bio-velvet_underground 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.gitmodules +3 -0
- data/.travis.yml +13 -0
- data/Gemfile +19 -0
- data/LICENSE.txt +20 -0
- data/README.md +53 -0
- data/Rakefile +51 -0
- data/VERSION +1 -0
- data/ext/bioruby.patch +60 -0
- data/ext/mkrf_conf.rb +50 -0
- data/ext/src/Makefile +125 -0
- data/ext/src/src/allocArray.c +305 -0
- data/ext/src/src/allocArray.h +86 -0
- data/ext/src/src/autoOpen.c +107 -0
- data/ext/src/src/autoOpen.h +18 -0
- data/ext/src/src/binarySequences.c +813 -0
- data/ext/src/src/binarySequences.h +125 -0
- data/ext/src/src/concatenatedGraph.c +233 -0
- data/ext/src/src/concatenatedGraph.h +30 -0
- data/ext/src/src/concatenatedPreGraph.c +262 -0
- data/ext/src/src/concatenatedPreGraph.h +29 -0
- data/ext/src/src/correctedGraph.c +2642 -0
- data/ext/src/src/correctedGraph.h +32 -0
- data/ext/src/src/dfib.c +509 -0
- data/ext/src/src/dfib.h +69 -0
- data/ext/src/src/dfibHeap.c +89 -0
- data/ext/src/src/dfibHeap.h +39 -0
- data/ext/src/src/dfibpriv.h +105 -0
- data/ext/src/src/fib.c +628 -0
- data/ext/src/src/fib.h +78 -0
- data/ext/src/src/fibHeap.c +79 -0
- data/ext/src/src/fibHeap.h +41 -0
- data/ext/src/src/fibpriv.h +110 -0
- data/ext/src/src/globals.h +153 -0
- data/ext/src/src/graph.c +3983 -0
- data/ext/src/src/graph.h +233 -0
- data/ext/src/src/graphReConstruction.c +1472 -0
- data/ext/src/src/graphReConstruction.h +30 -0
- data/ext/src/src/graphStats.c +2167 -0
- data/ext/src/src/graphStats.h +72 -0
- data/ext/src/src/kmer.c +652 -0
- data/ext/src/src/kmer.h +73 -0
- data/ext/src/src/kmerOccurenceTable.c +236 -0
- data/ext/src/src/kmerOccurenceTable.h +44 -0
- data/ext/src/src/kseq.h +223 -0
- data/ext/src/src/locallyCorrectedGraph.c +557 -0
- data/ext/src/src/locallyCorrectedGraph.h +40 -0
- data/ext/src/src/passageMarker.c +677 -0
- data/ext/src/src/passageMarker.h +137 -0
- data/ext/src/src/preGraph.c +1717 -0
- data/ext/src/src/preGraph.h +106 -0
- data/ext/src/src/preGraphConstruction.c +990 -0
- data/ext/src/src/preGraphConstruction.h +26 -0
- data/ext/src/src/readCoherentGraph.c +557 -0
- data/ext/src/src/readCoherentGraph.h +30 -0
- data/ext/src/src/readSet.c +1734 -0
- data/ext/src/src/readSet.h +67 -0
- data/ext/src/src/recycleBin.c +199 -0
- data/ext/src/src/recycleBin.h +58 -0
- data/ext/src/src/roadMap.c +342 -0
- data/ext/src/src/roadMap.h +65 -0
- data/ext/src/src/run.c +318 -0
- data/ext/src/src/run.h +52 -0
- data/ext/src/src/run2.c +712 -0
- data/ext/src/src/scaffold.c +1876 -0
- data/ext/src/src/scaffold.h +64 -0
- data/ext/src/src/shortReadPairs.c +1243 -0
- data/ext/src/src/shortReadPairs.h +32 -0
- data/ext/src/src/splay.c +259 -0
- data/ext/src/src/splay.h +43 -0
- data/ext/src/src/splayTable.c +1315 -0
- data/ext/src/src/splayTable.h +31 -0
- data/ext/src/src/tightString.c +362 -0
- data/ext/src/src/tightString.h +82 -0
- data/ext/src/src/utility.c +199 -0
- data/ext/src/src/utility.h +98 -0
- data/ext/src/third-party/zlib-1.2.3/ChangeLog +855 -0
- data/ext/src/third-party/zlib-1.2.3/FAQ +339 -0
- data/ext/src/third-party/zlib-1.2.3/INDEX +51 -0
- data/ext/src/third-party/zlib-1.2.3/Makefile +154 -0
- data/ext/src/third-party/zlib-1.2.3/Makefile.in +154 -0
- data/ext/src/third-party/zlib-1.2.3/README +125 -0
- data/ext/src/third-party/zlib-1.2.3/adler32.c +149 -0
- data/ext/src/third-party/zlib-1.2.3/algorithm.txt +209 -0
- data/ext/src/third-party/zlib-1.2.3/amiga/Makefile.pup +66 -0
- data/ext/src/third-party/zlib-1.2.3/amiga/Makefile.sas +65 -0
- data/ext/src/third-party/zlib-1.2.3/as400/bndsrc +132 -0
- data/ext/src/third-party/zlib-1.2.3/as400/compile.clp +123 -0
- data/ext/src/third-party/zlib-1.2.3/as400/readme.txt +111 -0
- data/ext/src/third-party/zlib-1.2.3/as400/zlib.inc +331 -0
- data/ext/src/third-party/zlib-1.2.3/compress.c +79 -0
- data/ext/src/third-party/zlib-1.2.3/configure +459 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/README.contrib +71 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/buffer_demo.adb +106 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/mtest.adb +156 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/read.adb +156 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/readme.txt +65 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/test.adb +463 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/zlib-streams.adb +225 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/zlib-streams.ads +114 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/zlib-thin.adb +141 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/zlib-thin.ads +450 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/zlib.adb +701 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/zlib.ads +328 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/zlib.gpr +20 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/asm586/README.586 +43 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/asm586/match.S +364 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/asm686/README.686 +34 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/asm686/match.S +329 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/blast/Makefile +8 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/blast/README +4 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/blast/blast.c +444 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/blast/blast.h +71 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/blast/test.pk +0 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/blast/test.txt +1 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/delphi/ZLib.pas +557 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/delphi/ZLibConst.pas +11 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/delphi/readme.txt +76 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/delphi/zlibd32.mak +93 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib.build +33 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib.chm +0 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib.sln +21 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/AssemblyInfo.cs +58 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/ChecksumImpl.cs +202 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/CircularBuffer.cs +83 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/CodecBase.cs +198 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/Deflater.cs +106 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/DotZLib.cs +288 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/DotZLib.csproj +141 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/GZipStream.cs +301 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/Inflater.cs +105 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/UnitTests.cs +274 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/LICENSE_1_0.txt +23 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/readme.txt +58 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/infback9/README +1 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/infback9/infback9.c +608 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/infback9/infback9.h +37 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/infback9/inffix9.h +107 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/infback9/inflate9.h +47 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/infback9/inftree9.c +323 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/infback9/inftree9.h +55 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/inflate86/inffas86.c +1157 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/inflate86/inffast.S +1368 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream/test.cpp +24 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream/zfstream.cpp +329 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream/zfstream.h +128 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream2/zstream.h +307 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream2/zstream_test.cpp +25 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream3/README +35 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream3/TODO +17 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream3/test.cc +50 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream3/zfstream.cc +479 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream3/zfstream.h +466 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masm686/match.asm +413 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx64/bld_ml64.bat +2 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx64/gvmat64.asm +513 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx64/gvmat64.obj +0 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx64/inffas8664.c +186 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx64/inffasx64.asm +392 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx64/inffasx64.obj +0 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx64/readme.txt +28 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx86/bld_ml32.bat +2 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx86/gvmat32.asm +972 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx86/gvmat32.obj +0 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx86/gvmat32c.c +62 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx86/inffas32.asm +1083 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx86/inffas32.obj +0 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx86/mkasm.bat +3 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx86/readme.txt +21 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/ChangeLogUnzip +67 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/Makefile +25 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/crypt.h +132 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/ioapi.c +177 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/ioapi.h +75 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/iowin32.c +270 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/iowin32.h +21 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/miniunz.c +585 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/minizip.c +420 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/mztools.c +281 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/mztools.h +31 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/unzip.c +1598 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/unzip.h +354 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/zip.c +1219 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/zip.h +235 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/pascal/example.pas +599 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/pascal/readme.txt +76 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/pascal/zlibd32.mak +93 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/pascal/zlibpas.pas +236 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/puff/Makefile +8 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/puff/README +63 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/puff/puff.c +837 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/puff/puff.h +31 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/puff/zeros.raw +0 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/testzlib/testzlib.c +275 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/testzlib/testzlib.txt +10 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/untgz/Makefile +14 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/untgz/Makefile.msc +17 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/untgz/untgz.c +674 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/readme.txt +73 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc7/miniunz.vcproj +126 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc7/minizip.vcproj +126 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc7/testzlib.vcproj +126 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc7/zlib.rc +32 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc7/zlibstat.vcproj +246 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc7/zlibvc.def +92 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc7/zlibvc.sln +78 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc7/zlibvc.vcproj +445 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/miniunz.vcproj +566 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/minizip.vcproj +563 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/testzlib.vcproj +948 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/testzlibdll.vcproj +567 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/zlib.rc +32 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/zlibstat.vcproj +870 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/zlibvc.def +92 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/zlibvc.sln +144 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/zlibvc.vcproj +1219 -0
- data/ext/src/third-party/zlib-1.2.3/crc32.c +423 -0
- data/ext/src/third-party/zlib-1.2.3/crc32.h +441 -0
- data/ext/src/third-party/zlib-1.2.3/deflate.c +1736 -0
- data/ext/src/third-party/zlib-1.2.3/deflate.h +331 -0
- data/ext/src/third-party/zlib-1.2.3/example.c +565 -0
- data/ext/src/third-party/zlib-1.2.3/examples/README.examples +42 -0
- data/ext/src/third-party/zlib-1.2.3/examples/fitblk.c +233 -0
- data/ext/src/third-party/zlib-1.2.3/examples/gun.c +693 -0
- data/ext/src/third-party/zlib-1.2.3/examples/gzappend.c +500 -0
- data/ext/src/third-party/zlib-1.2.3/examples/gzjoin.c +448 -0
- data/ext/src/third-party/zlib-1.2.3/examples/gzlog.c +413 -0
- data/ext/src/third-party/zlib-1.2.3/examples/gzlog.h +58 -0
- data/ext/src/third-party/zlib-1.2.3/examples/zlib_how.html +523 -0
- data/ext/src/third-party/zlib-1.2.3/examples/zpipe.c +191 -0
- data/ext/src/third-party/zlib-1.2.3/examples/zran.c +404 -0
- data/ext/src/third-party/zlib-1.2.3/gzio.c +1026 -0
- data/ext/src/third-party/zlib-1.2.3/infback.c +623 -0
- data/ext/src/third-party/zlib-1.2.3/inffast.c +318 -0
- data/ext/src/third-party/zlib-1.2.3/inffast.h +11 -0
- data/ext/src/third-party/zlib-1.2.3/inffixed.h +94 -0
- data/ext/src/third-party/zlib-1.2.3/inflate.c +1368 -0
- data/ext/src/third-party/zlib-1.2.3/inflate.h +115 -0
- data/ext/src/third-party/zlib-1.2.3/inftrees.c +329 -0
- data/ext/src/third-party/zlib-1.2.3/inftrees.h +55 -0
- data/ext/src/third-party/zlib-1.2.3/make_vms.com +461 -0
- data/ext/src/third-party/zlib-1.2.3/minigzip.c +322 -0
- data/ext/src/third-party/zlib-1.2.3/msdos/Makefile.bor +109 -0
- data/ext/src/third-party/zlib-1.2.3/msdos/Makefile.dj2 +104 -0
- data/ext/src/third-party/zlib-1.2.3/msdos/Makefile.emx +69 -0
- data/ext/src/third-party/zlib-1.2.3/msdos/Makefile.msc +106 -0
- data/ext/src/third-party/zlib-1.2.3/msdos/Makefile.tc +94 -0
- data/ext/src/third-party/zlib-1.2.3/old/Makefile.riscos +151 -0
- data/ext/src/third-party/zlib-1.2.3/old/README +3 -0
- data/ext/src/third-party/zlib-1.2.3/old/descrip.mms +48 -0
- data/ext/src/third-party/zlib-1.2.3/old/os2/Makefile.os2 +136 -0
- data/ext/src/third-party/zlib-1.2.3/old/os2/zlib.def +51 -0
- data/ext/src/third-party/zlib-1.2.3/old/visual-basic.txt +160 -0
- data/ext/src/third-party/zlib-1.2.3/old/zlib.html +971 -0
- data/ext/src/third-party/zlib-1.2.3/projects/README.projects +41 -0
- data/ext/src/third-party/zlib-1.2.3/projects/visualc6/README.txt +73 -0
- data/ext/src/third-party/zlib-1.2.3/projects/visualc6/example.dsp +278 -0
- data/ext/src/third-party/zlib-1.2.3/projects/visualc6/minigzip.dsp +278 -0
- data/ext/src/third-party/zlib-1.2.3/projects/visualc6/zlib.dsp +609 -0
- data/ext/src/third-party/zlib-1.2.3/projects/visualc6/zlib.dsw +59 -0
- data/ext/src/third-party/zlib-1.2.3/qnx/package.qpg +141 -0
- data/ext/src/third-party/zlib-1.2.3/trees.c +1219 -0
- data/ext/src/third-party/zlib-1.2.3/trees.h +128 -0
- data/ext/src/third-party/zlib-1.2.3/uncompr.c +61 -0
- data/ext/src/third-party/zlib-1.2.3/win32/DLL_FAQ.txt +397 -0
- data/ext/src/third-party/zlib-1.2.3/win32/Makefile.bor +107 -0
- data/ext/src/third-party/zlib-1.2.3/win32/Makefile.emx +69 -0
- data/ext/src/third-party/zlib-1.2.3/win32/Makefile.gcc +141 -0
- data/ext/src/third-party/zlib-1.2.3/win32/Makefile.msc +126 -0
- data/ext/src/third-party/zlib-1.2.3/win32/VisualC.txt +3 -0
- data/ext/src/third-party/zlib-1.2.3/win32/zlib.def +60 -0
- data/ext/src/third-party/zlib-1.2.3/win32/zlib1.rc +39 -0
- data/ext/src/third-party/zlib-1.2.3/zconf.h +332 -0
- data/ext/src/third-party/zlib-1.2.3/zconf.in.h +332 -0
- data/ext/src/third-party/zlib-1.2.3/zlib.3 +159 -0
- data/ext/src/third-party/zlib-1.2.3/zlib.h +1357 -0
- data/ext/src/third-party/zlib-1.2.3/zutil.c +318 -0
- data/ext/src/third-party/zlib-1.2.3/zutil.h +269 -0
- data/lib/bio-velvet_underground.rb +12 -0
- data/lib/bio-velvet_underground/external/VERSION +1 -0
- data/lib/bio-velvet_underground/velvet_underground.rb +72 -0
- data/spec/binary_sequence_store_spec.rb +27 -0
- data/spec/data/1/CnyUnifiedSeq +0 -0
- data/spec/spec_helper.rb +31 -0
- metadata +456 -0
Binary file
|
@@ -0,0 +1,186 @@
|
|
1
|
+
/* inffas8664.c is a hand tuned assembler version of inffast.c - fast decoding
|
2
|
+
* version for AMD64 on Windows using Microsoft C compiler
|
3
|
+
*
|
4
|
+
* Copyright (C) 1995-2003 Mark Adler
|
5
|
+
* For conditions of distribution and use, see copyright notice in zlib.h
|
6
|
+
*
|
7
|
+
* Copyright (C) 2003 Chris Anderson <christop@charm.net>
|
8
|
+
* Please use the copyright conditions above.
|
9
|
+
*
|
10
|
+
* 2005 - Adaptation to Microsoft C Compiler for AMD64 by Gilles Vollant
|
11
|
+
*
|
12
|
+
* inffas8664.c call function inffas8664fnc in inffasx64.asm
|
13
|
+
* inffasx64.asm is automatically convert from AMD64 portion of inffas86.c
|
14
|
+
*
|
15
|
+
* Dec-29-2003 -- I added AMD64 inflate asm support. This version is also
|
16
|
+
* slightly quicker on x86 systems because, instead of using rep movsb to copy
|
17
|
+
* data, it uses rep movsw, which moves data in 2-byte chunks instead of single
|
18
|
+
* bytes. I've tested the AMD64 code on a Fedora Core 1 + the x86_64 updates
|
19
|
+
* from http://fedora.linux.duke.edu/fc1_x86_64
|
20
|
+
* which is running on an Athlon 64 3000+ / Gigabyte GA-K8VT800M system with
|
21
|
+
* 1GB ram. The 64-bit version is about 4% faster than the 32-bit version,
|
22
|
+
* when decompressing mozilla-source-1.3.tar.gz.
|
23
|
+
*
|
24
|
+
* Mar-13-2003 -- Most of this is derived from inffast.S which is derived from
|
25
|
+
* the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at
|
26
|
+
* the moment. I have successfully compiled and tested this code with gcc2.96,
|
27
|
+
* gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S
|
28
|
+
* compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX
|
29
|
+
* enabled. I will attempt to merge the MMX code into this version. Newer
|
30
|
+
* versions of this and inffast.S can be found at
|
31
|
+
* http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/
|
32
|
+
*
|
33
|
+
*/
|
34
|
+
|
35
|
+
#include <stdio.h>
|
36
|
+
#include "zutil.h"
|
37
|
+
#include "inftrees.h"
|
38
|
+
#include "inflate.h"
|
39
|
+
#include "inffast.h"
|
40
|
+
|
41
|
+
/* Mark Adler's comments from inffast.c: */
|
42
|
+
|
43
|
+
/*
|
44
|
+
Decode literal, length, and distance codes and write out the resulting
|
45
|
+
literal and match bytes until either not enough input or output is
|
46
|
+
available, an end-of-block is encountered, or a data error is encountered.
|
47
|
+
When large enough input and output buffers are supplied to inflate(), for
|
48
|
+
example, a 16K input buffer and a 64K output buffer, more than 95% of the
|
49
|
+
inflate execution time is spent in this routine.
|
50
|
+
|
51
|
+
Entry assumptions:
|
52
|
+
|
53
|
+
state->mode == LEN
|
54
|
+
strm->avail_in >= 6
|
55
|
+
strm->avail_out >= 258
|
56
|
+
start >= strm->avail_out
|
57
|
+
state->bits < 8
|
58
|
+
|
59
|
+
On return, state->mode is one of:
|
60
|
+
|
61
|
+
LEN -- ran out of enough output space or enough available input
|
62
|
+
TYPE -- reached end of block code, inflate() to interpret next block
|
63
|
+
BAD -- error in block data
|
64
|
+
|
65
|
+
Notes:
|
66
|
+
|
67
|
+
- The maximum input bits used by a length/distance pair is 15 bits for the
|
68
|
+
length code, 5 bits for the length extra, 15 bits for the distance code,
|
69
|
+
and 13 bits for the distance extra. This totals 48 bits, or six bytes.
|
70
|
+
Therefore if strm->avail_in >= 6, then there is enough input to avoid
|
71
|
+
checking for available input while decoding.
|
72
|
+
|
73
|
+
- The maximum bytes that a single length/distance pair can output is 258
|
74
|
+
bytes, which is the maximum length that can be coded. inflate_fast()
|
75
|
+
requires strm->avail_out >= 258 for each loop to avoid checking for
|
76
|
+
output space.
|
77
|
+
*/
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
typedef struct inffast_ar {
|
82
|
+
/* 64 32 x86 x86_64 */
|
83
|
+
/* ar offset register */
|
84
|
+
/* 0 0 */ void *esp; /* esp save */
|
85
|
+
/* 8 4 */ void *ebp; /* ebp save */
|
86
|
+
/* 16 8 */ unsigned char FAR *in; /* esi rsi local strm->next_in */
|
87
|
+
/* 24 12 */ unsigned char FAR *last; /* r9 while in < last */
|
88
|
+
/* 32 16 */ unsigned char FAR *out; /* edi rdi local strm->next_out */
|
89
|
+
/* 40 20 */ unsigned char FAR *beg; /* inflate()'s init next_out */
|
90
|
+
/* 48 24 */ unsigned char FAR *end; /* r10 while out < end */
|
91
|
+
/* 56 28 */ unsigned char FAR *window;/* size of window, wsize!=0 */
|
92
|
+
/* 64 32 */ code const FAR *lcode; /* ebp rbp local strm->lencode */
|
93
|
+
/* 72 36 */ code const FAR *dcode; /* r11 local strm->distcode */
|
94
|
+
/* 80 40 */ size_t /*unsigned long */hold; /* edx rdx local strm->hold */
|
95
|
+
/* 88 44 */ unsigned bits; /* ebx rbx local strm->bits */
|
96
|
+
/* 92 48 */ unsigned wsize; /* window size */
|
97
|
+
/* 96 52 */ unsigned write; /* window write index */
|
98
|
+
/*100 56 */ unsigned lmask; /* r12 mask for lcode */
|
99
|
+
/*104 60 */ unsigned dmask; /* r13 mask for dcode */
|
100
|
+
/*108 64 */ unsigned len; /* r14 match length */
|
101
|
+
/*112 68 */ unsigned dist; /* r15 match distance */
|
102
|
+
/*116 72 */ unsigned status; /* set when state chng*/
|
103
|
+
} type_ar;
|
104
|
+
#ifdef ASMINF
|
105
|
+
|
106
|
+
void inflate_fast(strm, start)
|
107
|
+
z_streamp strm;
|
108
|
+
unsigned start; /* inflate()'s starting value for strm->avail_out */
|
109
|
+
{
|
110
|
+
struct inflate_state FAR *state;
|
111
|
+
type_ar ar;
|
112
|
+
void inffas8664fnc(struct inffast_ar * par);
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
#if (defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 )) || (defined(_MSC_VER) && defined(_M_AMD64))
|
117
|
+
#define PAD_AVAIL_IN 6
|
118
|
+
#define PAD_AVAIL_OUT 258
|
119
|
+
#else
|
120
|
+
#define PAD_AVAIL_IN 5
|
121
|
+
#define PAD_AVAIL_OUT 257
|
122
|
+
#endif
|
123
|
+
|
124
|
+
/* copy state to local variables */
|
125
|
+
state = (struct inflate_state FAR *)strm->state;
|
126
|
+
|
127
|
+
ar.in = strm->next_in;
|
128
|
+
ar.last = ar.in + (strm->avail_in - PAD_AVAIL_IN);
|
129
|
+
ar.out = strm->next_out;
|
130
|
+
ar.beg = ar.out - (start - strm->avail_out);
|
131
|
+
ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT);
|
132
|
+
ar.wsize = state->wsize;
|
133
|
+
ar.write = state->write;
|
134
|
+
ar.window = state->window;
|
135
|
+
ar.hold = state->hold;
|
136
|
+
ar.bits = state->bits;
|
137
|
+
ar.lcode = state->lencode;
|
138
|
+
ar.dcode = state->distcode;
|
139
|
+
ar.lmask = (1U << state->lenbits) - 1;
|
140
|
+
ar.dmask = (1U << state->distbits) - 1;
|
141
|
+
|
142
|
+
/* decode literals and length/distances until end-of-block or not enough
|
143
|
+
input data or output space */
|
144
|
+
|
145
|
+
/* align in on 1/2 hold size boundary */
|
146
|
+
while (((size_t)(void *)ar.in & (sizeof(ar.hold) / 2 - 1)) != 0) {
|
147
|
+
ar.hold += (unsigned long)*ar.in++ << ar.bits;
|
148
|
+
ar.bits += 8;
|
149
|
+
}
|
150
|
+
|
151
|
+
inffas8664fnc(&ar);
|
152
|
+
|
153
|
+
if (ar.status > 1) {
|
154
|
+
if (ar.status == 2)
|
155
|
+
strm->msg = "invalid literal/length code";
|
156
|
+
else if (ar.status == 3)
|
157
|
+
strm->msg = "invalid distance code";
|
158
|
+
else
|
159
|
+
strm->msg = "invalid distance too far back";
|
160
|
+
state->mode = BAD;
|
161
|
+
}
|
162
|
+
else if ( ar.status == 1 ) {
|
163
|
+
state->mode = TYPE;
|
164
|
+
}
|
165
|
+
|
166
|
+
/* return unused bytes (on entry, bits < 8, so in won't go too far back) */
|
167
|
+
ar.len = ar.bits >> 3;
|
168
|
+
ar.in -= ar.len;
|
169
|
+
ar.bits -= ar.len << 3;
|
170
|
+
ar.hold &= (1U << ar.bits) - 1;
|
171
|
+
|
172
|
+
/* update state and return */
|
173
|
+
strm->next_in = ar.in;
|
174
|
+
strm->next_out = ar.out;
|
175
|
+
strm->avail_in = (unsigned)(ar.in < ar.last ?
|
176
|
+
PAD_AVAIL_IN + (ar.last - ar.in) :
|
177
|
+
PAD_AVAIL_IN - (ar.in - ar.last));
|
178
|
+
strm->avail_out = (unsigned)(ar.out < ar.end ?
|
179
|
+
PAD_AVAIL_OUT + (ar.end - ar.out) :
|
180
|
+
PAD_AVAIL_OUT - (ar.out - ar.end));
|
181
|
+
state->hold = (unsigned long)ar.hold;
|
182
|
+
state->bits = ar.bits;
|
183
|
+
return;
|
184
|
+
}
|
185
|
+
|
186
|
+
#endif
|
@@ -0,0 +1,392 @@
|
|
1
|
+
; inffasx64.asm is a hand tuned assembler version of inffast.c - fast decoding
|
2
|
+
; version for AMD64 on Windows using Microsoft C compiler
|
3
|
+
;
|
4
|
+
; inffasx64.asm is automatically convert from AMD64 portion of inffas86.c
|
5
|
+
; inffasx64.asm is called by inffas8664.c, which contain more info.
|
6
|
+
|
7
|
+
|
8
|
+
; to compile this file, I use option
|
9
|
+
; ml64.exe /Flinffasx64 /c /Zi inffasx64.asm
|
10
|
+
; with Microsoft Macro Assembler (x64) for AMD64
|
11
|
+
;
|
12
|
+
; ml64.exe is given with Visual Studio 2005, Windows 2003 server DDK
|
13
|
+
;
|
14
|
+
; (you can get Windows 2003 server DDK with ml64 and cl.exe for AMD64 from
|
15
|
+
; http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price)
|
16
|
+
;
|
17
|
+
|
18
|
+
.code
|
19
|
+
inffas8664fnc PROC
|
20
|
+
|
21
|
+
; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and
|
22
|
+
; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp
|
23
|
+
;
|
24
|
+
; All registers must be preserved across the call, except for
|
25
|
+
; rax, rcx, rdx, r8, r-9, r10, and r11, which are scratch.
|
26
|
+
|
27
|
+
|
28
|
+
mov [rsp-8],rsi
|
29
|
+
mov [rsp-16],rdi
|
30
|
+
mov [rsp-24],r12
|
31
|
+
mov [rsp-32],r13
|
32
|
+
mov [rsp-40],r14
|
33
|
+
mov [rsp-48],r15
|
34
|
+
mov [rsp-56],rbx
|
35
|
+
|
36
|
+
mov rax,rcx
|
37
|
+
|
38
|
+
mov [rax+8], rbp ; /* save regs rbp and rsp */
|
39
|
+
mov [rax], rsp
|
40
|
+
|
41
|
+
mov rsp, rax ; /* make rsp point to &ar */
|
42
|
+
|
43
|
+
mov rsi, [rsp+16] ; /* rsi = in */
|
44
|
+
mov rdi, [rsp+32] ; /* rdi = out */
|
45
|
+
mov r9, [rsp+24] ; /* r9 = last */
|
46
|
+
mov r10, [rsp+48] ; /* r10 = end */
|
47
|
+
mov rbp, [rsp+64] ; /* rbp = lcode */
|
48
|
+
mov r11, [rsp+72] ; /* r11 = dcode */
|
49
|
+
mov rdx, [rsp+80] ; /* rdx = hold */
|
50
|
+
mov ebx, [rsp+88] ; /* ebx = bits */
|
51
|
+
mov r12d, [rsp+100] ; /* r12d = lmask */
|
52
|
+
mov r13d, [rsp+104] ; /* r13d = dmask */
|
53
|
+
; /* r14d = len */
|
54
|
+
; /* r15d = dist */
|
55
|
+
|
56
|
+
|
57
|
+
cld
|
58
|
+
cmp r10, rdi
|
59
|
+
je L_one_time ; /* if only one decode left */
|
60
|
+
cmp r9, rsi
|
61
|
+
|
62
|
+
jne L_do_loop
|
63
|
+
|
64
|
+
|
65
|
+
L_one_time:
|
66
|
+
mov r8, r12 ; /* r8 = lmask */
|
67
|
+
cmp bl, 32
|
68
|
+
ja L_get_length_code_one_time
|
69
|
+
|
70
|
+
lodsd ; /* eax = *(uint *)in++ */
|
71
|
+
mov cl, bl ; /* cl = bits, needs it for shifting */
|
72
|
+
add bl, 32 ; /* bits += 32 */
|
73
|
+
shl rax, cl
|
74
|
+
or rdx, rax ; /* hold |= *((uint *)in)++ << bits */
|
75
|
+
jmp L_get_length_code_one_time
|
76
|
+
|
77
|
+
ALIGN 4
|
78
|
+
L_while_test:
|
79
|
+
cmp r10, rdi
|
80
|
+
jbe L_break_loop
|
81
|
+
cmp r9, rsi
|
82
|
+
jbe L_break_loop
|
83
|
+
|
84
|
+
L_do_loop:
|
85
|
+
mov r8, r12 ; /* r8 = lmask */
|
86
|
+
cmp bl, 32
|
87
|
+
ja L_get_length_code ; /* if (32 < bits) */
|
88
|
+
|
89
|
+
lodsd ; /* eax = *(uint *)in++ */
|
90
|
+
mov cl, bl ; /* cl = bits, needs it for shifting */
|
91
|
+
add bl, 32 ; /* bits += 32 */
|
92
|
+
shl rax, cl
|
93
|
+
or rdx, rax ; /* hold |= *((uint *)in)++ << bits */
|
94
|
+
|
95
|
+
L_get_length_code:
|
96
|
+
and r8, rdx ; /* r8 &= hold */
|
97
|
+
mov eax, [rbp+r8*4] ; /* eax = lcode[hold & lmask] */
|
98
|
+
|
99
|
+
mov cl, ah ; /* cl = this.bits */
|
100
|
+
sub bl, ah ; /* bits -= this.bits */
|
101
|
+
shr rdx, cl ; /* hold >>= this.bits */
|
102
|
+
|
103
|
+
test al, al
|
104
|
+
jnz L_test_for_length_base ; /* if (op != 0) 45.7% */
|
105
|
+
|
106
|
+
mov r8, r12 ; /* r8 = lmask */
|
107
|
+
shr eax, 16 ; /* output this.val char */
|
108
|
+
stosb
|
109
|
+
|
110
|
+
L_get_length_code_one_time:
|
111
|
+
and r8, rdx ; /* r8 &= hold */
|
112
|
+
mov eax, [rbp+r8*4] ; /* eax = lcode[hold & lmask] */
|
113
|
+
|
114
|
+
L_dolen:
|
115
|
+
mov cl, ah ; /* cl = this.bits */
|
116
|
+
sub bl, ah ; /* bits -= this.bits */
|
117
|
+
shr rdx, cl ; /* hold >>= this.bits */
|
118
|
+
|
119
|
+
test al, al
|
120
|
+
jnz L_test_for_length_base ; /* if (op != 0) 45.7% */
|
121
|
+
|
122
|
+
shr eax, 16 ; /* output this.val char */
|
123
|
+
stosb
|
124
|
+
jmp L_while_test
|
125
|
+
|
126
|
+
ALIGN 4
|
127
|
+
L_test_for_length_base:
|
128
|
+
mov r14d, eax ; /* len = this */
|
129
|
+
shr r14d, 16 ; /* len = this.val */
|
130
|
+
mov cl, al
|
131
|
+
|
132
|
+
test al, 16
|
133
|
+
jz L_test_for_second_level_length ; /* if ((op & 16) == 0) 8% */
|
134
|
+
and cl, 15 ; /* op &= 15 */
|
135
|
+
jz L_decode_distance ; /* if (!op) */
|
136
|
+
|
137
|
+
L_add_bits_to_len:
|
138
|
+
sub bl, cl
|
139
|
+
xor eax, eax
|
140
|
+
inc eax
|
141
|
+
shl eax, cl
|
142
|
+
dec eax
|
143
|
+
and eax, edx ; /* eax &= hold */
|
144
|
+
shr rdx, cl
|
145
|
+
add r14d, eax ; /* len += hold & mask[op] */
|
146
|
+
|
147
|
+
L_decode_distance:
|
148
|
+
mov r8, r13 ; /* r8 = dmask */
|
149
|
+
cmp bl, 32
|
150
|
+
ja L_get_distance_code ; /* if (32 < bits) */
|
151
|
+
|
152
|
+
lodsd ; /* eax = *(uint *)in++ */
|
153
|
+
mov cl, bl ; /* cl = bits, needs it for shifting */
|
154
|
+
add bl, 32 ; /* bits += 32 */
|
155
|
+
shl rax, cl
|
156
|
+
or rdx, rax ; /* hold |= *((uint *)in)++ << bits */
|
157
|
+
|
158
|
+
L_get_distance_code:
|
159
|
+
and r8, rdx ; /* r8 &= hold */
|
160
|
+
mov eax, [r11+r8*4] ; /* eax = dcode[hold & dmask] */
|
161
|
+
|
162
|
+
L_dodist:
|
163
|
+
mov r15d, eax ; /* dist = this */
|
164
|
+
shr r15d, 16 ; /* dist = this.val */
|
165
|
+
mov cl, ah
|
166
|
+
sub bl, ah ; /* bits -= this.bits */
|
167
|
+
shr rdx, cl ; /* hold >>= this.bits */
|
168
|
+
mov cl, al ; /* cl = this.op */
|
169
|
+
|
170
|
+
test al, 16 ; /* if ((op & 16) == 0) */
|
171
|
+
jz L_test_for_second_level_dist
|
172
|
+
and cl, 15 ; /* op &= 15 */
|
173
|
+
jz L_check_dist_one
|
174
|
+
|
175
|
+
L_add_bits_to_dist:
|
176
|
+
sub bl, cl
|
177
|
+
xor eax, eax
|
178
|
+
inc eax
|
179
|
+
shl eax, cl
|
180
|
+
dec eax ; /* (1 << op) - 1 */
|
181
|
+
and eax, edx ; /* eax &= hold */
|
182
|
+
shr rdx, cl
|
183
|
+
add r15d, eax ; /* dist += hold & ((1 << op) - 1) */
|
184
|
+
|
185
|
+
L_check_window:
|
186
|
+
mov r8, rsi ; /* save in so from can use it's reg */
|
187
|
+
mov rax, rdi
|
188
|
+
sub rax, [rsp+40] ; /* nbytes = out - beg */
|
189
|
+
|
190
|
+
cmp eax, r15d
|
191
|
+
jb L_clip_window ; /* if (dist > nbytes) 4.2% */
|
192
|
+
|
193
|
+
mov ecx, r14d ; /* ecx = len */
|
194
|
+
mov rsi, rdi
|
195
|
+
sub rsi, r15 ; /* from = out - dist */
|
196
|
+
|
197
|
+
sar ecx, 1
|
198
|
+
jnc L_copy_two ; /* if len % 2 == 0 */
|
199
|
+
|
200
|
+
rep movsw
|
201
|
+
mov al, [rsi]
|
202
|
+
mov [rdi], al
|
203
|
+
inc rdi
|
204
|
+
|
205
|
+
mov rsi, r8 ; /* move in back to %rsi, toss from */
|
206
|
+
jmp L_while_test
|
207
|
+
|
208
|
+
L_copy_two:
|
209
|
+
rep movsw
|
210
|
+
mov rsi, r8 ; /* move in back to %rsi, toss from */
|
211
|
+
jmp L_while_test
|
212
|
+
|
213
|
+
ALIGN 4
|
214
|
+
L_check_dist_one:
|
215
|
+
cmp r15d, 1 ; /* if dist 1, is a memset */
|
216
|
+
jne L_check_window
|
217
|
+
cmp [rsp+40], rdi ; /* if out == beg, outside window */
|
218
|
+
je L_check_window
|
219
|
+
|
220
|
+
mov ecx, r14d ; /* ecx = len */
|
221
|
+
mov al, [rdi-1]
|
222
|
+
mov ah, al
|
223
|
+
|
224
|
+
sar ecx, 1
|
225
|
+
jnc L_set_two
|
226
|
+
mov [rdi], al
|
227
|
+
inc rdi
|
228
|
+
|
229
|
+
L_set_two:
|
230
|
+
rep stosw
|
231
|
+
jmp L_while_test
|
232
|
+
|
233
|
+
ALIGN 4
|
234
|
+
L_test_for_second_level_length:
|
235
|
+
test al, 64
|
236
|
+
jnz L_test_for_end_of_block ; /* if ((op & 64) != 0) */
|
237
|
+
|
238
|
+
xor eax, eax
|
239
|
+
inc eax
|
240
|
+
shl eax, cl
|
241
|
+
dec eax
|
242
|
+
and eax, edx ; /* eax &= hold */
|
243
|
+
add eax, r14d ; /* eax += len */
|
244
|
+
mov eax, [rbp+rax*4] ; /* eax = lcode[val+(hold&mask[op])]*/
|
245
|
+
jmp L_dolen
|
246
|
+
|
247
|
+
ALIGN 4
|
248
|
+
L_test_for_second_level_dist:
|
249
|
+
test al, 64
|
250
|
+
jnz L_invalid_distance_code ; /* if ((op & 64) != 0) */
|
251
|
+
|
252
|
+
xor eax, eax
|
253
|
+
inc eax
|
254
|
+
shl eax, cl
|
255
|
+
dec eax
|
256
|
+
and eax, edx ; /* eax &= hold */
|
257
|
+
add eax, r15d ; /* eax += dist */
|
258
|
+
mov eax, [r11+rax*4] ; /* eax = dcode[val+(hold&mask[op])]*/
|
259
|
+
jmp L_dodist
|
260
|
+
|
261
|
+
ALIGN 4
|
262
|
+
L_clip_window:
|
263
|
+
mov ecx, eax ; /* ecx = nbytes */
|
264
|
+
mov eax, [rsp+92] ; /* eax = wsize, prepare for dist cmp */
|
265
|
+
neg ecx ; /* nbytes = -nbytes */
|
266
|
+
|
267
|
+
cmp eax, r15d
|
268
|
+
jb L_invalid_distance_too_far ; /* if (dist > wsize) */
|
269
|
+
|
270
|
+
add ecx, r15d ; /* nbytes = dist - nbytes */
|
271
|
+
cmp dword ptr [rsp+96], 0
|
272
|
+
jne L_wrap_around_window ; /* if (write != 0) */
|
273
|
+
|
274
|
+
mov rsi, [rsp+56] ; /* from = window */
|
275
|
+
sub eax, ecx ; /* eax -= nbytes */
|
276
|
+
add rsi, rax ; /* from += wsize - nbytes */
|
277
|
+
|
278
|
+
mov eax, r14d ; /* eax = len */
|
279
|
+
cmp r14d, ecx
|
280
|
+
jbe L_do_copy ; /* if (nbytes >= len) */
|
281
|
+
|
282
|
+
sub eax, ecx ; /* eax -= nbytes */
|
283
|
+
rep movsb
|
284
|
+
mov rsi, rdi
|
285
|
+
sub rsi, r15 ; /* from = &out[ -dist ] */
|
286
|
+
jmp L_do_copy
|
287
|
+
|
288
|
+
ALIGN 4
|
289
|
+
L_wrap_around_window:
|
290
|
+
mov eax, [rsp+96] ; /* eax = write */
|
291
|
+
cmp ecx, eax
|
292
|
+
jbe L_contiguous_in_window ; /* if (write >= nbytes) */
|
293
|
+
|
294
|
+
mov esi, [rsp+92] ; /* from = wsize */
|
295
|
+
add rsi, [rsp+56] ; /* from += window */
|
296
|
+
add rsi, rax ; /* from += write */
|
297
|
+
sub rsi, rcx ; /* from -= nbytes */
|
298
|
+
sub ecx, eax ; /* nbytes -= write */
|
299
|
+
|
300
|
+
mov eax, r14d ; /* eax = len */
|
301
|
+
cmp eax, ecx
|
302
|
+
jbe L_do_copy ; /* if (nbytes >= len) */
|
303
|
+
|
304
|
+
sub eax, ecx ; /* len -= nbytes */
|
305
|
+
rep movsb
|
306
|
+
mov rsi, [rsp+56] ; /* from = window */
|
307
|
+
mov ecx, [rsp+96] ; /* nbytes = write */
|
308
|
+
cmp eax, ecx
|
309
|
+
jbe L_do_copy ; /* if (nbytes >= len) */
|
310
|
+
|
311
|
+
sub eax, ecx ; /* len -= nbytes */
|
312
|
+
rep movsb
|
313
|
+
mov rsi, rdi
|
314
|
+
sub rsi, r15 ; /* from = out - dist */
|
315
|
+
jmp L_do_copy
|
316
|
+
|
317
|
+
ALIGN 4
|
318
|
+
L_contiguous_in_window:
|
319
|
+
mov rsi, [rsp+56] ; /* rsi = window */
|
320
|
+
add rsi, rax
|
321
|
+
sub rsi, rcx ; /* from += write - nbytes */
|
322
|
+
|
323
|
+
mov eax, r14d ; /* eax = len */
|
324
|
+
cmp eax, ecx
|
325
|
+
jbe L_do_copy ; /* if (nbytes >= len) */
|
326
|
+
|
327
|
+
sub eax, ecx ; /* len -= nbytes */
|
328
|
+
rep movsb
|
329
|
+
mov rsi, rdi
|
330
|
+
sub rsi, r15 ; /* from = out - dist */
|
331
|
+
jmp L_do_copy ; /* if (nbytes >= len) */
|
332
|
+
|
333
|
+
ALIGN 4
|
334
|
+
L_do_copy:
|
335
|
+
mov ecx, eax ; /* ecx = len */
|
336
|
+
rep movsb
|
337
|
+
|
338
|
+
mov rsi, r8 ; /* move in back to %esi, toss from */
|
339
|
+
jmp L_while_test
|
340
|
+
|
341
|
+
L_test_for_end_of_block:
|
342
|
+
test al, 32
|
343
|
+
jz L_invalid_literal_length_code
|
344
|
+
mov dword ptr [rsp+116], 1
|
345
|
+
jmp L_break_loop_with_status
|
346
|
+
|
347
|
+
L_invalid_literal_length_code:
|
348
|
+
mov dword ptr [rsp+116], 2
|
349
|
+
jmp L_break_loop_with_status
|
350
|
+
|
351
|
+
L_invalid_distance_code:
|
352
|
+
mov dword ptr [rsp+116], 3
|
353
|
+
jmp L_break_loop_with_status
|
354
|
+
|
355
|
+
L_invalid_distance_too_far:
|
356
|
+
mov dword ptr [rsp+116], 4
|
357
|
+
jmp L_break_loop_with_status
|
358
|
+
|
359
|
+
L_break_loop:
|
360
|
+
mov dword ptr [rsp+116], 0
|
361
|
+
|
362
|
+
L_break_loop_with_status:
|
363
|
+
; /* put in, out, bits, and hold back into ar and pop esp */
|
364
|
+
mov [rsp+16], rsi ; /* in */
|
365
|
+
mov [rsp+32], rdi ; /* out */
|
366
|
+
mov [rsp+88], ebx ; /* bits */
|
367
|
+
mov [rsp+80], rdx ; /* hold */
|
368
|
+
|
369
|
+
mov rax, [rsp] ; /* restore rbp and rsp */
|
370
|
+
mov rbp, [rsp+8]
|
371
|
+
mov rsp, rax
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
mov rsi,[rsp-8]
|
376
|
+
mov rdi,[rsp-16]
|
377
|
+
mov r12,[rsp-24]
|
378
|
+
mov r13,[rsp-32]
|
379
|
+
mov r14,[rsp-40]
|
380
|
+
mov r15,[rsp-48]
|
381
|
+
mov rbx,[rsp-56]
|
382
|
+
|
383
|
+
ret 0
|
384
|
+
; :
|
385
|
+
; : "m" (ar)
|
386
|
+
; : "memory", "%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi",
|
387
|
+
; "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
|
388
|
+
; );
|
389
|
+
|
390
|
+
inffas8664fnc ENDP
|
391
|
+
;_TEXT ENDS
|
392
|
+
END
|