LICENCE0000664000175000017500000000367414741067256011061 0ustar aniolaniolCopyright (c) 2004-2012, Aegisub Project 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. --- END AEGISUB LICENSE -- Any file that does not have a license in the header is covered by the above license with exception to any directories that contain a license file, or are covered by another license in the file itself. The following directories and file are covered by their respective licenses as follows: src/gl/ - MIT license. See src/gl/glext.h src/MatroskaParser.(c|h) - Licensed to BSDL with permission from the author. universalchardet/ - MPL 1.1 README.md0000664000175000017500000000734514741067256011352 0ustar aniolaniol# Aegisub For binaries and general information [see the homepage](http://aegisub.org). The bug tracker can be found at https://github.com/TypesettingTools/Aegisub/issues. Support is available on [Discord](https://discord.com/invite/AZaVyPr) or [IRC](irc://irc.rizon.net/aegisub). ## Building Aegisub ### Windows Prerequisites: 1. Visual Studio (Community edition of any recent version is fine, needs the Windows SDK included) 2. Python 3 3. Meson 4. CMake There are a few optional dependencies that must be installed and on your PATH: 1. msgfmt, to build the translations (installing from https://mlocati.github.io/articles/gettext-iconv-windows.html seems to be the easiest option) 2. InnoSetup, to build the regular installer (iscc.exe on your PATH) 3. 7zip, to build the regular installer (7z.exe on your PATH) 4. Moonscript, to build the regular installer (moonc.exe on your PATH) All other dependencies are either stored in the repository or are included as submodules. 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` (if building for release, add `--buildtype=release`) 3. Build with `cd build` and `ninja` You should now have a binary: `aegisub.exe`. 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. For personal usage, you can use pip and homebrew to install almost all of Aegisub's dependencies: pip3 install meson # or brew install meson if you installed Python via brew brew install cmake ninja pkg-config libass boost zlib ffms2 fftw hunspell uchardet 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" When compiling on Apple Silicon, replace `/usr/local` with `/opt/homebrew`. When compiling on macOS 15.0 (Sequoia) or later, you may also want to `export MACOS_X_DEPLOYMENT_TARGET=14.0` to make the color picker work. 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`. Open the newly created `bin/moonscript.lua`, and within it make the following changes: 1. Prepend the final line of the file, `package.preload["moonscript"]()`, with a `return`, producing `return package.preload["moonscript"]()`. 2. Within the function at `package.preload['moonscript.base']`, remove references to `moon_loader`, `insert_loader`, and `remove_loader`. This means removing their declarations, definitions, and entries in the returned table. 3. Within the function at `package.preload['moonscript']`, remove the line `_with_0.insert_loader()`. The file is now ready for use, to be placed in `automation/include` within the Aegisub repo. ## License All files in this repository are licensed under various GPL-compatible BSD-style licenses; see LICENCE and the individual source files for more information. The official Windows and OS X builds are GPLv2 due to including fftw3. automation/0000775000175000017500000000000014741067256012242 5ustar aniolaniolautomation/tests/0000775000175000017500000000000014741067256013404 5ustar aniolaniolautomation/tests/automation/0000775000175000017500000000000014741067256015564 5ustar aniolaniolautomation/tests/automation/trace-level-test.lua0000664000175000017500000000107014741067256021445 0ustar aniolaniolscript_name = "Automation 4 test 9" script_description = "Test debug out function" script_author = "Niels Martin Hansen" script_version = "2" function test9(subtitles, selected_lines, active_line) aegisub.debug.out("Only string argument\n") aegisub.debug.out("Hello %s!\n", "format string world") aegisub.log("Now going to log 7 strings with trace levels 0 to 6:\n") for i = 0, 6 do aegisub.log(i, "Trace level %d...\n", i) end aegisub.debug.out(3, "Finished!") end aegisub.register_macro("Test debug out", "Tests the aegisub.debug.out function", test9) automation/tests/automation/config-dialog-test.lua0000664000175000017500000000674514741067256021762 0ustar aniolaniol-- Automation 4 test file -- Create a Filter feature that does some kara stuff script_name = "Automation 4 test 7" script_description = "Test config dialogs" script_author = "Niels Martin Hansen" script_version = "1" include("utils.lua") function test7(subtitles, selected_lines, active_line) local a, b = aegisub.dialog.display({{class="label", label="Test..."}}, {}) report_dialog_result(a, b) aegisub.progress.set(50) a, b = aegisub.dialog.display( { {class="edit", name="foo", text="", x=0, y=0}, {class="intedit", name="e1", value=20, x=0, y=1}, {class="intedit", name="e2", value=30, min=10, max=50, x=1, y=1}, {class="floatedit", name="e3", value=19.95, x=0, y=2}, {class="floatedit", name="e4", value=123.63423, min=-4.3, max=2091, x=1, y=2}, {class="floatedit", name="e5", value=-4, step=0.21, x=2, y=2}, {class="floatedit", name="e6", value=22, min=0, max=100, step=1.4, x=3, y=2}, {class="textbox", name="e7", text="hmm wuzzis say?", x=0, y=3, width=4}, {class="dropdown", name="l1", items={"abc", "def", "ghi"}, value="def", x=0, y=4}, {class="dropdown", name="l2", items={"abc", "def", "ghi"}, value="doesnotexist", x=1, y=4}, {class="checkbox", name="b1", value=true, label='checked', x=0, y=5}, {class="checkbox", name="b2", value=false, label='cleared', x=1, y=5}, {class="color", name="c1", value="#00ff11", x=0, y=6}, {class="color", name="c2", value="&H0011ff00", x=1, y=6}, {class="coloralpha", name="c3", value="#aabbccdd", x=0, y=7}, {class="coloralpha", name="c4", value="&Hddccbbaa&", x=1, y=7}, {class="alpha", name="c5", value="#12", x=0, y=8}, {class="alpha", name="c6", value="&H12&", x=1, y=8} }, {"foo", "bar"}) report_dialog_result(a, b) end function report_dialog_result(button, controls) aegisub.debug.out("Dialog closed: ") if button == false then aegisub.debug.out("cancelled\n") elseif button == true then aegisub.debug.out("clicked Ok\n") else aegisub.debug.out("clicked '" .. button .. "'\n") end for key, val in pairs(controls) do local printable = (val == true and "true") or (val == false and "false") or tostring(val) aegisub.debug.out("%s: %s\n", key, printable) end aegisub.debug.out(" - - - - -\n") end function exporter(subs, config) for i = 1, #subs do local l = subs[i] if l.class == "dialogue" and not l.comment then if config.style == "" or l.style == config.style then l.text = config.text .. l.text subs[i] = l end end end end function export_config_dialog(subs, store) local styles = {""} for i = 1, #subs do local l = subs[i] if l.class == "style" then table.insert(styles, l.name) end end return { { class = "label", label = "This will insert a given text in\n" .. "front of all dialogue lines of\n" .. "the given style, or every line\n" .. "if no specific style is selected.", x = 0, y = 0, width = 2, height = 1 }, { class = "label", label = "Text to insert:", x = 0, y = 1, width = 1, height = 1 }, { class = "edit", name = "text", x = 1, y = 1, width = 1, height = 1 }, { class = "label", label = "Style to apply on:", x = 0, y = 2, width = 1, height = 1 }, { class = "dropdown", name = "style", value = "", items = styles, x = 1, y = 2, width = 1, height = 1 } } end aegisub.register_macro("Config Dialog 1", "Show a stupid config dialog", test7, nil) aegisub.register_filter("Export Config", "Test export filter config dialog stuff", 500, exporter, export_config_dialog) automation/tests/automation/basic-export-test.lua0000664000175000017500000000442514741067256021651 0ustar aniolaniol-- Automation 4 test file -- Create a Filter feature that does some kara stuff script_name = "Automation 4 test 6" script_description = "Test basic export filters" script_author = "Niels Martin Hansen" script_version = "1" include("utils.lua") function test6_2(subtitles, config) --[[for i = 1, #subtitles do local l = subtitles[i] if l.class == "dialogue" then local nl = table.copy(l) nl.text = "Copied!" subtitles.insert(i, nl) break end end]] end function test6(subtitles, config) aegisub.progress.task("Collecting style data") local styles = {} for i = 1, #subtitles do aegisub.debug.out("finding styles, line " .. i) local l = subtitles[i] if l.class == "dialogue" then break end if l.class == "style" then aegisub.debug.out(" found style: " .. l.name) styles[l.name] = l end aegisub.progress.set(100 * i / #subtitles) end local res = {} local i = 1 while i <= #subtitles do aegisub.debug.out("producing effect, line " .. i) local l = subtitles[i] if l.class == "dialogue" then aegisub.debug.out(" found dialogue: " .. l.text) local res = {} do_line(styles, l, config, res) aegisub.debug.out(" lines returned by do_line: " .. #res) for j,nl in ipairs(res) do subtitles.insert(i+j, nl) end aegisub.debug.out(" done inserting generated lines") subtitles.delete(i) i = i + #res else aegisub.debug.out(" not dialogue") i = i + 1 end aegisub.progress.task(string.format("Producing effect (%d/%d)", i, #subtitles)) aegisub.progress.set(100 * i / #subtitles) end end function do_line(styles, line, config, res) local k = aegisub.parse_karaoke_data(line) aegisub.debug.out(" syllables generated from line: " .. #k) local left = 0 for j = 1, #k do aegisub.debug.out(" syllable " .. j .. " is: " .. k[j].text) local nl = table.copy(line) nl.text = string.format("{\\t(%d,%d,\\fscx50)\\pos(%d,20)}%s", k[j].start_time, k[j].end_time, left, k[j].text_stripped) left = left + (aegisub.text_extents(styles[nl.style], k[j].text_stripped)) table.insert(res, nl) end end aegisub.register_filter("Stupid karaoke", "Makes some more karaoke-like stuff", 2000, test6, nil) aegisub.register_filter("Lame test", "Simple test of filters, just inserting a new line", 2000, test6_2) automation/tests/automation/test-filter-name-clash.lua0000664000175000017500000000114014741067256022533 0ustar aniolaniol-- Automation 4 test file -- Create a Filter feature that does some kara stuff script_name = "Automation 4 test 10" script_description = "Test reaction to export filter name clashes" script_author = "Niels Martin Hansen" script_version = "1" include("utils.lua") function function1(subtitles, config) aegisub.debug.out("function 1") end function function2(subtitles, config) aegisub.debug.out("function 2") end aegisub.register_filter("Export breaker", "Export filter with nameclash (1)", 500, function1) aegisub.register_filter("Export breaker", "Export filter with nameclash (2)", 500, function2) automation/tests/automation/selection-set-test.lua0000664000175000017500000000176114741067256022027 0ustar aniolaniol-- Automation 4 test file -- Create a Macro feature, that displays some text script_name = "Automation 4 set-selection test" script_description = "Test setting the grid selection" script_author = "Niels Martin Hansen" script_version = "1" function selecttest(subtitles, selected_lines, active_line) -- get line-id of first selected line local lid = selected_lines[1] -- insert a copy of line 'lid' before itself subtitles[-lid] = subtitles[lid] -- append a copy of the copy of the copied line subtitles[0] = subtitles[lid] -- grab the copied line local l = subtitles[lid] -- modify it l.text = "A4 was here!" -- and store it back subtitles[lid] = l -- select some new lines selected_lines = { lid-1, lid, lid+1 } -- and set undo point (never forget!) aegisub.set_undo_point("Insert+select Stuff") -- return the new selection return selected_lines end aegisub.register_macro("Insert+select stuff", "Inserts some lines near the active line and selects the new lines", selecttest, nil) automation/tests/automation/furi-test.ass0000664000175000017500000000472414741067256020225 0ustar aniolaniol[Script Info] ; Script generated by Aegisub v2.00 PRE-RELEASE (SVN r1170, jfs) ; http://www.aegisub.net Title: Default Aegisub file ScriptType: v4.00+ WrapStyle: 0 PlayResX: 640 PlayResY: 480 Video Aspect Ratio: 0 Video Zoom: 8 Video Position: 840 Automation Scripts: ~test-furi.lua Video File: ?dummy:23.976000:3000:640:480:226:221:236:c Audio File: E:\Anime Projekter\Zegapain\op\op.wav [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding Style: Default-furigana,Arial,10,&H00FFFFFF,&H0000FFFF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,1,1,2,10,10,10,0 Style: Default,Arial,20,&H00FFFFFF,&H0000FFFF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,2,2,2,10,10,10,0 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:00.00,0:00:05.00,Default,,0000,0000,0000,,{\k3}振|ふ{\k3}り{\k10}仮|が{\k5}名|な Dialogue: 0,0:00:05.00,0:00:10.00,Default,,0000,0000,0000,,{\k4}変身|か{\k12}わ{\k7}っ{\k7}た Dialogue: 0,0:00:10.00,0:00:15.00,Default,,0000,0000,0000,,{\k4}お{\k4}茶|ちゃ Dialogue: 0,0:00:15.00,0:00:20.00,Default,,0000,0000,0000,,{\k15}二|ふ{\k15}#|た{\k10}人|り{\k15}だ{\k57}け{\k5}の{\k6}地|は{\k5}球|し{\k8}で Dialogue: 0,0:00:20.00,0:00:25.00,Default,,0000,0000,0000,,{\k5}明日|あ{\k10}#|し{\k5}#|た{\k10}ま{\k7}だ{\k10}会{\k4}う{\k6}時{\k14}# Dialogue: 0,0:00:25.00,0:00:30.00,Default,,0000,0000,0000,,{\k21}遠|と{\k6}#|お{\k27}い{\k27}記|き{\k21}憶|お{\k6}#|く{\k27} {\k14}蘇|<よ{\k5}#|み{\k4}#|が{\k4}#|え{\k26}る{\k20}悲|か{\k6}#|な{\k26}し{\k26}み{\k26}も{\k16}温|<あ{\k5}#|た{\k5}#|た{\k26}め{\k26}て{\k26}行|ゆ{\k26}け{\k26}る{\k26}の{\k26}に Dialogue: 0,0:00:30.00,0:00:35.00,Default,,0000,0000,0000,,{\k29}筋肉|きんにく{\k15}の{\k58}長軸方向|ちょうじくほうこう{\k15}に{\k15}伸|の{\k29}びる{\k29}非常|ひじょう{\k15}に{\k29}大型|おおがた{\k14}の{\k28}細胞{\k28}で、{\k28}1個|いっこ{\k14}の{\k28}細胞|さいぼう{\k14}を{\k42}筋線維|きんせんい{\k28}とも{\k14}呼|よ{\k28}ぶ。 Dialogue: 0,0:00:35.00,0:00:40.00,Default,,0000,0000,0000,,{\k80}中|<ちゅ{\k60}#|う{\k60}国|ご{\k60}#|く{\k60}魂|<た{\k60}#|ま{\k60}#|し{\k60}#|い Dialogue: 0,0:00:40.00,0:00:45.00,Default,,0000,0000,0000,,wee automation/tests/automation/progress-reporting-test.lua0000664000175000017500000000151714741067256023123 0ustar aniolaniol-- Automation 4 test file -- Create a Macro feature, that displays some text script_name = "Automation 4 test 4" script_description = "Test progress reporting" script_author = "Niels Martin Hansen" script_version = "1" function wait() local s = "" for i = 0, 500 do s = s .. i end return s end function progression(subtitles, selected_lines, active_line) while not aegisub.progress.is_cancelled() do aegisub.progress.task("Counting up...") for i = 0, 100, 0.2 do aegisub.progress.set(i) if aegisub.progress.is_cancelled() then break end wait() end if aegisub.progress.is_cancelled() then break end aegisub.progress.task("Counting down...") for i = 0, 100 do aegisub.progress.set(100-i) wait() end end end aegisub.register_macro("Progress fun", "Does absolutely nothing", progression, nil) automation/tests/automation/text-extents-test.lua0000664000175000017500000000206014741067256021716 0ustar aniolaniol-- Automation 4 test file -- Create a Macro feature, that displays some text script_name = "Automation 4 test 5" script_description = "Test include and text_extents" script_author = "Niels Martin Hansen" script_version = "1" include("utils.lua") function test5(subtitles, selected_lines, active_line) local styles = {} for i = 1, #subtitles do local l = subtitles[i] if l.class == "dialogue" then break end if l.class == "style" then styles[l.name] = l end end for i = #selected_lines, 1, -1 do local ri = selected_lines[i] local l = subtitles[ri] local k = aegisub.parse_karaoke_data(l) local left = 0 for j = 1, #k do local nl = table.copy(l) l.text = string.format("{\\t(%d,%d,\\fscx50)\\pos(%d,20)}%s", k[j].start_time, k[j].end_time, left, k[j].text_stripped) left = left + (aegisub.text_extents(styles[l.style], k[j].text_stripped)) subtitles.insert(ri+j, l) end end aegisub.set_undo_point("karaoke-like stuff") end aegisub.register_macro("More karaoke fun", "Makes some more karaoke-like stuff", test5, nil) automation/tests/automation/test-text_extents.lua0000664000175000017500000000177414741067256022013 0ustar aniolaniol-- Automation 4 test file -- Test the result of the text_extents function script_name = "Test text_extents" script_description = "Test what the result of text_extents is on a fixed string on all styles in the file" script_author = "Niels Martin Hansen" script_version = "1" function test_te(subtitles, selected_lines, active_line) local teststring = "Test" aegisub.debug.out("Test string is '" .. teststring .. "'\n") local styles = {} for i = 1, #subtitles do local l = subtitles[i] if l.class == "style" then aegisub.debug.out(" - - -\n") aegisub.debug.out("Found style: " .. l.name .. "\n") local width, height, descent, extlead = aegisub.text_extents(l, teststring) aegisub.debug.out(string.format("Width: %.2f Height: %.2f Descent: %.2f Ext. lead: %.2f\n", width, height, descent, extlead)) end aegisub.progress.set(i/#subtitles*100) end end aegisub.register_macro("Test text_extents", "Show the result of the text_extents function for all styles in the file", test_te, nil) automation/tests/automation/unicode-test.lua0000664000175000017500000000161214741067256020672 0ustar aniolaniol-- Automation 4 test file -- Test the unicode.lua include script_name = "Automation 4 test 7" script_description = "Test unicode.lua include" script_author = "Niels Martin Hansen" script_version = "1" include("unicode.lua") function test8(subtitles, selected_lines, active_line) local s = "ōkii テスト aåDŽਵ℡랩ム﹌" aegisub.debug.out("Test string is: " .. s .. "\n") aegisub.debug.out("Width of first character is: " .. unicode.charwidth(s, 1) .. "\n") local len = unicode.len(s) aegisub.debug.out("Byte length is: " .. s:len() .. "\n") aegisub.debug.out("Unicode length is: " .. len .. "\n") for c, i in unicode.chars(s) do local cp = unicode.codepoint(c) aegisub.debug.out(string.format("Character %d is '%s' with codepoint %d\n", i, c, cp)) end aegisub.debug.out("Done!") end aegisub.register_macro("Test Unicode", "Tests the Unicode include file", test8, nil) automation/tests/automation/gen-absurd-t-line.lua0000664000175000017500000000175414741067256021513 0ustar aniolaniolscript_name = "Absurdness" script_description = "Benchmark renderers by testing how they react to an absurd number of \\t tags in one line, and an absurd amount of lines each with a single \\t." script_author = "jfs" absurd = 1000 ttext = "\\1a&H00&\\2a&H00&\\3a&H00&\\4a&H00&" function gen_one_absurd(subs, sel) local l = subs[sel[1]] l.text = "" l.start_time = 0 l.end_time = (absurd+1)*100 for i = 1, absurd do l.text = l.text .. string.format("{\\t(%d,%d,%s)}", i*100, (i+1)*100, ttext) end l.text = l.text .. "a" subs[-sel[1]] = l aegisub.set_undo_point("absurdness 1") end function gen_absurd_many(subs, sel) local l = subs[sel[1]] for i = 1, absurd do l.start_time = i*100 l.end_time = (i+1)*100 l.text = string.format("{\\t(0,100,%s)}a", ttext) subs[-sel[1]] = l end aegisub.set_undo_point("absurdness 2") end aegisub.register_macro("Generate absurd line", "Absurd", gen_one_absurd) aegisub.register_macro("Generate absurdly many lines", "Absurd", gen_absurd_many) automation/tests/automation/hello-world.lua0000664000175000017500000000073614741067256020525 0ustar aniolaniol-- Automation 4 test file -- Create a Macro feature, that displays some text script_name = "Automation 4 test 1" script_description = "Hello World in Automation 4/Lua" script_author = "Niels Martin Hansen" script_version = "1" function macro_test1(subtitles, selected_lines, active_line) --aegisub.debug.out(3, "Hello World from %s", "Automation 4/Lua") aegisub.debug.out("Hello Automation 4 World!") end aegisub.register_macro("Hello", "Shows a message", macro_test1) automation/tests/automation/kara-templater-retime.ass0000664000175000017500000000372414741067256022476 0ustar aniolaniol[Script Info] Title: Default Aegisub file ScriptType: v4.00+ WrapStyle: 0 PlayResX: 640 PlayResY: 480 Video Aspect Ratio: 0 Video Zoom: 8 Video Position: 500 Last Style Storage: Default Video File: ?dummy:50.000000:1000:640:480:226:221:236:c [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding Style: Default,Arial,50,&H00FFFFFF,&H0000FFFF,&H00000000,&H00000000,-1,0,0,0,100,100,0,0,1,2,0,5,10,10,10,0 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Comment: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,template noblank,!retime("abs",1000,2000)!{\pos($x,$y)\1c&H0000FF&} Comment: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,template noblank,!retime("preline",-100)!{\pos($x,$y)\1c&H000000&} Comment: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,template noblank,!retime("start2syl")!{\pos($x,$y)\1c&HFF0000&} Comment: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,template noblank,!retime("presyl",-200,0)!{\pos($x,$y)\1a&HFF&\3c&H0000FF&} Comment: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,template noblank,!retime("syl")!{\pos($x,$y)\1c&H00FF00&} Comment: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,template noblank,!retime("postsyl",0,200)!{\pos($x,$y)\1a&HFF&\3c&H00FF00&} Comment: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,template noblank,!retime("syl2end",200,0)!{\pos($x,$y)\1c&HFF00FF&} Comment: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,template noblank,!retime("postline",0,100)!{\pos($x,$y)\1c&H00FFFF&} Comment: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,template noblank,!retime("sylpct",50,100)!{\pos($center,$middle)\an5\1a&HFF&\3c&HFFFFFF&\fscy300\t(\3a&HFF&)} Dialogue: 0,0:00:10.00,0:00:11.00,Default,,0000,0000,0000,,{\k30}ha{\k20}hi{\k50}ho Dialogue: 0,0:00:11.00,0:00:16.00,Default,,0000,0000,0000,,automation/tests/automation/test-tablecopy-recursive.lua0000664000175000017500000000201214741067256023226 0ustar aniolaniolscript_name = "Test table.copy_deep" script_description = "Tests the Auto4 Lua utils.lua table.copy_deep function" script_author = "Niels Martin Hansen" include "utils.lua" function test_tablecopy_deep() local function test_table(tab, desc) local l = aegisub.log l("--- %15s -------------\n", desc) l("tab.a = %d\n", tab.a) l("type(tab.b) = %s\n", type(tab.b)) l("tab.b.a = %s\n", tab.b.a) l("tab.c==tab.b ? %d\n", (tab.c==tab.b) and 1 or 0) l("type(tab.b.b) = %s\n", type(tab.b.b)) l("type(tab.d) = %s\n", type(tab.d)) l("tab.d.a == tab.d ? %d\n", (tab.d.a==tab.d) and 1 or 0) l("tab.e == tab ? %d\n", (tab.e==tab) and 1 or 0) l("\n") end local orgtab = {} orgtab.a = 1 orgtab.b = {} orgtab.b.a = "hi" orgtab.c = orgtab.b orgtab.c.b = test_table orgtab.d = {} orgtab.d.a = orgtab.d orgtab.e = orgtab test_table(orgtab, "Original table") local cpytab = table.copy_deep(orgtab) test_table(cpytab, "Copied table") end aegisub.register_macro("TEST table.copy_deep", "", test_tablecopy_deep) automation/tests/automation/test-furi.lua0000664000175000017500000000601214741067256020210 0ustar aniolaniolscript_name = "Test furigana" script_description = "Tests the Auto4/Lua karaskel furigana and multi-highlight code" script_author = "jfs" include "karaskel.lua" function dump_furi(subs) aegisub.progress.task("Collecting header data") local meta, styles = karaskel.collect_head(subs, true) -- make sure to create furigana styles aegisub.progress.task("Processing lines") for i = 1, #subs do local l = subs[i] if l.class == "dialogue" then aegisub.progress.task(l.text) karaskel.preproc_line_text(meta, styles, l) -- Dump the thing aegisub.debug.out(4, "Line: %s\nStripped: %s\nDuration: %d\n", l.text, l.text_stripped, l.duration) aegisub.debug.out(4, "Karaoke syllables: (%d)\n", l.kara.n) for s = 0, l.kara.n do local syl = l.kara[s] aegisub.debug.out(4, "\tSyllable: text='%s' stripped='%s' duration=%d, start/end_time=%d/%d, inline_fx='%s', highlights=%d\n", syl.text, syl.text_stripped, syl.duration, syl.start_time, syl.end_time, syl.inline_fx, syl.highlights.n) aegisub.debug.out(4, "\t\tHighlights:") for h = 1, syl.highlights.n do local hl = syl.highlights[h] aegisub.debug.out(4, " %d-%d=%d", hl.start_time, hl.end_time, hl.duration) end aegisub.debug.out(4, "\n") end aegisub.debug.out(4, "Furigana parts: (%d)\n", l.furi.n) for f = 1, l.furi.n do local furi = l.furi[f] aegisub.debug.out(4, "\tFurigana: text='%s', duration=%d, start/end_time=%d/%d, flags=%s%s, syl='%s'\n", furi.text, furi.duration, furi.start_time, furi.end_time, furi.isbreak and "b" or "", furi.spillback and "s" or "", furi.syl.text_stripped) end aegisub.debug.out(4, " - - - - - -\n") end end aegisub.debug.out(4, "Done dumping!") end function layout_furi(subs) aegisub.progress.task("Collecting header data") local meta, styles = karaskel.collect_head(subs, true) -- make sure to create furigana styles aegisub.progress.task("Processing lines") for i = 1, #subs do local l = subs[i] if l.class == "dialogue" then aegisub.progress.task(l.text) karaskel.preproc_line_pos(meta, styles, l) aegisub.progress.task("Line layouting done, rendering...") aegisub.debug.out(4, "line width: %.2f\n", l.width) -- First all syllables for s = 0, l.kara.n do local syl = l.kara[s] local lc = table.copy(l) lc.text = string.format("{\\pos(%.1f,%.1f)\\k%d\\k%d\\an5}%s", l.left+syl.center, l.middle, syl.start_time/10, syl.kdur, syl.text_stripped) subs.append(lc) end -- Then all furigana for f = 1, l.furi.n do local furi = l.furi[f] local lc = table.copy(l) lc.text = string.format("{\\pos(%.1f,%.1f)\\k%d\\k%d\\an5}%s", l.left+furi.center, l.top-l.height/2, furi.start_time/10, furi.duration/10, furi.text) lc.style = furi.style.name subs.append(lc) end end end aegisub.set_undo_point("Furigana layout test") end aegisub.register_macro("Test furi parsing", "Run the furigana parsing code and dump the result", dump_furi) aegisub.register_macro("Test furi layout", "Run the furigana layout code and render the result", layout_furi) automation/tests/automation/basic-tests.lua0000664000175000017500000000327314741067256020515 0ustar aniolaniol-- Automation 4 test file -- Create a Macro feature, that displays some text script_name = "Automation 4 test 2" script_description = "Some additional non-hello-world tests" script_author = "Niels Martin Hansen" script_version = "2" function macro_test2(subtitles, selected_lines, active_line) aegisub.debug.out(subtitles.n .. " and " .. #subtitles .. " should be the same value") aegisub.debug.out(subtitles[selected_lines[1]].raw) end function dumper(subtitles, selected_lines, active_line) for i = 1, #subtitles do local l = subtitles[i] local s = l.raw .. "\n" s = s .. l.class .. "\n" if l.class == "comment" then s = s .. "text: " .. l.text .. "\n" elseif l.class == "info" then s = s .. string.format("key: %s\nvalue:%s\n", l.key, l.value) elseif l.class == "format" then -- skip elseif l.class == "style" then s = s .. string.format("name: %s\nfont: %s %d\ncolors: %s %s %s %s\n", l.name, l.fontname, l.fontsize, l.color1, l.color2, l.color3, l.color4) elseif l.class == "dialogue" then s = s .. string.format("layer: %d\nstyle: %s\ntext: %s\n", l.layer, l.style, l.text) end aegisub.debug.out(s) end end function inserttest(subtitles, selected_lines, active_line) local lid = selected_lines[1] subtitles[-lid] = subtitles[lid] subtitles[0] = subtitles[lid] local l = subtitles[lid] l.text = "A4 was here!" subtitles[lid] = l aegisub.set_undo_point("Insert Stuff") end aegisub.register_macro("File line count", "Count the number of lines in the ASS file", macro_test2, nil) aegisub.register_macro("Dump", "Dumps info on every line in the file", dumper, nil) aegisub.register_macro("Insert stuff", "Inserts some lines near the active line", inserttest, nil) automation/tests/automation/karaoke-parse-test.lua0000664000175000017500000000152514741067256021774 0ustar aniolaniol-- Automation 4 test file -- Create a Macro feature, that displays some text script_name = "Automation 4 test 3" script_description = "Test parse_karaoke_data" script_author = "Niels Martin Hansen" script_version = "1" function copy_table(tab) local res = {} for key, val in pairs(tab) do res[key] = val end return res end function karatest(subtitles, selected_lines, active_line) for i = #selected_lines, 1, -1 do local ri = selected_lines[i] local l = subtitles[ri] local k = aegisub.parse_karaoke_data(l) for j = 1, #k do local nl = copy_table(l) l.text = string.format("{\\t(%d,%d,\\fscx50)}%s", k[j].start_time, k[j].end_time, k[j].text_stripped) subtitles.insert(ri+j, l) end end aegisub.set_undo_point("karaoke-like stuff") end aegisub.register_macro("Karaoke fun", "Makes karaoke-like stuff", karatest, nil) automation/tests/automation/appended-lines.lua0000664000175000017500000001110214741067256021152 0ustar aniolaniol-- Automation 4 test file -- Test that appending lines to a file places the lines in the appropriate -- sections of the file, creating the sections if needed script_name = "TEST append lines" script_description = "Test that appended lines go to the right place" script_author = "Thomas Goyne" script_version = "1" function make_scriptinfo(key, value) return { class = "info", section = "[Script Info]", key = key, value = value } end function make_style(name) return { class = "style", section = "[V4+ Styles]", name = name, fontname = "Arial", fontsize = 20, color1 = "&H000000&", color2 = "&H000000&", color3 = "&H000000&", color4 = "&H000000&", bold = true, italic = false, underline = false, strikeout = false, scale_x = 100, scale_y = 100, spacing = 0, angle = 0, borderstyle = 0, outline = 0, shadow = 0, align = 5, margin_l = 0, margin_r = 0, margin_t = 0, margin_b = 0, encoding = 0 } end function make_dialogue(text) return { class = "dialogue", section = "[Events]", comment = false, layer = 0, start_time = 0, end_time = 2000, style = "Default", actor = "", margin_l = 0, margin_r = 0, margin_t = 0, margin_b = 0, effect = "", text = text } end function make_header(name) return { class = "head", section = name } end function make_format(fstr, section) return { class = "format", section = section, text = fstr } end function check_field(i, actual, expected, name) if actual ~= expected then error(i .. ": Expected '" .. expected .. "', got '" .. actual .. "' for " .. name) end end function check_line(i, line, class, section) check_field(i, line.class, class, "class") check_field(i, line.section, section, "section") end function test(subs) subs.deleterange(1, #subs) -- verify that everything works with the items added in order subs[0] = make_header("[Script Info]") subs[0] = make_scriptinfo("Title", "Default Aegisub file") subs[0] = make_scriptinfo("ScriptType", "v4.00+") subs[0] = make_scriptinfo("WrapStyle", "0"); subs[0] = make_scriptinfo("ScaledBorderAndShadow", "yes") subs[0] = make_scriptinfo("Collisions", "Normal") subs[0] = make_header("[V4+ Styles]") subs[0] = make_format("Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding", "[V4+ Styles]") subs[0] = make_style("Default") subs[0] = make_header("[Events]") subs[0] = make_format("Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text", "[Events]") subs[0] = make_dialogue("") check_line(1, subs[1], "head", "[Script Info]") check_line(2, subs[2], "info", "[Script Info]") check_line(3, subs[3], "info", "[Script Info]") check_line(4, subs[4], "info", "[Script Info]") check_line(5, subs[5], "info", "[Script Info]") check_line(6, subs[6], "info", "[Script Info]") check_line(7, subs[7], "head", "[V4+ Styles]") check_line(8, subs[8], "format", "[V4+ Styles]") check_line(9, subs[9], "style", "[V4+ Styles]") check_line(10, subs[10], "head", "[Events]") check_line(11, subs[11], "format", "[Events]") check_line(12, subs[12], "dialogue", "[Events]") subs.deleterange(1, #subs) -- test that groups appear in the order they're first used and lines are -- put in the right group subs[0] = make_scriptinfo("Title", "Script Title") subs[0] = make_style("Default") subs[0] = make_dialogue("Foo") subs[0] = make_style("Default 2") subs[0] = make_scriptinfo("ScriptType", "v4.00+") subs[0] = make_dialogue("Bar") check_line(1, subs[1], "head", "[Script Info]") check_line(2, subs[2], "info", "[Script Info]") check_line(3, subs[3], "info", "[Script Info]") check_line(4, subs[4], "head", "[V4+ Styles]") check_line(5, subs[5], "style", "[V4+ Styles]") check_line(6, subs[6], "style", "[V4+ Styles]") check_line(7, subs[7], "head", "[Events]") check_line(8, subs[8], "dialogue", "[Events]") check_line(9, subs[9], "dialogue", "[Events]") aegisub.set_undo_point("append test") end aegisub.register_macro(script_name, script_description, test) automation/tests/busted.lua0000664000175000017500000000173314741067256015401 0ustar aniolaniollocal ffi = require("ffi") ffi.cdef[[ typedef struct timeval { long tv_sec; long tv_usec; } timeval; int gettimeofday(timeval *t, void *tzp); typedef struct timespec { long tv_sec; long tv_nsec; } timespec; int clock_gettime(int clk_id, timespec *tp); ]] function gettime() local t = ffi.new("timeval") ffi.C.gettimeofday(t, nil) return tonumber(t.tv_sec) + tonumber(t.tv_usec) / 1000000.0 end function monotime() local ts = ffi.new("timespec") ffi.C.clock_gettime(6, ts) return tonumber(ts.tv_sec) + tonumber(ts.tv_nsec) / 1000000000.0 end function sleep() end -- busted depends on luasocket just for gettime(), so just supply a definition -- of that to avoid the dep package.loaded['socket'] = { gettime = gettime } package.loaded['system'] = { gettime = gettime, monotime = monotime, sleep = sleep } package.loaded['term'] = { isatty = function() return true end } require 'busted.runner'({ batch = true, standalone = false }) automation/tests/modules/0000775000175000017500000000000014741067256015054 5ustar aniolaniolautomation/tests/modules/argcheck.moon0000664000175000017500000000654314741067256017525 0ustar aniolaniol-- 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/ check = require 'aegisub.argcheck' describe 'argcheck', -> it 'should permit simple valid calls', -> assert.has_no.errors -> (check'string' ->) '' assert.has_no.errors -> (check'number' ->) 10 assert.has_no.errors -> (check'boolean' ->) true assert.has_no.errors -> (check'table' ->) {} it 'should support multiple arguments', -> assert.has_no.errors -> (check'string number' ->) '', 10 assert.has_no.errors -> (check'string table number' ->) '', {}, 10 it 'should support moonscript classes', -> class Foo assert.has_no.errors -> (check'Foo' (->) Foo) it 'should support optional arguments', -> assert.has_no.errors -> (check'?number' ->) nil assert.has_no.errors -> (check'?number ?number' ->) 5 it 'should support ...', -> assert.has_no.errors -> (check'number ...' ->) 5 assert.has_no.errors -> (check'number ...' ->) 5, 5 assert.has_no.errors -> (check'number ...' ->) 5, 5, '' it 'should support alternates', -> assert.has_no.errors -> (check'number|string' ->) 5 assert.has_no.errors -> (check'number|string' ->) '' it 'should support optional alternates', -> assert.has_no.errors -> (check'?number|string' ->) 5 assert.has_no.errors -> (check'?number|string' ->) '' assert.has_no.errors -> (check'?number|string' ->) nil it 'should reject simple invalid calls', -> assert.has.errors -> (check'string' ->) 10 assert.has.errors -> (check'number' ->) '' it 'should reject inccorect numbers of arguments', -> assert.has.errors -> (check'string number' ->) '' assert.has_no.errors -> (check'string ?number' ->) '' assert.has.errors -> (check'string number' ->) '', 5, 5 it 'should reject non-optional nil arguments', -> assert.has.errors -> (check'string number' ->) nil, nil it 'should reject invalid matches with alternates', -> assert.has.errors -> (check'number|string' ->) {} it 'should report the correct error levels', -> valid_err_loc = (fn) -> _, err = pcall fn err\find('tests/modules/argcheck.moon') != nil assert.is.true valid_err_loc -> (check'number' ->) {} assert.is.true valid_err_loc -> (check'number' ->) nil assert.is.true valid_err_loc -> (check'number|string' ->) {} assert.is.true valid_err_loc -> (check'number|string' ->) nil assert.is.true valid_err_loc -> (check'number string' ->) {} assert.is.true valid_err_loc -> (check'?number ?string' ->) 1, 2, 3 assert.is.true valid_err_loc -> (check'number string ...' ->) {} prevent_tail_call_so_that_this_shows_up_in_backtrace = 1 automation/tests/modules/lfs.moon0000664000175000017500000000410714741067256016534 0ustar aniolaniol-- 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. lfs = require 'aegisub.lfs' uuid = require 'uuid' uuid.randomseed os.time() get_pwd = -> pwd = io.popen 'pwd' dir = pwd\read! pwd.close! dir original_dir = get_pwd! describe 'lfs', -> after_each -> lfs.chdir original_dir describe 'currentdir', -> it 'should give the same result as pwd', -> dir = lfs.currentdir() assert.is.equal dir, get_pwd! describe 'chdir', -> it 'should change the current directory', -> dir = get_pwd! lfs.chdir '/' new_dir = get_pwd! assert.is.equal '/', new_dir lfs.chdir dir assert.is.equal get_pwd!, dir it 'should fail on an invalid path', -> name = '/tmp/' .. uuid! .. '/' .. uuid! res, msg = lfs.chdir name assert.is.nil res assert.is.not.nil msg describe 'mkdir', -> it 'should be able to create new directories', -> name = '/tmp/' .. uuid! lfs.mkdir name assert.is.equal lfs.attributes(name, 'mode'), 'directory' res, msg = lfs.rmdir name assert.is.nil lfs.attributes name, 'mode' describe 'touch', -> it 'should create files if given a nonexistent filename', -> name = '/tmp/' .. uuid! lfs.touch name assert.is.equal lfs.attributes(name).mode, 'file' os.remove(name) assert.is.nil lfs.attributes name, 'mode' automation/tests/modules/unicode.moon0000664000175000017500000000737014741067256017403 0ustar aniolaniol-- Copyright (c) 2013, 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. unicode = require 'aegisub.unicode' describe 'charwidth', -> it 'should return 1 for an ascii character', -> assert.is.equal 1, unicode.charwidth 'a' it 'should return 2 for a two byte character', -> assert.is.equal 2, unicode.charwidth 'ß' it 'should return 3 for a three byte character', -> assert.is.equal 3, unicode.charwidth 'c' it 'should return 4 for a four byte character', -> assert.is.equal 4, unicode.charwidth '🄓' describe 'char_iterator', -> it 'should iterator over multi-byte codepoints', -> chars = [c for c in unicode.chars 'aßc🄓'] assert.is.equal 4, #chars assert.is.equal chars[1], 'a' assert.is.equal chars[2], 'ß' assert.is.equal chars[3], 'c' assert.is.equal chars[4], '🄓' describe 'len', -> it 'should give length in codepoints', -> assert.is.equal 4, unicode.len 'aßc🄓' describe 'codepoint', -> it 'should give codepoint as an integer for a string', -> assert.is.equal 97, unicode.codepoint 'a' assert.is.equal 223, unicode.codepoint 'ß' assert.is.equal 0xFF43, unicode.codepoint 'c' assert.is.equal 0x1F113, unicode.codepoint '🄓' it 'should give ignore codepoints after the first', -> assert.is.equal 97, unicode.codepoint 'abc' describe 'to_upper_case', -> it 'should support plain ASCII', -> assert.is.equal 'ABC', unicode.to_upper_case 'abc' it 'should support accents', -> assert.is.equal 'ÀÈÌ', unicode.to_upper_case 'àèì' it 'should support fullwidth letters', -> assert.is.equal 'ABC', unicode.to_upper_case 'abc' it 'should support greek', -> assert.is.equal 'ΑΒΓ', unicode.to_upper_case 'αβγ' it 'should support sharp-s', -> assert.is.equal 'SS', unicode.to_upper_case 'ß' it 'should support ligatures', -> assert.is.equal 'FFI', unicode.to_upper_case 'ffi' describe 'to_lower_case', -> it 'should support plain ASCII', -> assert.is.equal 'abc', unicode.to_lower_case 'ABC' it 'should support accents', -> assert.is.equal 'àèì', unicode.to_lower_case 'ÀÈÌ' it 'should support fullwidth letters', -> assert.is.equal 'abc', unicode.to_lower_case 'ABC' it 'should support greek', -> assert.is.equal 'αβγ', unicode.to_lower_case 'ΑΒΓ' it 'should support sharp-s', -> assert.is.equal 'ß', unicode.to_lower_case 'ẞ' -- note: Unicode doesn't have any uppercase precomposed ligatures describe 'to_fold_case', -> it 'should support plain ASCII', -> assert.is.equal 'abc', unicode.to_fold_case 'ABC' it 'should support accents', -> assert.is.equal 'àèì', unicode.to_fold_case 'ÀÈÌ' it 'should support fullwidth letters', -> assert.is.equal 'abc', unicode.to_fold_case 'ABC' it 'should support greek', -> assert.is.equal 'αβγ', unicode.to_fold_case 'ΑΒΓ' it 'should support sharp-s', -> assert.is.equal 'ss', unicode.to_fold_case 'ẞ' it 'should support ligatures', -> assert.is.equal 'ffi', unicode.to_fold_case 'ffi' automation/tests/modules/re.moon0000664000175000017500000002577514741067256016374 0ustar aniolaniol-- Copyright (c) 2013, 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. re = require 'aegisub.re' describe 'compile', -> it 'should return a object with the regexp bound', -> r = re.compile '.' res = r\find 'abc' assert.is.not.nil res assert.is.equal 3, #res res = r\find 'bc' assert.is.not.nil res assert.is.equal 2, #res it 'should throw an error when it is not called with \\', -> r = re.compile '.' assert.is.error -> r.find 'bc' it 'should throw an error when given an invalid regex', -> assert.is.error -> re.compile '(' it 'should throw an error when given an empty regex', -> assert.is.error -> re.compile '' describe 'find', -> it 'should only match once when using ^', -> res = re.find 'aaa', '^a' assert.is.not.nil res assert.is.equal 1, #res it 'should match codepoints with ., not bytes', -> res = re.find '☃☃', '.' assert.is.not.nil res assert.is.equal 2, #res assert.is.equal '☃', res[1].str assert.is.equal 1, res[1].first assert.is.equal 3, res[1].last assert.is.equal '☃', res[2].str assert.is.equal 4, res[2].first assert.is.equal 6, res[2].last it 'should return nil when there are no matches', -> assert.is.nil(re.find 'a', 'b') it 'should return nil when called on an empty string', -> assert.is.nil(re.find '', '.') it 'should return full match information', -> res = re.find 'aa', '.' assert.is.not.nil res assert.is.equal 2, #res assert.is.equal 'a', res[1].str assert.is.equal 1, res[1].first assert.is.equal 1, res[1].last assert.is.equal 'a', res[2].str assert.is.equal 2, res[2].first assert.is.equal 2, res[2].last it 'should be able to handle a zero-length match', -> res = re.find 'abc', '^' assert.is.not.nil res assert.is.equal 1, #res assert.is.equal '', res[1].str assert.is.equal 1, res[1].first assert.is.equal 0, res[1].last describe 'flag handling', -> it 'should be an error to pass flags somewhere other than the end', -> assert.is.error -> re.sub 'a', re.ICASE, 'b', 'c' assert.is.error -> re.sub 'a', 'b', re.ICASE, 'c' describe 'match', -> it 'should be able to extract values from multiple match groups', -> res = re.match '{250 1173 380}Help!', '(\\d+) (\\d+) (\\d+)' assert.is.not.nil res assert.is.equal 4, #res assert.is.equal '250 1173 380', res[1].str assert.is.equal 2, res[1].first assert.is.equal 13, res[1].last assert.is.equal '250', res[2].str assert.is.equal 2, res[2].first assert.is.equal 4, res[2].last assert.is.equal '1173', res[3].str assert.is.equal 6, res[3].first assert.is.equal 9, res[3].last assert.is.equal '380', res[4].str assert.is.equal 11, res[4].first assert.is.equal 13, res[4].last it 'should handle zero length matches', -> res = re.match 'abc', '^' assert.is.not.nil res assert.is.equal 1, #res assert.is.equal '', res[1].str assert.is.equal 1, res[1].first assert.is.equal 0, res[1].last describe 'split', -> it 'should return the input string in a table when the delimiter does not appear in the string', -> res = re.split 'abc', ',' assert.is.not.nil res assert.is.equal 1, #res assert.is.equal 'abc', res[1] it 'should return an empty table when given an empty string', -> res = re.split '', ',' assert.is.not.nil res assert.is.equal 0, #res it 'should honor the max splits argument', -> res = re.split 'a,,b,c', ',', false, 1 assert.is.not.nil res assert.is.equal 2, #res assert.is.equal 'a', res[1] assert.is.equal ',b,c', res[2] it 'should not count skipped segments in the maximum when skipping empty', -> res = re.split 'a,,b,c', ',', true, 1 assert.is.not.nil res assert.is.equal 2, #res assert.is.equal 'a', res[1] assert.is.equal ',b,c', res[2] res = re.split 'a,,b,c,d', ',', true, 2 assert.is.not.nil res assert.is.equal 3, #res assert.is.equal 'a', res[1] assert.is.equal 'b', res[2] assert.is.equal 'c,d', res[3] it 'should support multi-character delimiters', -> res = re.split 'a::b::c:d', '::' assert.is.not.nil res assert.is.equal 3, #res assert.is.equal 'a', res[1] assert.is.equal 'b', res[2] assert.is.equal 'c:d', res[3] it 'should not fail on basic splits', -> res = re.split 'a,,b,c', ',' assert.is.not.nil res assert.is.equal 4, #res assert.is.equal 'a', res[1] assert.is.equal '', res[2] assert.is.equal 'b', res[3] assert.is.equal 'c', res[4] it 'should be able to skip empty segments', -> res = re.split 'a,,b,c', ',', true assert.is.not.nil res assert.is.equal 3, #res assert.is.equal 'a', res[1] assert.is.equal 'b', res[2] assert.is.equal 'c', res[3] it 'should return an empty table when given only empty segments', -> res = re.split ',,,', ',', true assert.is.not.nil res assert.is.equal 0, #res it 'should be able to split on word boundaries', -> res = re.split 'aa bb cc', '\\b', true assert.is.not.nil res assert.is.equal 5, #res assert.is.equal res[1], 'aa' assert.is.equal res[2], ' ' assert.is.equal res[3], 'bb' assert.is.equal res[4], ' ' assert.is.equal res[5], 'cc' it 'should be able to split on the beginning of the buffer', -> res = re.split 'aa bb cc', '\\A' assert.is.not.nil res assert.is.equal 2, #res assert.is.equal '', res[1] assert.is.equal 'aa bb cc', res[2] describe 'sub', -> it 'should throw an error when given a non-string to search for', -> assert.is.error -> re.sub 'aa', 5, 'b' it 'should throw an error when given a non-string to search in', -> assert.is.error -> re.sub 5, 'a', 'b' it 'should throw an error when given a non-string to replace with', -> assert.is.error -> re.sub 'aa', 'a', 5 it 'should pass capture groups to the replacement function if given one', -> assert.is.equal 'aabbaabb', re.sub 'abab', '(a)(b)', (str) -> str .. str it 'should return an empty string when given an empty string', -> assert.is.equal '', re.sub '', 'b', 'c' it 'should support functions for replacements in addition to strings', -> add_one = (str) -> tostring tonumber(str) + 1 res = re.sub '{\\k10}a{\\k15}b{\\k30}c', '\\\\k([[:digit:]]+)', add_one assert.is.not.nil res assert.is.equal '{\\k11}a{\\k16}b{\\k31}c', res it 'should pass the full match to the replacement function if there are no capture groups', -> found = {} drop_match = (str) -> table.insert found, str '' res = re.sub '{\\k10}a{\\k15}b{\\k30}c', '\\\\k[[:digit:]]+', drop_match assert.is.not.nil res assert.is.equal '{}a{}b{}c', res assert.is.equal 3, #found assert.is.equal '\\k10', found[1] assert.is.equal '\\k15', found[2] assert.is.equal '\\k30', found[3] it 'should return the input unchanged if the replacement function does not return a string', -> found = {} mutate_external = (str) -> table.insert found, str nil res = re.sub '{\\k10}a{\\k15}b{\\k30}c', '\\\\k([[:digit:]]+)', mutate_external assert.is.not.nil res assert.is.equal '{\\k10}a{\\k15}b{\\k30}c', res assert.is.equal 3, #found assert.is.equal '10', found[1] assert.is.equal '15', found[2] assert.is.equal '30', found[3] it 'should be able to do case-insensitive replacements on English', -> res = re.sub '{\\K10}a{\\K15}b{\\k30}c', '\\\\k', '\\\\kf', re.ICASE assert.is.not.nil res assert.is.equal '{\\kf10}a{\\kf15}b{\\kf30}c', res it 'should be able to do case-insensitive replacements on Greek', -> res = re.sub '!συνεργ!', 'Συνεργ', 'foo', re.ICASE assert.is.not.nil res assert.is.equal '!foo!', res it 'should be able to limit the number of replacements', -> res = re.sub 'aaa', 'a', 'b', 2 assert.is.not.nil res assert.is.equal 'bba', res it 'should return the input unchanged if there are no matches', -> assert.is.equal('a', re.sub 'a', 'b', 'c') it 'should be able to do simple string replacements', -> res = re.sub '{\\k10}a{\\k15}b{\\k30}c', '\\\\k', '\\\\kf' assert.is.not.nil res assert.is.equal '{\\kf10}a{\\kf15}b{\\kf30}c', res it 'should replace only once when given a zero-length-bol-match', -> res = re.sub 'abc', '^', 'd' assert.is.not.nil res assert.is.equal 'dabc', res it 'should replace only once when given a zero-length-bow-match', -> res = re.sub 'abc abc', '\\<', 'd' assert.is.not.nil res assert.is.equal 'dabc dabc', res it 'should replace only once when given a zero-length-bob-match', -> res = re.sub 'abc', '\\A', 'd' assert.is.not.nil res assert.is.equal 'dabc', res assert_empty_match_and_return_d = (str) -> assert.is.equal '', str 'd' it 'should replace only once when given a zero-length-bol-match and a function replacements', -> res = re.sub 'abc', '^', assert_empty_match_and_return_d assert.is.not.nil res assert.is.equal 'dabc', res it 'should replace only once when given a zero-length-bow-match and a function replacements', -> res = re.sub 'abc abc', '\\<', assert_empty_match_and_return_d assert.is.not.nil res assert.is.equal 'dabc dabc', res it 'should replace only once when given a zero-length-bob-match and a function replacements', -> res = re.sub 'abc', '\\A', assert_empty_match_and_return_d assert.is.not.nil res assert.is.equal 'dabc', res it 'should replace only once when given a zero-length-eol-match', -> res = re.sub 'abc', '$', 'd' assert.is.not.nil res assert.is.equal 'abcd', res it 'should replace only once when given a zero-length-eol-match and a function replacements', -> res = re.sub 'abc', '$', assert_empty_match_and_return_d assert.is.not.nil res assert.is.equal 'abcd', res it 'should apply unanchored zero-length matches at each point in the string', -> res = re.sub 'abc', 'e?', 'd' assert.is.not.nil res assert.is.equal 'dadbdcd', res res = re.sub 'abc', 'b*', 'd' assert.is.not.nil res assert.is.equal 'daddcd', res it 'should apply unanchored zero-length matches with function insertions at each point in the string', -> res = re.sub 'abc', 'e?', assert_empty_match_and_return_d assert.is.not.nil res assert.is.equal 'dadbdcd', res automation/tests/aegisub.cpp0000664000175000017500000000505214741067256015531 0ustar aniolaniol// 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 #include #include #include #include #include using namespace agi::lua; namespace { void check(lua_State *L, int status) { if (status && !lua_isnil(L, -1)) { fprintf(stderr, "%s\n", get_string_or_default(L, -1).c_str()); exit(status); } } int close_and_exit(lua_State *L) { int status = (int)lua_tointeger(L, 1); lua_close(L); exit(status); } } int main(int argc, char **argv) { if (argc < 2) { fprintf(stderr, "usage: aegisub-lua

Note: I cannot reply to GMail, Google Workplace, Outlook or Office365 mail addresses, since they prefer to mindlessly filter out mails sent from small domains using independent mail servers, such as mine. If you don't like that, please complain to Google or Microsoft, not me.

Copyright

All documentation is Copyright © 2005-2023 Mike Pall.


subprojects/luajit/doc/ext_c_api.html0000644000175000017500000001321614741067622017301 0ustar aniolaniol Lua/C API Extensions

LuaJIT adds some extensions to the standard Lua/C API. The LuaJIT include directory must be in the compiler search path (-Ipath) to be able to include the required header for C code:

#include "luajit.h"

Or for C++ code:

#include "lua.hpp"

luaJIT_setmode(L, idx, mode) — Control VM

This is a C API extension to allow control of the VM from C code. The full prototype of LuaJIT_setmode is:

LUA_API int luaJIT_setmode(lua_State *L, int idx, int mode);

The returned status is either success (1) or failure (0). The second argument is either 0 or a stack index (similar to the other Lua/C API functions).

The third argument specifies the mode, which is 'or'ed with a flag. The flag can be LUAJIT_MODE_OFF to turn a feature off, LUAJIT_MODE_ON to turn a feature on, or LUAJIT_MODE_FLUSH to flush cached code.

The following modes are defined:

luaJIT_setmode(L, 0, LUAJIT_MODE_ENGINE|flag)

Turn the whole JIT compiler on or off or flush the whole cache of compiled code.

luaJIT_setmode(L, idx, LUAJIT_MODE_FUNC|flag)
luaJIT_setmode(L, idx, LUAJIT_MODE_ALLFUNC|flag)
luaJIT_setmode(L, idx, LUAJIT_MODE_ALLSUBFUNC|flag)

This sets the mode for the function at the stack index idx or the parent of the calling function (idx = 0). It either enables JIT compilation for a function, disables it and flushes any already compiled code, or only flushes already compiled code. This applies recursively to all sub-functions of the function with LUAJIT_MODE_ALLFUNC or only to the sub-functions with LUAJIT_MODE_ALLSUBFUNC.

luaJIT_setmode(L, trace,
  LUAJIT_MODE_TRACE|LUAJIT_MODE_FLUSH)

Flushes the specified root trace and all of its side traces from the cache. The code for the trace will be retained as long as there are any other traces which link to it.

luaJIT_setmode(L, idx, LUAJIT_MODE_WRAPCFUNC|flag)

This mode defines a wrapper function for calls to C functions. If called with LUAJIT_MODE_ON, the stack index at idx must be a lightuserdata object holding a pointer to the wrapper function. From now on, all C functions are called through the wrapper function. If called with LUAJIT_MODE_OFF this mode is turned off and all C functions are directly called.

The wrapper function can be used for debugging purposes or to catch and convert foreign exceptions. But please read the section on C++ exception interoperability first. Recommended usage can be seen in this C++ code excerpt:

#include <exception>
#include "lua.hpp"

// Catch C++ exceptions and convert them to Lua error messages.
// Customize as needed for your own exception classes.
static int wrap_exceptions(lua_State *L, lua_CFunction f)
{
  try {
    return f(L);  // Call wrapped function and return result.
  } catch (const char *s) {  // Catch and convert exceptions.
    lua_pushstring(L, s);
  } catch (std::exception& e) {
    lua_pushstring(L, e.what());
  } catch (...) {
    lua_pushliteral(L, "caught (...)");
  }
  return lua_error(L);  // Rethrow as a Lua error.
}

static int myinit(lua_State *L)
{
  ...
  // Define wrapper function and enable it.
  lua_pushlightuserdata(L, (void *)wrap_exceptions);
  luaJIT_setmode(L, -1, LUAJIT_MODE_WRAPCFUNC|LUAJIT_MODE_ON);
  lua_pop(L, 1);
  ...
}

Note that you can only define a single global wrapper function, so be careful when using this mechanism from multiple C++ modules. Also note that this mechanism is not without overhead.


subprojects/luajit/doc/luajit.html0000644000175000017500000001511114741067622016632 0ustar aniolaniol LuaJIT

LuaJIT is a Just-In-Time Compiler (JIT) for the » Lua programming language. Lua is a powerful, dynamic and light-weight programming language. It may be embedded or used as a general-purpose, stand-alone language.

LuaJIT is Copyright © 2005-2023 Mike Pall, released under the » MIT open source license.

Compatibility

WindowsLinuxBSDmacOSPOSIX
EmbeddedAndroidiOS
PS3PS4
PS5
PS VitaXbox 360Xbox OneNintendo
Switch
GCCClang
LLVM
MSVC
x86
x64
ARM
ARM64
PPCMIPS32
MIPS64
Lua 5.1
API+ABI
+ JIT+ BitOp+ FFIDrop-in
DLL/.so

Overview

LuaJIT has been successfully used as a scripting middleware in games, appliances, network and graphics apps, numerical simulations, trading platforms and many other specialty applications.

LuaJIT is part of a hundred million web sites, huge SaaS installations, network switches, set-top boxes and other embedded devices. You've probably already used LuaJIT without knowing about it.

LuaJIT scales from embedded devices, smartphones, desktops up to server farms. It combines high flexibility with high performance and an unmatched low memory footprint.

LuaJIT has been in continuous development since 2005. It's widely considered to be one of the fastest dynamic language implementations. It has outperformed other dynamic languages on many cross-language benchmarks since its first release — often by a substantial margin.

For LuaJIT 2.0, the whole VM has been rewritten from the ground up and relentlessly optimized for performance. It combines a high-speed interpreter, written in assembler, with a state-of-the-art JIT compiler.

An innovative trace compiler is integrated with advanced, SSA-based optimizations and highly tuned code generation backends. A substantial reduction of the overhead associated with dynamic languages allows it to break into the performance range traditionally reserved for offline, static language compilers.

More ...

Please select a sub-topic in the navigation bar to learn more about LuaJIT.


subprojects/luajit/doc/ext_jit.html0000644000175000017500000001334314741067622017015 0ustar aniolaniol jit.* Library

The functions in this built-in module control the behavior of the JIT compiler engine. Note that JIT-compilation is fully automatic — you probably won't need to use any of the following functions unless you have special needs.

jit.on()
jit.off()

Turns the whole JIT compiler on (default) or off.

These functions are typically used with the command line options -j on or -j off.

jit.flush()

Flushes the whole cache of compiled code.

jit.on(func|true [,true|false])
jit.off(func|true [,true|false])
jit.flush(func|true [,true|false])

jit.on enables JIT compilation for a Lua function (this is the default).

jit.off disables JIT compilation for a Lua function and flushes any already compiled code from the code cache.

jit.flush flushes the code, but doesn't affect the enable/disable status.

The current function, i.e. the Lua function calling this library function, can also be specified by passing true as the first argument.

If the second argument is true, JIT compilation is also enabled, disabled or flushed recursively for all sub-functions of a function. With false only the sub-functions are affected.

The jit.on and jit.off functions only set a flag which is checked when the function is about to be compiled. They do not trigger immediate compilation.

Typical usage is jit.off(true, true) in the main chunk of a module to turn off JIT compilation for the whole module for debugging purposes.

jit.flush(tr)

Flushes the root trace, specified by its number, and all of its side traces from the cache. The code for the trace will be retained as long as there are any other traces which link to it.

status, ... = jit.status()

Returns the current status of the JIT compiler. The first result is either true or false if the JIT compiler is turned on or off. The remaining results are strings for CPU-specific features and enabled optimizations.

jit.version

Contains the LuaJIT version string.

jit.version_num

Contains the version number of the LuaJIT core. Version xx.yy.zz is represented by the decimal number xxyyzz.
DEPRECATED after the switch to » rolling releases. zz is frozen at 99.

jit.os

Contains the target OS name: "Windows", "Linux", "OSX", "BSD", "POSIX" or "Other".

jit.arch

Contains the target architecture name: "x86", "x64", "arm", "arm64", "arm64be", "ppc", "mips", "mipsel", "mips64", "mips64el", "mips64r6", "mips64r6el".

jit.opt.* — JIT compiler optimization control

This submodule provides the backend for the -O command line option.

You can also use it programmatically, e.g.:

jit.opt.start(2) -- same as -O2
jit.opt.start("-dce")
jit.opt.start("hotloop=10", "hotexit=2")

Unlike in LuaJIT 1.x, the module is built-in and optimization is turned on by default! It's no longer necessary to run require("jit.opt").start(), which was one of the ways to enable optimization.

jit.util.* — JIT compiler introspection

This submodule holds functions to introspect the bytecode, generated traces, the IR and the generated machine code. The functionality provided by this module is still in flux and therefore undocumented.

The debug modules -jbc, -jv and -jdump make extensive use of these functions. Please check out their source code, if you want to know more.


subprojects/luajit/doc/ext_ffi_tutorial.html0000644000175000017500000005347714741067622020732 0ustar aniolaniol FFI Tutorial

This page is intended to give you an overview of the features of the FFI library by presenting a few use cases and guidelines.

This page makes no attempt to explain all of the FFI library, though. You'll want to have a look at the ffi.* API function reference and the FFI semantics to learn more.

Loading the FFI Library

The FFI library is built into LuaJIT by default, but it's not loaded and initialized by default. The suggested way to use the FFI library is to add the following to the start of every Lua file that needs one of its functions:

local ffi = require("ffi")

Please note, this doesn't define an ffi variable in the table of globals — you really need to use the local variable. The require function ensures the library is only loaded once.

Note: If you want to experiment with the FFI from the interactive prompt of the command line executable, omit the local, as it doesn't preserve local variables across lines.

Accessing Standard System Functions

The following code explains how to access standard system functions. We slowly print two lines of dots by sleeping for 10 milliseconds after each dot:

 
①





②
③
④



⑤





⑥local ffi = require("ffi")
ffi.cdef[[
void Sleep(int ms);
int poll(struct pollfd *fds, unsigned long nfds, int timeout);
]]

local sleep
if ffi.os == "Windows" then
  function sleep(s)
    ffi.C.Sleep(s*1000)
  end
else
  function sleep(s)
    ffi.C.poll(nil, 0, s*1000)
  end
end

for i=1,160 do
  io.write("."); io.flush()
  sleep(0.01)
end
io.write("\n")

Here's the step-by-step explanation:

This defines the C library functions we're going to use. The part inside the double-brackets (in green) is just standard C syntax. You can usually get this info from the C header files or the documentation provided by each C library or C compiler.

The difficulty we're facing here, is that there are different standards to choose from. Windows has a simple Sleep() function. On other systems there are a variety of functions available to achieve sub-second sleeps, but with no clear consensus. Thankfully poll() can be used for this task, too, and it's present on most non-Windows systems. The check for ffi.os makes sure we use the Windows-specific function only on Windows systems.

Here we're wrapping the call to the C function in a Lua function. This isn't strictly necessary, but it's helpful to deal with system-specific issues only in one part of the code. The way we're wrapping it ensures the check for the OS is only done during initialization and not for every call.

A more subtle point is that we defined our sleep() function (for the sake of this example) as taking the number of seconds, but accepting fractional seconds. Multiplying this by 1000 gets us milliseconds, but that still leaves it a Lua number, which is a floating-point value. Alas, the Sleep() function only accepts an integer value. Luckily for us, the FFI library automatically performs the conversion when calling the function (truncating the FP value towards zero, like in C).

Some readers will notice that Sleep() is part of KERNEL32.DLL and is also a stdcall function. So how can this possibly work? The FFI library provides the ffi.C default C library namespace, which allows calling functions from the default set of libraries, like a C compiler would. Also, the FFI library automatically detects stdcall functions, so you don't need to declare them as such.

The poll() function takes a couple more arguments we're not going to use. You can simply use nil to pass a NULL pointer and 0 for the nfds parameter. Please note, that the number 0 does not convert to a pointer value, unlike in C++. You really have to pass pointers to pointer arguments and numbers to number arguments.

The page on FFI semantics has all of the gory details about conversions between Lua objects and C types. For the most part you don't have to deal with this, as it's performed automatically and it's carefully designed to bridge the semantic differences between Lua and C.

Now that we have defined our own sleep() function, we can just call it from plain Lua code. That wasn't so bad, huh? Turning these boring animated dots into a fascinating best-selling game is left as an exercise for the reader. :-)

Accessing the zlib Compression Library

The following code shows how to access the » zlib compression library from Lua code. We'll define two convenience wrapper functions that take a string and compress or uncompress it to another string:

 
①






②


③

④


⑤


⑥







⑦local ffi = require("ffi")
ffi.cdef[[
unsigned long compressBound(unsigned long sourceLen);
int compress2(uint8_t *dest, unsigned long *destLen,
	      const uint8_t *source, unsigned long sourceLen, int level);
int uncompress(uint8_t *dest, unsigned long *destLen,
	       const uint8_t *source, unsigned long sourceLen);
]]
local zlib = ffi.load(ffi.os == "Windows" and "zlib1" or "z")

local function compress(txt)
  local n = zlib.compressBound(#txt)
  local buf = ffi.new("uint8_t[?]", n)
  local buflen = ffi.new("unsigned long[1]", n)
  local res = zlib.compress2(buf, buflen, txt, #txt, 9)
  assert(res == 0)
  return ffi.string(buf, buflen[0])
end

local function uncompress(comp, n)
  local buf = ffi.new("uint8_t[?]", n)
  local buflen = ffi.new("unsigned long[1]", n)
  local res = zlib.uncompress(buf, buflen, comp, #comp)
  assert(res == 0)
  return ffi.string(buf, buflen[0])
end

-- Simple test code.
local txt = string.rep("abcd", 1000)
print("Uncompressed size: ", #txt)
local c = compress(txt)
print("Compressed size: ", #c)
local txt2 = uncompress(c, #txt)
assert(txt2 == txt)

Here's the step-by-step explanation:

This defines some of the C functions provided by zlib. For the sake of this example, some type indirections have been reduced and it uses the predefined fixed-size integer types, while still adhering to the zlib API/ABI.

This loads the zlib shared library. On POSIX systems, it's named libz.so and usually comes pre-installed. Since ffi.load() automatically adds any missing standard prefixes/suffixes, we can simply load the "z" library. On Windows it's named zlib1.dll and you'll have to download it first from the » zlib site. The check for ffi.os makes sure we pass the right name to ffi.load().

First, the maximum size of the compression buffer is obtained by calling the zlib.compressBound function with the length of the uncompressed string. The next line allocates a byte buffer of this size. The [?] in the type specification indicates a variable-length array (VLA). The actual number of elements of this array is given as the 2nd argument to ffi.new().

This may look strange at first, but have a look at the declaration of the compress2 function from zlib: the destination length is defined as a pointer! This is because you pass in the maximum buffer size and get back the actual length that was used.

In C you'd pass in the address of a local variable (&buflen). But since there's no address-of operator in Lua, we'll just pass in a one-element array. Conveniently, it can be initialized with the maximum buffer size in one step. Calling the actual zlib.compress2 function is then straightforward.

We want to return the compressed data as a Lua string, so we'll use ffi.string(). It needs a pointer to the start of the data and the actual length. The length has been returned in the buflen array, so we'll just get it from there.

Note that since the function returns now, the buf and buflen variables will eventually be garbage collected. This is fine, because ffi.string() has copied the contents to a newly created (interned) Lua string. If you plan to call this function lots of times, consider reusing the buffers and/or handing back the results in buffers instead of strings. This will reduce the overhead for garbage collection and string interning.

The uncompress functions does the exact opposite of the compress function. The compressed data doesn't include the size of the original string, so this needs to be passed in. Otherwise, no surprises here.

The code, that makes use of the functions we just defined, is just plain Lua code. It doesn't need to know anything about the LuaJIT FFI — the convenience wrapper functions completely hide it.

One major advantage of the LuaJIT FFI is that you are now able to write those wrappers in Lua. And at a fraction of the time it would cost you to create an extra C module using the Lua/C API. Many of the simpler C functions can probably be used directly from your Lua code, without any wrappers.

Side note: the zlib API uses the long type for passing lengths and sizes around. But all those zlib functions actually only deal with 32 bit values. This is an unfortunate choice for a public API, but may be explained by zlib's history — we'll just have to deal with it.

First, you should know that a long is a 64 bit type e.g. on POSIX/x64 systems, but a 32 bit type on Windows/x64 and on 32 bit systems. Thus a long result can be either a plain Lua number or a boxed 64 bit integer cdata object, depending on the target system.

Ok, so the ffi.* functions generally accept cdata objects wherever you'd want to use a number. That's why we get a away with passing n to ffi.string() above. But other Lua library functions or modules don't know how to deal with this. So for maximum portability, one needs to use tonumber() on returned long results before passing them on. Otherwise the application might work on some systems, but would fail in a POSIX/x64 environment.

Defining Metamethods for a C Type

The following code explains how to define metamethods for a C type. We define a simple point type and add some operations to it:

 
①



②

③

④



⑤

⑥local ffi = require("ffi")
ffi.cdef[[
typedef struct { double x, y; } point_t;
]]

local point
local mt = {
  __add = function(a, b) return point(a.x+b.x, a.y+b.y) end,
  __len = function(a) return math.sqrt(a.x*a.x + a.y*a.y) end,
  __index = {
    area = function(a) return a.x*a.x + a.y*a.y end,
  },
}
point = ffi.metatype("point_t", mt)

local a = point(3, 4)
print(a.x, a.y)  --> 3  4
print(#a)        --> 5
print(a:area())  --> 25
local b = a + point(0.5, 8)
print(#b)        --> 12.5

Here's the step-by-step explanation:

This defines the C type for a two-dimensional point object.

We have to declare the variable holding the point constructor first, because it's used inside of a metamethod.

Let's define an __add metamethod which adds the coordinates of two points and creates a new point object. For simplicity, this function assumes that both arguments are points. But it could be any mix of objects, if at least one operand is of the required type (e.g. adding a point plus a number or vice versa). Our __len metamethod returns the distance of a point to the origin.

If we run out of operators, we can define named methods, too. Here, the __index table defines an area function. For custom indexing needs, one might want to define __index and __newindex functions instead.

This associates the metamethods with our C type. This only needs to be done once. For convenience, a constructor is returned by ffi.metatype(). We're not required to use it, though. The original C type can still be used e.g. to create an array of points. The metamethods automatically apply to any and all uses of this type.

Please note, that the association with a metatable is permanent and the metatable must not be modified afterwards! Ditto for the __index table.

Here are some simple usage examples for the point type and their expected results. The predefined operations (such as a.x) can be freely mixed with the newly defined metamethods. Note that area is a method and must be called with the Lua syntax for methods: a:area(), not a.area().

The C type metamethod mechanism is most useful when used in conjunction with C libraries that are written in an object-oriented style. Creators return a pointer to a new instance, and methods take an instance pointer as the first argument. Sometimes you can just point __index to the library namespace and __gc to the destructor and you're done. But often enough you'll want to add convenience wrappers, e.g. to return actual Lua strings or when returning multiple values.

Some C libraries only declare instance pointers as an opaque void * type. In this case you can use a fake type for all declarations, e.g. a pointer to a named (incomplete) struct will do: typedef struct foo_type *foo_handle. The C side doesn't know what you declare with the LuaJIT FFI, but as long as the underlying types are compatible, everything still works.

Translating C Idioms

Here's a list of common C idioms and their translation to the LuaJIT FFI:

Idiom C code Lua code
Pointer dereference
int *p;
x = *p;
*p = y;
x = p[0]
p[0] = y
Pointer indexing
int i, *p;
x = p[i];
p[i+1] = y;
x = p[i]
p[i+1] = y
Array indexing
int i, a[];
x = a[i];
a[i+1] = y;
x = a[i]
a[i+1] = y
struct/union dereference
struct foo s;
x = s.field;
s.field = y;
x = s.field
s.field = y
struct/union pointer deref.
struct foo *sp;
x = sp->field;
sp->field = y;
x = s.field
s.field = y
Pointer arithmetic
int i, *p;
x = p + i;
y = p - i;
x = p + i
y = p - i
Pointer difference
int *p1, *p2;
x = p1 - p2;x = p1 - p2
Array element pointer
int i, a[];
x = &a[i];x = a+i
Cast pointer to address
int *p;
x = (intptr_t)p;x = tonumber(
 ffi.cast("intptr_t",
          p))
Functions with outargs
void foo(int *inoutlen);
int len = x;
foo(&len);
y = len;
local len =
  ffi.new("int[1]", x)
foo(len)
y = len[0]
Vararg conversions
int printf(char *fmt, ...);
printf("%g", 1.0);
printf("%d", 1);
 
printf("%g", 1);
printf("%d",
  ffi.new("int", 1))

To Cache or Not to Cache

It's a common Lua idiom to cache library functions in local variables or upvalues, e.g.:

local byte, char = string.byte, string.char
local function foo(x)
  return char(byte(x)+1)
end

This replaces several hash-table lookups with a (faster) direct use of a local or an upvalue. This is less important with LuaJIT, since the JIT compiler optimizes hash-table lookups a lot and is even able to hoist most of them out of the inner loops. It can't eliminate all of them, though, and it saves some typing for often-used functions. So there's still a place for this, even with LuaJIT.

The situation is a bit different with C function calls via the FFI library. The JIT compiler has special logic to eliminate all of the lookup overhead for functions resolved from a C library namespace! Thus it's not helpful and actually counter-productive to cache individual C functions like this:

local funca, funcb = ffi.C.funca, ffi.C.funcb -- Not helpful!
local function foo(x, n)
  for i=1,n do funcb(funca(x, i), 1) end
end

This turns them into indirect calls and generates bigger and slower machine code. Instead, you'll want to cache the namespace itself and rely on the JIT compiler to eliminate the lookups:

local C = ffi.C          -- Instead use this!
local function foo(x, n)
  for i=1,n do C.funcb(C.funca(x, i), 1) end
end

This generates both shorter and faster code. So don't cache C functions, but do cache namespaces! Most often the namespace is already in a local variable at an outer scope, e.g. from local lib = ffi.load(...). Note that copying it to a local variable in the function scope is unnecessary.


subprojects/luajit/doc/running.html0000644000175000017500000003376414741067622017040 0ustar aniolaniol Running LuaJIT

LuaJIT has only a single stand-alone executable, called luajit on POSIX systems or luajit.exe on Windows. It can be used to run simple Lua statements or whole Lua applications from the command line. It has an interactive mode, too.

Command Line Options

The luajit stand-alone executable is just a slightly modified version of the regular lua stand-alone executable. It supports the same basic options, too. luajit -h prints a short list of the available options. Please have a look at the » Lua manual for details.

LuaJIT has some additional options:

-b[options] input output

This option saves or lists bytecode. The following additional options are accepted:

  • -l — Only list bytecode.
  • -s — Strip debug info (this is the default).
  • -g — Keep debug info.
  • -W — Generate 32 bit (non-GC64) bytecode.
  • -X — Generate 64 bit (GC64) bytecode.
  • -d — Generate bytecode in deterministic manner.
  • -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).
  • -F name — Override filename (default: input filename).
  • -e chunk — Use chunk string as input.
  • - (a single minus sign) — Use stdin as input and/or stdout as output.

The output file type is auto-detected from the extension of the output file name:

  • c — C source file, exported bytecode data.
  • cc — C++ source file, exported bytecode data.
  • h — C/C++ header file, static bytecode data.
  • obj or o — Object file, exported bytecode data (OS- and architecture-specific).
  • raw or any other extension — Raw bytecode file (portable).

Notes:

  • See also string.dump() for information on bytecode portability and compatibility.
  • A file in raw bytecode format is auto-detected and can be loaded like any Lua source file. E.g. directly from the command line or with loadfile(), dofile() etc.
  • To statically embed the bytecode of a module in your application, generate an object file and just link it with your application.
  • On most ELF-based systems (e.g. Linux) you need to explicitly export the global symbols when linking your application, e.g. with: -Wl,-E
  • require() tries to load embedded bytecode data from exported symbols (in *.exe or lua51.dll on Windows) and from shared libraries in package.cpath.

Typical usage examples:

luajit -b test.lua test.out                 # Save bytecode to test.out
luajit -bg test.lua test.out                # Keep debug info
luajit -be "print('hello world')" test.out  # Save cmdline script

luajit -bl test.lua                         # List to stdout
luajit -bl test.lua test.txt                # List to test.txt
luajit -ble "print('hello world')"          # List cmdline script

luajit -b test.lua test.obj                 # Generate object file
# Link test.obj with your application and load it with require("test")

-j cmd[=arg[,arg...]]

This option performs a LuaJIT control command or activates one of the loadable extension modules. The command is first looked up in the jit.* library. If no matching function is found, a module named jit.<cmd> is loaded and the start() function of the module is called with the specified arguments (if any). The space between -j and cmd is optional.

Here are the available LuaJIT control commands:

  • -jon — Turns the JIT compiler on (default).
  • -joff — Turns the JIT compiler off (only use the interpreter).
  • -jflush — Flushes the whole cache of compiled code.
  • -jv — Shows verbose information about the progress of the JIT compiler.
  • -jdump — Dumps the code and structures used in various compiler stages.
  • -jp — Start the integrated profiler.

The -jv and -jdump commands are extension modules written in Lua. They are mainly used for debugging the JIT compiler itself. For a description of their options and output format, please read the comment block at the start of their source. They can be found in the lib directory of the source distribution or installed under the jit directory. By default, this is /usr/local/share/luajit-XX.YY.ZZ>/jit on POSIX systems (replace XX.YY.ZZ by the installed version).

-O[level]
-O[+]flag   -O-flag
-Oparam=value

This options allows fine-tuned control of the optimizations used by the JIT compiler. This is mainly intended for debugging LuaJIT itself. Please note that the JIT compiler is extremely fast (we are talking about the microsecond to millisecond range). Disabling optimizations doesn't have any visible impact on its overhead, but usually generates code that runs slower.

The first form sets an optimization level — this enables a specific mix of optimization flags. -O0 turns off all optimizations and higher numbers enable more optimizations. Omitting the level (i.e. just -O) sets the default optimization level, which is -O3 in the current version.

The second form adds or removes individual optimization flags. The third form sets a parameter for the VM or the JIT compiler to a specific value.

You can either use this option multiple times (like -Ocse -O-dce -Ohotloop=10) or separate several settings with a comma (like -O+cse,-dce,hotloop=10). The settings are applied from left to right, and later settings override earlier ones. You can freely mix the three forms, but note that setting an optimization level overrides all earlier flags.

Note that -Ofma is not enabled by default at any level, because it affects floating-point result accuracy. Only enable this, if you fully understand the trade-offs of FMA for performance (higher), determinism (lower) and numerical accuracy (higher).

Here are the available flags and at what optimization levels they are enabled:

Flag -O1 -O2 -O3  
foldConstant Folding, Simplifications and Reassociation
cseCommon-Subexpression Elimination
dceDead-Code Elimination
narrow Narrowing of numbers to integers
loop Loop Optimizations (code hoisting)
fwd  Load Forwarding (L2L) and Store Forwarding (S2L)
dse  Dead-Store Elimination
abc  Array Bounds Check Elimination
sink  Allocation/Store Sinking
fuse  Fusion of operands into instructions
fma    Fused multiply-add

Here are the parameters and their default settings:

Parameter Default  
maxtrace1000Max. number of traces in the cache
maxrecord4000Max. number of recorded IR instructions
maxirconst500Max. number of IR constants of a trace
maxside100Max. number of side traces of a root trace
maxsnap500Max. number of snapshots for a trace
hotloop56Number of iterations to detect a hot loop or hot call
hotexit10Number of taken exits to start a side trace
tryside4Number of attempts to compile a side trace
instunroll4Max. unroll factor for instable loops
loopunroll15Max. unroll factor for loop ops in side traces
callunroll3Max. unroll factor for pseudo-recursive calls
recunroll2Min. unroll factor for true recursion
sizemcode32Size of each machine code area in KBytes (Windows: 64K)
maxmcode512Max. total size of all machine code areas in KBytes

subprojects/luajit/.gitattributes0000644000175000017500000000002614741067622016601 0ustar aniolaniol/.relver export-subst subprojects/luajit/meson.build0000644000175000017500000000332714741067416016060 0ustar aniolaniolproject('luajit', 'c', version: '2.1.0', license: 'MIT') cc = meson.get_compiler('c') system_deps = [ cc.find_library('dl', required: false), cc.find_library('m', required: false) ] # get architecture id for the host machine so it can be set when compiling buildvm natively lj_target_id = cc.get_define('LUAJIT_TARGET', prefix: '#include "@0@/src/lj_arch.h"'.format(meson.current_source_dir())) add_project_arguments('-DLUAJIT_TARGET=@0@'.format(lj_target_id), language: 'c', native: true) # compat flag is needed for both the buildvm code generator (compiled natively) and luajit itself 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) 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) ljvm_mode = 'machasm' ljvm_bout = 'lj_vm.s' elif host_machine.system() == 'windows' add_project_arguments('-DLUAJIT_OS=LUAJIT_OS_WINDOWS', language: 'c', native: true) if cc.get_id() != 'msvc' add_project_arguments('-malign-double', language: 'c', native: true) endif ljvm_mode = 'peobj' ljvm_bout = 'lj_vm.o' else error('Unsupported platform') endif subdir('src') luajit_dep = declare_dependency(link_with: luajit_lib, include_directories: src_inc) subprojects/luajit/etc/0000755000175000017500000000000014741067622014463 5ustar aniolaniolsubprojects/luajit/etc/luajit.pc0000644000175000017500000000112714741067622016300 0ustar aniolaniol# Package information for LuaJIT to be used by pkg-config. majver=2 minver=1 relver=ROLLING version=${majver}.${minver}.${relver} abiver=5.1 prefix=/usr/local multilib=lib exec_prefix=${prefix} libdir=${exec_prefix}/${multilib} libname=luajit-${abiver} includedir=${prefix}/include/luajit-${majver}.${minver} INSTALL_LMOD=${prefix}/share/lua/${abiver} INSTALL_CMOD=${prefix}/${multilib}/lua/${abiver} Name: LuaJIT Description: Just-in-time compiler for Lua URL: https://luajit.org Version: ${version} Requires: Libs: -L${libdir} -l${libname} Libs.private: -Wl,-E -lm -ldl Cflags: -I${includedir} subprojects/luajit/etc/luajit.10000644000175000017500000000444614741067622016045 0ustar aniolaniol.TH luajit 1 "" "" "LuaJIT documentation" .SH NAME luajit \- Just-In-Time Compiler for the Lua Language \fB .SH SYNOPSIS .B luajit [\fIoptions\fR]... [\fIscript\fR [\fIargs\fR]...] .SH "WEB SITE" .IR https://luajit.org .SH DESCRIPTION .PP This is the command-line program to run Lua programs with \fBLuaJIT\fR. .PP \fBLuaJIT\fR is a just-in-time (JIT) compiler for the Lua language. The virtual machine (VM) is based on a fast interpreter combined with a trace compiler. It can significantly improve the performance of Lua programs. .PP \fBLuaJIT\fR is API\- and ABI-compatible with the VM of the standard Lua\ 5.1 interpreter. When embedding the VM into an application, the built library can be used as a drop-in replacement. .SH OPTIONS .TP .BI "\-e " chunk Run the given chunk of Lua code. .TP .BI "\-l " library Load the named library, just like \fBrequire("\fR\fIlibrary\fR\fB")\fR. .TP .BI "\-b " ... Save or list bytecode. Run without arguments to get help on options. .TP .BI "\-j " command Perform LuaJIT control command (optional space after \fB\-j\fR). .TP .BI "\-O" [opt] Control LuaJIT optimizations. .TP .B "\-i" Run in interactive mode. .TP .B "\-v" Show \fBLuaJIT\fR version. .TP .B "\-E" Ignore environment variables. .TP .B "\-\-" Stop processing options. .TP .B "\-" Read script from stdin instead. .PP After all options are processed, the given \fIscript\fR is run. The arguments are passed in the global \fIarg\fR table. .PP Interactive mode is only entered, if no \fIscript\fR and no \fB\-e\fR option is given. Interactive mode can be left with EOF (\fICtrl\-Z\fB). .SH EXAMPLES .TP luajit hello.lua world Prints "Hello world", assuming \fIhello.lua\fR contains: .br print("Hello", arg[1]) .TP luajit \-e "local x=0; for i=1,1e9 do x=x+i end; print(x)" Calculates the sum of the numbers from 1 to 1000000000. .br And finishes in a reasonable amount of time, too. .TP luajit \-jv \-e "for i=1,10 do for j=1,10 do for k=1,100 do end end end" Runs some nested loops and shows the resulting traces. .SH COPYRIGHT .PP \fBLuaJIT\fR is Copyright \(co 2005-2023 Mike Pall. .br \fBLuaJIT\fR is open source software, released under the MIT license. .SH SEE ALSO .PP More details in the provided HTML docs or at: .IR https://luajit.org .br More about the Lua language can be found at: .IR https://lua.org/docs.html .PP lua(1) subprojects/luajit/README0000644000175000017500000000066614741067622014600 0ustar aniolaniolREADME for LuaJIT 2.1 --------------------- LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. Project Homepage: https://luajit.org/ LuaJIT is Copyright (C) 2005-2023 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 subprojects/luajit/COPYRIGHT0000644000175000017500000000556714741067622015220 0ustar aniolaniol=============================================================================== LuaJIT -- a Just-In-Time Compiler for Lua. https://luajit.org/ Copyright (C) 2005-2023 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: https://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 https://creativecommons.org/licenses/publicdomain =============================================================================== subprojects/luajit/.relver0000644000175000017500000000001514741067622015204 0ustar aniolaniol$Format:%ct$ subprojects/luajit/Makefile0000644000175000017500000001441214741067622015352 0ustar aniolaniol############################################################################## # LuaJIT top level Makefile for installation. Requires GNU Make. # # Please read doc/install.html before changing any variables! # # Suitable for POSIX platforms (Linux, *BSD, OSX etc.). # Note: src/Makefile has many more configurable options. # # ##### This Makefile is NOT useful for Windows! ##### # For MSVC, please follow the instructions given in src/msvcbuild.bat. # For MinGW and Cygwin, cd to src and run make with the Makefile there. # # Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h ############################################################################## MAJVER= 2 MINVER= 1 ABIVER= 5.1 # LuaJIT uses rolling releases. The release version is based on the time of # the latest git commit. The 'git' command must be available during the build. RELVER= $(shell cat src/luajit_relver.txt 2>/dev/null || : ) # Note: setting it with := doesn't work, since it will change during the build. MMVERSION= $(MAJVER).$(MINVER) VERSION= $(MMVERSION).$(RELVER) ############################################################################## # # Change the installation path as needed. This automatically adjusts # the paths in src/luaconf.h, too. Note: PREFIX must be an absolute path! # export PREFIX= /usr/local export MULTILIB= lib ############################################################################## DPREFIX= $(DESTDIR)$(PREFIX) INSTALL_BIN= $(DPREFIX)/bin INSTALL_LIB= $(DPREFIX)/$(MULTILIB) INSTALL_SHARE_= $(PREFIX)/share INSTALL_SHARE= $(DESTDIR)$(INSTALL_SHARE_) INSTALL_DEFINC= $(DPREFIX)/include/luajit-$(MMVERSION) INSTALL_INC= $(INSTALL_DEFINC) export INSTALL_LJLIBD= $(INSTALL_SHARE_)/luajit-$(MMVERSION) INSTALL_JITLIB= $(DESTDIR)$(INSTALL_LJLIBD)/jit INSTALL_LMODD= $(INSTALL_SHARE)/lua INSTALL_LMOD= $(INSTALL_LMODD)/$(ABIVER) INSTALL_CMODD= $(INSTALL_LIB)/lua INSTALL_CMOD= $(INSTALL_CMODD)/$(ABIVER) INSTALL_MAN= $(INSTALL_SHARE)/man/man1 INSTALL_PKGCONFIG= $(INSTALL_LIB)/pkgconfig INSTALL_TNAME= luajit-$(VERSION) INSTALL_TSYMNAME= luajit INSTALL_ANAME= libluajit-$(ABIVER).a INSTALL_SOSHORT1= libluajit-$(ABIVER).so INSTALL_SOSHORT2= libluajit-$(ABIVER).so.$(MAJVER) INSTALL_SONAME= libluajit-$(ABIVER).so.$(VERSION) INSTALL_DYLIBSHORT1= libluajit-$(ABIVER).dylib INSTALL_DYLIBSHORT2= libluajit-$(ABIVER).$(MAJVER).dylib INSTALL_DYLIBNAME= libluajit-$(ABIVER).$(VERSION).dylib INSTALL_PCNAME= luajit.pc INSTALL_STATIC= $(INSTALL_LIB)/$(INSTALL_ANAME) INSTALL_DYN= $(INSTALL_LIB)/$(INSTALL_SONAME) INSTALL_SHORT1= $(INSTALL_LIB)/$(INSTALL_SOSHORT1) INSTALL_SHORT2= $(INSTALL_LIB)/$(INSTALL_SOSHORT2) INSTALL_T= $(INSTALL_BIN)/$(INSTALL_TNAME) INSTALL_TSYM= $(INSTALL_BIN)/$(INSTALL_TSYMNAME) INSTALL_PC= $(INSTALL_PKGCONFIG)/$(INSTALL_PCNAME) INSTALL_DIRS= $(INSTALL_BIN) $(INSTALL_LIB) $(INSTALL_INC) $(INSTALL_MAN) \ $(INSTALL_PKGCONFIG) $(INSTALL_JITLIB) $(INSTALL_LMOD) $(INSTALL_CMOD) UNINSTALL_DIRS= $(INSTALL_JITLIB) $(DESTDIR)$(INSTALL_LJLIBD) $(INSTALL_INC) \ $(INSTALL_LMOD) $(INSTALL_LMODD) $(INSTALL_CMOD) $(INSTALL_CMODD) RM= rm -f MKDIR= mkdir -p RMDIR= rmdir 2>/dev/null SYMLINK= ln -sf INSTALL_X= install -m 0755 INSTALL_F= install -m 0644 UNINSTALL= $(RM) LDCONFIG= ldconfig -n 2>/dev/null SED_PC= sed -e "s|^prefix=.*|prefix=$(PREFIX)|" \ -e "s|^multilib=.*|multilib=$(MULTILIB)|" \ -e "s|^relver=.*|relver=$(RELVER)|" ifneq ($(INSTALL_DEFINC),$(INSTALL_INC)) SED_PC+= -e "s|^includedir=.*|includedir=$(INSTALL_INC)|" endif FILE_T= luajit FILE_A= libluajit.a FILE_SO= libluajit.so FILE_MAN= luajit.1 FILE_PC= luajit.pc FILES_INC= lua.h lualib.h lauxlib.h luaconf.h lua.hpp luajit.h FILES_JITLIB= bc.lua bcsave.lua dump.lua p.lua v.lua zone.lua \ dis_x86.lua dis_x64.lua dis_arm.lua dis_arm64.lua \ dis_arm64be.lua dis_ppc.lua dis_mips.lua dis_mipsel.lua \ dis_mips64.lua dis_mips64el.lua \ dis_mips64r6.lua dis_mips64r6el.lua \ vmdef.lua ifeq (,$(findstring Windows,$(OS))) HOST_SYS:= $(shell uname -s) else HOST_SYS= Windows endif TARGET_SYS?= $(HOST_SYS) ifeq (Darwin,$(TARGET_SYS)) INSTALL_SONAME= $(INSTALL_DYLIBNAME) INSTALL_SOSHORT1= $(INSTALL_DYLIBSHORT1) INSTALL_SOSHORT2= $(INSTALL_DYLIBSHORT2) LDCONFIG= : SED_PC+= -e "s| -Wl,-E||" endif ############################################################################## INSTALL_DEP= src/luajit default all $(INSTALL_DEP): @echo "==== Building LuaJIT $(MMVERSION) ====" $(MAKE) -C src @echo "==== Successfully built LuaJIT $(MMVERSION) ====" install: $(INSTALL_DEP) @echo "==== Installing LuaJIT $(VERSION) to $(PREFIX) ====" $(MKDIR) $(INSTALL_DIRS) cd src && $(INSTALL_X) $(FILE_T) $(INSTALL_T) cd src && test -f $(FILE_A) && $(INSTALL_F) $(FILE_A) $(INSTALL_STATIC) || : $(RM) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) cd src && test -f $(FILE_SO) && \ $(INSTALL_X) $(FILE_SO) $(INSTALL_DYN) && \ ( $(LDCONFIG) $(INSTALL_LIB) || : ) && \ $(SYMLINK) $(INSTALL_SONAME) $(INSTALL_SHORT1) && \ $(SYMLINK) $(INSTALL_SONAME) $(INSTALL_SHORT2) || : cd etc && $(INSTALL_F) $(FILE_MAN) $(INSTALL_MAN) cd etc && $(SED_PC) $(FILE_PC) > $(FILE_PC).tmp && \ $(INSTALL_F) $(FILE_PC).tmp $(INSTALL_PC) && \ $(RM) $(FILE_PC).tmp cd src && $(INSTALL_F) $(FILES_INC) $(INSTALL_INC) cd src/jit && $(INSTALL_F) $(FILES_JITLIB) $(INSTALL_JITLIB) $(SYMLINK) $(INSTALL_TNAME) $(INSTALL_TSYM) @echo "==== Successfully installed LuaJIT $(VERSION) to $(PREFIX) ====" uninstall: @echo "==== Uninstalling LuaJIT $(VERSION) from $(PREFIX) ====" $(UNINSTALL) $(INSTALL_TSYM) $(INSTALL_T) $(INSTALL_STATIC) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) $(INSTALL_MAN)/$(FILE_MAN) $(INSTALL_PC) for file in $(FILES_JITLIB); do \ $(UNINSTALL) $(INSTALL_JITLIB)/$$file; \ done for file in $(FILES_INC); do \ $(UNINSTALL) $(INSTALL_INC)/$$file; \ done $(LDCONFIG) $(INSTALL_LIB) $(RMDIR) $(UNINSTALL_DIRS) || : @echo "==== Successfully uninstalled LuaJIT $(VERSION) from $(PREFIX) ====" ############################################################################## amalg: @echo "==== Building LuaJIT $(MMVERSION) (amalgamation) ====" $(MAKE) -C src amalg @echo "==== Successfully built LuaJIT $(MMVERSION) (amalgamation) ====" clean: $(MAKE) -C src clean .PHONY: all install amalg clean ############################################################################## subprojects/luajit/src/0000755000175000017500000000000014741067622014477 5ustar aniolaniolsubprojects/luajit/src/lj_obj.h0000644000175000017500000010761614741067622016122 0ustar aniolaniol/* ** LuaJIT VM tags, values and objects. ** Copyright (C) 2005-2023 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 --------------------------------------------------- */ /* Memory and GC object sizes. */ typedef uint32_t MSize; #if LJ_GC64 typedef uint64_t GCSize; #else typedef uint32_t GCSize; #endif /* Memory reference */ typedef struct MRef { #if LJ_GC64 uint64_t ptr64; /* True 64 bit pointer. */ #else uint32_t ptr32; /* Pseudo 32 bit pointer. */ #endif } MRef; #if LJ_GC64 #define mref(r, t) ((t *)(void *)(r).ptr64) #define mrefu(r) ((r).ptr64) #define setmref(r, p) ((r).ptr64 = (uint64_t)(void *)(p)) #define setmrefu(r, u) ((r).ptr64 = (uint64_t)(u)) #define setmrefr(r, v) ((r).ptr64 = (v).ptr64) #else #define mref(r, t) ((t *)(void *)(uintptr_t)(r).ptr32) #define mrefu(r) ((r).ptr32) #define setmref(r, p) ((r).ptr32 = (uint32_t)(uintptr_t)(void *)(p)) #define setmrefu(r, u) ((r).ptr32 = (uint32_t)(u)) #define setmrefr(r, v) ((r).ptr32 = (v).ptr32) #endif /* -- GC object references ------------------------------------------------ */ /* GCobj reference */ typedef struct GCRef { #if LJ_GC64 uint64_t gcptr64; /* True 64 bit pointer. */ #else uint32_t gcptr32; /* Pseudo 32 bit pointer. */ #endif } 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. */ #if LJ_GC64 #define gcref(r) ((GCobj *)(r).gcptr64) #define gcrefp(r, t) ((t *)(void *)(r).gcptr64) #define gcrefu(r) ((r).gcptr64) #define gcrefeq(r1, r2) ((r1).gcptr64 == (r2).gcptr64) #define setgcref(r, gc) ((r).gcptr64 = (uint64_t)&(gc)->gch) #define setgcreft(r, gc, it) \ (r).gcptr64 = (uint64_t)&(gc)->gch | (((uint64_t)(it)) << 47) #define setgcrefp(r, p) ((r).gcptr64 = (uint64_t)(p)) #define setgcrefnull(r) ((r).gcptr64 = 0) #define setgcrefr(r, v) ((r).gcptr64 = (v).gcptr64) #else #define gcref(r) ((GCobj *)(uintptr_t)(r).gcptr32) #define gcrefp(r, t) ((t *)(void *)(uintptr_t)(r).gcptr32) #define gcrefu(r) ((r).gcptr32) #define gcrefeq(r1, r2) ((r1).gcptr32 == (r2).gcptr32) #define setgcref(r, gc) ((r).gcptr32 = (uint32_t)(uintptr_t)&(gc)->gch) #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) #endif #define gcnext(gc) (gcref((gc)->gch.nextgc)) /* 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_buf.h. */ #define SBufHeader char *w, *e, *b; MRef L typedef struct SBuf { SBufHeader; } SBuf; /* -- Tags and values ----------------------------------------------------- */ /* Frame link. */ typedef union { int32_t ftsz; /* Frame type and size of previous frame. */ MRef pcr; /* Or 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. */ #if LJ_GC64 GCRef gcr; /* GCobj reference with tag. */ int64_t it64; struct { LJ_ENDIAN_LOHI( int32_t i; /* Integer value. */ , uint32_t it; /* Internal object tag. Must overlap MSW of number. */ ) }; #else 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. */ ) }; #endif #if LJ_FR2 int64_t ftsz; /* Frame type and size of previous frame, or PC. */ #else struct { LJ_ENDIAN_LOHI( GCRef func; /* Function for next frame (or dummy L). */ , FrameLink tp; /* Link to previous frame. */ ) } fr; #endif 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. ** ** Format for 32 bit GC references (!LJ_GC64): ** ** 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|seg| ofs | (64 bit platforms) ** GC objects | itype | GCRef | ** int (LJ_DUALNUM)| itype | int | ** number -------double------ ** ** Format for 64 bit GC references (LJ_GC64): ** ** The upper 13 bits must be 1 (0xfff8...) for a special NaN. The next ** 4 bits hold the internal tag. The lowest 47 bits either hold a pointer, ** a zero-extended 32 bit integer or all bits set to 1 for primitive types. ** ** ------MSW------.------LSW------ ** primitive types |1..1|itype|1..................1| ** GC objects |1..1|itype|-------GCRef--------| ** lightuserdata |1..1|itype|seg|------ofs-------| ** int (LJ_DUALNUM) |1..1|itype|0..0|-----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 && !LJ_GC64 #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 /* Type marker for slot holding a traversal index. Must be lightuserdata. */ #define LJ_KEYINDEX 0xfffe7fffu #if LJ_GC64 #define LJ_GCVMASK (((uint64_t)1 << 47) - 1) #endif #if LJ_64 /* To stay within 47 bits, lightuserdata is segmented. */ #define LJ_LIGHTUD_BITS_SEG 8 #define LJ_LIGHTUD_BITS_LO (47 - LJ_LIGHTUD_BITS_SEG) #endif /* -- String object ------------------------------------------------------- */ typedef uint32_t StrHash; /* String hash value. */ typedef uint32_t StrID; /* String ID. */ /* String object header. String payload follows. */ typedef struct GCstr { GCHeader; uint8_t reserved; /* Used by lexer for fast lookup of reserved words. */ uint8_t hashalg; /* Hash algorithm. */ StrID sid; /* Interned string ID. */ StrHash 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)) /* -- 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_BUFFER, /* String buffer. */ 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. */ #if LJ_GC64 uint32_t unused_gc64; #endif 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)(pt)->sizekgc+1u, \ 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. */ #if !LJ_GC64 MRef freetop; /* Top of free elements (stored in t->node[0]). */ #endif } 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). */ #if LJ_GC64 MRef freetop; /* Top of free elements. */ #endif } GCtab; #define sizetabcolo(n) ((n)*sizeof(TValue) + sizeof(GCtab)) #define tabref(r) ((GCtab *)gcref((r))) #define noderef(r) (mref((r), Node)) #define nextnode(n) (mref((n)->next, Node)) #if LJ_GC64 #define getfreetop(t, n) (noderef((t)->freetop)) #define setfreetop(t, n, v) (setmref((t)->freetop, (v))) #else #define getfreetop(t, n) (noderef((n)->freetop)) #define setfreetop(t, n, v) (setmref((n)->freetop, (v))) #endif /* -- 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. */ #if LJ_HASFFI GCROOT_FFI_FIN, /* FFI finalizer table. */ #endif 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)])) /* Garbage collector state. */ typedef struct GCState { GCSize total; /* Memory currently allocated. */ GCSize threshold; /* Memory threshold. */ uint8_t currentwhite; /* Current white color. */ uint8_t state; /* GC state. */ uint8_t unused0; #if LJ_64 uint8_t lightudnum; /* Number of lightuserdata segments - 1. */ #else uint8_t unused1; #endif 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). */ GCSize debt; /* Debt (how much GC is behind schedule). */ GCSize estimate; /* Estimate of memory actually in use. */ MSize stepmul; /* Incremental GC step granularity. */ MSize pause; /* Pause between successive GC cycles. */ #if LJ_64 MRef lightudseg; /* Upper bits of lightuserdata segments. */ #endif } GCState; /* String interning state. */ typedef struct StrInternState { GCRef *tab; /* String hash table anchors. */ MSize mask; /* String hash mask (size of hash table - 1). */ MSize num; /* Number of strings in hash table. */ StrID id; /* Next string ID. */ uint8_t idreseed; /* String ID reseed counter. */ uint8_t second; /* String interning table uses secondary hashing. */ uint8_t unused1; uint8_t unused2; LJ_ALIGN(8) uint64_t seed; /* Random string seed. */ } StrInternState; /* Global state, shared by all threads of a Lua universe. */ typedef struct global_State { lua_Alloc allocf; /* Memory allocator. */ void *allocd; /* Memory allocator data. */ GCState gc; /* Garbage collector. */ 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. */ StrInternState str; /* String interning. */ volatile int32_t vmstate; /* VM state or current JIT code trace number. */ GCRef mainthref; /* Link to main thread. */ SBuf tmpbuf; /* Temporary string buffer. */ TValue tmptv, tmptv2; /* Temporary TValues. */ Node nilnode; /* Fallback 1-element hash part (nil key and value). */ TValue registrytv; /* Anchor for registry. */ 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. */ BCIns bc_cfunc_int; /* Bytecode for internal C function calls. */ BCIns bc_cfunc_ext; /* Bytecode for external C function calls. */ GCRef cur_L; /* Currently executing lua_State. */ MRef jit_base; /* Current JIT code L->base or NULL. */ MRef ctype_state; /* Pointer to C type state. */ PRNGState prng; /* Global PRNG 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_PROFILE 0x80 #define hook_active(g) ((g)->hookmask & HOOK_ACTIVE) #define hook_enter(g) ((g)->hookmask |= HOOK_ACTIVE) #define hook_entergc(g) \ ((g)->hookmask = ((g)->hookmask | (HOOK_ACTIVE|HOOK_GC)) & ~HOOK_PROFILE) #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. */ #if LJ_GC64 #define curr_func(L) (&gcval(L->base-2)->fn) #elif LJ_FR2 #define curr_func(L) (&gcref((L->base-2)->gcr)->fn) #else #define curr_func(L) (&gcref((L->base-1)->fr.func)->fn) #endif #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) #if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK) LJ_FUNC_NORET void lj_assert_fail(global_State *g, const char *file, int line, const char *func, const char *fmt, ...); #endif /* -- 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 ---------------------------------------------- */ /* Macros to test types. */ #if LJ_GC64 #define itype(o) ((uint32_t)((o)->it64 >> 47)) #define tvisnil(o) ((o)->it64 == -1) #else #define itype(o) ((o)->it) #define tvisnil(o) (itype(o) == LJ_TNIL) #endif #define tvisfalse(o) (itype(o) == LJ_TFALSE) #define tvistrue(o) (itype(o) == LJ_TTRUE) #define tvisbool(o) (tvisfalse(o) || tvistrue(o)) #if LJ_64 && !LJ_GC64 #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 && !LJ_GC64 #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. */ #if LJ_GC64 #define gcval(o) ((GCobj *)(gcrefu((o)->gcr) & LJ_GCVMASK)) #else #define gcval(o) (gcref((o)->gcr)) #endif #define boolV(o) check_exp(tvisbool(o), (LJ_TFALSE - itype(o))) #if LJ_64 #define lightudseg(u) \ (((u) >> LJ_LIGHTUD_BITS_LO) & ((1 << LJ_LIGHTUD_BITS_SEG)-1)) #define lightudlo(u) \ ((u) & (((uint64_t)1 << LJ_LIGHTUD_BITS_LO) - 1)) #define lightudup(p) \ ((uint32_t)(((p) >> LJ_LIGHTUD_BITS_LO) << (LJ_LIGHTUD_BITS_LO-32))) static LJ_AINLINE void *lightudV(global_State *g, cTValue *o) { uint64_t u = o->u64; uint64_t seg = lightudseg(u); uint32_t *segmap = mref(g->gc.lightudseg, uint32_t); lj_assertG(tvislightud(o), "lightuserdata expected"); if (seg == (1 << LJ_LIGHTUD_BITS_SEG)-1) return NULL; lj_assertG(seg <= g->gc.lightudnum, "bad lightuserdata segment %d", seg); return (void *)(((uint64_t)segmap[seg] << 32) | lightudlo(u)); } #else #define lightudV(g, 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. */ #if LJ_GC64 #define setitype(o, i) ((o)->it = ((i) << 15)) #define setnilV(o) ((o)->it64 = -1) #define setpriV(o, x) ((o)->it64 = (int64_t)~((uint64_t)~(x)<<47)) #define setboolV(o, x) ((o)->it64 = (int64_t)~((uint64_t)((x)+1)<<47)) #else #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)) #define setpriV(o, i) (setitype((o), (i))) #endif static LJ_AINLINE void setrawlightudV(TValue *o, void *p) { #if LJ_GC64 o->u64 = (uint64_t)p | (((uint64_t)LJ_TLIGHTUD) << 47); #elif LJ_64 o->u64 = (uint64_t)p | (((uint64_t)0xffff) << 48); #else setgcrefp(o->gcr, p); setitype(o, LJ_TLIGHTUD); #endif } #if LJ_FR2 || LJ_32 #define contptr(f) ((void *)(f)) #define setcont(o, f) ((o)->u64 = (uint64_t)(uintptr_t)contptr(f)) #else #define contptr(f) \ ((void *)(uintptr_t)(uint32_t)((intptr_t)(f) - (intptr_t)lj_vm_asm_begin)) #define setcont(o, f) \ ((o)->u64 = (uint64_t)(void *)(f) - (uint64_t)lj_vm_asm_begin) #endif static LJ_AINLINE void checklivetv(lua_State *L, TValue *o, const char *msg) { UNUSED(L); UNUSED(o); UNUSED(msg); #if LUA_USE_ASSERT if (tvisgcv(o)) { lj_assertL(~itype(o) == gcval(o)->gch.gct, "mismatch of TValue type %d vs GC type %d", ~itype(o), gcval(o)->gch.gct); /* Copy of isdead check from lj_gc.h to avoid circular include. */ lj_assertL(!(gcval(o)->gch.marked & (G(L)->gc.currentwhite ^ 3) & 3), msg); } #endif } static LJ_AINLINE void setgcVraw(TValue *o, GCobj *v, uint32_t itype) { #if LJ_GC64 setgcreft(o->gcr, v, itype); #else setgcref(o->gcr, v); setitype(o, itype); #endif } static LJ_AINLINE void setgcV(lua_State *L, TValue *o, GCobj *v, uint32_t it) { setgcVraw(o, v, it); checklivetv(L, o, "store to dead GC object"); } #define define_setV(name, type, tag) \ static LJ_AINLINE void name(lua_State *L, TValue *o, const 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; checklivetv(L, o1, "copy of dead GC object"); } /* -- Number to integer conversion ---------------------------------------- */ #if LJ_SOFTFP LJ_ASMF int32_t lj_vm_tobit(double x); #if LJ_TARGET_MIPS64 LJ_ASMF int32_t lj_vm_tointg(double x); #endif #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 } #define lj_num2int(n) ((int32_t)(n)) /* ** This must match the JIT backend behavior. In particular for archs ** that don't have a common hardware instruction for this conversion. ** Note that signed FP to unsigned int conversions have an undefined ** result and should never be relied upon in portable FFI code. ** See also: C99 or C11 standard, 6.3.1.4, footnote of (1). */ static LJ_AINLINE uint64_t lj_num2u64(lua_Number n) { #if LJ_TARGET_X86ORX64 || LJ_TARGET_MIPS int64_t i = (int64_t)n; if (i < 0) i = (int64_t)(n - 18446744073709551616.0); return (uint64_t)i; #else return (uint64_t)n; #endif } 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_FASTCALL lj_obj_equal(cTValue *o1, cTValue *o2); LJ_FUNC const void * LJ_FASTCALL lj_obj_ptr(global_State *g, cTValue *o); #if LJ_ABI_PAUTH #if LJ_TARGET_ARM64 #include #define lj_ptr_sign(ptr, ctx) \ ptrauth_sign_unauthenticated((ptr), ptrauth_key_function_pointer, (ctx)) #define lj_ptr_strip(ptr) ptrauth_strip((ptr), ptrauth_key_function_pointer) #else #error "No support for pointer authentication for this architecture" #endif #else #define lj_ptr_sign(ptr, ctx) (ptr) #define lj_ptr_strip(ptr) (ptr) #endif #endif subprojects/luajit/src/lj_strfmt.h0000644000175000017500000001114114741067622016652 0ustar aniolaniol/* ** String formatting. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #ifndef _LJ_STRFMT_H #define _LJ_STRFMT_H #include "lj_obj.h" typedef uint32_t SFormat; /* Format indicator. */ /* Format parser state. */ typedef struct FormatState { const uint8_t *p; /* Current format string pointer. */ const uint8_t *e; /* End of format string. */ const char *str; /* Returned literal string. */ MSize len; /* Size of literal string. */ } FormatState; /* Format types (max. 16). */ typedef enum FormatType { STRFMT_EOF, STRFMT_ERR, STRFMT_LIT, STRFMT_INT, STRFMT_UINT, STRFMT_NUM, STRFMT_STR, STRFMT_CHAR, STRFMT_PTR } FormatType; /* Format subtypes (bits are reused). */ #define STRFMT_T_HEX 0x0010 /* STRFMT_UINT */ #define STRFMT_T_OCT 0x0020 /* STRFMT_UINT */ #define STRFMT_T_FP_A 0x0000 /* STRFMT_NUM */ #define STRFMT_T_FP_E 0x0010 /* STRFMT_NUM */ #define STRFMT_T_FP_F 0x0020 /* STRFMT_NUM */ #define STRFMT_T_FP_G 0x0030 /* STRFMT_NUM */ #define STRFMT_T_QUOTED 0x0010 /* STRFMT_STR */ /* Format flags. */ #define STRFMT_F_LEFT 0x0100 #define STRFMT_F_PLUS 0x0200 #define STRFMT_F_ZERO 0x0400 #define STRFMT_F_SPACE 0x0800 #define STRFMT_F_ALT 0x1000 #define STRFMT_F_UPPER 0x2000 /* Format indicator fields. */ #define STRFMT_SH_WIDTH 16 #define STRFMT_SH_PREC 24 #define STRFMT_TYPE(sf) ((FormatType)((sf) & 15)) #define STRFMT_WIDTH(sf) (((sf) >> STRFMT_SH_WIDTH) & 255u) #define STRFMT_PREC(sf) ((((sf) >> STRFMT_SH_PREC) & 255u) - 1u) #define STRFMT_FP(sf) (((sf) >> 4) & 3) /* Formats for conversion characters. */ #define STRFMT_A (STRFMT_NUM|STRFMT_T_FP_A) #define STRFMT_C (STRFMT_CHAR) #define STRFMT_D (STRFMT_INT) #define STRFMT_E (STRFMT_NUM|STRFMT_T_FP_E) #define STRFMT_F (STRFMT_NUM|STRFMT_T_FP_F) #define STRFMT_G (STRFMT_NUM|STRFMT_T_FP_G) #define STRFMT_I STRFMT_D #define STRFMT_O (STRFMT_UINT|STRFMT_T_OCT) #define STRFMT_P (STRFMT_PTR) #define STRFMT_Q (STRFMT_STR|STRFMT_T_QUOTED) #define STRFMT_S (STRFMT_STR) #define STRFMT_U (STRFMT_UINT) #define STRFMT_X (STRFMT_UINT|STRFMT_T_HEX) #define STRFMT_G14 (STRFMT_G | ((14+1) << STRFMT_SH_PREC)) /* Maximum buffer sizes for conversions. */ #define STRFMT_MAXBUF_XINT (1+22) /* '0' prefix + uint64_t in octal. */ #define STRFMT_MAXBUF_INT (1+10) /* Sign + int32_t in decimal. */ #define STRFMT_MAXBUF_NUM 32 /* Must correspond with STRFMT_G14. */ #define STRFMT_MAXBUF_PTR (2+2*sizeof(ptrdiff_t)) /* "0x" + hex ptr. */ /* Format parser. */ LJ_FUNC SFormat LJ_FASTCALL lj_strfmt_parse(FormatState *fs); static LJ_AINLINE void lj_strfmt_init(FormatState *fs, const char *p, MSize len) { fs->p = (const uint8_t *)p; fs->e = (const uint8_t *)p + len; /* Must be NUL-terminated. May have NULs inside, too. */ lj_assertX(*fs->e == 0, "format not NUL-terminated"); } /* Raw conversions. */ LJ_FUNC char * LJ_FASTCALL lj_strfmt_wint(char *p, int32_t k); LJ_FUNC char * LJ_FASTCALL lj_strfmt_wptr(char *p, const void *v); LJ_FUNC char * LJ_FASTCALL lj_strfmt_wuleb128(char *p, uint32_t v); LJ_FUNC const char *lj_strfmt_wstrnum(lua_State *L, cTValue *o, MSize *lenp); /* Unformatted conversions to buffer. */ LJ_FUNC SBuf * LJ_FASTCALL lj_strfmt_putint(SBuf *sb, int32_t k); #if LJ_HASJIT LJ_FUNC SBuf * LJ_FASTCALL lj_strfmt_putnum(SBuf *sb, cTValue *o); #endif LJ_FUNC SBuf * LJ_FASTCALL lj_strfmt_putptr(SBuf *sb, const void *v); #if LJ_HASJIT LJ_FUNC SBuf * LJ_FASTCALL lj_strfmt_putquoted(SBuf *sb, GCstr *str); #endif /* Formatted conversions to buffer. */ LJ_FUNC SBuf *lj_strfmt_putfxint(SBuf *sb, SFormat sf, uint64_t k); LJ_FUNC SBuf *lj_strfmt_putfnum_int(SBuf *sb, SFormat sf, lua_Number n); LJ_FUNC SBuf *lj_strfmt_putfnum_uint(SBuf *sb, SFormat sf, lua_Number n); LJ_FUNC SBuf *lj_strfmt_putfnum(SBuf *sb, SFormat, lua_Number n); LJ_FUNC SBuf *lj_strfmt_putfchar(SBuf *sb, SFormat, int32_t c); #if LJ_HASJIT LJ_FUNC SBuf *lj_strfmt_putfstr(SBuf *sb, SFormat, GCstr *str); #endif LJ_FUNC int lj_strfmt_putarg(lua_State *L, SBuf *sb, int arg, int retry); /* Conversions to strings. */ LJ_FUNC GCstr * LJ_FASTCALL lj_strfmt_int(lua_State *L, int32_t k); LJ_FUNCA GCstr * LJ_FASTCALL lj_strfmt_num(lua_State *L, cTValue *o); LJ_FUNCA GCstr * LJ_FASTCALL lj_strfmt_number(lua_State *L, cTValue *o); #if LJ_HASJIT LJ_FUNC GCstr * LJ_FASTCALL lj_strfmt_char(lua_State *L, int c); #endif LJ_FUNC GCstr * LJ_FASTCALL lj_strfmt_obj(lua_State *L, cTValue *o); /* Internal string formatting. */ LJ_FUNC const char *lj_strfmt_pushvf(lua_State *L, const char *fmt, va_list argp); LJ_FUNC const char *lj_strfmt_pushf(lua_State *L, const char *fmt, ...) #if defined(__GNUC__) || defined(__clang__) __attribute__ ((format (printf, 2, 3))) #endif ; #endif subprojects/luajit/src/lj_gdbjit.h0000644000175000017500000000072014741067622016577 0ustar aniolaniol/* ** Client for the GDB JIT API. ** Copyright (C) 2005-2023 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 subprojects/luajit/src/lj_state.c0000644000175000017500000002772514741067622016465 0ustar aniolaniol/* ** State and stack handling. ** Copyright (C) 2005-2023 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_buf.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_prng.h" #include "lj_lex.h" #include "lj_alloc.h" #include "luajit.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. ** LJ_FR2: We need 2 more slots for the frame PC and the continuation PC. */ /* 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; lj_assertL((MSize)(tvref(L->maxstack)-oldst) == L->stacksize-LJ_STACK_EXTRA-1, "inconsistent stack size"); st = (TValue *)lj_mem_realloc(L, tvref(L->stack), (MSize)(oldsize*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; if ((size_t)(mref(G(L)->jit_base, char) - (char *)oldst) < oldsize) setmref(G(L)->jit_base, mref(G(L)->jit_base, char) + delta); 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)); } /* 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 && /* Don't shrink stack of live trace. */ (tvref(G(L)->jit_base) == NULL || obj2gco(L) != gcref(G(L)->cur_L))) resizestack(L, L->stacksize >> 1); } /* Try to grow stack. */ void LJ_FASTCALL lj_state_growstack(lua_State *L, MSize need) { MSize n = L->stacksize + need; if (LJ_LIKELY(n < LJ_STACK_MAX)) { /* The stack can grow as requested. */ if (n < 2 * L->stacksize) { /* Try to double the size. */ n = 2 * L->stacksize; if (n > LJ_STACK_MAX) n = LJ_STACK_MAX; } resizestack(L, n); } else { /* Request would overflow. Raise a stack overflow error. */ if (LJ_HASJIT) { TValue *base = tvref(G(L)->jit_base); if (base) L->base = base; } if (curr_funcisL(L)) { L->top = curr_topL(L); if (L->top > tvref(L->maxstack)) { /* The current Lua frame violates the stack, so replace it with a ** dummy. This can happen when BC_IFUNCF is trying to grow the stack. */ L->top = L->base; setframe_gc(L->base - 1 - LJ_FR2, obj2gco(L), LJ_TTHREAD); } } if (L->stacksize <= LJ_STACK_MAXEX) { /* An error handler might want to inspect the stack overflow error, but ** will need some stack space to run in. We give it a stack size beyond ** the normal limit in order to do so, then rely on lj_state_relimitstack ** calls during unwinding to bring us back to a convential stack size. ** The + 1 is space for the error message, and 2 * LUA_MINSTACK is for ** the lj_state_checkstack() call in lj_err_run(). */ resizestack(L, LJ_STACK_MAX + 1 + 2 * LUA_MINSTACK); lj_err_stkov(L); /* May invoke an error handler. */ } else { /* If we're here, then the stack overflow error handler is requesting ** to grow the stack even further. We have no choice but to abort the ** error handler. */ GCstr *em = lj_err_str(L, LJ_ERR_STKOV); /* Might OOM. */ setstrV(L, L->top++, em); /* There is always space to push an error. */ lj_err_throw(L, LUA_ERRERR); /* Does not invoke an error handler. */ } } } void LJ_FASTCALL lj_state_growstack1(lua_State *L) { lj_state_growstack(L, 1); } static TValue *cpgrowstack(lua_State *co, lua_CFunction dummy, void *ud) { UNUSED(dummy); lj_state_growstack(co, *(MSize *)ud); return NULL; } int LJ_FASTCALL lj_state_cpgrowstack(lua_State *L, MSize need) { return lj_vm_cpcall(L, NULL, &need, cpgrowstack); } /* 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); setthreadV(L1, st++, L1); /* Needed for curr_funcisL() on empty stack. */ if (LJ_FR2) setnilV(st++); L1->base = L1->top = st; 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_init(L); 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; #if LJ_HASFFI lj_ctype_initfin(L); #endif lj_trace_initstate(g); lj_err_verify(); 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); lj_assertG(gcref(g->gc.root) == obj2gco(L), "main thread is not first GC object"); lj_assertG(g->str.num == 0, "leaked %d strings", g->str.num); lj_trace_freestate(g); #if LJ_HASFFI lj_ctype_freestate(g); #endif lj_str_freetab(g); lj_buf_free(g, &g->tmpbuf); lj_mem_freevec(g, tvref(L->stack), L->stacksize, TValue); #if LJ_64 if (mref(g->gc.lightudseg, uint32_t)) { MSize segnum = g->gc.lightudnum ? (2 << lj_fls(g->gc.lightudnum)) : 2; lj_mem_freevec(g, mref(g->gc.lightudseg, uint32_t), segnum, uint32_t); } #endif lj_assertG(g->gc.total == sizeof(GG_State), "memory leak of %lld bytes", (long long)(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 && !LJ_GC64 && !(defined(LUAJIT_USE_VALGRIND) && defined(LUAJIT_USE_SYSMALLOC)) lua_State *lj_state_newstate(lua_Alloc allocf, void *allocd) #else LUA_API lua_State *lua_newstate(lua_Alloc allocf, void *allocd) #endif { PRNGState prng; GG_State *GG; lua_State *L; global_State *g; /* We need the PRNG for the memory allocator, so initialize this first. */ if (!lj_prng_seed_secure(&prng)) { lj_assertX(0, "secure PRNG seeding failed"); /* Can only return NULL here, so this errors with "not enough memory". */ return NULL; } #ifndef LUAJIT_USE_SYSMALLOC if (allocf == LJ_ALLOCF_INTERNAL) { allocd = lj_alloc_create(&prng); if (!allocd) return NULL; allocf = lj_alloc_f; } #endif GG = (GG_State *)allocf(allocd, NULL, 0, sizeof(GG_State)); if (GG == NULL || !checkptrGC(GG)) return NULL; memset(GG, 0, sizeof(GG_State)); L = &GG->L; g = &GG->g; 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 = allocf; g->allocd = allocd; g->prng = prng; #ifndef LUAJIT_USE_SYSMALLOC if (allocf == lj_alloc_f) { lj_alloc_setprng(allocd, &g->prng); } #endif setgcref(g->mainthref, obj2gco(L)); setgcref(g->uvhead.prev, obj2gco(&g->uvhead)); setgcref(g->uvhead.next, obj2gco(&g->uvhead)); g->str.mask = ~(MSize)0; setnilV(registry(L)); setnilV(&g->nilnode.val); setnilV(&g->nilnode.key); #if !LJ_GC64 setmref(g->nilnode.freetop, &g->nilnode); #endif lj_buf_init(NULL, &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 = LUA_OK; 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. */ #if LJ_HASPROFILE luaJIT_profile_stop(L); #endif setgcrefnull(g->cur_L); 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 = LUA_OK; L->base = L->top = tvref(L->stack) + 1 + LJ_FR2; L->cframe = NULL; if (lj_vm_cpcall(L, NULL, NULL, cpfinalize) == LUA_OK) { 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 = LUA_OK; 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 */ lj_assertL(iswhite(obj2gco(L1)), "new thread object is not white"); return L1; } void LJ_FASTCALL lj_state_free(global_State *g, lua_State *L) { lj_assertG(L != mainthread(g), "free of main thread"); if (obj2gco(L) == gcref(g->cur_L)) setgcrefnull(g->cur_L); if (gcref(L->openupval) != NULL) { lj_func_closeuv(L, tvref(L->stack)); lj_trace_abort(g); /* For aa_uref soundness. */ lj_assertG(gcref(L->openupval) == NULL, "stale open upvalues"); } lj_mem_freevec(g, tvref(L->stack), L->stacksize, TValue); lj_mem_freet(g, L); } subprojects/luajit/src/lib_base.c0000644000175000017500000004262114741067622016410 0ustar aniolaniol/* ** Base and coroutine library. ** Copyright (C) 2005-2023 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_buf.h" #include "lj_str.h" #include "lj_tab.h" #include "lj_meta.h" #include "lj_state.h" #include "lj_frame.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_strfmt.h" #include "lj_lib.h" /* -- Base library: checks ------------------------------------------------ */ #define LJLIB_MODULE_base LJLIB_ASM(assert) LJLIB_REC(.) { lj_lib_checkany(L, 1); if (L->top == L->base+1) lj_err_caller(L, LJ_ERR_ASSERT); else if (tvisstr(L->base+1) || tvisnumber(L->base+1)) lj_err_callermsg(L, strdata(lj_lib_checkstr(L, 2))); else lj_err_run(L); 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) LJLIB_REC(.) { lj_lib_checktab(L, 1); lj_err_msg(L, LJ_ERR_NEXTIDX); 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-LJ_FR2, mo); /* Replace callable. */ return FFH_TAILCALL; } else { if (!tvistab(o)) lj_err_argt(L, 1, LUA_TTABLE); if (LJ_FR2) { copyTV(L, o-1, o); o--; } 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) LJLIB_REC(xpairs 0) { 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(xpairs 1) { 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-LJ_FR2, t); return FFH_RES(1); } LJLIB_CF(getfenv) LJLIB_REC(.) { 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); if (LJ_FR2) o--; } 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); if (LJ_FR2) o--; } 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); uint32_t nu; if (i > e) return 0; nu = (uint32_t)e - (uint32_t)i; n = (int32_t)(nu+1); if (nu >= LUAI_MAXCSTACK || !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-LJ_FR2, 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-LJ_FR2, i); return FFH_RES(1); } lj_cconv_ct_tv(cts, ctype_get(cts, CTID_DOUBLE), (uint8_t *)&(L->base-1-LJ_FR2)->n, o, 0); return FFH_RES(1); } } #endif } else { const char *p = strdata(lj_lib_checkstr(L, 1)); char *ep; unsigned int neg = 0; unsigned long ul; if (base < 2 || base > 36) lj_err_arg(L, 2, LJ_ERR_BASERNG); while (lj_char_isspace((unsigned char)(*p))) p++; if (*p == '-') { p++; neg = 1; } else if (*p == '+') { p++; } if (lj_char_isalnum((unsigned char)(*p))) { 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+neg)) { if (neg) ul = ~ul+1u; setintV(L->base-1-LJ_FR2, (int32_t)ul); } else { lua_Number n = (lua_Number)ul; if (neg) n = -n; setnumV(L->base-1-LJ_FR2, n); } return FFH_RES(1); } } } } setnilV(L->base-1-LJ_FR2); return FFH_RES(1); } 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-LJ_FR2, mo); /* Replace callable. */ return FFH_TAILCALL; } lj_gc_check(L); setstrV(L, L->base-1-LJ_FR2, lj_strfmt_obj(L, L->base)); 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 == LUA_OK) { /* ** Set environment table for top-level function. ** Don't do this for non-native bytecode, which returns a prototype. */ if (tvistab(L->base+envarg-1) && tvisfunc(L->top-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) || tvisbuf(L->base))) { const char *s; MSize len; if (tvisbuf(L->base)) { SBufExt *sbx = bufV(L->base); s = sbx->r; len = sbufxlen(sbx); if (!name) name = &G(L)->strempty; /* Buffers are not NUL-terminated. */ } else { GCstr *str = lj_lib_checkstr(L, 1); s = strdata(str); len = str->len; } lua_settop(L, 4); /* Ensure env arg exists. */ status = luaL_loadbufferx(L, s, len, name ? strdata(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) != LUA_OK) 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++, (int32_t)(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\1\377\11isrunning"); 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 || opt == LUA_GCISRUNNING) 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) && !gcrefu(basemt_it(G(L), LJ_TNUMX)); for (i = 0; i < nargs; i++) { cTValue *o = &L->base[i]; const char *str; size_t size; MSize len; if (shortcut && (str = lj_strfmt_wstrnum(L, o, &len)) != NULL) { size = len; } 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 != LUA_OK) s = "dead"; else if (co->base > tvref(co->stack)+1+LJ_FR2) 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_isyieldable) { setboolV(L->top++, cframe_canyield(L->cframe)); return 1; } 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 == LUA_OK && 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-LJ_FR2, 0); setstrV(L, L->base-LJ_FR2, lj_err_str(L, em)); return FFH_RES(2); } if (lj_state_cpgrowstack(co, (MSize)(L->top - L->base)) != LUA_OK) { cTValue *msg = --co->top; lj_err_callermsg(L, strVdata(msg)); } 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) { GCfunc *fn; lj_cf_coroutine_create(L); fn = lj_lib_pushcc(L, lj_ffh_coroutine_wrap_aux, FF_coroutine_wrap_aux, 1); setpc_wrap_aux(L, fn); 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; } subprojects/luajit/src/msvcbuild.bat0000644000175000017500000001220114741067622017153 0ustar aniolaniol@rem Script to build LuaJIT with MSVC. @rem Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h @rem @rem Open a "Visual Studio Command Prompt" (either x86 or x64). @rem Then cd to this directory and run this script. Use the following @rem options (in order), if needed. The default is a dynamic release build. @rem @rem nogc64 disable LJ_GC64 mode for x64 @rem debug emit debug symbols @rem amalg amalgamated build @rem static static linkage @if not defined INCLUDE goto :FAIL @setlocal @rem Add more debug flags here, e.g. DEBUGCFLAGS=/DLUA_USE_ASSERT @set DEBUGCFLAGS= @set LJCOMPILE=cl /nologo /c /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_STDIO_INLINE=__declspec(dllexport)__inline @set LJDYNBUILD=/DLUA_BUILD_AS_DLL /MD @set LJDYNBUILD_DEBUG=/DLUA_BUILD_AS_DLL /MDd @set LJCOMPILETARGET=/Zi @set LJLINKTYPE=/DEBUG /RELEASE @set LJLINKTYPE_DEBUG=/DEBUG @set LJLINKTARGET=/OPT:REF /OPT:ICF /INCREMENTAL:NO @set LJLINK=link /nologo @set LJMT=mt /nologo @set LJLIB=lib /nologo /nodefaultlib @set DASMDIR=..\dynasm @set DASM=%DASMDIR%\dynasm.lua @set DASC=vm_x64.dasc @set LJDLLNAME=lua51.dll @set LJLIBNAME=lua51.lib @set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c lib_buffer.c @setlocal @call :SETHOSTVARS %LJCOMPILE% host\minilua.c @if errorlevel 1 goto :BAD %LJLINK% /out:minilua.exe minilua.obj @if errorlevel 1 goto :BAD if exist minilua.exe.manifest^ %LJMT% -manifest minilua.exe.manifest -outputresource:minilua.exe @endlocal @set DASMFLAGS=-D WIN -D JIT -D FFI -D ENDIAN_LE -D FPU -D P64 @set LJARCH=x64 @minilua @if errorlevel 8 goto :NO32 @set DASC=vm_x86.dasc @set DASMFLAGS=-D WIN -D JIT -D FFI -D ENDIAN_LE -D FPU @set LJARCH=x86 @set LJCOMPILE=%LJCOMPILE% /arch:SSE2 @goto :DA :NO32 @if "%VSCMD_ARG_TGT_ARCH%" neq "arm64" goto :X64 @set DASC=vm_arm64.dasc @set DASMTARGET=-D LUAJIT_TARGET=LUAJIT_ARCH_ARM64 @set LJARCH=arm64 @goto :DA :X64 @if "%1" neq "nogc64" goto :DA @shift @set DASC=vm_x86.dasc @set LJCOMPILE=%LJCOMPILE% /DLUAJIT_DISABLE_GC64 :DA minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h %DASC% @if errorlevel 1 goto :BAD if exist ..\.git ( git show -s --format=%%ct >luajit_relver.txt ) else ( type ..\.relver >luajit_relver.txt ) minilua host\genversion.lua @setlocal @call :SETHOSTVARS %LJCOMPILE% /I "." /I %DASMDIR% %DASMTARGET% host\buildvm*.c @if errorlevel 1 goto :BAD %LJLINK% /out:buildvm.exe buildvm*.obj @if errorlevel 1 goto :BAD if exist buildvm.exe.manifest^ %LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe @endlocal buildvm -m peobj -o lj_vm.obj @if errorlevel 1 goto :BAD buildvm -m bcdef -o lj_bcdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m ffdef -o lj_ffdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m libdef -o lj_libdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m recdef -o lj_recdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m vmdef -o jit\vmdef.lua %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m folddef -o lj_folddef.h lj_opt_fold.c @if errorlevel 1 goto :BAD @if "%1" neq "debug" goto :NODEBUG @shift @set LJCOMPILE=%LJCOMPILE% %DEBUGCFLAGS% @set LJDYNBUILD=%LJDYNBUILD_DEBUG% @set LJLINKTYPE=%LJLINKTYPE_DEBUG% :NODEBUG @set LJCOMPILE=%LJCOMPILE% %LJCOMPILETARGET% @set LJLINK=%LJLINK% %LJLINKTYPE% %LJLINKTARGET% @if "%1"=="amalg" goto :AMALGDLL @if "%1"=="static" goto :STATIC %LJCOMPILE% %LJDYNBUILD% lj_*.c lib_*.c @if errorlevel 1 goto :BAD %LJLINK% /DLL /OUT:%LJDLLNAME% lj_*.obj lib_*.obj @if errorlevel 1 goto :BAD @goto :MTDLL :STATIC %LJCOMPILE% lj_*.c lib_*.c @if errorlevel 1 goto :BAD %LJLIB% /OUT:%LJLIBNAME% lj_*.obj lib_*.obj @if errorlevel 1 goto :BAD @goto :MTDLL :AMALGDLL @if "%2"=="static" goto :AMALGSTATIC %LJCOMPILE% %LJDYNBUILD% ljamalg.c @if errorlevel 1 goto :BAD %LJLINK% /DLL /OUT:%LJDLLNAME% ljamalg.obj lj_vm.obj @if errorlevel 1 goto :BAD @goto :MTDLL :AMALGSTATIC %LJCOMPILE% ljamalg.c @if errorlevel 1 goto :BAD %LJLINK% /OUT:%LJDLLNAME% ljamalg.obj lj_vm.obj @if errorlevel 1 goto :BAD :MTDLL if exist %LJDLLNAME%.manifest^ %LJMT% -manifest %LJDLLNAME%.manifest -outputresource:%LJDLLNAME%;2 %LJCOMPILE% luajit.c @if errorlevel 1 goto :BAD %LJLINK% /OUT:luajit.exe luajit.obj %LJLIBNAME% @if errorlevel 1 goto :BAD if exist luajit.exe.manifest^ %LJMT% -manifest luajit.exe.manifest -outputresource:luajit.exe @del *.obj *.manifest minilua.exe buildvm.exe @del host\buildvm_arch.h @del lj_bcdef.h lj_ffdef.h lj_libdef.h lj_recdef.h lj_folddef.h @echo. @echo === Successfully built LuaJIT for Windows/%LJARCH% === @goto :END :SETHOSTVARS @if "%VSCMD_ARG_HOST_ARCH%_%VSCMD_ARG_TGT_ARCH%" equ "x64_arm64" ( call "%VSINSTALLDIR%Common7\Tools\VsDevCmd.bat" -arch=%VSCMD_ARG_HOST_ARCH% -no_logo echo on ) @goto :END :BAD @echo. @echo ******************************************************* @echo *** Build FAILED -- Please check the error messages *** @echo ******************************************************* @goto :END :FAIL @echo You must open a "Visual Studio Command Prompt" to run this script :END subprojects/luajit/src/lj_opt_fold.c0000644000175000017500000021777714741067622017163 0ustar aniolaniol/* ** FOLD: Constant Folding, Algebraic Simplifications and Reassociation. ** ABCelim: Array Bounds Check Elimination. ** CSE: Common-Subexpression Elimination. ** Copyright (C) 2005-2023 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_buf.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_carith.h" #endif #include "lj_vm.h" #include "lj_strscan.h" #include "lj_strfmt.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's 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_BUFSTR] || J->chain[IR_TOSTR] || J->chain[IR_CALLA])) /* -- Constant folding for FP numbers ------------------------------------- */ LJFOLD(ADD KNUM KNUM) LJFOLD(SUB KNUM KNUM) LJFOLD(MUL KNUM KNUM) LJFOLD(DIV 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(NEG KNUM FLOAD) LJFOLD(ABS KNUM FLOAD) LJFOLDF(kfold_numabsneg) { lua_Number a = knumleft; lua_Number y = lj_vm_foldarith(a, a, 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(CALLN KNUM any) LJFOLDF(kfold_fpcall1) { const CCallInfo *ci = &lj_ir_callinfo[fins->op2]; if (CCI_TYPE(ci) == IRT_NUM) { double y = ((double (*)(double))ci->func)(knumleft); return lj_ir_knum(J, y); } return NEXTFOLD; } LJFOLD(CALLN CARG IRCALL_atan2) LJFOLDF(kfold_fpcall2) { if (irref_isk(fleft->op1) && irref_isk(fleft->op2)) { const CCallInfo *ci = &lj_ir_callinfo[fins->op2]; double a = ir_knum(IR(fleft->op1))->n; double b = ir_knum(IR(fleft->op2))->n; double y = ((double (*)(double, double))ci->func)(a, b); return lj_ir_knum(J, y); } return NEXTFOLD; } LJFOLD(POW KNUM KNUM) LJFOLDF(kfold_numpow) { return lj_ir_knum(J, lj_vm_foldarith(knumleft, knumright, IR_POW - IR_ADD)); } /* 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 = (int32_t)(~(uint32_t)k1+1u); 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: lj_assertX(0, "bad IR op %d", op); 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: lj_assertJ(0, "bad IR op %d", fins->o); 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(jit_State *J, uint64_t k1, uint64_t k2, IROp op) { UNUSED(J); #if LJ_HASFFI switch (op) { case IR_ADD: k1 += k2; break; case IR_SUB: k1 -= k2; break; case IR_MUL: k1 *= k2; break; case IR_BAND: k1 &= k2; break; case IR_BOR: k1 |= k2; break; case IR_BXOR: k1 ^= k2; break; case IR_BSHL: k1 <<= (k2 & 63); break; case IR_BSHR: k1 >>= (k2 & 63); break; case IR_BSAR: k1 = (uint64_t)((int64_t)k1 >> (k2 & 63)); break; case IR_BROL: k1 = lj_rol(k1, (k2 & 63)); break; case IR_BROR: k1 = lj_ror(k1, (k2 & 63)); break; default: lj_assertJ(0, "bad IR op %d", op); break; } #else UNUSED(k2); UNUSED(op); lj_assertJ(0, "FFI IR op without FFI"); #endif 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(J, 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); lj_assertJ(0, "FFI IR op without FFI"); 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 uint64_t k = ir_k64(fleft)->u64; int32_t sh = (fright->i & 63); return INT64FOLD(lj_carith_shift64(k, sh, fins->o - IR_BSHL)); #else UNUSED(J); lj_assertJ(0, "FFI IR op without FFI"); return FAILFOLD; #endif } LJFOLD(BNOT KINT64) LJFOLDF(kfold_bnot64) { #if LJ_HASFFI return INT64FOLD(~ir_k64(fleft)->u64); #else UNUSED(J); lj_assertJ(0, "FFI IR op without FFI"); return FAILFOLD; #endif } LJFOLD(BSWAP KINT64) LJFOLDF(kfold_bswap64) { #if LJ_HASFFI return INT64FOLD(lj_bswap64(ir_k64(fleft)->u64)); #else UNUSED(J); lj_assertJ(0, "FFI IR op without FFI"); 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: lj_assertJ(0, "bad IR op %d", fins->o); return FAILFOLD; } #else UNUSED(J); lj_assertJ(0, "FFI IR op without FFI"); 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); lj_assertJ(0, "FFI IR op without FFI"); 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) LJFOLD(XSNEW 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); lj_assertJ((MSize)fright->i <= str->len, "bad string ref"); 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_PGC); 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 and forwarding for buffers ------------------------- */ /* ** Buffer ops perform stores, but their effect is limited to the buffer ** itself. Also, buffer ops are chained: a use of an op implies a use of ** all other ops up the chain. Conversely, if an op is unused, all ops ** up the chain can go unsed. This largely eliminates the need to treat ** them as stores. ** ** Alas, treating them as normal (IRM_N) ops doesn't work, because they ** cannot be CSEd in isolation. CSE for IRM_N is implicitly done in LOOP ** or if FOLD is disabled. ** ** The compromise is to declare them as loads, emit them like stores and ** CSE whole chains manually when the BUFSTR is to be emitted. Any chain ** fragments left over from CSE are eliminated by DCE. ** ** The string buffer methods emit a USE instead of a BUFSTR to keep the ** chain alive. */ LJFOLD(BUFHDR any any) LJFOLDF(bufhdr_merge) { return fins->op2 == IRBUFHDR_WRITE ? CSEFOLD : EMITFOLD; } LJFOLD(BUFPUT any BUFSTR) LJFOLDF(bufput_bufstr) { if ((J->flags & JIT_F_OPT_FWD)) { IRRef hdr = fright->op2; /* New buffer, no other buffer op inbetween and same buffer? */ if (fleft->o == IR_BUFHDR && fleft->op2 == IRBUFHDR_RESET && fleft->prev == hdr && fleft->op1 == IR(hdr)->op1 && !(irt_isphi(fright->t) && IR(hdr)->prev) && (!LJ_HASBUFFER || J->chain[IR_CALLA] < hdr)) { IRRef ref = fins->op1; IR(ref)->op2 = IRBUFHDR_APPEND; /* Modify BUFHDR. */ IR(ref)->op1 = fright->op1; return ref; } /* Replay puts to global temporary buffer. */ if (IR(hdr)->op2 == IRBUFHDR_RESET && !irt_isphi(fright->t)) { IRIns *ir = IR(fright->op1); /* For now only handle single string.reverse .lower .upper .rep. */ if (ir->o == IR_CALLL && ir->op2 >= IRCALL_lj_buf_putstr_reverse && ir->op2 <= IRCALL_lj_buf_putstr_rep) { IRIns *carg1 = IR(ir->op1); if (ir->op2 == IRCALL_lj_buf_putstr_rep) { IRIns *carg2 = IR(carg1->op1); if (carg2->op1 == hdr) { return lj_ir_call(J, ir->op2, fins->op1, carg2->op2, carg1->op2); } } else if (carg1->op1 == hdr) { return lj_ir_call(J, ir->op2, fins->op1, carg1->op2); } } } } return EMITFOLD; /* Always emit, CSE later. */ } LJFOLD(BUFPUT any any) LJFOLDF(bufput_kgc) { if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD) && fright->o == IR_KGC) { GCstr *s2 = ir_kstr(fright); if (s2->len == 0) { /* Empty string? */ return LEFTFOLD; } else { if (fleft->o == IR_BUFPUT && irref_isk(fleft->op2) && !irt_isphi(fleft->t)) { /* Join two constant string puts in a row. */ GCstr *s1 = ir_kstr(IR(fleft->op2)); IRRef kref = lj_ir_kstr(J, lj_buf_cat2str(J->L, s1, s2)); /* lj_ir_kstr() may realloc the IR and invalidates any IRIns *. */ IR(fins->op1)->op2 = kref; /* Modify previous BUFPUT. */ return fins->op1; } } } return EMITFOLD; /* Always emit, CSE later. */ } LJFOLD(BUFSTR any any) LJFOLDF(bufstr_kfold_cse) { lj_assertJ(fleft->o == IR_BUFHDR || fleft->o == IR_BUFPUT || fleft->o == IR_CALLL, "bad buffer constructor IR op %d", fleft->o); if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD)) { if (fleft->o == IR_BUFHDR) { /* No put operations? */ if (fleft->op2 == IRBUFHDR_RESET) /* Empty buffer? */ return lj_ir_kstr(J, &J2G(J)->strempty); fins->op1 = fleft->op1; fins->op2 = fleft->prev; /* Relies on checks in bufput_append. */ return CSEFOLD; } else if (fleft->o == IR_BUFPUT) { IRIns *irb = IR(fleft->op1); if (irb->o == IR_BUFHDR && irb->op2 == IRBUFHDR_RESET) return fleft->op2; /* Shortcut for a single put operation. */ } } /* Try to CSE the whole chain. */ if (LJ_LIKELY(J->flags & JIT_F_OPT_CSE)) { IRRef ref = J->chain[IR_BUFSTR]; while (ref) { IRIns *irs = IR(ref), *ira = fleft, *irb = IR(irs->op1); while (ira->o == irb->o && ira->op2 == irb->op2) { lj_assertJ(ira->o == IR_BUFHDR || ira->o == IR_BUFPUT || ira->o == IR_CALLL || ira->o == IR_CARG, "bad buffer constructor IR op %d", ira->o); if (ira->o == IR_BUFHDR && ira->op2 == IRBUFHDR_RESET) return ref; /* CSE succeeded. */ if (ira->o == IR_CALLL && ira->op2 == IRCALL_lj_buf_puttab) break; ira = IR(ira->op1); irb = IR(irb->op1); } ref = irs->prev; } } return EMITFOLD; /* No CSE possible. */ } LJFOLD(CALLL CARG IRCALL_lj_buf_putstr_reverse) LJFOLD(CALLL CARG IRCALL_lj_buf_putstr_upper) LJFOLD(CALLL CARG IRCALL_lj_buf_putstr_lower) LJFOLD(CALLL CARG IRCALL_lj_strfmt_putquoted) LJFOLDF(bufput_kfold_op) { if (irref_isk(fleft->op2)) { const CCallInfo *ci = &lj_ir_callinfo[fins->op2]; SBuf *sb = lj_buf_tmp_(J->L); sb = ((SBuf * (LJ_FASTCALL *)(SBuf *, GCstr *))ci->func)(sb, ir_kstr(IR(fleft->op2))); fins->o = IR_BUFPUT; fins->op1 = fleft->op1; fins->op2 = lj_ir_kstr(J, lj_buf_tostr(sb)); return RETRYFOLD; } return EMITFOLD; /* Always emit, CSE later. */ } LJFOLD(CALLL CARG IRCALL_lj_buf_putstr_rep) LJFOLDF(bufput_kfold_rep) { if (irref_isk(fleft->op2)) { IRIns *irc = IR(fleft->op1); if (irref_isk(irc->op2)) { SBuf *sb = lj_buf_tmp_(J->L); sb = lj_buf_putstr_rep(sb, ir_kstr(IR(irc->op2)), IR(fleft->op2)->i); fins->o = IR_BUFPUT; fins->op1 = irc->op1; fins->op2 = lj_ir_kstr(J, lj_buf_tostr(sb)); return RETRYFOLD; } } return EMITFOLD; /* Always emit, CSE later. */ } LJFOLD(CALLL CARG IRCALL_lj_strfmt_putfxint) LJFOLD(CALLL CARG IRCALL_lj_strfmt_putfnum_int) LJFOLD(CALLL CARG IRCALL_lj_strfmt_putfnum_uint) LJFOLD(CALLL CARG IRCALL_lj_strfmt_putfnum) LJFOLD(CALLL CARG IRCALL_lj_strfmt_putfstr) LJFOLD(CALLL CARG IRCALL_lj_strfmt_putfchar) LJFOLDF(bufput_kfold_fmt) { IRIns *irc = IR(fleft->op1); lj_assertJ(irref_isk(irc->op2), "SFormat must be const"); if (irref_isk(fleft->op2)) { SFormat sf = (SFormat)IR(irc->op2)->i; IRIns *ira = IR(fleft->op2); SBuf *sb = lj_buf_tmp_(J->L); switch (fins->op2) { case IRCALL_lj_strfmt_putfxint: sb = lj_strfmt_putfxint(sb, sf, ir_k64(ira)->u64); break; case IRCALL_lj_strfmt_putfstr: sb = lj_strfmt_putfstr(sb, sf, ir_kstr(ira)); break; case IRCALL_lj_strfmt_putfchar: sb = lj_strfmt_putfchar(sb, sf, ira->i); break; case IRCALL_lj_strfmt_putfnum_int: case IRCALL_lj_strfmt_putfnum_uint: case IRCALL_lj_strfmt_putfnum: default: { const CCallInfo *ci = &lj_ir_callinfo[fins->op2]; sb = ((SBuf * (*)(SBuf *, SFormat, lua_Number))ci->func)(sb, sf, ir_knum(ira)->n); break; } } fins->o = IR_BUFPUT; fins->op1 = irc->op1; fins->op2 = lj_ir_kstr(J, lj_buf_tostr(sb)); return RETRYFOLD; } return EMITFOLD; /* Always emit, CSE later. */ } /* -- 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; 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); } LJFOLD(CONV KNUM IRCONV_U32_NUM) LJFOLDF(kfold_conv_knum_u32_num) { #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) { return INT64FOLD((uint64_t)(int64_t)knumleft); } LJFOLD(CONV KNUM IRCONV_U64_NUM) LJFOLDF(kfold_conv_knum_u64_num) { return INT64FOLD(lj_num2u64(knumleft)); } LJFOLD(TOSTR KNUM any) LJFOLDF(kfold_tostr_knum) { return lj_ir_kstr(J, lj_strfmt_num(J->L, ir_knum(fleft))); } LJFOLD(TOSTR KINT any) LJFOLDF(kfold_tostr_kint) { return lj_ir_kstr(J, fins->op2 == IRTOSTR_INT ? lj_strfmt_int(J->L, fleft->i) : lj_strfmt_char(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 FLOAD) LJFOLDF(shortcut_left) { return LEFTFOLD; /* f(g(x)) ==> g(x) */ } LJFOLD(ABS NEG FLOAD) 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) { if (ir_knum(fright)->u64 == 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 */ IRRef op1 = fins->op1; fins->op2 = (IRRef1)lj_ir_ksimd(J, LJ_KSIMD_NEG); /* Modifies fins. */ fins->op1 = op1; fins->o = IR_NEG; 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 KNUM) LJFOLDF(simplify_numpow_k) { if (knumright == 0.0) /* x ^ 0 ==> 1 */ return lj_ir_knum_one(J); /* Result must be a number, not an int. */ else if (knumright == 1.0) /* x ^ 1 ==> x */ return LEFTFOLD; else if (knumright == 2.0) /* x ^ 2 ==> x * x */ return emitir(IRTN(IR_MUL), fins->op1, fins->op1); else 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_INT_U32) /* _INT or _U32 */ LJFOLD(CONV CONV IRCONV_U32_I64) /* _INT or _U32 */ LJFOLD(CONV CONV IRCONV_U32_U64) /* _INT or _U32 */ LJFOLD(CONV CONV IRCONV_U32_INT) /* _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) { lj_assertJ(irt_isnum(fleft->t), "expected TOBIT number arg"); return fleft->op1; } else if ((fleft->op2 & IRCONV_SRCMASK) == IRT_U32) { lj_assertJ(irt_isnum(fleft->t), "expected TOBIT number arg"); fins->o = IR_CONV; fins->op1 = fleft->op1; fins->op2 = (IRT_INT<<5)|IRT_U32; return RETRYFOLD; } return NEXTFOLD; } /* Shortcut floor/ceil/trunc + IRT_NUM <- integer conversion. */ LJFOLD(FPMATH CONV IRFPM_FLOOR) LJFOLD(FPMATH CONV IRFPM_CEIL) LJFOLD(FPMATH CONV IRFPM_TRUNC) LJFOLDF(simplify_floor_conv) { if ((uint32_t)(fleft->op2 & IRCONV_SRCMASK) - (uint32_t)IRT_I8 <= (uint32_t)(IRT_U64 - IRT_U8)) 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; lj_assertJ(irt_isint(J->scev.t), "only int SCEV supported"); if (lo && IR(lo)->o == IR_KINT && 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) { #if LJ_64 UNUSED(J); return NEXTFOLD; #else 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(IRT(IR_CONV, t), op1, mode); op2 = emitir(IRT(IR_CONV, t), op2, mode); fins->ot = IRT(op, t); fins->op1 = op1; fins->op2 = op2; return RETRYFOLD; #endif } /* 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; lj_assertJ(fins->o != IR_CONV || (fins->op2&IRCONV_CONVMASK) != IRCONV_TOBIT, "unexpected CONV 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, (int32_t)(~(uint32_t)fright->i+1u)); /* 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, ~k+1u); 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 == 0) { /* i * 0 ==> 0 */ return RIGHTFOLD; } else 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) return simplify_intmul_k(J, fright->i); return NEXTFOLD; } LJFOLD(MUL any KINT64) LJFOLDF(simplify_intmul_k64) { #if LJ_HASFFI if (ir_kint64(fright)->u64 < 0x80000000u) return simplify_intmul_k(J, (int32_t)ir_kint64(fright)->u64); return NEXTFOLD; #else UNUSED(J); lj_assertJ(0, "FFI IR op without FFI"); return FAILFOLD; #endif } LJFOLD(MOD any KINT) LJFOLDF(simplify_intmod_k) { int32_t k = fright->i; lj_assertJ(k != 0, "integer mod 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; } else if (irk->o == IR_KINT64) { uint64_t k = kfold_int64arith(J, ir_k64(irk)->u64, fright->i, (IROp)fins->o); IROpT ot = fleft->ot; fins->op1 = fleft->op1; fins->op1 = (IRRef1)lj_opt_fold(J); fins->op2 = (IRRef1)lj_ir_kint64(J, k); fins->ot = ot; 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; } LJFOLD(BAND BOR KINT) LJFOLD(BOR BAND KINT) LJFOLDF(simplify_andor_k) { IRIns *irk = IR(fleft->op2); PHIBARRIER(fleft); if (irk->o == IR_KINT) { int32_t k = kfold_intop(irk->i, fright->i, (IROp)fins->o); /* (i | k1) & k2 ==> i & k2, if (k1 & k2) == 0. */ /* (i & k1) | k2 ==> i | k2, if (k1 | k2) == -1. */ if (k == (fins->o == IR_BAND ? 0 : -1)) { fins->op1 = fleft->op1; return RETRYFOLD; } } return NEXTFOLD; } LJFOLD(BAND BOR KINT64) LJFOLD(BOR BAND KINT64) LJFOLDF(simplify_andor_k64) { #if LJ_HASFFI IRIns *irk = IR(fleft->op2); PHIBARRIER(fleft); if (irk->o == IR_KINT64) { uint64_t k = kfold_int64arith(J, ir_k64(irk)->u64, ir_k64(fright)->u64, (IROp)fins->o); /* (i | k1) & k2 ==> i & k2, if (k1 & k2) == 0. */ /* (i & k1) | k2 ==> i | k2, if (k1 | k2) == -1. */ if (k == (fins->o == IR_BAND ? (uint64_t)0 : ~(uint64_t)0)) { fins->op1 = fleft->op1; return RETRYFOLD; } } return NEXTFOLD; #else UNUSED(J); lj_assertJ(0, "FFI IR op without FFI"); return FAILFOLD; #endif } /* -- 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 IRIns *irk = IR(fleft->op2); if (irk->o == IR_KINT64) { uint64_t k = kfold_int64arith(J, 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); lj_assertJ(0, "FFI IR op without FFI"); return FAILFOLD; #endif } 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(MIN MIN any) LJFOLD(MAX MAX any) LJFOLDF(reassoc_dup_minmax) { if (fins->op2 == fleft->op2) return LEFTFOLD; /* (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 KINT) LJFOLD(MAX MAX KINT) LJFOLDF(reassoc_minmax_k) { IRIns *irk = IR(fleft->op2); 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; } /* -- 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) { PHIBARRIER(fleft); 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)) { uint32_t k = (uint32_t)IR(ir->op2)->i; if ((uint32_t)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 P32 or U32. Drop if op1 is invariant too. */ if (!irt_isint(fins->t) && fins->op1 < J->chain[IR_LOOP] && (irt_isu32(fins->t) || (!irref_isk(fins->op1) && !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) || (fleft->o == IR_CONV && /* Converted integers cannot be NaN. */ (uint32_t)(fleft->op2 & IRCONV_SRCMASK) - (uint32_t)IRT_I8 <= (uint32_t)(IRT_U64 - IRT_U8)))) 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) LJFOLDF(comm_dup) { if (fins->op1 == fins->op2) /* x o x ==> x */ return LEFTFOLD; return fold_comm_swap(J); } LJFOLD(MIN any any) LJFOLD(MAX any any) LJFOLDF(comm_dup_minmax) { if (fins->op1 == fins->op2) /* x o x ==> x */ return LEFTFOLD; return NEXTFOLD; } 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; lj_assertJ(irt_isstr(fins->t), "bad equality IR type"); #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); lj_assertJ(ir_kptr(fleft) == niltvg(J2G(J)), "expected niltv"); return TREF_NIL; } LJFOLD(HLOAD any) LJFOLDX(lj_opt_fwd_hload) LJFOLD(ULOAD any) LJFOLDX(lj_opt_fwd_uload) LJFOLD(ALEN any any) LJFOLDX(lj_opt_fwd_alen) /* Try to merge UREFO/UREFC into referenced instruction. */ static TRef merge_uref(jit_State *J, IRRef ref, IRIns* ir) { if (ir->o == IR_UREFO && irt_isguard(ir->t)) { /* Might be pointing to some other coroutine's stack. ** And GC might shrink said stack, thereby repointing the upvalue. ** GC might even collect said coroutine, thereby closing the upvalue. */ if (gcstep_barrier(J, ref)) return EMITFOLD; /* So cannot merge. */ /* Current fins wants a check, but ir doesn't have one. */ if ((irt_t(fins->t) & (IRT_GUARD|IRT_TYPE)) == (IRT_GUARD|IRT_PGC) && irt_type(ir->t) == IRT_IGC) ir->t.irt += IRT_PGC-IRT_IGC; /* So install a check. */ } return ref; /* Not a TRef, but the caller doesn't care. */ } /* Upvalue refs are really loads, but there are no corresponding stores. ** So CSE is ok for them, except for guarded UREFO across a GC step. ** 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) { return merge_uref(J, ref, ir); } } ref = ir->prev; } } return EMITFOLD; } /* Custom CSE for UREFO. */ LJFOLD(UREFO any any) LJFOLDF(cse_urefo) { if (LJ_LIKELY(J->flags & JIT_F_OPT_CSE)) { IRRef ref = J->chain[IR_UREFO]; IRRef lim = fins->op1; IRRef2 op12 = (IRRef2)fins->op1 + ((IRRef2)fins->op2 << 16); while (ref > lim) { IRIns *ir = IR(ref); if (ir->op12 == op12) return merge_uref(J, ref, ir); 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). ** LREF is constant (per trace) since coroutine switches are not inlined. */ 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; } LJFOLD(FLOAD TOSTR IRFL_STR_LEN) LJFOLDF(fload_str_len_tostr) { if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD) && fleft->op2 == IRTOSTR_CHAR) return INTFOLD(1); return NEXTFOLD; } LJFOLD(FLOAD any IRFL_SBUF_W) LJFOLD(FLOAD any IRFL_SBUF_E) LJFOLD(FLOAD any IRFL_SBUF_B) LJFOLD(FLOAD any IRFL_SBUF_L) LJFOLD(FLOAD any IRFL_SBUF_REF) LJFOLD(FLOAD any IRFL_SBUF_R) LJFOLDF(fload_sbuf) { TRef tr = lj_opt_fwd_fload(J); return lj_opt_fwd_sbuf(J, tref_ref(tr)) ? tr : EMITFOLD; } /* The fast function ID of function objects is immutable. */ LJFOLD(FLOAD KGC IRFL_FUNC_FFID) LJFOLDF(fload_func_ffid_kgc) { if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD)) return INTFOLD((int32_t)ir_kfunc(fleft)->c.ffid); 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_FUNC_ENV) LJFOLD(FLOAD any IRFL_THREAD_ENV) 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 { lj_assertJ(J->slot[fins->op1] != 0, "uninitialized slot accessed"); 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) /* -- Frame handling ------------------------------------------------------ */ /* Prevent CSE of a REF_BASE operand across IR_RETF. */ LJFOLD(SUB any BASE) LJFOLD(SUB BASE any) LJFOLD(EQ any BASE) LJFOLDF(fold_base) { return lj_opt_cselim(J, J->chain[IR_RETF]); } /* -- Write barriers ------------------------------------------------------ */ /* Write barriers are amenable to CSE, but not across any incremental ** GC steps. */ LJFOLD(TBAR any) LJFOLD(OBAR 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; } /* -- Profiling ----------------------------------------------------------- */ LJFOLD(PROF any any) LJFOLDF(prof) { IRRef ref = J->chain[IR_PROF]; if (ref+1 == J->cur.nins) /* Drop neighbouring IR_PROF. */ return ref; return EMITFOLD; } /* -- 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(TMPREF any any) LJFOLD(CALLA any any) LJFOLD(CALLL any any) /* Safeguard fallback. */ LJFOLD(CALLS any any) 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) /* -- Miscellaneous ------------------------------------------------------- */ LJFOLD(CARG any any) LJFOLDF(cse_carg) { TRef tr = lj_opt_cse(J); if (tref_ref(tr) < J->chain[IR_LOOP]) /* CSE across loop? */ return EMITFOLD; /* Raw emit. Assumes fins is left intact by CSE. */ return tr; } /* ------------------------------------------------------------------------ */ /* 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)) { lj_assertJ(((JIT_F_OPT_FOLD|JIT_F_OPT_FWD|JIT_F_OPT_CSE|JIT_F_OPT_DSE) | JIT_F_OPT_DEFAULT) == JIT_F_OPT_DEFAULT, "bad 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->op1 < REF_TRUE) fleft[1] = IR(fins->op1)[1]; } if (fins->op2 >= J->cur.nk) { key += (uint32_t)IR(fins->op2)->o; *fright = *IR(fins->op2); if (fins->op2 < REF_TRUE) fright[1] = IR(fins->op2)[1]; } 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); lj_assertJ(ref == DROPFOLD, "bad fold result"); 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 subprojects/luajit/src/lj_mcode.h0000644000175000017500000000126314741067622016426 0ustar aniolaniol/* ** Machine code management. ** Copyright (C) 2005-2023 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 subprojects/luajit/src/lj_snap.c0000644000175000017500000010132314741067622016271 0ustar aniolaniol/* ** Snapshot handling. ** Copyright (C) 2005-2023 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 LJ_FR2 if (s == 1) { /* Ignore slot 1 in LJ_FR2 mode, except if tailcalled. */ if ((tr & TREF_FRAME)) map[n++] = SNAP(1, SNAP_FRAME | SNAP_NORESTORE, REF_NIL); continue; } if ((tr & (TREF_FRAME | TREF_CONT)) && !ref) { cTValue *base = J->L->base - J->baseslot; tr = J->slot[s] = (tr & 0xff0000) | lj_ir_k64(J, IR_KNUM, base[s].u64); ref = tref_ref(tr); } #endif if (ref) { SnapEntry sn = SNAP_TR(s, tr); IRIns *ir = &J->cur.ir[ref]; if ((LJ_FR2 || !(sn & (SNAP_CONT|SNAP_FRAME))) && ir->o == IR_SLOAD && ir->op1 == s && ref > retf) { /* ** No need to snapshot unmodified non-inherited slots. ** But always snapshot the function below a frame in LJ_FR2 mode. */ if (!(ir->op2 & IRSLOAD_INHERIT) && (!LJ_FR2 || s == 0 || s+1 == nslots || !(J->slot[s+1] & (TREF_CONT|TREF_FRAME)))) 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_SOFTFP32 && irt_isnum(ir->t)) sn |= SNAP_SOFTFPNUM; map[n++] = sn; } } return n; } /* Add frame links at the end of the snapshot. */ static MSize snapshot_framelinks(jit_State *J, SnapEntry *map, uint8_t *topslot) { cTValue *frame = J->L->base - 1; cTValue *lim = J->L->base - J->baseslot + LJ_FR2; GCfunc *fn = frame_func(frame); cTValue *ftop = isluafunc(fn) ? (frame+funcproto(fn)->framesize) : J->L->top; #if LJ_FR2 uint64_t pcbase = (u64ptr(J->pc) << 8) | (J->baseslot - 2); lj_assertJ(2 <= J->baseslot && J->baseslot <= 257, "bad baseslot"); memcpy(map, &pcbase, sizeof(uint64_t)); #else MSize f = 0; map[f++] = SNAP_MKPC(J->pc); /* The current PC is always the first entry. */ #endif lj_assertJ(!J->pt || (J->pc >= proto_bc(J->pt) && J->pc < proto_bc(J->pt) + J->pt->sizebc), "bad snapshot PC"); while (frame > lim) { /* Backwards traversal of all frames above base. */ if (frame_islua(frame)) { #if !LJ_FR2 map[f++] = SNAP_MKPC(frame_pc(frame)); #endif frame = frame_prevl(frame); } else if (frame_iscont(frame)) { #if !LJ_FR2 map[f++] = SNAP_MKFTSZ(frame_ftsz(frame)); map[f++] = SNAP_MKPC(frame_contpc(frame)); #endif frame = frame_prevd(frame); } else { lj_assertJ(!frame_isc(frame), "broken frame chain"); #if !LJ_FR2 map[f++] = SNAP_MKFTSZ(frame_ftsz(frame)); #endif frame = frame_prevd(frame); continue; } if (frame + funcproto(frame_func(frame))->framesize > ftop) ftop = frame + funcproto(frame_func(frame))->framesize; } *topslot = (uint8_t)(ftop - lim); #if LJ_FR2 lj_assertJ(sizeof(SnapEntry) * 2 == sizeof(uint64_t), "bad SnapEntry def"); return 2; #else lj_assertJ(f == (MSize)(1 + J->framedepth), "miscalculated snapshot size"); return f; #endif } /* 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)(LJ_FR2?2:J->framedepth+1)); p = &J->cur.snapmap[nsnapmap]; nent = snapshot_slots(J, p, nslots); snap->nent = (uint8_t)nent; nent += snapshot_framelinks(J, p + nent, &snap->topslot); snap->mapofs = (uint32_t)nsnapmap; snap->ref = (IRRef1)J->cur.nins; snap->mcofs = 0; snap->nslots = (uint8_t)nslots; snap->count = 0; J->cur.nsnapmap = (uint32_t)(nsnapmap + nent); } /* 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 ((nsnap > 0 && J->cur.snap[nsnap-1].ref == J->cur.nins) || (J->mergesnap && !irt_isguard(J->guardemit))) { 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. */ lj_assertJ(pc >= proto_bc(J->pt) && pc < proto_bc(J->pt) + J->pt->sizebc, "snapshot PC out of range"); 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: lj_assertJ(op == BC_CAT, "unhandled op %d with RC rbase", op); 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) { ptrdiff_t delta = bc_j(ins); if (delta < 0) return maxslot; /* Prevent loop. */ pc += delta; 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_ITERN) { BCReg top = (op == BC_CALLM || op == BC_CALLMT || bc_c(ins) == 0) ? maxslot : (bc_a(ins) + bc_c(ins)+LJ_FR2); if (LJ_FR2) DEF_SLOT(bc_a(ins)+1); 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_VARG) { return maxslot; /* NYI: punt. */ } 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; } lj_assertJ(pc >= proto_bc(J->pt) && pc < proto_bc(J->pt) + J->pt->sizebc, "use/def analysis PC out of range"); } #undef USE_SLOT #undef DEF_SLOT return 0; /* unreachable */ } /* Mark slots used by upvalues of child prototypes as used. */ static void snap_useuv(GCproto *pt, uint8_t *udf) { /* This is a coarse check, because it's difficult to correlate the lifetime ** of slots and closures. But the number of false positives is quite low. ** A false positive may cause a slot not to be purged, which is just ** a missed optimization. */ if ((pt->flags & PROTO_CHILD)) { ptrdiff_t i, j, 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) { for (j = 0; j < gco2pt(o)->sizeuv; j++) { uint32_t v = proto_uv(gco2pt(o))[j]; if ((v & PROTO_UV_LOCAL)) { udf[(v & 0xff)] = 0; } } } } } } /* Purge dead slots before the next snapshot. */ void lj_snap_purge(jit_State *J) { uint8_t udf[SNAP_USEDEF_SLOTS]; BCReg s, maxslot = J->maxslot; if (bc_op(*J->pc) == BC_FUNCV && maxslot > J->pt->numparams) maxslot = J->pt->numparams; s = snap_usedef(J, udf, J->pc, maxslot); if (s < maxslot) { snap_useuv(J->pt, udf); 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 baseslot = J->baseslot; BCReg minslot = snap_usedef(J, udf, snap_pc(&map[nent]), maxslot); if (minslot < maxslot) snap_useuv(J->pt, udf); 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 = (uint32_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(jit_State *J, 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; UNUSED(J); for ( ; ; ir++) { uint32_t rs; if (ir->o == IR_SLOAD) { if (!(ir->op2 & IRSLOAD_PARENT)) break; for ( ; ; n++) { lj_assertJ(n < snap->nent, "slot %d not found in snapshot", ir->op1); if (snap_slot(map[n]) == ir->op1) { ref = snap_ref(map[n++]); break; } } } else if (LJ_SOFTFP32 && 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; lj_assertJ(regsp_used(rs), "unused IR %04d in snapshot", ref - REF_BIAS); } 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: case IR_KINT64: return lj_ir_k64(J, (IROp)ir->o, ir_k64(ir)->u64); case IR_KPTR: return lj_ir_kptr(J, ir_kptr(ir)); /* Continuation. */ case IR_KNULL: return lj_ir_knull(J, irt_type(ir->t)); default: lj_assertJ(0, "bad IR constant op %d", ir->o); return TREF_NIL; } } /* 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_KEYINDEX|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)) { /* See special treatment of LJ_FR2 slot 1 in snapshot_slots() above. */ if (LJ_FR2 && (sn == SNAP(1, SNAP_FRAME | SNAP_NORESTORE, REF_NIL))) tr = 0; else tr = snap_replay_const(J, ir); } else if (!regsp_used(ir->prev)) { pass23 = 1; lj_assertJ(s != 0, "unused slot 0 in snapshot"); tr = s; } else { IRType t = irt_type(ir->t); uint32_t mode = IRSLOAD_INHERIT|IRSLOAD_PARENT; if (LJ_SOFTFP32 && (sn & SNAP_SOFTFPNUM)) t = IRT_NUM; if (ir->o == IR_SLOAD) mode |= (ir->op2 & IRSLOAD_READONLY); if ((sn & SNAP_KEYINDEX)) mode |= IRSLOAD_KEYINDEX; tr = emitir_raw(IRT(IR_SLOAD, t), s, mode); } setslot: /* Same as TREF_* flags. */ J->slot[s] = tr | (sn&(SNAP_KEYINDEX|SNAP_CONT|SNAP_FRAME)); J->framedepth += ((sn & (SNAP_CONT|SNAP_FRAME)) && (s != LJ_FR2)); 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) { uint8_t m; if (J->slot[snap_slot(sn)] != snap_slot(sn)) continue; pass23 = 1; lj_assertJ(ir->o == IR_TNEW || ir->o == IR_TDUP || ir->o == IR_CNEW || ir->o == IR_CNEWI, "sunk parent IR %04d has bad op %d", refp - REF_BIAS, ir->o); m = lj_ir_mode[ir->o]; if (irm_op1(m) == IRMref) snap_pref(J, T, map, nent, seen, ir->op1); if (irm_op2(m) == IRMref) 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_SOFTFP32 || (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)) { lj_assertJ(ir->o == IR_CONV && ir->op2 == IRCONV_NUM_INT, "sunk parent IR %04d has bad op %d", refp - REF_BIAS, ir->o); 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; uint8_t m; 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; m = lj_ir_mode[ir->o]; if (irm_op1(m) == IRMref) op1 = snap_pref(J, T, map, nent, seen, op1); op2 = ir->op2; if (irm_op2(m) == IRMref) 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); } else if (irr->o == IR_NEWREF) { IRRef allocref = tref_ref(tr); IRRef keyref = tref_ref(key); IRRef newref_ref = J->chain[IR_NEWREF]; IRIns *newref = &J->cur.ir[newref_ref]; lj_assertJ(irref_isk(keyref), "sunk store for parent IR %04d with bad key %04d", refp - REF_BIAS, keyref - REF_BIAS); if (newref_ref > allocref && newref->op2 == keyref) { lj_assertJ(newref->op1 == allocref, "sunk store for parent IR %04d with bad tab %04d", refp - REF_BIAS, allocref - REF_BIAS); tmp = newref_ref; goto skip_newref; } } } tmp = emitir(irr->ot, tmp, key); skip_newref: val = snap_pref(J, T, map, nent, seen, irs->op2); if (val == 0) { IRIns *irc = &T->ir[irs->op2]; lj_assertJ(irc->o == IR_CONV && irc->op2 == IRCONV_NUM_INT, "sunk store for parent IR %04d with bad op %d", refp - REF_BIAS, irc->o); val = snap_pref(J, T, map, nent, seen, irc->op1); val = emitir(IRTN(IR_CONV), val, IRCONV_NUM_INT); } else if ((LJ_SOFTFP32 || (LJ_32 && LJ_HASFFI)) && irs+1 < irlast && (irs+1)->o == IR_HIOP) { IRType t = IRT_I64; if (LJ_SOFTFP32 && 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, 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. */ if (ir->o == IR_KPTR) { o->u64 = (uint64_t)(uintptr_t)ir_kptr(ir); } else { lj_assertJ(!(ir->o == IR_KKPTR || ir->o == IR_KNULL), "restore of const from IR %04d with bad op %d", ref - REF_BIAS, ir->o); 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_SOFTFP32 } else if (irt_isnum(t)) { o->u64 = *(uint64_t *)sps; #endif #if LJ_64 && !LJ_GC64 } else if (irt_islightud(t)) { /* 64 bit lightuserdata which may escape already has the tag bits. */ o->u64 = *(uint64_t *)sps; #endif } else { lj_assertJ(!irt_ispri(t), "PRI ref with spill slot"); setgcV(J->L, o, (GCobj *)(uintptr_t)*(GCSize *)sps, irt_toitype(t)); } } else { /* Restore from register. */ Reg r = regsp_reg(rs); if (ra_noreg(r)) { lj_assertJ(ir->o == IR_CONV && ir->op2 == IRCONV_NUM_INT, "restore from IR %04d has no reg", ref - REF_BIAS); 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]); #elif LJ_64 /* && LJ_SOFTFP */ } else if (irt_isnum(t)) { o->u64 = ex->gpr[r-RID_MIN_GPR]; #endif #if LJ_64 && !LJ_GC64 } else if (irt_is64(t)) { /* 64 bit values that already have the tag bits. */ o->u64 = ex->gpr[r-RID_MIN_GPR]; #endif } else if (irt_ispri(t)) { setpriV(o, irt_toitype(t)); } else { setgcV(J->L, o, (GCobj *)ex->gpr[r-RID_MIN_GPR], irt_toitype(t)); } } } #if LJ_HASFFI /* Restore raw data from the trace exit state. */ static void snap_restoredata(jit_State *J, 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; UNUSED(J); if (irref_isk(ref)) { if (ir_isk64(ir)) { src = (int32_t *)&ir[1]; } 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. */ lj_assertJ(sz == 8 && ir->o == IR_CONV && ir->op2 == IRCONV_NUM_INT, "restore from IR %04d has no reg", ref - REF_BIAS); snap_restoredata(J, T, ex, snapno, rfilt, ir->op1, dst, 4); *(lua_Number *)dst = (lua_Number)*(int32_t *)dst; return; } #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 } else #endif { src = (int32_t *)&ex->gpr[r-RID_MIN_GPR]; if (LJ_64 && LJ_BE && sz == 4) src++; } } } lj_assertJ(sz == 1 || sz == 2 || sz == 4 || sz == 8, "restore from IR %04d with bad size %d", ref - REF_BIAS, sz); 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) { lj_assertJ(ir->o == IR_TNEW || ir->o == IR_TDUP || ir->o == IR_CNEW || ir->o == IR_CNEWI, "sunk allocation with bad op %d", ir->o); #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; CTInfo info = lj_ctype_info(cts, id, &sz); GCcdata *cd = lj_cdata_newx(cts, id, sz, info); setcdataV(J->L, o, cd); if (ir->o == IR_CNEWI) { uint8_t *p = (uint8_t *)cdataptr(cd); lj_assertJ(sz == 4 || sz == 8, "sunk cdata with bad size %d", sz); if (LJ_32 && sz == 8 && ir+1 < T->ir + T->nins && (ir+1)->o == IR_HIOP) { snap_restoredata(J, T, ex, snapno, rfilt, (ir+1)->op2, LJ_LE ? p+4 : p, 4); if (LJ_BE) p += 4; sz = 4; } snap_restoredata(J, 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; lj_assertJ(irs->o == IR_XSTORE, "sunk store with bad op %d", irs->o); lj_assertJ(T->ir[irs->op1].o == IR_ADD, "sunk store with bad add op %d", T->ir[irs->op1].o); lj_assertJ(iro->o == IR_KINT || iro->o == IR_KINT64, "sunk store with bad const offset op %d", iro->o); 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; lj_assertJ(p >= (uint8_t *)cdataptr(cd) && p + szs <= (uint8_t *)cdataptr(cd) + sz, "sunk store with offset out of range"); if (LJ_32 && irs+1 < T->ir + T->nins && (irs+1)->o == IR_HIOP) { lj_assertJ(szs == 4, "sunk store with bad size %d", szs); snap_restoredata(J, T, ex, snapno, rfilt, (irs+1)->op2, LJ_LE ? p+4 : p, 4); if (LJ_BE) p += 4; } snap_restoredata(J, 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; lj_assertJ(irs->o == IR_ASTORE || irs->o == IR_HSTORE || irs->o == IR_FSTORE, "sunk store with bad op %d", irs->o); if (irk->o == IR_FREF) { switch (irk->op2) { case IRFL_TAB_META: if (T->ir[irs->op2].o == IR_KNULL) { setgcrefnull(t->metatable); } else { snap_restoreval(J, T, ex, snapno, rfilt, irs->op2, &tmp); /* NOBARRIER: The table is new (marked white). */ setgcref(t->metatable, obj2gco(tabV(&tmp))); } break; case IRFL_TAB_NOMM: /* Negative metamethod cache invalidated by lj_tab_set() below. */ break; default: lj_assertJ(0, "sunk store with bad field %d", irk->op2); break; } } 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_SOFTFP32 && 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]; #if !LJ_FR2 || defined(LUA_USE_ASSERT) SnapEntry *flinks = &T->snapmap[snap_nextofs(T, snap)-1-LJ_FR2]; #endif #if !LJ_FR2 ptrdiff_t ftsz0; #endif 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(L->cframe, pc+1); setcframe_pc(cframe_raw(cframe_prev(L->cframe)), pc); /* 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-LJ_FR2; #if !LJ_FR2 ftsz0 = frame_ftsz(frame); /* Preserve link to previous frame in slot #0. */ #endif 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_SOFTFP32 && (sn & SNAP_SOFTFPNUM) && tvisint(o)) { TValue tmp; snap_restoreval(J, T, ex, snapno, rfilt, ref+1, &tmp); o->u32.hi = tmp.u32.lo; #if !LJ_FR2 } else if ((sn & (SNAP_CONT|SNAP_FRAME))) { /* Overwrite tag with frame link. */ setframe_ftsz(o, snap_slot(sn) != 0 ? (int32_t)*flinks-- : ftsz0); L->base = o+1; #endif } else if ((sn & SNAP_KEYINDEX)) { /* A IRT_INT key index slot is restored as a number. Undo this. */ o->u32.lo = (uint32_t)(LJ_DUALNUM ? intV(o) : lj_num2int(numV(o))); o->u32.hi = LJ_KEYINDEX; } } } #if LJ_FR2 L->base += (map[nent+LJ_BE] & 0xff); #endif lj_assertJ(map + nent == flinks, "inconsistent frames in snapshot"); /* 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 subprojects/luajit/src/lj_bcread.c0000644000175000017500000003171414741067622016556 0ustar aniolaniol/* ** Bytecode reader. ** Copyright (C) 2005-2023 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_buf.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" #include "lj_strfmt.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_strfmt_pushf(L, "%s: %s", name, err2msg(em)); lj_err_throw(L, LUA_ERRSYNTAX); } /* Refill buffer. */ static LJ_NOINLINE void bcread_fill(LexState *ls, MSize len, int need) { lj_assertLS(len != 0, "empty refill"); if (len > LJ_MAX_BUF || ls->c < 0) bcread_error(ls, LJ_ERR_BCBAD); do { const char *buf; size_t sz; char *p = ls->sb.b; MSize n = (MSize)(ls->pe - ls->p); if (n) { /* Copy remainder to buffer. */ if (sbuflen(&ls->sb)) { /* Move down in buffer. */ lj_assertLS(ls->pe == ls->sb.w, "bad buffer pointer"); if (ls->p != p) memmove(p, ls->p, n); } else { /* Copy from buffer provided by reader. */ p = lj_buf_need(&ls->sb, len); memcpy(p, ls->p, n); } ls->p = p; ls->pe = p + n; } ls->sb.w = p + n; buf = ls->rfunc(ls->L, ls->rdata, &sz); /* Get more data from reader. */ if (buf == NULL || sz == 0) { /* EOF? */ if (need) bcread_error(ls, LJ_ERR_BCBAD); ls->c = -1; /* Only bad if we get called again. */ break; } if (sz >= LJ_MAX_BUF - n) lj_err_mem(ls->L); if (n) { /* Append to buffer. */ n += (MSize)sz; p = lj_buf_need(&ls->sb, n < len ? len : n); memcpy(ls->sb.w, buf, sz); ls->sb.w = p + n; ls->p = p; ls->pe = p + n; } else { /* Return buffer provided by reader. */ ls->p = buf; ls->pe = buf + sz; } } while ((MSize)(ls->pe - ls->p) < len); } /* Need a certain number of bytes. */ static LJ_AINLINE void bcread_need(LexState *ls, MSize len) { if (LJ_UNLIKELY((MSize)(ls->pe - ls->p) < 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((MSize)(ls->pe - ls->p) < len)) bcread_fill(ls, len, 0); } /* Return memory block from buffer. */ static LJ_AINLINE uint8_t *bcread_mem(LexState *ls, MSize len) { uint8_t *p = (uint8_t *)ls->p; ls->p += len; lj_assertLS(ls->p <= ls->pe, "buffer read overflow"); 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) { lj_assertLS(ls->p < ls->pe, "buffer read overflow"); return (uint32_t)(uint8_t)*ls->p++; } /* Read ULEB128 value from buffer. */ static LJ_AINLINE uint32_t bcread_uleb128(LexState *ls) { uint32_t v = lj_buf_ruleb128(&ls->p); lj_assertLS(ls->p <= ls->pe, "buffer read overflow"); 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)); } while (*p++ >= 0x80); } ls->p = (char *)p; lj_assertLS(ls->p <= ls->pe, "buffer read overflow"); 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 { lj_assertLS(tp <= BCDUMP_KTAB_TRUE, "bad constant type %d", tp); setpriV(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); lj_assertLS(!tvisnil(&key), "nil 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; lj_assertLS(tp == BCDUMP_KGC_CHILD, "bad constant type %d", tp); 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); BCIns op; if (ls->fr2 != LJ_FR2) op = BC_NOT; /* Mark non-native prototype. */ else if ((pt->flags & PROTO_VARARG)) op = BC_FUNCV; else op = BC_FUNCF; bc[0] = BCINS_AD(op, 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. */ GCproto *lj_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; /* 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); } 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_FR2) != (uint32_t)ls->fr2*BCDUMP_F_FR2) return 0; if ((flags & BCDUMP_F_FFI)) { #if LJ_HASFFI lua_State *L = ls->L; ctype_loadffi(L); #else return 0; #endif } if ((flags & BCDUMP_F_STRIP)) { ls->chunkname = lj_str_newz(ls->L, *ls->chunkarg == BCDUMP_HEAD1 ? "=?" : 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; lj_assertLS(ls->c == BCDUMP_HEAD1, "bad bytecode header"); bcread_savetop(L, ls, L->top); lj_buf_reset(&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; MSize len; const char *startp; /* Read length. */ if (ls->p < ls->pe && ls->p[0] == 0) { /* Shortcut EOF. */ ls->p++; break; } bcread_want(ls, 5); len = bcread_uleb128(ls); if (!len) break; /* EOF */ bcread_need(ls, len); startp = ls->p; pt = lj_bcread_proto(ls); if (ls->p != startp + len) bcread_error(ls, LJ_ERR_BCBAD); setprotoV(L, L->top, pt); incr_top(L); } if ((ls->pe != ls->p && !ls->endmark) || L->top-1 != bcread_oldtop(L, ls)) bcread_error(ls, LJ_ERR_BCBAD); /* Pop off last prototype. */ L->top--; return protoV(L->top); } subprojects/luajit/src/lj_parse.c0000644000175000017500000023634314741067622016455 0ustar aniolaniol/* ** Lua parser (source code -> bytecode). ** Copyright (C) 2005-2023 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_buf.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_strfmt.h" #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); #ifdef LUA_USE_ASSERT #define lj_assertFS(c, ...) (lj_assertG_(G(fs->L), (c), __VA_ARGS__)) #else #define lj_assertFS(c, ...) ((void)fs) #endif /* -- Error handling ------------------------------------------------------ */ LJ_NORET LJ_NOINLINE static void err_syntax(LexState *ls, ErrMsg em) { lj_lex_error(ls, ls->tok, em); } LJ_NORET LJ_NOINLINE static void err_token(LexState *ls, LexToken tok) { lj_lex_error(ls, ls->tok, LJ_ERR_XTOKEN, lj_lex_token2str(ls, tok)); } 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; lj_assertFS(expr_isnumk(e), "bad usage"); 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) { lj_assertFS(expr_isstrk(e) || e->k == VGLOBAL, "bad usage"); 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; lj_assertFS(dest != NO_JMP, "uninitialized jump target"); 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 { lj_assertFS(target < fs->pc, "bad jump target"); 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--; lj_assertFS(reg == fs->freereg, "bad regfree"); } } /* 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 { lj_assertFS(e->k == VVOID || e->k == VJMP, "bad expr type %d", e->k); 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; lj_assertFS(var->k == VINDEXED, "bad expr type %d", var->k); 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 { #ifdef LUA_USE_ASSERT /* Free late alloced key reg to avoid assert on free of value reg. */ /* This can only happen when called from expr_table(). */ if (e->k == VNONRELOC && ra >= fs->nactvar && rc >= ra) bcreg_free(fs, rc); #endif 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, fr2, obj = expr_toanyreg(fs, e); expr_free(fs, e); func = fs->freereg; fr2 = fs->ls->fr2; bcemit_AD(fs, BC_MOV, func+1+fr2, obj); /* Copy object to 1st argument. */ lj_assertFS(expr_isstrk(key), "bad usage"); idx = const_str(fs, key); if (idx <= BCMAX_C) { bcreg_reserve(fs, 2+fr2); bcemit_ABC(fs, BC_TGETS, func, obj, idx); } else { bcreg_reserve(fs, 3+fr2); bcemit_AD(fs, BC_KSTR, func+2+fr2, idx); bcemit_ABC(fs, BC_TGETV, func, obj, func+2+fr2); 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. */ lj_assertFS(expr_isnumk(e1) || e1->k == VNONRELOC, "bad expr type %d", e1->k); 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); ra = expr_toanyreg(fs, e1); rd = expr_toanyreg(fs, e2); } else { 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) { lj_assertFS(e1->t == NO_JMP, "jump list not closed"); expr_discharge(fs, e2); jmp_append(fs, &e2->f, e1->f); *e1 = *e2; } else if (op == OPR_OR) { lj_assertFS(e1->f == NO_JMP, "jump list not 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) { lj_assertFS(e1->u.s.info == bc_b(*bcptr(fs, e2))-1, "bad CAT stack layout"); 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 { lj_assertFS(op == OPR_NE || op == OPR_EQ || op == OPR_LT || op == OPR_GE || op == OPR_LE || op == OPR_GT, "bad binop %d", op); 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 { lj_assertFS(e->k == VNONRELOC, "bad expr type %d", e->k); } } else { lj_assertFS(op == BC_UNM || op == BC_LEN, "bad unop %d", op); 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); uint64_t *p = (uint64_t *)cdataptr(cd); if (cd->ctypeid == CTID_COMPLEX_DOUBLE) p[1] ^= U64x(80000000,00000000); else *p = ~*p+1u; 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), negk = (int32_t)(~(uint32_t)k+1u); if (k == negk) setnumV(o, -(lua_Number)k); else setintV(o, negk); 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->tok == tok) { lj_lex_next(ls); return 1; } return 0; } /* Check and consume token. */ static void lex_check(LexState *ls, LexToken tok) { if (ls->tok != 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->tok, LJ_ERR_XMATCH, swhat, swho, line); } } } /* Check for string token. */ static GCstr *lex_str(LexState *ls) { GCstr *s; if (ls->tok != TK_name && (LJ_52 || ls->tok != TK_goto)) err_token(ls, TK_name); s = strV(&ls->tokval); 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); } lj_assertFS((uintptr_t)name < VARNAME__MAX || lj_tab_getstr(fs->kt, name) != NULL, "unanchored variable name"); /* 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"); lj_assertFS(e->k == VLOCAL || e->k == VUPVAL, "bad expr type %d", e->k); 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); } lj_assertFS(name == NAME_BREAK || lj_tab_getstr(fs->kt, name) != NULL, "unanchored label name"); /* 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; lj_assertFS(gola_isgoto(vg), "expected goto"); lj_assertFS(bc_op(*ip) == BC_JMP || bc_op(*ip) == BC_UCLO, "bad bytecode op %d", bc_op(*ip)); 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); lj_assertLS((uintptr_t)name >= VARNAME__MAX, "expected goto name"); ls->linenumber = ls->fs->bcbase[vg->startpc].line; lj_assertLS(strref(vg->name) != NAME_BREAK, "unexpected 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; lj_assertFS(fs->freereg == fs->nactvar, "bad regalloc"); } /* 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; lj_assertFS(bl->nactvar == fs->nactvar, "bad regalloc"); 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; BCIns op; pt->sizebc = n; if (fs->ls->fr2 != LJ_FR2) op = BC_NOT; /* Mark non-native prototype. */ else if ((fs->flags & PROTO_VARARG)) op = BC_FUNCV; else op = BC_FUNCF; bc[0] = BCINS_AD(op, 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); lj_assertFS(!tvisint(&n->key), "unexpected integer 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); lj_assertFS(!tvismzero(&n->key), "unexpected -0 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; lj_assertFS(delta >= 0 && delta < 256, "bad line delta"); 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; lj_assertFS(delta >= 0 && delta < 65536, "bad line delta"); li[i] = (uint16_t)delta; } while (++i < n); } else { uint32_t *li = (uint32_t *)lineinfo; do { BCLine delta = base[i].line - first; lj_assertFS(delta >= 0, "bad line delta"); li[i] = (uint32_t)delta; } while (++i < 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_buf_reset(&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; char *p = lj_buf_more(&ls->sb, len); p = lj_buf_wmem(p, strdata(s), len); ls->sb.w = p; } *ofsvar = sbuflen(&ls->sb); 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; char *p; if ((uintptr_t)s < VARNAME__MAX) { p = lj_buf_more(&ls->sb, 1 + 2*5); *p++ = (char)(uintptr_t)s; } else { MSize len = s->len+1; p = lj_buf_more(&ls->sb, len + 2*5); p = lj_buf_wmem(p, strdata(s), len); } startpc = vs->startpc; p = lj_strfmt_wuleb128(p, startpc-lastpc); p = lj_strfmt_wuleb128(p, vs->endpc-startpc); ls->sb.w = p; lastpc = startpc; } } lj_buf_putb(&ls->sb, '\0'); /* Terminator for varinfo. */ return sbuflen(&ls->sb); } /* 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.b, sbuflen(&ls->sb)); /* Copy from temp. 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); lj_assertFS(fs->bl == NULL, "bad scope nesting"); /* 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_FNEW: 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; lj_assertL(ls->fs != NULL || ls->tok == TK_eof, "bad parser state"); 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(FuncState *fs, TValue *v, ExpDesc *e) { UNUSED(fs); if (e->k <= VKTRUE) { setpriV(v, ~(uint32_t)e->k); } else if (e->k == VKSTR) { setgcVraw(v, obj2gco(e->u.sval), LJ_TSTR); } else { lj_assertFS(tvisnumber(expr_numtv(e)), "bad number constant"); *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->tok != '}') { ExpDesc key, val; vcall = 0; if (ls->tok == '[') { 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->tok == TK_name || (!LJ_52 && ls->tok == 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(fs, &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(fs, 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; lj_assertFS(bc_a(ilp->ins) == freg && bc_op(ilp->ins) == (narr > 256 ? BC_TSETV : BC_TSETB), "bad CALL code generation"); 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)) { lj_assertFS(tabV(&n->val) == t, "bad dummy key in template table"); 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->tok != ')') { do { if (ls->tok == TK_name || (!LJ_52 && ls->tok == TK_goto)) { var_new(ls, nparams++, lex_str(ls)); } else if (ls->tok == 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); lj_assertFS(fs->nactvar == nparams, "bad regalloc"); 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->tok != 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->tok == '(') { #if !LJ_52 if (line != ls->lastline) err_syntax(ls, LJ_ERR_XAMBIG); #endif lj_lex_next(ls); if (ls->tok == ')') { /* 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->tok == '{') { expr_table(ls, &args); } else if (ls->tok == TK_string) { expr_init(&args, VKSTR, 0); args.u.sval = strV(&ls->tokval); lj_lex_next(ls); } else { err_syntax(ls, LJ_ERR_XFUNARG); return; /* Silence compiler. */ } lj_assertFS(e->k == VNONRELOC, "bad expr type %d", e->k); 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 - ls->fr2); } else { if (args.k != VVOID) expr_tonextreg(fs, &args); ins = BCINS_ABC(BC_CALL, base, 2, fs->freereg - base - ls->fr2); } 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->tok == '(') { BCLine line = ls->linenumber; lj_lex_next(ls); expr(ls, v); lex_match(ls, ')', '(', line); expr_discharge(ls->fs, v); } else if (ls->tok == TK_name || (!LJ_52 && ls->tok == TK_goto)) { var_lookup(ls, v); } else { err_syntax(ls, LJ_ERR_XSYMBOL); } for (;;) { /* Parse multiple expression suffixes. */ if (ls->tok == '.') { expr_field(ls, v); } else if (ls->tok == '[') { ExpDesc key; expr_toanyreg(fs, v); expr_bracket(ls, &key); expr_index(fs, v, &key); } else if (ls->tok == ':') { ExpDesc key; lj_lex_next(ls); expr_str(ls, &key); bcemit_method(fs, v, &key); parse_args(ls, v); } else if (ls->tok == '(' || ls->tok == TK_string || ls->tok == '{') { expr_tonextreg(fs, v); if (ls->fr2) bcreg_reserve(fs, 1); parse_args(ls, v); } else { break; } } } /* Parse simple expression. */ static void expr_simple(LexState *ls, ExpDesc *v) { switch (ls->tok) { case TK_number: expr_init(v, (LJ_HASFFI && tviscdata(&ls->tokval)) ? VKCDATA : VKNUM, 0); copyTV(ls->L, &v->u.nval, &ls->tokval); break; case TK_string: expr_init(v, VKSTR, 0); v->u.sval = strV(&ls->tokval); 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->tok == TK_not) { op = BC_NOT; } else if (ls->tok == '-') { op = BC_UNM; } else if (ls->tok == '#') { 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->tok); 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->tok == '.') /* Multiple dot-separated fields. */ expr_field(ls, &v); if (ls->tok == ':') { /* 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 parse_isend(LexToken tok) { switch (tok) { 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 (parse_isend(ls->tok) || ls->tok == ';') { /* 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. */ #ifdef LUAJIT_DISABLE_TAILCALL goto notailcall; #else 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)); #endif } 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->tok == TK_label) { synlevel_begin(ls); parse_label(ls); synlevel_end(ls); } else if (LJ_52 && ls->tok == ';') { lj_lex_next(ls); } else { break; } } /* Trailing label is considered to be outside of scope. */ if (parse_isend(ls->tok) && ls->tok != 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: if (bc_d(ins) >= fs->nactvar) return 0; 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); /* The iterator needs another 3 [4] slots (func [pc] | state ctl). */ bcreg_bump(fs, 3+ls->fr2); isnext = (nvars <= 5 && fs->pc > exprpc && 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->tok == '=') parse_for_num(ls, varname, line); else if (ls->tok == ',' || ls->tok == 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->tok == TK_elseif) { /* Parse multiple 'elseif' blocks. */ jmp_append(fs, &escapelist, bcemit_jmp(fs)); jmp_tohere(fs, flist); flist = parse_then(ls); } if (ls->tok == 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->tok) { 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; } /* 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 && !parse_isend(ls->tok)) { islast = parse_stmt(ls); lex_opt(ls, ';'); lj_assertLS(ls->fs->framesize >= ls->fs->freereg && ls->fs->freereg >= ls->fs->nactvar, "bad regalloc"); 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->tok != TK_eof) err_token(ls, TK_eof); pt = fs_finish(ls, ls->linenumber); L->top--; /* Drop chunkname. */ lj_assertL(fs.prev == NULL && ls->fs == NULL, "mismatched frame nesting"); lj_assertL(pt->sizeuv == 0, "toplevel proto has upvalues"); return pt; } subprojects/luajit/src/lj_dispatch.c0000644000175000017500000004111514741067622017131 0ustar aniolaniol/* ** Instruction dispatch handling. ** Copyright (C) 2005-2023 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_buf.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" #include "lj_strfmt.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" #if LJ_HASPROFILE #include "lj_profile.h" #endif #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); #if !LJ_HASJIT #define lj_dispatch_stitch lj_dispatch_ins #endif #if !LJ_HASPROFILE #define lj_dispatch_profile lj_dispatch_ins #endif #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]; /* Workaround for stable v2.1 bytecode. TODO: Replace with BC_IITERN. */ disp[BC_ITERN] = &lj_vm_IITERN; 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*sizeof(ASMFunction *)); #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_CALL 0x01 /* Override call dispatch. */ #define DISPMODE_RET 0x02 /* Override return dispatch. */ #define DISPMODE_INS 0x04 /* Override instruction dispatch. */ #define DISPMODE_JIT 0x10 /* JIT compiler on. */ #define DISPMODE_REC 0x20 /* Recording active. */ #define DISPMODE_PROF 0x40 /* Profiling active. */ /* 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 #if LJ_HASPROFILE mode |= (g->hookmask & HOOK_PROFILE) ? (DISPMODE_PROF|DISPMODE_INS) : 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_itern, 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_itern = makeasmfunc(lj_bc_ofs[BC_ITERN]); 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_itern = &lj_vm_IITERN; 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_ITERN] = f_itern; disp[GG_LEN_DDISP+BC_LOOP] = f_loop; /* Set dynamic instruction dispatch. */ if ((oldmode ^ mode) & (DISPMODE_PROF|DISPMODE_REC|DISPMODE_INS)) { /* Need to update the whole table. */ if (!(mode & 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_PROF) ? lj_vm_profhook : (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_INS)) { /* Otherwise set dynamic counting ins. */ disp[BC_FORL] = f_forl; disp[BC_ITERL] = f_iterl; disp[BC_ITERN] = f_itern; 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; else G2J(g)->flags |= (uint32_t)JIT_F_ON; 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)-LJ_FR2 : 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(g, tv); else return 0; /* Failed. */ } else { return 0; /* Failed. */ } setbc_op(&g->bc_cfunc_ext, BC_FUNCCW); } else { setbc_op(&g->bc_cfunc_ext, BC_FUNCC); } 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); #if LJ_HASPROFILE && !LJ_PROFILE_SIGPROF lj_profile_hook_enter(g); #else hook_enter(g); #endif hookf(L, &ar); lj_assertG(hook_active(g), "active hook flag removed"); setgcref(g->cur_L, obj2gco(L)); #if LJ_HASPROFILE && !LJ_PROFILE_SIGPROF lj_profile_hook_leave(g); #else hook_leave(g); #endif } } /* -- 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+LJ_FR2; 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. */ lj_assertG(L->top - L->base == delta, "unbalanced stack after tracing of instruction"); } } #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+LJ_FR2+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); lj_assertG(L->top - L->base == delta, "unbalanced stack after hot call"); 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. */ lj_assertG(L->top - L->base == delta, "unbalanced stack after hot instruction"); } #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. */ } #if LJ_HASJIT /* Stitch a new trace. */ void LJ_FASTCALL lj_dispatch_stitch(jit_State *J, const BCIns *pc) { ERRNO_SAVE lua_State *L = J->L; void *cf = cframe_raw(L->cframe); const BCIns *oldpc = cframe_pc(cf); setcframe_pc(cf, pc); /* Before dispatch, have to bias PC by 1. */ L->top = L->base + cur_topslot(curr_proto(L), pc+1, cframe_multres_n(cf)); lj_trace_stitch(J, pc-1); /* Point to the CALL instruction. */ setcframe_pc(cf, oldpc); ERRNO_RESTORE } #endif #if LJ_HASPROFILE /* Profile dispatch. */ void LJ_FASTCALL lj_dispatch_profile(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; setcframe_pc(cf, pc); L->top = L->base + cur_topslot(pt, pc, cframe_multres_n(cf)); lj_profile_interpreter(L); setcframe_pc(cf, oldpc); g = G(L); setgcref(g->cur_L, obj2gco(L)); setvmstate(g, INTERP); ERRNO_RESTORE } #endif subprojects/luajit/src/lib_string.c0000644000175000017500000004313214741067622017002 0ustar aniolaniol/* ** String library. ** Copyright (C) 2005-2023 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_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_buf.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_strfmt.h" #include "lj_lib.h" /* ------------------------------------------------------------------------ */ #define LJLIB_MODULE_string LJLIB_LUA(string_len) /* function(s) CHECK_str(s) return #s end */ 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-LJ_FR2, p[i]); return FFH_RES(n); } LJLIB_ASM(string_char) LJLIB_REC(.) { int i, nargs = (int)(L->top - L->base); char *buf = lj_buf_tmp(L, (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_FR2, 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_CF(string_rep) LJLIB_REC(.) { GCstr *s = lj_lib_checkstr(L, 1); int32_t rep = lj_lib_checkint(L, 2); GCstr *sep = lj_lib_optstr(L, 3); SBuf *sb = lj_buf_tmp_(L); if (sep && rep > 1) { GCstr *s2 = lj_buf_cat2str(L, sep, s); lj_buf_reset(sb); lj_buf_putstr(sb, s); s = s2; rep--; } sb = lj_buf_putstr_rep(sb, s, rep); setstrV(L, L->top-1, lj_buf_str(L, sb)); lj_gc_check(L); return 1; } LJLIB_ASM(string_reverse) LJLIB_REC(string_op IRCALL_lj_buf_putstr_reverse) { lj_lib_checkstr(L, 1); return FFH_RETRY; } LJLIB_ASM_(string_lower) LJLIB_REC(string_op IRCALL_lj_buf_putstr_lower) LJLIB_ASM_(string_upper) LJLIB_REC(string_op IRCALL_lj_buf_putstr_upper) /* ------------------------------------------------------------------------ */ static int writer_buf(lua_State *L, const void *p, size_t size, void *sb) { lj_buf_putmem((SBuf *)sb, p, (MSize)size); UNUSED(L); return 0; } LJLIB_CF(string_dump) { GCproto *pt = lj_lib_checkLproto(L, 1, 1); uint32_t flags = 0; SBuf *sb; TValue *o = L->base+1; if (o < L->top) { if (tvisstr(o)) { const char *mode = strVdata(o); char c; while ((c = *mode++)) { if (c == 's') flags |= BCDUMP_F_STRIP; if (c == 'd') flags |= BCDUMP_F_DETERMINISTIC; } } else if (tvistruecond(o)) { flags |= BCDUMP_F_STRIP; } } sb = lj_buf_tmp_(L); /* Assumes lj_bcwrite() doesn't use tmpbuf. */ L->top = L->base+1; if (!pt || lj_bcwrite(L, pt, writer_buf, sb, flags)) lj_err_caller(L, LJ_ERR_STRDUMP); setstrV(L, L->top-1, lj_buf_str(L, sb)); lj_gc_check(L); 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 '%' 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 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 int str_find_aux(lua_State *L, int find) { GCstr *s = lj_lib_checkstr(L, 1); GCstr *p = lj_lib_checkstr(L, 2); int32_t start = lj_lib_optint(L, 3, 1); MSize st; if (start < 0) start += (int32_t)s->len; else start--; if (start < 0) start = 0; st = (MSize)start; if (st > s->len) { #if LJ_52 setnilV(L->top-1); return 1; #else st = s->len; #endif } if (find && ((L->base+3 < L->top && tvistruecond(L->base+3)) || !lj_str_haspattern(p))) { /* Search for fixed string. */ const char *q = lj_str_find(strdata(s)+st, strdata(p), s->len-st, p->len); if (q) { setintV(L->top-2, (int32_t)(q-strdata(s)) + 1); setintV(L->top-1, (int32_t)(q-strdata(s)) + (int32_t)p->len); return 2; } } else { /* Search for pattern. */ MatchState ms; const char *pstr = strdata(p); const char *sstr = strdata(s) + st; int anchor = 0; if (*pstr == '^') { pstr++; anchor = 1; } ms.L = L; ms.src_init = strdata(s); ms.src_end = strdata(s) + s->len; do { /* Loop through string and try to match the pattern. */ const char *q; ms.level = ms.depth = 0; q = match(&ms, sstr, pstr); if (q) { if (find) { setintV(L->top++, (int32_t)(sstr-(strdata(s)-1))); setintV(L->top++, (int32_t)(q-strdata(s))); return push_captures(&ms, NULL, NULL) + 2; } else { return push_captures(&ms, sstr, q); } } } while (sstr++ < ms.src_end && !anchor); } setnilV(L->top-1); /* Not found. */ return 1; } LJLIB_CF(string_find) LJLIB_REC(.) { 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; } /* ------------------------------------------------------------------------ */ LJLIB_CF(string_format) LJLIB_REC(.) { int retry = 0; SBuf *sb; do { sb = lj_buf_tmp_(L); retry = lj_strfmt_putarg(L, sb, 1, -retry); } while (retry > 0); setstrV(L, L->top-1, lj_buf_str(L, sb)); lj_gc_check(L); 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); 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-1)); #endif return 1; } subprojects/luajit/src/lj_ir.c0000644000175000017500000003172514741067622015752 0ustar aniolaniol/* ** SSA IR (Intermediate Representation) emitter. ** Copyright (C) 2005-2023 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_buf.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_serialize.h" #include "lj_strfmt.h" #include "lj_prng.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; lj_assertJ(szins != 0, "zero IR size"); lj_assertJ(J->cur.nk == J->irbotlim || J->cur.nk-1 == J->irbotlim, "unexpected IR growth"); 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); } /* Load field of type t from GG_State + offset. Must be 32 bit aligned. */ TRef lj_ir_ggfload(jit_State *J, IRType t, uintptr_t ofs) { lj_assertJ((ofs & 3) == 0, "unaligned GG_State field offset"); ofs >>= 2; lj_assertJ(ofs >= IRFL__MAX && ofs <= 0x3ff, "GG_State field offset breaks 10 bit FOLD key limit"); lj_ir_set(J, IRT(IR_FLOAD, t), REF_NIL, ofs); return lj_opt_fold(J); } /* -- 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; } /* Get ref of next 64 bit IR constant and optionally grow IR. ** Note: this may invalidate all IRIns *! */ static LJ_AINLINE IRRef ir_nextk64(jit_State *J) { IRRef ref = J->cur.nk - 2; lj_assertJ(J->state != LJ_TRACE_ASM, "bad JIT state"); if (LJ_UNLIKELY(ref < J->irbotlim)) lj_ir_growbot(J); J->cur.nk = ref; return ref; } #if LJ_GC64 #define ir_nextkgc ir_nextk64 #else #define ir_nextkgc ir_nextk #endif /* 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); } /* Intern 64 bit constant, given by its 64 bit pattern. */ TRef lj_ir_k64(jit_State *J, IROp op, uint64_t u64) { 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])->u64 == u64) goto found; ref = ir_nextk64(J); ir = IR(ref); ir[1].tv.u64 = u64; ir->t.irt = t; ir->o = op; ir->op12 = 0; 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, u64); } /* Intern 64 bit integer constant. */ TRef lj_ir_kint64(jit_State *J, uint64_t u64) { return lj_ir_k64(J, IR_KINT64, 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; lj_assertJ(!isdead(J2G(J), o), "interning of dead GC object"); for (ref = J->chain[IR_KGC]; ref; ref = cir[ref].prev) if (ir_kgc(&cir[ref]) == o) goto found; ref = ir_nextkgc(J); ir = IR(ref); /* NOBARRIER: Current trace is a GC root. */ ir->op12 = 0; setgcref(ir[LJ_GC64].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); } /* Allocate GCtrace constant placeholder (no interning). */ TRef lj_ir_ktrace(jit_State *J) { IRRef ref = ir_nextkgc(J); IRIns *ir = IR(ref); lj_assertJ(irt_toitype_(IRT_P64) == LJ_TTRACE, "mismatched type mapping"); ir->t.irt = IRT_P64; ir->o = LJ_GC64 ? IR_KNUM : IR_KNULL; /* Not IR_KGC yet, but same size. */ ir->op12 = 0; ir->prev = 0; return TREF(ref, IRT_P64); } /* Intern pointer constant. */ TRef lj_ir_kptr_(jit_State *J, IROp op, void *ptr) { IRIns *ir, *cir = J->cur.ir; IRRef ref; #if LJ_64 && !LJ_GC64 lj_assertJ((void *)(uintptr_t)u32ptr(ptr) == ptr, "out-of-range GC pointer"); #endif for (ref = J->chain[op]; ref; ref = cir[ref].prev) if (ir_kptr(&cir[ref]) == ptr) goto found; #if LJ_GC64 ref = ir_nextk64(J); #else ref = ir_nextk(J); #endif ir = IR(ref); ir->op12 = 0; setmref(ir[LJ_GC64].ptr, ptr); ir->t.irt = IRT_PGC; ir->o = op; ir->prev = J->chain[op]; J->chain[op] = (IRRef1)ref; found: return TREF(ref, IRT_PGC); } /* 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. */ lj_assertJ(tref_isk(key) && slot == (IRRef)(IRRef1)slot, "out-of-range key/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); lj_assertL(ir->o != IR_KSLOT, "unexpected KSLOT"); /* Common mistake. */ switch (ir->o) { case IR_KPRI: setpriV(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: setnumV(tv, (lua_Number)(uintptr_t)ir_kptr(ir)); break; case IR_KNULL: setintV(tv, 0); 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: lj_assertL(0, "bad IR constant op %d", ir->o); 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, tref_isnum(tr) ? IRTOSTR_NUM : IRTOSTR_INT); } 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: lj_assertX(0, "bad IR op %d", op); 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: lj_assertX(0, "bad IR op %d", op); 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 subprojects/luajit/src/lj_vmmath.c0000644000175000017500000000706614741067622016635 0ustar aniolaniol/* ** Math helper functions for assembler VM. ** Copyright (C) 2005-2023 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" /* -- Wrapper functions --------------------------------------------------- */ #if LJ_TARGET_X86 && __ELF__ && __PIC__ /* Wrapper functions to deal with the ELF/x86 PIC disaster. */ LJ_FUNCA double lj_wrap_log(double x) { return log(x); } LJ_FUNCA double lj_wrap_log10(double x) { return log10(x); } LJ_FUNCA double lj_wrap_exp(double x) { return exp(x); } LJ_FUNCA double lj_wrap_sin(double x) { return sin(x); } LJ_FUNCA double lj_wrap_cos(double x) { return cos(x); } LJ_FUNCA double lj_wrap_tan(double x) { return tan(x); } LJ_FUNCA double lj_wrap_asin(double x) { return asin(x); } LJ_FUNCA double lj_wrap_acos(double x) { return acos(x); } LJ_FUNCA double lj_wrap_atan(double x) { return atan(x); } LJ_FUNCA double lj_wrap_sinh(double x) { return sinh(x); } LJ_FUNCA double lj_wrap_cosh(double x) { return cosh(x); } LJ_FUNCA double lj_wrap_tanh(double x) { return tanh(x); } LJ_FUNCA double lj_wrap_atan2(double x, double y) { return atan2(x, y); } LJ_FUNCA double lj_wrap_pow(double x, double y) { return pow(x, y); } LJ_FUNCA double lj_wrap_fmod(double x, double y) { return fmod(x, y); } #endif /* -- Helper functions ---------------------------------------------------- */ /* Required to prevent the C compiler from applying FMA optimizations. ** ** Yes, there's -ffp-contract and the FP_CONTRACT pragma ... in theory. ** But the current state of C compilers is a mess in this regard. ** Also, this function is not performance sensitive at all. */ LJ_NOINLINE static double lj_vm_floormul(double x, double y) { return lj_vm_floor(x / y) * y; } 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_floormul(x, 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_LDEXP - IR_ADD: return ldexp(x, (int)y); break; case IR_MIN - IR_ADD: return x < y ? x : y; break; case IR_MAX - IR_ADD: return x > y ? x : y; break; #endif default: return x; } } /* -- Helper functions for generated machine code ------------------------- */ #if (LJ_HASJIT && !(LJ_TARGET_ARM || LJ_TARGET_ARM64 || LJ_TARGET_PPC)) || LJ_TARGET_MIPS int32_t LJ_FASTCALL lj_vm_modi(int32_t a, int32_t b) { uint32_t y, ua, ub; /* This must be checked before using this function. */ lj_assertX(b != 0, "modulo with zero divisor"); ua = a < 0 ? ~(uint32_t)a+1u : (uint32_t)a; ub = b < 0 ? ~(uint32_t)b+1u : (uint32_t)b; y = ua % ub; if (y != 0 && (a^b) < 0) y = y - ub; if (((int32_t)y^b) < 0) y = ~y+1u; return (int32_t)y; } #endif #if LJ_HASJIT #ifdef LUAJIT_NO_LOG2 double lj_vm_log2(double a) { return log(a) * 1.4426950408889634074; } #endif /* 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_LOG: return log(x); case IRFPM_LOG2: return lj_vm_log2(x); default: lj_assertX(0, "bad fpm %d", fpm); } return 0; } #if LJ_HASFFI int lj_vm_errno(void) { return errno; } #endif #endif subprojects/luajit/src/lj_carith.h0000644000175000017500000000214314741067622016607 0ustar aniolaniol/* ** C data arithmetic. ** Copyright (C) 2005-2023 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_FUNC uint64_t lj_carith_shl64(uint64_t x, int32_t sh); LJ_FUNC uint64_t lj_carith_shr64(uint64_t x, int32_t sh); LJ_FUNC uint64_t lj_carith_sar64(uint64_t x, int32_t sh); LJ_FUNC uint64_t lj_carith_rol64(uint64_t x, int32_t sh); LJ_FUNC uint64_t lj_carith_ror64(uint64_t x, int32_t sh); #endif LJ_FUNC uint64_t lj_carith_shift64(uint64_t x, int32_t sh, int op); LJ_FUNC uint64_t lj_carith_check64(lua_State *L, int narg, CTypeID *id); #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 subprojects/luajit/src/lj_cdata.c0000644000175000017500000002231614741067622016410 0ustar aniolaniol/* ** C data management. ** Copyright (C) 2005-2023 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_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(lua_State *L, CTypeID id, CTSize sz, CTSize align) { global_State *g; MSize extra = sizeof(GCcdataVar) + sizeof(GCcdata) + (align > CT_MEMALIGN ? (1u<offset = (uint16_t)((char *)cd - p); cdatav(cd)->extra = extra; cdatav(cd)->len = sz; g = G(L); 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; } /* Allocate arbitrary C data object. */ GCcdata *lj_cdata_newx(CTState *cts, CTypeID id, CTSize sz, CTInfo info) { if (!(info & CTF_VLA) && ctype_align(info) <= CT_MEMALIGN) return lj_cdata_new(cts, id, sz); else return lj_cdata_newv(cts->L, id, sz, ctype_align(info)); } /* 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; lj_assertG(ctype_hassize(ct->info) || ctype_isfunc(ct->info) || ctype_isextern(ct->info), "free of ctype without a size"); lj_mem_free(g, cd, sizeof(GCcdata) + sz); } else { lj_mem_free(g, memcdatav(cd), sizecdatav(cd)); } } void lj_cdata_setfin(lua_State *L, GCcdata *cd, GCobj *obj, uint32_t it) { GCtab *t = tabref(G(L)->gcroot[GCROOT_FFI_FIN]); 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); if (it == LJ_TNIL) { setnilV(tv); cd->marked &= ~LJ_GC_CDATA_FIN; } else { setgcV(L, tv, obj, it); cd->marked |= LJ_GC_CDATA_FIN; } } } /* -- 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)) { lj_assertCTS(ct->size == CTSIZE_PTR, "ref is not pointer-sized"); 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); } /* Interning rejects refs to refs. */ lj_assertCTS(!ctype_isref(ct->info), "bad ref of ref"); if (tvisint(key)) { idx = (ptrdiff_t)intV(key); goto integer_key; } else if (tvisnum(key)) { /* Numeric key. */ #ifdef _MSC_VER /* Workaround for MSVC bug. */ volatile #endif lua_Number n = numV(key); idx = LJ_64 ? (ptrdiff_t)n : (ptrdiff_t)lj_num2int(n); 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); lj_assertCTS(ctype_isinteger(ctt->info) && ctt->size <= 4, "only 32 bit const supported"); /* NYI */ /* 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. */ lj_assertCTS(ctype_ispointer(s->info) || ctype_isfield(s->info), "pointer or field expected"); sid = ctype_cid(s->info); s = ctype_get(cts, sid); /* Resolve reference for field. */ if (ctype_isref(s->info)) { lj_assertCTS(s->size == CTSIZE_PTR, "ref is not pointer-sized"); 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. */ lj_assertCTS(ctype_ispointer(d->info) || ctype_isfield(d->info), "pointer or field expected"); d = ctype_child(cts, d); /* Resolve reference for field. */ if (ctype_isref(d->info)) { lj_assertCTS(d->size == CTSIZE_PTR, "ref is not pointer-sized"); 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); } lj_assertCTS(ctype_hassize(d->info), "store to ctype without size"); lj_assertCTS(!ctype_isvoid(d->info), "store to void type"); 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 subprojects/luajit/src/lj_lib.c0000644000175000017500000002273014741067622016102 0ustar aniolaniol/* ** Library function support. ** Copyright (C) 2005-2023 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" #if LJ_HASFFI #include "lj_ctype.h" #endif #include "lj_vm.h" #include "lj_strscan.h" #include "lj_strfmt.h" #include "lj_lex.h" #include "lj_bcdump.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); } static const uint8_t *lib_read_lfunc(lua_State *L, const uint8_t *p, GCtab *tab) { int len = *p++; GCstr *name = lj_str_new(L, (const char *)p, len); LexState ls; GCproto *pt; GCfunc *fn; memset(&ls, 0, sizeof(ls)); ls.L = L; ls.p = (const char *)(p+len); ls.pe = (const char *)~(uintptr_t)0; ls.c = -1; ls.level = (BCDUMP_F_STRIP|(LJ_BE*BCDUMP_F_BE)); ls.fr2 = LJ_FR2; ls.chunkname = name; pt = lj_bcread_proto(&ls); pt->firstline = ~(BCLine)0; fn = lj_func_newL_empty(L, pt, tabref(L->env)); /* NOBARRIER: See below for common barrier. */ setfuncV(L, lj_tab_setstr(L, tab, name), fn); return (const uint8_t *)ls.p; } 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_LUA: p = lib_read_lfunc(L, p, tab); break; 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; } } } } /* Push internal function on the stack. */ GCfunc *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); return fn; } void lj_lib_prereg(lua_State *L, const char *name, lua_CFunction f, GCtab *env) { luaL_findtable(L, LUA_REGISTRYINDEX, "_PRELOAD", 4); lua_pushcfunction(L, f); /* NOBARRIER: The function is new (marked white). */ setgcref(funcV(L->top-1)->c.env, obj2gco(env)); lua_setfield(L, -2, name); L->top--; } int lj_lib_postreg(lua_State *L, lua_CFunction cf, int id, const char *name) { GCfunc *fn = lj_lib_pushcf(L, cf, id); GCtab *t = tabref(curr_func(L)->c.env); /* Reference to parent table. */ setfuncV(L, lj_tab_setstr(L, t, lj_str_newz(L, name)), fn); lj_gc_anybarriert(L, t); setfuncV(L, L->top++, fn); return 1; } /* -- 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_strfmt_number(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; } 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); } GCproto *lj_lib_checkLproto(lua_State *L, int narg, int nolua) { TValue *o = L->base + narg-1; 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, narg, LUA_TFUNCTION); return NULL; /* unreachable */ } 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; } /* -- Strict type checks -------------------------------------------------- */ /* The following type checks do not coerce between strings and numbers. ** And they handle plain int64_t/uint64_t FFI numbers, too. */ #if LJ_HASBUFFER GCstr *lj_lib_checkstrx(lua_State *L, int narg) { TValue *o = L->base + narg-1; if (!(o < L->top && tvisstr(o))) lj_err_argt(L, narg, LUA_TSTRING); return strV(o); } int32_t lj_lib_checkintrange(lua_State *L, int narg, int32_t a, int32_t b) { TValue *o = L->base + narg-1; lj_assertL(b >= 0, "expected range must be non-negative"); if (o < L->top) { if (LJ_LIKELY(tvisint(o))) { int32_t i = intV(o); if (i >= a && i <= b) return i; } else if (LJ_LIKELY(tvisnum(o))) { /* For performance reasons, this doesn't check for integerness or ** integer overflow. Overflow detection still works, since all FPUs ** return either MININT or MAXINT, which is then out of range. */ int32_t i = (int32_t)numV(o); if (i >= a && i <= b) return i; #if LJ_HASFFI } else if (tviscdata(o)) { GCcdata *cd = cdataV(o); if (cd->ctypeid == CTID_INT64) { int64_t i = *(int64_t *)cdataptr(cd); if (i >= (int64_t)a && i <= (int64_t)b) return (int32_t)i; } else if (cd->ctypeid == CTID_UINT64) { uint64_t i = *(uint64_t *)cdataptr(cd); if ((a < 0 || i >= (uint64_t)a) && i <= (uint64_t)b) return (int32_t)i; } else { goto badtype; } #endif } else { goto badtype; } lj_err_arg(L, narg, LJ_ERR_NUMRNG); } badtype: lj_err_argt(L, narg, LUA_TNUMBER); return 0; /* unreachable */ } #endif subprojects/luajit/src/lj_lib.h0000644000175000017500000000746114741067622016113 0ustar aniolaniol/* ** Library function support. ** Copyright (C) 2005-2023 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 GCfunc *lj_lib_checkfunc(lua_State *L, int narg); LJ_FUNC GCproto *lj_lib_checkLproto(lua_State *L, int narg, int nolua); 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); #if LJ_HASBUFFER LJ_FUNC GCstr *lj_lib_checkstrx(lua_State *L, int narg); LJ_FUNC int32_t lj_lib_checkintrange(lua_State *L, int narg, int32_t a, int32_t b); #endif /* Avoid including lj_frame.h. */ #if LJ_GC64 #define lj_lib_upvalue(L, n) \ (&gcval(L->base-2)->fn.c.upvalue[(n)-1]) #elif LJ_FR2 #define lj_lib_upvalue(L, n) \ (&gcref((L->base-2)->gcr)->fn.c.upvalue[(n)-1]) #else #define lj_lib_upvalue(L, n) \ (&gcref((L->base-1)->fr.func)->fn.c.upvalue[(n)-1]) #endif #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 LJ_FUNC GCfunc *lj_lib_pushcc(lua_State *L, lua_CFunction f, int id, int n); #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_LUA(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); LJ_FUNC void lj_lib_prereg(lua_State *L, const char *name, lua_CFunction f, GCtab *env); LJ_FUNC int lj_lib_postreg(lua_State *L, lua_CFunction cf, int id, const char *name); /* 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 0x38 #define LIBINIT_LUA 0xf9 #define LIBINIT_SET 0xfa #define LIBINIT_NUMBER 0xfb #define LIBINIT_COPY 0xfc #define LIBINIT_LASTCL 0xfd #define LIBINIT_FFID 0xfe #define LIBINIT_END 0xff #endif subprojects/luajit/src/lj_opt_narrow.c0000644000175000017500000005750314741067622017534 0ustar aniolaniol/* ** NARROW: Narrowing of numbers to integers (double to int32_t). ** STRIPOV: Stripping of overflow checks. ** Copyright (C) 2005-2023 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); /* Limit total number of conversions. */ if (count <= 1 && nc->sp < nc->maxsp) { *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) { lj_assertJ(sp >= nc->stack+1, "stack underflow"); sp[-1] = emitir(IRT(IR_CONV, IRT_I64), sp[-1], (IRT_I64<<5)|IRT_INT|IRCONV_SEXT); } else if (op == NARROW_INT) { lj_assertJ(next < last, "missing arg to NARROW_INT"); *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; lj_assertJ(sp >= nc->stack+2, "stack underflow"); 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); } } lj_assertJ(sp == nc->stack+1, "stack misalignment"); 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; lj_assertJ(tref_isnumber(tr), "expected number type"); 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) { lj_assertJ(tref_isnumber(tr), "expected number type"); 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)) { uint32_t k = (uint32_t)numberVint(vc); if ((LJ_DUALNUM || k != 0) && k != 0x80000000u) { TRef zero = lj_ir_kint(J, 0); if (!LJ_DUALNUM) emitir(IRTGI(IR_NE), rc, zero); return emitir(IRTGI(IR_SUBOV), zero, rc); } rc = emitir(IRTN(IR_CONV), rc, IRCONV_NUM_INT); } return emitir(IRTN(IR_NEG), rc, lj_ir_ksimd(J, LJ_KSIMD_NEG)); } /* 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); } /* -- 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) { lj_assertJ(tvisnumber(&tv[FORL_IDX]) && tvisnumber(&tv[FORL_STOP]) && tvisnumber(&tv[FORL_STEP]), "expected number types"); /* 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 subprojects/luajit/src/lj_ircall.h0000644000175000017500000003100514741067622016602 0ustar aniolaniol/* ** IR CALL* instruction definitions. ** Copyright (C) 2005-2023 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) /* # 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_TYPE(ci) (((ci)->flags>>CCI_OTSHIFT) & IRT_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_A (IR_CALLA << 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_FA (CCI_CALL_A|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_T (IRT_GUARD << CCI_OTSHIFT) /* May throw. */ #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. */ /* Extra args for SOFTFP, SPLIT 64 bit. */ #define CCI_XARGS_SHIFT 14 #define CCI_XARGS(ci) (((ci)->flags >> CCI_XARGS_SHIFT) & 3) #define CCI_XA (1u << CCI_XARGS_SHIFT) #if LJ_SOFTFP32 || (LJ_32 && LJ_HASFFI) #define CCI_XNARGS(ci) (CCI_NARGS((ci)) + CCI_XARGS((ci))) #else #define CCI_XNARGS(ci) CCI_NARGS((ci)) #endif /* Helpers for conditional function definitions. */ #define IRCALLCOND_ANY(x) x #if LJ_TARGET_X86ORX64 || LJ_TARGET_ARM64 #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 #if LJ_SOFTFP && LJ_TARGET_MIPS #define IRCALLCOND_SOFTFP_MIPS(x) x #else #define IRCALLCOND_SOFTFP_MIPS(x) NULL #endif #if LJ_SOFTFP && LJ_TARGET_MIPS64 #define IRCALLCOND_SOFTFP_MIPS64(x) x #else #define IRCALLCOND_SOFTFP_MIPS64(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_HASBUFFER #define IRCALLCOND_BUFFER(x) x #else #define IRCALLCOND_BUFFER(x) NULL #endif #if LJ_HASBUFFER && LJ_HASFFI #define IRCALLCOND_BUFFFI(x) x #else #define IRCALLCOND_BUFFFI(x) NULL #endif #if LJ_SOFTFP #define XA_FP CCI_XA #define XA2_FP (CCI_XA+CCI_XA) #else #define XA_FP 0 #define XA2_FP 0 #endif #if LJ_SOFTFP32 #define XA_FP32 CCI_XA #define XA2_FP32 (CCI_XA+CCI_XA) #else #define XA_FP32 0 #define XA2_FP32 0 #endif #if LJ_32 #define XA_64 CCI_XA #define XA2_64 (CCI_XA+CCI_XA) #else #define XA_64 0 #define XA2_64 0 #endif /* Function definitions for CALL* instructions. */ #define IRCALLDEF(_) \ _(ANY, lj_str_cmp, 2, FN, INT, CCI_NOFPRCLOBBER) \ _(ANY, lj_str_find, 4, N, PGC, 0) \ _(ANY, lj_str_new, 3, S, STR, CCI_L|CCI_T) \ _(ANY, lj_strscan_num, 2, FN, INT, 0) \ _(ANY, lj_strfmt_int, 2, FN, STR, CCI_L|CCI_T) \ _(ANY, lj_strfmt_num, 2, FN, STR, CCI_L|CCI_T) \ _(ANY, lj_strfmt_char, 2, FN, STR, CCI_L|CCI_T) \ _(ANY, lj_strfmt_putint, 2, FL, PGC, CCI_T) \ _(ANY, lj_strfmt_putnum, 2, FL, PGC, CCI_T) \ _(ANY, lj_strfmt_putquoted, 2, FL, PGC, CCI_T) \ _(ANY, lj_strfmt_putfxint, 3, L, PGC, XA_64|CCI_T) \ _(ANY, lj_strfmt_putfnum_int, 3, L, PGC, XA_FP|CCI_T) \ _(ANY, lj_strfmt_putfnum_uint, 3, L, PGC, XA_FP|CCI_T) \ _(ANY, lj_strfmt_putfnum, 3, L, PGC, XA_FP|CCI_T) \ _(ANY, lj_strfmt_putfstr, 3, L, PGC, CCI_T) \ _(ANY, lj_strfmt_putfchar, 3, L, PGC, CCI_T) \ _(ANY, lj_buf_putmem, 3, S, PGC, CCI_T) \ _(ANY, lj_buf_putstr, 2, FL, PGC, CCI_T) \ _(ANY, lj_buf_putchar, 2, FL, PGC, CCI_T) \ _(ANY, lj_buf_putstr_reverse, 2, FL, PGC, CCI_T) \ _(ANY, lj_buf_putstr_lower, 2, FL, PGC, CCI_T) \ _(ANY, lj_buf_putstr_upper, 2, FL, PGC, CCI_T) \ _(ANY, lj_buf_putstr_rep, 3, L, PGC, CCI_T) \ _(ANY, lj_buf_puttab, 5, L, PGC, CCI_T) \ _(BUFFER, lj_bufx_set, 4, S, NIL, 0) \ _(BUFFFI, lj_bufx_more, 2, FS, INT, CCI_T) \ _(BUFFER, lj_serialize_put, 2, FS, PGC, CCI_T) \ _(BUFFER, lj_serialize_get, 2, FS, PTR, CCI_T) \ _(BUFFER, lj_serialize_encode, 2, FA, STR, CCI_L|CCI_T) \ _(BUFFER, lj_serialize_decode, 3, A, INT, CCI_L|CCI_T) \ _(ANY, lj_buf_tostr, 1, FL, STR, CCI_T) \ _(ANY, lj_tab_new_ah, 3, A, TAB, CCI_L|CCI_T) \ _(ANY, lj_tab_new1, 2, FA, TAB, CCI_L|CCI_T) \ _(ANY, lj_tab_dup, 2, FA, TAB, CCI_L|CCI_T) \ _(ANY, lj_tab_clear, 1, FS, NIL, 0) \ _(ANY, lj_tab_newkey, 3, S, PGC, CCI_L|CCI_T) \ _(ANY, lj_tab_keyindex, 2, FL, INT, 0) \ _(ANY, lj_vm_next, 2, FL, PTR, 0) \ _(ANY, lj_tab_len, 1, FL, INT, 0) \ _(ANY, lj_tab_len_hint, 2, 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, FA, PGC, CCI_L|CCI_T) \ _(ANY, lj_prng_u64d, 1, FS, NUM, CCI_CASTU64) \ _(ANY, lj_vm_modi, 2, FN, INT, 0) \ _(ANY, log10, 1, N, NUM, XA_FP) \ _(ANY, exp, 1, N, NUM, XA_FP) \ _(ANY, sin, 1, N, NUM, XA_FP) \ _(ANY, cos, 1, N, NUM, XA_FP) \ _(ANY, tan, 1, N, NUM, XA_FP) \ _(ANY, asin, 1, N, NUM, XA_FP) \ _(ANY, acos, 1, N, NUM, XA_FP) \ _(ANY, atan, 1, N, NUM, XA_FP) \ _(ANY, sinh, 1, N, NUM, XA_FP) \ _(ANY, cosh, 1, N, NUM, XA_FP) \ _(ANY, tanh, 1, N, NUM, XA_FP) \ _(ANY, fputc, 2, S, INT, 0) \ _(ANY, fwrite, 4, S, INT, 0) \ _(ANY, fflush, 1, S, INT, 0) \ /* ORDER FPM */ \ _(FPMATH, lj_vm_floor, 1, N, NUM, XA_FP) \ _(FPMATH, lj_vm_ceil, 1, N, NUM, XA_FP) \ _(FPMATH, lj_vm_trunc, 1, N, NUM, XA_FP) \ _(FPMATH, sqrt, 1, N, NUM, XA_FP) \ _(ANY, log, 1, N, NUM, XA_FP) \ _(ANY, lj_vm_log2, 1, N, NUM, XA_FP) \ _(ANY, pow, 2, N, NUM, XA2_FP) \ _(ANY, atan2, 2, N, NUM, XA2_FP) \ _(ANY, ldexp, 2, N, NUM, XA_FP) \ _(SOFTFP, lj_vm_tobit, 1, N, INT, XA_FP32) \ _(SOFTFP, softfp_add, 2, N, NUM, XA2_FP32) \ _(SOFTFP, softfp_sub, 2, N, NUM, XA2_FP32) \ _(SOFTFP, softfp_mul, 2, N, NUM, XA2_FP32) \ _(SOFTFP, softfp_div, 2, N, NUM, XA2_FP32) \ _(SOFTFP, softfp_cmp, 2, N, NIL, XA2_FP32) \ _(SOFTFP, softfp_i2d, 1, N, NUM, 0) \ _(SOFTFP, softfp_d2i, 1, N, INT, XA_FP32) \ _(SOFTFP_MIPS, lj_vm_sfmin, 2, N, NUM, XA2_FP32) \ _(SOFTFP_MIPS, lj_vm_sfmax, 2, N, NUM, XA2_FP32) \ _(SOFTFP_MIPS64, lj_vm_tointg, 1, N, INT, 0) \ _(SOFTFP_FFI, softfp_ui2d, 1, N, NUM, 0) \ _(SOFTFP_FFI, softfp_f2d, 1, N, NUM, 0) \ _(SOFTFP_FFI, softfp_d2ui, 1, N, INT, XA_FP32) \ _(SOFTFP_FFI, softfp_d2f, 1, N, FLOAT, XA_FP32) \ _(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, 1, N, NUM, XA_64) \ _(FP64_FFI, fp64_ul2d, 1, N, NUM, XA_64) \ _(FP64_FFI, fp64_l2f, 1, N, FLOAT, XA_64) \ _(FP64_FFI, fp64_ul2f, 1, N, FLOAT, XA_64) \ _(FP64_FFI, fp64_d2l, 1, N, I64, XA_FP) \ _(FP64_FFI, fp64_d2ul, 1, N, U64, XA_FP) \ _(FP64_FFI, fp64_f2l, 1, N, I64, 0) \ _(FP64_FFI, fp64_f2ul, 1, N, U64, 0) \ _(FFI, lj_carith_divi64, 2, N, I64, XA2_64|CCI_NOFPRCLOBBER) \ _(FFI, lj_carith_divu64, 2, N, U64, XA2_64|CCI_NOFPRCLOBBER) \ _(FFI, lj_carith_modi64, 2, N, I64, XA2_64|CCI_NOFPRCLOBBER) \ _(FFI, lj_carith_modu64, 2, N, U64, XA2_64|CCI_NOFPRCLOBBER) \ _(FFI, lj_carith_powi64, 2, N, I64, XA2_64|CCI_NOFPRCLOBBER) \ _(FFI, lj_carith_powu64, 2, N, U64, XA2_64|CCI_NOFPRCLOBBER) \ _(FFI, lj_cdata_newv, 4, S, CDATA, CCI_L) \ _(FFI, lj_cdata_setfin, 4, S, NIL, 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, 2, N, I64, XA2_64|CCI_NOFPRCLOBBER) \ _(FFI32, lj_carith_shl64, 2, N, U64, XA_64|CCI_NOFPRCLOBBER) \ _(FFI32, lj_carith_shr64, 2, N, U64, XA_64|CCI_NOFPRCLOBBER) \ _(FFI32, lj_carith_sar64, 2, N, U64, XA_64|CCI_NOFPRCLOBBER) \ _(FFI32, lj_carith_rol64, 2, N, U64, XA_64|CCI_NOFPRCLOBBER) \ _(FFI32, lj_carith_ror64, 2, N, U64, XA_64|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 #elif LJ_TARGET_MIPS || LJ_TARGET_PPC #define softfp_add __adddf3 #define softfp_sub __subdf3 #define softfp_mul __muldf3 #define softfp_div __divdf3 #define softfp_cmp __ledf2 #define softfp_i2d __floatsidf #define softfp_d2i __fixdfsi #define softfp_ui2d __floatunsidf #define softfp_f2d __extendsfdf2 #define softfp_d2ui __fixunsdfsi #define softfp_d2f __truncdfsf2 #define softfp_i2f __floatsisf #define softfp_ui2f __floatunsisf #define softfp_f2i __fixsfsi #define softfp_f2ui __fixunssfsi #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 #if LJ_TARGET_MIPS extern double lj_vm_sfmin(double a, double b); extern double lj_vm_sfmax(double a, double b); #endif #endif #if LJ_HASFFI && LJ_NEED_FP64 && !(LJ_TARGET_ARM && LJ_SOFTFP) #if defined(__GNUC__) || defined(__clang__) #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 subprojects/luajit/src/lj_clib.c0000644000175000017500000002550114741067622016244 0ustar aniolaniol/* ** FFI C library loader. ** Copyright (C) 2005-2023 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" #include "lj_strfmt.h" /* -- OS-specific functions ----------------------------------------------- */ #if LJ_TARGET_DLOPEN #include #include #if defined(RTLD_DEFAULT) && !defined(NO_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_strfmt_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_strfmt_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 && *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(); } if (!err) err = "dlopen failed"; 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, #if !LJ_TARGET_UWP CLIB_HANDLE_DLL, CLIB_HANDLE_CRT, CLIB_HANDLE_KERNEL32, CLIB_HANDLE_USER32, CLIB_HANDLE_GDI32, #endif 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(); #if LJ_TARGET_XBOXONE wchar_t wbuf[128]; char buf[128*2]; if (!FormatMessageW(FORMAT_MESSAGE_IGNORE_INSERTS|FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0, wbuf, sizeof(wbuf)/sizeof(wchar_t), NULL) || !WideCharToMultiByte(CP_ACP, 0, wbuf, 128, buf, 128*2, NULL, NULL)) #else char buf[128]; if (!FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS|FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0, buf, sizeof(buf), NULL)) #endif buf[0] = '\0'; lj_err_callermsg(L, lj_strfmt_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_strfmt_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 = LJ_WIN_LOADLIBA(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) { #if !LJ_TARGET_UWP 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); } } #endif } else if (cl->handle) { FreeLibrary((HINSTANCE)cl->handle); } } #if LJ_TARGET_UWP EXTERN_C IMAGE_DOS_HEADER __ImageBase; #endif 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). */ #if LJ_TARGET_UWP h = (HINSTANCE)&__ImageBase; #else 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 = LJ_WIN_LOADLIBA("kernel32.dll"); break; case CLIB_HANDLE_USER32: h = LJ_WIN_LOADLIBA("user32.dll"); break; case CLIB_HANDLE_GDI32: h = LJ_WIN_LOADLIBA("gdi32.dll"); break; } if (!h) continue; #endif 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_strfmt_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); lj_assertCTS(ctype_isinteger(ctt->info) && ctt->size <= 4, "only 32 bit const supported"); /* NYI */ 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; lj_assertCTS(ctype_isfunc(ct->info) || ctype_isextern(ct->info), "unexpected ctype %08x in clib", 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_strfmt_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); lj_gc_anybarriert(L, cl->cache); } } 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 subprojects/luajit/src/lj_ff.h0000644000175000017500000000055414741067622015734 0ustar aniolaniol/* ** Fast function IDs. ** Copyright (C) 2005-2023 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 subprojects/luajit/src/lj_target_x86.h0000644000175000017500000002454614741067622017343 0ustar aniolaniol/* ** Definitions for x86 and x64 CPUs. ** Copyright (C) 2005-2023 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) _(RIP) #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. */ RID_RIP = RID_MAX+5, /* Pseudo-id for RIP (x64 only), rm bits = 5. */ /* Calling conventions. */ RID_SP = RID_ESP, RID_RET = RID_EAX, #if LJ_64 RID_FPRET = RID_XMM0, #endif RID_RETLO = RID_EAX, RID_RETHI = RID_EDX, /* 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 (and maybe DISPATCH). */ #define RSET_GPR (RSET_RANGE(RID_MIN_GPR, RID_MAX_GPR) \ - RID2RSET(RID_ESP) \ - LJ_GC64*RID2RSET(RID_DISPATCH)) #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 #if LJ_GC64 #define SPS_FIXED 2 #else #define SPS_FIXED 4 #endif #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 #define EXITTRACE_VMSTATE 1 /* g->vmstate has traceno on exit. */ /* -- 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))) #define XV_660f38(o) ((uint32_t)(0x79e2c4 + (0x##o<<24))) #define XV_f20f38(o) ((uint32_t)(0x7be2c4 + (0x##o<<24))) #define XV_f20f3a(o) ((uint32_t)(0x7be3c4 + (0x##o<<24))) #define XV_f30f38(o) ((uint32_t)(0x7ae2c4 + (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_O16 = 0x66, 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_INT3 = 0xcc, XI_MOVmi = 0xc7, XI_GROUP5 = 0xff, /* Note: little-endian byte-order! */ XI_FLDZ = 0xeed9, XI_FLD1 = 0xe8d9, XI_FDUP = 0xc0d9, /* Really fld st0. */ XI_FPOP = 0xd8dd, /* Really fstp st0. */ XI_FPOP1 = 0xd9dd, /* Really fstp st1. */ XI_FRNDINT = 0xfcd9, XI_FSCALE = 0xfdd9, XI_FYL2X = 0xf1d9, /* VEX-encoded instructions. XV_* prefix. */ XV_RORX = XV_f20f3a(f0), XV_SARX = XV_f30f38(f7), XV_SHLX = XV_660f38(f7), XV_SHRX = XV_f20f38(f7), /* Variable-length opcodes. XO_* prefix. */ XO_OR = XO_(0b), 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_CVTTSD2SI= XO_f20f(2c), XO_CVTSI2SS = XO_f30f(2a), 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 subprojects/luajit/src/lj_asm_arm.h0000644000175000017500000022202014741067622016752 0ustar aniolaniol/* ** ARM IR assembler (SSA IR -> machine code). ** Copyright (C) 2005-2023 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])); } } } lj_assertA(rset_test(RSET_GPREVEN, r), "odd reg %d", 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); } } else if (ir->o == IR_TMPREF) { *ofsp = 0; return RID_SP; } } *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))) { lj_assertA(ofs == 0, "bad usage"); 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. ** VMLA rounds twice (UMA, not FMA) -- no need to check for JIT_F_OPT_FMA. ** VFMA needs VFPv4, which is uncommon on the remaining ARM32 targets. */ 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_XNARGS(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) { lj_assertA(rset_test(as->freeset, gpr), "reg %d not free", gpr); /* Must have been evicted. */ if (irt_isnum(ir->t)) { lj_assertA(rset_test(as->freeset, gpr+1), "reg %d not free", 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) { lj_assertA(rset_test(as->freeset, gpr), "reg %d not free", 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)) { lj_assertA(!irt_ispri(ir->t), "PRI dest"); 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_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+LJ_FR2+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); } /* -- Buffer operations --------------------------------------------------- */ #if LJ_HASBUFFER static void asm_bufhdr_write(ASMState *as, Reg sb) { Reg tmp = ra_scratch(as, rset_exclude(RSET_GPR, sb)); IRIns irgc; int32_t addr = i32ptr((void *)&J2G(as->J)->cur_L); irgc.ot = IRT(0, IRT_PGC); /* GC type. */ emit_storeofs(as, &irgc, RID_TMP, sb, offsetof(SBuf, L)); if ((as->flags & JIT_F_ARMV6T2)) { emit_dnm(as, ARMI_BFI, RID_TMP, lj_fls(SBUF_MASK_FLAG), tmp); } else { emit_dnm(as, ARMI_ORR, RID_TMP, RID_TMP, tmp); emit_dn(as, ARMI_AND|ARMI_K12|SBUF_MASK_FLAG, tmp, tmp); } emit_lso(as, ARMI_LDR, RID_TMP, ra_allock(as, (addr & ~4095), rset_exclude(rset_exclude(RSET_GPR, sb), tmp)), (addr & 4095)); emit_loadofs(as, &irgc, tmp, sb, offsetof(SBuf, L)); } #endif /* -- 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. */ lj_assertA(!irt_isint64(ir->t) && !(st == IRT_I64 || st == IRT_U64), "IR %04d has unsplit 64 bit type", (int)(ir - as->ir) - REF_BIAS); #if LJ_SOFTFP /* FP conversions are handled by SPLIT. */ lj_assertA(!irt_isfp(ir->t) && !(st == IRT_NUM || st == IRT_FLOAT), "IR %04d has FP type", (int)(ir - as->ir) - REF_BIAS); /* Can't check for same types: SPLIT uses CONV int.int + BXOR for sfp NEG. */ #else lj_assertA(irt_type(ir->t) != st, "inconsistent types for CONV"); 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. */ lj_assertA(irt_isint(ir->t) && st == IRT_NUM, "bad type for checked CONV"); 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); lj_assertA(irt_isint(ir->t) || irt_isu32(ir->t), "bad type for CONV EXT"); 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. */ } } } 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); } /* -- Memory references --------------------------------------------------- */ /* Get pointer to TValue. */ static void asm_tvptr(ASMState *as, Reg dest, IRRef ref, MSize mode) { if ((mode & IRTMPREF_IN1)) { IRIns *ir = IR(ref); if (irt_isnum(ir->t)) { if ((mode & IRTMPREF_OUT1)) { #if LJ_SOFTFP lj_assertA(irref_isk(ref), "unsplit FP op"); emit_dm(as, ARMI_MOV, dest, RID_SP); emit_lso(as, ARMI_STR, ra_allock(as, (int32_t)ir_knum(ir)->u32.lo, RSET_GPR), RID_SP, 0); emit_lso(as, ARMI_STR, ra_allock(as, (int32_t)ir_knum(ir)->u32.hi, RSET_GPR), RID_SP, 4); #else Reg src = ra_alloc1(as, ref, RSET_FPR); emit_dm(as, ARMI_MOV, dest, RID_SP); emit_vlso(as, ARMI_VSTR_D, src, RID_SP, 0); #endif } else if (irref_isk(ref)) { /* Use the number constant itself as a TValue. */ ra_allockreg(as, i32ptr(ir_knum(ir)), dest); } else { #if LJ_SOFTFP lj_assertA(0, "unsplit FP op"); #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. ** This assumes the following call has max. 4 args. */ Reg type; emit_dm(as, ARMI_MOV, dest, RID_SP); if (!irt_ispri(ir->t)) { Reg src = ra_alloc1(as, ref, RSET_GPR); emit_lso(as, ARMI_STR, src, RID_SP, 0); } if (LJ_SOFTFP && (ir+1)->o == IR_HIOP && !irt_isnil((ir+1)->t)) type = ra_alloc1(as, ref+1, RSET_GPR); else type = ra_allock(as, irt_toitype(ir->t), RSET_GPR); emit_lso(as, ARMI_STR, type, RID_SP, 4); } } else { emit_dm(as, ARMI_MOV, dest, RID_SP); } } 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(as, 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->sid 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, sid)); 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); lj_assertA(ofs % sizeof(Node) == 0, "unaligned HREFK slot"); 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_uref(ASMState *as, IRIns *ir) { Reg dest = ra_dest(as, ir, RSET_GPR); int guarded = (irt_t(ir->t) & (IRT_GUARD|IRT_TYPE)) == (IRT_GUARD|IRT_PGC); if (irref_isk(ir->op1) && !guarded) { 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 { if (guarded) { asm_guardcc(as, ir->o == IR_UREFC ? CC_NE : CC_EQ); emit_n(as, ARMI_CMP|ARMI_K12|1, RID_TMP); } if (ir->o == IR_UREFC) emit_opk(as, ARMI_ADD, dest, dest, (int32_t)offsetof(GCupval, tv), RSET_GPR); else emit_lso(as, ARMI_LDR, dest, dest, (int32_t)offsetof(GCupval, v)); if (guarded) emit_lso(as, ARMI_LDRB, RID_TMP, dest, (int32_t)offsetof(GCupval, closed)); if (irref_isk(ir->op1)) { GCfunc *fn = ir_kfunc(IR(ir->op1)); int32_t k = (int32_t)gcrefu(fn->l.uvptr[(ir->op2 >> 8)]); emit_loadi(as, dest, k); } else { emit_lso(as, ARMI_LDR, dest, ra_alloc1(as, ir->op1, RSET_GPR), (int32_t)offsetof(GCfuncL, uvptr) + 4*(int32_t)(ir->op2 >> 8)); } } } static void asm_fref(ASMState *as, IRIns *ir) { UNUSED(as); UNUSED(ir); lj_assertA(!ra_used(ir), "unfused FREF"); } 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(ASMState *as, IRIns *ir) { UNUSED(as); 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: lj_assertA(!LJ_SOFTFP, "unsplit FP op"); return ARMI_VLDR_D; case IRT_FLOAT: if (!LJ_SOFTFP) return ARMI_VLDR_S; /* fallthrough */ default: return ARMI_LDR; } } static ARMIns asm_fxstoreins(ASMState *as, IRIns *ir) { UNUSED(as); 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: lj_assertA(!LJ_SOFTFP, "unsplit FP op"); return ARMI_VSTR_D; case IRT_FLOAT: if (!LJ_SOFTFP) return ARMI_VSTR_S; /* fallthrough */ default: return ARMI_STR; } } static void asm_fload(ASMState *as, IRIns *ir) { Reg dest = ra_dest(as, ir, RSET_GPR); ARMIns ai = asm_fxloadins(as, ir); Reg idx; int32_t ofs; if (ir->op1 == REF_NIL) { /* FLOAD from GG_State with offset. */ idx = ra_allock(as, (int32_t)(ir->op2<<2) + (int32_t)J2GG(as->J), RSET_GPR); ofs = 0; } else { idx = ra_alloc1(as, ir->op1, RSET_GPR); 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(as, 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); lj_assertA(!(ir->op2 & IRXLOAD_UNALIGNED), "unaligned XLOAD"); asm_fusexref(as, asm_fxloadins(as, 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(as, ir), src, ir->op1, rset_exclude(RSET_GPR, src), ofs); } } #define asm_xstore(as, ir) asm_xstore_(as, ir, 0) 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)) { lj_assertA((LJ_SOFTFP ? 0 : irt_isnum(ir->t)) || irt_isint(ir->t) || irt_isaddr(ir->t), "bad load type %d", irt_type(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 (ir->o == IR_VLOAD) ofs += 8 * ir->op2; 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; lj_assertA(!(ir->op2 & IRSLOAD_PARENT), "bad parent SLOAD"); /* Handled by asm_head_side(). */ lj_assertA(irt_isguard(ir->t) || !(ir->op2 & IRSLOAD_TYPECHECK), "inconsistent SLOAD variant"); #if LJ_SOFTFP lj_assertA(!(ir->op2 & IRSLOAD_CONVERT), "unsplit SLOAD 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); lj_assertA((LJ_SOFTFP ? 0 : irt_isnum(ir->t)) || irt_isint(ir->t) || irt_isaddr(ir->t), "bad SLOAD type %d", irt_type(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); if ((ir->op2 & IRSLOAD_KEYINDEX)) { emit_n(as, ARMI_CMN|ARMI_K12|1, type); emit_dn(as, ARMI_EOR^emit_isk12(ARMI_EOR, ~LJ_KEYINDEX), type, type); } else { 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 id = (CTypeID)IR(ir->op1)->i; CTSize sz; CTInfo info = lj_ctype_info(cts, id, &sz); const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_mem_newgco]; IRRef args[4]; RegSet allow = (RSET_GPR & ~RSET_SCRATCH); RegSet drop = RSET_SCRATCH; lj_assertA(sz != CTSIZE_INVALID || (ir->o == IR_CNEW && ir->op2 != REF_NIL), "bad CNEW/CNEWI operands"); 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); lj_assertA(sz == 4 || sz == 8, "bad CNEWI size %d", sz); if (sz == 8) { ofs += 4; ir++; lj_assertA(ir->o == IR_HIOP, "expected HIOP for CNEWI"); } 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--; } } else if (ir->op2 != REF_NIL) { /* Create VLA/VLS/aligned cdata. */ ci = &lj_ir_callinfo[IRCALL_lj_cdata_newv]; args[0] = ASMREF_L; /* lua_State *L */ args[1] = ir->op1; /* CTypeID id */ args[2] = ir->op2; /* CTSize sz */ args[3] = ASMREF_TMP1; /* CTSize align */ asm_gencall(as, ci, args); emit_loadi(as, ra_releasetmp(as, ASMREF_TMP1), (int32_t)ctype_align(info)); return; } /* Initialize gct and ctypeid. lj_mem_newgco() already sets marked. */ { uint32_t k = emit_isk12(ARMI_MOV, id); Reg r = k ? RID_R1 : ra_allock(as, id, 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); } args[0] = ASMREF_L; /* lua_State *L */ args[1] = ASMREF_TMP1; /* MSize size */ asm_gencall(as, ci, args); ra_allockreg(as, (int32_t)(sz+sizeof(GCcdata)), ra_releasetmp(as, ASMREF_TMP1)); } #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). */ lj_assertA(IR(ir->op1)->o == IR_UREFC, "bad OBAR type"); 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 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)); } static void asm_fpmath(ASMState *as, IRIns *ir) { 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); } #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); } /* Try to drop cmp r, #0. */ static ARMIns asm_drop_cmp0(ASMState *as, ARMIns ai) { if (as->flagmcp == as->mcp) { 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 in general. */ } return ai; } static void asm_intop_s(ASMState *as, IRIns *ir, ARMIns ai) { asm_intop(as, ir, asm_drop_cmp0(as, 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); } #define asm_addov(as, ir) asm_add(as, ir) #define asm_subov(as, ir) asm_sub(as, ir) #define asm_mulov(as, ir) asm_mul(as, ir) #if !LJ_SOFTFP #define asm_fpdiv(as, ir) asm_fparith(as, ir, ARMI_VDIV_D) #define asm_abs(as, ir) asm_fpunary(as, ir, ARMI_VABS_D) #endif 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_bitop(ASMState *as, IRIns *ir, ARMIns ai) { ai = asm_drop_cmp0(as, ai); 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); } } #define asm_bnot(as, ir) asm_bitop(as, ir, ARMI_MVN) static void asm_bswap(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); } } #define asm_band(as, ir) asm_bitop(as, ir, ARMI_AND) #define asm_bor(as, ir) asm_bitop(as, ir, ARMI_ORR) #define asm_bxor(as, ir) asm_bitop(as, ir, ARMI_EOR) 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); } } #define asm_bshl(as, ir) asm_bitshift(as, ir, ARMSH_LSL) #define asm_bshr(as, ir) asm_bitshift(as, ir, ARMSH_LSR) #define asm_bsar(as, ir) asm_bitshift(as, ir, ARMSH_ASR) #define asm_bror(as, ir) asm_bitshift(as, ir, ARMSH_ROR) #define asm_brol(as, ir) lj_assertA(0, "unexpected BROL") 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); } #define asm_min(as, ir) asm_min_max(as, ir, CC_GT, CC_PL) #define asm_max(as, ir) asm_min_max(as, ir, CC_LT, CC_LE) /* -- 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; lj_assertA(irt_isint(ir->t) || irt_isu32(ir->t) || irt_isaddr(ir->t), "bad comparison data type %d", irt_type(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. */ } static void asm_comp(ASMState *as, IRIns *ir) { #if !LJ_SOFTFP if (irt_isnum(ir->t)) asm_fpcomp(as, ir); else #endif asm_intcomp(as, ir); } #define asm_equal(as, ir) asm_comp(as, ir) #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 /* -- Split register ops -------------------------------------------------- */ /* Hiword op of a split 32/32 bit op. Previous op is the loword op. */ static void asm_hiop(ASMState *as, IRIns *ir) { /* 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 LJ_HASFFI || LJ_SOFTFP 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_PL : CC_LE); 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; } #endif 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; case IR_CNEWI: /* Nothing to do here. Handled by lo op itself. */ 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; case IR_ASTORE: case IR_HSTORE: case IR_USTORE: case IR_TOSTR: case IR_TMPREF: /* Nothing to do here. Handled by lo op itself. */ break; #endif case IR_CALLN: case IR_CALLL: case IR_CALLS: case IR_CALLXS: if (!uselo) ra_allocref(as, ir->op1, RID2RSET(RID_RETLO)); /* Mark lo op as used. */ break; default: lj_assertA(0, "bad HIOP for op %d", (ir-1)->o); break; } } /* -- Profiling ----------------------------------------------------------- */ static void asm_prof(ASMState *as, IRIns *ir) { UNUSED(ir); asm_guardcc(as, CC_NE); emit_n(as, ARMI_TST|ARMI_K12|HOOK_PROFILE, RID_TMP); emit_lsptr(as, ARMI_LDRB, RID_TMP, (void *)&J2G(as->J)->hookmask); } /* -- 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) { int savereg = 0; Reg pbase; uint32_t k; if (irp) { if (!ra_hasspill(irp->s)) { pbase = irp->r; lj_assertA(ra_hasreg(pbase), "base reg lost"); } else if (allow) { pbase = rset_pickbot(allow); } else { pbase = RID_RET; savereg = 1; } } else { pbase = RID_BASE; } emit_branch(as, ARMF_CC(ARMI_BL, CC_LS), exitstub_addr(as->J, exitno)); if (savereg) emit_lso(as, ARMI_LDR, RID_RET, RID_SP, 0); /* Restore temp. register. */ k = emit_isk12(0, (int32_t)(8*topslot)); lj_assertA(k, "slot offset %d does not fit in K12", 8*topslot); 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)->cur_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 (savereg) 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, cur_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; int32_t bias = 0; /* 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) - bias; 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; /* LJ_SOFTFP: must be a number constant. */ lj_assertA(irref_isk(ref), "unsplit FP op"); 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); if (LJ_UNLIKELY(ofs < -1020 || ofs > 1020)) { int32_t adj = ofs & 0xffffff00; /* K12-friendly. */ bias += adj; ofs -= adj; emit_addptr(as, RID_BASE, -adj); } emit_vlso(as, ARMI_VSTR_D, src, RID_BASE, ofs); #endif } else { RegSet odd = rset_exclude(RSET_GPRODD, RID_BASE); Reg type; lj_assertA(irt_ispri(ir->t) || irt_isaddr(ir->t) || irt_isinteger(ir->t), "restore of IR type %d", irt_type(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 if ((sn & SNAP_KEYINDEX)) { type = ra_allock(as, (int32_t)LJ_KEYINDEX, odd); } else { type = ra_allock(as, (int32_t)irt_toitype(ir->t), odd); } emit_lso(as, ARMI_STR, type, RID_BASE, ofs+4); } checkmclim(as); } emit_addptr(as, RID_BASE, bias); lj_assertA(map + nent == flinks, "inconsistent frames in snapshot"); } /* -- GC handling --------------------------------------------------------- */ /* Marker to prevent patching the GC check exit. */ #define ARM_NOPATCH_GC_CHECK (ARMI_BIC|ARMI_K12) /* 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. */ *--as->mcp = ARM_NOPATCH_GC_CHECK; 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); } } /* Fixup the tail of the loop. */ static void asm_loop_tail_fixup(ASMState *as) { UNUSED(as); /* Nothing to do. */ } /* -- Head of trace ------------------------------------------------------- */ /* Reload L register from g->cur_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, cur_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 Reg asm_head_side_base(ASMState *as, IRIns *irp) { 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)) { return ra_dest(as, ir, RSET_GPR); } else { Reg r = irp->r; lj_assertA(ra_hasreg(r), "base reg lost"); if (r != ir->r && !rset_test(as->freeset, r)) ra_restore(as, regcost_ref(as->cost[r])); ra_destreg(as, ir, r); return r; } } /* -- 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); lj_assertA(k, "stack adjustment %d does not fit in K12", spadj); 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. */ } /* -- 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 = CCI_XNARGS(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(irt_isfp(ir->t) ? RID_FPRET : 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[-1] != ARM_NOPATCH_GC_CHECK) { *p = (ins & 0xfe000000u) | (((target-p)-2) & 0x00ffffffu); cend = p+1; if (!cstart) cstart = p; } } lj_assertJ(cstart != NULL, "exit stub %d not found", exitno); lj_mcode_sync(cstart, cend); lj_mcode_patch(J, mcarea, 1); } subprojects/luajit/src/lj_lex.c0000644000175000017500000003264414741067622016131 0ustar aniolaniol/* ** Lexical analyzer. ** Copyright (C) 2005-2023 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_buf.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" #include "lj_strfmt.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 LEX_EOF (-1) #define lex_iseol(ls) (ls->c == '\n' || ls->c == '\r') /* Get more input from reader. */ static LJ_NOINLINE LexChar lex_more(LexState *ls) { size_t sz; const char *p = ls->rfunc(ls->L, ls->rdata, &sz); if (p == NULL || sz == 0) return LEX_EOF; if (sz >= LJ_MAX_BUF) { if (sz != ~(size_t)0) lj_err_mem(ls->L); sz = ~(uintptr_t)0 - (uintptr_t)p; if (sz >= LJ_MAX_BUF) sz = LJ_MAX_BUF-1; ls->endmark = 1; } ls->pe = p + sz; ls->p = p + 1; return (LexChar)(uint8_t)p[0]; } /* Get next character. */ static LJ_AINLINE LexChar lex_next(LexState *ls) { return (ls->c = ls->p < ls->pe ? (LexChar)(uint8_t)*ls->p++ : lex_more(ls)); } /* Save character. */ static LJ_AINLINE void lex_save(LexState *ls, LexChar c) { lj_buf_putb(&ls->sb, c); } /* Save previous character and get next character. */ static LJ_AINLINE LexChar lex_savenext(LexState *ls) { lex_save(ls, ls->c); return lex_next(ls); } /* Skip line break. Handles "\n", "\r", "\r\n" or "\n\r". */ static void lex_newline(LexState *ls) { LexChar old = ls->c; lj_assertLS(lex_iseol(ls), "bad usage"); lex_next(ls); /* Skip "\n" or "\r". */ if (lex_iseol(ls) && ls->c != old) lex_next(ls); /* Skip "\n\r" or "\r\n". */ if (++ls->linenumber >= LJ_MAX_LINE) lj_lex_error(ls, ls->tok, LJ_ERR_XLINES); } /* -- Scanner for terminals ----------------------------------------------- */ /* Parse a number literal. */ static void lex_number(LexState *ls, TValue *tv) { StrScanFmt fmt; LexChar c, xp = 'e'; lj_assertLS(lj_char_isdigit(ls->c), "bad usage"); if ((c = ls->c) == '0' && (lex_savenext(ls) | 0x20) == 'x') xp = 'p'; while (lj_char_isident(ls->c) || ls->c == '.' || ((ls->c == '-' || ls->c == '+') && (c | 0x20) == xp)) { c = ls->c; lex_savenext(ls); } lex_save(ls, '\0'); fmt = lj_strscan_scan((const uint8_t *)ls->sb.b, sbuflen(&ls->sb)-1, 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; lj_assertLS(fmt == STRSCAN_I64 || fmt == STRSCAN_U64 || fmt == STRSCAN_IMAG, "unexpected number format %d", fmt); ctype_loadffi(L); 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 { lj_assertLS(fmt == STRSCAN_ERROR, "unexpected number format %d", fmt); lj_lex_error(ls, TK_number, LJ_ERR_XNUMBER); } } /* Skip equal signs for "[=...=[" and "]=...=]" and return their count. */ static int lex_skipeq(LexState *ls) { int count = 0; LexChar s = ls->c; lj_assertLS(s == '[' || s == ']', "bad usage"); while (lex_savenext(ls) == '=' && count < 0x20000000) count++; return (ls->c == s) ? count : (-count) - 1; } /* Parse a long string or long comment (tv set to NULL). */ static void lex_longstring(LexState *ls, TValue *tv, int sep) { lex_savenext(ls); /* Skip second '['. */ if (lex_iseol(ls)) /* Skip initial newline. */ lex_newline(ls); for (;;) { switch (ls->c) { case LEX_EOF: lj_lex_error(ls, TK_eof, tv ? LJ_ERR_XLSTR : LJ_ERR_XLCOM); break; case ']': if (lex_skipeq(ls) == sep) { lex_savenext(ls); /* Skip second ']'. */ goto endloop; } break; case '\n': case '\r': lex_save(ls, '\n'); lex_newline(ls); if (!tv) lj_buf_reset(&ls->sb); /* Don't waste space for comments. */ break; default: lex_savenext(ls); break; } } endloop: if (tv) { GCstr *str = lj_parse_keepstr(ls, ls->sb.b + (2 + (MSize)sep), sbuflen(&ls->sb) - 2*(2 + (MSize)sep)); setstrV(ls->L, tv, str); } } /* Parse a string. */ static void lex_string(LexState *ls, TValue *tv) { LexChar delim = ls->c; /* Delimiter is '\'' or '"'. */ lex_savenext(ls); while (ls->c != delim) { switch (ls->c) { case LEX_EOF: 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 '\\': { LexChar c = lex_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 = (lex_next(ls) & 15u) << 4; if (!lj_char_isdigit(ls->c)) { if (!lj_char_isxdigit(ls->c)) goto err_xesc; c += 9 << 4; } c += (lex_next(ls) & 15u); if (!lj_char_isdigit(ls->c)) { if (!lj_char_isxdigit(ls->c)) goto err_xesc; c += 9; } break; case 'u': /* Unicode escape '\u{XX...}'. */ if (lex_next(ls) != '{') goto err_xesc; lex_next(ls); c = 0; do { c = (c << 4) | (ls->c & 15u); if (!lj_char_isdigit(ls->c)) { if (!lj_char_isxdigit(ls->c)) goto err_xesc; c += 9; } if (c >= 0x110000) goto err_xesc; /* Out of Unicode range. */ } while (lex_next(ls) != '}'); if (c < 0x800) { if (c < 0x80) break; lex_save(ls, 0xc0 | (c >> 6)); } else { if (c >= 0x10000) { lex_save(ls, 0xf0 | (c >> 18)); lex_save(ls, 0x80 | ((c >> 12) & 0x3f)); } else { if (c >= 0xd800 && c < 0xe000) goto err_xesc; /* No surrogates. */ lex_save(ls, 0xe0 | (c >> 12)); } lex_save(ls, 0x80 | ((c >> 6) & 0x3f)); } c = 0x80 | (c & 0x3f); break; case 'z': /* Skip whitespace. */ lex_next(ls); while (lj_char_isspace(ls->c)) if (lex_iseol(ls)) lex_newline(ls); else lex_next(ls); continue; case '\n': case '\r': lex_save(ls, '\n'); lex_newline(ls); continue; case '\\': case '\"': case '\'': break; case LEX_EOF: continue; default: if (!lj_char_isdigit(c)) goto err_xesc; c -= '0'; /* Decimal escape '\ddd'. */ if (lj_char_isdigit(lex_next(ls))) { c = c*10 + (ls->c - '0'); if (lj_char_isdigit(lex_next(ls))) { c = c*10 + (ls->c - '0'); if (c > 255) { err_xesc: lj_lex_error(ls, TK_string, LJ_ERR_XESC); } lex_next(ls); } } lex_save(ls, c); continue; } lex_save(ls, c); lex_next(ls); continue; } default: lex_savenext(ls); break; } } lex_savenext(ls); /* Skip trailing delimiter. */ setstrV(ls->L, tv, lj_parse_keepstr(ls, ls->sb.b+1, sbuflen(&ls->sb)-2)); } /* -- Main lexical scanner ------------------------------------------------ */ /* Get next lexical token. */ static LexToken lex_scan(LexState *ls, TValue *tv) { lj_buf_reset(&ls->sb); for (;;) { if (lj_char_isident(ls->c)) { GCstr *s; if (lj_char_isdigit(ls->c)) { /* Numeric literal. */ lex_number(ls, tv); return TK_number; } /* Identifier or reserved word. */ do { lex_savenext(ls); } while (lj_char_isident(ls->c)); s = lj_parse_keepstr(ls, ls->sb.b, sbuflen(&ls->sb)); setstrV(ls->L, tv, s); if (s->reserved > 0) /* Reserved word? */ return TK_OFS + s->reserved; return TK_name; } switch (ls->c) { case '\n': case '\r': lex_newline(ls); continue; case ' ': case '\t': case '\v': case '\f': lex_next(ls); continue; case '-': lex_next(ls); if (ls->c != '-') return '-'; lex_next(ls); if (ls->c == '[') { /* Long comment "--[=*[...]=*]". */ int sep = lex_skipeq(ls); lj_buf_reset(&ls->sb); /* `lex_skipeq' may dirty the buffer */ if (sep >= 0) { lex_longstring(ls, NULL, sep); lj_buf_reset(&ls->sb); continue; } } /* Short comment "--.*\n". */ while (!lex_iseol(ls) && ls->c != LEX_EOF) lex_next(ls); continue; case '[': { int sep = lex_skipeq(ls); if (sep >= 0) { lex_longstring(ls, tv, sep); return TK_string; } else if (sep == -1) { return '['; } else { lj_lex_error(ls, TK_string, LJ_ERR_XLDELIM); continue; } } case '=': lex_next(ls); if (ls->c != '=') return '='; else { lex_next(ls); return TK_eq; } case '<': lex_next(ls); if (ls->c != '=') return '<'; else { lex_next(ls); return TK_le; } case '>': lex_next(ls); if (ls->c != '=') return '>'; else { lex_next(ls); return TK_ge; } case '~': lex_next(ls); if (ls->c != '=') return '~'; else { lex_next(ls); return TK_ne; } case ':': lex_next(ls); if (ls->c != ':') return ':'; else { lex_next(ls); return TK_label; } case '"': case '\'': lex_string(ls, tv); return TK_string; case '.': if (lex_savenext(ls) == '.') { lex_next(ls); if (ls->c == '.') { lex_next(ls); return TK_dots; /* ... */ } return TK_concat; /* .. */ } else if (!lj_char_isdigit(ls->c)) { return '.'; } else { lex_number(ls, tv); return TK_number; } case LEX_EOF: return TK_eof; default: { LexChar c = ls->c; lex_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->pe = ls->p = NULL; ls->vstack = NULL; ls->sizevstack = 0; ls->vtop = 0; ls->bcstack = NULL; ls->sizebcstack = 0; ls->tok = 0; ls->lookahead = TK_eof; /* No look-ahead token. */ ls->linenumber = 1; ls->lastline = 1; ls->endmark = 0; ls->fr2 = LJ_FR2; /* Generate native bytecode by default. */ lex_next(ls); /* Read-ahead first char. */ if (ls->c == 0xef && ls->p + 2 <= ls->pe && (uint8_t)ls->p[0] == 0xbb && (uint8_t)ls->p[1] == 0xbf) { /* Skip UTF-8 BOM (if buffered). */ ls->p += 2; lex_next(ls); header = 1; } if (ls->c == '#') { /* Skip POSIX #! header line. */ do { lex_next(ls); if (ls->c == LEX_EOF) return 0; } while (!lex_iseol(ls)); lex_newline(ls); header = 1; } if (ls->c == 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_buf_free(g, &ls->sb); } /* Return next lexical token. */ void lj_lex_next(LexState *ls) { ls->lastline = ls->linenumber; if (LJ_LIKELY(ls->lookahead == TK_eof)) { /* No lookahead token? */ ls->tok = lex_scan(ls, &ls->tokval); /* Get next token. */ } else { /* Otherwise return lookahead token. */ ls->tok = ls->lookahead; ls->lookahead = TK_eof; ls->tokval = ls->lookaheadval; } } /* Look ahead for the next token. */ LexToken lj_lex_lookahead(LexState *ls) { lj_assertLS(ls->lookahead == TK_eof, "double lookahead"); ls->lookahead = lex_scan(ls, &ls->lookaheadval); return ls->lookahead; } /* Convert token to string. */ const char *lj_lex_token2str(LexState *ls, LexToken tok) { if (tok > TK_OFS) return tokennames[tok-TK_OFS-1]; else if (!lj_char_iscntrl(tok)) return lj_strfmt_pushf(ls->L, "%c", tok); else return lj_strfmt_pushf(ls->L, "char(%d)", tok); } /* Lexer error. */ void lj_lex_error(LexState *ls, LexToken tok, ErrMsg em, ...) { const char *tokstr; va_list argp; if (tok == 0) { tokstr = NULL; } else if (tok == TK_name || tok == TK_string || tok == TK_number) { lex_save(ls, '\0'); tokstr = ls->sb.b; } else { tokstr = lj_lex_token2str(ls, tok); } va_start(argp, em); lj_err_lex(ls->L, ls->chunkname, tokstr, ls->linenumber, em, argp); va_end(argp); } /* Initialize strings for reserved words. */ 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); } } subprojects/luajit/src/lj_asm.h0000644000175000017500000000054414741067622016120 0ustar aniolaniol/* ** IR assembler (SSA IR -> machine code). ** Copyright (C) 2005-2023 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 subprojects/luajit/src/lj_assert.c0000644000175000017500000000114214741067622016627 0ustar aniolaniol/* ** Internal assertions. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #define lj_assert_c #define LUA_CORE #if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK) #include #include "lj_obj.h" void lj_assert_fail(global_State *g, const char *file, int line, const char *func, const char *fmt, ...) { va_list argp; va_start(argp, fmt); fprintf(stderr, "LuaJIT ASSERT %s:%d: %s: ", file, line, func); vfprintf(stderr, fmt, argp); fputc('\n', stderr); va_end(argp); UNUSED(g); /* May be NULL. TODO: optionally dump state. */ abort(); } #endif subprojects/luajit/src/lj_carith.c0000644000175000017500000003063414741067622016610 0ustar aniolaniol/* ** C data arithmetic. ** Copyright (C) 2005-2023 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_ir.h" #include "lj_ctype.h" #include "lj_cconv.h" #include "lj_cdata.h" #include "lj_carith.h" #include "lj_strscan.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)) { CTypeID id0 = i ? ctype_typeid(cts, ca->ct[0]) : 0; p = (uint8_t *)*(void **)p; ct = ctype_get(cts, lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|id), CTSIZE_PTR)); if (i) { /* cts->tab may have been reallocated. */ ca->ct[0] = ctype_get(cts, id0); } } 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 { lj_assertL(mm == MM_le, "bad metamethod %d", mm); 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 = ~u0+1u; break; default: lj_assertL(0, "bad metamethod %d", mm); 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) && mm != MM_len && mm != MM_concat) { 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 bit operations helpers --------------------------------------- */ #if LJ_64 #define B64DEF(name) \ static LJ_AINLINE uint64_t lj_carith_##name(uint64_t x, int32_t sh) #else /* Not inlined on 32 bit archs, since some of these are quite lengthy. */ #define B64DEF(name) \ uint64_t LJ_NOINLINE lj_carith_##name(uint64_t x, int32_t sh) #endif B64DEF(shl64) { return x << (sh&63); } B64DEF(shr64) { return x >> (sh&63); } B64DEF(sar64) { return (uint64_t)((int64_t)x >> (sh&63)); } B64DEF(rol64) { return lj_rol(x, (sh&63)); } B64DEF(ror64) { return lj_ror(x, (sh&63)); } #undef B64DEF uint64_t lj_carith_shift64(uint64_t x, int32_t sh, int op) { switch (op) { case IR_BSHL-IR_BSHL: x = lj_carith_shl64(x, sh); break; case IR_BSHR-IR_BSHL: x = lj_carith_shr64(x, sh); break; case IR_BSAR-IR_BSHL: x = lj_carith_sar64(x, sh); break; case IR_BROL-IR_BSHL: x = lj_carith_rol64(x, sh); break; case IR_BROR-IR_BSHL: x = lj_carith_ror64(x, sh); break; default: lj_assertX(0, "bad shift op %d", op); break; } return x; } /* Equivalent to lj_lib_checkbit(), but handles cdata. */ uint64_t lj_carith_check64(lua_State *L, int narg, CTypeID *id) { TValue *o = L->base + narg-1; if (o >= L->top) { err: lj_err_argt(L, narg, LUA_TNUMBER); } else if (LJ_LIKELY(tvisnumber(o))) { /* Handled below. */ } else if (tviscdata(o)) { CTState *cts = ctype_cts(L); uint8_t *sp = (uint8_t *)cdataptr(cdataV(o)); CTypeID sid = cdataV(o)->ctypeid; CType *s = ctype_get(cts, sid); uint64_t x; if (ctype_isref(s->info)) { sp = *(void **)sp; sid = ctype_cid(s->info); } s = ctype_raw(cts, sid); if (ctype_isenum(s->info)) s = ctype_child(cts, s); if ((s->info & (CTMASK_NUM|CTF_BOOL|CTF_FP|CTF_UNSIGNED)) == CTINFO(CT_NUM, CTF_UNSIGNED) && s->size == 8) *id = CTID_UINT64; /* Use uint64_t, since it has the highest rank. */ else if (!*id) *id = CTID_INT64; /* Use int64_t, unless already set. */ lj_cconv_ct_ct(cts, ctype_get(cts, *id), s, (uint8_t *)&x, sp, CCF_ARG(narg)); return x; } else if (!(tvisstr(o) && lj_strscan_number(strV(o), o))) { goto err; } if (LJ_LIKELY(tvisint(o))) { return (uint32_t)intV(o); } else { return (uint32_t)lj_num2bit(numV(o)); } } /* -- 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 subprojects/luajit/src/lj_cparse.c0000644000175000017500000016110414741067622016610 0ustar aniolaniol/* ** C declaration parser. ** Copyright (C) 2005-2023 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_buf.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" #include "lj_strfmt.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. */ #ifdef LUA_USE_ASSERT #define lj_assertCP(c, ...) (lj_assertG_(G(cp->L), (c), __VA_ARGS__)) #else #define lj_assertCP(c, ...) ((void)cp) #endif /* -- Miscellaneous ------------------------------------------------------- */ /* Match string against a C literal. */ #define cp_str_is(str, k) \ ((str)->len == sizeof(k)-1 && !memcmp(strdata(str), k, sizeof(k)-1)) /* Check string against a linear list of matches. */ int lj_cparse_case(GCstr *str, const char *match) { MSize len; int n; for (n = 0; (len = (MSize)*match++); n++, match += len) { if (str->len == len && !memcmp(match, strdata(str), len)) return n; } return -1; } /* -- 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) { lj_assertCP(tok < CTOK_FIRSTDECL, "bad CPToken %d", tok); if (tok > CTOK_OFS) return ctoknames[tok-CTOK_OFS-1]; else if (!lj_char_iscntrl(tok)) return lj_strfmt_pushf(cp->L, "%c", tok); else return lj_strfmt_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); } /* Save character in buffer. */ static LJ_AINLINE void cp_save(CPState *cp, CPChar c) { lj_buf_putb(&cp->sb, 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.w == cp->sb.b) cp_save(cp, '$'); cp_save(cp, '\0'); tokstr = cp->sb.b; } else { tokstr = cp_tok2str(cp, tok); } L = cp->L; va_start(argp, em); msg = lj_strfmt_pushvf(L, err2msg(em), argp); va_end(argp); if (tokstr) msg = lj_strfmt_pushf(L, err2msg(LJ_ERR_XNEAR), msg, tokstr); if (cp->linenumber > 1) msg = lj_strfmt_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.b), sbuflen(&cp->sb)-1, &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_buf_str(cp->L, &cp->sb); 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_buf_str(cp->L, &cp->sb); return CTOK_STRING; } else { if (sbuflen(&cp->sb) != 1) cp_err_token(cp, '\''); cp->val.i32 = (int32_t)(char)*cp->sb.b; 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_buf_reset(&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_buf_init(cp->L, &cp->sb); lj_assertCP(cp->p != NULL, "uninitialized cp->p"); 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_buf_free(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_raw(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 = (int32_t)(~(uint32_t)k->i32+1); } 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; } /* fallthrough */ 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; } /* fallthrough */ 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; } /* fallthrough */ case 3: if (cp_opt(cp, '|')) { cp_expr_sub(cp, &k2, 4); k->u32 = k->u32 | k2.u32; goto arith_result; } /* fallthrough */ case 4: if (cp_opt(cp, '^')) { cp_expr_sub(cp, &k2, 5); k->u32 = k->u32 ^ k2.u32; goto arith_result; } /* fallthrough */ case 5: if (cp_opt(cp, '&')) { cp_expr_sub(cp, &k2, 6); k->u32 = k->u32 & k2.u32; goto arith_result; } /* fallthrough */ 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; } /* fallthrough */ 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; } /* fallthrough */ 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; } /* fallthrough */ 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; } /* fallthrough */ 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)) { lj_assertCP(id == 0, "typedef not at toplevel"); 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; lj_assertCP(ctype_isstruct(cinfo) || ctype_isenum(cinfo), "typedef of bad type"); } 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. */ lj_assertCP(id == 0, "number not at toplevel"); 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 { lj_assertCP(ctype_isvoid(info), "bad ctype %08x", info); } csize = size; cinfo = info+id; id = lj_ctype_intern(cp->cts, info+id, size); } } while (idx); return id; } /* -- C declaration parser ------------------------------------------------ */ /* 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_strfmt_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 (lj_cparse_case(attrstr, "\007aligned" "\013__aligned__" "\006packed" "\012__packed__" "\004mode" "\010__mode__" "\013vector_size" "\017__vector_size__" #if LJ_TARGET_X86 "\007regparm" "\013__regparm__" "\005cdecl" "\011__cdecl__" "\010thiscall" "\014__thiscall__" "\010fastcall" "\014__fastcall__" "\007stdcall" "\013__stdcall__" "\012sseregparm" "\016__sseregparm__" #endif )) { case 0: case 1: /* aligned */ cp_decl_align(cp, decl); break; case 2: case 3: /* packed */ decl->attr |= CTFP_PACKED; break; case 4: case 5: /* mode */ cp_decl_mode(cp, decl); break; case 6: case 7: /* vector_size */ { CTSize vsize = cp_decl_sizeattr(cp); if (vsize) CTF_INSERT(decl->attr, VSIZEP, lj_fls(vsize)); } break; #if LJ_TARGET_X86 case 8: case 9: /* regparm */ CTF_INSERT(decl->fattr, REGPARM, cp_decl_sizeattr(cp)); decl->fattr |= CTFP_CCONV; break; case 10: case 11: /* cdecl */ CTF_INSERT(decl->fattr, CCONV, CTCC_CDECL); decl->fattr |= CTFP_CCONV; break; case 12: case 13: /* thiscall */ CTF_INSERT(decl->fattr, CCONV, CTCC_THISCALL); decl->fattr |= CTFP_CCONV; break; case 14: case 15: /* fastcall */ CTF_INSERT(decl->fattr, CCONV, CTCC_FASTCALL); decl->fattr |= CTFP_CCONV; break; case 16: case 17: /* stdcall */ CTF_INSERT(decl->fattr, CCONV, CTCC_STDCALL); decl->fattr |= CTFP_CCONV; break; case 18: case 19: /* 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); if (cp_str_is(attrstr, "align")) { cp_decl_align(cp, decl); } else { /* Ignore all other attributes. */ if (cp_opt(cp, '(')) { while (cp->tok != ')' && cp->tok != CTOK_EOF) cp_next(cp); cp_check(cp, ')'); } } } 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); } lj_assertCP(sz != 0, "basic ctype with zero size"); 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_is(cp->str, "pack")) { cp_next(cp); cp_check(cp, '('); if (cp->tok == CTOK_IDENT) { if (cp_str_is(cp->str, "push")) { if (cp->curpack < CPARSE_MAX_PACKSTACK-1) { cp->packstack[cp->curpack+1] = cp->packstack[cp->curpack]; cp->curpack++; } else { cp_errmsg(cp, cp->tok, LJ_ERR_XLEVELS); } } else if (cp_str_is(cp->str, "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); } } /* Handle line number. */ static void cp_line(CPState *cp, BCLine hashline) { BCLine newline = cp->val.u32; /* TODO: Handle file name and include it in error messages. */ while (cp->tok != CTOK_EOF && cp->linenumber == hashline) cp_next(cp); cp->linenumber = newline; } /* 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 hashline = cp->linenumber; CPToken tok = cp_next(cp); if (tok == CTOK_INTEGER) { cp_line(cp, hashline); continue; } else if (tok == CTOK_IDENT && cp_str_is(cp->str, "line")) { if (cp_next(cp) != CTOK_INTEGER) cp_err_token(cp, tok); cp_line(cp, hashline); continue; } else if (tok == CTOK_IDENT && cp_str_is(cp->str, "pragma")) { cp_pragma(cp, hashline); continue; } else { cp_errmsg(cp, cp->tok, LJ_ERR_XSYMBOL); } } 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). */ lj_assertCP(gcref(ct->name) == NULL, "unexpected named function"); 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); } /* ------------------------------------------------------------------------ */ /* 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); lj_assertCP(cp->depth == 0, "unbalanced cparser declaration depth"); 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 subprojects/luajit/src/lj_ctype.h0000644000175000017500000004222214741067622016463 0ustar aniolaniol/* ** C type management. ** Copyright (C) 2005-2023 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<g, (c), __VA_ARGS__)) #else #define lj_assertCTS(c, ...) ((void)cts) #endif /* -- Predefined types ---------------------------------------------------- */ /* Target-dependent types. */ #if LJ_TARGET_PPC #define CTTYDEFP(_) \ _(LINT32, 4, CT_NUM, CTF_LONG|CTALIGN(2)) #else #define CTTYDEFP(_) #endif #define CTF_LONG_IF8 (CTF_LONG * (sizeof(long) == 8)) /* Common types. */ #define CTTYDEF(_) \ _(NONE, 0, CT_ATTRIB, CTATTRIB(CTA_BAD)) \ _(VOID, -1, CT_VOID, CTALIGN(0)) \ _(CVOID, -1, CT_VOID, CTF_CONST|CTALIGN(0)) \ _(BOOL, 1, CT_NUM, CTF_BOOL|CTF_UNSIGNED|CTALIGN(0)) \ _(CCHAR, 1, CT_NUM, CTF_CONST|CTF_UCHAR|CTALIGN(0)) \ _(INT8, 1, CT_NUM, CTALIGN(0)) \ _(UINT8, 1, CT_NUM, CTF_UNSIGNED|CTALIGN(0)) \ _(INT16, 2, CT_NUM, CTALIGN(1)) \ _(UINT16, 2, CT_NUM, CTF_UNSIGNED|CTALIGN(1)) \ _(INT32, 4, CT_NUM, CTALIGN(2)) \ _(UINT32, 4, CT_NUM, CTF_UNSIGNED|CTALIGN(2)) \ _(INT64, 8, CT_NUM, CTF_LONG_IF8|CTALIGN(3)) \ _(UINT64, 8, CT_NUM, CTF_UNSIGNED|CTF_LONG_IF8|CTALIGN(3)) \ _(FLOAT, 4, CT_NUM, CTF_FP|CTALIGN(2)) \ _(DOUBLE, 8, CT_NUM, CTF_FP|CTALIGN(3)) \ _(COMPLEX_FLOAT, 8, CT_ARRAY, CTF_COMPLEX|CTALIGN(2)|CTID_FLOAT) \ _(COMPLEX_DOUBLE, 16, CT_ARRAY, CTF_COMPLEX|CTALIGN(3)|CTID_DOUBLE) \ _(P_VOID, CTSIZE_PTR, CT_PTR, CTALIGN_PTR|CTID_VOID) \ _(P_CVOID, CTSIZE_PTR, CT_PTR, CTALIGN_PTR|CTID_CVOID) \ _(P_CCHAR, CTSIZE_PTR, CT_PTR, CTALIGN_PTR|CTID_CCHAR) \ _(P_UINT8, CTSIZE_PTR, CT_PTR, CTALIGN_PTR|CTID_UINT8) \ _(A_CCHAR, -1, CT_ARRAY, CTF_CONST|CTALIGN(0)|CTID_CCHAR) \ _(CTYPEID, 4, CT_ENUM, CTALIGN(2)|CTID_INT32) \ CTTYDEFP(_) \ /* End of type list. */ /* Public predefined type IDs. */ enum { #define CTTYIDDEF(id, sz, ct, info) CTID_##id, CTTYDEF(CTTYIDDEF) #undef CTTYIDDEF /* Predefined typedefs and keywords follow. */ CTID_MAX = 65536 }; /* Target-dependent type IDs. */ #if LJ_64 #define CTID_INT_PSZ CTID_INT64 #define CTID_UINT_PSZ CTID_UINT64 #else #define CTID_INT_PSZ CTID_INT32 #define CTID_UINT_PSZ CTID_UINT32 #endif #if LJ_ABI_WIN #define CTID_WCHAR CTID_UINT16 #elif LJ_TARGET_PPC #define CTID_WCHAR CTID_LINT32 #else #define CTID_WCHAR CTID_INT32 #endif /* -- C tokens and keywords ----------------------------------------------- */ /* C lexer keywords. */ #define CTOKDEF(_) \ _(IDENT, "") _(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; } /* Load FFI library on-demand. */ #define ctype_loadffi(L) \ do { \ if (!ctype_ctsG(G(L))) { \ ptrdiff_t oldtop = (char *)L->top - mref(L->stack, char); \ luaopen_ffi(L); \ L->top = (TValue *)(mref(L->stack, char) + oldtop); \ } \ } while (0) /* 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) { UNUSED(cts); lj_assertCTS(id > 0 && id < cts->top, "bad CTID %d", id); 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) { lj_assertCTS(!(ctype_isvoid(ct->info) || ctype_isstruct(ct->info) || ctype_isbitfield(ct->info)), "ctype %08x has no children", ct->info); 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 CTInfo lj_ctype_info_raw(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_initfin(lua_State *L); LJ_FUNC void lj_ctype_freestate(global_State *g); #endif #endif subprojects/luajit/src/lib_aux.c0000644000175000017500000002347214741067622016276 0ustar aniolaniol/* ** Auxiliary library for the Lua/C API. ** Copyright (C) 2005-2023 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" #include "lj_vmevent.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 && l->name; l++) size++; return size; } LUALIB_API void luaL_pushmodule(lua_State *L, const char *modname, int sizehint) { luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 16); lua_getfield(L, -1, modname); if (!lua_istable(L, -1)) { lua_pop(L, 1); if (luaL_findtable(L, LUA_GLOBALSINDEX, modname, sizehint) != NULL) lj_err_callerv(L, LJ_ERR_BADMODN, modname); lua_pushvalue(L, -1); lua_setfield(L, -3, modname); /* _LOADED[modname] = new table. */ } lua_remove(L, -2); /* Remove _LOADED table. */ } LUALIB_API void luaL_openlib(lua_State *L, const char *libname, const luaL_Reg *l, int nup) { lj_lib_checkfpu(L); if (libname) { luaL_pushmodule(L, libname, libsize(l)); lua_insert(L, -(nup + 1)); /* Move module table below upvalues. */ } if (l) luaL_setfuncs(L, l, nup); else 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 void luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup) { luaL_checkstack(L, nup, "too many 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 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) { if (l <= bufffree(B)) { memcpy(B->p, s, l); B->p += l; } else { emptybuffer(B); lua_pushlstring(B->L, s, l); B->lvl++; adjuststack(B); } } 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; } #ifndef LUAJIT_DISABLE_VMEVENT static int error_finalizer(lua_State *L) { const char *s = lua_tostring(L, -1); fputs("ERROR in finalizer: ", stderr); fputs(s ? s : "?", stderr); fputc('\n', stderr); fflush(stderr); return 0; } #endif #ifdef LUAJIT_USE_SYSMALLOC #if LJ_64 && !LJ_GC64 && !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; #ifndef LUAJIT_DISABLE_VMEVENT luaL_findtable(L, LUA_REGISTRYINDEX, LJ_VMEVENTS_REGKEY, LJ_VMEVENTS_HSIZE); lua_pushcfunction(L, error_finalizer); lua_rawseti(L, -2, VMEVENT_HASH(LJ_VMEVENT_ERRFIN)); G(L)->vmevmask = VMEVENT_MASK(LJ_VMEVENT_ERRFIN); L->top--; #endif } return L; } #else LUALIB_API lua_State *luaL_newstate(void) { lua_State *L; #if LJ_64 && !LJ_GC64 L = lj_state_newstate(LJ_ALLOCF_INTERNAL, NULL); #else L = lua_newstate(LJ_ALLOCF_INTERNAL, NULL); #endif if (L) { G(L)->panic = panic; #ifndef LUAJIT_DISABLE_VMEVENT luaL_findtable(L, LUA_REGISTRYINDEX, LJ_VMEVENTS_REGKEY, LJ_VMEVENTS_HSIZE); lua_pushcfunction(L, error_finalizer); lua_rawseti(L, -2, VMEVENT_HASH(LJ_VMEVENT_ERRFIN)); G(L)->vmevmask = VMEVENT_MASK(LJ_VMEVENT_ERRFIN); L->top--; #endif } return L; } #if LJ_64 && !LJ_GC64 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 subprojects/luajit/src/host/0000755000175000017500000000000014741067622015454 5ustar aniolaniolsubprojects/luajit/src/host/buildvm_asm.c0000644000175000017500000002252114741067622020124 0ustar aniolaniol/* ** LuaJIT VM builder: Assembler source code emitter. ** Copyright (C) 2005-2023 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 x86/x64 text relocations. */ static void emit_asm_reloc_text(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); if (strncmp(sym+(*sym == '_'), LABEL_PREFIX, sizeof(LABEL_PREFIX)-1)) { /* Various fixups for external symbols outside of our binary. */ if (ctx->mode == BUILD_elfasm) { if (LJ_32) fprintf(ctx->fp, "#if __PIC__\n\t%s lj_wrap_%s\n#else\n", opname, sym); fprintf(ctx->fp, "\t%s %s@PLT\n", opname, sym); if (LJ_32) fprintf(ctx->fp, "#endif\n"); return; } else if (LJ_32 && ctx->mode == BUILD_machasm) { fprintf(ctx->fp, "\t%s L%s$stub\n", opname, sym); return; } } 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) { uint32_t ins = *(uint32_t *)(p+i); #if LJ_TARGET_ARM64 && LJ_BE ins = lj_bswap(ins); /* ARM64 instructions are always little-endian. */ #endif if ((i & 15) == 0) fprintf(ctx->fp, "\t.long 0x%08x", ins); else fprintf(ctx->fp, ",0x%08x", ins); 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_ARM64 if ((ins >> 26) == 0x25u) { fprintf(ctx->fp, "\tbl %s\n", sym); } else { fprintf(stderr, "Error: unsupported opcode %08x for %s symbol relocation.\n", ins, sym); exit(1); } #elif LJ_TARGET_PPC #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"); #if LJ_TARGET_MIPS32 && !LJ_ABI_SOFTFP fprintf(ctx->fp, "\t.module fp=32\n"); #endif #if LJ_TARGET_MIPS fprintf(ctx->fp, "\t.set nomips16\n\t.abicalls\n\t.set noreorder\n\t.set nomacro\n"); #endif 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. */ #if LJ_ARCH_HASFPU fprintf(ctx->fp, ".fnstart\n" ".save {r5, r6, r7, r8, r9, r10, r11, lr}\n" ".vsave {d8-d15}\n" ".save {r4}\n" ".pad #28\n"); #else fprintf(ctx->fp, ".fnstart\n" ".save {r4, r5, r6, r7, r8, r9, r10, r11, lr}\n" ".pad #28\n"); #endif #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 (r->type != 0 && (ctx->mode == BUILD_elfasm || ctx->mode == BUILD_machasm)) { emit_asm_reloc_text(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_PPC && !LJ_TARGET_PS3 && !LJ_ABI_SOFTFP /* 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: #if defined(__apple_build_version__) && __apple_build_version__ >= 15000000 && __apple_build_version__ < 15000300 /* Workaround for XCode 15.0 - 15.2. */ fprintf(ctx->fp, "\t.subsections_via_symbols\n"); #endif fprintf(ctx->fp, "\t.cstring\n" "\t.ascii \"%s\\0\"\n", ctx->dasm_ident); break; default: break; } fprintf(ctx->fp, "\n"); } subprojects/luajit/src/host/genlibbc.lua0000644000175000017500000001371714741067622017735 0ustar aniolaniol---------------------------------------------------------------------------- -- Lua script to dump the bytecode of the library functions written in Lua. -- The resulting 'buildvm_libbc.h' is used for the build process of LuaJIT. ---------------------------------------------------------------------------- -- Copyright (C) 2005-2023 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h ---------------------------------------------------------------------------- local ffi = require("ffi") local bit = require("bit") local vmdef = require("jit.vmdef") local bcnames = vmdef.bcnames local format = string.format local isbe = (string.byte(string.dump(function() end), 5) % 2 == 1) local function usage(arg) io.stderr:write("Usage: ", arg and arg[0] or "genlibbc", " [-o buildvm_libbc.h] lib_*.c\n") os.exit(1) end local function parse_arg(arg) local outfile = "-" if not (arg and arg[1]) then usage(arg) end if arg[1] == "-o" then outfile = arg[2] if not outfile then usage(arg) end table.remove(arg, 1) table.remove(arg, 1) end return outfile end local function read_files(names) local src = "" for _,name in ipairs(names) do local fp = assert(io.open(name)) src = src .. fp:read("*a") fp:close() end return src end local function transform_lua(code) local fixup = {} local n = -30000 code = string.gsub(code, "CHECK_(%w*)%((.-)%)", function(tp, var) n = n + 1 fixup[n] = { "CHECK", tp } return format("%s=%d", var, n) end) code = string.gsub(code, "PAIRS%((.-)%)", function(var) fixup.PAIRS = true return format("nil, %s, 0x4dp80", var) end) return "return "..code, fixup end local function read_uleb128(p) local v = p[0]; p = p + 1 if v >= 128 then local sh = 7; v = v - 128 repeat local r = p[0] v = v + bit.lshift(bit.band(r, 127), sh) sh = sh + 7 p = p + 1 until r < 128 end return p, v end -- ORDER LJ_T local name2itype = { str = 5, func = 9, tab = 12, int = 14, num = 15 } local BC, BCN = {}, {} for i=0,#bcnames/6-1 do local name = bcnames:sub(i*6+1, i*6+6):gsub(" ", "") BC[name] = i BCN[i] = name end local xop, xra = isbe and 3 or 0, isbe and 2 or 1 local xrc, xrb = isbe and 1 or 2, isbe and 0 or 3 local function fixup_dump(dump, fixup) local buf = ffi.new("uint8_t[?]", #dump+1, dump) local p = buf+5 local n, sizebc p, n = read_uleb128(p) local start = p p = p + 4 p = read_uleb128(p) p = read_uleb128(p) p, sizebc = read_uleb128(p) local startbc = tonumber(p - start) local rawtab = {} for i=0,sizebc-1 do local op = p[xop] if op == BC.KSHORT then local rd = p[xrc] + 256*p[xrb] rd = bit.arshift(bit.lshift(rd, 16), 16) local f = fixup[rd] if f then if f[1] == "CHECK" then local tp = f[2] if tp == "tab" then rawtab[p[xra]] = true end p[xop] = tp == "num" and BC.ISNUM or BC.ISTYPE p[xrb] = 0 p[xrc] = name2itype[tp] else error("unhandled fixup type: "..f[1]) end end elseif op == BC.TGETV then if rawtab[p[xrb]] then p[xop] = BC.TGETR end elseif op == BC.TSETV then if rawtab[p[xrb]] then p[xop] = BC.TSETR end elseif op == BC.ITERC then if fixup.PAIRS then p[xop] = BC.ITERN end end p = p + 4 end local ndump = ffi.string(start, n) -- Fixup hi-part of 0x4dp80 to LJ_KEYINDEX. ndump = ndump:gsub("\x80\x80\xcd\xaa\x04", "\xff\xff\xf9\xff\x0f") return { dump = ndump, startbc = startbc, sizebc = sizebc } end local function find_defs(src, mode) local defs = {} for name, code in string.gmatch(src, "LJLIB_LUA%(([^)]*)%)%s*/%*(.-)%*/") do local tcode, fixup = transform_lua(code) local func = assert(load(tcode, "", mode)) defs[name] = fixup_dump(string.dump(func, mode), fixup) defs[#defs+1] = name end return defs end local function gen_header(defs32, defs64) local t = {} local function w(x) t[#t+1] = x end w("/* This is a generated file. DO NOT EDIT! */\n\n") w("static const int libbc_endian = ") w(isbe and 1 or 0) w(";\n\n") for j,defs in ipairs{defs64, defs32} do local s, sb = "", "" for i,name in ipairs(defs) do local d = defs[name] s = s .. d.dump sb = sb .. string.char(i) .. ("\0"):rep(d.startbc - 1) .. (isbe and "\0\0\0\255" or "\255\0\0\0"):rep(d.sizebc) .. ("\0"):rep(#d.dump - d.startbc - d.sizebc*4) end if j == 1 then w("static const uint8_t libbc_code[] = {\n#if LJ_FR2\n") else w("\n#else\n") end local n = 0 for i=1,#s do local x = string.byte(s, i) local xb = string.byte(sb, i) if xb == 255 then local name = BCN[x] local m = #name + 4 if n + m > 78 then n = 0; w("\n") end n = n + m w("BC_"); w(name) else local m = x < 10 and 2 or (x < 100 and 3 or 4) if xb == 0 then if n + m > 78 then n = 0; w("\n") end else local name = defs[xb]:gsub("_", ".") if n ~= 0 then w("\n") end w("/* "); w(name); w(" */ ") n = #name + 7 end n = n + m w(x) end w(",") end end w("\n#endif\n0\n};\n\n") w("static const struct { const char *name; int ofs; } libbc_map[] = {\n") local m32, m64 = 0, 0 for i,name in ipairs(defs32) do assert(name == defs64[i]) w('{"'); w(name); w('",'); w(m32) w('},\n') m32 = m32 + #defs32[name].dump m64 = m64 + #defs64[name].dump assert(m32 == m64) end w("{NULL,"); w(m32); w("}\n};\n\n") return table.concat(t) end local function write_file(name, data) if name == "-" then assert(io.write(data)) assert(io.flush()) else local fp = io.open(name) if fp then local old = fp:read("*a") fp:close() if data == old then return end end fp = assert(io.open(name, "w")) assert(fp:write(data)) assert(fp:close()) end end local outfile = parse_arg(arg) local src = read_files(arg) local defs32 = find_defs(src, "Wdts") local defs64 = find_defs(src, "Xdts") local hdr = gen_header(defs32, defs64) write_file(outfile, hdr) subprojects/luajit/src/host/buildvm.h0000644000175000017500000000504014741067622017266 0ustar aniolaniol/* ** LuaJIT VM builder. ** Copyright (C) 2005-2023 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 *const *extnames; 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 subprojects/luajit/src/host/buildvm_peobj.c0000644000175000017500000003536714741067622020457 0ustar aniolaniol/* ** LuaJIT VM builder: PE object emitter. ** Copyright (C) 2005-2023 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_WINDOWS || LJ_TARGET_CYGWIN /* 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. */ #define PEOBJ_PDATA_NRELOC 6 #define PEOBJ_XDATA_SIZE (8*2+4+6*2) #elif LJ_TARGET_ARM64 #define PEOBJ_ARCH_TARGET 0xaa64 #define PEOBJ_RELOC_REL32 0x03 /* MS: BRANCH26. */ #define PEOBJ_RELOC_DIR32 0x01 #define PEOBJ_RELOC_ADDR32NB 0x02 #define PEOBJ_RELOC_OFS (-4) #define PEOBJ_TEXT_FLAGS 0x60500020 /* 60=r+x, 50=align16, 20=code. */ #define PEOBJ_PDATA_NRELOC 4 #define PEOBJ_XDATA_SIZE (4+24+4 +4+8) #endif /* Section numbers (0-based). */ enum { PEOBJ_SECT_ABS = -2, PEOBJ_SECT_UNDEF = -1, PEOBJ_SECT_TEXT, #ifdef PEOBJ_PDATA_NRELOC PEOBJ_SECT_PDATA, PEOBJ_SECT_XDATA, #elif LJ_TARGET_X86 PEOBJ_SECT_SXDATA, #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; #ifdef PEOBJ_PDATA_NRELOC uint32_t fcofs = (uint32_t)ctx->sym[ctx->nsym-1].ofs; #endif 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; #ifdef PEOBJ_PDATA_NRELOC memcpy(pesect[PEOBJ_SECT_PDATA].name, ".pdata", sizeof(".pdata")-1); pesect[PEOBJ_SECT_PDATA].ofs = sofs; sofs += (pesect[PEOBJ_SECT_PDATA].size = PEOBJ_PDATA_NRELOC*4); pesect[PEOBJ_SECT_PDATA].relocofs = sofs; sofs += (pesect[PEOBJ_SECT_PDATA].nreloc = PEOBJ_PDATA_NRELOC) * 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 = PEOBJ_XDATA_SIZE); /* 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; #elif LJ_TARGET_X86 memcpy(pesect[PEOBJ_SECT_SXDATA].name, ".sxdata", sizeof(".sxdata")-1); pesect[PEOBJ_SECT_SXDATA].ofs = sofs; sofs += (pesect[PEOBJ_SECT_SXDATA].size = 4); pesect[PEOBJ_SECT_SXDATA].relocofs = sofs; /* Flags: 40 = read, 30 = align4, 02 = lnk_info, 40 = initialized data. */ pesect[PEOBJ_SECT_SXDATA].flags = 0x40300240; #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; #ifdef PEOBJ_PDATA_NRELOC pehdr.nsyms += 1; /* Symbol for lj_err_unwind_win. */ #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)) { fprintf(stderr, "Error: different byte order for host and target\n"); exit(1); } 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 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); } #elif LJ_TARGET_ARM64 /* https://learn.microsoft.com/en-us/cpp/build/arm64-exception-handling */ { /* Write .pdata section. */ uint32_t pdata[4]; PEreloc reloc; pdata[0] = 0; pdata[1] = 0; pdata[2] = fcofs; pdata[3] = 4+24+4; owrite(ctx, &pdata, sizeof(pdata)); /* Start of .text and start of .xdata. */ 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; reloc.type = PEOBJ_RELOC_ADDR32NB; owrite(ctx, &reloc, PEOBJ_RELOC_SIZE); /* Start of vm_ffi_call and start of second part of .xdata. */ reloc.vaddr = 8; reloc.symidx = 1+2+nrsym+2+2+1; reloc.type = PEOBJ_RELOC_ADDR32NB; owrite(ctx, &reloc, PEOBJ_RELOC_SIZE); reloc.vaddr = 12; reloc.symidx = 1+2+nrsym+2; reloc.type = PEOBJ_RELOC_ADDR32NB; owrite(ctx, &reloc, PEOBJ_RELOC_SIZE); } { /* Write .xdata section. */ uint32_t u32; uint8_t *p, uwc[24]; PEreloc reloc; #define CBE16(x) (*p = ((x) >> 8) & 0xff, p[1] = (x) & 0xff, p += 2) #define CALLOC_S(s) (*p++ = ((s) >> 4)) /* s < 512 */ #define CSAVE_FPLR(o) (*p++ = 0x40 | ((o) >> 3)) /* o <= 504 */ #define CSAVE_REGP(r,o) CBE16(0xc800 | (((r) - 19) << 6) | ((o) >> 3)) #define CSAVE_REGS(r1,r2,o1) do { \ int r, o; for (r = r1, o = o1; r <= r2; r += 2, o -= 16) CSAVE_REGP(r, o); \ } while (0) #define CSAVE_REGPX(r,o) CBE16(0xcc00 | (((r) - 19) << 6) | (~(o) >> 3)) #define CSAVE_FREGP(r,o) CBE16(0xd800 | (((r) - 8) << 6) | ((o) >> 3)) #define CSAVE_FREGS(r1,r2,o1) do { \ int r, o; for (r = r1, o = o1; r <= r2; r += 2, o -= 16) CSAVE_FREGP(r, o); \ } while (0) #define CADD_FP(s) CBE16(0xe200 | ((s) >> 3)) /* s < 8*256 */ #define CODE_NOP 0xe3 #define CODE_END 0xe4 #define CEND_ALIGN do { \ *p++ = CODE_END; \ while ((p - uwc) & 3) *p++ = CODE_NOP; \ } while (0) /* Unwind codes for .text section with handler. */ p = uwc; CADD_FP(192); /* +2 */ CSAVE_REGS(19, 28, 176); /* +5*2 */ CSAVE_FREGS(8, 15, 96); /* +4*2 */ CSAVE_FPLR(192); /* +1 */ CALLOC_S(208); /* +1 */ CEND_ALIGN; /* +1 +1 -> 24 */ u32 = ((24u >> 2) << 27) | (1u << 20) | (fcofs >> 2); owrite(ctx, &u32, 4); owrite(ctx, &uwc, 24); u32 = 0; /* Handler RVA to be relocated at 4 + 24. */ owrite(ctx, &u32, 4); /* Unwind codes for vm_ffi_call without handler. */ p = uwc; CADD_FP(16); /* +2 */ CSAVE_FPLR(16); /* +1 */ CSAVE_REGPX(19, -32); /* +2 */ CEND_ALIGN; /* +1 +2 -> 8 */ u32 = ((8u >> 2) << 27) | (((uint32_t)ctx->codesz - fcofs) >> 2); owrite(ctx, &u32, 4); owrite(ctx, &uwc, 8); reloc.vaddr = 4 + 24; reloc.symidx = 1+2+nrsym+2+2; reloc.type = PEOBJ_RELOC_ADDR32NB; owrite(ctx, &reloc, PEOBJ_RELOC_SIZE); } #elif LJ_TARGET_X86 /* Write .sxdata section. */ for (i = 0; i < nrsym; i++) { if (!strcmp(ctx->relocsym[i], "_lj_err_unwind_win")) { uint32_t symidx = 1+2+i; owrite(ctx, &symidx, 4); break; } } if (i == nrsym) { fprintf(stderr, "Error: extern lj_err_unwind_win not used\n"); exit(1); } #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); #ifdef PEOBJ_PDATA_NRELOC 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_win", 0, PEOBJ_SECT_UNDEF, PEOBJ_TYPE_FUNC, PEOBJ_SCL_EXTERN); #elif LJ_TARGET_X86 emit_peobj_sym_sect(ctx, pesect, PEOBJ_SECT_SXDATA); #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 subprojects/luajit/src/host/meson.build0000644000175000017500000000317014741067416017620 0ustar aniolaniolcpu_family = host_machine.cpu_family() if cpu_family == 'x86_64' dynasm_arch = 'x64' elif cpu_family == 'aarch64' dynasm_arch = 'arm64' else dynasm_arch = 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_LE', '1', ['-D', 'ENDIAN_LE']], ['LJ_ARCH_BITS', '64', ['-D', 'P64']], ['LJ_HASJIT', '1', ['-D', 'JIT']], ['LJ_HASFFI', '1', ['-D', 'FFI']], ['LJ_DUALNUM', '1', ['-D', 'DUALNUM']], ['LJ_ARCH_HASFPU', '1', ['-D', 'FPU']], ['LJ_ABI_SOFTFP', '0', ['-D', 'HFABI']], ['LJ_NO_UNWIND', '1', ['-D', 'NO_UNWIND']], ['LJ_ABI_PAUTH', '1', ['-D', 'PAUTH']], ] foreach def: checkdefs if cc.get_define(def[0], prefix: hpre) == def[1] dasm += def[2] endif endforeach if host_machine.system() == 'windows' dasm += ['-D', 'WIN'] endif dasm += ['-D', 'VER=' + cc.get_define('LJ_ARCH_VERSION', prefix: hpre)] 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, luajit_h, dependencies: system_deps, include_directories: src_inc, native: true) subprojects/luajit/src/host/buildvm_fold.c0000644000175000017500000001463214741067622020274 0ustar aniolaniol/* ** LuaJIT VM builder: IR folding hash table generator. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #include "buildvm.h" #include "lj_obj.h" #if LJ_HASJIT #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); } #else void emit_fold(BuildCtx *ctx) { UNUSED(ctx); } #endif subprojects/luajit/src/host/genversion.lua0000644000175000017500000000272614741067622020345 0ustar aniolaniol---------------------------------------------------------------------------- -- Lua script to embed the rolling release version in luajit.h. ---------------------------------------------------------------------------- -- Copyright (C) 2005-2023 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h ---------------------------------------------------------------------------- local arg = {...} local FILE_ROLLING_H = arg[1] or "luajit_rolling.h" local FILE_RELVER_TXT = arg[2] or "luajit_relver.txt" local FILE_LUAJIT_H = arg[3] or "luajit.h" local function file_read(file) local fp = assert(io.open(file, "rb"), "run from the wrong directory") local data = assert(fp:read("*a")) fp:close() return data end local function file_write_mod(file, data) local fp = io.open(file, "rb") if fp then local odata = assert(fp:read("*a")) fp:close() if odata == data then return end end fp = assert(io.open(file, "wb")) assert(fp:write(data)) assert(fp:close()) end local text = file_read(FILE_ROLLING_H):gsub("#error.-\n", "") local relver = file_read(FILE_RELVER_TXT):match("(%d+)") if relver then text = text:gsub("ROLLING", relver) else io.stderr:write([[ **** WARNING Cannot determine rolling release version from git log. **** WARNING The 'git' command must be available during the build. ]]) file_write_mod(FILE_RELVER_TXT, "ROLLING\n") -- Fallback for install target. end file_write_mod(FILE_LUAJIT_H, text) subprojects/luajit/src/host/README0000644000175000017500000000030114741067622016326 0ustar aniolaniolThe 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! subprojects/luajit/src/host/genminilua.lua0000644000175000017500000003012614741067622020311 0ustar aniolaniol---------------------------------------------------------------------------- -- Lua script to generate a customized, minified version of Lua. -- The resulting 'minilua' is used for the build process of LuaJIT. ---------------------------------------------------------------------------- -- Copyright (C) 2005-2023 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, "imaxstacksize)%)", "%1+p->numparams)") src = gsub(src, "if%(sep==%-1%)(return'%[';)\nelse (luaX_lexerror%b();)", "if (sep!=-1)%2\n%1") return gsub(src, "(default:{\nNode%*n=mainposition)", "/*fallthrough*/\n%1") end local function func_gather(src) local nodes, list = {}, {} local pos, len = 1, #src while pos < len do local d, w = match(src, "^(#define ([%w_]+)[^\n]*\n)", pos) if d then local n = #list+1 list[n] = d nodes[w] = n else local s d, w, s = match(src, "^(([%w_]+)[^\n]*([{;])\n)", pos) if not d then d, w, s = match(src, "^(([%w_]+)[^(]*%b()([{;])\n)", pos) if not d then d = match(src, "^[^\n]*\n", pos) end end if s == "{" then d = d..sub(match(src, "^%b{}[^;\n]*;?\n", pos+#d-2), 3) if sub(d, -2) == "{\n" then d = d..sub(match(src, "^%b{}[^;\n]*;?\n", pos+#d-2), 3) end end local k, v = nil, d if w == "typedef" then if match(d, "^typedef enum") then head[#head+1] = d else k = match(d, "([%w_]+);\n$") if not k then k = match(d, "^.-%(.-([%w_]+)%)%(") end end elseif w == "enum" then head[#head+1] = v elseif w ~= nil then k = match(d, "^[^\n]-([%w_]+)[(%[=]") if k then if w ~= "static" and k ~= "main" then v = "static "..d end else k = w end end if w and k then local o = nodes[k] if o then nodes["*"..k] = o end local n = #list+1 list[n] = v nodes[k] = n end end pos = pos + #d end return nodes, list end local function func_visit(nodes, list, used, n) local i = nodes[n] for m in string.gmatch(list[i], "[%w_]+") do if nodes[m] then local j = used[m] if not j then used[m] = i func_visit(nodes, list, used, m) elseif i < j then used[m] = i end end end end local function func_collect(src) local nodes, list = func_gather(src) local used = {} func_visit(nodes, list, used, "main") for n,i in pairs(nodes) do local j = used[n] if j and j < i then used["*"..n] = j end end for n,i in pairs(nodes) do if not used[n] then list[i] = "" end end return table.concat(list) end find_sources() local src = read_sources() src = merge_includes(src) local license = get_license(src) src = fold_lines(src) src = strip_unused1(src) src = save_strings(src) src = strip_unused2(src) src = strip_comments(src) src = preprocess(src) src = strip_whitespace(src) src = strip_unused3(src) src = rename_tokens1(src) src = func_collect(src) src = rename_tokens2(src) src = restore_strings(src) src = fix_bugs_and_warnings(src) src = merge_header(src, license) io.write(src) subprojects/luajit/src/host/buildvm_libbc.h0000644000175000017500000001042214741067622020421 0ustar aniolaniol/* This is a generated file. DO NOT EDIT! */ static const int libbc_endian = 0; static const uint8_t libbc_code[] = { #if LJ_FR2 /* math.deg */ 0,1,2,0,0,1,2,BC_MULVN,1,0,0,BC_RET1,1,2,0,241,135,158,166,3, 220,203,178,130,4, /* math.rad */ 0,1,2,0,0,1,2,BC_MULVN,1,0,0,BC_RET1,1,2,0,243,244,148,165,20, 198,190,199,252,3, /* string.len */ 0,1,2,0,0,0,3,BC_ISTYPE,0,5,0,BC_LEN,1,0,0,BC_RET1,1,2,0, /* table.foreachi */ 0,2,10,0,0,0,15,BC_ISTYPE,0,12,0,BC_ISTYPE,1,9,0, BC_KSHORT,2,1,0,BC_LEN,3,0,0,BC_KSHORT,4,1,0,BC_FORI,2,8,128,BC_MOV,6,1,0, BC_MOV,8,5,0,BC_TGETR,9,5,0,BC_CALL,6,3,2,BC_ISEQP,6,0,0,BC_JMP,7,1,128, BC_RET1,6,2,0,BC_FORL,2,248,127,BC_RET0,0,1,0, /* table.foreach */ 0,2,11,0,0,1,16,BC_ISTYPE,0,12,0,BC_ISTYPE,1,9,0,BC_KPRI, 2,0,0,BC_MOV,3,0,0,BC_KNUM,4,0,0,BC_JMP,5,7,128,BC_MOV,7,1,0,BC_MOV,9,5,0, BC_MOV,10,6,0,BC_CALL,7,3,2,BC_ISEQP,7,0,0,BC_JMP,8,1,128,BC_RET1,7,2,0, BC_ITERN,5,3,3,BC_ITERL,5,247,127,BC_RET0,0,1,0,1,255,255,249,255,15, /* table.getn */ 0,1,2,0,0,0,3,BC_ISTYPE,0,12,0,BC_LEN,1,0,0,BC_RET1,1,2,0, /* table.remove */ 0,2,10,0,0,2,30,BC_ISTYPE,0,12,0,BC_LEN,2,0,0,BC_ISNEP,1,0, 0,BC_JMP,3,7,128,BC_ISEQN,2,0,0,BC_JMP,3,23,128,BC_TGETR,3,2,0,BC_KPRI,4,0,0, BC_TSETR,4,2,0,BC_RET1,3,2,0,BC_JMP,3,18,128,BC_ISTYPE,1,14,0,BC_KSHORT,3,1,0, BC_ISGT,3,1,0,BC_JMP,3,14,128,BC_ISGT,1,2,0,BC_JMP,3,12,128,BC_TGETR,3,1,0, BC_ADDVN,4,1,1,BC_MOV,5,2,0,BC_KSHORT,6,1,0,BC_FORI,4,4,128,BC_SUBVN,8,1,7, BC_TGETR,9,7,0,BC_TSETR,9,8,0,BC_FORL,4,252,127,BC_KPRI,4,0,0,BC_TSETR,4,2,0, BC_RET1,3,2,0,BC_RET0,0,1,0,0,2, /* table.move */ 0,5,12,0,0,0,35,BC_ISTYPE,0,12,0,BC_ISTYPE,1,14,0,BC_ISTYPE, 2,14,0,BC_ISTYPE,3,14,0,BC_ISNEP,4,0,0,BC_JMP,5,1,128,BC_MOV,4,0,0,BC_ISTYPE, 4,12,0,BC_ISGT,1,2,0,BC_JMP,5,24,128,BC_SUBVV,5,1,3,BC_ISLT,2,3,0,BC_JMP,6,4, 128,BC_ISLE,3,1,0,BC_JMP,6,2,128,BC_ISEQV,4,0,0,BC_JMP,6,9,128,BC_MOV,6,1,0, BC_MOV,7,2,0,BC_KSHORT,8,1,0,BC_FORI,6,4,128,BC_ADDVV,10,5,9,BC_TGETR,11,9,0, BC_TSETR,11,10,4,BC_FORL,6,252,127,BC_JMP,6,8,128,BC_MOV,6,2,0,BC_MOV,7,1,0, BC_KSHORT,8,255,255,BC_FORI,6,4,128,BC_ADDVV,10,5,9,BC_TGETR,11,9,0,BC_TSETR, 11,10,4,BC_FORL,6,252,127,BC_RET1,4,2,0, #else /* math.deg */ 0,1,2,0,0,1,2,BC_MULVN,1,0,0,BC_RET1,1,2,0,241,135,158,166,3, 220,203,178,130,4, /* math.rad */ 0,1,2,0,0,1,2,BC_MULVN,1,0,0,BC_RET1,1,2,0,243,244,148,165,20, 198,190,199,252,3, /* string.len */ 0,1,2,0,0,0,3,BC_ISTYPE,0,5,0,BC_LEN,1,0,0,BC_RET1,1,2,0, /* table.foreachi */ 0,2,9,0,0,0,15,BC_ISTYPE,0,12,0,BC_ISTYPE,1,9,0, BC_KSHORT,2,1,0,BC_LEN,3,0,0,BC_KSHORT,4,1,0,BC_FORI,2,8,128,BC_MOV,6,1,0, BC_MOV,7,5,0,BC_TGETR,8,5,0,BC_CALL,6,3,2,BC_ISEQP,6,0,0,BC_JMP,7,1,128, BC_RET1,6,2,0,BC_FORL,2,248,127,BC_RET0,0,1,0, /* table.foreach */ 0,2,10,0,0,1,16,BC_ISTYPE,0,12,0,BC_ISTYPE,1,9,0,BC_KPRI, 2,0,0,BC_MOV,3,0,0,BC_KNUM,4,0,0,BC_JMP,5,7,128,BC_MOV,7,1,0,BC_MOV,8,5,0, BC_MOV,9,6,0,BC_CALL,7,3,2,BC_ISEQP,7,0,0,BC_JMP,8,1,128,BC_RET1,7,2,0, BC_ITERN,5,3,3,BC_ITERL,5,247,127,BC_RET0,0,1,0,1,255,255,249,255,15, /* table.getn */ 0,1,2,0,0,0,3,BC_ISTYPE,0,12,0,BC_LEN,1,0,0,BC_RET1,1,2,0, /* table.remove */ 0,2,10,0,0,2,30,BC_ISTYPE,0,12,0,BC_LEN,2,0,0,BC_ISNEP,1,0, 0,BC_JMP,3,7,128,BC_ISEQN,2,0,0,BC_JMP,3,23,128,BC_TGETR,3,2,0,BC_KPRI,4,0,0, BC_TSETR,4,2,0,BC_RET1,3,2,0,BC_JMP,3,18,128,BC_ISTYPE,1,14,0,BC_KSHORT,3,1,0, BC_ISGT,3,1,0,BC_JMP,3,14,128,BC_ISGT,1,2,0,BC_JMP,3,12,128,BC_TGETR,3,1,0, BC_ADDVN,4,1,1,BC_MOV,5,2,0,BC_KSHORT,6,1,0,BC_FORI,4,4,128,BC_SUBVN,8,1,7, BC_TGETR,9,7,0,BC_TSETR,9,8,0,BC_FORL,4,252,127,BC_KPRI,4,0,0,BC_TSETR,4,2,0, BC_RET1,3,2,0,BC_RET0,0,1,0,0,2, /* table.move */ 0,5,12,0,0,0,35,BC_ISTYPE,0,12,0,BC_ISTYPE,1,14,0,BC_ISTYPE, 2,14,0,BC_ISTYPE,3,14,0,BC_ISNEP,4,0,0,BC_JMP,5,1,128,BC_MOV,4,0,0,BC_ISTYPE, 4,12,0,BC_ISGT,1,2,0,BC_JMP,5,24,128,BC_SUBVV,5,1,3,BC_ISLT,2,3,0,BC_JMP,6,4, 128,BC_ISLE,3,1,0,BC_JMP,6,2,128,BC_ISEQV,4,0,0,BC_JMP,6,9,128,BC_MOV,6,1,0, BC_MOV,7,2,0,BC_KSHORT,8,1,0,BC_FORI,6,4,128,BC_ADDVV,10,5,9,BC_TGETR,11,9,0, BC_TSETR,11,10,4,BC_FORL,6,252,127,BC_JMP,6,8,128,BC_MOV,6,2,0,BC_MOV,7,1,0, BC_KSHORT,8,255,255,BC_FORI,6,4,128,BC_ADDVV,10,5,9,BC_TGETR,11,9,0,BC_TSETR, 11,10,4,BC_FORL,6,252,127,BC_RET1,4,2,0, #endif 0 }; static const struct { const char *name; int ofs; } libbc_map[] = { {"math_deg",0}, {"math_rad",25}, {"string_len",50}, {"table_foreachi",69}, {"table_foreach",136}, {"table_getn",213}, {"table_remove",232}, {"table_move",361}, {NULL,508} }; subprojects/luajit/src/host/buildvm.c0000644000175000017500000003172314741067622017270 0ustar aniolaniol/* ** LuaJIT VM builder. ** Copyright (C) 2005-2023 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" #if LJ_HASJIT #include "lj_ir.h" #include "lj_ircall.h" #endif #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_ARM64 #include "../dynasm/dasm_arm64.h" #elif LJ_TARGET_PPC #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] = name[1] == 'R' ? '_' : '@'; /* Just for _RtlUnwind@16. */ else *p = '\0'; #elif LJ_TARGET_PPC && !LJ_TARGET_CONSOLE /* Keep @plt etc. */ #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->extnames = extnames; 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 }; #if LJ_HASJIT 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 }; #endif #if LJ_HASJIT 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; } #endif /* 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) { #if LJ_HASJIT char buf[80]; #endif int i; fprintf(ctx->fp, "-- This is a generated file. DO NOT EDIT!\n\n"); fprintf(ctx->fp, "assert(require(\"jit\").version == \"%s\", \"LuaJIT core/library version mismatch\")\n\n", LUAJIT_VERSION); fprintf(ctx->fp, "return {\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"); #if LJ_HASJIT 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"); #endif } /* -- 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); fprintf(ctx->fp, "}\n\n"); 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; } subprojects/luajit/src/host/buildvm_lib.c0000644000175000017500000003005214741067622020110 0ustar aniolaniol/* ** LuaJIT VM builder: library definition compiler. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #include "buildvm.h" #include "lj_obj.h" #include "lj_bc.h" #include "lj_lib.h" #include "buildvm_libbc.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 uint8_t *libdef_uleb128(uint8_t *p, uint32_t *vv) { uint32_t v = *p++; if (v >= 0x80) { int sh = 0; v &= 0x7f; do { v |= ((*p & 0x7f) << (sh += 7)); } while (*p++ >= 0x80); } *vv = v; return p; } static void libdef_fixupbc(uint8_t *p) { uint32_t i, sizebc; p += 4; p = libdef_uleb128(p, &sizebc); p = libdef_uleb128(p, &sizebc); p = libdef_uleb128(p, &sizebc); for (i = 0; i < sizebc; i++, p += 4) { uint8_t op = p[libbc_endian ? 3 : 0]; uint8_t ra = p[libbc_endian ? 2 : 1]; uint8_t rc = p[libbc_endian ? 1 : 2]; uint8_t rb = p[libbc_endian ? 0 : 3]; if (!LJ_DUALNUM && op == BC_ISTYPE && rc == ~LJ_TNUMX+1) { op = BC_ISNUM; rc++; } p[LJ_ENDIAN_SELECT(0, 3)] = op; p[LJ_ENDIAN_SELECT(1, 2)] = ra; p[LJ_ENDIAN_SELECT(2, 1)] = rc; p[LJ_ENDIAN_SELECT(3, 0)] = rb; } } static void libdef_lua(BuildCtx *ctx, char *p, int arg) { UNUSED(arg); if (ctx->mode == BUILD_libdef) { int i; for (i = 0; libbc_map[i].name != NULL; i++) { if (!strcmp(libbc_map[i].name, p)) { int ofs = libbc_map[i].ofs; int len = libbc_map[i+1].ofs - ofs; obuf[2]++; /* Bump hash table size. */ *optr++ = LIBINIT_LUA; libdef_name(p, 0); memcpy(optr, libbc_code + ofs, len); libdef_fixupbc(optr); optr += len; return; } } fprintf(stderr, "Error: missing libbc definition for %s\n", p); exit(1); } } 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_ }, { "LUA(", ")", libdef_lua, 0 }, { "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; size_t len = strlen(buf); if (buf[len-1] == '\n') { buf[len-1] = 0; if (buf[len-2] == '\r') { buf[len-2] = 0; } } if (!strcmp(buf, "#if LJ_52")) ok = LJ_52; else if (!strcmp(buf, "#if LJ_HASJIT")) ok = LJ_HASJIT; else if (!strcmp(buf, "#if LJ_HASFFI")) ok = LJ_HASFFI; else if (!strcmp(buf, "#if LJ_HASBUFFER")) ok = LJ_HASBUFFER; 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"); } } subprojects/luajit/src/host/minilua.c0000644000175000017500000052446514741067622017276 0ustar aniolaniol/* This is a heavily customized and minimized copy of Lua 5.1.5. */ /* It's only used to build LuaJIT. It does NOT have all standard functions! */ /****************************************************************************** * Copyright (C) 1994-2012 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. ******************************************************************************/ #ifdef _MSC_VER typedef unsigned __int64 U64; #else typedef unsigned long long U64; #endif int _CRT_glob = 0; #include #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+p->numparams); 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); } /*fallthrough*/ 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)luaX_lexerror(ls,"invalid long string delimiter",TK_STRING); return'['; } 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 #endif #if LJ_TARGET_WINDOWS #define WIN32_LEAN_AND_MEAN #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_WINDOWS FlushInstructionCache(GetCurrentProcess(), start, (char *)end-(char *)start); #elif LJ_TARGET_IOS sys_icache_invalidate(start, (char *)end-(char *)start); #elif LJ_TARGET_PPC lj_vm_cachesync(start, end); #elif defined(__GNUC__) || defined(__clang__) __clear_cache(start, end); #else #error "Missing builtin to flush instruction cache" #endif } #endif #if LJ_HASJIT #if LJ_TARGET_WINDOWS #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 = LJ_WIN_VALLOC((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 !LJ_WIN_VPROTECT(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) #ifdef PROT_MPROTECT #define MCPROT_CREATE (PROT_MPROTECT(MCPROT_RWX)) #else #define MCPROT_CREATE 0 #endif static void *mcode_alloc_at(jit_State *J, uintptr_t hint, size_t sz, int prot) { void *p = mmap((void *)hint, sz, prot|MCPROT_CREATE, 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); } #else #error "Missing OS support for explicit placement of executable memory" #endif /* -- MCode area protection ----------------------------------------------- */ #if LUAJIT_SECURITY_MCODE == 0 /* Define this ONLY if page protection twiddling becomes a bottleneck. ** ** 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. ** ** 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 pages ** simplify 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); UNUSED(mcode_setprot); } #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_NORET 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); } exit(EXIT_FAILURE); } /* 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 & ~(uintptr_t)0x0fffffffu) + 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_u64(&J2G(J)->prng) & ((1u<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; J->mcbot = (MCode *)lj_err_register_mcode(J->mcarea, sz, (uint8_t *)J->mcbot); } /* 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; size_t sz = ((MCLink *)mc)->size; lj_err_deregister_mcode(mc, sz, (uint8_t *)mc + sizeof(MCLink)); mcode_free(J, mc, sz); 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) { if (finish) { #if LUAJIT_SECURITY_MCODE if (J->mcarea == ptr) mcode_protect(J, MCPROT_RUN); else if (LJ_UNLIKELY(mcode_setprot(ptr, ((MCLink *)ptr)->size, MCPROT_RUN))) mcode_protfail(J); #endif 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)) { #if LUAJIT_SECURITY_MCODE mcode_protect(J, MCPROT_GEN); #endif return mc; } /* Otherwise search through the list of MCode areas. */ for (;;) { mc = ((MCLink *)mc)->next; lj_assertJ(mc != NULL, "broken MCode area chain"); if (ptr >= mc && ptr < (MCode *)((char *)mc + ((MCLink *)mc)->size)) { #if LUAJIT_SECURITY_MCODE if (LJ_UNLIKELY(mcode_setprot(mc, ((MCLink *)mc)->size, MCPROT_GEN))) mcode_protfail(J); #endif return mc; } } } } /* 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 (need * sizeof(MCode) > 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 subprojects/luajit/src/lj_prng.h0000644000175000017500000000121114741067622016276 0ustar aniolaniol/* ** Pseudo-random number generation. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #ifndef _LJ_PRNG_H #define _LJ_PRNG_H #include "lj_def.h" LJ_FUNC int LJ_FASTCALL lj_prng_seed_secure(PRNGState *rs); LJ_FUNC uint64_t LJ_FASTCALL lj_prng_u64(PRNGState *rs); LJ_FUNC uint64_t LJ_FASTCALL lj_prng_u64d(PRNGState *rs); /* This is just the precomputed result of lib_math.c:random_seed(rs, 0.0). */ static LJ_AINLINE void lj_prng_seed_fixed(PRNGState *rs) { rs->u[0] = U64x(a0d27757,0a345b8c); rs->u[1] = U64x(764a296c,5d4aa64f); rs->u[2] = U64x(51220704,070adeaa); rs->u[3] = U64x(2a2717b5,a7b7b927); } #endif subprojects/luajit/src/vm_ppc.dasc0000644000175000017500000046250114741067622016627 0ustar aniolaniol|// Low-level VM code for PowerPC 32 bit or 32on64 bit mode. |// Bytecode interpreter, fast functions and helper functions. |// Copyright (C) 2005-2023 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). |// 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) | |.macro .FPU, a, b |.if FPU | a, b |.endif |.endmacro | |.macro .FPU, a, b, c |.if FPU | a, b, c |.endif |.endmacro | |// 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 |.if FPU |.define TOBIT, f30 // 2^52 + 2^51. |.define TONUM, f31 // 2^52 + 2^51 + 2^31. |.endif | |// 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 |.define SAVE1, r25 | |// Calling conventions. |.define CARG1, r3 |.define CARG2, r4 |.define CARG3, r5 |.define CARG4, r6 // Overlaps TMP3. |.define CARG5, r7 // Overlaps INS. | |.if FPU |.define FARG1, f1 |.define FARG2, f2 |.endif | |.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 | |.if FPU |.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. |.else |.define SAVE_LR, 132(sp) |.define CFRAME_SPACE, 128 // Delta for sp. |// Back chain for sp: 128(sp) <-- sp entering interpreter |.endif |.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) |.if FPU |.define TMPD_LO, 20(sp) |.define TMPD_HI, 16(sp) |.define TONUM_LO, 12(sp) |.define TONUM_HI, 8(sp) |.else |.define SFSAVE_4, 20(sp) |.define SFSAVE_3, 16(sp) |.define SFSAVE_2, 12(sp) |.define SFSAVE_1, 8(sp) |.endif |// Next frame lr: 4(sp) |// Back chain for sp: 0(sp) <-- sp while in interpreter | |.if FPU |.define TMPD_BLO, 23(sp) |.define TMPD, TMPD_HI |.define TONUM_D, TONUM_HI |.endif | |.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 | .FPU 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 | .FPU 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 |.type SBUF, SBuf | |//----------------------------------------------------------------------- | |// Trap for not-yet-implemented parts. |.macro NYI; tw 4, sp, sp; .endmacro | |.if FPU |// 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 |.endif | |//----------------------------------------------------------------------- | |// 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 |.if FPU | lfd f0, 0(RA) |.else | lwz CARG1, 0(RA) | lwz CARG2, 4(RA) |.endif | addi RA, RA, 8 |.if FPU | stfd f0, 0(BASE) |.else | stw CARG1, 0(BASE) | stw CARG2, 4(BASE) |.endif | 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 | .FPU lus TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). | lwz DISPATCH, L->glref // Setup pointer to dispatch table. | li ZERO, 0 | .FPU stw TMP3, TMPD | li TMP1, LJ_TFALSE | .FPU ori TMP3, TMP3, 0x0004 // TONUM = 2^52 + 2^51 + 2^31 (float). | li TISNIL, LJ_TNIL | li_vmstate INTERP | .FPU lfs TOBIT, TMPD | lwz PC, FRAME_PC(BASE) // Fetch PC of previous frame. | la RA, -8(BASE) // Results start at BASE-8. | .FPU 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 | .FPU 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 CARG3, SAVE_CFRAME | stw CARG1, SAVE_PC // Any value outside of bytecode is ok. | stp TMP0, L->cframe | beq >3 | | // Resume after yield (like a return). | stw L, DISPATCH_GL(cur_L)(DISPATCH) | mr RA, BASE | lp BASE, L->base | li TISNUM, LJ_TISNUM // Setup type comparison constants. | lp TMP1, L->top | lwz PC, FRAME_PC(BASE) | .FPU lus TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). | stb CARG3, L->status | .FPU stw TMP3, TMPD | .FPU ori TMP3, TMP3, 0x0004 // TONUM = 2^52 + 2^51 + 2^31 (float). | .FPU lfs TOBIT, TMPD | sub RD, TMP1, BASE | .FPU stw TMP3, TMPD | .FPU lus TMP0, 0x4338 // Hiword of 2^52 + 2^51 (double) | addi RD, RD, 8 | .FPU stw TMP0, TONUM_HI | li_vmstate INTERP | li ZERO, 0 | st_vmstate | andix. TMP0, PC, FRAME_TYPE | mr MULTRES, RD | .FPU 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 | mr L, CARG1 | stw CARG3, SAVE_NRES | lwz DISPATCH, L->glref // Setup pointer to dispatch table. | stw CARG1, SAVE_L | mr BASE, CARG2 | addi DISPATCH, DISPATCH, GG_G2DISP | stw CARG1, SAVE_PC // Any value outside of bytecode is ok. | stp TMP1, SAVE_CFRAME | stp sp, L->cframe // Add our C frame to cframe chain. | |3: // Entry point for vm_cpcall/vm_resume (BASE = base, PC = ftype). | stw L, DISPATCH_GL(cur_L)(DISPATCH) | lp TMP2, L->base // TMP2 = old base (used in vmeta_call). | li TISNUM, LJ_TISNUM // Setup type comparison constants. | lp TMP1, L->top | .FPU lus TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). | add PC, PC, BASE | .FPU stw TMP3, TMPD | li ZERO, 0 | .FPU ori TMP3, TMP3, 0x0004 // TONUM = 2^52 + 2^51 + 2^31 (float). | .FPU lfs TOBIT, TMPD | sub PC, PC, TMP2 // PC = frame delta + frame type | .FPU stw TMP3, TMPD | .FPU lus TMP0, 0x4338 // Hiword of 2^52 + 2^51 (double) | sub NARGS8:RC, TMP1, BASE | .FPU stw TMP0, TONUM_HI | li_vmstate INTERP | .FPU 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 | lwz DISPATCH, L->glref // Setup pointer to dispatch table. | stw CARG1, SAVE_PC // Any value outside of bytecode is ok. | sub TMP0, TMP0, TMP1 // Compute -savestack(L, L->top). | lp TMP1, L->cframe | addi DISPATCH, DISPATCH, GG_G2DISP | .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 | stp sp, L->cframe // Add our C frame to cframe chain. | stw L, DISPATCH_GL(cur_L)(DISPATCH) | mtctr CARG4 | bctrl // (lua_State *L, lua_CFunction func, void *ud) |.if PPE | mr BASE, CRET1 | cmpwi CRET1, 0 |.else | mr. BASE, CRET1 |.endif | li PC, FRAME_CP | 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 | stwx TISNIL, RA, TMP2 // Ensure one valid arg. |.if FFI | ble >1 |.endif | lwz TMP1, LFUNC:TMP1->pc | 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 |.if FPU | lfd f0, 0(RA) |.else | lwz TMP2, 0(RA) | lwz TMP3, 4(RA) |.endif | add TMP1, BASE, SAVE0 | stp BASE, L->base | cmplw TMP1, CARG2 | sub CARG3, CARG2, TMP1 | decode_RA8 RA, INS |.if FPU | stfd f0, 0(CARG2) |.else | stw TMP2, 0(CARG2) | stw TMP3, 4(CARG2) |.endif | bney ->BC_CAT_Z |.if FPU | stfdx f0, BASE, RA |.else | stwux TMP2, RA, BASE | stw TMP3, 4(RA) |.endif | 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 |.if FPU | lfd f0, 0(CRET1) |.else | lwz TMP0, 0(CRET1) | lwz TMP1, 4(CRET1) |.endif | ins_next1 |.if FPU | stfdx f0, BASE, RA |.else | stwux TMP0, RA, BASE | stw TMP1, 4(RA) |.endif | 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_tgetr: | bl extern lj_tab_getinth // (GCtab *t, int32_t key) | // Returns cTValue * or NULL. | cmplwi CRET1, 0 | beq >1 |.if FPU | lfd f14, 0(CRET1) |.else | lwz SAVE0, 0(CRET1) | lwz SAVE1, 4(CRET1) |.endif | b ->BC_TGETR_Z |1: | stwx TISNIL, BASE, RA | b ->cont_nop | |//----------------------------------------------------------------------- | |->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 |.if FPU | lfdx f0, BASE, RA |.else | lwzux TMP2, RA, BASE | lwz TMP3, 4(RA) |.endif | beq >3 | // NOBARRIER: lj_meta_tset ensures the table is not black. | ins_next1 |.if FPU | stfd f0, 0(CRET1) |.else | stw TMP2, 0(CRET1) | stw TMP3, 4(CRET1) |.endif | 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) |.if FPU | stfd f0, 16(BASE) // Copy value to third argument. |.else | stw TMP2, 16(BASE) | stw TMP3, 20(BASE) |.endif | b ->vm_call_dispatch_f | |->vmeta_tsetr: | stp BASE, L->base | mr CARG1, L | stw PC, SAVE_PC | bl extern lj_tab_setinth // (lua_State *L, GCtab *t, int32_t key) | // Returns TValue *. |.if FPU | stfd f14, 0(CRET1) |.else | stw SAVE0, 0(CRET1) | stw SAVE1, 4(CRET1) |.endif | b ->cont_nop | |//-- 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) |.if FPU | lfd f0, 0(RA) |.else | lwz CARG1, 0(RA) | lwz CARG2, 4(RA) |.endif | decode_RA8 TMP1, INS |.if FPU | stfdx f0, BASE, TMP1 |.else | stwux CARG1, TMP1, BASE | stw CARG2, 4(TMP1) |.endif | 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 | |->vmeta_istype: | subi PC, PC, 4 | stp BASE, L->base | srwi CARG2, RA, 3 | mr CARG1, L | srwi CARG3, RD, 3 | stw PC, SAVE_PC | bl extern lj_meta_istype // (lua_State *L, BCReg ra, BCReg tp) | b ->cont_nop | |//-- 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 CARG1, 0(BASE) |.if FPU | lfd FARG1, 0(BASE) |.else | lwz CARG2, 4(BASE) |.endif | blt ->fff_fallback | checknum CARG1; bge ->fff_fallback |.endmacro | |.macro .ffunc_nn, name |->ff_ .. name: | cmplwi NARGS8:RC, 16 | lwz CARG1, 0(BASE) |.if FPU | lfd FARG1, 0(BASE) | lwz CARG3, 8(BASE) | lfd FARG2, 8(BASE) |.else | lwz CARG2, 4(BASE) | lwz CARG3, 8(BASE) | lwz CARG4, 12(BASE) |.endif | blt ->fff_fallback | checknum CARG1; bge ->fff_fallback | checknum CARG3; 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. | addi TMP1, BASE, 8 | add TMP2, RA, NARGS8:RC | stw CARG1, 4(RA) | beq ->fff_res // Done if exactly 1 argument. |1: | cmplw TMP1, TMP2 |.if FPU | lfd f0, 0(TMP1) | stfd f0, 0(TMP1) |.else | lwz CARG1, 0(TMP1) | lwz CARG2, 4(TMP1) | stw CARG1, -8(TMP1) | stw CARG2, -4(TMP1) |.endif | 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 |.if FPU | la TMP2, CFUNC:RB->upvalue | lfdx FARG1, TMP2, TMP1 |.else | add TMP1, CFUNC:RB, TMP1 | lwz CARG1, CFUNC:TMP1->upvalue[0].u32.hi | lwz CARG2, CFUNC:TMP1->upvalue[0].u32.lo |.endif | 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->sid | lwz NODE:TMP2, TAB:CARG1->node | and TMP1, TMP1, TMP0 // idx = str->sid & 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 *. |.if FPU | lfd FARG1, 0(CRET1) |.else | lwz CARG2, 4(CRET1) | lwz CARG1, 0(CRET1) // Caveat: CARG1 == CRET1. |.endif | 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) |.if FPU | lfd FARG1, 0(BASE) |.else | lwz CARG2, 4(BASE) |.endif | 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_strfmt_number // (lua_State *L, cTValue *o) |.else | bl extern lj_strfmt_num // (lua_State *L, lua_Number *np) |.endif | // Returns GCstr *. | li CARG3, LJ_TSTR | b ->fff_restv | |//-- Base library: iterators ------------------------------------------- | |.ffunc_1 next | stwx TISNIL, BASE, NARGS8:RC // Set missing 2nd arg to nil. | checktab CARG3 | lwz PC, FRAME_PC(BASE) | bne ->fff_fallback | la CARG2, 8(BASE) | la CARG3, -8(BASE) | bl extern lj_tab_next // (GCtab *t, cTValue *key, TValue *o) | // Returns 1=found, 0=end, -1=error. | cmpwi CRET1, 0 | la RA, -8(BASE) | li RD, (2+1)*8 | bgt ->fff_res // Found key/value. | li CARG3, LJ_TNIL | beq ->fff_restv // End of traversal: return nil. | lwz CFUNC:RB, FRAME_FUNC(BASE) | li NARGS8:RC, 2*8 | b ->fff_fallback // Invalid key. | |.ffunc_1 pairs | checktab CARG3 | lwz PC, FRAME_PC(BASE) | bne ->fff_fallback #if LJ_52 | lwz TAB:TMP2, TAB:CARG1->metatable |.if FPU | lfd f0, CFUNC:RB->upvalue[0] |.else | lwz TMP0, CFUNC:RB->upvalue[0].u32.hi | lwz TMP1, CFUNC:RB->upvalue[0].u32.lo |.endif | cmplwi TAB:TMP2, 0 | la RA, -8(BASE) | bne ->fff_fallback #else |.if FPU | lfd f0, CFUNC:RB->upvalue[0] |.else | lwz TMP0, CFUNC:RB->upvalue[0].u32.hi | lwz TMP1, CFUNC:RB->upvalue[0].u32.lo |.endif | la RA, -8(BASE) #endif | stw TISNIL, 8(BASE) | li RD, (3+1)*8 |.if FPU | stfd f0, 0(RA) |.else | stw TMP0, 0(RA) | stw TMP1, 4(RA) |.endif | 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? |.if FPU | lwzx TMP2, TMP1, TMP3 | lfdx f0, TMP1, TMP3 |.else | lwzux TMP2, TMP1, TMP3 | lwz TMP3, 4(TMP1) |.endif |1: | checknil TMP2 | li RD, (0+1)*8 | beq ->fff_res // End of iteration, return 0 results. | li RD, (2+1)*8 |.if FPU | stfd f0, 8(RA) |.else | stw TMP2, 8(RA) | stw TMP3, 12(RA) |.endif | 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) |.if FPU | lfd f0, 0(CRET1) |.else | lwz TMP3, 4(CRET1) |.endif | b <1 | |.ffunc_1 ipairs | checktab CARG3 | lwz PC, FRAME_PC(BASE) | bne ->fff_fallback #if LJ_52 | lwz TAB:TMP2, TAB:CARG1->metatable |.if FPU | lfd f0, CFUNC:RB->upvalue[0] |.else | lwz TMP0, CFUNC:RB->upvalue[0].u32.hi | lwz TMP1, CFUNC:RB->upvalue[0].u32.lo |.endif | cmplwi TAB:TMP2, 0 | la RA, -8(BASE) | bne ->fff_fallback #else |.if FPU | lfd f0, CFUNC:RB->upvalue[0] |.else | lwz TMP0, CFUNC:RB->upvalue[0].u32.hi | lwz TMP1, CFUNC:RB->upvalue[0].u32.lo |.endif | 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 |.if FPU | stfd f0, 0(RA) |.else | stw TMP0, 0(RA) | stw TMP1, 4(RA) |.endif | b ->fff_res | |//-- Base library: catch errors ---------------------------------------- | |.ffunc pcall | lwz TMP1, L->maxstack | add TMP2, BASE, NARGS8:RC | cmplwi NARGS8:RC, 8 | lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH) | cmplw cr1, TMP1, TMP2 | cror 4*cr0+lt, 4*cr0+lt, 4*cr1+lt | 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 | lwz TMP1, L->maxstack | add TMP2, BASE, NARGS8:RC | cmplwi NARGS8:RC, 16 | lwz CARG3, 8(BASE) | cmplw cr1, TMP1, TMP2 |.if FPU | lfd FARG2, 8(BASE) | cror 4*cr0+lt, 4*cr0+lt, 4*cr1+lt | lfd FARG1, 0(BASE) |.else | lwz CARG1, 0(BASE) | lwz CARG2, 4(BASE) | cror 4*cr0+lt, 4*cr0+lt, 4*cr1+lt | lwz CARG4, 12(BASE) |.endif | blt ->fff_fallback | lbz TMP1, DISPATCH_GL(hookmask)(DISPATCH) | mr TMP2, BASE | checkfunc CARG3; 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 |.if FPU | stfd FARG2, 0(TMP2) // Swap function and traceback. | stfd FARG1, 8(TMP2) |.else | stw CARG3, 0(TMP2) | stw CARG4, 4(TMP2) | stw CARG1, 8(TMP2) | stw CARG2, 12(TMP2) |.endif | subi NARGS8:RC, NARGS8:RC, 16 | 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 |.if FPU | lfdx f0, BASE, TMP1 |.else | add CARG3, BASE, TMP1 | lwz TMP2, 0(CARG3) | lwz TMP3, 4(CARG3) |.endif | beq >3 |.if FPU | stfdx f0, CARG2, TMP1 |.else | add CARG3, CARG2, TMP1 | stw TMP2, 0(CARG3) | stw TMP3, 4(CARG3) |.endif | 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 | stw L, DISPATCH_GL(cur_L)(DISPATCH) | 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 |.if FPU | lfdx f0, TMP2, TMP1 | stfdx f0, BASE, TMP1 |.else | add CARG3, TMP2, TMP1 | lwz CARG1, 0(CARG3) | lwz CARG2, 4(CARG3) | add CARG3, BASE, TMP1 | stw CARG1, 0(CARG3) | stw CARG2, 4(CARG3) |.endif | 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 |.if FPU | lfd f0, 0(TMP3) |.else | lwz CARG1, 0(TMP3) | lwz CARG2, 4(TMP3) |.endif | 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) |.if FPU | stfd f0, 0(BASE) // Copy error message. |.else | stw CARG1, 0(BASE) // Copy error message. | stw CARG2, 4(BASE) |.endif | 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: |.if FPU | lfd FARG1, 0(BASE) |.else | lwz CARG1, 0(BASE) | lwz CARG2, 4(BASE) |.endif | 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 CARG1, 0(BASE) | bne ->fff_fallback // Need exactly 1 argument. | checknum CARG1; bge ->fff_fallback |.if FPU | lfd FARG1, 0(BASE) |.else | lwz CARG2, 4(BASE) |.endif | 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 | |.if DUALNUM |.ffunc math_ldexp | cmplwi NARGS8:RC, 16 | lwz TMP0, 0(BASE) |.if FPU | lfd FARG1, 0(BASE) |.else | lwz CARG1, 0(BASE) | lwz CARG2, 4(BASE) |.endif | lwz TMP1, 8(BASE) |.if GPR64 | lwz CARG2, 12(BASE) |.elif FPU | lwz CARG1, 12(BASE) |.else | lwz CARG3, 12(BASE) |.endif | blt ->fff_fallback | checknum TMP0; bge ->fff_fallback | checknum TMP1; 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) |.elif FPU | la CARG1, DISPATCH_GL(tmptv)(DISPATCH) |.else | la CARG3, 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 |.if FPU | stfd FARG1, 0(RA) |.else | stw CRET1, 0(RA) | stw CRET2, 4(RA) |.endif | 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) |.elif FPU | la CARG1, -8(BASE) |.else | la CARG3, -8(BASE) |.endif | lwz PC, FRAME_PC(BASE) | blex modf | la RA, -8(BASE) |.if FPU | stfd FARG1, 0(BASE) |.else | stw CRET1, 0(BASE) | stw CRET2, 4(BASE) |.endif | li RD, (2+1)*8 | b ->fff_res | |.macro math_minmax, name, ismax |.if DUALNUM | .ffunc_1 name | checknum CARG3 | addi SAVE0, BASE, 8 | add SAVE1, BASE, NARGS8:RC | bne >4 |1: // Handle integers. | lwz CARG4, 0(SAVE0) | cmplw cr1, SAVE0, SAVE1 | lwz CARG2, 4(SAVE0) | 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 SAVE0, SAVE0, 8 | b <1 |3: | bge ->fff_fallback | // Convert intermediate result to number and continue below. |.if FPU | tonum_i FARG1, CARG1 | lfd FARG2, 0(SAVE0) |.else | mr CARG2, CARG1 | bl ->vm_sfi2d_1 | lwz CARG3, 0(SAVE0) | lwz CARG4, 4(SAVE0) |.endif | b >6 |4: |.if FPU | lfd FARG1, 0(BASE) |.else | lwz CARG1, 0(BASE) | lwz CARG2, 4(BASE) |.endif | bge ->fff_fallback |5: // Handle numbers. | lwz CARG3, 0(SAVE0) | cmplw cr1, SAVE0, SAVE1 |.if FPU | lfd FARG2, 0(SAVE0) |.else | lwz CARG4, 4(SAVE0) |.endif | bge cr1, ->fff_resn | checknum CARG3; bge >7 |6: | addi SAVE0, SAVE0, 8 |.if FPU |.if ismax | fsub f0, FARG1, FARG2 |.else | fsub f0, FARG2, FARG1 |.endif | fsel FARG1, f0, FARG1, FARG2 |.else | stw CARG1, SFSAVE_1 | stw CARG2, SFSAVE_2 | stw CARG3, SFSAVE_3 | stw CARG4, SFSAVE_4 | blex __ledf2 | cmpwi CRET1, 0 |.if ismax | blt >8 |.else | bge >8 |.endif | lwz CARG1, SFSAVE_1 | lwz CARG2, SFSAVE_2 | b <5 |8: | lwz CARG1, SFSAVE_3 | lwz CARG2, SFSAVE_4 |.endif | b <5 |7: // Convert integer to number and continue above. | lwz CARG3, 4(SAVE0) | bne ->fff_fallback |.if FPU | tonum_i FARG2, CARG3 |.else | bl ->vm_sfi2d_2 |.endif | 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 |.if ismax | fsub f0, FARG1, FARG2 |.else | fsub f0, FARG2, FARG1 |.endif | addi TMP1, TMP1, 8 | fsel FARG1, f0, FARG1, FARG2 | b <1 |.endif |.endmacro | | math_minmax math_min, 0 | math_minmax math_max, 1 | |//-- String library ----------------------------------------------------- | |.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) |->fff_resstr: | // 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 | |.macro ffstring_op, name | .ffunc string_ .. name | ffgccheck | cmplwi NARGS8:RC, 8 | lwz CARG3, 0(BASE) | lwz STR:CARG2, 4(BASE) | blt ->fff_fallback | checkstr CARG3 | la SBUF:CARG1, DISPATCH_GL(tmpbuf)(DISPATCH) | bne ->fff_fallback | lwz TMP0, SBUF:CARG1->b | stw L, SBUF:CARG1->L | stp BASE, L->base | stw PC, SAVE_PC | stw TMP0, SBUF:CARG1->w | bl extern lj_buf_putstr_ .. name | bl extern lj_buf_tostr | b ->fff_resstr |.endmacro | |ffstring_op reverse |ffstring_op lower |ffstring_op upper | |//-- 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 SAVE0, BASE, 8 | add SAVE1, BASE, NARGS8:RC |1: | lwz CARG4, 0(SAVE0) | cmplw cr1, SAVE0, SAVE1 |.if DUALNUM | lwz CARG2, 4(SAVE0) |.else | lfd FARG1, 0(SAVE0) |.endif | bgey cr1, ->fff_resi | checknum CARG4 |.if DUALNUM |.if FPU | bnel ->fff_bitop_fb |.else | beq >3 | stw CARG1, SFSAVE_1 | bl ->fff_bitop_fb | mr CARG2, CARG1 | lwz CARG1, SFSAVE_1 |3: |.endif |.else | fadd FARG1, FARG1, TOBIT | bge ->fff_fallback | stfd FARG1, TMPD | lwz CARG2, TMPD_LO |.endif | ins CARG1, CARG1, CARG2 | addi SAVE0, SAVE0, 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 |.if FPU | checknum CARG3; bnel ->fff_tobit_fb |.else | checknum CARG3; beq >1 | bl ->fff_tobit_fb | lwz CARG2, 12(BASE) // Conversion polluted CARG2. |1: |.endif | // 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) |.if FPU | stfd FARG1, -8(BASE) |.else | stw CARG1, -8(BASE) | stw CARG2, -4(BASE) |.endif | b ->fff_res1 | |// Fallback FP number to bit conversion. |->fff_tobit_fb: |.if DUALNUM |.if FPU | lfd FARG1, 0(BASE) | bgt ->fff_fallback | fadd FARG1, FARG1, TOBIT | stfd FARG1, TMPD | lwz CARG1, TMPD_LO | blr |.else | bgt ->fff_fallback | mr CARG2, CARG1 | mr CARG1, CARG3 |// Modifies: CARG1, CARG2, TMP0, TMP1, TMP2. |->vm_tobit: | slwi TMP2, CARG1, 1 | addis TMP2, TMP2, 0x0020 | cmpwi TMP2, 0 | bge >2 | li TMP1, 0x3e0 | srawi TMP2, TMP2, 21 | not TMP1, TMP1 | sub. TMP2, TMP1, TMP2 | cmpwi cr7, CARG1, 0 | blt >1 | slwi TMP1, CARG1, 11 | srwi TMP0, CARG2, 21 | oris TMP1, TMP1, 0x8000 | or TMP1, TMP1, TMP0 | srw CARG1, TMP1, TMP2 | bclr 4, 28 // Return if cr7[lt] == 0, no hint. | neg CARG1, CARG1 | blr |1: | addi TMP2, TMP2, 21 | srw TMP1, CARG2, TMP2 | slwi CARG2, CARG1, 12 | subfic TMP2, TMP2, 20 | slw TMP0, CARG2, TMP2 | or CARG1, TMP1, TMP0 | bclr 4, 28 // Return if cr7[lt] == 0, no hint. | neg CARG1, CARG1 | blr |2: | li CARG1, 0 | blr |.endif |.endif |->fff_bitop_fb: |.if DUALNUM |.if FPU | lfd FARG1, 0(SAVE0) | bgt ->fff_fallback | fadd FARG1, FARG1, TOBIT | stfd FARG1, TMPD | lwz CARG2, TMPD_LO | blr |.else | bgt ->fff_fallback | mr CARG1, CARG4 | b ->vm_tobit |.endif |.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 | |->cont_stitch: // Trace stitching. |.if JIT | // RA = resultptr, RB = meta base | lwz INS, -4(PC) | lwz TRACE:TMP2, -20(RB) // Save previous trace. | addic. TMP1, MULTRES, -8 | decode_RA8 RC, INS // Call base. | beq >2 |1: // Move results down. |.if FPU | lfd f0, 0(RA) |.else | lwz CARG1, 0(RA) | lwz CARG2, 4(RA) |.endif | addic. TMP1, TMP1, -8 | addi RA, RA, 8 |.if FPU | stfdx f0, BASE, RC |.else | add CARG3, BASE, RC | stw CARG1, 0(CARG3) | stw CARG2, 4(CARG3) |.endif | addi RC, RC, 8 | bne <1 |2: | decode_RA8 RA, INS | decode_RB8 RB, INS | add RA, RA, RB |3: | cmplw RA, RC | bgt >9 // More results wanted? | | lhz TMP3, TRACE:TMP2->traceno | lhz RD, TRACE:TMP2->link | cmpw RD, TMP3 | cmpwi cr1, RD, 0 | beq ->cont_nop // Blacklisted. | slwi RD, RD, 3 | bne cr1, =>BC_JLOOP // Jump to stitched trace. | | // Stitch a new trace to the previous trace. | stw TMP3, DISPATCH_J(exitno)(DISPATCH) | stp L, DISPATCH_J(L)(DISPATCH) | stp BASE, L->base | addi CARG1, DISPATCH, GG_DISP2J | mr CARG2, PC | bl extern lj_dispatch_stitch // (jit_State *J, const BCIns *pc) | lp BASE, L->base | b ->cont_nop | |9: | stwx TISNIL, BASE, RC | addi RC, RC, 8 | b <3 |.endif | |->vm_profhook: // Dispatch target for profiler hook. #if LJ_HASPROFILE | mr CARG1, L | stw MULTRES, SAVE_MULTRES | mr CARG2, PC | stp BASE, L->base | bl extern lj_dispatch_profile // (lua_State *L, const BCIns *pc) | // HOOK_PROFILE is off again, so re-dispatch to dynamic instruction. | lp BASE, L->base | subi PC, PC, 4 | b ->cont_nop #endif | |//----------------------------------------------------------------------- |//-- Trace exit handler ------------------------------------------------- |//----------------------------------------------------------------------- | |.macro savex_, a, b, c, d |.if FPU | 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) |.endif |.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(cur_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 | stp L, DISPATCH_J(L)(DISPATCH) | subi CARG3, CARG3, 2 | stp BASE, L->base | stw CARG4, DISPATCH_J(parent)(DISPATCH) | stw TMP1, DISPATCH_GL(jit_base)(DISPATCH) | 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 | stp BASE, L->base |1: | li TMP2, -LUA_ERRERR | cmplw CARG1, TMP2 | bge >9 // Check for error from exit. | lwz LFUNC:RB, FRAME_FUNC(BASE) | slwi MULTRES, CARG1, 3 | li TMP2, 0 | stw MULTRES, SAVE_MULTRES | lwz TMP1, LFUNC:RB->pc | stw TMP2, DISPATCH_GL(jit_base)(DISPATCH) | lwz KBASE, PC2PROTO(k)(TMP1) | // Setup type comparison constants. | li TISNUM, LJ_TISNUM | .FPU lus TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). | .FPU stw TMP3, TMPD | li ZERO, 0 | .FPU ori TMP3, TMP3, 0x0004 // TONUM = 2^52 + 2^51 + 2^31 (float). | .FPU lfs TOBIT, TMPD | .FPU stw TMP3, TMPD | .FPU lus TMP0, 0x4338 // Hiword of 2^52 + 2^51 (double) | li TISNIL, LJ_TNIL | .FPU stw TMP0, TONUM_HI | .FPU 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) | cmpwi CARG1, -17 // Static dispatch? | beq >5 | 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: | cmplwi TMP1, (BC_FUNCC+2)*4 // Fast function? | blt >3 | // Check frame below fast function. | lwz TMP1, FRAME_PC(BASE) | andix. TMP0, TMP1, FRAME_TYPE | bney >3 // Trace stitching continuation? | // Otherwise set KBASE for Lua function below fast function. | lwz TMP2, -4(TMP1) | decode_RA8 TMP0, TMP2 | sub TMP1, BASE, TMP0 | lwz LFUNC:TMP2, -12(TMP1) | lwz TMP1, LFUNC:TMP2->pc | lwz KBASE, PC2PROTO(k)(TMP1) |3: | subi RC, MULTRES, 8 | add RA, RA, BASE | bctr | |5: // Dispatch to static entry of original ins replaced by BC_JLOOP. | lwz TMP1, DISPATCH_J(trace)(DISPATCH) | decode_RD4 RD, INS | lwzx TRACE:TMP1, TMP1, RD | lwz INS, TRACE:TMP1->startins | decode_OPP TMP1, INS | addi TMP1, TMP1, GG_DISP2STATIC | lpx TMP0, DISPATCH, TMP1 | mtctr TMP0 | decode_RB8 RB, INS | decode_RD8 RD, INS | decode_RA8 RA, INS | decode_RC8 RC, INS | bctr | |9: // Rethrow error from the right C frame. | neg CARG2, CARG1 | mr CARG1, L | bl extern lj_err_trace // (lua_State *L, int errcode) |.endif | |//----------------------------------------------------------------------- |//-- Math helper functions ---------------------------------------------- |//----------------------------------------------------------------------- | |// NYI: Use internal implementations of floor, ceil, trunc, sfcmp. | |.macro sfi2d, AHI, ALO |.if not FPU | mr. AHI, ALO | bclr 12, 2 // Handle zero first. | srawi TMP0, ALO, 31 | xor TMP1, ALO, TMP0 | sub TMP1, TMP1, TMP0 // Absolute value in TMP1. | cntlzw AHI, TMP1 | andix. TMP0, TMP0, 0x800 // Mask sign bit. | slw TMP1, TMP1, AHI // Align mantissa left with leading 1. | subfic AHI, AHI, 0x3ff+31-1 // Exponent -1 in AHI. | slwi ALO, TMP1, 21 | or AHI, AHI, TMP0 // Sign | Exponent. | srwi TMP1, TMP1, 11 | slwi AHI, AHI, 20 // Align left. | add AHI, AHI, TMP1 // Add mantissa, increment exponent. | blr |.endif |.endmacro | |// Input: CARG2. Output: CARG1, CARG2. Temporaries: TMP0, TMP1. |->vm_sfi2d_1: | sfi2d CARG1, CARG2 | |// Input: CARG4. Output: CARG3, CARG4. Temporaries: TMP0, TMP1. |->vm_sfi2d_2: | sfi2d CARG3, CARG4 | |->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 | |->vm_next: |.if JIT | NYI // On big-endian. |.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] | .FPU stfd f1, CTSTATE->cb.fpr[0] | stw r4, CTSTATE->cb.gpr[1] | .FPU stfd f2, CTSTATE->cb.fpr[1] | stw r5, CTSTATE->cb.gpr[2] | .FPU stfd f3, CTSTATE->cb.fpr[2] | stw r6, CTSTATE->cb.gpr[3] | .FPU stfd f4, CTSTATE->cb.fpr[3] | stw r7, CTSTATE->cb.gpr[4] | .FPU stfd f5, CTSTATE->cb.fpr[4] | stw r8, CTSTATE->cb.gpr[5] | .FPU stfd f6, CTSTATE->cb.fpr[5] | stw r9, CTSTATE->cb.gpr[6] | .FPU stfd f7, CTSTATE->cb.fpr[6] | stw r10, CTSTATE->cb.gpr[7] | .FPU 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 | .FPU lus TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). | li ZERO, 0 | mr L, CRET1 | .FPU stw TMP3, TMPD | .FPU lus TMP0, 0x4338 // Hiword of 2^52 + 2^51 (double) | lwz LFUNC:RB, FRAME_FUNC(BASE) | .FPU ori TMP3, TMP3, 0x0004 // TONUM = 2^52 + 2^51 + 2^31 (float). | .FPU stw TMP0, TONUM_HI | li TISNIL, LJ_TNIL | li_vmstate INTERP | .FPU lfs TOBIT, TMPD | .FPU stw TMP3, TMPD | sub RC, RC, BASE | st_vmstate | .FPU 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] | .FPU 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, -4 | 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 | 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 | .FPU lfd f1, CCSTATE->fpr[0] | .FPU lfd f2, CCSTATE->fpr[1] | .FPU lfd f3, CCSTATE->fpr[2] | .FPU lfd f4, CCSTATE->fpr[3] | .FPU lfd f5, CCSTATE->fpr[4] | .FPU lfd f6, CCSTATE->fpr[5] | .FPU lfd f7, CCSTATE->fpr[6] | .FPU 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] | .FPU 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 CARG1, RA, BASE | addi PC, PC, 4 | lwz CARG2, 4(RA) | lwzux CARG3, RD, BASE | lwz TMP2, -4(PC) | checknum cr0, CARG1 | lwz CARG4, 4(RD) | decode_RD4 TMP2, TMP2 | checknum cr1, CARG3 | addis SAVE0, TMP2, -(BCBIAS_J*4 >> 16) | bne cr0, >7 | bne cr1, >8 | cmpw CARG2, CARG4 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, SAVE0 |2: | ins_next | |7: // RA is not an integer. | bgt cr0, ->vmeta_comp | // RA is a number. | .FPU lfd f0, 0(RA) | bgt cr1, ->vmeta_comp | blt cr1, >4 | // RA is a number, RD is an integer. |.if FPU | tonum_i f1, CARG4 |.else | bl ->vm_sfi2d_2 |.endif | b >5 | |8: // RA is an integer, RD is not an integer. | bgt cr1, ->vmeta_comp | // RA is an integer, RD is a number. |.if FPU | tonum_i f0, CARG2 |.else | bl ->vm_sfi2d_1 |.endif |4: | .FPU lfd f1, 0(RD) |5: |.if FPU | fcmpu cr0, f0, f1 |.else | blex __ledf2 | cmpwi CRET1, 0 |.endif 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 CARG1, RA, BASE | addi PC, PC, 4 | lwz CARG2, 4(RA) | lwzux CARG3, RD, BASE | checknum cr0, CARG1 | lwz SAVE0, -4(PC) | checknum cr1, CARG3 | decode_RD4 SAVE0, SAVE0 | lwz CARG4, 4(RD) | cror 4*cr7+gt, 4*cr0+gt, 4*cr1+gt | addis SAVE0, SAVE0, -(BCBIAS_J*4 >> 16) if (vk) { | ble cr7, ->BC_ISEQN_Z } else { | ble cr7, ->BC_ISNEN_Z } |.else | lwzux CARG1, RA, BASE | lwz SAVE0, 0(PC) | lfd f0, 0(RA) | addi PC, PC, 4 | lwzux CARG3, RD, BASE | checknum cr0, CARG1 | decode_RD4 SAVE0, SAVE0 | lfd f1, 0(RD) | checknum cr1, CARG3 | addis SAVE0, SAVE0, -(BCBIAS_J*4 >> 16) | bge cr0, >5 | bge cr1, >5 | fcmpu cr0, f0, f1 if (vk) { | bne >1 | add PC, PC, SAVE0 } else { | beq >1 | add PC, PC, SAVE0 } |1: | ins_next |.endif |5: // Either or both types are not numbers. |.if not DUALNUM | lwz CARG2, 4(RA) | lwz CARG4, 4(RD) |.endif |.if FFI | cmpwi cr7, CARG1, LJ_TCDATA | cmpwi cr5, CARG3, LJ_TCDATA |.endif | not TMP2, CARG1 | cmplw CARG1, CARG3 | cmplwi cr1, TMP2, ~LJ_TISPRI // Primitive? |.if FFI | cror 4*cr7+eq, 4*cr7+eq, 4*cr5+eq |.endif | cmplwi cr6, TMP2, ~LJ_TISTABUD // Table or userdata? |.if FFI | beq cr7, ->vmeta_equal_cd |.endif | cmplw cr5, CARG2, CARG4 | 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 SAVE1, 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, SAVE0 |6: } else { | beq cr0, >6 | add PC, PC, SAVE0 |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! | mr CARG3, CARG4 | 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 CARG1, RA, BASE | addi PC, PC, 4 | lwz CARG2, 4(RA) | lwzux CARG3, RD, KBASE | checknum cr0, CARG1 | lwz SAVE0, -4(PC) | checknum cr1, CARG3 | decode_RD4 SAVE0, SAVE0 | lwz CARG4, 4(RD) | addis SAVE0, SAVE0, -(BCBIAS_J*4 >> 16) if (vk) { |->BC_ISEQN_Z: } else { |->BC_ISNEN_Z: } | bne cr0, >7 | bne cr1, >8 | cmpw CARG2, CARG4 |4: |.else if (vk) { |->BC_ISEQN_Z: // Dummy label. } else { |->BC_ISNEN_Z: // Dummy label. } | lwzx CARG1, BASE, RA | addi PC, PC, 4 | lfdx f0, BASE, RA | lwz SAVE0, -4(PC) | lfdx f1, KBASE, RD | decode_RD4 SAVE0, SAVE0 | checknum CARG1 | addis SAVE0, SAVE0, -(BCBIAS_J*4 >> 16) | bge >3 | fcmpu cr0, f0, f1 |.endif if (vk) { | bne >1 | add PC, PC, SAVE0 |1: |.if not FFI |3: |.endif } else { | beq >2 |1: |.if not FFI |3: |.endif | add PC, PC, SAVE0 |2: } | ins_next |.if FFI |3: | cmpwi CARG1, LJ_TCDATA | beq ->vmeta_equal_cd | b <1 |.endif |.if DUALNUM |7: // RA is not an integer. | bge cr0, <3 | // RA is a number. | .FPU lfd f0, 0(RA) | blt cr1, >1 | // RA is a number, RD is an integer. |.if FPU | tonum_i f1, CARG4 |.else | bl ->vm_sfi2d_2 |.endif | b >2 | |8: // RA is an integer, RD is a number. |.if FPU | tonum_i f0, CARG2 |.else | bl ->vm_sfi2d_1 |.endif |1: | .FPU lfd f1, 0(RD) |2: |.if FPU | fcmpu cr0, f0, f1 |.else | blex __ledf2 | cmpwi CRET1, 0 |.endif | 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 |.if FPU | lfdx f0, BASE, RD |.else | lwzux CARG1, RD, BASE | lwz CARG2, 4(RD) |.endif | cmplw TMP0, TMP1 if (op == BC_ISTC) { | bge >1 } else { | blt >1 } | addis PC, PC, -(BCBIAS_J*4 >> 16) | decode_RD4 TMP2, INS |.if FPU | stfdx f0, BASE, RA |.else | stwux CARG1, RA, BASE | stw CARG2, 4(RA) |.endif | add PC, PC, TMP2 |1: } | ins_next break; case BC_ISTYPE: | // RA = src*8, RD = -type*8 | lwzx TMP0, BASE, RA | srwi TMP1, RD, 3 | ins_next1 |.if not PPE and not GPR64 | add. TMP0, TMP0, TMP1 |.else | neg TMP1, TMP1 | cmpw TMP0, TMP1 |.endif | bne ->vmeta_istype | ins_next2 break; case BC_ISNUM: | // RA = src*8, RD = -(TISNUM-1)*8 | lwzx TMP0, BASE, RA | ins_next1 | checknum TMP0 | bge ->vmeta_istype | ins_next2 break; /* -- Unary ops --------------------------------------------------------- */ case BC_MOV: | // RA = dst*8, RD = src*8 | ins_next1 |.if FPU | lfdx f0, BASE, RD | stfdx f0, BASE, RA |.else | lwzux TMP0, RD, BASE | lwz TMP1, 4(RD) | stwux TMP0, RA, BASE | stw TMP1, 4(RA) |.endif | 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 CARG1, BASE, RB | .if DUALNUM | lwzx CARG3, KBASE, RC | .endif | .if FPU | lfdx f14, BASE, RB | lfdx f15, KBASE, RC | .else | add TMP1, BASE, RB | add TMP2, KBASE, RC | lwz CARG2, 4(TMP1) | lwz CARG4, 4(TMP2) | .endif | .if DUALNUM | checknum cr0, CARG1 | checknum cr1, CARG3 | crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt | bge ->vmeta_arith_vn | .else | checknum CARG1; bge ->vmeta_arith_vn | .endif || break; ||case 1: | lwzx CARG1, BASE, RB | .if DUALNUM | lwzx CARG3, KBASE, RC | .endif | .if FPU | lfdx f15, BASE, RB | lfdx f14, KBASE, RC | .else | add TMP1, BASE, RB | add TMP2, KBASE, RC | lwz CARG2, 4(TMP1) | lwz CARG4, 4(TMP2) | .endif | .if DUALNUM | checknum cr0, CARG1 | checknum cr1, CARG3 | crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt | bge ->vmeta_arith_nv | .else | checknum CARG1; bge ->vmeta_arith_nv | .endif || break; ||default: | lwzx CARG1, BASE, RB | lwzx CARG3, BASE, RC | .if FPU | lfdx f14, BASE, RB | lfdx f15, BASE, RC | .else | add TMP1, BASE, RB | add TMP2, BASE, RC | lwz CARG2, 4(TMP1) | lwz CARG4, 4(TMP2) | .endif | checknum cr0, CARG1 | checknum cr1, CARG3 | 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 sfpmod |->BC_MODVN_Z: | stw CARG1, SFSAVE_1 | stw CARG2, SFSAVE_2 | mr SAVE0, CARG3 | mr SAVE1, CARG4 | blex __divdf3 | blex floor | mr CARG3, SAVE0 | mr CARG4, SAVE1 | blex __muldf3 | mr CARG3, CRET1 | mr CARG4, CRET2 | lwz CARG1, SFSAVE_1 | lwz CARG2, SFSAVE_2 | blex __subdf3 |.endmacro | |.macro ins_arithfp, fpins | ins_arithpre |.if "fpins" == "fpmod_" | b ->BC_MODVN_Z // Avoid 3 copies. It's slow anyway. |.elif FPU | fpins f0, f14, f15 | ins_next1 | stfdx f0, BASE, RA | ins_next2 |.else | blex __divdf3 // Only soft-float div uses this macro. | ins_next1 | stwux CRET1, RA, BASE | stw CRET2, 4(RA) | ins_next2 |.endif |.endmacro | |.macro ins_arithdn, intins, fpins, fpcall | // 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 CARG1, RB, BASE | lwzux CARG3, RC, KBASE | lwz CARG2, 4(RB) | checknum cr0, CARG1 | lwz CARG4, 4(RC) | checknum cr1, CARG3 || break; ||case 1: | lwzux CARG3, RB, BASE | lwzux CARG1, RC, KBASE | lwz CARG4, 4(RB) | checknum cr0, CARG3 | lwz CARG2, 4(RC) | checknum cr1, CARG1 || break; ||default: | lwzux CARG1, RB, BASE | lwzux CARG3, RC, BASE | lwz CARG2, 4(RB) | checknum cr0, CARG1 | lwz CARG4, 4(RC) | checknum cr1, CARG3 || break; ||} | bne >5 | bne cr1, >5 |.if "intins" == "intmod" | mr CARG1, CARG2 | mr CARG2, CARG4 |.endif | intins CARG1, CARG2, CARG4 | 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 FPU ||if (vk == 1) { | lfd f15, 0(RB) | lfd f14, 0(RC) ||} else { | lfd f14, 0(RB) | lfd f15, 0(RC) ||} |.endif | crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt | ins_arithfallback bge |.if "fpins" == "fpmod_" | b ->BC_MODVN_Z // Avoid 3 copies. It's slow anyway. |.else |.if FPU | fpins f0, f14, f15 | stfdx f0, BASE, RA |.else |.if "fpcall" == "sfpmod" | sfpmod |.else | blex fpcall |.endif | stwux CRET1, RA, BASE | stw CRET2, 4(RA) |.endif | ins_next1 | b <2 |.endif |.endmacro | |.macro ins_arith, intins, fpins, fpcall |.if DUALNUM | ins_arithdn intins, fpins, fpcall |.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 TMP1, b, 32, 31 | addo. TMP0, TMP0, TMP1 | add y, a, b |.endmacro | ins_arith addo32., fadd, __adddf3 |.else | ins_arith addo., fadd, __adddf3 |.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 TMP1, b, 32, 31 | subo. TMP0, TMP0, TMP1 | sub y, a, b |.endmacro | ins_arith subo32., fsub, __subdf3 |.else | ins_arith subo., fsub, __subdf3 |.endif break; case BC_MULVN: case BC_MULNV: case BC_MULVV: | ins_arith mullwo., fmul, __muldf3 break; case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: | ins_arithfp fdiv break; case BC_MODVN: | ins_arith intmod, fpmod, sfpmod break; case BC_MODNV: case BC_MODVV: | ins_arith intmod, fpmod_, sfpmod break; case BC_POW: | // NYI: (partial) integer arithmetic. | lwzx CARG1, BASE, RB | lwzx CARG3, BASE, RC |.if FPU | lfdx FARG1, BASE, RB | lfdx FARG2, BASE, RC |.else | add TMP1, BASE, RB | add TMP2, BASE, RC | lwz CARG2, 4(TMP1) | lwz CARG4, 4(TMP2) |.endif | checknum cr0, CARG1 | checknum cr1, CARG3 | crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt | bge ->vmeta_arith_vv | blex pow | ins_next1 |.if FPU | stfdx FARG1, BASE, RA |.else | stwux CARG1, RA, BASE | stw CARG2, 4(RA) |.endif | 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 |.if FPU | lfdx f0, BASE, SAVE0 // Copy result from RB to RA. | stfdx f0, BASE, RA |.else | lwzux TMP0, SAVE0, BASE | lwz TMP1, 4(SAVE0) | stwux TMP0, RA, BASE | stw TMP1, 4(RA) |.endif | 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 |.if FPU | lfdx f0, KBASE, RD | stfdx f0, BASE, RA |.else | lwzux TMP0, RD, KBASE | lwz TMP1, 4(RD) | stwux TMP0, RA, BASE | stw TMP1, 4(RA) |.endif | 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 |.if FPU | lfd f0, 0(TMP1) | stfdx f0, BASE, RA |.else | lwz TMP2, 0(TMP1) | lwz TMP3, 4(TMP1) | stwux TMP2, RA, BASE | stw TMP3, 4(RA) |.endif | 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) |.if FPU | lfdux f0, RD, BASE |.else | lwzux CARG1, RD, BASE | lwz CARG3, 4(RD) |.endif | 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) |.if FPU | stfd f0, 0(CARG2) |.else | stw CARG1, 0(CARG2) | stw CARG3, 4(CARG2) |.endif | 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) |.if FPU | lfdx f0, KBASE, RD |.else | lwzux TMP2, RD, KBASE | lwz TMP3, 4(RD) |.endif | lwzx UPVAL:RB, LFUNC:RB, RA | ins_next1 | lwz TMP1, UPVAL:RB->v |.if FPU | stfd f0, 0(TMP1) |.else | stw TMP2, 0(TMP1) | stw TMP3, 4(TMP1) |.endif | 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 |.if FPU | lfdx f14, TMP1, TMP2 |.else | lwzux SAVE0, TMP1, TMP2 | lwz SAVE1, 4(TMP1) |.endif | checknil TMP0; beq >2 |1: | ins_next1 |.if FPU | stfdx f14, BASE, RA |.else | stwux SAVE0, RA, BASE | stw SAVE1, 4(RA) |.endif | 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->sid | lwz NODE:TMP2, TAB:RB->node | and TMP1, TMP1, TMP0 // idx = str->sid & 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 |.if FPU | lwzx TMP1, TMP2, RC | lfdx f0, TMP2, RC |.else | lwzux TMP1, TMP2, RC | lwz TMP3, 4(TMP2) |.endif | checknil TMP1; beq >5 |1: | ins_next1 |.if FPU | stfdx f0, BASE, RA |.else | stwux TMP1, RA, BASE | stw TMP3, 4(RA) |.endif | 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_TGETR: | // RA = dst*8, RB = table*8, RC = key*8 | add RB, BASE, RB | lwz TAB:CARG1, 4(RB) |.if DUALNUM | add RC, BASE, RC | lwz TMP0, TAB:CARG1->asize | lwz CARG2, 4(RC) | lwz TMP1, TAB:CARG1->array |.else | lfdx f0, BASE, RC | lwz TMP0, TAB:CARG1->asize | toint CARG2, f0 | lwz TMP1, TAB:CARG1->array |.endif | cmplw TMP0, CARG2 | slwi TMP2, CARG2, 3 | ble ->vmeta_tgetr // In array part? |.if FPU | lfdx f14, TMP1, TMP2 |.else | lwzux SAVE0, TMP2, TMP1 | lwz SAVE1, 4(TMP2) |.endif |->BC_TGETR_Z: | ins_next1 |.if FPU | stfdx f14, BASE, RA |.else | stwux SAVE0, RA, BASE | stw SAVE1, 4(RA) |.endif | ins_next2 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 |.if FPU | lfdx f14, BASE, RA |.else | add SAVE1, BASE, RA | lwz SAVE0, 0(SAVE1) | lwz SAVE1, 4(SAVE1) |.endif | checknil TMP2; beq >3 |1: | andix. TMP2, TMP3, LJ_GC_BLACK // isblack(table) |.if FPU | stfdx f14, TMP1, TMP0 |.else | stwux SAVE0, TMP1, TMP0 | stw SAVE1, 4(TMP1) |.endif | 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->sid | lwz NODE:TMP2, TAB:RB->node | stb ZERO, TAB:RB->nomm // Clear metamethod cache. | and TMP1, TMP1, TMP0 // idx = str->sid & tab->hmask |.if FPU | lfdx f14, BASE, RA |.else | add CARG2, BASE, RA | lwz SAVE0, 0(CARG2) | lwz SAVE1, 4(CARG2) |.endif | 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) |.if FPU | stfd f14, NODE:TMP2->val |.else | stw SAVE0, NODE:TMP2->val.u32.hi | stw SAVE1, NODE:TMP2->val.u32.lo |.endif | 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 |.if FPU | stfd f14, 0(CRET1) |.else | stw SAVE0, 0(CRET1) | stw SAVE1, 4(CRET1) |.endif | 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 |.if FPU | lfdx f14, BASE, RA |.else | add CARG2, BASE, RA | lwz SAVE0, 0(CARG2) | lwz SAVE1, 4(CARG2) |.endif | bge ->vmeta_tsetb | lwzx TMP1, TMP2, RC | checknil TMP1; beq >5 |1: | andix. TMP0, TMP3, LJ_GC_BLACK // isblack(table) |.if FPU | stfdx f14, TMP2, RC |.else | stwux SAVE0, RC, TMP2 | stw SAVE1, 4(RC) |.endif | 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_TSETR: | // RA = dst*8, RB = table*8, RC = key*8 | add RB, BASE, RB | lwz TAB:CARG2, 4(RB) |.if DUALNUM | add RC, BASE, RC | lbz TMP3, TAB:CARG2->marked | lwz TMP0, TAB:CARG2->asize | lwz CARG3, 4(RC) | lwz TMP1, TAB:CARG2->array |.else | lfdx f0, BASE, RC | lbz TMP3, TAB:CARG2->marked | lwz TMP0, TAB:CARG2->asize | toint CARG3, f0 | lwz TMP1, TAB:CARG2->array |.endif | andix. TMP2, TMP3, LJ_GC_BLACK // isblack(table) | bne >7 |2: | cmplw TMP0, CARG3 | slwi TMP2, CARG3, 3 |.if FPU | lfdx f14, BASE, RA |.else | lwzux SAVE0, RA, BASE | lwz SAVE1, 4(RA) |.endif | ble ->vmeta_tsetr // In array part? | ins_next1 |.if FPU | stfdx f14, TMP1, TMP2 |.else | stwux SAVE0, TMP1, TMP2 | stw SAVE1, 4(TMP1) |.endif | ins_next2 | |7: // Possible table write barrier for the value. Skip valiswhite check. | barrierback TAB:CARG2, TMP3, TMP2 | 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. |.if FPU | lfd f0, 0(RA) |.else | lwz SAVE0, 0(RA) | lwz SAVE1, 4(RA) |.endif | addi RA, RA, 8 | cmpw cr1, RA, TMP2 |.if FPU | stfd f0, 0(TMP1) |.else | stw SAVE0, 0(TMP1) | stw SAVE1, 4(TMP1) |.endif | 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 |.if FPU | lfdx f0, RA, TMP2 |.else | add CARG3, RA, TMP2 | lwz CARG1, 0(CARG3) | lwz CARG2, 4(CARG3) |.endif | cmplw cr1, TMP3, NARGS8:RC |.if FPU | stfdx f0, BASE, TMP2 |.else | stwux CARG1, TMP2, BASE | stw CARG2, 4(TMP2) |.endif | 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) |.if FPU | lfd f1, -8(BASE) | lfd f0, -16(BASE) |.else | lwz CARG1, -8(BASE) | lwz CARG2, -4(BASE) | lwz CARG3, -16(BASE) | lwz CARG4, -12(BASE) |.endif | stw TMP1, 0(BASE) // Copy callable. | stw LFUNC:RB, 4(BASE) | checkfunc TMP1 | li NARGS8:RC, 16 // Iterators get 2 arguments. |.if FPU | stfd f1, 16(BASE) // Copy control var. | stfdu f0, 8(BASE) // Copy state. |.else | stw CARG1, 16(BASE) // Copy control var. | stw CARG2, 20(BASE) | stwu CARG3, 8(BASE) // Copy state. | stw CARG4, 4(BASE) |.endif | 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 on big-endian |.endif |->vm_IITERN: | 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 |.if FPU | lfdx f0, TMP1, TMP3 |.else | lwzux CARG1, TMP3, TMP1 | lwz CARG2, 4(TMP3) |.endif | 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) |.if FPU | stfd f0, 8(RA) |.else | stw CARG1, 8(RA) | stw CARG2, 12(RA) |.endif | 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 |.if FPU | lfdx f0, TMP2, TMP3 |.else | add CARG3, TMP2, TMP3 | lwz CARG1, 0(CARG3) | lwz CARG2, 4(CARG3) |.endif | add NODE:TMP3, TMP2, TMP3 | checknil RB | lwz INS, -4(PC) | beq >7 |.if FPU | lfd f1, NODE:TMP3->key |.else | lwz CARG3, NODE:TMP3->key.u32.hi | lwz CARG4, NODE:TMP3->key.u32.lo |.endif | addis TMP2, PC, -(BCBIAS_J*4 >> 16) |.if FPU | stfd f0, 8(RA) |.else | stw CARG1, 8(RA) | stw CARG2, 12(RA) |.endif | add RC, RC, TMP0 | decode_RD4 TMP1, INS |.if FPU | stfd f1, 0(RA) |.else | stw CARG3, 0(RA) | stw CARG4, 4(RA) |.endif | 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, (LJ_KEYINDEX >> 16) | ori TMP1, TMP1, (LJ_KEYINDEX & 0xffff) | 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) | // NYI on big-endian: unpatch JLOOP. | 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. |.if FPU | lfd f0, 0(RC) |.else | lwz CARG1, 0(RC) | lwz CARG2, 4(RC) |.endif | addi RC, RC, 8 |.if FPU | stfd f0, 0(RA) |.else | stw CARG1, 0(RA) | stw CARG2, 4(RA) |.endif | 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: |.if FPU | lfd f0, 0(RC) |.else | lwz CARG1, 0(RC) | lwz CARG2, 4(RC) |.endif | addi RC, RC, 8 |.if FPU | stfd f0, 0(RA) |.else | stw CARG1, 0(RA) | stw CARG2, 4(RA) |.endif | 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 |.if FPU | lfdx f0, RA, TMP1 |.else | add CARG3, RA, TMP1 | lwz CARG1, 0(CARG3) | lwz CARG2, 4(CARG3) |.endif | cmpw TMP3, RC |.if FPU | stfdx f0, TMP2, TMP1 |.else | add CARG3, TMP2, TMP1 | stw CARG1, 0(CARG3) | stw CARG2, 4(CARG3) |.endif | beq >3 | addi TMP1, TMP3, 8 |.if FPU | lfdx f1, RA, TMP3 |.else | add CARG3, RA, TMP3 | lwz CARG1, 0(CARG3) | lwz CARG2, 4(CARG3) |.endif | cmpw TMP1, RC |.if FPU | stfdx f1, TMP2, TMP3 |.else | add CARG3, TMP2, TMP3 | stw CARG1, 0(CARG3) | stw CARG2, 4(CARG3) |.endif | 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) { |.if FPU | lfd f0, 0(RA) | stfd f0, 0(TMP2) |.else | lwz CARG1, 0(RA) | lwz CARG2, 4(RA) | stw CARG1, 0(TMP2) | stw CARG2, 4(TMP2) |.endif } |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 SAVE0, 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, SAVE0, 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. |.if FPU | lfd f1, FORL_IDX*8(RA) |.else | lwz CARG1, FORL_IDX*8(RA) | lwz CARG2, FORL_IDX*8+4(RA) |.endif |.else | lfdux f1, RA, BASE |.endif |.if FPU | lfd f3, FORL_STEP*8(RA) | lfd f2, FORL_STOP*8(RA) | fadd f1, f1, f3 | stfd f1, FORL_IDX*8(RA) |.else | lwz CARG3, FORL_STEP*8(RA) | lwz CARG4, FORL_STEP*8+4(RA) | mr SAVE1, RD | blex __adddf3 | mr RD, SAVE1 | stw CRET1, FORL_IDX*8(RA) | stw CRET2, FORL_IDX*8+4(RA) | lwz CARG3, FORL_STOP*8(RA) | lwz CARG4, FORL_STOP*8+4(RA) |.endif | lwz SAVE0, FORL_STEP*8(RA) } else { |.if DUALNUM |9: // FP loop. |.else | lwzux TMP1, RA, BASE | lwz SAVE0, FORL_STEP*8(RA) | lwz TMP2, FORL_STOP*8(RA) | cmplw cr0, TMP1, TISNUM | cmplw cr7, SAVE0, TISNUM | cmplw cr1, TMP2, TISNUM |.endif |.if FPU | lfd f1, FORL_IDX*8(RA) |.else | lwz CARG1, FORL_IDX*8(RA) | lwz CARG2, FORL_IDX*8+4(RA) |.endif | crand 4*cr0+lt, 4*cr0+lt, 4*cr7+lt | crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt |.if FPU | lfd f2, FORL_STOP*8(RA) |.else | lwz CARG3, FORL_STOP*8(RA) | lwz CARG4, FORL_STOP*8+4(RA) |.endif | bge ->vmeta_for } | cmpwi cr6, SAVE0, 0 if (op != BC_JFORL) { | srwi RD, RD, 1 } |.if FPU | stfd f1, FORL_EXT*8(RA) |.else | stw CARG1, FORL_EXT*8(RA) | stw CARG2, FORL_EXT*8+4(RA) |.endif if (op != BC_JFORL) { | add RD, PC, RD } |.if FPU | fcmpu cr0, f1, f2 |.else | mr SAVE1, RD | blex __ledf2 | cmpwi CRET1, 0 | mr RD, SAVE1 |.endif 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 | addi JGL, DISPATCH, GG_DISP2G+32768 | stw L, DISPATCH_GL(tmpbuf.L)(DISPATCH) | 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. | stw L, DISPATCH_GL(cur_L)(DISPATCH) | 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; } } subprojects/luajit/src/lj_state.h0000644000175000017500000000236314741067622016461 0ustar aniolaniol/* ** State and stack handling. ** Copyright (C) 2005-2023 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); LJ_FUNC int LJ_FASTCALL lj_state_cpgrowstack(lua_State *L, MSize need); 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_GC64 && !(defined(LUAJIT_USE_VALGRIND) && defined(LUAJIT_USE_SYSMALLOC)) LJ_FUNC lua_State *lj_state_newstate(lua_Alloc f, void *ud); #endif #define LJ_ALLOCF_INTERNAL ((lua_Alloc)(void *)(uintptr_t)(1237<<4)) #endif subprojects/luajit/src/luajit_rolling.h0000644000175000017500000000576114741067622017677 0ustar aniolaniol/* ** LuaJIT -- a Just-In-Time Compiler for Lua. https://luajit.org/ ** ** Copyright (C) 2005-2023 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: https://www.opensource.org/licenses/mit-license.php ] */ #ifndef _LUAJIT_H #define _LUAJIT_H #include "lua.h" #define LUAJIT_VERSION "LuaJIT 2.1.ROLLING" #define LUAJIT_VERSION_NUM 20199 /* Deprecated. */ #define LUAJIT_VERSION_SYM luaJIT_version_2_1_ROLLING #define LUAJIT_COPYRIGHT "Copyright (C) 2005-2023 Mike Pall" #define LUAJIT_URL "https://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); /* Low-overhead profiling API. */ typedef void (*luaJIT_profile_callback)(void *data, lua_State *L, int samples, int vmstate); LUA_API void luaJIT_profile_start(lua_State *L, const char *mode, luaJIT_profile_callback cb, void *data); LUA_API void luaJIT_profile_stop(lua_State *L); LUA_API const char *luaJIT_profile_dumpstack(lua_State *L, const char *fmt, int depth, size_t *len); /* Enforce (dynamic) linker error for version mismatches. Call from main. */ LUA_API void LUAJIT_VERSION_SYM(void); #error "DO NOT USE luajit_rolling.h -- only include build-generated luajit.h" #endif subprojects/luajit/src/lj_cconv.c0000644000175000017500000006162014741067622016445 0ustar aniolaniol/* ** C type conversions. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #include "lj_obj.h" #if LJ_HASFFI #include "lj_err.h" #include "lj_buf.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; lj_assertCTS(!ctype_isenum(dinfo) && !ctype_isenum(sinfo), "unresolved enum"); lj_assertCTS(!ctype_isattrib(dinfo) && !ctype_isattrib(sinfo), "unstripped attribute"); if (ctype_type(dinfo) > CT_MAYCONVERT || ctype_type(sinfo) > CT_MAYCONVERT) goto err_conv; /* Some basic sanity checks. */ lj_assertCTS(!ctype_isnum(dinfo) || dsize > 0, "bad size for number type"); lj_assertCTS(!ctype_isnum(sinfo) || ssize > 0, "bad size for number type"); lj_assertCTS(!ctype_isbool(dinfo) || dsize == 1 || dsize == 4, "bad size for bool type"); lj_assertCTS(!ctype_isbool(sinfo) || ssize == 1 || ssize == 4, "bad size for bool type"); lj_assertCTS(!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. */ lj_assertCTS(dsize == ssize, "value copy with different sizes"); 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. */ lj_assertCTS(tvisnum(o), "non-canonical NaN passed"); } } 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; lj_assertCTS(sz != CTSIZE_INVALID, "value copy with invalid size"); /* 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; lj_assertCTS(ctype_isbitfield(info), "bitfield expected"); /* 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: lj_assertCTS(0, "bad bitfield container size %d", ctype_bitcsz(info)); val = 0; break; } /* Check if a packed bitfield crosses a container boundary. */ pos = ctype_bitpos(info); bsz = ctype_bitbsz(info); lj_assertCTS(pos < 8*ctype_bitcsz(info), "bad bitfield position"); lj_assertCTS(bsz > 0 && bsz <= 8*ctype_bitcsz(info), "bad bitfield size"); 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 { uint32_t b = (val >> pos) & 1; lj_assertCTS(bsz == 1, "bad bool bitfield size"); setboolV(o, b); setboolV(&cts->g->tmptv2, b); /* Remember for trace recorder. */ } 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. */ lj_assertCTS(s->size == CTSIZE_PTR, "ref is not pointer-sized"); sp = *(void **)sp; sid = ctype_cid(s->info); } s = ctype_raw(cts, sid); if (ctype_isfunc(s->info)) { CTypeID did = ctype_typeid(cts, d); sid = lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|sid), CTSIZE_PTR); d = ctype_get(cts, did); /* cts->tab may have been reallocated. */ } 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; lj_assertCTS(d->size == 4, "only 32 bit enum supported"); /* NYI */ 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 (ud->udtype == UDTYPE_BUFFER) tmpptr = ((SBufExt *)tmpptr)->r; } else if (tvislightud(o)) { tmpptr = lightudV(cts->g, 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; lj_assertCTS(ctype_isbitfield(info), "bitfield expected"); if ((info & CTF_BOOL)) { uint8_t tmpbool; lj_assertCTS(ctype_bitbsz(info) == 1, "bad bool bitfield size"); 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); lj_assertCTS(pos < 8*ctype_bitcsz(info), "bad bitfield position"); lj_assertCTS(bsz > 0 && bsz <= 8*ctype_bitcsz(info), "bad bitfield size"); /* 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: lj_assertCTS(0, "bad bitfield container size %d", ctype_bitcsz(info)); 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 subprojects/luajit/src/lj_asm_x86.h0000644000175000017500000031551114741067622016630 0ustar aniolaniol/* ** x86/x64 IR assembler (SSA IR -> machine code). ** Copyright (C) 2005-2023 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); #if !LJ_GC64 /* 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; #endif /* Jump to exit handler which fills in the ExitState. */ *mxp++ = XI_JMP; mxp += 4; *((int32_t *)(mxp-4)) = jmprel(as->J, 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(as->J, p+5, target); target = p; cc ^= 1; if (as->realign) { if (LJ_GC64 && LJ_UNLIKELY(as->mrm.base == RID_RIP)) as->mrm.ofs += 2; /* Fixup RIP offset for pending fused load. */ emit_sjcc(as, cc, target); return; } } if (LJ_GC64 && LJ_UNLIKELY(as->mrm.base == RID_RIP)) as->mrm.ofs += 6; /* Fixup RIP offset for pending fused load. */ 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 LJ_GC64 if (ir->o == IR_KNULL || !irt_is64(ir->t)) { *k = ir->i; return 1; } else if (checki32((int64_t)ir_k64(ir)->u64)) { *k = (int32_t)ir_k64(ir)->u64; return 1; } #else 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; } #endif } 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 check) { 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 ((check & 1) && (ir[i].o == IR_NEWREF || ir[i].o == IR_CALLS)) return 0; else if ((check & 2) && (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); lj_assertA(irb->op2 == IRFL_TAB_ARRAY, "expected FLOAD 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, 0)) { 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). */ IRIns *irk = IR(irb->op2); as->mrm.ofs = irk->o == IR_KINT ? irk->i : (int32_t)ir_kint64(irk)->u64; 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; lj_assertA(ir->o == IR_AREF, "expected 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; #if LJ_GC64 int64_t ofs = dispofs(as, &uv->tv); if (checki32(ofs) && checki32(ofs+4)) { as->mrm.ofs = (int32_t)ofs; as->mrm.base = RID_DISPATCH; as->mrm.idx = RID_NONE; return; } #else as->mrm.ofs = ptr2addr(&uv->tv); as->mrm.base = as->mrm.idx = RID_NONE; return; #endif } break; case IR_TMPREF: #if LJ_GC64 as->mrm.ofs = (int32_t)dispofs(as, &J2G(as->J)->tmptv); as->mrm.base = RID_DISPATCH; as->mrm.idx = RID_NONE; #else as->mrm.ofs = igcptr(&J2G(as->J)->tmptv); as->mrm.base = as->mrm.idx = RID_NONE; #endif return; default: 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) { lj_assertA(ir->o == IR_FLOAD || ir->o == IR_FREF, "bad IR op %d", ir->o); as->mrm.idx = RID_NONE; if (ir->op1 == REF_NIL) { /* FLOAD from GG_State with offset. */ #if LJ_GC64 as->mrm.ofs = (int32_t)(ir->op2 << 2) - GG_OFS(dispatch); as->mrm.base = RID_DISPATCH; #else as->mrm.ofs = (int32_t)(ir->op2 << 2) + ptr2addr(J2GG(as->J)); as->mrm.base = RID_NONE; #endif return; } as->mrm.ofs = field_ofs[ir->op2]; if (irref_isk(ir->op1)) { IRIns *op1 = IR(ir->op1); #if LJ_GC64 if (ir->op1 == REF_NIL) { as->mrm.ofs -= GG_OFS(dispatch); as->mrm.base = RID_DISPATCH; return; } else if (op1->o == IR_KPTR || op1->o == IR_KKPTR) { intptr_t ofs = dispofs(as, ir_kptr(op1)); if (checki32(as->mrm.ofs + ofs)) { as->mrm.ofs += (int32_t)ofs; as->mrm.base = RID_DISPATCH; return; } } #else as->mrm.ofs += op1->i; as->mrm.base = RID_NONE; return; #endif } 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; lj_assertA(ir->o == IR_STRREF, "bad IR op %d", ir->o); as->mrm.base = as->mrm.idx = RID_NONE; as->mrm.scale = XM_SCALE1; as->mrm.ofs = sizeof(GCstr); if (!LJ_GC64 && 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) { #if LJ_GC64 intptr_t ofs = dispofs(as, ir_kptr(ir)); if (checki32(ofs)) { as->mrm.ofs = (int32_t)ofs; as->mrm.base = RID_DISPATCH; return; } } if (0) { #else as->mrm.ofs = ir->i; as->mrm.base = RID_NONE; } else if (ir->o == IR_STRREF) { asm_fusestrref(as, ir, allow); #endif } 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 of 64 bit IR constant into memory operand. */ static Reg asm_fuseloadk64(ASMState *as, IRIns *ir) { const uint64_t *k = &ir_k64(ir)->u64; if (!LJ_GC64 || checki32((intptr_t)k)) { as->mrm.ofs = ptr2addr(k); as->mrm.base = RID_NONE; #if LJ_GC64 } else if (checki32(dispofs(as, k))) { as->mrm.ofs = (int32_t)dispofs(as, k); as->mrm.base = RID_DISPATCH; } else if (checki32(mcpofs(as, k)) && checki32(mcpofs(as, k+1)) && checki32(mctopofs(as, k)) && checki32(mctopofs(as, k+1))) { as->mrm.ofs = (int32_t)mcpofs(as, k); as->mrm.base = RID_RIP; } else { /* Intern 64 bit constant at bottom of mcode. */ if (ir->i) { lj_assertA(*k == *(uint64_t*)(as->mctop - ir->i), "bad interned 64 bit constant"); } else { while ((uintptr_t)as->mcbot & 7) *as->mcbot++ = XI_INT3; *(uint64_t*)as->mcbot = *k; ir->i = (int32_t)(as->mctop - as->mcbot); as->mcbot += 8; as->mclim = as->mcbot + MCLIM_REDZONE; lj_mcode_commitbot(as->J, as->mcbot); } as->mrm.ofs = (int32_t)mcpofs(as, as->mctop - ir->i); as->mrm.base = RID_RIP; #endif } as->mrm.idx = RID_NONE; return RID_MRM; } /* Fuse load into memory operand. ** ** Important caveat: this may emit RIP-relative loads! So don't place any ** code emitters between this function and the use of its result. ** The only permitted exception is asm_guardcc(). */ 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; lj_assertA(allow != RSET_EMPTY, "no register allowed"); if (!(avail & (avail-1))) /* Fuse if less than two regs available. */ return asm_fuseloadk64(as, ir); } else if (ref == REF_BASE || ir->o == IR_KINT64) { RegSet avail = as->freeset & ~as->modset & RSET_GPR; lj_assertA(allow != RSET_EMPTY, "no register allowed"); if (!(avail & (avail-1))) { /* Fuse if less than two regs available. */ if (ref == REF_BASE) { #if LJ_GC64 as->mrm.ofs = (int32_t)dispofs(as, &J2G(as->J)->jit_base); as->mrm.base = RID_DISPATCH; #else as->mrm.ofs = ptr2addr(&J2G(as->J)->jit_base); as->mrm.base = RID_NONE; #endif as->mrm.idx = RID_NONE; return RID_MRM; } else { return asm_fuseloadk64(as, ir); } } } 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, 2) && !(LJ_GC64 && irt_isaddr(ir->t))) { as->mrm.base = (uint8_t)ra_alloc1(as, REF_BASE, xallow); as->mrm.ofs = 8*((int32_t)ir->op1-1-LJ_FR2) + (!LJ_FR2 && (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, 2)) { 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, 2+(ir->o != IR_ULOAD)) && !(LJ_GC64 && irt_isaddr(ir->t))) { 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, 2)) { asm_fusexref(as, ir->op1, xallow); return RID_MRM; } } else if (ir->o == IR_VLOAD && IR(ir->op1)->o == IR_AREF && !(LJ_GC64 && irt_isaddr(ir->t))) { asm_fuseahuref(as, ir->op1, xallow); as->mrm.ofs += 8 * ir->op2; return RID_MRM; } } if (ir->o == IR_FLOAD && ir->op1 == REF_NIL) { asm_fusefref(as, ir, RSET_EMPTY); 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_XNARGS(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_XNARGS(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 (LJ_GC64 ? !(ir->o == IR_KINT || ir->o == IR_KNULL) : ir->o == IR_KINT64) emit_loadu64(as, r, ir_k64(ir)->u64); else #endif emit_loadi(as, r, ir->i); } else { /* Must have been evicted. */ lj_assertA(rset_test(as->freeset, r), "reg %d not free", r); 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. */ lj_assertA(!(irt_isfloat(ir->t) && irref_isk(ref)), "unexpected float constant"); 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 = ((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) ? XO_MOVSD : 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 } else if (hiop) { ra_destpair(as, ir); } else { lj_assertA(!irt_ispri(ir->t), "PRI dest"); 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. */ } } /* 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); #if LJ_FR2 Reg rpc = ra_scratch(as, rset_exclude(RSET_GPR, base)); #endif void *pc = ir_kptr(IR(ir->op2)); int32_t delta = 1+LJ_FR2+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); #if LJ_FR2 emit_rmro(as, XO_CMP, rpc|REX_GC64, base, -8); emit_loadu64(as, rpc, u64ptr(pc)); #else emit_gmroi(as, XG_ARITHi(XOg_CMP), base, -4, ptr2addr(pc)); #endif } /* -- Buffer operations --------------------------------------------------- */ #if LJ_HASBUFFER static void asm_bufhdr_write(ASMState *as, Reg sb) { Reg tmp = ra_scratch(as, rset_exclude(RSET_GPR, sb)); IRIns irgc; irgc.ot = IRT(0, IRT_PGC); /* GC type. */ emit_storeofs(as, &irgc, tmp, sb, offsetof(SBuf, L)); emit_opgl(as, XO_ARITH(XOg_OR), tmp|REX_GC64, cur_L); emit_gri(as, XG_ARITHi(XOg_AND), tmp, SBUF_MASK_FLAG); emit_loadofs(as, &irgc, tmp, sb, offsetof(SBuf, L)); } #endif /* -- 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); emit_rr(as, XO_XORPS, tmp, tmp); /* Avoid partial register stall. */ checkmclim(as); 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; emit_rr(as, XO_MOVDto, tmp, dest); right = asm_fuseload(as, ir->op2, rset_exclude(RSET_FPR, tmp)); 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; lj_assertA(irt_type(ir->t) != st, "inconsistent types for CONV"); lj_assertA(!(LJ_32 && (irt_isint64(ir->t) || st64)), "IR %04d has unsplit 64 bit type", (int)(ir - as->ir) - REF_BIAS); 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 = &as->J->k64[LJ_K64_TOBIT]; 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_rma(as, XO_MOVSD, bias, k); checkmclim(as); 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); cTValue *k = &as->J->k64[LJ_K64_2P64]; 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); } 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. */ lj_assertA(irt_isint(ir->t) && st == IRT_NUM, "bad type for checked CONV"); asm_tointg(as, ir, ra_alloc1(as, lref, RSET_FPR)); } else { Reg dest = ra_dest(as, ir, RSET_GPR); x86Op op = st == IRT_NUM ? XO_CVTTSD2SI : XO_CVTTSS2SI; 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, &as->J->k64[LJ_K64_M2P64_31]); else emit_rma(as, XO_ADDSS, tmp, &as->J->k32[LJ_K32_M2P64_31]); 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 { 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), asm_fuseload(as, lref, RSET_FPR)); } } } 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; lj_assertA(irt_isint(ir->t) || irt_isu32(ir->t), "bad type for CONV EXT"); 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 && !(ir->op2 & IRCONV_NONE)) { 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) ? XO_MOVSD : 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, &as->J->k64[LJ_K64_2P64]); emit_sjcc(as, CC_NS, l_end); emit_rr(as, XO_TEST, hi, hi); /* Check if u64 >= 2^63. */ } else { lj_assertA(((ir-1)->op2 & IRCONV_SRCMASK) == IRT_I64, "bad type for CONV"); } 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; lj_assertA(st == IRT_NUM || st == IRT_FLOAT, "bad type for CONV"); lj_assertA(dt == IRT_I64 || dt == IRT_U64, "bad type for CONV"); 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, &as->J->k64[LJ_K64_M2P64]); 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)); } static void asm_conv64(ASMState *as, IRIns *ir) { if (irt_isfp(ir->t)) asm_conv_fp_int64(as, ir); else asm_conv_int64_fp(as, ir); } #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)); } /* -- Memory references --------------------------------------------------- */ /* Get pointer to TValue. */ static void asm_tvptr(ASMState *as, Reg dest, IRRef ref, MSize mode) { if ((mode & IRTMPREF_IN1)) { IRIns *ir = IR(ref); if (irt_isnum(ir->t)) { if (irref_isk(ref) && !(mode & IRTMPREF_OUT1)) { /* Use the number constant itself as a TValue. */ emit_loada(as, dest, ir_knum(ir)); return; } emit_rmro(as, XO_MOVSDto, ra_alloc1(as, ref, RSET_FPR), dest, 0); } else { #if LJ_GC64 if (irref_isk(ref)) { TValue k; lj_ir_kvalue(as->J->L, &k, ir); emit_movmroi(as, dest, 4, k.u32.hi); emit_movmroi(as, dest, 0, k.u32.lo); } else { /* TODO: 64 bit store + 32 bit load-modify-store is suboptimal. */ Reg src = ra_alloc1(as, ref, rset_exclude(RSET_GPR, dest)); if (irt_is64(ir->t)) { emit_u32(as, irt_toitype(ir->t) << 15); emit_rmro(as, XO_ARITHi, XOg_OR, dest, 4); } else { emit_movmroi(as, dest, 4, (irt_toitype(ir->t) << 15)); } emit_movtomro(as, REX_64IR(ir, src), dest, 0); } #else if (!irref_isk(ref)) { Reg src = ra_alloc1(as, ref, rset_exclude(RSET_GPR, dest)); emit_movtomro(as, REX_64IR(ir, src), dest, 0); } else if (!irt_ispri(ir->t)) { emit_movmroi(as, dest, 0, ir->i); } if (!(LJ_64 && irt_islightud(ir->t))) emit_movmroi(as, dest, 4, irt_toitype(ir->t)); #endif } } emit_loada(as, dest, &J2G(as->J)->tmptv); /* g->tmptv holds the TValue(s). */ } 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|REX_GC64, RID_MRM); else if (as->mrm.base != dest) emit_rr(as, XO_MOV, dest|REX_GC64, as->mrm.base); } /* 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, 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 (LJ_GC64 || !irt_isstr(kt)) tmp = ra_scratch(as, rset_exclude(allow, key)); } /* Key not found in chain: jump to exit (if merged) or load niltv. */ l_end = emit_label(as); if (merge == IR_NE) asm_guardcc(as, CC_E); /* XI_JMP is not found by lj_asm_patchexit. */ else if (destused) 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|REX_GC64, dest); emit_rmro(as, XO_MOV, dest|REX_GC64, dest, offsetof(Node, next)); l_next = emit_label(as); /* Type and value comparison. */ if (merge == IR_EQ) asm_guardcc(as, CC_E); else emit_sjcc(as, CC_E, l_end); checkmclim(as); 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 && !LJ_GC64 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 && !LJ_GC64 } else if (irt_islightud(kt)) { emit_rmro(as, XO_CMP, key|REX_64, dest, offsetof(Node, key.u64)); #endif #if LJ_GC64 } else if (irt_isaddr(kt)) { if (isk) { TValue k; k.u64 = ((uint64_t)irt_toitype(irkey->t) << 47) | irkey[1].tv.u64; emit_gmroi(as, XG_ARITHi(XOg_CMP), dest, offsetof(Node, key.u32.lo), k.u32.lo); emit_sjcc(as, CC_NE, l_next); emit_gmroi(as, XG_ARITHi(XOg_CMP), dest, offsetof(Node, key.u32.hi), k.u32.hi); } else { emit_rmro(as, XO_CMP, tmp|REX_64, dest, offsetof(Node, key.u64)); } } else { lj_assertA(irt_ispri(kt) && !irt_isnil(kt), "bad HREF key type"); emit_u32(as, (irt_toitype(kt)<<15)|0x7fff); emit_rmro(as, XO_ARITHi, XOg_CMP, dest, offsetof(Node, key.it)); #else } else { if (!irt_ispri(kt)) { lj_assertA(irt_isaddr(kt), "bad HREF key type"); 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); } lj_assertA(!irt_isnil(kt), "bad HREF key type"); emit_i8(as, irt_toitype(kt)); emit_rmro(as, XO_ARITHi8, XOg_CMP, dest, offsetof(Node, key.it)); #endif } emit_sfixup(as, l_loop); #if LJ_GC64 if (!isk && irt_isaddr(kt)) { emit_rr(as, XO_OR, tmp|REX_64, key); emit_loadu64(as, tmp, (uint64_t)irt_toitype(kt) << 47); } #endif /* Load main position relative to tab->node into dest. */ khash = isk ? ir_khash(as, irkey) : 1; if (khash == 0) { emit_rmro(as, XO_MOV, dest|REX_GC64, tab, offsetof(GCtab, node)); } else { emit_rmro(as, XO_ARITH(XOg_ADD), dest|REX_GC64, tab, offsetof(GCtab,node)); 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, sid)); 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); checkmclim(as); 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); #if LJ_GC64 emit_gri(as, XG_ARITHi(XOg_XOR), dest, irt_toitype(kt) << 15); if ((as->flags & JIT_F_BMI2)) { emit_i8(as, 32); emit_mrm(as, XV_RORX|VEX_64, dest, key); } else { emit_shifti(as, XOg_SHR|REX_64, dest, 32); emit_rr(as, XO_MOV, dest|REX_64, key|REX_64); } #else emit_rmro(as, XO_LEA, dest, key, HASH_BIAS); #endif } } } } 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 lj_assertA(ofs % sizeof(Node) == 0, "unaligned HREFK slot"); if (ra_hasreg(dest)) { if (ofs != 0) { if (dest == node) emit_gri(as, XG_ARITHi(XOg_ADD), dest|REX_GC64, ofs); else emit_rmro(as, XO_LEA, dest|REX_GC64, node, ofs); } else if (dest != node) { emit_rr(as, XO_MOV, dest|REX_GC64, 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)); lj_assertA(irt_isnum(irkey->t) || irt_isgcv(irkey->t), "bad HREFK key type"); /* Assumes -0.0 is already canonicalized to +0.0. */ emit_loadu64(as, key, irt_isnum(irkey->t) ? ir_knum(irkey)->u64 : #if LJ_GC64 ((uint64_t)irt_toitype(irkey->t) << 47) | (uint64_t)ir_kgc(irkey)); #else ((uint64_t)irt_toitype(irkey->t) << 32) | (uint64_t)(uint32_t)ptr2addr(ir_kgc(irkey))); #endif } else { lj_assertA(!irt_isnil(irkey->t), "bad HREFK key type"); #if LJ_GC64 emit_i32(as, (irt_toitype(irkey->t)<<15)|0x7fff); emit_rmro(as, XO_ARITHi, XOg_CMP, node, ofs + (int32_t)offsetof(Node, key.it)); #else emit_i8(as, irt_toitype(irkey->t)); emit_rmro(as, XO_ARITHi8, XOg_CMP, node, ofs + (int32_t)offsetof(Node, key.it)); #endif } #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)) { lj_assertA(irt_isgcv(irkey->t), "bad HREFK key type"); 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); } lj_assertA(!irt_isnil(irkey->t), "bad HREFK key type"); 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_uref(ASMState *as, IRIns *ir) { Reg dest = ra_dest(as, ir, RSET_GPR); int guarded = (irt_t(ir->t) & (IRT_GUARD|IRT_TYPE)) == (IRT_GUARD|IRT_PGC); if (irref_isk(ir->op1) && !guarded) { GCfunc *fn = ir_kfunc(IR(ir->op1)); MRef *v = &gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.v; emit_rma(as, XO_MOV, dest|REX_GC64, v); } else { Reg uv = ra_scratch(as, RSET_GPR); if (ir->o == IR_UREFC) emit_rmro(as, XO_LEA, dest|REX_GC64, uv, offsetof(GCupval, tv)); else emit_rmro(as, XO_MOV, dest|REX_GC64, uv, offsetof(GCupval, v)); if (guarded) { asm_guardcc(as, ir->o == IR_UREFC ? CC_E : CC_NE); emit_i8(as, 0); emit_rmro(as, XO_ARITHib, XOg_CMP, uv, offsetof(GCupval, closed)); } if (irref_isk(ir->op1)) { GCfunc *fn = ir_kfunc(IR(ir->op1)); GCobj *o = gcref(fn->l.uvptr[(ir->op2 >> 8)]); emit_loada(as, uv, o); } else { emit_rmro(as, XO_MOV, uv|REX_GC64, ra_alloc1(as, ir->op1, RSET_GPR), (int32_t)offsetof(GCfuncL, uvptr) + (int32_t)sizeof(MRef) * (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|REX_GC64, as->mrm.ofs); else emit_mrm(as, XO_LEA, dest|REX_GC64, 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 = XO_MOVSD; break; case IRT_FLOAT: xo = XO_MOVSS; break; default: if (LJ_64 && irt_is64(ir->t)) dest |= REX_64; else lj_assertA(irt_isint(ir->t) || irt_isu32(ir->t) || irt_isaddr(ir->t), "unsplit 64 bit load"); xo = XO_MOV; break; } emit_mrm(as, xo, dest, RID_MRM); } #define asm_fload(as, ir) asm_fxload(as, ir) #define asm_xload(as, ir) asm_fxload(as, ir) 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 && !LJ_GC64 case IRT_LIGHTUD: /* NYI: mask 64 bit lightuserdata. */ lj_assertA(0, "store of lightuserdata"); #endif default: if (LJ_64 && irt_is64(ir->t)) src |= REX_64; else lj_assertA(irt_isint(ir->t) || irt_isu32(ir->t) || irt_isaddr(ir->t), "unsplit 64 bit store"); 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 { lj_assertA(irt_is64(ir->t) || irt_isint(ir->t) || irt_isu32(ir->t) || irt_isaddr(ir->t), "bad store type"); emit_i32(as, k); emit_mrm(as, XO_MOVmi, REX_64IR(ir, 0), RID_MRM); } } } #define asm_fstore(as, ir) asm_fxstore(as, ir) #define asm_xstore(as, ir) asm_fxstore(as, ir) #if LJ_64 && !LJ_GC64 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) { #if LJ_GC64 Reg tmp = RID_NONE; #endif lj_assertA(irt_isnum(ir->t) || irt_ispri(ir->t) || irt_isaddr(ir->t) || (LJ_DUALNUM && irt_isint(ir->t)), "bad load type %d", irt_type(ir->t)); #if LJ_64 && !LJ_GC64 if (irt_islightud(ir->t)) { Reg dest = asm_load_lightud64(as, ir, 1); if (ra_hasreg(dest)) { checkmclim(as); asm_fuseahuref(as, ir->op1, RSET_GPR); if (ir->o == IR_VLOAD) as->mrm.ofs += 8 * ir->op2; 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); if (ir->o == IR_VLOAD) as->mrm.ofs += 8 * ir->op2; #if LJ_GC64 if (irt_isaddr(ir->t)) { emit_shifti(as, XOg_SHR|REX_64, dest, 17); asm_guardcc(as, CC_NE); emit_i8(as, irt_toitype(ir->t)); emit_rr(as, XO_ARITHi8, XOg_CMP, dest); emit_i8(as, XI_O16); if ((as->flags & JIT_F_BMI2)) { emit_i8(as, 47); emit_mrm(as, XV_RORX|VEX_64, dest, RID_MRM); } else { emit_shifti(as, XOg_ROR|REX_64, dest, 47); emit_mrm(as, XO_MOV, dest|REX_64, RID_MRM); } return; } else #endif emit_mrm(as, dest < RID_MAX_GPR ? XO_MOV : XO_MOVSD, dest, RID_MRM); } else { RegSet gpr = RSET_GPR; #if LJ_GC64 if (irt_isaddr(ir->t)) { tmp = ra_scratch(as, RSET_GPR); gpr = rset_exclude(gpr, tmp); } #endif asm_fuseahuref(as, ir->op1, gpr); if (ir->o == IR_VLOAD) as->mrm.ofs += 8 * ir->op2; } /* 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) { lj_assertA(irt_isinteger(ir->t) || irt_isnum(ir->t), "bad load type %d", irt_type(ir->t)); checkmclim(as); #if LJ_GC64 emit_u32(as, LJ_TISNUM << 15); #else emit_u32(as, LJ_TISNUM); #endif emit_mrm(as, XO_ARITHi, XOg_CMP, RID_MRM); #if LJ_GC64 } else if (irt_isaddr(ir->t)) { as->mrm.ofs -= 4; emit_i8(as, irt_toitype(ir->t)); emit_mrm(as, XO_ARITHi8, XOg_CMP, tmp); emit_shifti(as, XOg_SAR|REX_64, tmp, 47); emit_mrm(as, XO_MOV, tmp|REX_64, RID_MRM); } else if (irt_isnil(ir->t)) { as->mrm.ofs -= 4; emit_i8(as, -1); emit_mrm(as, XO_ARITHi8, XOg_CMP|REX_64, RID_MRM); } else { emit_u32(as, (irt_toitype(ir->t) << 15) | 0x7fff); emit_mrm(as, XO_ARITHi, XOg_CMP, RID_MRM); #else } else { emit_i8(as, irt_toitype(ir->t)); emit_mrm(as, XO_ARITHi8, XOg_CMP, RID_MRM); #endif } } 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 && !LJ_GC64 } 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 #if LJ_GC64 } else if (irref_isk(ir->op2)) { TValue k; lj_ir_kvalue(as->J->L, &k, IR(ir->op2)); asm_fuseahuref(as, ir->op1, RSET_GPR); if (tvisnil(&k)) { emit_i32(as, -1); emit_mrm(as, XO_MOVmi, REX_64, RID_MRM); } else { emit_u32(as, k.u32.lo); emit_mrm(as, XO_MOVmi, 0, RID_MRM); as->mrm.ofs += 4; emit_u32(as, k.u32.hi); emit_mrm(as, XO_MOVmi, 0, 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)) { #if LJ_GC64 if (!(LJ_DUALNUM && irt_isinteger(ir->t))) { /* TODO: 64 bit store + 32 bit load-modify-store is suboptimal. */ as->mrm.ofs += 4; emit_u32(as, irt_toitype(ir->t) << 15); emit_mrm(as, XO_ARITHi, XOg_OR, RID_MRM); as->mrm.ofs -= 4; emit_mrm(as, XO_MOVto, src|REX_64, RID_MRM); return; } #endif emit_mrm(as, XO_MOVto, src, RID_MRM); } else if (!irt_ispri(irr->t)) { lj_assertA(irt_isaddr(ir->t) || (LJ_DUALNUM && irt_isinteger(ir->t)), "bad store type"); emit_i32(as, irr->i); emit_mrm(as, XO_MOVmi, 0, RID_MRM); } as->mrm.ofs += 4; #if LJ_GC64 lj_assertA(LJ_DUALNUM && irt_isinteger(ir->t), "bad store type"); emit_i32(as, LJ_TNUMX << 15); #else emit_i32(as, (int32_t)irt_toitype(ir->t)); #endif 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-LJ_FR2) + (!LJ_FR2 && (ir->op2 & IRSLOAD_FRAME) ? 4 : 0); IRType1 t = ir->t; Reg base; lj_assertA(!(ir->op2 & IRSLOAD_PARENT), "bad parent SLOAD"); /* Handled by asm_head_side(). */ lj_assertA(irt_isguard(t) || !(ir->op2 & IRSLOAD_TYPECHECK), "inconsistent SLOAD variant"); lj_assertA(LJ_DUALNUM || !irt_isint(t) || (ir->op2 & (IRSLOAD_CONVERT|IRSLOAD_FRAME|IRSLOAD_KEYINDEX)), "bad SLOAD type"); 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, XO_MOVSD, left, base, ofs); t.irt = IRT_NUM; /* Continue with a regular number type check. */ #if LJ_64 && !LJ_GC64 } 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); lj_assertA(irt_isnum(t) || irt_isint(t) || irt_isaddr(t), "bad SLOAD type %d", irt_type(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_CVTTSD2SI, dest, base, ofs); } else { #if LJ_GC64 if (irt_isaddr(t)) { /* LJ_GC64 type check + tag removal without BMI2 and with BMI2: ** ** mov r64, [addr] rorx r64, [addr], 47 ** ror r64, 47 ** cmp r16, itype cmp r16, itype ** jne ->exit jne ->exit ** shr r64, 16 shr r64, 16 */ emit_shifti(as, XOg_SHR|REX_64, dest, 17); if ((ir->op2 & IRSLOAD_TYPECHECK)) { asm_guardcc(as, CC_NE); emit_i8(as, irt_toitype(t)); emit_rr(as, XO_ARITHi8, XOg_CMP, dest); emit_i8(as, XI_O16); } if ((as->flags & JIT_F_BMI2)) { emit_i8(as, 47); emit_rmro(as, XV_RORX|VEX_64, dest, base, ofs); } else { if ((ir->op2 & IRSLOAD_TYPECHECK)) emit_shifti(as, XOg_ROR|REX_64, dest, 47); else emit_shifti(as, XOg_SHL|REX_64, dest, 17); emit_rmro(as, XO_MOV, dest|REX_64, base, ofs); } return; } else #endif emit_rmro(as, irt_isnum(t) ? XO_MOVSD : 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) || (ir->op2 & IRSLOAD_KEYINDEX)) { lj_assertA(irt_isinteger(t) || irt_isnum(t), "bad SLOAD type %d", irt_type(t)); emit_u32(as, (ir->op2 & IRSLOAD_KEYINDEX) ? LJ_KEYINDEX : LJ_GC64 ? (LJ_TISNUM << 15) : LJ_TISNUM); emit_rmro(as, XO_ARITHi, XOg_CMP, base, ofs+4); #if LJ_GC64 } else if (irt_isnil(t)) { /* LJ_GC64 type check for nil: ** ** cmp qword [addr], -1 ** jne ->exit */ emit_i8(as, -1); emit_rmro(as, XO_ARITHi8, XOg_CMP|REX_64, base, ofs); } else if (irt_ispri(t)) { emit_u32(as, (irt_toitype(t) << 15) | 0x7fff); emit_rmro(as, XO_ARITHi, XOg_CMP, base, ofs+4); } else { /* LJ_GC64 type check only: ** ** mov r64, [addr] ** sar r64, 47 ** cmp r32, itype ** jne ->exit */ Reg tmp = ra_scratch(as, rset_exclude(RSET_GPR, base)); emit_i8(as, irt_toitype(t)); emit_rr(as, XO_ARITHi8, XOg_CMP, tmp); emit_shifti(as, XOg_SAR|REX_64, tmp, 47); emit_rmro(as, XO_MOV, tmp|REX_64, base, ofs); #else } else { emit_i8(as, irt_toitype(t)); emit_rmro(as, XO_ARITHi8, XOg_CMP, base, ofs+4); #endif } } } /* -- Allocations --------------------------------------------------------- */ #if LJ_HASFFI static void asm_cnew(ASMState *as, IRIns *ir) { CTState *cts = ctype_ctsG(J2G(as->J)); CTypeID id = (CTypeID)IR(ir->op1)->i; CTSize sz; CTInfo info = lj_ctype_info(cts, id, &sz); const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_mem_newgco]; IRRef args[4]; lj_assertA(sz != CTSIZE_INVALID || (ir->o == IR_CNEW && ir->op2 != REF_NIL), "bad CNEW/CNEWI operands"); 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 || (LJ_GC64 && (irk->o == IR_KPTR || irk->o == IR_KKPTR))) ? 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++; lj_assertA(ir->o == IR_HIOP, "missing CNEWI 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 lj_assertA(sz == 4 || sz == 8, "bad CNEWI size %d", sz); } else if (ir->op2 != REF_NIL) { /* Create VLA/VLS/aligned cdata. */ ci = &lj_ir_callinfo[IRCALL_lj_cdata_newv]; args[0] = ASMREF_L; /* lua_State *L */ args[1] = ir->op1; /* CTypeID id */ args[2] = ir->op2; /* CTSize sz */ args[3] = ASMREF_TMP1; /* CTSize align */ asm_gencall(as, ci, args); emit_loadi(as, ra_releasetmp(as, ASMREF_TMP1), (int32_t)ctype_align(info)); return; } /* 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)+(id<<16))); emit_gri(as, XG_ARITHi(XOg_AND), RID_ECX, LJ_GC_WHITES); emit_opgl(as, XO_MOVZXb, RID_ECX, gc.currentwhite); args[0] = ASMREF_L; /* lua_State *L */ args[1] = ASMREF_TMP1; /* MSize size */ asm_gencall(as, ci, args); emit_loadi(as, ra_releasetmp(as, ASMREF_TMP1), (int32_t)(sz+sizeof(GCcdata))); } #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|REX_GC64, 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). */ lj_assertA(IR(ir->op1)->o == IR_UREFC, "bad OBAR type"); 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)); } } static void asm_fpmath(ASMState *as, IRIns *ir) { IRFPMathOp fpm = (IRFPMathOp)ir->op2; 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 { asm_callid(as, ir, IRCALL_lj_vm_floor + fpm); } } static void asm_ldexp(ASMState *as, IRIns *ir) { 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, XO_MOVSD, dest, RID_ESP, ofs); } emit_rmro(as, XO_FSTPq, XOg_FSTPq, RID_ESP, ofs); emit_x87op(as, XI_FPOP1); emit_x87op(as, XI_FSCALE); asm_x87load(as, ir->op1); asm_x87load(as, ir->op2); } static int asm_swapops(ASMState *as, IRIns *ir) { IRIns *irl = IR(ir->op1); IRIns *irr = IR(ir->op2); lj_assertA(ra_noreg(irr->r), "bad usage"); 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); MCode *q = p[0] == 0x0f ? p+1 : p; if ((*q & 15) < 14) { if ((*q & 15) >= 12) *q -= 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->flagmcp == as->mcp || irt_is64(ir->t) || !asm_lea(as, ir)) asm_intarith(as, ir, XOg_ADD); } static void asm_sub(ASMState *as, IRIns *ir) { 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); } static void asm_mul(ASMState *as, IRIns *ir) { if (irt_isnum(ir->t)) asm_fparith(as, ir, XO_MULSD); else asm_intarith(as, ir, XOg_X_IMUL); } #define asm_fpdiv(as, ir) asm_fparith(as, ir, XO_DIVSD) 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_neg(ASMState *as, IRIns *ir) { if (irt_isnum(ir->t)) asm_fparith(as, ir, XO_XORPS); else asm_neg_not(as, ir, XOg_NEG); } #define asm_abs(as, ir) asm_fparith(as, ir, XO_ANDPS) static void asm_intmin_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_min(ASMState *as, IRIns *ir) { if (irt_isnum(ir->t)) asm_fparith(as, ir, XO_MINSD); else asm_intmin_max(as, ir, CC_G); } static void asm_max(ASMState *as, IRIns *ir) { if (irt_isnum(ir->t)) asm_fparith(as, ir, XO_MAXSD); else asm_intmin_max(as, ir, CC_L); } /* Note: don't use LEA for overflow-checking arithmetic! */ #define asm_addov(as, ir) asm_intarith(as, ir, XOg_ADD) #define asm_subov(as, ir) asm_intarith(as, ir, XOg_SUB) #define asm_mulov(as, ir) asm_intarith(as, ir, XOg_X_IMUL) #define asm_bnot(as, ir) asm_neg_not(as, ir, XOg_NOT) static void asm_bswap(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); } #define asm_band(as, ir) asm_intarith(as, ir, XOg_AND) #define asm_bor(as, ir) asm_intarith(as, ir, XOg_OR) #define asm_bxor(as, ir) asm_intarith(as, ir, XOg_XOR) static void asm_bitshift(ASMState *as, IRIns *ir, x86Shift xs, x86Op xv) { 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); if (!xv && shift && (as->flags & JIT_F_BMI2)) { Reg left = asm_fuseloadm(as, ir->op1, RSET_GPR, irt_is64(ir->t)); if (left != dest) { /* BMI2 rotate right by constant. */ emit_i8(as, xs == XOg_ROL ? -shift : shift); emit_mrm(as, VEX_64IR(ir, XV_RORX), dest, left); return; } } 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 if ((as->flags & JIT_F_BMI2) && xv) { /* BMI2 variable shifts. */ Reg left, right; dest = ra_dest(as, ir, RSET_GPR); right = ra_alloc1(as, rref, RSET_GPR); left = asm_fuseloadm(as, ir->op1, rset_exclude(RSET_GPR, right), irt_is64(ir->t)); emit_mrm(as, VEX_64IR(ir, xv) ^ (right << 19), dest, left); return; } 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, REX_64IR(ir, 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. */ } #define asm_bshl(as, ir) asm_bitshift(as, ir, XOg_SHL, XV_SHLX) #define asm_bshr(as, ir) asm_bitshift(as, ir, XOg_SHR, XV_SHRX) #define asm_bsar(as, ir) asm_bitshift(as, ir, XOg_SAR, XV_SARX) #define asm_brol(as, ir) asm_bitshift(as, ir, XOg_ROL, 0) #define asm_bror(as, ir) asm_bitshift(as, ir, XOg_ROR, 0) /* -- 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 = asm_compmap[ir->o]; 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); 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); } } right = asm_fuseload(as, rref, rset_exclude(RSET_FPR, left)); 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; lj_assertA(irt_is64(ir->t) || irt_isint(ir->t) || irt_isu32(ir->t) || irt_isaddr(ir->t) || irt_isu8(ir->t), "bad comparison data type %d", irt_type(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)) { lj_assertA(ir->o == IR_EQ || ir->o == IR_NE, "bad usage"); 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); } } } #define asm_equal(as, ir) asm_comp(as, ir) #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 /* -- Split register ops -------------------------------------------------- */ /* Hiword op of a split 32/32 or 64/64 bit op. Previous op is the loword op. */ static void asm_hiop(ASMState *as, IRIns *ir) { /* 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 LJ_32 && LJ_HASFFI 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. */ asm_comp_int64(as, ir); return; } else if ((ir-1)->o == IR_XSTORE) { if ((ir-1)->r != RID_SINK) asm_fxstore(as, ir); return; } #endif if (!usehi) return; /* Skip unused hiword op for all remaining ops. */ switch ((ir-1)->o) { #if LJ_32 && LJ_HASFFI 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_CNEWI: /* Nothing to do here. Handled by CNEWI itself. */ break; #endif case IR_CALLN: case IR_CALLL: case IR_CALLS: case IR_CALLXS: if (!uselo) ra_allocref(as, ir->op1, RID2RSET(RID_RETLO)); /* Mark lo op as used. */ break; default: lj_assertA(0, "bad HIOP for op %d", (ir-1)->o); break; } } /* -- Profiling ----------------------------------------------------------- */ static void asm_prof(ASMState *as, IRIns *ir) { UNUSED(ir); asm_guardcc(as, CC_NE); emit_i8(as, HOOK_PROFILE); emit_rma(as, XO_GROUP3b, XOg_TEST, &J2G(as->J)->hookmask); } /* -- 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|REX_GC64, (int32_t)(8*topslot)); if (ra_hasreg(pbase) && pbase != r) emit_rr(as, XO_ARITH(XOg_SUB), r|REX_GC64, pbase); else #if LJ_GC64 emit_rmro(as, XO_ARITH(XOg_SUB), r|REX_64, RID_DISPATCH, (int32_t)dispofs(as, &J2G(as->J)->jit_base)); #else emit_rmro(as, XO_ARITH(XOg_SUB), r, RID_NONE, ptr2addr(&J2G(as->J)->jit_base)); #endif emit_rmro(as, XO_MOV, r|REX_GC64, r, offsetof(lua_State, maxstack)); emit_getgl(as, r, cur_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]; #if !LJ_FR2 || defined(LUA_USE_ASSERT) SnapEntry *flinks = &as->T->snapmap[snap_nextofs(as->T, snap)-1-LJ_FR2]; #endif 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-LJ_FR2); IRRef ref = snap_ref(sn); IRIns *ir = IR(ref); if ((sn & SNAP_NORESTORE)) continue; if ((sn & SNAP_KEYINDEX)) { emit_movmroi(as, RID_BASE, ofs+4, LJ_KEYINDEX); if (irref_isk(ref)) { emit_movmroi(as, RID_BASE, ofs, ir->i); } else { Reg src = ra_alloc1(as, ref, rset_exclude(RSET_GPR, RID_BASE)); emit_movtomro(as, src, RID_BASE, ofs); } } else if (irt_isnum(ir->t)) { Reg src = ra_alloc1(as, ref, RSET_FPR); emit_rmro(as, XO_MOVSDto, src, RID_BASE, ofs); } else { lj_assertA(irt_ispri(ir->t) || irt_isaddr(ir->t) || (LJ_DUALNUM && irt_isinteger(ir->t)), "restore of IR type %d", irt_type(ir->t)); if (!irref_isk(ref)) { Reg src = ra_alloc1(as, ref, rset_exclude(RSET_GPR, RID_BASE)); #if LJ_GC64 if (irt_is64(ir->t)) { /* TODO: 64 bit store + 32 bit load-modify-store is suboptimal. */ emit_u32(as, irt_toitype(ir->t) << 15); emit_rmro(as, XO_ARITHi, XOg_OR, RID_BASE, ofs+4); } else if (LJ_DUALNUM && irt_isinteger(ir->t)) { emit_movmroi(as, RID_BASE, ofs+4, LJ_TISNUM << 15); } else { emit_movmroi(as, RID_BASE, ofs+4, (irt_toitype(ir->t)<<15)|0x7fff); } #endif emit_movtomro(as, REX_64IR(ir, src), RID_BASE, ofs); #if LJ_GC64 } else { TValue k; lj_ir_kvalue(as->J->L, &k, ir); if (tvisnil(&k)) { emit_i32(as, -1); emit_rmro(as, XO_MOVmi, REX_64, RID_BASE, ofs); } else { emit_movmroi(as, RID_BASE, ofs+4, k.u32.hi); emit_movmroi(as, RID_BASE, ofs, k.u32.lo); } #else } else if (!irt_ispri(ir->t)) { emit_movmroi(as, RID_BASE, ofs, ir->i); #endif } if ((sn & (SNAP_CONT|SNAP_FRAME))) { #if !LJ_FR2 if (s != 0) /* Do not overwrite link to previous frame. */ emit_movmroi(as, RID_BASE, ofs+4, (int32_t)(*flinks--)); #endif #if !LJ_GC64 } else { if (!(LJ_64 && irt_islightud(ir->t))) emit_movmroi(as, RID_BASE, ofs+4, irt_toitype(ir->t)); #endif } } checkmclim(as); } lj_assertA(map + nent == flinks, "inconsistent frames in snapshot"); } /* -- 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); #if LJ_GC64 emit_rmro(as, XO_LEA, tmp|REX_64, RID_DISPATCH, GG_DISP2G); #else emit_loada(as, tmp, J2G(as->J)); #endif 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|REX_GC64, 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. */ lj_assertA(((intptr_t)target & 15) == 0, "loop realign failed"); if (as->loopinv) { /* Inverted loop branch? */ p -= 5; p[0] = XI_JMP; lj_assertA(target - p >= -128, "loop realign failed"); p[-1] = (MCode)(target - p); /* Patch sjcc. */ if (as->loopinv == 2) p[-3] = (MCode)(target - p + 2); /* Patch opt. short jp. */ } else { lj_assertA(target - p >= -128, "loop realign failed"); 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. */ } } } /* Fixup the tail of the loop. */ static void asm_loop_tail_fixup(ASMState *as) { UNUSED(as); /* Nothing to do. */ } /* -- 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|REX_GC64, RID_BASE); } } /* Coalesce or reload BASE register for a side trace. */ static Reg asm_head_side_base(ASMState *as, IRIns *irp) { 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) { return r; /* Same BASE register already coalesced. */ } else if (ra_hasreg(irp->r) && rset_test(as->freeset, irp->r)) { /* Move from coalesced parent reg. */ emit_rr(as, XO_MOV, r|REX_GC64, irp->r); return irp->r; } else { emit_getgl(as, r, jit_base); /* Otherwise reload BASE. */ } } return RID_NONE; } /* -- 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 -= LJ_64 ? 7 : 6; } 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 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(as->J, 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 - (LJ_64 ? 7 : 6); as->invmcp = NULL; } } /* -- 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); as->mrm.base = 0; } /* -- 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; MCode *pgc = NULL; #if LJ_GC64 uint32_t statei = (uint32_t)(GG_OFS(g.vmstate) - GG_OFS(dispatch)); #else uint32_t statei = u32ptr(&J2G(J)->vmstate); #endif if (len > 5 && p[len-5] == XI_JMP && p+len-6 + *(int32_t *)(p+len-4) == px) *(int32_t *)(p+len-4) = jmprel(J, p+len, target); /* Do not patch parent exit for a stack check. Skip beyond vmstate update. */ for (; p < pe; p += asm_x86_inslen(p)) { intptr_t ofs = LJ_GC64 ? (p[0] & 0xf0) == 0x40 : LJ_64; if (*(uint32_t *)(p+2+ofs) == statei && p[ofs+LJ_GC64-LJ_64] == XI_MOVmi) break; } lj_assertJ(p < pe, "instruction length decoder failed"); for (; p < pe; p += asm_x86_inslen(p)) { if ((*(uint16_t *)p & 0xf0ff) == 0x800f && p + *(int32_t *)(p+2) == px && p != pgc) { *(int32_t *)(p+2) = jmprel(J, p+6, target); } else if (*p == XI_CALL && (void *)(p+5+*(int32_t *)(p+1)) == (void *)lj_gc_step_jit) { pgc = p+7; /* Do not patch GC check exit. */ } } lj_mcode_sync(T->mcode, T->mcode + T->szmcode); lj_mcode_patch(J, mcarea, 1); } subprojects/luajit/src/vm_x64.dasc0000644000175000017500000040765214741067622016474 0ustar aniolaniol|// Low-level VM code for x64 CPUs in LJ_GC64 mode. |// Bytecode interpreter, fast functions and helper functions. |// Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h | |.arch x64 |.section code_op, code_sub | |.actionlist build_actionlist |.globals GLOB_ |.globalnames globnames |.externnames extnames | |//----------------------------------------------------------------------- | |.if WIN |.define X64WIN, 1 // Windows/x64 calling conventions. |.endif | |// Fixed register assignments for the interpreter. |// This is very fragile and has many dependencies. Caveat emptor. |.define BASE, rdx // Not C callee-save, refetched anyway. |.if X64WIN |.define KBASE, rdi // Must be C callee-save. |.define PC, rsi // Must be C callee-save. |.define DISPATCH, rbx // Must be C callee-save. |.define KBASEd, edi |.define PCd, esi |.define DISPATCHd, ebx |.else |.define KBASE, r15 // Must be C callee-save. |.define PC, rbx // Must be C callee-save. |.define DISPATCH, r14 // Must be C callee-save. |.define KBASEd, r15d |.define PCd, ebx |.define DISPATCHd, r14d |.endif | |.define RA, rcx |.define RAd, ecx |.define RAH, ch |.define RAL, cl |.define RB, rbp // Must be rbp (C callee-save). |.define RBd, ebp |.define RC, rax // Must be rax. |.define RCd, eax |.define RCW, ax |.define RCH, ah |.define RCL, al |.define OP, RBd |.define RD, RC |.define RDd, RCd |.define RDW, RCW |.define RDL, RCL |.define TMPR, r10 |.define TMPRd, r10d |.define ITYPE, r11 |.define ITYPEd, r11d | |.if 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 |.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 |.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 |.type SBUF, SBuf | |// Stack layout while in interpreter. Must match with lj_frame.h. |//----------------------------------------------------------------------- |.if 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, aword [rsp+aword*12] |.define SAVE_L, aword [rsp+aword*11] |.define SAVE_ERRF, dword [rsp+dword*21] |.define SAVE_NRES, 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 | |.define ARG5d, dword [rsp+dword*8] |.define TMP1, ARG5 // TMP1 overlaps ARG5 |.define TMP1d, ARG5d |.define TMP1hi, dword [rsp+dword*9] |.define MULTRES, TMP1d // MULTRES overlaps TMP1d. | |//----------------------------------------------------------------------- |.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, aword [rsp+aword*3] |.define SAVE_L, aword [rsp+aword*2] |.define SAVE_ERRF, dword [rsp+dword*3] |.define SAVE_NRES, dword [rsp+dword*2] |.define TMP1, aword [rsp] //<-- rsp while in interpreter. |//----- 16 byte aligned | |.define TMP1d, dword [rsp] |.define TMP1hi, dword [rsp+dword*1] |.define MULTRES, TMP1d // MULTRES overlaps TMP1d. | |.endif | |//----------------------------------------------------------------------- | |// Instruction headers. |.macro ins_A; .endmacro |.macro ins_AD; .endmacro |.macro ins_AJ; .endmacro |.macro ins_ABC; movzx RBd, RCH; movzx RCd, RCL; .endmacro |.macro ins_AB_; movzx RBd, RCH; .endmacro |.macro ins_A_C; movzx RCd, RCL; .endmacro |.macro ins_AND; not RD; .endmacro | |// Instruction decode+dispatch. Carefully tuned (nope, lodsd is not faster). |.macro ins_NEXT | mov RCd, [PC] | movzx RAd, RCH | movzx OP, RCL | add PC, 4 | shr RCd, 16 | jmp aword [DISPATCH+OP*8] |.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-8] = PC | mov PC, LFUNC:RB->pc | mov RAd, [PC] | movzx OP, RAL | movzx RAd, RAH | add PC, 4 | jmp aword [DISPATCH+OP*8] |.endmacro | |.macro ins_call | // BASE = new base, RB = LFUNC, RD = nargs+1 | mov [BASE-8], PC | ins_callt |.endmacro | |//----------------------------------------------------------------------- | |// Macros to clear or set tags. |.macro cleartp, reg; shl reg, 17; shr reg, 17; .endmacro |.macro settp, reg, tp | mov64 ITYPE, ((uint64_t)tp<<47) | or reg, ITYPE |.endmacro |.macro settp, dst, reg, tp | mov64 dst, ((uint64_t)tp<<47) | or dst, reg |.endmacro |.macro setint, reg | settp reg, LJ_TISNUM |.endmacro |.macro setint, dst, reg | settp dst, reg, LJ_TISNUM |.endmacro | |// Macros to test operand types. |.macro checktp_nc, reg, tp, target | mov ITYPE, reg | sar ITYPE, 47 | cmp ITYPEd, tp | jne target |.endmacro |.macro checktp, reg, tp, target | mov ITYPE, reg | cleartp reg | sar ITYPE, 47 | cmp ITYPEd, tp | jne target |.endmacro |.macro checktptp, src, tp, target | mov ITYPE, src | sar ITYPE, 47 | cmp ITYPEd, tp | jne target |.endmacro |.macro checkstr, reg, target; checktp reg, LJ_TSTR, target; .endmacro |.macro checktab, reg, target; checktp reg, LJ_TTAB, target; .endmacro |.macro checkfunc, reg, target; checktp reg, LJ_TFUNC, target; .endmacro | |.macro checknumx, reg, target, jump | mov ITYPE, reg | sar ITYPE, 47 | cmp ITYPEd, LJ_TISNUM | jump target |.endmacro |.macro checkint, reg, target; checknumx reg, target, jne; .endmacro |.macro checkinttp, src, target; checknumx src, target, jne; .endmacro |.macro checknum, reg, target; checknumx reg, target, jae; .endmacro |.macro checknumtp, src, target; checknumx src, target, jae; .endmacro |.macro checknumber, src, target; checknumx src, target, ja; .endmacro | |.macro mov_false, reg; mov64 reg, (int64_t)~((uint64_t)1<<47); .endmacro |.macro mov_true, reg; mov64 reg, (int64_t)~((uint64_t)2<<47); .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, PCd | shr reg, 1 | and reg, HOTCOUNT_PCMASK | sub word [DISPATCH+reg+GG_DISP2HOT], HOTCOUNT_LOOP | jb ->vm_hotloop |.endmacro | |.macro hotcall, reg | mov reg, PCd | 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 | |.macro fpop1; fstp st1; .endmacro | |// Synthesize SSE FP constants. |.macro sseconst_abs, reg, tmp // Synthesize abs mask. | mov64 tmp, U64x(7fffffff,ffffffff); movd reg, tmp |.endmacro | |.macro sseconst_hi, reg, tmp, val // Synthesize hi-32 bit const. | mov64 tmp, U64x(val,00000000); movd reg, tmp |.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_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 PCd, FRAME_P | jz ->cont_dispatch | | // Return from pcall or xpcall fast func. | and PC, -8 | sub BASE, PC // Restore caller base. | lea RA, [RA+PC-8] // Rebase RA and prepend one result. | mov PC, [BASE-8] // Fetch PC of previous frame. | // Prepending may overwrite the pcall frame, so do it at the end. | mov_true ITYPE | mov aword [BASE+RA], ITYPE // Prepend true to results. | |->vm_returnc: | add RDd, 1 // RD = nresults+1 | jz ->vm_unwind_yield | mov MULTRES, RDd | 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 PCd, FRAME_TYPE | jnz ->vm_returnp | | // Return to C. | set_vmstate C | and PC, -8 | sub PC, BASE | neg PC // Previous base = BASE - delta. | | sub RDd, 1 | jz >2 |1: // Move results down. | mov RB, [BASE+RA] | mov [BASE-16], RB | add BASE, 8 | sub RDd, 1 | jnz <1 |2: | mov L:RB, SAVE_L | mov L:RB->base, PC |3: | mov RDd, MULTRES | mov RAd, SAVE_NRES // RA = wanted nresults+1 |4: | cmp RAd, RDd | jne >6 // More/less results wanted? |5: | sub BASE, 16 | mov L:RB->top, BASE | |->vm_leave_cp: | mov RA, SAVE_CFRAME // Restore previous C frame. | mov L:RB->cframe, RA | 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 aword [BASE-16], LJ_TNIL | add BASE, 8 | add RDd, 1 | jmp <4 | |7: // Less results wanted. | test RAd, RAd | 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, RDd // Need to fill only remainder with nil. | mov CARG2d, RAd | mov CARG1, L:RB | call extern lj_state_growstack // (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: // Unwind C stack, return from vm_pcall. | // (void *cframe, int errcode) | mov eax, CARG2d // Error return status for vm_pcall. | mov rsp, CARG1 |->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 not X64WIN | mov CARG1, SAVE_L | mov CARG2d, eax | restoreregs | jmp extern lj_err_throw // (lua_State *L, int errcode) |.endif | |->vm_unwind_ff: // Unwind C stack, return from ff pcall. | // (void *cframe) | and CARG1, CFRAME_RAWMASK | mov rsp, CARG1 |->vm_unwind_ff_eh: // Landing pad for external unwinder. | mov L:RB, SAVE_L | mov RDd, 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-8] // Fetch PC of previous frame. | mov_false RA | mov RB, [BASE] | mov [BASE-16], RA // Prepend false to error message. | mov [BASE-8], RB | mov RA, -16 // Results start at BASE+RA = BASE-16. | set_vmstate INTERP | jmp ->vm_returnc // Increments RD/MULTRES and returns. | |//----------------------------------------------------------------------- |//-- Grow stack for calls ----------------------------------------------- |//----------------------------------------------------------------------- | |->vm_growstack_c: // Grow stack for C function. | mov CARG2d, LUA_MINSTACK | jmp >2 | |->vm_growstack_v: // Grow stack for vararg Lua function. | sub RD, 16 // LJ_FR2 | 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 RAd, 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 CARG2, RA |2: | // RB = L, L->base = new base, L->top = top | mov CARG1, L:RB | call extern lj_state_growstack // (lua_State *L, int n) | mov BASE, L:RB->base | mov RD, L:RB->top | mov LFUNC:RB, [BASE-16] | cleartp LFUNC:RB | sub RD, BASE | shr RDd, 3 | add NARGS:RDd, 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 | mov L:RB, CARG1 // Caveat: CARG1 may be RA. | mov SAVE_L, CARG1 | mov RA, CARG2 | mov PCd, FRAME_CP | xor RDd, RDd | lea KBASE, [esp+CFRAME_RESUME] | mov DISPATCH, L:RB->glref // Setup pointer to dispatch table. | add DISPATCH, GG_G2DISP | mov SAVE_PC, RD // Any value outside of bytecode is ok. | mov SAVE_CFRAME, RD | mov SAVE_NRES, RDd | mov SAVE_ERRF, RDd | mov L:RB->cframe, KBASE | cmp byte L:RB->status, RDL | je >2 // Initial resume (like a call). | | // Resume after yield (like a return). | mov [DISPATCH+DISPATCH_GL(cur_L)], L:RB | set_vmstate INTERP | mov byte L:RB->status, RDL | mov BASE, L:RB->base | mov RD, L:RB->top | sub RD, RA | shr RDd, 3 | add RDd, 1 // RD = nresults+1 | sub RA, BASE // RA = resultofs | mov PC, [BASE-8] | mov MULTRES, RDd | test PCd, 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 PCd, FRAME_CP | mov SAVE_ERRF, CARG4d | jmp >1 | |->vm_call: // Setup C frame and enter VM. | // (lua_State *L, TValue *base, int nres1) | saveregs | mov PCd, FRAME_C | |1: // Entry point for vm_pcall above (PC = ftype). | mov SAVE_NRES, CARG3d | mov L:RB, CARG1 // Caveat: CARG1 may be RA. | mov SAVE_L, CARG1 | mov RA, CARG2 | | mov DISPATCH, L:RB->glref // Setup pointer to dispatch table. | mov KBASE, L:RB->cframe // Add our C frame to cframe chain. | mov SAVE_CFRAME, KBASE | mov SAVE_PC, L:RB // Any value outside of bytecode is ok. | add DISPATCH, GG_G2DISP | mov L:RB->cframe, rsp | |2: // Entry point for vm_resume/vm_cpcall (RA = base, RB = L, PC = ftype). | mov [DISPATCH+DISPATCH_GL(cur_L)], L:RB | 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:RDd, 3 | add NARGS:RDd, 1 // RD = nargs+1 | |->vm_call_dispatch: | mov LFUNC:RB, [RA-16] | checkfunc LFUNC:RB, ->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 | mov L:RB, CARG1 // Caveat: CARG1 may be RA. | mov SAVE_L, CARG1 | 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 DISPATCH, L:RB->glref // Setup pointer to dispatch table. | mov SAVE_ERRF, 0 // No error function. | mov SAVE_NRES, KBASEd // Neg. delta means cframe w/o frame. | add DISPATCH, GG_G2DISP | // Handler may change cframe_nres(L->cframe) or cframe_errfunc(L->cframe). | | mov KBASE, L:RB->cframe // Add our C frame to cframe chain. | mov SAVE_CFRAME, KBASE | mov L:RB->cframe, rsp | mov [DISPATCH+DISPATCH_GL(cur_L)], L:RB | | call CARG4 // (lua_State *L, lua_CFunction func, void *ud) | // 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 PCd, 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 aword [RA+RD*8-8], LJ_TNIL // Ensure one valid arg. | mov RC, RA // ... in [RC] | mov PC, [RB-24] // Restore PC from [cont|PC]. | mov RA, qword [RB-32] // May be negative on WIN64 with debug. |.if FFI | cmp RA, 1 | jbe >1 |.endif | mov LFUNC:KBASE, [BASE-16] | cleartp LFUNC:KBASE | mov KBASE, LFUNC:KBASE->pc | mov KBASE, [KBASE+PC2PROTO(k)] | // BASE = base, RC = result, RB = meta base | jmp RA // 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 RBd, 3 | lea RDd, [RBd-3] | jmp ->vm_call_tail |.endif | |->cont_cat: // BASE = base, RC = result, RB = mbase | movzx RAd, PC_RB | sub RB, 32 | lea RA, [BASE+RA*8] | sub RA, RB | je ->cont_ra | neg RA | shr RAd, 3 |.if X64WIN | mov CARG3d, RAd | mov L:CARG1, SAVE_L | mov L:CARG1->base, BASE | mov RC, [RC] | mov [RB], RC | mov CARG2, RB |.else | mov L:CARG1, SAVE_L | mov L:CARG1->base, BASE | mov CARG3d, RAd | mov RA, [RC] | mov [RB], RA | mov CARG2, RB |.endif | jmp ->BC_CAT_Z | |//-- Table indexing metamethods ----------------------------------------- | |->vmeta_tgets: | settp STR:RC, LJ_TSTR // STR:RC = GCstr * | mov TMP1, STR:RC | lea RC, TMP1 | cmp PC_OP, BC_GGET | jne >1 | settp TAB:RA, TAB:RB, LJ_TTAB // TAB:RB = GCtab * | lea RB, [DISPATCH+DISPATCH_GL(tmptv)] // Store fn->l.env in g->tmptv. | mov [RB], TAB:RA | jmp >2 | |->vmeta_tgetb: | movzx RCd, PC_RC |.if DUALNUM | setint RC | mov TMP1, RC |.else | cvtsi2sd xmm0, RCd | movsd TMP1, xmm0 |.endif | lea RC, TMP1 | jmp >1 | |->vmeta_tgetv: | movzx RCd, PC_RC // Reload TValue *k from RC. | lea RC, [BASE+RC*8] |1: | movzx RBd, PC_RB // Reload TValue *t from RB. | lea RB, [BASE+RB*8] |2: | mov L:CARG1, SAVE_L | mov L:CARG1->base, BASE // Caveat: CARG2/CARG3 may be BASE. | mov CARG2, RB | mov CARG3, RC | mov L:RB, L:CARG1 | 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 RAd, PC_RA | mov RB, [RC] | mov [BASE+RA*8], RB | ins_next | |3: // Call __index metamethod. | // BASE = base, L->top = new base, stack = cont/func/t/k | mov RA, L:RB->top | mov [RA-24], PC // [cont|PC] | lea PC, [RA+FRAME_CONT] | sub PC, BASE | mov LFUNC:RB, [RA-16] // Guaranteed to be a function here. | mov NARGS:RDd, 2+1 // 2 args for func(t, k). | cleartp LFUNC:RB | jmp ->vm_call_dispatch_f | |->vmeta_tgetr: | mov CARG1, TAB:RB | mov RB, BASE // Save BASE. | mov CARG2d, RCd // Caveat: CARG2 == BASE | call extern lj_tab_getinth // (GCtab *t, int32_t key) | // cTValue * or NULL returned in eax (RC). | movzx RAd, PC_RA | mov BASE, RB // Restore BASE. | test RC, RC | jnz ->BC_TGETR_Z | mov ITYPE, LJ_TNIL | jmp ->BC_TGETR2_Z | |//----------------------------------------------------------------------- | |->vmeta_tsets: | settp STR:RC, LJ_TSTR // STR:RC = GCstr * | mov TMP1, STR:RC | lea RC, TMP1 | cmp PC_OP, BC_GSET | jne >1 | settp TAB:RA, TAB:RB, LJ_TTAB // TAB:RB = GCtab * | lea RB, [DISPATCH+DISPATCH_GL(tmptv)] // Store fn->l.env in g->tmptv. | mov [RB], TAB:RA | jmp >2 | |->vmeta_tsetb: | movzx RCd, PC_RC |.if DUALNUM | setint RC | mov TMP1, RC |.else | cvtsi2sd xmm0, RCd | movsd TMP1, xmm0 |.endif | lea RC, TMP1 | jmp >1 | |->vmeta_tsetv: | movzx RCd, PC_RC // Reload TValue *k from RC. | lea RC, [BASE+RC*8] |1: | movzx RBd, PC_RB // Reload TValue *t from RB. | lea RB, [BASE+RB*8] |2: | mov L:CARG1, SAVE_L | mov L:CARG1->base, BASE // Caveat: CARG2/CARG3 may be BASE. | mov CARG2, RB | mov CARG3, RC | mov L:RB, L:CARG1 | 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 RAd, PC_RA | mov RB, [BASE+RA*8] | mov [RC], RB |->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-24], PC // [cont|PC] | movzx RCd, PC_RA | // Copy value to third argument. | mov RB, [BASE+RC*8] | mov [RA+16], RB | lea PC, [RA+FRAME_CONT] | sub PC, BASE | mov LFUNC:RB, [RA-16] // Guaranteed to be a function here. | mov NARGS:RDd, 3+1 // 3 args for func(t, k, v). | cleartp LFUNC:RB | jmp ->vm_call_dispatch_f | |->vmeta_tsetr: |.if X64WIN | mov L:CARG1, SAVE_L | mov CARG3d, RCd | mov L:CARG1->base, BASE | xchg CARG2, TAB:RB // Caveat: CARG2 == BASE. |.else | mov L:CARG1, SAVE_L | mov CARG2, TAB:RB | mov L:CARG1->base, BASE | mov RB, BASE // Save BASE. | mov CARG3d, RCd // Caveat: CARG3 == BASE. |.endif | mov SAVE_PC, PC | call extern lj_tab_setinth // (lua_State *L, GCtab *t, int32_t key) | // TValue * returned in eax (RC). | movzx RAd, PC_RA | mov BASE, RB // Restore BASE. | jmp ->BC_TSETR_Z | |//-- Comparison metamethods --------------------------------------------- | |->vmeta_comp: | movzx RDd, PC_RD | movzx RAd, PC_RA | mov L:RB, SAVE_L | mov L:RB->base, BASE // Caveat: CARG2/CARG3 == BASE. |.if X64WIN | lea CARG3, [BASE+RD*8] | lea CARG2, [BASE+RA*8] |.else | lea CARG2, [BASE+RA*8] | lea CARG3, [BASE+RD*8] |.endif | mov CARG1, L:RB // Caveat: CARG1/CARG4 == RA. | movzx CARG4d, PC_OP | 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 RDd, PC_RD | branchPC RD |6: | ins_next | |->cont_condt: // BASE = base, RC = result | add PC, 4 | mov ITYPE, [RC] | sar ITYPE, 47 | cmp ITYPEd, LJ_TISTRUECOND // Branch if result is true. | jb <5 | jmp <6 | |->cont_condf: // BASE = base, RC = result | mov ITYPE, [RC] | sar ITYPE, 47 | cmp ITYPEd, LJ_TISTRUECOND // Branch if result is false. | jmp <4 | |->vmeta_equal: | cleartp TAB:RD | sub PC, 4 |.if X64WIN | mov CARG3, RD | mov CARG4d, RBd | mov L:RB, SAVE_L | mov L:RB->base, BASE // Caveat: CARG2 == BASE. | mov CARG2, RA | mov CARG1, L:RB // Caveat: CARG1 == RA. |.else | mov CARG2, RA | mov CARG4d, RBd // Caveat: CARG4 == RA. | mov L:RB, SAVE_L | mov L:RB->base, BASE // Caveat: CARG3 == BASE. | mov CARG3, RD | mov CARG1, L:RB |.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 CARG1, L:RB | mov CARG2d, dword [PC-4] | mov SAVE_PC, PC | call extern lj_meta_equal_cd // (lua_State *L, BCIns ins) | // 0/1 or TValue * (metamethod) returned in eax (RC). | jmp <3 |.endif | |->vmeta_istype: | mov L:RB, SAVE_L | mov L:RB->base, BASE // Caveat: CARG2/CARG3 may be BASE. | mov CARG2d, RAd | mov CARG3d, RDd | mov L:CARG1, L:RB | mov SAVE_PC, PC | call extern lj_meta_istype // (lua_State *L, BCReg ra, BCReg tp) | mov BASE, L:RB->base | jmp <6 | |//-- Arithmetic metamethods --------------------------------------------- | |->vmeta_arith_vno: |.if DUALNUM | movzx RBd, PC_RB | movzx RCd, PC_RC |.endif |->vmeta_arith_vn: | lea RC, [KBASE+RC*8] | jmp >1 | |->vmeta_arith_nvo: |.if DUALNUM | movzx RBd, PC_RB | movzx RCd, PC_RC |.endif |->vmeta_arith_nv: | lea TMPR, [KBASE+RC*8] | lea RC, [BASE+RB*8] | mov RB, TMPR | jmp >2 | |->vmeta_unm: | lea RC, [BASE+RD*8] | mov RB, RC | jmp >2 | |->vmeta_arith_vvo: |.if DUALNUM | movzx RBd, PC_RB | movzx RCd, PC_RC |.endif |->vmeta_arith_vv: | lea RC, [BASE+RC*8] |1: | lea RB, [BASE+RB*8] |2: | lea RA, [BASE+RA*8] |.if X64WIN | mov CARG3, RB | mov CARG4, RC | movzx RCd, PC_OP | mov ARG5d, RCd | mov L:RB, SAVE_L | mov L:RB->base, BASE // Caveat: CARG2 == BASE. | mov CARG2, RA | mov CARG1, L:RB // Caveat: CARG1 == RA. |.else | movzx CARG5d, PC_OP | mov CARG2, RA | mov CARG4, RC // Caveat: CARG4 == RA. | mov L:CARG1, SAVE_L | mov L:CARG1->base, BASE // Caveat: CARG3 == BASE. | mov CARG3, RB | mov L:RB, L:CARG1 |.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-24], PC // [cont|PC] | lea PC, [RC+FRAME_CONT] | mov NARGS:RDd, 2+1 // 2 args for func(o1, o2). | jmp ->vm_call_dispatch | |->vmeta_len: | movzx RDd, PC_RD | mov L:RB, SAVE_L | mov L:RB->base, BASE | lea CARG2, [BASE+RD*8] // Caveat: CARG2 == BASE | mov L:CARG1, L:RB | mov SAVE_PC, PC | call extern lj_meta_len // (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 RDd, PC_RD | mov TAB:CARG1, [BASE+RD*8] | cleartp TAB:CARG1 | jmp ->BC_LEN_Z #else | jmp ->vmeta_binop // Binop call for compatibility. #endif | |//-- Call metamethod ---------------------------------------------------- | |->vmeta_call_ra: | lea RA, [BASE+RA*8+16] |->vmeta_call: // Resolve and call __call metamethod. | // BASE = old base, RA = new base, RC = nargs+1, PC = return | mov TMP1d, NARGS:RDd // Save RA, RC for us. | mov RB, RA |.if X64WIN | mov L:TMPR, SAVE_L | mov L:TMPR->base, BASE // Caveat: CARG2 is BASE. | lea CARG2, [RA-16] | lea CARG3, [RA+NARGS:RD*8-8] | mov CARG1, L:TMPR // Caveat: CARG1 is RA. |.else | mov L:CARG1, SAVE_L | mov L:CARG1->base, BASE // Caveat: CARG3 is BASE. | lea CARG2, [RA-16] | lea CARG3, [RA+NARGS:RD*8-8] |.endif | mov SAVE_PC, PC | call extern lj_meta_call // (lua_State *L, TValue *func, TValue *top) | mov RA, RB | mov L:RB, SAVE_L | mov BASE, L:RB->base | mov NARGS:RDd, TMP1d | mov LFUNC:RB, [RA-16] | add NARGS:RDd, 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 | cleartp LFUNC:RB | 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 CARG2, RA // Caveat: CARG2 == BASE | mov L:CARG1, L:RB // Caveat: CARG1 == RA | mov SAVE_PC, PC | call extern lj_meta_for // (lua_State *L, TValue *base) | mov BASE, L:RB->base | mov RCd, [PC-4] | movzx RAd, RCH | movzx OP, RCL | shr RCd, 16 | jmp aword [DISPATCH+OP*8+GG_DISP2STATIC] // Retry FORI or JFORI. | |//----------------------------------------------------------------------- |//-- Fast functions ----------------------------------------------------- |//----------------------------------------------------------------------- | |.macro .ffunc, name |->ff_ .. name: |.endmacro | |.macro .ffunc_1, name |->ff_ .. name: | cmp NARGS:RDd, 1+1; jb ->fff_fallback |.endmacro | |.macro .ffunc_2, name |->ff_ .. name: | cmp NARGS:RDd, 2+1; jb ->fff_fallback |.endmacro | |.macro .ffunc_n, name, op | .ffunc_1 name | checknumtp [BASE], ->fff_fallback | op xmm0, qword [BASE] |.endmacro | |.macro .ffunc_n, name | .ffunc_n name, movsd |.endmacro | |.macro .ffunc_nn, name | .ffunc_2 name | checknumtp [BASE], ->fff_fallback | checknumtp [BASE+8], ->fff_fallback | movsd xmm0, qword [BASE] | movsd xmm1, qword [BASE+8] |.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 ITYPE, [BASE] | mov RB, ITYPE | sar ITYPE, 47 | cmp ITYPEd, LJ_TISTRUECOND; jae ->fff_fallback | mov PC, [BASE-8] | mov MULTRES, RDd | mov RB, [BASE] | mov [BASE-16], RB | sub RDd, 2 | jz >2 | mov RA, BASE |1: | add RA, 8 | mov RB, [RA] | mov [RA-16], RB | sub RDd, 1 | jnz <1 |2: | mov RDd, MULTRES | jmp ->fff_res_ | |.ffunc_1 type | mov RC, [BASE] | sar RC, 47 | mov RBd, LJ_TISNUM | cmp RCd, RBd | cmovb RCd, RBd | not RCd |2: | mov CFUNC:RB, [BASE-16] | cleartp CFUNC:RB | mov STR:RC, [CFUNC:RB+RC*8+((char *)(&((GCfuncC *)0)->upvalue))] | mov PC, [BASE-8] | settp STR:RC, LJ_TSTR | mov [BASE-16], STR:RC | jmp ->fff_res1 | |//-- Base library: getters and setters --------------------------------- | |.ffunc_1 getmetatable | mov TAB:RB, [BASE] | mov PC, [BASE-8] | checktab TAB:RB, >6 |1: // Field metatable must be at same offset for GCtab and GCudata! | mov TAB:RB, TAB:RB->metatable |2: | test TAB:RB, TAB:RB | mov aword [BASE-16], LJ_TNIL | jz ->fff_res1 | settp TAB:RC, TAB:RB, LJ_TTAB | mov [BASE-16], TAB:RC // Store metatable as default result. | mov STR:RC, [DISPATCH+DISPATCH_GL(gcroot)+8*(GCROOT_MMNAME+MM_metatable)] | mov RAd, TAB:RB->hmask | and RAd, STR:RC->sid | settp STR:RC, LJ_TSTR | imul RAd, #NODE | add NODE:RA, TAB:RB->node |3: // Rearranged logic, because we expect _not_ to find the key. | cmp NODE:RA->key, 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, NODE:RA->val | cmp RB, LJ_TNIL; je ->fff_res1 // Ditto for nil value. | mov [BASE-16], RB // Return value of mt.__metatable. | jmp ->fff_res1 | |6: | cmp ITYPEd, LJ_TUDATA; je <1 | cmp ITYPEd, LJ_TISNUM; ja >7 | mov ITYPEd, LJ_TISNUM |7: | not ITYPEd | mov TAB:RB, [DISPATCH+ITYPE*8+DISPATCH_GL(gcroot[GCROOT_BASEMT])] | jmp <2 | |.ffunc_2 setmetatable | mov TAB:RB, [BASE] | mov TAB:TMPR, TAB:RB | checktab TAB:RB, ->fff_fallback | // Fast path: no mt for table yet and not clearing the mt. | cmp aword TAB:RB->metatable, 0; jne ->fff_fallback | mov TAB:RA, [BASE+8] | checktab TAB:RA, ->fff_fallback | mov TAB:RB->metatable, TAB:RA | mov PC, [BASE-8] | mov [BASE-16], TAB:TMPR // Return original table. | 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 |.if X64WIN | mov TAB:RA, [BASE] | checktab TAB:RA, ->fff_fallback | mov RB, BASE // Save BASE. | lea CARG3, [BASE+8] | mov CARG2, TAB:RA // Caveat: CARG2 == BASE. | mov CARG1, SAVE_L |.else | mov TAB:CARG2, [BASE] | checktab TAB:CARG2, ->fff_fallback | mov RB, BASE // Save BASE. | lea CARG3, [BASE+8] // Caveat: CARG3 == BASE. | mov CARG1, SAVE_L |.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. | mov RB, [RD] | mov PC, [BASE-8] | mov [BASE-16], RB | jmp ->fff_res1 | |//-- Base library: conversions ------------------------------------------ | |.ffunc tonumber | // Only handles the number case inline (without a base argument). | cmp NARGS:RDd, 1+1; jne ->fff_fallback // Exactly one argument. | mov RB, [BASE] | checknumber RB, ->fff_fallback | mov PC, [BASE-8] | mov [BASE-16], RB | jmp ->fff_res1 | |.ffunc_1 tostring | // Only handles the string or number case inline. | mov PC, [BASE-8] | mov STR:RB, [BASE] | checktp_nc STR:RB, LJ_TSTR, >3 | // A __tostring method in the string base metatable is ignored. |2: | mov [BASE-16], STR:RB | jmp ->fff_res1 |3: // Handle numbers inline, unless a number base metatable is present. | cmp ITYPEd, LJ_TISNUM; ja ->fff_fallback_1 | cmp aword [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 not X64WIN | mov CARG2, BASE // Otherwise: CARG2 == BASE |.endif | mov L:CARG1, L:RB |.if DUALNUM | call extern lj_strfmt_number // (lua_State *L, cTValue *o) |.else | call extern lj_strfmt_num // (lua_State *L, lua_Number *np) |.endif | // GCstr returned in eax (RD). | mov BASE, L:RB->base | settp STR:RB, RD, LJ_TSTR | jmp <2 | |//-- Base library: iterators ------------------------------------------- | |.ffunc_1 next | je >2 // Missing 2nd arg? |1: | mov CARG1, [BASE] | mov PC, [BASE-8] | checktab CARG1, ->fff_fallback | mov RB, BASE // Save BASE. |.if X64WIN | lea CARG3, [BASE-16] | lea CARG2, [BASE+8] // Caveat: CARG2 == BASE. |.else | lea CARG2, [BASE+8] | lea CARG3, [BASE-16] // Caveat: CARG3 == BASE. |.endif | call extern lj_tab_next // (GCtab *t, cTValue *key, TValue *o) | // 1=found, 0=end, -1=error returned in eax (RD). | mov BASE, RB // Restore BASE. | test RDd, RDd; jg ->fff_res2 // Found key/value. | js ->fff_fallback_2 // Invalid key. | // End of traversal: return nil. | mov aword [BASE-16], LJ_TNIL | jmp ->fff_res1 |2: // Set missing 2nd arg to nil. | mov aword [BASE+8], LJ_TNIL | jmp <1 | |.ffunc_1 pairs | mov TAB:RB, [BASE] | mov TMPR, TAB:RB | checktab TAB:RB, ->fff_fallback #if LJ_52 | cmp aword TAB:RB->metatable, 0; jne ->fff_fallback #endif | mov CFUNC:RD, [BASE-16] | cleartp CFUNC:RD | mov CFUNC:RD, CFUNC:RD->upvalue[0] | settp CFUNC:RD, LJ_TFUNC | mov PC, [BASE-8] | mov [BASE-16], CFUNC:RD | mov [BASE-8], TMPR | mov aword [BASE], LJ_TNIL | mov RDd, 1+3 | jmp ->fff_res | |.ffunc_2 ipairs_aux | mov TAB:RB, [BASE] | checktab TAB:RB, ->fff_fallback |.if DUALNUM | mov RA, [BASE+8] | checkint RA, ->fff_fallback |.else | checknumtp [BASE+8], ->fff_fallback | movsd xmm0, qword [BASE+8] |.endif | mov PC, [BASE-8] |.if DUALNUM | add RAd, 1 | setint ITYPE, RA | mov [BASE-16], ITYPE |.else | sseconst_1 xmm1, TMPR | addsd xmm0, xmm1 | cvttsd2si RAd, xmm0 | movsd qword [BASE-16], xmm0 |.endif | cmp RAd, TAB:RB->asize; jae >2 // Not in array part? | mov RD, TAB:RB->array | lea RD, [RD+RA*8] |1: | cmp aword [RD], LJ_TNIL; je ->fff_res0 | // Copy array slot. | mov RB, [RD] | mov [BASE-8], RB |->fff_res2: | mov RDd, 1+2 | jmp ->fff_res |2: // Check for empty hash part first. Otherwise call C function. | cmp dword TAB:RB->hmask, 0; je ->fff_res0 |.if X64WIN | mov TMPR, BASE | mov CARG2d, RAd | mov CARG1, TAB:RB | mov RB, TMPR |.else | mov CARG1, TAB:RB | mov RB, BASE // Save BASE. | mov CARG2d, RAd // Caveat: CARG2 == BASE |.endif | call extern lj_tab_getinth // (GCtab *t, int32_t key) | // cTValue * or NULL returned in eax (RD). | mov BASE, RB | test RD, RD | jnz <1 |->fff_res0: | mov RDd, 1+0 | jmp ->fff_res | |.ffunc_1 ipairs | mov TAB:RB, [BASE] | mov TMPR, TAB:RB | checktab TAB:RB, ->fff_fallback #if LJ_52 | cmp aword TAB:RB->metatable, 0; jne ->fff_fallback #endif | mov CFUNC:RD, [BASE-16] | cleartp CFUNC:RD | mov CFUNC:RD, CFUNC:RD->upvalue[0] | settp CFUNC:RD, LJ_TFUNC | mov PC, [BASE-8] | mov [BASE-16], CFUNC:RD | mov [BASE-8], TMPR |.if DUALNUM | mov64 RD, ((uint64_t)LJ_TISNUM<<47) | mov [BASE], RD |.else | mov qword [BASE], 0 |.endif | mov RDd, 1+3 | jmp ->fff_res | |//-- Base library: catch errors ---------------------------------------- | |.ffunc_1 pcall | mov L:RB, SAVE_L | lea RA, [BASE+NARGS:RD*8] | cmp RA, L:RB->maxstack; ja ->fff_fallback | lea RA, [BASE+16] | sub NARGS:RDd, 1 | mov PCd, 16+FRAME_PCALL |1: | movzx RBd, byte [DISPATCH+DISPATCH_GL(hookmask)] | shr RB, HOOK_ACTIVE_SHIFT | and RB, 1 | add PC, RB // Remember active hook before pcall. | // Note: this does a (harmless) copy of the function to the PC slot, too. | mov KBASE, RD |2: | mov RB, [RA+KBASE*8-24] | mov [RA+KBASE*8-16], RB | sub KBASE, 1 | ja <2 | jmp ->vm_call_dispatch | |.ffunc_2 xpcall | mov L:RB, SAVE_L | lea RA, [BASE+NARGS:RD*8] | cmp RA, L:RB->maxstack; ja ->fff_fallback | mov LFUNC:RA, [BASE+8] | checktp_nc LFUNC:RA, LJ_TFUNC, ->fff_fallback | mov LFUNC:RB, [BASE] // Swap function and traceback. | mov [BASE], LFUNC:RA | mov [BASE+8], LFUNC:RB | lea RA, [BASE+24] | sub NARGS:RDd, 2 | mov PCd, 24+FRAME_PCALL | jmp <1 | |//-- Coroutine library -------------------------------------------------- | |.macro coroutine_resume_wrap, resume |.if resume |.ffunc_1 coroutine_resume | mov L:RB, [BASE] | cleartp L:RB |.else |.ffunc coroutine_wrap_aux | mov CFUNC:RB, [BASE-16] | cleartp CFUNC:RB | mov L:RB, CFUNC:RB->upvalue[0].gcr | cleartp L:RB |.endif | mov PC, [BASE-8] | mov SAVE_PC, PC | mov TMP1, L:RB |.if resume | checktptp [BASE], LJ_TTHREAD, ->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 | mov PC, [RA-8] // Move initial function up. | mov [RA], PC | add RA, 8 |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 RB, PC // Relative to PC. | | cmp PC, RA | je >3 |2: // Move args to coroutine. | mov RC, [PC+RB] | mov [PC-8], RC | sub PC, 8 | cmp PC, RA | jne <2 |3: | mov CARG2, RA | mov CARG1, TMP1 | call ->vm_resume // (lua_State *L, TValue *base, 0, 0) | | mov L:RB, SAVE_L | mov L:PC, TMP1 | mov BASE, L:RB->base | mov [DISPATCH+DISPATCH_GL(cur_L)], L:RB | set_vmstate INTERP | | 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 PCd, 3 | cmp RD, L:RB->maxstack | ja >9 // Need to grow stack? | | mov RB, BASE | sub RB, RA |5: // Move results from coroutine. | mov RD, [RA] | mov [RA+RB], RD | add RA, 8 | cmp RA, KBASE | jne <5 |6: |.if resume | lea RDd, [PCd+2] // nresults+1 = 1 + true + results. | mov_true ITYPE // Prepend true to results. | mov [BASE-8], ITYPE |.else | lea RDd, [PCd+1] // nresults+1 = 1 + results. |.endif |7: | mov PC, SAVE_PC | mov MULTRES, RDd |.if resume | mov RA, -8 |.else | xor RAd, RAd |.endif | test PCd, FRAME_TYPE | jz ->BC_RET_Z | jmp ->vm_return | |8: // Coroutine returned with error (at co->top-1). |.if resume | mov_false ITYPE // Prepend false to results. | mov [BASE-8], ITYPE | mov RA, L:PC->top | sub RA, 8 | mov L:PC->top, RA // Clear error from coroutine stack. | // Copy error message. | mov RD, [RA] | mov [BASE], RD | mov RDd, 1+2 // nresults+1 = 1 + false + error. | jmp <7 |.else | mov CARG2, L:PC | mov CARG1, L:RB | call extern lj_ffh_coroutine_wrap_err // (lua_State *L, lua_State *co) | // Error function does not return. |.endif | |9: // Handle stack expansion on return from yield. | mov L:RA, TMP1 | mov L:RA->top, KBASE // Undo coroutine stack clearing. | mov CARG2, PC | mov CARG1, L:RB | call extern lj_state_growstack // (lua_State *L, int n) | mov L:PC, TMP1 | 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 RDd, RDd | mov aword L:RB->cframe, RD | mov al, LUA_YIELD | mov byte L:RB->status, al | jmp ->vm_leave_unw | |//-- Math library ------------------------------------------------------- | | .ffunc_1 math_abs | mov RB, [BASE] |.if DUALNUM | checkint RB, >3 | cmp RBd, 0; jns ->fff_resi | neg RBd; js >2 |->fff_resbit: |->fff_resi: | setint RB |->fff_resRB: | mov PC, [BASE-8] | mov [BASE-16], RB | jmp ->fff_res1 |2: | mov64 RB, U64x(41e00000,00000000) // 2^31. | jmp ->fff_resRB |3: | ja ->fff_fallback |.else | checknum RB, ->fff_fallback |.endif | shl RB, 1 | shr RB, 1 | mov PC, [BASE-8] | mov [BASE-16], RB | jmp ->fff_res1 | |.ffunc_n math_sqrt, sqrtsd |->fff_resxmm0: | mov PC, [BASE-8] | movsd qword [BASE-16], xmm0 | // fallthrough | |->fff_res1: | mov RDd, 1+1 |->fff_res: | mov MULTRES, RDd |->fff_res_: | test PCd, 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 RAd, PC_RA | neg RA | lea BASE, [BASE+RA*8-16] // base = base - (RA+2)*8 | ins_next | |6: // Fill up results with nil. | mov aword [BASE+RD*8-24], LJ_TNIL | add RD, 1 | jmp <5 | |7: // Non-standard return case. | mov RA, -16 // Results start at BASE+RA = BASE-16. | jmp ->vm_return | |.macro math_round, func | .ffunc math_ .. func |.if DUALNUM | mov RB, [BASE] | checknumx RB, ->fff_resRB, je | ja ->fff_fallback |.else | checknumtp [BASE], ->fff_fallback |.endif | movsd xmm0, qword [BASE] | call ->vm_ .. func .. _sse |.if DUALNUM | cvttsd2si RBd, xmm0 | cmp RBd, 0x80000000 | jne ->fff_resi | cvtsi2sd xmm1, RBd | ucomisd xmm0, xmm1 | jp ->fff_resxmm0 | je ->fff_resi |.endif | jmp ->fff_resxmm0 |.endmacro | | math_round floor | math_round ceil | |.ffunc math_log | cmp NARGS:RDd, 1+1; jne ->fff_fallback // Exactly one argument. | checknumtp [BASE], ->fff_fallback | movsd xmm0, qword [BASE] | mov RB, BASE | call extern log | mov BASE, RB | jmp ->fff_resxmm0 | |.macro math_extern, func | .ffunc_n math_ .. func | mov RB, BASE | call extern func | mov BASE, RB | jmp ->fff_resxmm0 |.endmacro | |.macro math_extern2, func | .ffunc_nn math_ .. func | mov RB, BASE | call extern func | mov BASE, RB | jmp ->fff_resxmm0 |.endmacro | | 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_2 math_ldexp | checknumtp [BASE], ->fff_fallback | checknumtp [BASE+8], ->fff_fallback | fld qword [BASE+8] | fld qword [BASE] | fscale | fpop1 | mov PC, [BASE-8] | fstp qword [BASE-16] | jmp ->fff_res1 | |.ffunc_n math_frexp | mov RB, BASE |.if X64WIN | lea CARG2, TMP1 // Caveat: CARG2 == BASE |.else | lea CARG1, TMP1 |.endif | call extern frexp | mov BASE, RB | mov RBd, TMP1d | mov PC, [BASE-8] | movsd qword [BASE-16], xmm0 |.if DUALNUM | setint RB | mov [BASE-8], RB |.else | cvtsi2sd xmm1, RBd | movsd qword [BASE-8], xmm1 |.endif | mov RDd, 1+2 | jmp ->fff_res | |.ffunc_n math_modf | mov RB, BASE |.if X64WIN | lea CARG2, [BASE-16] // Caveat: CARG2 == BASE |.else | lea CARG1, [BASE-16] |.endif | call extern modf | mov BASE, RB | mov PC, [BASE-8] | movsd qword [BASE-8], xmm0 | mov RDd, 1+2 | jmp ->fff_res | |.macro math_minmax, name, cmovop, sseop | .ffunc_1 name | mov RAd, 2 |.if DUALNUM | mov RB, [BASE] | checkint RB, >4 |1: // Handle integers. | cmp RAd, RDd; jae ->fff_resRB | mov TMPR, [BASE+RA*8-8] | checkint TMPR, >3 | cmp RBd, TMPRd | cmovop RB, TMPR | add RAd, 1 | jmp <1 |3: | ja ->fff_fallback | // Convert intermediate result to number and continue below. | cvtsi2sd xmm0, RBd | jmp >6 |4: | ja ->fff_fallback |.else | checknumtp [BASE], ->fff_fallback |.endif | | movsd xmm0, qword [BASE] |5: // Handle numbers or integers. | cmp RAd, RDd; jae ->fff_resxmm0 |.if DUALNUM | mov RB, [BASE+RA*8-8] | checknumx RB, >6, jb | ja ->fff_fallback | cvtsi2sd xmm1, RBd | jmp >7 |.else | checknumtp [BASE+RA*8-8], ->fff_fallback |.endif |6: | movsd xmm1, qword [BASE+RA*8-8] |7: | sseop xmm0, xmm1 | add RAd, 1 | jmp <5 |.endmacro | | math_minmax math_min, cmovg, minsd | math_minmax math_max, cmovl, maxsd | |//-- String library ----------------------------------------------------- | |.ffunc string_byte // Only handle the 1-arg case here. | cmp NARGS:RDd, 1+1; jne ->fff_fallback | mov STR:RB, [BASE] | checkstr STR:RB, ->fff_fallback | mov PC, [BASE-8] | cmp dword STR:RB->len, 1 | jb ->fff_res0 // Return no results for empty string. | movzx RBd, byte STR:RB[1] |.if DUALNUM | jmp ->fff_resi |.else | cvtsi2sd xmm0, RBd; jmp ->fff_resxmm0 |.endif | |.ffunc string_char // Only handle the 1-arg case here. | ffgccheck | cmp NARGS:RDd, 1+1; jne ->fff_fallback // *Exactly* 1 arg. |.if DUALNUM | mov RB, [BASE] | checkint RB, ->fff_fallback |.else | checknumtp [BASE], ->fff_fallback | cvttsd2si RBd, qword [BASE] |.endif | cmp RBd, 255; ja ->fff_fallback | mov TMP1d, RBd | mov TMPRd, 1 | lea RD, TMP1 // Points to stack. Little-endian. |->fff_newstr: | mov L:RB, SAVE_L | mov L:RB->base, BASE | mov CARG3d, TMPRd // Zero-extended to size_t. | mov CARG2, RD | mov CARG1, L:RB | mov SAVE_PC, PC | call extern lj_str_new // (lua_State *L, char *str, size_t l) |->fff_resstr: | // GCstr * returned in eax (RD). | mov BASE, L:RB->base | mov PC, [BASE-8] | settp STR:RD, LJ_TSTR | mov [BASE-16], STR:RD | jmp ->fff_res1 | |.ffunc string_sub | ffgccheck | mov TMPRd, -1 | cmp NARGS:RDd, 1+2; jb ->fff_fallback | jna >1 |.if DUALNUM | mov TMPR, [BASE+16] | checkint TMPR, ->fff_fallback |.else | checknumtp [BASE+16], ->fff_fallback | cvttsd2si TMPRd, qword [BASE+16] |.endif |1: | mov STR:RB, [BASE] | checkstr STR:RB, ->fff_fallback |.if DUALNUM | mov ITYPE, [BASE+8] | mov RAd, ITYPEd // Must clear hiword for lea below. | sar ITYPE, 47 | cmp ITYPEd, LJ_TISNUM | jne ->fff_fallback |.else | checknumtp [BASE+8], ->fff_fallback | cvttsd2si RAd, qword [BASE+8] |.endif | mov RCd, STR:RB->len | cmp RCd, TMPRd // len < end? (unsigned compare) | jb >5 |2: | test RAd, RAd // start <= 0? | jle >7 |3: | sub TMPRd, RAd // start > end? | jl ->fff_emptystr | lea RD, [STR:RB+RAd+#STR-1] | add TMPRd, 1 |4: | jmp ->fff_newstr | |5: // Negative end or overflow. | jl >6 | lea TMPRd, [TMPRd+RCd+1] // end = end+(len+1) | jmp <2 |6: // Overflow. | mov TMPRd, RCd // end = len | jmp <2 | |7: // Negative start or underflow. | je >8 | add RAd, RCd // start = start+(len+1) | add RAd, 1 | jg <3 // start > 0? |8: // Underflow. | mov RAd, 1 // start = 1 | jmp <3 | |->fff_emptystr: // Range underflow. | xor TMPRd, TMPRd // Zero length. Any ptr in RD is ok. | jmp <4 | |.macro ffstring_op, name | .ffunc_1 string_ .. name | ffgccheck |.if X64WIN | mov STR:TMPR, [BASE] | checkstr STR:TMPR, ->fff_fallback |.else | mov STR:CARG2, [BASE] | checkstr STR:CARG2, ->fff_fallback |.endif | mov L:RB, SAVE_L | lea SBUF:CARG1, [DISPATCH+DISPATCH_GL(tmpbuf)] | mov L:RB->base, BASE |.if X64WIN | mov STR:CARG2, STR:TMPR // Caveat: CARG2 == BASE |.endif | mov RC, SBUF:CARG1->b | mov SBUF:CARG1->L, L:RB | mov SBUF:CARG1->w, RC | mov SAVE_PC, PC | call extern lj_buf_putstr_ .. name | mov CARG1, rax | call extern lj_buf_tostr | jmp ->fff_resstr |.endmacro | |ffstring_op reverse |ffstring_op lower |ffstring_op upper | |//-- Bit library -------------------------------------------------------- | |.macro .ffunc_bit, name, kind, fdef | fdef name |.if kind == 2 | sseconst_tobit xmm1, RB |.endif |.if DUALNUM | mov RB, [BASE] | checkint RB, >1 |.if kind > 0 | jmp >2 |.else | jmp ->fff_resbit |.endif |1: | ja ->fff_fallback | movd xmm0, RB |.else | checknumtp [BASE], ->fff_fallback | movsd xmm0, qword [BASE] |.endif |.if kind < 2 | sseconst_tobit xmm1, RB |.endif | addsd xmm0, xmm1 | movd RBd, xmm0 |2: |.endmacro | |.macro .ffunc_bit, name, kind | .ffunc_bit name, kind, .ffunc_1 |.endmacro | |.ffunc_bit bit_tobit, 0 | jmp ->fff_resbit | |.macro .ffunc_bit_op, name, ins | .ffunc_bit name, 2 | mov TMPRd, NARGS:RDd // Save for fallback. | lea RD, [BASE+NARGS:RD*8-16] |1: | cmp RD, BASE | jbe ->fff_resbit |.if DUALNUM | mov RA, [RD] | checkint RA, >2 | ins RBd, RAd | sub RD, 8 | jmp <1 |2: | ja ->fff_fallback_bit_op | movd xmm0, RA |.else | checknumtp [RD], ->fff_fallback_bit_op | movsd xmm0, qword [RD] |.endif | addsd xmm0, xmm1 | movd RAd, xmm0 | ins RBd, RAd | 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 RBd | jmp ->fff_resbit | |.ffunc_bit bit_bnot, 1 | not RBd |.if DUALNUM | jmp ->fff_resbit |.else |->fff_resbit: | cvtsi2sd xmm0, RBd | jmp ->fff_resxmm0 |.endif | |->fff_fallback_bit_op: | mov NARGS:RDd, TMPRd // 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! | mov RA, [BASE+8] | checkint RA, ->fff_fallback |.else | .ffunc_nn name | sseconst_tobit xmm2, RB | addsd xmm0, xmm2 | addsd xmm1, xmm2 | movd RBd, xmm0 | movd RAd, xmm1 |.endif | ins RBd, 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:RDd, 1+2 // Other args are ignored, anyway. | jmp ->fff_fallback |->fff_fallback_1: | mov NARGS:RDd, 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-8] // 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-16] | cleartp CFUNC:RD | cmp RA, L:RB->maxstack | ja >5 // Need to grow stack. | mov CARG1, L:RB | 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 RDd, RDd; jg ->fff_res // Returned nresults+1? |1: | mov RA, L:RB->top | sub RA, BASE | shr RAd, 3 | test RDd, RDd | lea NARGS:RDd, [RAd+1] | mov LFUNC:RB, [BASE-16] | jne ->vm_call_tail // Returned -1? | cleartp LFUNC:RB | ins_callt // Returned 0: retry fast path. | |// Reconstruct previous base for vmeta_call during tailcall. |->vm_call_tail: | mov RA, BASE | test PCd, FRAME_TYPE | jnz >3 | movzx RBd, PC_RA | neg RB | lea BASE, [BASE+RB*8-16] // base = base - (RB+2)*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 CARG2d, LUA_MINSTACK | mov CARG1, L:RB | call extern lj_state_growstack // (lua_State *L, int n) | mov BASE, L:RB->base | xor RDd, RDd // 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 RB // Must keep stack at same level. | mov TMP1, RB // 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 CARG1, L:RB | mov L:RB->top, RD | call extern lj_gc_step // (lua_State *L) | mov BASE, L:RB->base | mov RD, L:RB->top | sub RD, BASE | shr RDd, 3 | add NARGS:RDd, 1 | mov RB, TMP1 | push RB // Restore return address. | ret | |//----------------------------------------------------------------------- |//-- Special dispatch targets ------------------------------------------- |//----------------------------------------------------------------------- | |->vm_record: // Dispatch target for recording phase. |.if JIT | movzx RDd, 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 RDd, 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 RDd, 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 CARG2, PC // Caveat: CARG2 == BASE | mov CARG1, L:RB | // SAVE_PC must hold the _previous_ PC. The callee updates it with PC. | call extern lj_dispatch_ins // (lua_State *L, const BCIns *pc) |3: | mov BASE, L:RB->base |4: | movzx RAd, PC_RA |5: | movzx OP, PC_OP | movzx RDd, PC_RD | jmp aword [DISPATCH+OP*8+GG_DISP2STATIC] // Re-dispatch to static ins. | |->cont_hook: // Continue from hook yield. | add PC, 4 | mov RA, [RB-40] | mov MULTRES, RAd // Restore MULTRES for *M ins. | jmp <4 | |->vm_hotloop: // Hot loop counter underflow. |.if JIT | mov LFUNC:RB, [BASE-16] // Same as curr_topL(L). | cleartp LFUNC:RB | mov RB, LFUNC:RB->pc | movzx RDd, 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 CARG2, PC | lea CARG1, [DISPATCH+GG_DISP2J] | mov aword [DISPATCH+DISPATCH_J(L)], L:RB | mov SAVE_PC, PC | call extern lj_trace_hot // (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 CARG2, PC | mov CARG1, L:RB | call extern lj_dispatch_call // (lua_State *L, const BCIns *pc) | // ASMFunction returned in eax/rax (RD). | mov SAVE_PC, 0 // Invalidate for subsequent line hook. |.if JIT | and PC, -2 |.endif | mov BASE, L:RB->base | mov RA, RD | mov RD, L:RB->top | sub RD, BASE | mov RB, RA | movzx RAd, PC_RA | shr RDd, 3 | add NARGS:RDd, 1 | jmp RB | |->cont_stitch: // Trace stitching. |.if JIT | // BASE = base, RC = result, RB = mbase | mov TRACE:ITYPE, [RB-40] // Save previous trace. | cleartp TRACE:ITYPE | mov TMPRd, MULTRES | movzx RAd, PC_RA | lea RA, [BASE+RA*8] // Call base. | sub TMPRd, 1 | jz >2 |1: // Move results down. | mov RB, [RC] | mov [RA], RB | add RC, 8 | add RA, 8 | sub TMPRd, 1 | jnz <1 |2: | movzx RCd, PC_RA | movzx RBd, PC_RB | add RC, RB | lea RC, [BASE+RC*8-8] |3: | cmp RC, RA | ja >9 // More results wanted? | | test TRACE:ITYPE, TRACE:ITYPE | jz ->cont_nop | movzx RBd, word TRACE:ITYPE->traceno | movzx RDd, word TRACE:ITYPE->link | cmp RDd, RBd | je ->cont_nop // Blacklisted. | test RDd, RDd | jne =>BC_JLOOP // Jump to stitched trace. | | // Stitch a new trace to the previous trace. | mov [DISPATCH+DISPATCH_J(exitno)], RB | mov L:RB, SAVE_L | mov L:RB->base, BASE | mov CARG2, PC | lea CARG1, [DISPATCH+GG_DISP2J] | mov aword [DISPATCH+DISPATCH_J(L)], L:RB | call extern lj_dispatch_stitch // (jit_State *J, const BCIns *pc) | mov BASE, L:RB->base | jmp ->cont_nop | |9: // Fill up results with nil. | mov aword [RA], LJ_TNIL | add RA, 8 | jmp <3 |.endif | |->vm_profhook: // Dispatch target for profiler hook. #if LJ_HASPROFILE | mov L:RB, SAVE_L | mov L:RB->base, BASE | mov CARG2, PC // Caveat: CARG2 == BASE | mov CARG1, L:RB | call extern lj_dispatch_profile // (lua_State *L, const BCIns *pc) | mov BASE, L:RB->base | // HOOK_PROFILE is off again, so re-dispatch to dynamic instruction. | sub PC, 4 | jmp ->cont_nop #endif | |//----------------------------------------------------------------------- |//-- 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 | 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 RCd, byte [rbp-8] // Reconstruct exit number. | mov RCH, byte [rbp-16] | mov [rbp-8], r15; mov [rbp-16], r14 | // DISPATCH is preserved on-trace in LJ_GC64 mode. | mov RAd, [DISPATCH+DISPATCH_GL(vmstate)] // Get trace number. | set_vmstate EXIT | mov [DISPATCH+DISPATCH_J(exitno)], RCd | mov [DISPATCH+DISPATCH_J(parent)], RAd |.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 | // Caveat: RB is rbp. | mov L:RB, [DISPATCH+DISPATCH_GL(cur_L)] | mov BASE, [DISPATCH+DISPATCH_GL(jit_base)] | mov aword [DISPATCH+DISPATCH_J(L)], L:RB | mov L:RB->base, BASE |.if X64WIN | lea CARG2, [rsp+4*8] |.else | mov CARG2, rsp |.endif | lea CARG1, [DISPATCH+GG_DISP2J] | mov qword [DISPATCH+DISPATCH_GL(jit_base)], 0 | call extern lj_trace_exit // (jit_State *J, ExitState *ex) | // MULTRES or negated error code returned in eax (RD). | mov RA, L:RB->cframe | and RA, CFRAME_RAWMASK | mov [RA+CFRAME_OFS_L], L:RB // Set SAVE_L (on-trace resume/yield). | mov BASE, L:RB->base | mov PC, [RA+CFRAME_OFS_PC] // Get SAVE_PC. | jmp >1 |.endif |->vm_exit_interp: | // RD = MULTRES or negated error code, BASE, PC and DISPATCH set. |.if JIT | // Restore additional callee-save registers only used in compiled code. |.if X64WIN | lea RA, [rsp+10*16+4*8] |1: | movdqa xmm15, [RA-10*16] | movdqa xmm14, [RA-9*16] | movdqa xmm13, [RA-8*16] | movdqa xmm12, [RA-7*16] | movdqa xmm11, [RA-6*16] | movdqa xmm10, [RA-5*16] | movdqa xmm9, [RA-4*16] | movdqa xmm8, [RA-3*16] | movdqa xmm7, [RA-2*16] | mov rsp, RA // Reposition stack to C frame. | movdqa xmm6, [RA-1*16] | mov r15, CSAVE_1 | mov r14, CSAVE_2 | mov r13, CSAVE_3 | mov r12, CSAVE_4 |.else | lea RA, [rsp+16] |1: | mov r13, [RA-8] | mov r12, [RA] | mov rsp, RA // Reposition stack to C frame. |.endif | cmp RDd, -LUA_ERRERR; jae >9 // Check for error from exit. | mov L:RB, SAVE_L | mov MULTRES, RDd | mov LFUNC:KBASE, [BASE-16] | cleartp LFUNC:KBASE | mov KBASE, LFUNC:KBASE->pc | mov KBASE, [KBASE+PC2PROTO(k)] | mov L:RB->base, BASE | mov qword [DISPATCH+DISPATCH_GL(jit_base)], 0 | set_vmstate INTERP | // Modified copy of ins_next which handles function header dispatch, too. | mov RCd, [PC] | movzx RAd, RCH | movzx OP, RCL | add PC, 4 | shr RCd, 16 | cmp MULTRES, -17 // Static dispatch? | je >5 | cmp OP, BC_FUNCF // Function header? | jb >3 | cmp OP, BC_FUNCC+2 // Fast function? | jae >4 |2: | mov RCd, MULTRES // RC/RD holds nres+1. |3: | jmp aword [DISPATCH+OP*8] | |4: // Check frame below fast function. | mov RC, [BASE-8] | test RCd, FRAME_TYPE | jnz <2 // Trace stitching continuation? | // Otherwise set KBASE for Lua function below fast function. | movzx RCd, byte [RC-3] | neg RC | mov LFUNC:KBASE, [BASE+RC*8-32] | cleartp LFUNC:KBASE | mov KBASE, LFUNC:KBASE->pc | mov KBASE, [KBASE+PC2PROTO(k)] | jmp <2 | |5: // Dispatch to static entry of original ins replaced by BC_JLOOP. | mov RA, [DISPATCH+DISPATCH_J(trace)] | mov TRACE:RA, [RA+RD*8] | mov RCd, TRACE:RA->startins | movzx RAd, RCH | movzx OP, RCL | shr RCd, 16 | jmp aword [DISPATCH+OP*8+GG_DISP2STATIC] | |9: // Rethrow error from the right C frame. | mov CARG2d, RDd | mov CARG1, L:RB | neg CARG2d | call extern lj_err_trace // (lua_State *L, int errcode) |.endif | |//----------------------------------------------------------------------- |//-- Math helper functions ---------------------------------------------- |//----------------------------------------------------------------------- | |// FP value rounding. Called by math.floor/math.ceil fast functions |// and from JIT code. arg/ret is xmm0. xmm0-xmm3 and RD (eax) modified. |.macro vm_round, name, mode, cond |->name: |->name .. _sse: | sseconst_abs xmm2, RD | sseconst_2p52 xmm3, RD | 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, RD | 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. | sseconst_1 xmm3, RD | .if mode == 1 // ceil(x)? | cmpsd xmm0, xmm1, 6 // x > result? | andpd xmm0, xmm3 | addsd xmm1, xmm0 // If yes, add 1. | orpd xmm1, xmm2 // Merge sign bit back in (again). | .else // floor(x)? | cmpsd xmm0, xmm1, 1 // x < result? | andpd xmm0, xmm3 | subsd xmm1, xmm0 // If yes, subtract 1. | .endif |.endif | movaps xmm0, xmm1 |1: | ret |.endmacro | | vm_round vm_floor, 0, 1 | vm_round vm_ceil, 1, JIT | vm_round vm_trunc, 2, JIT | |// FP modulo x%y. Called by BC_MOD* and vm_arith. |->vm_mod: |// Args in xmm0/xmm1, return value in xmm0. |// Caveat: xmm0-xmm5 and RC (eax) modified! | movaps xmm5, xmm0 | divsd xmm0, xmm1 | sseconst_abs xmm2, RD | sseconst_2p52 xmm3, RD | 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, RD | 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 | |//----------------------------------------------------------------------- |//-- Miscellaneous functions -------------------------------------------- |//----------------------------------------------------------------------- | |// int lj_vm_cpuid(uint32_t f, uint32_t res[4]) |->vm_cpuid: | mov eax, CARG1d | .if X64WIN; push rsi; mov rsi, CARG2; .endif | push rbx | xor ecx, ecx | cpuid | mov [rsi], eax | mov [rsi+4], ebx | mov [rsi+8], ecx | mov [rsi+12], edx | pop rbx | .if X64WIN; pop rsi; .endif | ret | |.define NEXT_TAB, TAB:CARG1 |.define NEXT_IDX, CARG2d |.define NEXT_IDXa, CARG2 |.define NEXT_PTR, RC |.define NEXT_PTRd, RCd |.define NEXT_TMP, CARG3 |.define NEXT_ASIZE, CARG4d |.macro NEXT_RES_IDXL, op2; lea edx, [NEXT_IDX+op2]; .endmacro |.if X64WIN |.define NEXT_RES_PTR, [rsp+aword*5] |.macro NEXT_RES_IDX, op2; add NEXT_IDX, op2; .endmacro |.else |.define NEXT_RES_PTR, [rsp+aword*1] |.macro NEXT_RES_IDX, op2; lea edx, [NEXT_IDX+op2]; .endmacro |.endif | |// TValue *lj_vm_next(GCtab *t, uint32_t idx) |// Next idx returned in edx. |->vm_next: |.if JIT | mov NEXT_ASIZE, NEXT_TAB->asize |1: // Traverse array part. | cmp NEXT_IDX, NEXT_ASIZE; jae >5 | mov NEXT_TMP, NEXT_TAB->array | mov NEXT_TMP, qword [NEXT_TMP+NEXT_IDX*8] | cmp NEXT_TMP, LJ_TNIL; je >2 | lea NEXT_PTR, NEXT_RES_PTR | mov qword [NEXT_PTR], NEXT_TMP |.if DUALNUM | setint NEXT_TMP, NEXT_IDXa | mov qword [NEXT_PTR+qword*1], NEXT_TMP |.else | cvtsi2sd xmm0, NEXT_IDX | movsd qword [NEXT_PTR+qword*1], xmm0 |.endif | NEXT_RES_IDX 1 | ret |2: // Skip holes in array part. | add NEXT_IDX, 1 | jmp <1 | |5: // Traverse hash part. | sub NEXT_IDX, NEXT_ASIZE |6: | cmp NEXT_IDX, NEXT_TAB->hmask; ja >9 | imul NEXT_PTRd, NEXT_IDX, #NODE | add NODE:NEXT_PTR, NEXT_TAB->node | cmp qword NODE:NEXT_PTR->val, LJ_TNIL; je >7 | NEXT_RES_IDXL NEXT_ASIZE+1 | ret |7: // Skip holes in hash part. | add NEXT_IDX, 1 | jmp <6 | |9: // End of iteration. Set the key to nil (not the value). | NEXT_RES_IDX NEXT_ASIZE | lea NEXT_PTR, NEXT_RES_PTR | mov qword [NEXT_PTR+qword*1], LJ_TNIL | 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 | 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 | 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 | mov SAVE_PC, CTSTATE // Any value outside of bytecode is ok. | mov CARG1, CTSTATE | call extern lj_ccallback_enter // (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-16] | cleartp LFUNC:RB | 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:RA | mov L:RA->base, BASE | mov L:RA->top, RB | mov CARG1, CTSTATE | mov CARG2, RC | call extern lj_ccallback_leave // (CTState *cts, TValue *o) | mov rax, CTSTATE->cb.gpr[0] | movsd xmm0, qword CTSTATE->cb.fpr[0] | jmp ->vm_leave_unw |.endif | |->vm_ffi_call: // Call C function via FFI. | // Caveat: needs special frame unwinding, see below. |.if FFI | .type CCSTATE, CCallState, rbx | push rbp; mov rbp, rsp; push rbx; mov CCSTATE, CARG1 | | // Readjust stack. | mov eax, CCSTATE->spadj | sub rsp, rax | | // Copy stack slots. | movzx ecx, byte CCSTATE->nsp | sub ecx, 8 | js >2 |1: | mov rax, [CCSTATE+rcx+offsetof(CCallState, stack)] | mov [rsp+rcx+CCALL_SPS_EXTRA*8], rax | sub ecx, 8 | jns <1 |2: | | 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: | | call aword CCSTATE->func | | mov CCSTATE->gpr[0], rax | movaps CCSTATE->fpr[0], xmm0 |.if not X64WIN | mov CCSTATE->gpr[1], rdx | movaps CCSTATE->fpr[1], xmm1 |.endif | | mov rbx, [rbp-8]; leave; ret |.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 | mov ITYPE, [BASE+RA*8] | mov RB, [BASE+RD*8] | mov RA, ITYPE | mov RD, RB | sar ITYPE, 47 | sar RB, 47 |.if DUALNUM | cmp ITYPEd, LJ_TISNUM; jne >7 | cmp RBd, LJ_TISNUM; jne >8 | add PC, 4 | cmp RAd, RDd | jmp_comp jge, jl, jg, jle, >9 |6: | movzx RDd, PC_RD | branchPC RD |9: | ins_next | |7: // RA is not an integer. | ja ->vmeta_comp | // RA is a number. | cmp RBd, LJ_TISNUM; jb >1; jne ->vmeta_comp | // RA is a number, RD is an integer. | cvtsi2sd xmm0, RDd | jmp >2 | |8: // RA is an integer, RD is not an integer. | ja ->vmeta_comp | // RA is an integer, RD is a number. | cvtsi2sd xmm1, RAd | movd xmm0, RD | jmp >3 |.else | cmp ITYPEd, LJ_TISNUM; jae ->vmeta_comp | cmp RBd, LJ_TISNUM; jae ->vmeta_comp |.endif |1: | movd xmm0, RD |2: | movd xmm1, RA |3: | add PC, 4 | ucomisd xmm0, xmm1 | // 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 RDd, 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] | mov ITYPE, [BASE+RA*8] | add PC, 4 | mov RD, RB | mov RA, ITYPE | sar RB, 47 | sar ITYPE, 47 |.if DUALNUM | cmp RBd, LJ_TISNUM; jne >7 | cmp ITYPEd, LJ_TISNUM; jne >8 | cmp RDd, RAd if (vk) { | jne >9 } else { | je >9 } | movzx RDd, PC_RD | branchPC RD |9: | ins_next | |7: // RD is not an integer. | ja >5 | // RD is a number. | movd xmm1, RD | cmp ITYPEd, LJ_TISNUM; jb >1; jne >5 | // RD is a number, RA is an integer. | cvtsi2sd xmm0, RAd | jmp >2 | |8: // RD is an integer, RA is not an integer. | ja >5 | // RD is an integer, RA is a number. | cvtsi2sd xmm1, RDd | jmp >1 | |.else | cmp RBd, LJ_TISNUM; jae >5 | cmp ITYPEd, LJ_TISNUM; jae >5 | movd xmm1, RD |.endif |1: | movd xmm0, RA |2: | ucomisd xmm0, xmm1 |4: 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 RDd, 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 RDd, 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 RBd, LJ_TCDATA; je ->vmeta_equal_cd | cmp ITYPEd, LJ_TCDATA; je ->vmeta_equal_cd |.endif | cmp RA, RD | je <1 // Same GCobjs or pvalues? | cmp RBd, ITYPEd | jne <2 // Not the same type? | cmp RBd, LJ_TISTABUD | ja <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! | cleartp TAB:RA | 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 ITYPEd, 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] | add PC, 4 | checkstr RB, >3 | cmp RB, [KBASE+RD*8] 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] | add PC, 4 |.if DUALNUM | checkint RB, >7 | mov RD, [KBASE+RD*8] | checkint RD, >8 | cmp RBd, RDd if (vk) { | jne >9 } else { | je >9 } | movzx RDd, PC_RD | branchPC RD |9: | ins_next | |7: // RA is not an integer. | ja >3 | // RA is a number. | mov RD, [KBASE+RD*8] | checkint RD, >1 | // RA is a number, RD is an integer. | cvtsi2sd xmm0, RDd | jmp >2 | |8: // RA is an integer, RD is a number. | cvtsi2sd xmm0, RBd | movd xmm1, RD | ucomisd xmm0, xmm1 | jmp >4 |1: | movd xmm0, RD |.else | checknum RB, >3 |1: | movsd xmm0, qword [KBASE+RD*8] |.endif |2: | ucomisd xmm0, qword [BASE+RA*8] |4: 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] | sar RB, 47 | add PC, 4 | cmp RBd, RDd if (!LJ_HASFFI) goto iseqne_test; if (vk) { | jne >3 | movzx RDd, PC_RD | branchPC RD |2: | ins_next |3: | cmp RBd, LJ_TCDATA; jne <2 | jmp ->vmeta_equal_cd } else { | je >2 | cmp RBd, LJ_TCDATA; je ->vmeta_equal_cd | movzx RDd, 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 ITYPE, [BASE+RD*8] | add PC, 4 if (op == BC_ISTC || op == BC_ISFC) { | mov RB, ITYPE } | sar ITYPE, 47 | cmp ITYPEd, 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], RB } | movzx RDd, PC_RD | branchPC RD |1: // Fallthrough to the next instruction. | ins_next break; case BC_ISTYPE: | ins_AD // RA = src, RD = -type | mov RB, [BASE+RA*8] | sar RB, 47 | add RBd, RDd | jne ->vmeta_istype | ins_next break; case BC_ISNUM: | ins_AD // RA = src, RD = -(TISNUM-1) | checknumtp [BASE+RA*8], ->vmeta_istype | ins_next break; /* -- Unary ops --------------------------------------------------------- */ case BC_MOV: | ins_AD // RA = dst, RD = src | mov RB, [BASE+RD*8] | mov [BASE+RA*8], RB | ins_next_ break; case BC_NOT: | ins_AD // RA = dst, RD = src | mov RB, [BASE+RD*8] | sar RB, 47 | mov RCd, 2 | cmp RB, LJ_TISTRUECOND | sbb RCd, 0 | shl RC, 47 | not RC | mov [BASE+RA*8], RC | ins_next break; case BC_UNM: | ins_AD // RA = dst, RD = src | mov RB, [BASE+RD*8] |.if DUALNUM | checkint RB, >5 | neg RBd | jo >4 | setint RB |9: | mov [BASE+RA*8], RB | ins_next |4: | mov64 RB, U64x(41e00000,00000000) // 2^31. | jmp <9 |5: | ja ->vmeta_unm |.else | checknum RB, ->vmeta_unm |.endif | mov64 RD, U64x(80000000,00000000) | xor RB, RD |.if DUALNUM | jmp <9 |.else | mov [BASE+RA*8], RB | ins_next |.endif break; case BC_LEN: | ins_AD // RA = dst, RD = src | mov RD, [BASE+RD*8] | checkstr RD, >2 |.if DUALNUM | mov RDd, dword STR:RD->len |1: | setint RD | mov [BASE+RA*8], RD |.else | xorps xmm0, xmm0 | cvtsi2sd xmm0, dword STR:RD->len |1: | movsd qword [BASE+RA*8], xmm0 |.endif | ins_next |2: | cmp ITYPEd, LJ_TTAB; jne ->vmeta_len | mov TAB:CARG1, TAB:RD #if LJ_52 | mov TAB:RB, TAB:RD->metatable | cmp TAB:RB, 0 | jnz >9 |3: #endif |->BC_LEN_Z: | mov RB, BASE // Save BASE. | call extern lj_tab_len // (GCtab *t) | // Length of table returned in eax (RD). |.if DUALNUM | // Nothing to do. |.else | cvtsi2sd xmm0, RDd |.endif | mov BASE, RB // Restore BASE. | movzx RAd, 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, sseins, ssereg | ins_ABC ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); ||switch (vk) { ||case 0: | checknumtp [BASE+RB*8], ->vmeta_arith_vn | .if DUALNUM | checknumtp [KBASE+RC*8], ->vmeta_arith_vn | .endif | movsd xmm0, qword [BASE+RB*8] | sseins ssereg, qword [KBASE+RC*8] || break; ||case 1: | checknumtp [BASE+RB*8], ->vmeta_arith_nv | .if DUALNUM | checknumtp [KBASE+RC*8], ->vmeta_arith_nv | .endif | movsd xmm0, qword [KBASE+RC*8] | sseins ssereg, qword [BASE+RB*8] || break; ||default: | checknumtp [BASE+RB*8], ->vmeta_arith_vv | checknumtp [BASE+RC*8], ->vmeta_arith_vv | movsd xmm0, qword [BASE+RB*8] | sseins ssereg, qword [BASE+RC*8] || break; ||} |.endmacro | |.macro ins_arithdn, intins | ins_ABC ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); ||switch (vk) { ||case 0: | mov RB, [BASE+RB*8] | mov RC, [KBASE+RC*8] | checkint RB, ->vmeta_arith_vno | checkint RC, ->vmeta_arith_vno | intins RBd, RCd; jo ->vmeta_arith_vno || break; ||case 1: | mov RB, [BASE+RB*8] | mov RC, [KBASE+RC*8] | checkint RB, ->vmeta_arith_nvo | checkint RC, ->vmeta_arith_nvo | intins RCd, RBd; jo ->vmeta_arith_nvo || break; ||default: | mov RB, [BASE+RB*8] | mov RC, [BASE+RC*8] | checkint RB, ->vmeta_arith_vvo | checkint RC, ->vmeta_arith_vvo | intins RBd, RCd; jo ->vmeta_arith_vvo || break; ||} ||if (vk == 1) { | setint RC | mov [BASE+RA*8], RC ||} else { | setint RB | mov [BASE+RA*8], RB ||} | ins_next |.endmacro | |.macro ins_arithpost | movsd qword [BASE+RA*8], xmm0 |.endmacro | |.macro ins_arith, sseins | ins_arithpre sseins, xmm0 | ins_arithpost | ins_next |.endmacro | |.macro ins_arith, intins, sseins |.if DUALNUM | ins_arithdn intins |.else | ins_arith, 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, addsd break; case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: | ins_arith sub, subsd break; case BC_MULVN: case BC_MULNV: case BC_MULVV: | ins_arith imul, mulsd break; case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: | ins_arith divsd break; case BC_MODVN: | ins_arithpre movsd, xmm1 |->BC_MODVN_Z: | call ->vm_mod | ins_arithpost | ins_next break; case BC_MODNV: case BC_MODVV: | ins_arithpre movsd, xmm1 | jmp ->BC_MODVN_Z // Avoid 3 copies. It's slow anyway. break; case BC_POW: | ins_arithpre movsd, xmm1 | mov RB, BASE | call extern pow | movzx RAd, PC_RA | mov BASE, RB | ins_arithpost | ins_next break; case BC_CAT: | ins_ABC // RA = dst, RB = src_start, RC = src_end | mov L:CARG1, SAVE_L | mov L:CARG1->base, BASE | lea CARG2, [BASE+RC*8] | mov CARG3d, RCd | sub CARG3d, RBd |->BC_CAT_Z: | mov L:RB, L:CARG1 | 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 RBd, PC_RB // Copy result to Stk[RA] from Stk[RB]. | movzx RAd, PC_RA | mov RC, [BASE+RB*8] | mov [BASE+RA*8], RC | ins_next break; /* -- Constant ops ------------------------------------------------------ */ case BC_KSTR: | ins_AND // RA = dst, RD = str const (~) | mov RD, [KBASE+RD*8] | settp RD, 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*8] | settp RD, 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 RDd, RDW | setint RD | mov [BASE+RA*8], RD |.else | movsx RDd, RDW // Sign-extend literal. | cvtsi2sd xmm0, RDd | movsd qword [BASE+RA*8], xmm0 |.endif | ins_next break; case BC_KNUM: | ins_AD // RA = dst, RD = num const | movsd xmm0, qword [KBASE+RD*8] | movsd qword [BASE+RA*8], xmm0 | ins_next break; case BC_KPRI: | ins_AD // RA = dst, RD = primitive type (~) | shl RD, 47 | not RD | mov [BASE+RA*8], RD | ins_next break; case BC_KNIL: | ins_AD // RA = dst_start, RD = dst_end | lea RA, [BASE+RA*8+8] | lea RD, [BASE+RD*8] | 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-16] | cleartp LFUNC:RB | mov UPVAL:RB, [LFUNC:RB+RD*8+offsetof(GCfuncL, uvptr)] | mov RB, UPVAL:RB->v | mov RD, [RB] | mov [BASE+RA*8], RD | 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-16] | cleartp LFUNC:RB | mov UPVAL:RB, [LFUNC:RB+RA*8+offsetof(GCfuncL, uvptr)] | cmp byte UPVAL:RB->closed, 0 | mov RB, UPVAL:RB->v | mov RA, [BASE+RD*8] | mov [RB], RA | 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. | mov RD, RA | sar RD, 47 | sub RDd, LJ_TISGCV | cmp RDd, LJ_TNUMX - LJ_TISGCV // tvisgcv(v) | jbe <1 | cleartp GCOBJ:RA | test byte GCOBJ:RA->gch.marked, LJ_GC_WHITES // iswhite(v) | jz <1 | // Crossed a write barrier. Move the barrier forward. |.if not X64WIN | mov CARG2, RB | mov RB, BASE // Save BASE. |.else | xchg CARG2, RB // Save BASE (CARG2 == BASE). |.endif | lea GL:CARG1, [DISPATCH+GG_DISP2G] | call extern lj_gc_barrieruv // (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-16] | cleartp LFUNC:RB | mov UPVAL:RB, [LFUNC:RB+RA*8+offsetof(GCfuncL, uvptr)] | mov STR:RA, [KBASE+RD*8] | mov RD, UPVAL:RB->v | settp STR:ITYPE, STR:RA, LJ_TSTR | mov [RD], STR:ITYPE | 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 (CARG2 == BASE). | mov CARG2, RD | lea GL:CARG1, [DISPATCH+GG_DISP2G] | call extern lj_gc_barrieruv // (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-16] | cleartp LFUNC:RB | movsd xmm0, qword [KBASE+RD*8] | mov UPVAL:RB, [LFUNC:RB+RA*8+offsetof(GCfuncL, uvptr)] | mov RA, UPVAL:RB->v | movsd qword [RA], xmm0 | ins_next break; case BC_USETP: | ins_AD // RA = upvalue #, RD = primitive type (~) | mov LFUNC:RB, [BASE-16] | cleartp LFUNC:RB | mov UPVAL:RB, [LFUNC:RB+RA*8+offsetof(GCfuncL, uvptr)] | shl RD, 47 | not RD | mov RA, UPVAL:RB->v | mov [RA], 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 aword L:RB->openupval, 0 | je >1 | mov L:RB->base, BASE | lea CARG2, [BASE+RA*8] // Caveat: CARG2 == BASE | mov L:CARG1, L:RB // Caveat: CARG1 == RA | call extern lj_func_closeuv // (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) | mov L:RB, SAVE_L | mov L:RB->base, BASE // Caveat: CARG2/CARG3 may be BASE. | mov CARG3, [BASE-16] | cleartp CARG3 | mov CARG2, [KBASE+RD*8] // Fetch GCproto *. | mov CARG1, L:RB | 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 RAd, PC_RA | settp LFUNC:RC, LJ_TFUNC | mov [BASE+RA*8], LFUNC:RC | 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: | mov CARG3d, RDd | and RDd, 0x7ff | shr CARG3d, 11 | cmp RDd, 0x7ff | je >3 |2: | mov L:CARG1, L:RB | mov CARG2d, RDd | 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 RAd, PC_RA | settp TAB:RC, LJ_TTAB | mov [BASE+RA*8], TAB:RC | ins_next |3: // Turn 0x7ff into 0x801. | mov RDd, 0x801 | jmp <2 |5: | mov L:CARG1, L:RB | call extern lj_gc_step_fixtop // (lua_State *L) | movzx RDd, 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:CARG2, [KBASE+RD*8] // Caveat: CARG2 == BASE | mov L:CARG1, L:RB // Caveat: CARG1 == RA | call extern lj_tab_dup // (lua_State *L, Table *kt) | // Table * returned in eax (RC). | mov BASE, L:RB->base | movzx RAd, PC_RA | settp TAB:RC, LJ_TTAB | mov [BASE+RA*8], TAB:RC | ins_next |3: | mov L:CARG1, L:RB | call extern lj_gc_step_fixtop // (lua_State *L) | movzx RDd, PC_RD // Need to reload RD. | not RD | jmp <2 break; case BC_GGET: | ins_AND // RA = dst, RD = str const (~) | mov LFUNC:RB, [BASE-16] | cleartp LFUNC:RB | mov TAB:RB, LFUNC:RB->env | mov STR:RC, [KBASE+RD*8] | jmp ->BC_TGETS_Z break; case BC_GSET: | ins_AND // RA = src, RD = str const (~) | mov LFUNC:RB, [BASE-16] | cleartp LFUNC:RB | mov TAB:RB, LFUNC:RB->env | mov STR:RC, [KBASE+RD*8] | jmp ->BC_TSETS_Z break; case BC_TGETV: | ins_ABC // RA = dst, RB = table, RC = key | mov TAB:RB, [BASE+RB*8] | mov RC, [BASE+RC*8] | checktab TAB:RB, ->vmeta_tgetv | | // Integer key? |.if DUALNUM | checkint RC, >5 |.else | // Convert number to int and back and compare. | checknum RC, >5 | movd xmm0, RC | cvttsd2si RCd, xmm0 | cvtsi2sd xmm1, RCd | ucomisd xmm0, xmm1 | jne ->vmeta_tgetv // Generic numeric key? Use fallback. |.endif | cmp RCd, TAB:RB->asize // Takes care of unordered, too. | jae ->vmeta_tgetv // Not in array part? Use fallback. | shl RCd, 3 | add RC, TAB:RB->array | // Get array slot. | mov ITYPE, [RC] | cmp ITYPE, LJ_TNIL // Avoid overwriting RB in fastpath. | je >2 |1: | mov [BASE+RA*8], ITYPE | ins_next | |2: // Check for __index if table value is nil. | mov TAB:TMPR, TAB:RB->metatable | test TAB:TMPR, TAB:TMPR | jz <1 | test byte TAB:TMPR->nomm, 1<vmeta_tgetv // 'no __index' flag NOT set: check. | jmp <1 | |5: // String key? | cmp ITYPEd, LJ_TSTR; jne ->vmeta_tgetv | cleartp STR:RC | jmp ->BC_TGETS_Z break; case BC_TGETS: | ins_ABC // RA = dst, RB = table, RC = str const (~) | mov TAB:RB, [BASE+RB*8] | not RC | mov STR:RC, [KBASE+RC*8] | checktab TAB:RB, ->vmeta_tgets |->BC_TGETS_Z: // RB = GCtab *, RC = GCstr * | mov TMPRd, TAB:RB->hmask | and TMPRd, STR:RC->sid | imul TMPRd, #NODE | add NODE:TMPR, TAB:RB->node | settp ITYPE, STR:RC, LJ_TSTR |1: | cmp NODE:TMPR->key, ITYPE | jne >4 | // Get node value. | mov ITYPE, NODE:TMPR->val | cmp ITYPE, LJ_TNIL | je >5 // Key found, but nil value? |2: | mov [BASE+RA*8], ITYPE | ins_next | |4: // Follow hash chain. | mov NODE:TMPR, NODE:TMPR->next | test NODE:TMPR, NODE:TMPR | jnz <1 | // End of hash chain: key not found, nil result. | mov ITYPE, LJ_TNIL | |5: // Check for __index if table value is nil. | mov TAB:TMPR, TAB:RB->metatable | test TAB:TMPR, TAB:TMPR | jz <2 // No metatable: done. | test byte TAB:TMPR->nomm, 1<vmeta_tgets // Caveat: preserve STR:RC. break; case BC_TGETB: | ins_ABC // RA = dst, RB = table, RC = byte literal | mov TAB:RB, [BASE+RB*8] | checktab TAB:RB, ->vmeta_tgetb | cmp RCd, TAB:RB->asize | jae ->vmeta_tgetb | shl RCd, 3 | add RC, TAB:RB->array | // Get array slot. | mov ITYPE, [RC] | cmp ITYPE, LJ_TNIL | je >2 |1: | mov [BASE+RA*8], ITYPE | ins_next | |2: // Check for __index if table value is nil. | mov TAB:TMPR, TAB:RB->metatable | test TAB:TMPR, TAB:TMPR | jz <1 | test byte TAB:TMPR->nomm, 1<vmeta_tgetb // 'no __index' flag NOT set: check. | jmp <1 break; case BC_TGETR: | ins_ABC // RA = dst, RB = table, RC = key | mov TAB:RB, [BASE+RB*8] | cleartp TAB:RB |.if DUALNUM | mov RCd, dword [BASE+RC*8] |.else | cvttsd2si RCd, qword [BASE+RC*8] |.endif | cmp RCd, TAB:RB->asize | jae ->vmeta_tgetr // Not in array part? Use fallback. | shl RCd, 3 | add RC, TAB:RB->array | // Get array slot. |->BC_TGETR_Z: | mov ITYPE, [RC] |->BC_TGETR2_Z: | mov [BASE+RA*8], ITYPE | ins_next break; case BC_TSETV: | ins_ABC // RA = src, RB = table, RC = key | mov TAB:RB, [BASE+RB*8] | mov RC, [BASE+RC*8] | checktab TAB:RB, ->vmeta_tsetv | | // Integer key? |.if DUALNUM | checkint RC, >5 |.else | // Convert number to int and back and compare. | checknum RC, >5 | movd xmm0, RC | cvttsd2si RCd, xmm0 | cvtsi2sd xmm1, RCd | ucomisd xmm0, xmm1 | jne ->vmeta_tsetv // Generic numeric key? Use fallback. |.endif | cmp RCd, TAB:RB->asize // Takes care of unordered, too. | jae ->vmeta_tsetv | shl RCd, 3 | add RC, TAB:RB->array | cmp aword [RC], 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. | mov RB, [BASE+RA*8] | mov [RC], RB | ins_next | |3: // Check for __newindex if previous value is nil. | mov TAB:TMPR, TAB:RB->metatable | test TAB:TMPR, TAB:TMPR | jz <1 | test byte TAB:TMPR->nomm, 1<vmeta_tsetv // 'no __newindex' flag NOT set: check. | jmp <1 | |5: // String key? | cmp ITYPEd, LJ_TSTR; jne ->vmeta_tsetv | cleartp STR:RC | jmp ->BC_TSETS_Z | |7: // Possible table write barrier for the value. Skip valiswhite check. | barrierback TAB:RB, TMPR | jmp <2 break; case BC_TSETS: | ins_ABC // RA = src, RB = table, RC = str const (~) | mov TAB:RB, [BASE+RB*8] | not RC | mov STR:RC, [KBASE+RC*8] | checktab TAB:RB, ->vmeta_tsets |->BC_TSETS_Z: // RB = GCtab *, RC = GCstr * | mov TMPRd, TAB:RB->hmask | and TMPRd, STR:RC->sid | imul TMPRd, #NODE | mov byte TAB:RB->nomm, 0 // Clear metamethod cache. | add NODE:TMPR, TAB:RB->node | settp ITYPE, STR:RC, LJ_TSTR |1: | cmp NODE:TMPR->key, ITYPE | jne >5 | // Ok, key found. Assumes: offsetof(Node, val) == 0 | cmp aword [TMPR], 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. | mov ITYPE, [BASE+RA*8] | mov [TMPR], ITYPE | ins_next | |4: // Check for __newindex if previous value is nil. | mov TAB:ITYPE, TAB:RB->metatable | test TAB:ITYPE, TAB:ITYPE | jz <2 | test byte TAB:ITYPE->nomm, 1<vmeta_tsets // 'no __newindex' flag NOT set: check. | jmp <2 | |5: // Follow hash chain. | mov NODE:TMPR, NODE:TMPR->next | test NODE:TMPR, NODE:TMPR | jnz <1 | // End of hash chain: key not found, add a new one. | | // But check for __newindex first. | mov TAB:TMPR, TAB:RB->metatable | test TAB:TMPR, TAB:TMPR | jz >6 // No metatable: continue. | test byte TAB:TMPR->nomm, 1<vmeta_tsets // 'no __newindex' flag NOT set: check. |6: | mov TMP1, ITYPE | mov L:CARG1, SAVE_L | mov L:CARG1->base, BASE | lea CARG3, TMP1 | mov CARG2, TAB:RB | 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 L:CARG1, SAVE_L | mov BASE, L:CARG1->base | mov TMPR, rax | movzx RAd, PC_RA | jmp <2 // Must check write barrier for value. | |7: // Possible table write barrier for the value. Skip valiswhite check. | barrierback TAB:RB, ITYPE | jmp <3 break; case BC_TSETB: | ins_ABC // RA = src, RB = table, RC = byte literal | mov TAB:RB, [BASE+RB*8] | checktab TAB:RB, ->vmeta_tsetb | cmp RCd, TAB:RB->asize | jae ->vmeta_tsetb | shl RCd, 3 | add RC, TAB:RB->array | cmp aword [RC], 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. | mov ITYPE, [BASE+RA*8] | mov [RC], ITYPE | ins_next | |3: // Check for __newindex if previous value is nil. | mov TAB:TMPR, TAB:RB->metatable | test TAB:TMPR, TAB:TMPR | jz <1 | test byte TAB:TMPR->nomm, 1<vmeta_tsetb // 'no __newindex' flag NOT set: check. | jmp <1 | |7: // Possible table write barrier for the value. Skip valiswhite check. | barrierback TAB:RB, TMPR | jmp <2 break; case BC_TSETR: | ins_ABC // RA = src, RB = table, RC = key | mov TAB:RB, [BASE+RB*8] | cleartp TAB:RB |.if DUALNUM | mov RC, [BASE+RC*8] |.else | cvttsd2si RCd, qword [BASE+RC*8] |.endif | test byte TAB:RB->marked, LJ_GC_BLACK // isblack(table) | jnz >7 |2: | cmp RCd, TAB:RB->asize | jae ->vmeta_tsetr | shl RCd, 3 | add RC, TAB:RB->array | // Set array slot. |->BC_TSETR_Z: | mov ITYPE, [BASE+RA*8] | mov [RC], ITYPE | ins_next | |7: // Possible table write barrier for the value. Skip valiswhite check. | barrierback TAB:RB, TMPR | jmp <2 break; case BC_TSETM: | ins_AD // RA = base (table at base-1), RD = num const (start index) |1: | mov TMPRd, dword [KBASE+RD*8] // Integer constant is in lo-word. | lea RA, [BASE+RA*8] | mov TAB:RB, [RA-8] // Guaranteed to be a table. | cleartp TAB:RB | test byte TAB:RB->marked, LJ_GC_BLACK // isblack(table) | jnz >7 |2: | mov RDd, MULTRES | sub RDd, 1 | jz >4 // Nothing to copy? | add RDd, TMPRd // Compute needed size. | cmp RDd, TAB:RB->asize | ja >5 // Doesn't fit into array part? | sub RDd, TMPRd | shl TMPRd, 3 | add TMPR, TAB:RB->array |3: // Copy result slots to table. | mov RB, [RA] | add RA, 8 | mov [TMPR], RB | add TMPR, 8 | sub RDd, 1 | jnz <3 |4: | ins_next | |5: // Need to resize array part. | mov L:CARG1, SAVE_L | mov L:CARG1->base, BASE // Caveat: CARG2/CARG3 may be BASE. | mov CARG2, TAB:RB | mov CARG3d, RDd | mov L:RB, L:CARG1 | mov SAVE_PC, PC | call extern lj_tab_reasize // (lua_State *L, GCtab *t, int nasize) | mov BASE, L:RB->base | movzx RAd, PC_RA // Restore RA. | movzx RDd, PC_RD // Restore RD. | 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:RDd, MULTRES } | mov LFUNC:RB, [BASE+RA*8] | checkfunc LFUNC:RB, ->vmeta_call_ra | lea BASE, [BASE+RA*8+16] | ins_call break; case BC_CALLMT: | ins_AD // RA = base, RD = extra_nargs | add NARGS:RDd, 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+16] | mov KBASE, BASE // Use KBASE for move + vmeta_call hint. | mov LFUNC:RB, [RA-16] | checktp_nc LFUNC:RB, LJ_TFUNC, ->vmeta_call |->BC_CALLT_Z: | mov PC, [BASE-8] | test PCd, FRAME_TYPE | jnz >7 |1: | mov [BASE-16], LFUNC:RB // Copy func+tag down, reloaded below. | mov MULTRES, NARGS:RDd | sub NARGS:RDd, 1 | jz >3 |2: // Move args down. | mov RB, [RA] | add RA, 8 | mov [KBASE], RB | add KBASE, 8 | sub NARGS:RDd, 1 | jnz <2 | | mov LFUNC:RB, [BASE-16] |3: | cleartp LFUNC:RB | mov NARGS:RDd, 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 PCd, FRAME_TYPE // Lua frame below? | jnz <4 | movzx RAd, PC_RA | neg RA | mov LFUNC:KBASE, [BASE+RA*8-32] // Need to prepare KBASE. | cleartp LFUNC:KBASE | mov KBASE, LFUNC:KBASE->pc | mov KBASE, [KBASE+PC2PROTO(k)] | jmp <4 | |7: // Tailcall from a vararg function. | sub PC, FRAME_VARG | test PCd, FRAME_TYPEP | jnz >8 // Vararg frame below? | sub BASE, PC // Need to relocate BASE/KBASE down. | mov KBASE, BASE | mov PC, [BASE-8] | jmp <1 |8: | add PCd, 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+16] // fb = base+2 | mov RB, [RA-32] // Copy state. fb[0] = fb[-4]. | mov RC, [RA-24] // Copy control var. fb[1] = fb[-3]. | mov [RA], RB | mov [RA+8], RC | mov LFUNC:RB, [RA-40] // Copy callable. fb[-2] = fb[-5] | mov [RA-16], LFUNC:RB | mov NARGS:RDd, 2+1 // Handle like a regular 2-arg call. | checkfunc LFUNC:RB, ->vmeta_call | mov BASE, RA | ins_call break; case BC_ITERN: |.if JIT | hotloop RBd |.endif |->vm_IITERN: | ins_A // RA = base, (RB = nresults+1, RC = nargs+1 (2+1)) | mov TAB:RB, [BASE+RA*8-16] | cleartp TAB:RB | mov RCd, [BASE+RA*8-8] // Get index from control var. | mov TMPRd, TAB:RB->asize | add PC, 4 | mov ITYPE, TAB:RB->array |1: // Traverse array part. | cmp RCd, TMPRd; jae >5 // Index points after array part? | cmp aword [ITYPE+RC*8], LJ_TNIL; je >4 |.if not DUALNUM | cvtsi2sd xmm0, RCd |.endif | // Copy array slot to returned value. | mov RB, [ITYPE+RC*8] | mov [BASE+RA*8+8], RB | // Return array index as a numeric key. |.if DUALNUM | setint ITYPE, RC | mov [BASE+RA*8], ITYPE |.else | movsd qword [BASE+RA*8], xmm0 |.endif | add RCd, 1 | mov [BASE+RA*8-8], RCd // Update control var. |2: | movzx RDd, PC_RD // Get target from ITERL. | branchPC RD |3: | ins_next | |4: // Skip holes in array part. | add RCd, 1 | jmp <1 | |5: // Traverse hash part. | sub RCd, TMPRd |6: | cmp RCd, TAB:RB->hmask; ja <3 // End of iteration? Branch to ITERL+1. | imul ITYPEd, RCd, #NODE | add NODE:ITYPE, TAB:RB->node | cmp aword NODE:ITYPE->val, LJ_TNIL; je >7 | lea TMPRd, [RCd+TMPRd+1] | // Copy key and value from hash slot. | mov RB, NODE:ITYPE->key | mov RC, NODE:ITYPE->val | mov [BASE+RA*8], RB | mov [BASE+RA*8+8], RC | mov [BASE+RA*8-8], TMPRd | jmp <2 | |7: // Skip holes in hash part. | add RCd, 1 | jmp <6 break; case BC_ISNEXT: | ins_AD // RA = base, RD = target (points to ITERN) | mov CFUNC:RB, [BASE+RA*8-24] | checkfunc CFUNC:RB, >5 | checktptp [BASE+RA*8-16], LJ_TTAB, >5 | cmp aword [BASE+RA*8-8], LJ_TNIL; jne >5 | cmp byte CFUNC:RB->ffid, FF_next_N; jne >5 | branchPC RD | mov64 TMPR, ((uint64_t)LJ_KEYINDEX << 32) | mov [BASE+RA*8-8], TMPR // Initialize control var. |1: | ins_next |5: // Despecialize bytecode if any of the checks fail. | mov PC_OP, BC_JMP | branchPC RD |.if JIT | cmp byte [PC], BC_ITERN | jne >6 |.endif | mov byte [PC], BC_ITERC | jmp <1 |.if JIT |6: // Unpatch JLOOP. | mov RA, [DISPATCH+DISPATCH_J(trace)] | movzx RCd, word [PC+2] | mov TRACE:RA, [RA+RC*8] | mov eax, TRACE:RA->startins | mov al, BC_ITERC | mov dword [PC], eax | jmp <1 |.endif break; case BC_VARG: | ins_ABC // RA = base, RB = nresults+1, RC = numparams | lea TMPR, [BASE+RC*8+(16+FRAME_VARG)] | lea RA, [BASE+RA*8] | sub TMPR, [BASE-8] | // Note: TMPR 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 TMPR, BASE // No vararg slots? | jnb >2 |1: // Copy vararg slots to destination slots. | mov RC, [TMPR-16] | add TMPR, 8 | mov [RA], RC | add RA, 8 | cmp RA, RB // All destination slots filled? | jnb >3 | cmp TMPR, BASE // No more vararg slots? | jb <1 |2: // Fill up remainder with nil. | mov aword [RA], LJ_TNIL | add RA, 8 | cmp RA, RB | jb <2 |3: | ins_next | |5: // Copy all varargs. | mov MULTRES, 1 // MULTRES = 0+1 | mov RC, BASE | sub RC, TMPR | jbe <3 // No vararg slots? | mov RBd, RCd | shr RBd, 3 | add RBd, 1 | mov MULTRES, RBd // 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. | mov RC, [TMPR-16] | add TMPR, 8 | mov [RA], RC | add RA, 8 | cmp TMPR, 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 TMPR, BASE // Need delta, because BASE may change. | mov TMP1hi, TMPRd | mov CARG2d, MULTRES | sub CARG2d, 1 | mov CARG1, L:RB | call extern lj_state_growstack // (lua_State *L, int n) | mov BASE, L:RB->base | movsxd TMPR, TMP1hi | mov RA, L:RB->top | add TMPR, BASE | jmp <6 break; /* -- Returns ----------------------------------------------------------- */ case BC_RETM: | ins_AD // RA = results, RD = extra_nresults | add RDd, 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 RAd, 3 } |1: | mov PC, [BASE-8] | mov MULTRES, RDd // Save nresults+1. | test PCd, 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 RDd, 1 | jz >3 |2: // Move results down. | mov RB, [KBASE+RA] | mov [KBASE-16], RB | add KBASE, 8 | sub RDd, 1 | jnz <2 |3: | mov RDd, MULTRES // Note: MULTRES may be >255. | movzx RBd, PC_RB // So cannot compare with RDL! |5: | cmp RBd, RDd // More results expected? | ja >6 break; case BC_RET1: | mov RB, [BASE+RA] | mov [BASE-16], RB /* fallthrough */ case BC_RET0: |5: | cmp PC_RB, RDL // More results expected? | ja >6 default: break; } | movzx RAd, PC_RA | neg RA | lea BASE, [BASE+RA*8-16] // base = base - (RA+2)*8 | mov LFUNC:KBASE, [BASE-16] | cleartp LFUNC:KBASE | mov KBASE, LFUNC:KBASE->pc | mov KBASE, [KBASE+PC2PROTO(k)] | ins_next | |6: // Fill up results with nil. if (op == BC_RET) { | mov aword [KBASE-16], LJ_TNIL // Note: relies on shifted base. | add KBASE, 8 } else { | mov aword [BASE+RD*8-24], LJ_TNIL } | add RD, 1 | jmp <5 | |7: // Non-standard return case. | lea RB, [PC-FRAME_VARG] | test RBd, 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_STOP, [RA+8] |.define FOR_STEP, [RA+16] |.define FOR_EXT, [RA+24] case BC_FORL: |.if JIT | hotloop RBd |.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) { | mov RB, FOR_IDX | checkint RB, >9 | mov TMPR, FOR_STOP if (!vk) { | checkint TMPR, ->vmeta_for | mov ITYPE, FOR_STEP | test ITYPEd, ITYPEd; js >5 | sar ITYPE, 47; | cmp ITYPEd, LJ_TISNUM; jne ->vmeta_for } else { #ifdef LUA_USE_ASSERT | checkinttp FOR_STOP, ->assert_bad_for_arg_type | checkinttp FOR_STEP, ->assert_bad_for_arg_type #endif | mov ITYPE, FOR_STEP | test ITYPEd, ITYPEd; js >5 | add RBd, ITYPEd; jo >1 | setint RB | mov FOR_IDX, RB } | cmp RBd, TMPRd | mov FOR_EXT, RB if (op == BC_FORI) { | jle >7 |1: |6: | branchPC RD } else if (op == BC_JFORI) { | branchPC RD | movzx RDd, 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) { | sar ITYPE, 47; | cmp ITYPEd, LJ_TISNUM; jne ->vmeta_for } else { | add RBd, ITYPEd; jo <1 | setint RB | mov FOR_IDX, RB } | cmp RBd, TMPRd | mov FOR_EXT, RB if (op == BC_FORI) { | jge <7 } else if (op == BC_JFORI) { | branchPC RD | movzx RDd, PC_RD | jge =>BC_JLOOP } else if (op == BC_IFORL) { | jl <7 } else { | jge =>BC_JLOOP } | jmp <6 |9: // Fallback to FP variant. if (!vk) { | jae ->vmeta_for } } else if (!vk) { | checknumtp FOR_IDX, ->vmeta_for } if (!vk) { | checknumtp FOR_STOP, ->vmeta_for } else { #ifdef LUA_USE_ASSERT | checknumtp FOR_STOP, ->assert_bad_for_arg_type | checknumtp FOR_STEP, ->assert_bad_for_arg_type #endif } | mov RB, FOR_STEP if (!vk) { | checknum RB, ->vmeta_for } | 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 if (op == BC_FORI) { |.if DUALNUM | jnb <7 |.else | jnb >2 | branchPC RD |.endif } else if (op == BC_JFORI) { | branchPC RD | movzx RDd, 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 | |3: // Invert comparison if step is negative. | ucomisd xmm0, xmm1 | jmp <1 break; case BC_ITERL: |.if JIT | hotloop RBd |.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] | cmp RB, LJ_TNIL; je >1 // Stop if iterator returned nil. if (op == BC_JITERL) { | mov [RA-8], RB | jmp =>BC_JLOOP } else { | branchPC RD // Otherwise save control var + branch. | mov [RA-8], RB } |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 RBd |.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*8] | mov RD, TRACE:RD->mcode | mov L:RB, SAVE_L | mov [DISPATCH+DISPATCH_GL(jit_base)], BASE | mov [DISPATCH+DISPATCH_GL(tmpbuf.L)], L:RB | // Save additional callee-save registers only used in compiled code. |.if X64WIN | mov CSAVE_4, r12 | mov CSAVE_3, r13 | mov CSAVE_2, r14 | mov CSAVE_1, r15 | mov RA, rsp | sub rsp, 10*16+4*8 | movdqa [RA-1*16], xmm6 | movdqa [RA-2*16], xmm7 | movdqa [RA-3*16], xmm8 | movdqa [RA-4*16], xmm9 | movdqa [RA-5*16], xmm10 | movdqa [RA-6*16], xmm11 | movdqa [RA-7*16], xmm12 | movdqa [RA-8*16], xmm13 | movdqa [RA-9*16], xmm14 | movdqa [RA-10*16], xmm15 |.else | sub rsp, 16 | mov [rsp+16], r12 | mov [rsp+8], r13 |.endif | jmp RD |.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 RBd |.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 RAd, byte [PC-4+PC2PROTO(numparams)] | cmp NARGS:RDd, RAd // Check for missing parameters. | jbe >3 |2: if (op == BC_JFUNCF) { | movzx RDd, PC_RD | jmp =>BC_JLOOP } else { | ins_next } | |3: // Clear missing parameters. | mov aword [BASE+NARGS:RD*8-8], LJ_TNIL | add NARGS:RDd, 1 | cmp NARGS:RDd, RAd | 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 RBd, [NARGS:RD*8+FRAME_VARG+8] | lea RD, [BASE+NARGS:RD*8+8] | mov LFUNC:KBASE, [BASE-16] | mov [RD-8], RB // Store delta + FRAME_VARG. | mov [RD-16], 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 RBd, byte [PC-4+PC2PROTO(numparams)] | test RBd, RBd | jz >2 | add RA, 8 |1: // Copy fixarg slots up to new frame. | add RA, 8 | cmp RA, BASE | jnb >3 // Less args than parameters? | mov KBASE, [RA-16] | mov [RD], KBASE | add RD, 8 | mov aword [RA-16], LJ_TNIL // Clear old fixarg slot (help the GC). | sub RBd, 1 | jnz <1 |2: if (op == BC_JFUNCV) { | movzx RDd, PC_RD | jmp =>BC_JLOOP } else { | mov KBASE, [PC-4+PC2PROTO(k)] | ins_next } | |3: // Clear missing parameters. | mov aword [RD], LJ_TNIL | add RD, 8 | sub RBd, 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-16] | cleartp CFUNC:RB | mov KBASE, 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) { | mov CARG1, L:RB // Caveat: CARG1 may be RA. } else { | mov CARG2, KBASE | mov CARG1, L:RB // Caveat: CARG1 may be RA. } | ja ->vm_growstack_c // Need to grow stack. | set_vmstate C if (op == BC_FUNCC) { | call KBASE // (lua_State *L) } else { | // (lua_State *L, lua_CFunction f) | call aword [DISPATCH+DISPATCH_GL(wrapf)] } | // nresults returned in eax (RD). | mov BASE, L:RB->base | mov [DISPATCH+DISPATCH_GL(cur_L)], L:RB | set_vmstate INTERP | lea RA, [BASE+RD*8] | neg RA | add RA, L:RB->top // RA = (L->top-(L->base+nresults))*8 | mov PC, [BASE-8] // 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); 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 -8\n" "\t.byte 0x10\n" "\t.byte 0xc\n\t.uleb128 0x7\n\t.uleb128 8\n" "\t.byte 0x80+0x10\n\t.uleb128 0x1\n" "\t.align 8\n" ".LECIE0:\n\n"); fprintf(ctx->fp, ".LSFDE0:\n" "\t.long .LEFDE0-.LASFDE0\n" ".LASFDE0:\n" "\t.long .Lframe0\n" "\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 "\t.align 8\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" "\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 */ "\t.align 8\n" ".LEFDE1:\n\n", (int)ctx->codesz - fcofs); #endif #if !LJ_NO_UNWIND #if LJ_TARGET_SOLARIS fprintf(ctx->fp, "\t.section .eh_frame,\"a\",@unwind\n"); #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 -8\n" "\t.byte 0x10\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 0x7\n\t.uleb128 8\n" "\t.byte 0x80+0x10\n\t.uleb128 0x1\n" "\t.align 8\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 */ "\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 */ "\t.align 8\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 -8\n" "\t.byte 0x10\n" "\t.uleb128 1\n" /* augmentation length */ "\t.byte 0x1b\n" /* pcrel|sdata4 */ "\t.byte 0xc\n\t.uleb128 0x7\n\t.uleb128 8\n" "\t.byte 0x80+0x10\n\t.uleb128 0x1\n" "\t.align 8\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 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 */ "\t.align 8\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-8\n" "\t.byte 0x10\n" "\t.byte 6\n" /* augmentation length */ "\t.byte 0x9b\n" /* indirect|pcrel|sdata4 */ "\t.long _lj_err_unwind_dwarf+4@GOTPCREL\n" "\t.byte 0x1b\n" /* pcrel|sdata4 */ "\t.byte 0xc\n\t.byte 0x7\n\t.byte 8\n" "\t.byte 0x80+0x10\n\t.byte 0x1\n" "\t.align 3\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 */ "\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 */ "\t.align 3\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-8\n" "\t.byte 0x10\n" "\t.byte 1\n" /* augmentation length */ "\t.byte 0x1b\n" /* pcrel|sdata4 */ "\t.byte 0xc\n\t.byte 0x7\n\t.byte 8\n" "\t.byte 0x80+0x10\n\t.byte 0x1\n" "\t.align 3\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 */ "\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 */ "\t.align 3\n" "LEFDEY:\n\n", fcsize); } #endif } break; #endif default: /* Difficult for other modes. */ break; } } subprojects/luajit/src/lj_iropt.h0000644000175000017500000001354214741067622016477 0ustar aniolaniol/* ** Common header for IR emitter and optimizations. ** Copyright (C) 2005-2023 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; } LJ_FUNC TRef lj_ir_ggfload(jit_State *J, IRType t, uintptr_t ofs); /* Interning of constants. */ LJ_FUNC TRef LJ_FASTCALL lj_ir_kint(jit_State *J, int32_t k); LJ_FUNC TRef lj_ir_k64(jit_State *J, IROp op, 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); LJ_FUNC TRef lj_ir_ktrace(jit_State *J); #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 #if LJ_GC64 #define lj_ir_kintpgc lj_ir_kintp #else #define lj_ir_kintpgc lj_ir_kint #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_ksimd(J, idx) \ lj_ir_ggfload(J, IRT_NUM, (uintptr_t)LJ_KSIMD(J, idx) - (uintptr_t)J2GG(J)) /* 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_alen(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_FASTCALL lj_opt_fwd_sbuf(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 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_SOFTFP32 || (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 subprojects/luajit/src/lj_errmsg.h0000644000175000017500000002011514741067622016633 0ustar aniolaniol/* ** VM error messages. ** Copyright (C) 2005-2023 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(NUMRNG, "number out of range") 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(PRNGSD, "PRNG seeding failed") 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(STRFMT, "invalid option " LUA_QS " to " LUA_QL("format")) 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?") ERRDEF(NOJIT, "JIT compiler disabled") #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(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 #if LJ_HASBUFFER /* String buffer errors. */ ERRDEF(BUFFER_SELF, "cannot put buffer into itself") ERRDEF(BUFFER_BADOPT, "bad options table") ERRDEF(BUFFER_BADENC, "cannot serialize " LUA_QS) ERRDEF(BUFFER_BADDEC, "cannot deserialize tag 0x%02x") ERRDEF(BUFFER_BADDICTX, "cannot deserialize dictionary index %d") ERRDEF(BUFFER_DEPTH, "too deep to serialize") ERRDEF(BUFFER_DUPKEY, "duplicate table key") ERRDEF(BUFFER_EOB, "unexpected end of buffer") ERRDEF(BUFFER_LEFTOV, "left-over data in buffer") #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 */ subprojects/luajit/src/lj_serialize.h0000644000175000017500000000146014741067622017325 0ustar aniolaniol/* ** Object de/serialization. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #ifndef _LJ_SERIALIZE_H #define _LJ_SERIALIZE_H #include "lj_obj.h" #include "lj_buf.h" #if LJ_HASBUFFER #define LJ_SERIALIZE_DEPTH 100 /* Default depth. */ LJ_FUNC void LJ_FASTCALL lj_serialize_dict_prep_str(lua_State *L, GCtab *dict); LJ_FUNC void LJ_FASTCALL lj_serialize_dict_prep_mt(lua_State *L, GCtab *dict); LJ_FUNC SBufExt * LJ_FASTCALL lj_serialize_put(SBufExt *sbx, cTValue *o); LJ_FUNC char * LJ_FASTCALL lj_serialize_get(SBufExt *sbx, TValue *o); LJ_FUNC GCstr * LJ_FASTCALL lj_serialize_encode(lua_State *L, cTValue *o); LJ_FUNC void lj_serialize_decode(lua_State *L, TValue *o, GCstr *str); #if LJ_HASJIT LJ_FUNC MSize LJ_FASTCALL lj_serialize_peektype(SBufExt *sbx); #endif #endif #endif subprojects/luajit/src/lj_emit_ppc.h0000644000175000017500000001601414741067622017137 0ustar aniolaniol/* ** PPC instruction emitter. ** Copyright (C) 2005-2023 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) { lj_assertA(n >= 0 && n < 32, "shift out or range"); emit_rot(as, PPCI_RLWINM, ra, rs, n, 0, 31-n); } static void emit_rotlwi(ASMState *as, Reg ra, Reg rs, int32_t n) { lj_assertA(n >= 0 && n < 32, "shift out or range"); 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 rd, int32_t i) { RegSet work = ~as->freeset & RSET_GPR; while (work) { Reg r = rset_picktop(work); IRRef ref = regcost_ref(as->cost[r]); lj_assertA(r != rd, "dest reg %d not free", rd); 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, rd, 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, intptr_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_loadk64(as, r, ir) \ emit_lsptr(as, PPCI_LFD, ((r) & 31), (void *)&ir_knum((ir))->u64, 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; lj_assertA(((delta + 0x8000) >> 16) == 0, "branch target out of range"); 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 with base and (small) offset address. */ static void emit_loadofs(ASMState *as, IRIns *ir, Reg r, Reg base, int32_t ofs) { if (r < RID_MAX_GPR) emit_tai(as, PPCI_LWZ, r, base, ofs); else emit_fai(as, irt_isnum(ir->t) ? PPCI_LFD : PPCI_LFS, r, base, ofs); } /* Generic store of register with base and (small) offset address. */ static void emit_storeofs(ASMState *as, IRIns *ir, Reg r, Reg base, int32_t ofs) { if (r < RID_MAX_GPR) emit_tai(as, PPCI_STW, r, base, ofs); else emit_fai(as, irt_isnum(ir->t) ? PPCI_STFD : PPCI_STFS, r, base, 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)); } } subprojects/luajit/src/lj_cdata.h0000644000175000017500000000437214741067622016417 0ustar aniolaniol/* ** C data management. ** Copyright (C) 2005-2023 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 { lj_assertX(sz == CTSIZE_PTR, "bad pointer size %d", sz); 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 { lj_assertX(sz == CTSIZE_PTR, "bad pointer size %d", sz); *(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); lj_assertCTS((ctype_hassize(ct->info) ? ct->size : CTSIZE_PTR) == sz, "inconsistent size of fixed-size cdata alloc"); #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(lua_State *L, CTypeID id, CTSize sz, CTSize align); LJ_FUNC GCcdata *lj_cdata_newx(CTState *cts, CTypeID id, CTSize sz, CTInfo info); LJ_FUNC void LJ_FASTCALL lj_cdata_free(global_State *g, GCcdata *cd); LJ_FUNC void lj_cdata_setfin(lua_State *L, GCcdata *cd, GCobj *obj, uint32_t it); 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 subprojects/luajit/src/lj_asm_mips.h0000644000175000017500000026126114741067622017155 0ustar aniolaniol/* ** MIPS IR assembler (SSA IR -> machine code). ** Copyright (C) 2005-2023 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) && get_kval(as, ref) == 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->mctop; if ((char *)mxp == (char *)as->J->mcarea + as->J->szmcarea) { mxp -= MIPS_SPAREJUMP*2; lj_assertA(MIPSI_NOP == 0, "bad NOP"); memset(mxp, 0, MIPS_SPAREJUMP*2*sizeof(MCode)); as->mctop = mxp; } } static MCode *asm_sparejump_use(MCode *mcarea, MCode tjump) { MCode *mxp = (MCode *)((char *)mcarea + ((MCLink *)mcarea)->size); int slot = MIPS_SPAREJUMP; while (slot--) { mxp -= 2; if (*mxp == tjump) { return mxp; } else if (*mxp == MIPSI_NOP) { *mxp = tjump; return mxp; } } return NULL; } /* 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); lj_assertA(((uintptr_t)mxp ^ (uintptr_t)(void *)lj_vm_exit_handler)>>28 == 0, "branch target out of range"); *--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; #if !LJ_TARGET_MIPSR6 mi = mi ^ ((mi>>28) == 1 ? 0x04000000u : 0x00010000u); /* Invert cond. */ #else mi = mi ^ ((mi>>28) == 1 ? 0x04000000u : (mi>>28) == 4 ? 0x00800000u : 0x00010000u); /* Invert cond. */ #endif 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)); intptr_t ofs = (intptr_t)&gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.tv; intptr_t jgl = (intptr_t)J2G(as->J); if ((uintptr_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); } } } else if (ir->o == IR_TMPREF) { *ofsp = (int32_t)(offsetof(global_State, tmptv)-32768); return RID_JGL; } } *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) { intptr_t ofs2; if (irref_isk(ir->op2) && (ofs2 = ofs + get_kval(as, ir->op2), checki16(ofs2))) { ref = ir->op1; ofs = (int32_t)ofs2; } } else if (ir->o == IR_STRREF) { intptr_t ofs2 = 65536; lj_assertA(ofs == 0, "bad usage"); ofs = (int32_t)sizeof(GCstr); if (irref_isk(ir->op2)) { ofs2 = ofs + get_kval(as, ir->op2); ref = ir->op1; } else if (irref_isk(ir->op1)) { ofs2 = ofs + get_kval(as, ir->op1); 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_AADDU, 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_XNARGS(ci); int32_t ofs = LJ_32 ? 16 : 0; #if LJ_SOFTFP Reg gpr = REGARG_FIRSTGPR; #else Reg gpr, fpr = REGARG_FIRSTFPR; #endif if ((void *)ci->func) emit_call(as, (void *)ci->func, 1); #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]; if (ref) { IRIns *ir = IR(ref); #if !LJ_SOFTFP if (irt_isfp(ir->t) && fpr <= REGARG_LASTFPR && !(ci->flags & CCI_VARARG)) { lj_assertA(rset_test(as->freeset, fpr), "reg %d not free", fpr); /* Already evicted. */ ra_leftov(as, fpr, ref); fpr += LJ_32 ? 2 : 1; gpr += (LJ_32 && irt_isnum(ir->t)) ? 2 : 1; } else #endif { #if LJ_32 && !LJ_SOFTFP fpr = REGARG_LASTFPR+1; #endif if (LJ_32 && irt_isnum(ir->t)) gpr = (gpr+1) & ~1; if (gpr <= REGARG_LASTGPR) { lj_assertA(rset_test(as->freeset, gpr), "reg %d not free", gpr); /* Already evicted. */ #if !LJ_SOFTFP 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)) { #if LJ_32 emit_tg(as, MIPSI_MFC1, gpr+(LJ_BE?0:1), r+1); emit_tg(as, MIPSI_MFC1, gpr+(LJ_BE?1:0), r); lj_assertA(rset_test(as->freeset, gpr+1), "reg %d not free", gpr+1); /* Already evicted. */ gpr += 2; #else emit_tg(as, MIPSI_DMFC1, gpr, r); gpr++; fpr++; #endif } else if (irt_isfloat(ir->t)) { emit_tg(as, MIPSI_MFC1, gpr, r); gpr++; #if LJ_64 fpr++; #endif } } else #endif { ra_leftov(as, gpr, ref); gpr++; #if LJ_64 && !LJ_SOFTFP fpr++; #endif } } else { Reg r = ra_alloc1z(as, ref, !LJ_SOFTFP && irt_isfp(ir->t) ? RSET_FPR : RSET_GPR); #if LJ_32 if (irt_isnum(ir->t)) ofs = (ofs + 4) & ~4; emit_spstore(as, ir, r, ofs); ofs += irt_isnum(ir->t) ? 8 : 4; #else emit_spstore(as, ir, r, ofs + ((LJ_BE && !irt_isfp(ir->t) && !irt_is64(ir->t)) ? 4 : 0)); ofs += 8; #endif } } } else { #if !LJ_SOFTFP fpr = REGARG_LASTFPR+1; #endif if (gpr <= REGARG_LASTGPR) { gpr++; #if LJ_64 && !LJ_SOFTFP fpr++; #endif } else { ofs += LJ_32 ? 4 : 8; } } 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 !LJ_SOFTFP if ((ci->flags & CCI_NOFPRCLOBBER)) drop &= ~RSET_FPR; #endif 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)) { lj_assertA(!irt_ispri(ir->t), "PRI dest"); if (!LJ_SOFTFP && 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); #if LJ_32 emit_tg(as, MIPSI_MTC1, RID_RETHI, dest+1); emit_tg(as, MIPSI_MTC1, RID_RETLO, dest); #else emit_tg(as, MIPSI_DMTC1, RID_RET, dest); #endif } if (ofs) { #if LJ_32 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 emit_tsi(as, MIPSI_SD, RID_RET, RID_SP, ofs); #endif } } else { ra_destreg(as, ir, RID_FPRET); } } else if (hiop) { ra_destpair(as, ir); } else { ra_destreg(as, ir, RID_RET); } } } 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 *)get_kval(as, func); } 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); } #if !LJ_SOFTFP 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 LJ_TARGET_MIPSR6 |RID2RSET(RID_F21) #endif ; 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, 0); ra_leftov(as, REGARG_FIRSTFPR, ir->op1); } #endif /* -- 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+LJ_FR2+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, igcptr(pc), rset_exclude(RSET_GPR, base))); emit_tsi(as, MIPSI_AL, RID_TMP, base, (LJ_BE || LJ_FR2) ? -8 : -4); } /* -- Buffer operations --------------------------------------------------- */ #if LJ_HASBUFFER static void asm_bufhdr_write(ASMState *as, Reg sb) { Reg tmp = ra_scratch(as, rset_exclude(RSET_GPR, sb)); IRIns irgc; irgc.ot = IRT(0, IRT_PGC); /* GC type. */ emit_storeofs(as, &irgc, RID_TMP, sb, offsetof(SBuf, L)); if ((as->flags & JIT_F_MIPSXXR2)) { emit_tsml(as, LJ_64 ? MIPSI_DINS : MIPSI_INS, RID_TMP, tmp, lj_fls(SBUF_MASK_FLAG), 0); } else { emit_dst(as, MIPSI_OR, RID_TMP, RID_TMP, tmp); emit_tsi(as, MIPSI_ANDI, tmp, tmp, SBUF_MASK_FLAG); } emit_getgl(as, RID_TMP, cur_L); emit_loadofs(as, &irgc, tmp, sb, offsetof(SBuf, L)); } #endif /* -- 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); #if !LJ_TARGET_MIPSR6 asm_guard(as, MIPSI_BC1F, 0, 0); emit_fgh(as, MIPSI_C_EQ_D, 0, tmp, left); #else asm_guard(as, MIPSI_BC1EQZ, 0, (tmp&31)); emit_fgh(as, MIPSI_CMP_EQ_D, tmp, tmp, left); #endif 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); } #elif LJ_64 /* && LJ_SOFTFP */ static void asm_tointg(ASMState *as, IRIns *ir, Reg r) { /* The modified regs must match with the *.dasc implementation. */ RegSet drop = RID2RSET(REGARG_FIRSTGPR)|RID2RSET(RID_RET)|RID2RSET(RID_RET+1)| RID2RSET(RID_R1)|RID2RSET(RID_R12); if (ra_hasreg(ir->r)) rset_clear(drop, ir->r); ra_evictset(as, drop); /* Return values are in RID_RET (converted value) and RID_RET+1 (status). */ ra_destreg(as, ir, RID_RET); asm_guard(as, MIPSI_BNE, RID_RET+1, RID_ZERO); emit_call(as, (void *)lj_ir_callinfo[IRCALL_lj_vm_tointg].func, 0); if (r == RID_NONE) ra_leftov(as, REGARG_FIRSTGPR, ir->op1); else if (r != REGARG_FIRSTGPR) emit_move(as, REGARG_FIRSTGPR, r); } static void asm_tobit(ASMState *as, IRIns *ir) { Reg dest = ra_dest(as, ir, RSET_GPR); emit_dta(as, MIPSI_SLL, dest, dest, 0); asm_callid(as, ir, IRCALL_lj_vm_tobit); } #endif static void asm_conv(ASMState *as, IRIns *ir) { IRType st = (IRType)(ir->op2 & IRCONV_SRCMASK); #if !LJ_SOFTFP32 int stfp = (st == IRT_NUM || st == IRT_FLOAT); #endif #if LJ_64 int st64 = (st == IRT_I64 || st == IRT_U64 || st == IRT_P64); #endif IRRef lref = ir->op1; #if LJ_32 /* 64 bit integer conversions are handled by SPLIT. */ lj_assertA(!(irt_isint64(ir->t) || (st == IRT_I64 || st == IRT_U64)), "IR %04d has unsplit 64 bit type", (int)(ir - as->ir) - REF_BIAS); #endif #if LJ_SOFTFP32 /* FP conversions are handled by SPLIT. */ lj_assertA(!irt_isfp(ir->t) && !(st == IRT_NUM || st == IRT_FLOAT), "IR %04d has FP type", (int)(ir - as->ir) - REF_BIAS); /* Can't check for same types: SPLIT uses CONV int.int + BXOR for sfp NEG. */ #else lj_assertA(irt_type(ir->t) != st, "inconsistent types for CONV"); #if !LJ_SOFTFP 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 *)&as->J->k64[LJ_K64_2P31], 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); #if LJ_64 } else if(st == IRT_U64) { /* U64 to FP conversion. */ /* if (x >= 1u<<63) y = (double)(int64_t)(x&(1u<<63)-1) + pow(2.0, 63) */ Reg left = ra_alloc1(as, lref, RSET_GPR); Reg tmp = ra_scratch(as, rset_exclude(RSET_FPR, dest)); MCLabel l_end = emit_label(as); if (irt_isfloat(ir->t)) { emit_fgh(as, MIPSI_ADD_S, dest, dest, tmp); emit_lsptr(as, MIPSI_LWC1, (tmp & 31), (void *)&as->J->k32[LJ_K32_2P63], rset_exclude(RSET_GPR, left)); emit_fg(as, MIPSI_CVT_S_L, dest, dest); } else { emit_fgh(as, MIPSI_ADD_D, dest, dest, tmp); emit_lsptr(as, MIPSI_LDC1, (tmp & 31), (void *)&as->J->k64[LJ_K64_2P63], rset_exclude(RSET_GPR, left)); emit_fg(as, MIPSI_CVT_D_L, dest, dest); } emit_branch(as, MIPSI_BGEZ, left, RID_ZERO, l_end); emit_tg(as, MIPSI_DMTC1, RID_TMP, dest); emit_tsml(as, MIPSI_DEXTM, RID_TMP, left, 30, 0); #endif } else { /* Integer to FP conversion. */ Reg left = ra_alloc1(as, lref, RSET_GPR); #if LJ_32 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 MIPSIns mi = irt_isfloat(ir->t) ? (st64 ? MIPSI_CVT_S_L : MIPSI_CVT_S_W) : (st64 ? MIPSI_CVT_D_L : MIPSI_CVT_D_W); emit_fg(as, mi, dest, dest); emit_tg(as, st64 ? MIPSI_DMTC1 : MIPSI_MTC1, left, dest); #endif } } else if (stfp) { /* FP to integer conversion. */ if (irt_isguard(ir->t)) { /* Checked conversions are only supported from number to int. */ lj_assertA(irt_isint(ir->t) && st == IRT_NUM, "bad type for checked CONV"); 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)) { /* FP to U32 conversion. */ /* 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 *)&as->J->k32[LJ_K32_2P31], RSET_GPR); else emit_lsptr(as, MIPSI_LDC1, (tmp & 31), (void *)&as->J->k64[LJ_K64_2P31], RSET_GPR); #if LJ_64 } else if (irt_isu64(ir->t)) { /* FP to U64 conversion. */ MCLabel l_end; emit_tg(as, MIPSI_DMFC1, dest, tmp); l_end = emit_label(as); /* For inputs >= 2^63 add -2^64 and convert again. */ if (st == IRT_NUM) { emit_fg(as, MIPSI_TRUNC_L_D, tmp, tmp); emit_fgh(as, MIPSI_ADD_D, tmp, left, tmp); emit_lsptr(as, MIPSI_LDC1, (tmp & 31), (void *)&as->J->k64[LJ_K64_M2P64], rset_exclude(RSET_GPR, dest)); emit_fg(as, MIPSI_TRUNC_L_D, tmp, left); /* Delay slot. */ #if !LJ_TARGET_MIPSR6 emit_branch(as, MIPSI_BC1T, 0, 0, l_end); emit_fgh(as, MIPSI_C_OLT_D, 0, left, tmp); #else emit_branch(as, MIPSI_BC1NEZ, 0, (tmp&31), l_end); emit_fgh(as, MIPSI_CMP_LT_D, tmp, left, tmp); #endif emit_lsptr(as, MIPSI_LDC1, (tmp & 31), (void *)&as->J->k64[LJ_K64_2P63], rset_exclude(RSET_GPR, dest)); } else { emit_fg(as, MIPSI_TRUNC_L_S, tmp, tmp); emit_fgh(as, MIPSI_ADD_S, tmp, left, tmp); emit_lsptr(as, MIPSI_LWC1, (tmp & 31), (void *)&as->J->k32[LJ_K32_M2P64], rset_exclude(RSET_GPR, dest)); emit_fg(as, MIPSI_TRUNC_L_S, tmp, left); /* Delay slot. */ #if !LJ_TARGET_MIPSR6 emit_branch(as, MIPSI_BC1T, 0, 0, l_end); emit_fgh(as, MIPSI_C_OLT_S, 0, left, tmp); #else emit_branch(as, MIPSI_BC1NEZ, 0, (tmp&31), l_end); emit_fgh(as, MIPSI_CMP_LT_S, tmp, left, tmp); #endif emit_lsptr(as, MIPSI_LWC1, (tmp & 31), (void *)&as->J->k32[LJ_K32_2P63], rset_exclude(RSET_GPR, dest)); } #endif } else { #if LJ_32 emit_tg(as, MIPSI_MFC1, dest, tmp); emit_fg(as, st == IRT_FLOAT ? MIPSI_TRUNC_W_S : MIPSI_TRUNC_W_D, tmp, left); #else MIPSIns mi = irt_is64(ir->t) ? (st == IRT_NUM ? MIPSI_TRUNC_L_D : MIPSI_TRUNC_L_S) : (st == IRT_NUM ? MIPSI_TRUNC_W_D : MIPSI_TRUNC_W_S); emit_tg(as, irt_is64(ir->t) ? MIPSI_DMFC1 : MIPSI_MFC1, dest, tmp); emit_fg(as, mi, tmp, left); #endif } } } else #else if (irt_isfp(ir->t)) { #if LJ_64 && LJ_HASFFI if (stfp) { /* FP to FP conversion. */ asm_callid(as, ir, irt_isnum(ir->t) ? IRCALL_softfp_f2d : IRCALL_softfp_d2f); } else { /* Integer to FP conversion. */ IRCallID cid = ((IRT_IS64 >> st) & 1) ? (irt_isnum(ir->t) ? (st == IRT_I64 ? IRCALL_fp64_l2d : IRCALL_fp64_ul2d) : (st == IRT_I64 ? IRCALL_fp64_l2f : IRCALL_fp64_ul2f)) : (irt_isnum(ir->t) ? (st == IRT_INT ? IRCALL_softfp_i2d : IRCALL_softfp_ui2d) : (st == IRT_INT ? IRCALL_softfp_i2f : IRCALL_softfp_ui2f)); asm_callid(as, ir, cid); } #else asm_callid(as, ir, IRCALL_softfp_i2d); #endif } else if (stfp) { /* FP to integer conversion. */ if (irt_isguard(ir->t)) { /* Checked conversions are only supported from number to int. */ lj_assertA(irt_isint(ir->t) && st == IRT_NUM, "bad type for checked CONV"); asm_tointg(as, ir, RID_NONE); } else { IRCallID cid = irt_is64(ir->t) ? ((st == IRT_NUM) ? (irt_isi64(ir->t) ? IRCALL_fp64_d2l : IRCALL_fp64_d2ul) : (irt_isi64(ir->t) ? IRCALL_fp64_f2l : IRCALL_fp64_f2ul)) : ((st == IRT_NUM) ? (irt_isint(ir->t) ? IRCALL_softfp_d2i : IRCALL_softfp_d2ui) : (irt_isint(ir->t) ? IRCALL_softfp_f2i : IRCALL_softfp_f2ui)); asm_callid(as, ir, cid); } } else #endif #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, ir->op1, RSET_GPR); lj_assertA(irt_isint(ir->t) || irt_isu32(ir->t), "bad type for CONV EXT"); if ((ir->op2 & IRCONV_SEXT)) { if (LJ_64 || (as->flags & JIT_F_MIPSXXR2)) { 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. */ #if LJ_32 /* 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. */ #else if (irt_is64(ir->t)) { if (st64) { /* 64/64 bit no-op (cast)*/ ra_leftov(as, dest, lref); } else { Reg left = ra_alloc1(as, lref, RSET_GPR); if ((ir->op2 & IRCONV_SEXT)) { /* 32 to 64 bit sign extension. */ emit_dta(as, MIPSI_SLL, dest, left, 0); } else { /* 32 to 64 bit zero extension. */ emit_tsml(as, MIPSI_DEXT, dest, left, 31, 0); } } } else { if (st64 && !(ir->op2 & IRCONV_NONE)) { /* This is either a 32 bit reg/reg mov which zeroes the hiword ** or a load of the loword from a 64 bit address. */ Reg left = ra_alloc1(as, lref, RSET_GPR); emit_tsml(as, MIPSI_DEXT, dest, left, 31, 0); } else { /* 32/32 bit no-op (cast). */ /* Do nothing, but may need to move regs. */ ra_leftov(as, dest, lref); } } #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 = 0; #if LJ_SOFTFP32 ra_evictset(as, RSET_SCRATCH); if (ra_used(ir)) { if (ra_hasspill(ir->s) && ra_hasspill((ir+1)->s) && (ir->s & 1) == LJ_BE && (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 & ~1); } else { Reg rhi = ra_dest(as, ir+1, RSET_GPR); Reg rlo = ra_dest(as, ir, rset_exclude(RSET_GPR, rhi)); emit_tsi(as, MIPSI_LW, rhi, RID_SP, ofs+(LJ_BE?0:4)); emit_tsi(as, MIPSI_LW, rlo, RID_SP, ofs+(LJ_BE?4:0)); } } #else RegSet drop = RSET_SCRATCH; if (ra_hasreg(ir->r)) rset_set(drop, ir->r); /* Spill dest reg (if any). */ ra_evictset(as, drop); ofs = sps_scale(ir->s); #endif 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_AADDIU, ra_releasetmp(as, ASMREF_TMP1), RID_SP, ofs); } /* -- Memory references --------------------------------------------------- */ #if LJ_64 /* Store tagged value for ref at base+ofs. */ static void asm_tvstore64(ASMState *as, Reg base, int32_t ofs, IRRef ref) { RegSet allow = rset_exclude(RSET_GPR, base); IRIns *ir = IR(ref); lj_assertA(irt_ispri(ir->t) || irt_isaddr(ir->t) || irt_isinteger(ir->t), "store of IR type %d", irt_type(ir->t)); if (irref_isk(ref)) { TValue k; lj_ir_kvalue(as->J->L, &k, ir); emit_tsi(as, MIPSI_SD, ra_allock(as, (int64_t)k.u64, allow), base, ofs); } else { Reg src = ra_alloc1(as, ref, allow); Reg type = ra_allock(as, (int64_t)irt_toitype(ir->t) << 47, rset_exclude(allow, src)); emit_tsi(as, MIPSI_SD, RID_TMP, base, ofs); if (irt_isinteger(ir->t)) { emit_dst(as, MIPSI_DADDU, RID_TMP, RID_TMP, type); emit_tsml(as, MIPSI_DEXT, RID_TMP, src, 31, 0); } else { emit_dst(as, MIPSI_DADDU, RID_TMP, src, type); } } } #endif /* Get pointer to TValue. */ static void asm_tvptr(ASMState *as, Reg dest, IRRef ref, MSize mode) { int32_t tmpofs = (int32_t)(offsetof(global_State, tmptv)-32768); if ((mode & IRTMPREF_IN1)) { IRIns *ir = IR(ref); if (irt_isnum(ir->t)) { if ((mode & IRTMPREF_OUT1)) { #if LJ_SOFTFP emit_tsi(as, MIPSI_AADDIU, dest, RID_JGL, tmpofs); #if LJ_64 emit_setgl(as, ra_alloc1(as, ref, RSET_GPR), tmptv.u64); #else lj_assertA(irref_isk(ref), "unsplit FP op"); emit_setgl(as, ra_allock(as, (int32_t)ir_knum(ir)->u32.lo, RSET_GPR), tmptv.u32.lo); emit_setgl(as, ra_allock(as, (int32_t)ir_knum(ir)->u32.hi, RSET_GPR), tmptv.u32.hi); #endif #else Reg src = ra_alloc1(as, ref, RSET_FPR); emit_tsi(as, MIPSI_AADDIU, dest, RID_JGL, tmpofs); emit_tsi(as, MIPSI_SDC1, (src & 31), RID_JGL, tmpofs); #endif } else if (irref_isk(ref)) { /* Use the number constant itself as a TValue. */ ra_allockreg(as, igcptr(ir_knum(ir)), dest); } else { #if LJ_SOFTFP32 lj_assertA(0, "unsplit FP op"); #else /* Otherwise force a spill and use the spill slot. */ emit_tsi(as, MIPSI_AADDIU, dest, RID_SP, ra_spill(as, ir)); #endif } } else { /* Otherwise use g->tmptv to hold the TValue. */ #if LJ_32 Reg type; emit_tsi(as, MIPSI_ADDIU, dest, RID_JGL, tmpofs); if (!irt_ispri(ir->t)) { Reg src = ra_alloc1(as, ref, RSET_GPR); emit_setgl(as, src, tmptv.gcr); } if (LJ_SOFTFP && (ir+1)->o == IR_HIOP && !irt_isnil((ir+1)->t)) type = ra_alloc1(as, ref+1, RSET_GPR); else type = ra_allock(as, (int32_t)irt_toitype(ir->t), RSET_GPR); emit_setgl(as, type, tmptv.it); #else asm_tvstore64(as, dest, 0, ref); emit_tsi(as, MIPSI_DADDIU, dest, RID_JGL, tmpofs); #endif } } else { emit_tsi(as, MIPSI_AADDIU, dest, RID_JGL, tmpofs); } } 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_AADDIU, dest, base, ofs); return; } } base = ra_alloc1(as, ir->op1, RSET_GPR); idx = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, base)); #if !LJ_TARGET_MIPSR6 emit_dst(as, MIPSI_AADDU, dest, RID_TMP, base); emit_dta(as, MIPSI_SLL, RID_TMP, idx, 3); #else emit_dst(as, MIPSI_ALSA | MIPSF_A(3-1), dest, idx, base); #endif } /* 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, type = RID_NONE, tmpnum = RID_NONE, tmp1 = RID_TMP, tmp2; #if LJ_64 Reg cmp64 = RID_NONE; #endif IRRef refkey = ir->op2; IRIns *irkey = IR(refkey); int isk = irref_isk(refkey); IRType1 kt = irkey->t; uint32_t khash; MCLabel l_end, l_loop, l_next; rset_clear(allow, tab); if (!LJ_SOFTFP && 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); } #if LJ_32 if (LJ_SOFTFP && irkey[1].o == IR_HIOP) { if (ra_hasreg((irkey+1)->r)) { type = tmpnum = (irkey+1)->r; tmp1 = ra_scratch(as, allow); rset_clear(allow, tmp1); ra_noweak(as, tmpnum); } else { type = tmpnum = ra_allocref(as, refkey+1, allow); } rset_clear(allow, tmpnum); } else { type = ra_allock(as, (int32_t)irt_toitype(kt), allow); rset_clear(allow, type); } #endif } tmp2 = ra_scratch(as, allow); rset_clear(allow, tmp2); #if LJ_64 if (LJ_SOFTFP || !irt_isnum(kt)) { /* Allocate cmp64 register used for 64-bit comparisons */ if (LJ_SOFTFP && irt_isnum(kt)) { cmp64 = key; } else if (!isk && irt_isaddr(kt)) { cmp64 = tmp2; } else { int64_t k; if (isk && irt_isaddr(kt)) { k = ((int64_t)irt_toitype(kt) << 47) | irkey[1].tv.u64; } else { lj_assertA(irt_ispri(kt) && !irt_isnil(kt), "bad HREF key type"); k = ~((int64_t)~irt_toitype(kt) << 47); } cmp64 = ra_allock(as, k, allow); rset_clear(allow, cmp64); } } #endif /* 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_guard(as, MIPSI_B, RID_ZERO, RID_ZERO); else if (destused) emit_loada(as, dest, niltvg(J2G(as->J))); /* Follow hash chain until the end. */ emit_move(as, dest, tmp1); l_loop = --as->mcp; emit_tsi(as, MIPSI_AL, tmp1, dest, (int32_t)offsetof(Node, next)); l_next = emit_label(as); /* Type and value comparison. */ if (merge == IR_EQ) { /* Must match asm_guard(). */ emit_ti(as, MIPSI_LI, RID_TMP, as->snapno); l_end = asm_exitstub_addr(as); } if (!LJ_SOFTFP && irt_isnum(kt)) { #if !LJ_TARGET_MIPSR6 emit_branch(as, MIPSI_BC1T, 0, 0, l_end); emit_fgh(as, MIPSI_C_EQ_D, 0, tmpnum, key); #else emit_branch(as, MIPSI_BC1NEZ, 0, (tmpnum&31), l_end); emit_fgh(as, MIPSI_CMP_EQ_D, tmpnum, tmpnum, key); #endif *--as->mcp = MIPSI_NOP; /* Avoid NaN comparison overhead. */ emit_branch(as, MIPSI_BEQ, tmp1, RID_ZERO, l_next); emit_tsi(as, MIPSI_SLTIU, tmp1, tmp1, (int32_t)LJ_TISNUM); #if LJ_32 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); #else emit_dta(as, MIPSI_DSRA32, tmp1, tmp1, 15); emit_tg(as, MIPSI_DMTC1, tmp1, tmpnum); emit_tsi(as, MIPSI_LD, tmp1, dest, (int32_t)offsetof(Node, key.u64)); } else { emit_branch(as, MIPSI_BEQ, tmp1, cmp64, l_end); emit_tsi(as, MIPSI_LD, tmp1, dest, (int32_t)offsetof(Node, key.u64)); } *l_loop = MIPSI_BNE | MIPSF_S(tmp1) | ((as->mcp-l_loop-1) & 0xffffu); if (!isk && irt_isaddr(kt)) { type = ra_allock(as, (int64_t)irt_toitype(kt) << 47, allow); emit_dst(as, MIPSI_DADDU, tmp2, key, type); rset_clear(allow, type); } #endif /* Load main position relative to tab->node into dest. */ khash = isk ? ir_khash(as, irkey) : 1; if (khash == 0) { emit_tsi(as, MIPSI_AL, dest, tab, (int32_t)offsetof(GCtab, node)); } else { Reg tmphash = tmp1; if (isk) tmphash = ra_allock(as, khash, allow); emit_dst(as, MIPSI_AADDU, dest, dest, tmp1); lj_assertA(sizeof(Node) == 24, "bad Node size"); 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_AL, dest, tab, (int32_t)offsetof(GCtab, node)); emit_tsi(as, MIPSI_LW, tmp2, tab, (int32_t)offsetof(GCtab, hmask)); if (isk) { /* Nothing to do. */ } else if (irt_isstr(kt)) { emit_tsi(as, MIPSI_LW, tmp1, key, (int32_t)offsetof(GCstr, sid)); } 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 LJ_32 if (LJ_SOFTFP ? (irkey[1].o == IR_HIOP) : irt_isnum(kt)) { emit_dst(as, MIPSI_XOR, tmp2, tmp2, tmp1); if ((as->flags & JIT_F_MIPSXXR2)) { 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); #if LJ_SOFTFP emit_ds(as, MIPSI_MOVE, tmp1, type); emit_ds(as, MIPSI_MOVE, tmp2, key); #else emit_tg(as, MIPSI_MFC1, tmp2, key); emit_tg(as, MIPSI_MFC1, tmp1, key+1); #endif } 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)); } #else emit_dst(as, MIPSI_XOR, tmp2, tmp2, tmp1); emit_dta(as, MIPSI_ROTR, dest, tmp1, (-HASH_ROT1)&31); if (irt_isnum(kt)) { emit_dst(as, MIPSI_ADDU, tmp1, tmp1, tmp1); emit_dta(as, MIPSI_DSRA32, tmp1, LJ_SOFTFP ? key : tmp1, 0); emit_dta(as, MIPSI_SLL, tmp2, LJ_SOFTFP ? key : tmp1, 0); #if !LJ_SOFTFP emit_tg(as, MIPSI_DMFC1, tmp1, key); #endif } else { checkmclim(as); emit_dta(as, MIPSI_DSRA32, tmp1, tmp1, 0); emit_dta(as, MIPSI_SLL, tmp2, key, 0); emit_dst(as, MIPSI_DADDU, tmp1, key, type); } #endif } } } 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); RegSet allow = rset_exclude(RSET_GPR, node); Reg idx = node; #if LJ_32 Reg key = RID_NONE, type = RID_TMP; int32_t lo, hi; #else Reg key = ra_scratch(as, allow); int64_t k; #endif lj_assertA(ofs % sizeof(Node) == 0, "unaligned HREFK slot"); if (ofs > 32736) { idx = dest; rset_clear(allow, dest); kofs = (int32_t)offsetof(Node, key); } else if (ra_hasreg(dest)) { emit_tsi(as, MIPSI_AADDIU, dest, node, ofs); } #if LJ_32 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)); #else if (irt_ispri(irkey->t)) { lj_assertA(!irt_isnil(irkey->t), "bad HREFK key type"); k = ~((int64_t)~irt_toitype(irkey->t) << 47); } else if (irt_isnum(irkey->t)) { k = (int64_t)ir_knum(irkey)->u64; } else { k = ((int64_t)irt_toitype(irkey->t) << 47) | (int64_t)ir_kgc(irkey); } asm_guard(as, MIPSI_BNE, key, ra_allock(as, k, allow)); emit_tsi(as, MIPSI_LD, key, idx, kofs); #endif if (ofs > 32736) emit_tsi(as, MIPSI_AADDU, dest, node, ra_allock(as, ofs, allow)); } static void asm_uref(ASMState *as, IRIns *ir) { Reg dest = ra_dest(as, ir, RSET_GPR); int guarded = (irt_t(ir->t) & (IRT_GUARD|IRT_TYPE)) == (IRT_GUARD|IRT_PGC); if (irref_isk(ir->op1) && !guarded) { GCfunc *fn = ir_kfunc(IR(ir->op1)); MRef *v = &gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.v; emit_lsptr(as, MIPSI_AL, dest, v, RSET_GPR); } else { if (guarded) asm_guard(as, ir->o == IR_UREFC ? MIPSI_BEQ : MIPSI_BNE, RID_TMP, RID_ZERO); if (ir->o == IR_UREFC) emit_tsi(as, MIPSI_AADDIU, dest, dest, (int32_t)offsetof(GCupval, tv)); else emit_tsi(as, MIPSI_AL, dest, dest, (int32_t)offsetof(GCupval, v)); if (guarded) emit_tsi(as, MIPSI_LBU, RID_TMP, dest, (int32_t)offsetof(GCupval, closed)); if (irref_isk(ir->op1)) { GCfunc *fn = ir_kfunc(IR(ir->op1)); GCobj *o = gcref(fn->l.uvptr[(ir->op2 >> 8)]); emit_loada(as, dest, o); } else { emit_tsi(as, MIPSI_AL, dest, ra_alloc1(as, ir->op1, RSET_GPR), (int32_t)offsetof(GCfuncL, uvptr) + (int32_t)sizeof(MRef) * (int32_t)(ir->op2 >> 8)); } } } static void asm_fref(ASMState *as, IRIns *ir) { UNUSED(as); UNUSED(ir); lj_assertA(!ra_used(ir), "unfused FREF"); } static void asm_strref(ASMState *as, IRIns *ir) { #if LJ_32 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))); #else RegSet allow = RSET_GPR; Reg dest = ra_dest(as, ir, allow); Reg base = ra_alloc1(as, ir->op1, allow); IRIns *irr = IR(ir->op2); int32_t ofs = sizeof(GCstr); rset_clear(allow, base); if (irref_isk(ir->op2) && checki16(ofs + irr->i)) { emit_tsi(as, MIPSI_DADDIU, dest, base, ofs + irr->i); } else { emit_tsi(as, MIPSI_DADDIU, dest, dest, ofs); emit_dst(as, MIPSI_DADDU, dest, base, ra_alloc1(as, ir->op2, allow)); } #endif } /* -- Loads and stores ---------------------------------------------------- */ static MIPSIns asm_fxloadins(ASMState *as, IRIns *ir) { UNUSED(as); 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: lj_assertA(!LJ_SOFTFP32, "unsplit FP op"); if (!LJ_SOFTFP) return MIPSI_LDC1; /* fallthrough */ case IRT_FLOAT: if (!LJ_SOFTFP) return MIPSI_LWC1; /* fallthrough */ default: return (LJ_64 && irt_is64(ir->t)) ? MIPSI_LD : MIPSI_LW; } } static MIPSIns asm_fxstoreins(ASMState *as, IRIns *ir) { UNUSED(as); 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: lj_assertA(!LJ_SOFTFP32, "unsplit FP op"); if (!LJ_SOFTFP) return MIPSI_SDC1; /* fallthrough */ case IRT_FLOAT: if (!LJ_SOFTFP) return MIPSI_SWC1; /* fallthrough */ default: return (LJ_64 && irt_is64(ir->t)) ? MIPSI_SD : MIPSI_SW; } } static void asm_fload(ASMState *as, IRIns *ir) { Reg dest = ra_dest(as, ir, RSET_GPR); MIPSIns mi = asm_fxloadins(as, ir); Reg idx; int32_t ofs; if (ir->op1 == REF_NIL) { /* FLOAD from GG_State with offset. */ idx = RID_JGL; ofs = (ir->op2 << 2) - 32768 - GG_OFS(g); } else { idx = ra_alloc1(as, ir->op1, RSET_GPR); 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_AADDIU, dest, idx, ofs); return; } } ofs = field_ofs[ir->op2]; lj_assertA(!irt_isfp(ir->t), "bad FP FLOAD"); } 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(as, ir); lj_assertA(!irt_isfp(ir->t), "bad FP FSTORE"); emit_tsi(as, mi, 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); lj_assertA(LJ_TARGET_UNALIGNED || !(ir->op2 & IRXLOAD_UNALIGNED), "unaligned XLOAD"); asm_fusexref(as, asm_fxloadins(as, 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, (!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR); asm_fusexref(as, asm_fxstoreins(as, ir), src, ir->op1, rset_exclude(RSET_GPR, src), ofs); } } #define asm_xstore(as, ir) asm_xstore_(as, ir, 0) static void asm_ahuvload(ASMState *as, IRIns *ir) { int hiop = (LJ_SOFTFP32 && (ir+1)->o == IR_HIOP); Reg dest = RID_NONE, type = RID_TMP, idx; RegSet allow = RSET_GPR; int32_t ofs = 0; IRType1 t = ir->t; if (hiop) { t.irt = IRT_NUM; if (ra_used(ir+1)) { type = ra_dest(as, ir+1, allow); rset_clear(allow, type); } } if (ra_used(ir)) { lj_assertA((LJ_SOFTFP32 ? 0 : irt_isnum(ir->t)) || irt_isint(ir->t) || irt_isaddr(ir->t), "bad load type %d", irt_type(ir->t)); dest = ra_dest(as, ir, (!LJ_SOFTFP && irt_isnum(t)) ? RSET_FPR : allow); rset_clear(allow, dest); #if LJ_64 if (irt_isaddr(t)) emit_tsml(as, MIPSI_DEXTM, dest, dest, 14, 0); else if (irt_isint(t)) emit_dta(as, MIPSI_SLL, dest, dest, 0); #endif } idx = asm_fuseahuref(as, ir->op1, &ofs, allow); if (ir->o == IR_VLOAD) ofs += 8 * ir->op2; rset_clear(allow, idx); if (irt_isnum(t)) { asm_guard(as, MIPSI_BEQ, RID_TMP, RID_ZERO); emit_tsi(as, MIPSI_SLTIU, RID_TMP, type, (int32_t)LJ_TISNUM); } else { asm_guard(as, MIPSI_BNE, type, ra_allock(as, (int32_t)irt_toitype(t), allow)); } #if LJ_32 if (ra_hasreg(dest)) { if (!LJ_SOFTFP && irt_isnum(t)) emit_hsi(as, MIPSI_LDC1, dest, idx, ofs); else emit_tsi(as, MIPSI_LW, dest, idx, ofs+(LJ_BE?4:0)); } emit_tsi(as, MIPSI_LW, type, idx, ofs+(LJ_BE?0:4)); #else if (ra_hasreg(dest)) { if (!LJ_SOFTFP && irt_isnum(t)) { emit_hsi(as, MIPSI_LDC1, dest, idx, ofs); dest = type; } } else { dest = type; } emit_dta(as, MIPSI_DSRA32, type, dest, 15); emit_tsi(as, MIPSI_LD, dest, idx, ofs); #endif } 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 (!LJ_SOFTFP32 && irt_isnum(ir->t)) { src = ra_alloc1(as, ir->op2, LJ_SOFTFP ? RSET_GPR : RSET_FPR); idx = asm_fuseahuref(as, ir->op1, &ofs, allow); emit_hsi(as, LJ_SOFTFP ? MIPSI_SD : MIPSI_SDC1, src, idx, ofs); } else { #if LJ_32 if (!irt_ispri(ir->t)) { src = ra_alloc1(as, ir->op2, allow); rset_clear(allow, src); } if (LJ_SOFTFP && (ir+1)->o == IR_HIOP) type = ra_alloc1(as, (ir+1)->op2, allow); else type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow); rset_clear(allow, type); idx = asm_fuseahuref(as, ir->op1, &ofs, allow); 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)); #else Reg tmp = RID_TMP; if (irt_ispri(ir->t)) { tmp = ra_allock(as, ~((int64_t)~irt_toitype(ir->t) << 47), allow); rset_clear(allow, tmp); } else { src = ra_alloc1(as, ir->op2, allow); rset_clear(allow, src); type = ra_allock(as, (int64_t)irt_toitype(ir->t) << 47, allow); rset_clear(allow, type); } idx = asm_fuseahuref(as, ir->op1, &ofs, allow); emit_tsi(as, MIPSI_SD, tmp, idx, ofs); if (ra_hasreg(src)) { if (irt_isinteger(ir->t)) { emit_dst(as, MIPSI_DADDU, tmp, tmp, type); emit_tsml(as, MIPSI_DEXT, tmp, src, 31, 0); } else { emit_dst(as, MIPSI_DADDU, tmp, src, type); } } #endif } } static void asm_sload(ASMState *as, IRIns *ir) { Reg dest = RID_NONE, type = RID_NONE, base; RegSet allow = RSET_GPR; IRType1 t = ir->t; #if LJ_32 int32_t ofs = 8*((int32_t)ir->op1-1) + ((ir->op2 & IRSLOAD_FRAME) ? 4 : 0); int hiop = (LJ_SOFTFP32 && (ir+1)->o == IR_HIOP); if (hiop) t.irt = IRT_NUM; #else int32_t ofs = 8*((int32_t)ir->op1-2); #endif lj_assertA(!(ir->op2 & IRSLOAD_PARENT), "bad parent SLOAD"); /* Handled by asm_head_side(). */ lj_assertA(irt_isguard(ir->t) || !(ir->op2 & IRSLOAD_TYPECHECK), "inconsistent SLOAD variant"); #if LJ_SOFTFP32 lj_assertA(!(ir->op2 & IRSLOAD_CONVERT), "unsplit SLOAD 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(t) && irt_isint(t)) { dest = ra_scratch(as, LJ_SOFTFP ? allow : RSET_FPR); asm_tointg(as, ir, dest); t.irt = IRT_NUM; /* Continue with a regular number type check. */ } else #endif if (ra_used(ir)) { lj_assertA((LJ_SOFTFP32 ? 0 : irt_isnum(ir->t)) || irt_isint(ir->t) || irt_isaddr(ir->t), "bad SLOAD type %d", irt_type(ir->t)); dest = ra_dest(as, ir, (!LJ_SOFTFP && irt_isnum(t)) ? RSET_FPR : allow); rset_clear(allow, dest); base = ra_alloc1(as, REF_BASE, allow); rset_clear(allow, base); if (!LJ_SOFTFP32 && (ir->op2 & IRSLOAD_CONVERT)) { if (irt_isint(t)) { Reg tmp = ra_scratch(as, LJ_SOFTFP ? RSET_GPR : RSET_FPR); #if LJ_SOFTFP ra_evictset(as, rset_exclude(RSET_SCRATCH, dest)); ra_destreg(as, ir, RID_RET); emit_call(as, (void *)lj_ir_callinfo[IRCALL_softfp_d2i].func, 0); if (tmp != REGARG_FIRSTGPR) emit_move(as, REGARG_FIRSTGPR, tmp); #else emit_tg(as, MIPSI_MFC1, dest, tmp); emit_fg(as, MIPSI_TRUNC_W_D, tmp, tmp); #endif dest = tmp; t.irt = IRT_NUM; /* Check for original type. */ } else { Reg tmp = ra_scratch(as, RSET_GPR); #if LJ_SOFTFP ra_evictset(as, rset_exclude(RSET_SCRATCH, dest)); ra_destreg(as, ir, RID_RET); emit_call(as, (void *)lj_ir_callinfo[IRCALL_softfp_i2d].func, 0); emit_dta(as, MIPSI_SLL, REGARG_FIRSTGPR, tmp, 0); #else emit_fg(as, MIPSI_CVT_D_W, dest, dest); emit_tg(as, MIPSI_MTC1, tmp, dest); #endif dest = tmp; t.irt = IRT_INT; /* Check for original type. */ } } #if LJ_64 else if (irt_isaddr(t)) { /* Clear type from pointers. */ emit_tsml(as, MIPSI_DEXTM, dest, dest, 14, 0); } else if (irt_isint(t) && (ir->op2 & IRSLOAD_TYPECHECK)) { /* Sign-extend integers. */ emit_dta(as, MIPSI_SLL, dest, dest, 0); } #endif goto dotypecheck; } base = ra_alloc1(as, REF_BASE, allow); rset_clear(allow, base); dotypecheck: #if LJ_32 if ((ir->op2 & IRSLOAD_TYPECHECK)) { if (ra_noreg(type)) type = RID_TMP; if (irt_isnum(t)) { asm_guard(as, MIPSI_BEQ, RID_TMP, RID_ZERO); emit_tsi(as, MIPSI_SLTIU, RID_TMP, type, (int32_t)LJ_TISNUM); } else { Reg ktype = ra_allock(as, (ir->op2 & IRSLOAD_KEYINDEX) ? LJ_KEYINDEX : irt_toitype(t), allow); asm_guard(as, MIPSI_BNE, type, ktype); } } if (ra_hasreg(dest)) { if (!LJ_SOFTFP && irt_isnum(t)) emit_hsi(as, MIPSI_LDC1, dest, base, ofs); else 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)); #else if ((ir->op2 & IRSLOAD_TYPECHECK)) { type = dest < RID_MAX_GPR ? dest : RID_TMP; if (irt_ispri(t)) { asm_guard(as, MIPSI_BNE, type, ra_allock(as, ~((int64_t)~irt_toitype(t) << 47) , allow)); } else if ((ir->op2 & IRSLOAD_KEYINDEX)) { asm_guard(as, MIPSI_BNE, RID_TMP, ra_allock(as, (int32_t)LJ_KEYINDEX, allow)); emit_dta(as, MIPSI_DSRA32, RID_TMP, type, 0); } else { if (irt_isnum(t)) { asm_guard(as, MIPSI_BEQ, RID_TMP, RID_ZERO); emit_tsi(as, MIPSI_SLTIU, RID_TMP, RID_TMP, (int32_t)LJ_TISNUM); if (!LJ_SOFTFP && ra_hasreg(dest)) emit_hsi(as, MIPSI_LDC1, dest, base, ofs); } else { asm_guard(as, MIPSI_BNE, RID_TMP, ra_allock(as, (int32_t)irt_toitype(t), allow)); } emit_dta(as, MIPSI_DSRA32, RID_TMP, type, 15); } emit_tsi(as, MIPSI_LD, type, base, ofs); } else if (ra_hasreg(dest)) { if (!LJ_SOFTFP && irt_isnum(t)) emit_hsi(as, MIPSI_LDC1, dest, base, ofs); else emit_tsi(as, irt_isint(t) ? MIPSI_LW : MIPSI_LD, dest, base, ofs ^ ((LJ_BE && irt_isint(t)) ? 4 : 0)); } #endif } /* -- Allocations --------------------------------------------------------- */ #if LJ_HASFFI static void asm_cnew(ASMState *as, IRIns *ir) { CTState *cts = ctype_ctsG(J2G(as->J)); CTypeID id = (CTypeID)IR(ir->op1)->i; CTSize sz; CTInfo info = lj_ctype_info(cts, id, &sz); const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_mem_newgco]; IRRef args[4]; RegSet drop = RSET_SCRATCH; lj_assertA(sz != CTSIZE_INVALID || (ir->o == IR_CNEW && ir->op2 != REF_NIL), "bad CNEW/CNEWI operands"); 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) { RegSet allow = (RSET_GPR & ~RSET_SCRATCH); #if LJ_32 int32_t ofs = sizeof(GCcdata); if (sz == 8) { ofs += 4; lj_assertA((ir+1)->o == IR_HIOP, "expected HIOP for CNEWI"); 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--; } #else emit_tsi(as, sz == 8 ? MIPSI_SD : MIPSI_SW, ra_alloc1(as, ir->op2, allow), RID_RET, sizeof(GCcdata)); #endif lj_assertA(sz == 4 || sz == 8, "bad CNEWI size %d", sz); } else if (ir->op2 != REF_NIL) { /* Create VLA/VLS/aligned cdata. */ ci = &lj_ir_callinfo[IRCALL_lj_cdata_newv]; args[0] = ASMREF_L; /* lua_State *L */ args[1] = ir->op1; /* CTypeID id */ args[2] = ir->op2; /* CTSize sz */ args[3] = ASMREF_TMP1; /* CTSize align */ asm_gencall(as, ci, args); emit_loadi(as, ra_releasetmp(as, ASMREF_TMP1), (int32_t)ctype_align(info)); return; } /* 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, id); /* Lower 16 bit used. Sign-ext ok. */ args[0] = ASMREF_L; /* lua_State *L */ args[1] = ASMREF_TMP1; /* MSize size */ asm_gencall(as, ci, args); ra_allockreg(as, (int32_t)(sz+sizeof(GCcdata)), ra_releasetmp(as, ASMREF_TMP1)); } #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_AS, 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). */ lj_assertA(IR(ir->op1)->o == IR_UREFC, "bad OBAR type"); 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_AADDIU, 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 ------------------------------------- */ #if !LJ_SOFTFP 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); } #endif #if !LJ_SOFTFP32 static void asm_fpmath(ASMState *as, IRIns *ir) { #if !LJ_SOFTFP 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 #endif asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2); } #endif #if !LJ_SOFTFP #define asm_fpadd(as, ir) asm_fparith(as, ir, MIPSI_ADD_D) #define asm_fpsub(as, ir) asm_fparith(as, ir, MIPSI_SUB_D) #define asm_fpmul(as, ir) asm_fparith(as, ir, MIPSI_MUL_D) #elif LJ_64 /* && LJ_SOFTFP */ #define asm_fpadd(as, ir) asm_callid(as, ir, IRCALL_softfp_add) #define asm_fpsub(as, ir) asm_callid(as, ir, IRCALL_softfp_sub) #define asm_fpmul(as, ir) asm_callid(as, ir, IRCALL_softfp_mul) #endif static void asm_add(ASMState *as, IRIns *ir) { IRType1 t = ir->t; #if !LJ_SOFTFP32 if (irt_isnum(t)) { asm_fpadd(as, ir); } else #endif { /* TODO MIPSR6: Fuse ADD(BSHL(a,1-4),b) or ADD(ADD(a,a),b) to MIPSI_ALSA. */ Reg dest = ra_dest(as, ir, RSET_GPR); Reg right, left = ra_hintalloc(as, ir->op1, dest, RSET_GPR); if (irref_isk(ir->op2)) { intptr_t k = get_kval(as, ir->op2); if (checki16(k)) { emit_tsi(as, (LJ_64 && irt_is64(t)) ? MIPSI_DADDIU : MIPSI_ADDIU, dest, left, k); return; } } right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); emit_dst(as, (LJ_64 && irt_is64(t)) ? MIPSI_DADDU : MIPSI_ADDU, dest, left, right); } } static void asm_sub(ASMState *as, IRIns *ir) { #if !LJ_SOFTFP32 if (irt_isnum(ir->t)) { asm_fpsub(as, ir); } else #endif { 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, (LJ_64 && irt_is64(ir->t)) ? MIPSI_DSUBU : MIPSI_SUBU, dest, left, right); } } static void asm_mul(ASMState *as, IRIns *ir) { #if !LJ_SOFTFP32 if (irt_isnum(ir->t)) { asm_fpmul(as, ir); } else #endif { Reg dest = ra_dest(as, ir, RSET_GPR); Reg right, left = ra_alloc2(as, ir, RSET_GPR); right = (left >> 8); left &= 255; if (LJ_64 && irt_is64(ir->t)) { #if !LJ_TARGET_MIPSR6 emit_dst(as, MIPSI_MFLO, dest, 0, 0); emit_dst(as, MIPSI_DMULT, 0, left, right); #else emit_dst(as, MIPSI_DMUL, dest, left, right); #endif } else { emit_dst(as, MIPSI_MUL, dest, left, right); } } } #if !LJ_SOFTFP32 static void asm_fpdiv(ASMState *as, IRIns *ir) { #if !LJ_SOFTFP asm_fparith(as, ir, MIPSI_DIV_D); #else asm_callid(as, ir, IRCALL_softfp_div); #endif } #endif static void asm_neg(ASMState *as, IRIns *ir) { #if !LJ_SOFTFP if (irt_isnum(ir->t)) { asm_fpunary(as, ir, MIPSI_NEG_D); } else #elif LJ_64 /* && LJ_SOFTFP */ if (irt_isnum(ir->t)) { Reg dest = ra_dest(as, ir, RSET_GPR); Reg left = ra_hintalloc(as, ir->op1, dest, RSET_GPR); emit_dst(as, MIPSI_XOR, dest, left, ra_allock(as, 0x8000000000000000ll, rset_exclude(RSET_GPR, dest))); } else #endif { Reg dest = ra_dest(as, ir, RSET_GPR); Reg left = ra_hintalloc(as, ir->op1, dest, RSET_GPR); emit_dst(as, (LJ_64 && irt_is64(ir->t)) ? MIPSI_DSUBU : MIPSI_SUBU, dest, RID_ZERO, left); } } #if !LJ_SOFTFP #define asm_abs(as, ir) asm_fpunary(as, ir, MIPSI_ABS_D) #elif LJ_64 /* && LJ_SOFTFP */ static void asm_abs(ASMState *as, IRIns *ir) { Reg dest = ra_dest(as, ir, RSET_GPR); Reg left = ra_alloc1(as, ir->op1, RSET_GPR); emit_tsml(as, MIPSI_DEXTM, dest, left, 30, 0); } #endif static void asm_arithov(ASMState *as, IRIns *ir) { /* TODO MIPSR6: bovc/bnvc. Caveat: no delay slot to load RID_TMP. */ Reg right, left, tmp, dest = ra_dest(as, ir, RSET_GPR); lj_assertA(!irt_is64(ir->t), "bad usage"); if (irref_isk(ir->op2)) { int k = IR(ir->op2)->i; if (ir->o == IR_SUBOV) k = (int)(~(unsigned int)k+1u); 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); } #define asm_addov(as, ir) asm_arithov(as, ir) #define asm_subov(as, ir) asm_arithov(as, ir) static void asm_mulov(ASMState *as, IRIns *ir) { Reg dest = ra_dest(as, ir, RSET_GPR); Reg tmp, right, 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_BNE, RID_TMP, tmp); emit_dta(as, MIPSI_SRA, RID_TMP, dest, 31); #if !LJ_TARGET_MIPSR6 emit_dst(as, MIPSI_MFHI, tmp, 0, 0); emit_dst(as, MIPSI_MFLO, dest, 0, 0); emit_dst(as, MIPSI_MULT, 0, left, right); #else emit_dst(as, MIPSI_MUL, dest, left, right); emit_dst(as, MIPSI_MUH, tmp, left, right); #endif } #if LJ_32 && 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_bnot(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_bswap(ASMState *as, IRIns *ir) { Reg dest = ra_dest(as, ir, RSET_GPR); Reg left = ra_alloc1(as, ir->op1, RSET_GPR); #if LJ_32 if ((as->flags & JIT_F_MIPSXXR2)) { 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); } #else if (irt_is64(ir->t)) { emit_dst(as, MIPSI_DSHD, dest, 0, RID_TMP); emit_dst(as, MIPSI_DSBH, RID_TMP, 0, left); } else { emit_dta(as, MIPSI_ROTR, dest, RID_TMP, 16); emit_dst(as, MIPSI_WSBH, RID_TMP, 0, left); } #endif } 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)) { intptr_t k = get_kval(as, ir->op2); 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); } #define asm_band(as, ir) asm_bitop(as, ir, MIPSI_AND, MIPSI_ANDI) #define asm_bor(as, ir) asm_bitop(as, ir, MIPSI_OR, MIPSI_ORI) #define asm_bxor(as, ir) asm_bitop(as, ir, MIPSI_XOR, MIPSI_XORI) 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; if (LJ_64 && irt_is64(ir->t)) mik |= (shift & 32) ? MIPSI_D32 : MIPSI_D; emit_dta(as, mik, dest, ra_hintalloc(as, ir->op1, dest, RSET_GPR), (shift & 31)); } else { Reg right, left = ra_alloc2(as, ir, RSET_GPR); right = (left >> 8); left &= 255; if (LJ_64 && irt_is64(ir->t)) mi |= MIPSI_DV; emit_dst(as, mi, dest, right, left); /* Shift amount is in rs. */ } } #define asm_bshl(as, ir) asm_bitshift(as, ir, MIPSI_SLLV, MIPSI_SLL) #define asm_bshr(as, ir) asm_bitshift(as, ir, MIPSI_SRLV, MIPSI_SRL) #define asm_bsar(as, ir) asm_bitshift(as, ir, MIPSI_SRAV, MIPSI_SRA) #define asm_brol(as, ir) lj_assertA(0, "unexpected BROL") static void asm_bror(ASMState *as, IRIns *ir) { if (LJ_64 || (as->flags & JIT_F_MIPSXXR2)) { 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); } } } #if LJ_SOFTFP static void asm_sfpmin_max(ASMState *as, IRIns *ir) { CCallInfo ci = lj_ir_callinfo[(IROp)ir->o == IR_MIN ? IRCALL_lj_vm_sfmin : IRCALL_lj_vm_sfmax]; #if LJ_64 IRRef args[2]; args[0] = ir->op1; args[1] = ir->op2; #else IRRef args[4]; args[0^LJ_BE] = ir->op1; args[1^LJ_BE] = (ir+1)->op1; args[2^LJ_BE] = ir->op2; args[3^LJ_BE] = (ir+1)->op2; #endif asm_setupresult(as, ir, &ci); emit_call(as, (void *)ci.func, 0); ci.func = NULL; asm_gencall(as, &ci, args); } #endif static void asm_min_max(ASMState *as, IRIns *ir, int ismax) { if (!LJ_SOFTFP32 && irt_isnum(ir->t)) { #if LJ_SOFTFP asm_sfpmin_max(as, ir); #else Reg dest = ra_dest(as, ir, RSET_FPR); Reg right, left = ra_alloc2(as, ir, RSET_FPR); right = (left >> 8); left &= 255; #if !LJ_TARGET_MIPSR6 if (dest == left) { emit_fg(as, MIPSI_MOVF_D, dest, right); } else { emit_fg(as, MIPSI_MOVT_D, dest, left); if (dest != right) emit_fg(as, MIPSI_MOV_D, dest, right); } emit_fgh(as, MIPSI_C_OLT_D, 0, ismax ? right : left, ismax ? left : right); #else emit_fgh(as, ismax ? MIPSI_MAX_D : MIPSI_MIN_D, dest, left, right); #endif #endif } else { Reg dest = ra_dest(as, ir, RSET_GPR); Reg right, left = ra_alloc2(as, ir, RSET_GPR); right = (left >> 8); left &= 255; if (left == right) { if (dest != left) emit_move(as, dest, left); } else { #if !LJ_TARGET_MIPSR6 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); } #else emit_dst(as, MIPSI_OR, dest, dest, RID_TMP); if (dest != right) { emit_dst(as, MIPSI_SELNEZ, RID_TMP, right, RID_TMP); emit_dst(as, MIPSI_SELEQZ, dest, left, RID_TMP); } else { emit_dst(as, MIPSI_SELEQZ, RID_TMP, left, RID_TMP); emit_dst(as, MIPSI_SELNEZ, dest, right, RID_TMP); } #endif emit_dst(as, MIPSI_SLT, RID_TMP, ismax ? left : right, ismax ? right : left); } } } #define asm_min(as, ir) asm_min_max(as, ir, 0) #define asm_max(as, ir) asm_min_max(as, ir, 1) /* -- Comparisons --------------------------------------------------------- */ #if LJ_SOFTFP /* SFP comparisons. */ static void asm_sfpcomp(ASMState *as, IRIns *ir) { const CCallInfo *ci = &lj_ir_callinfo[IRCALL_softfp_cmp]; RegSet drop = RSET_SCRATCH; Reg r; #if LJ_64 IRRef args[2]; args[0] = ir->op1; args[1] = ir->op2; #else IRRef args[4]; args[LJ_LE ? 0 : 1] = ir->op1; args[LJ_LE ? 1 : 0] = (ir+1)->op1; args[LJ_LE ? 2 : 3] = ir->op2; args[LJ_LE ? 3 : 2] = (ir+1)->op2; #endif for (r = REGARG_FIRSTGPR; r <= REGARG_FIRSTGPR+(LJ_64?1:3); r++) { if (!rset_test(as->freeset, r) && regcost_ref(as->cost[r]) == args[r-REGARG_FIRSTGPR]) rset_clear(drop, r); } ra_evictset(as, drop); asm_setupresult(as, ir, ci); switch ((IROp)ir->o) { case IR_LT: asm_guard(as, MIPSI_BGEZ, RID_RET, 0); break; case IR_ULT: asm_guard(as, MIPSI_BEQ, RID_RET, RID_TMP); emit_loadi(as, RID_TMP, 1); asm_guard(as, MIPSI_BEQ, RID_RET, RID_ZERO); break; case IR_GE: asm_guard(as, MIPSI_BEQ, RID_RET, RID_TMP); emit_loadi(as, RID_TMP, 2); asm_guard(as, MIPSI_BLTZ, RID_RET, 0); break; case IR_LE: asm_guard(as, MIPSI_BGTZ, RID_RET, 0); break; case IR_GT: asm_guard(as, MIPSI_BEQ, RID_RET, RID_TMP); emit_loadi(as, RID_TMP, 2); asm_guard(as, MIPSI_BLEZ, RID_RET, 0); break; case IR_UGE: asm_guard(as, MIPSI_BLTZ, RID_RET, 0); break; case IR_ULE: asm_guard(as, MIPSI_BEQ, RID_RET, RID_TMP); emit_loadi(as, RID_TMP, 1); break; case IR_UGT: case IR_ABC: asm_guard(as, MIPSI_BLEZ, RID_RET, 0); break; case IR_EQ: case IR_NE: asm_guard(as, (ir->o & 1) ? MIPSI_BEQ : MIPSI_BNE, RID_RET, RID_ZERO); default: break; } asm_gencall(as, ci, args); } #endif static void asm_comp(ASMState *as, IRIns *ir) { /* ORDER IR: LT GE LE GT ULT UGE ULE UGT. */ IROp op = ir->o; if (!LJ_SOFTFP32 && irt_isnum(ir->t)) { #if LJ_SOFTFP asm_sfpcomp(as, ir); #else #if !LJ_TARGET_MIPSR6 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 tmp, right, left = ra_alloc2(as, ir, RSET_FPR); right = (left >> 8); left &= 255; tmp = ra_scratch(as, rset_exclude(rset_exclude(RSET_FPR, left), right)); asm_guard(as, (op&1) ? MIPSI_BC1NEZ : MIPSI_BC1EQZ, 0, (tmp&31)); emit_fgh(as, MIPSI_CMP_LT_D + ((op&3) ^ ((op>>2)&1)), tmp, left, right); #endif #endif } 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) && get_kval(as, ir->op2) == 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)) { intptr_t k = get_kval(as, ir->op2); 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_equal(ASMState *as, IRIns *ir) { Reg right, left = ra_alloc2(as, ir, (!LJ_SOFTFP && irt_isnum(ir->t)) ? RSET_FPR : RSET_GPR); right = (left >> 8); left &= 255; if (!LJ_SOFTFP32 && irt_isnum(ir->t)) { #if LJ_SOFTFP asm_sfpcomp(as, ir); #elif !LJ_TARGET_MIPSR6 asm_guard(as, (ir->o & 1) ? MIPSI_BC1T : MIPSI_BC1F, 0, 0); emit_fgh(as, MIPSI_C_EQ_D, 0, left, right); #else Reg tmp = ra_scratch(as, rset_exclude(rset_exclude(RSET_FPR, left), right)); asm_guard(as, (ir->o & 1) ? MIPSI_BC1NEZ : MIPSI_BC1EQZ, 0, (tmp&31)); emit_fgh(as, MIPSI_CMP_EQ_D, tmp, left, right); #endif } else { asm_guard(as, (ir->o & 1) ? MIPSI_BEQ : MIPSI_BNE, left, right); } } #if LJ_32 && 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 /* -- Split register ops -------------------------------------------------- */ /* Hiword op of a split 32/32 or 64/64 bit op. Previous op is the loword op. */ static void asm_hiop(ASMState *as, IRIns *ir) { /* 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 LJ_32 && (LJ_HASFFI || LJ_SOFTFP) if ((ir-1)->o == IR_CONV) { /* Conversions to/from 64 bit. */ as->curins--; /* Always skip the CONV. */ #if LJ_HASFFI && !LJ_SOFTFP if (usehi || uselo) asm_conv64(as, ir); return; #endif } else if ((ir-1)->o < IR_EQ) { /* 64 bit integer 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_comp64(as, ir); #endif return; } else if ((ir-1)->o <= IR_NE) { /* 64 bit integer 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_comp64eq(as, ir); #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); return; #endif } 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; } #endif if (!usehi) return; /* Skip unused hiword op for all remaining ops. */ switch ((ir-1)->o) { #if LJ_32 && LJ_HASFFI 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_CNEWI: /* Nothing to do here. Handled by lo op itself. */ break; #endif #if LJ_32 && 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; case IR_ASTORE: case IR_HSTORE: case IR_USTORE: case IR_TOSTR: case IR_TMPREF: /* Nothing to do here. Handled by lo op itself. */ break; #endif case IR_CALLN: case IR_CALLL: case IR_CALLS: case IR_CALLXS: if (!uselo) ra_allocref(as, ir->op1, RID2RSET(RID_RETLO)); /* Mark lo op as used. */ break; default: lj_assertA(0, "bad HIOP for op %d", (ir-1)->o); break; } } /* -- Profiling ----------------------------------------------------------- */ static void asm_prof(ASMState *as, IRIns *ir) { UNUSED(ir); asm_guard(as, MIPSI_BNE, RID_TMP, RID_ZERO); emit_tsi(as, MIPSI_ANDI, RID_TMP, RID_TMP, HOOK_PROFILE); emit_lsglptr(as, MIPSI_LBU, RID_TMP, (int32_t)offsetof(global_State, hookmask)); } /* -- 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); #if LJ_32 tmp = allow ? rset_pickbot(allow) : (pbase == RID_RETHI ? RID_RETLO : RID_RETHI); #else tmp = allow ? rset_pickbot(allow) : RID_RET; #endif 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_AL, 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_ASUBU, RID_TMP, tmp, pbase); emit_tsi(as, MIPSI_AL, tmp, tmp, offsetof(lua_State, maxstack)); if (pbase == RID_TMP) emit_getgl(as, RID_TMP, jit_base); emit_getgl(as, tmp, cur_L); if (allow == RSET_EMPTY) /* Spill temp. register. */ emit_tsi(as, MIPSI_AS, 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]; #if LJ_32 || defined(LUA_USE_ASSERT) SnapEntry *flinks = &as->T->snapmap[snap_nextofs(as->T, snap)-1-LJ_FR2]; #endif 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-LJ_FR2); IRRef ref = snap_ref(sn); IRIns *ir = IR(ref); if ((sn & SNAP_NORESTORE)) continue; if (irt_isnum(ir->t)) { #if LJ_SOFTFP32 Reg tmp; RegSet allow = rset_exclude(RSET_GPR, RID_BASE); /* LJ_SOFTFP: must be a number constant. */ lj_assertA(irref_isk(ref), "unsplit FP op"); tmp = ra_allock(as, (int32_t)ir_knum(ir)->u32.lo, allow); emit_tsi(as, MIPSI_SW, tmp, RID_BASE, ofs+(LJ_BE?4:0)); if (rset_test(as->freeset, tmp+1)) allow = RID2RSET(tmp+1); tmp = ra_allock(as, (int32_t)ir_knum(ir)->u32.hi, allow); emit_tsi(as, MIPSI_SW, tmp, RID_BASE, ofs+(LJ_BE?0:4)); #elif LJ_SOFTFP /* && LJ_64 */ Reg src = ra_alloc1(as, ref, rset_exclude(RSET_GPR, RID_BASE)); emit_tsi(as, MIPSI_SD, src, RID_BASE, ofs); #else Reg src = ra_alloc1(as, ref, RSET_FPR); emit_hsi(as, MIPSI_SDC1, src, RID_BASE, ofs); #endif } else { #if LJ_32 RegSet allow = rset_exclude(RSET_GPR, RID_BASE); Reg type; lj_assertA(irt_ispri(ir->t) || irt_isaddr(ir->t) || irt_isinteger(ir->t), "restore of IR type %d", irt_type(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); #if LJ_SOFTFP } else if ((sn & SNAP_SOFTFPNUM)) { type = ra_alloc1(as, ref+1, rset_exclude(RSET_GPR, RID_BASE)); #endif } else if ((sn & SNAP_KEYINDEX)) { type = ra_allock(as, (int32_t)LJ_KEYINDEX, 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)); #else if ((sn & SNAP_KEYINDEX)) { RegSet allow = rset_exclude(RSET_GPR, RID_BASE); int64_t kki = (int64_t)LJ_KEYINDEX << 32; if (irref_isk(ref)) { emit_tsi(as, MIPSI_SD, ra_allock(as, kki | (int64_t)(uint32_t)ir->i, allow), RID_BASE, ofs); } else { Reg src = ra_alloc1(as, ref, allow); Reg rki = ra_allock(as, kki, rset_exclude(allow, src)); emit_tsi(as, MIPSI_SD, RID_TMP, RID_BASE, ofs); emit_dst(as, MIPSI_DADDU, RID_TMP, src, rki); } } else { asm_tvstore64(as, RID_BASE, ofs, ref); } #endif } checkmclim(as); } lj_assertA(map + nent == flinks, "inconsistent frames in snapshot"); } /* -- GC handling --------------------------------------------------------- */ /* Marker to prevent patching the GC check exit. */ #define MIPS_NOPATCH_GC_CHECK MIPSI_OR /* 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); l_end[-3] = MIPS_NOPATCH_GC_CHECK; /* Replace the nop after the call. */ emit_tsi(as, MIPSI_AADDIU, 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); } } /* Fixup the tail of the loop. */ static void asm_loop_tail_fixup(ASMState *as) { if (as->loopinv) as->mctop--; } /* -- 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_move(as, r, RID_BASE); } } /* Coalesce BASE register for a side trace. */ static Reg asm_head_side_base(ASMState *as, IRIns *irp) { 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) { return r; /* Same BASE register already coalesced. */ } else if (ra_hasreg(irp->r) && rset_test(as->freeset, irp->r)) { emit_move(as, r, irp->r); /* Move from coalesced parent reg. */ return irp->r; } else { emit_getgl(as, r, jit_base); /* Otherwise reload BASE. */ } } return RID_NONE; } /* -- 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_AADDIU|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; } /* -- 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 = CCI_XNARGS(ci); #if LJ_32 int nslots = 4, ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR; #else int nslots = 0, ngpr = REGARG_NUMGPR; #endif asm_collectargs(as, ir, ci, args); for (i = 0; i < nargs; i++) { #if LJ_32 if (!LJ_SOFTFP && 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 (!LJ_SOFTFP && 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++; } #else if (ngpr > 0) ngpr--; else nslots += 2; #endif } 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. */ /* Look for exitstub branch. Yes, this covers all used branch variants. */ if (((p[-1] ^ (px-p)) & 0xffffu) == 0 && ((p[-1] & 0xf0000000u) == MIPSI_BEQ || (p[-1] & 0xfc1e0000u) == MIPSI_BLTZ || #if !LJ_TARGET_MIPSR6 (p[-1] & 0xffe00000u) == MIPSI_BC1F #else (p[-1] & 0xff600000u) == MIPSI_BC1EQZ #endif ) && p[-2] != MIPS_NOPATCH_GC_CHECK) { 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+1; if (!cstart) cstart = p-1; } else { /* Branch out of range. Use spare jump slot in mcarea. */ MCode *mcjump = asm_sparejump_use(mcarea, tjump); if (mcjump) { lj_mcode_sync(mcjump, mcjump+1); delta = mcjump - p; if (((delta + 0x8000) >> 16) == 0) { goto patchbranch; } else { lj_assertJ(0, "spare jump out of range: -Osizemcode too big"); } } /* 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. */ lj_assertJ(p[1] == MIPSI_NOP, "expected 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); } subprojects/luajit/src/lj_ccall.h0000644000175000017500000001157014741067622016417 0ustar aniolaniol/* ** FFI C call handling. ** Copyright (C) 2005-2023 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_ARM64 #define CCALL_NARG_GPR 8 #define CCALL_NRET_GPR 2 #define CCALL_NARG_FPR 8 #define CCALL_NRET_FPR 4 #define CCALL_SPS_FREE 0 #if LJ_TARGET_OSX #define CCALL_PACK_STACKARG 1 #endif typedef intptr_t GPRArg; typedef union FPRArg { double d; struct { LJ_ENDIAN_LOHI(float f; , float g;) }; struct { LJ_ENDIAN_LOHI(uint32_t lo; , uint32_t hi;) }; } FPRArg; #elif LJ_TARGET_PPC #define CCALL_NARG_GPR 8 #define CCALL_NARG_FPR (LJ_ABI_SOFTFP ? 0 : 8) #define CCALL_NRET_GPR 4 /* For complex double. */ #define CCALL_NRET_FPR (LJ_ABI_SOFTFP ? 0 : 1) #define CCALL_SPS_EXTRA 4 #define CCALL_SPS_FREE 0 typedef intptr_t GPRArg; typedef double FPRArg; #elif LJ_TARGET_MIPS32 #define CCALL_NARG_GPR 4 #define CCALL_NARG_FPR (LJ_ABI_SOFTFP ? 0 : 2) #define CCALL_NRET_GPR (LJ_ABI_SOFTFP ? 4 : 2) #define CCALL_NRET_FPR (LJ_ABI_SOFTFP ? 0 : 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; #elif LJ_TARGET_MIPS64 /* FP args are positional and overlay the GPR array. */ #define CCALL_NARG_GPR 8 #define CCALL_NARG_FPR 0 #define CCALL_NRET_GPR 2 #define CCALL_NRET_FPR (LJ_ABI_SOFTFP ? 0 : 2) #define CCALL_SPS_EXTRA 3 #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_PACK_STACKARG #define CCALL_PACK_STACKARG 0 #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_NUM_STACK 31 #define CCALL_SIZE_STACK (CCALL_NUM_STACK * CTSIZE_PTR) /* -- 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 bytes on stack. */ 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_ARM64 void *retp; /* Aggregate return pointer in x8. */ #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_NUM_STACK]; /* 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 subprojects/luajit/src/lj_target.h0000644000175000017500000001365414741067622016634 0ustar aniolaniol/* ** Definitions for target CPU. ** Copyright (C) 2005-2023 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 || LJ_TARGET_ARM64 typedef uint64_t RegSet; #define RSET_BITS 6 #define rset_picktop_(rs) ((Reg)lj_fls64(rs)) #define rset_pickbot_(rs) ((Reg)lj_ffs64(rs)) #else typedef uint32_t RegSet; #define RSET_BITS 5 #define rset_picktop_(rs) ((Reg)lj_fls(rs)) #define rset_pickbot_(rs) ((Reg)lj_ffs(rs)) #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)) /* -- 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_ARM64 #include "lj_target_arm64.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) { lj_assertX(group[exitno / EXITSTUBS_PER_GROUP] != NULL, "exit stub group for exit %d uninitialized", exitno); 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 subprojects/luajit/src/lj_str.h0000644000175000017500000000165414741067622016153 0ustar aniolaniol/* ** String handling. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #ifndef _LJ_STR_H #define _LJ_STR_H #include #include "lj_obj.h" /* String helpers. */ LJ_FUNC int32_t LJ_FASTCALL lj_str_cmp(GCstr *a, GCstr *b); LJ_FUNC const char *lj_str_find(const char *s, const char *f, MSize slen, MSize flen); LJ_FUNC int lj_str_haspattern(GCstr *s); /* String interning. */ 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); LJ_FUNC void LJ_FASTCALL lj_str_init(lua_State *L); #define lj_str_freetab(g) \ (lj_mem_freevec(g, g->str.tab, g->str.mask+1, GCRef)) #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)) #define lj_str_size(len) (sizeof(GCstr) + (((len)+4) & ~(MSize)3)) #endif subprojects/luajit/src/lj_ccall.c0000644000175000017500000010761214741067622016415 0ustar aniolaniol/* ** FFI C call handling. ** Copyright (C) 2005-2023 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_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 --------------------------------------------- */ #define CCALL_PUSH(arg) \ *(GPRArg *)((uint8_t *)cc->stack + nsp) = (GPRArg)(arg), nsp += CTSIZE_PTR #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) CCALL_PUSH(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 \ CCALL_PUSH(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 \ CCALL_PUSH(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 \ CCALL_PUSH(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) * CTSIZE_PTR; /* Assumes contiguous gpr/stack fields. */ \ if (nsp > CCALL_SIZE_STACK) 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_ARM64 /* -- ARM64 calling conventions ------------------------------------------- */ #define CCALL_HANDLE_STRUCTRET \ cc->retref = !ccall_classify_struct(cts, ctr); \ if (cc->retref) cc->retp = dp; #define CCALL_HANDLE_STRUCTRET2 \ unsigned int cl = ccall_classify_struct(cts, ctr); \ if ((cl & 4)) { /* Combine float HFA from separate registers. */ \ CTSize i = (cl >> 8) - 1; \ do { ((uint32_t *)dp)[i] = cc->fpr[i].lo; } while (i--); \ } else { \ if (cl > 1) sp = (uint8_t *)&cc->fpr[0]; \ memcpy(dp, sp, 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 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 \ unsigned int cl = ccall_classify_struct(cts, d); \ if (cl == 0) { /* Pass struct by reference. */ \ rp = cdataptr(lj_cdata_new(cts, did, sz)); \ sz = CTSIZE_PTR; \ } else if (cl > 1) { /* Pass struct in FPRs or on stack. */ \ isfp = (cl & 4) ? 2 : 1; \ } /* else: Pass struct in GPRs or on stack. */ #define CCALL_HANDLE_COMPLEXARG \ /* Pass complex by value in separate (!) FPRs or on stack. */ \ isfp = sz == 2*sizeof(float) ? 2 : 1; #define CCALL_HANDLE_REGARG \ if (LJ_TARGET_OSX && isva) { \ /* IOS: All variadic arguments are on the stack. */ \ } else if (isfp) { /* Try to pass argument in FPRs. */ \ int n2 = ctype_isvector(d->info) ? 1 : \ isfp == 1 ? n : (d->size >> (4-isfp)); \ if (nfpr + n2 <= CCALL_NARG_FPR) { \ dp = &cc->fpr[nfpr]; \ nfpr += n2; \ goto done; \ } else { \ nfpr = CCALL_NARG_FPR; /* Prevent reordering. */ \ } \ } else { /* Try to pass argument in GPRs. */ \ if (!LJ_TARGET_OSX && (d->info & CTF_ALIGN) > CTALIGN_PTR) \ ngpr = (ngpr + 1u) & ~1u; /* Align to regpair. */ \ if (ngpr + n <= maxgpr) { \ dp = &cc->gpr[ngpr]; \ ngpr += n; \ goto done; \ } else { \ ngpr = maxgpr; /* Prevent reordering. */ \ } \ } #if LJ_BE #define CCALL_HANDLE_RET \ if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \ sp = (uint8_t *)&cc->fpr[0].f; #endif #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_GPR \ /* Try to pass argument in GPRs. */ \ if (n > 1) { \ /* int64_t or complex (float). */ \ lj_assertL(n == 2 || n == 4, "bad GPR size %d", n); \ if (ctype_isinteger(d->info) || ctype_isfp(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; \ } \ #if LJ_ABI_SOFTFP #define CCALL_HANDLE_REGARG CCALL_HANDLE_GPR #else #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 { \ CCALL_HANDLE_GPR \ } #endif #if !LJ_ABI_SOFTFP #define CCALL_HANDLE_RET \ if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \ ctr = ctype_get(cts, CTID_DOUBLE); /* FPRs always hold doubles. */ #endif #elif LJ_TARGET_MIPS32 /* -- MIPS o32 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; #if LJ_ABI_SOFTFP #define CCALL_HANDLE_COMPLEXRET2 \ if (ctr->size == 2*sizeof(float)) { /* Copy complex float from GPRs. */ \ ((intptr_t *)dp)[0] = cc->gpr[0]; \ ((intptr_t *)dp)[1] = cc->gpr[1]; \ } else { /* Copy complex double from GPRs. */ \ ((intptr_t *)dp)[0] = cc->gpr[0]; \ ((intptr_t *)dp)[1] = cc->gpr[1]; \ ((intptr_t *)dp)[2] = cc->gpr[2]; \ ((intptr_t *)dp)[3] = cc->gpr[3]; \ } #else #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; \ } #endif #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_GPR \ 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) * CTSIZE_PTR; /* Assumes contiguous gpr/stack fields. */ \ if (nsp > CCALL_SIZE_STACK) goto err_nyi; /* Too many arguments. */ \ ngpr = maxgpr; \ } else { \ ngpr += n; \ } \ goto done; \ } #if !LJ_ABI_SOFTFP /* MIPS32 hard-float */ #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; \ CCALL_HANDLE_GPR \ } #else /* MIPS32 soft-float */ #define CCALL_HANDLE_REGARG CCALL_HANDLE_GPR #endif #if !LJ_ABI_SOFTFP /* On MIPS64 soft-float, position of float return values is endian-dependant. */ #define CCALL_HANDLE_RET \ if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \ sp = (uint8_t *)&cc->fpr[0].f; #endif #elif LJ_TARGET_MIPS64 /* -- MIPS n64 calling conventions ---------------------------------------- */ #define CCALL_HANDLE_STRUCTRET \ cc->retref = !(sz <= 16); \ if (cc->retref) cc->gpr[ngpr++] = (GPRArg)dp; #define CCALL_HANDLE_STRUCTRET2 \ ccall_copy_struct(cc, ctr, dp, sp, ccall_classify_struct(cts, ctr, ct)); #define CCALL_HANDLE_COMPLEXRET \ /* Complex values are returned in 1 or 2 FPRs. */ \ cc->retref = 0; #if LJ_ABI_SOFTFP /* MIPS64 soft-float */ #define CCALL_HANDLE_COMPLEXRET2 \ if (ctr->size == 2*sizeof(float)) { /* Copy complex float from GPRs. */ \ ((intptr_t *)dp)[0] = cc->gpr[0]; \ } else { /* Copy complex double from GPRs. */ \ ((intptr_t *)dp)[0] = cc->gpr[0]; \ ((intptr_t *)dp)[1] = cc->gpr[1]; \ } #define CCALL_HANDLE_COMPLEXARG \ /* Pass complex by value in 2 or 4 GPRs. */ /* Position of soft-float 'float' return value depends on endianess. */ #define CCALL_HANDLE_RET \ if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \ sp = (uint8_t *)cc->gpr + LJ_ENDIAN_SELECT(0, 4); #else /* MIPS64 hard-float */ #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_COMPLEXARG \ if (sz == 2*sizeof(float)) { \ isfp = 2; \ if (ngpr < maxgpr) \ sz *= 2; \ } #define CCALL_HANDLE_RET \ if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \ sp = (uint8_t *)&cc->fpr[0].f; #endif #define CCALL_HANDLE_STRUCTARG \ /* Pass all structs by value in registers and/or on the stack. */ #define CCALL_HANDLE_REGARG \ if (ngpr < maxgpr) { \ dp = &cc->gpr[ngpr]; \ if (ngpr + n > maxgpr) { \ nsp += (ngpr + n - maxgpr) * CTSIZE_PTR; /* Assumes contiguous gpr/stack fields. */ \ if (nsp > CCALL_SIZE_STACK) goto err_nyi; /* Too many arguments. */ \ ngpr = maxgpr; \ } else { \ ngpr += n; \ } \ goto done; \ } #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; lj_assertCTS(ctype_hassize(ct->info), "classify ctype %08x without size", 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, CTState *cts, GPRArg *dp, int *rcl) { MSize ngpr = cc->ngpr, nfpr = cc->nfpr; uint32_t i; UNUSED(cts); for (i = 0; i < 2; i++) { lj_assertCTS(!(rcl[i] & CCALL_RCL_MEM), "pass mem struct in reg"); 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, cts, dp, rcl)) { /* Register overflow? Pass on stack. */ MSize nsp = cc->nsp, sz = rcl[1] ? 2*CTSIZE_PTR : CTSIZE_PTR; if (nsp + sz > CCALL_SIZE_STACK) return 1; /* Too many arguments. */ cc->nsp = nsp + sz; memcpy((uint8_t *)cc->stack + nsp, dp, sz); } 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 /* -- ARM64 ABI struct classification ------------------------------------- */ #if LJ_TARGET_ARM64 /* Classify a struct based on its fields. */ static unsigned int ccall_classify_struct(CTState *cts, CType *ct) { CTSize sz = ct->size; unsigned int r = 0, n = 0, isu = (ct->info & CTF_UNION); 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); 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 <= 16); /* Return structs of size <= 16 in GPRs. */ } #endif /* -- MIPS64 ABI struct classification ---------------------------- */ #if LJ_TARGET_MIPS64 #define FTYPE_FLOAT 1 #define FTYPE_DOUBLE 2 /* Classify FP fields (max. 2) and their types. */ static unsigned int ccall_classify_struct(CTState *cts, CType *ct, CType *ctf) { int n = 0, ft = 0; if ((ctf->info & CTF_VARARG) || (ct->info & CTF_UNION)) goto noth; while (ct->sib) { CType *sct; ct = ctype_get(cts, ct->sib); if (n == 2) { goto noth; } else if (ctype_isfield(ct->info)) { sct = ctype_rawchild(cts, ct); if (ctype_isfp(sct->info)) { ft |= (sct->size == 4 ? FTYPE_FLOAT : FTYPE_DOUBLE) << 2*n; n++; } else { goto noth; } } else if (ctype_isbitfield(ct->info) || ctype_isxattrib(ct->info, CTA_SUBTYPE)) { goto noth; } } if (n <= 2) return ft; noth: /* Not a homogeneous float/double aggregate. */ return 0; /* Struct is in GPRs. */ } static void ccall_copy_struct(CCallState *cc, CType *ctr, void *dp, void *sp, int ft) { if (LJ_ABI_SOFTFP ? ft : ((ft & 3) == FTYPE_FLOAT || (ft >> 2) == FTYPE_FLOAT)) { int i, ofs = 0; for (i = 0; ft != 0; i++, ft >>= 2) { if ((ft & 3) == FTYPE_FLOAT) { #if LJ_ABI_SOFTFP /* The 2nd FP struct result is in CARG1 (gpr[2]) and not CRET2. */ memcpy((uint8_t *)dp + ofs, (uint8_t *)&cc->gpr[2*i] + LJ_ENDIAN_SELECT(0, 4), 4); #else *(float *)((uint8_t *)dp + ofs) = cc->fpr[i].f; #endif ofs += 4; } else { ofs = (ofs + 7) & ~7; /* 64 bit alignment. */ #if LJ_ABI_SOFTFP *(intptr_t *)((uint8_t *)dp + ofs) = cc->gpr[2*i]; #else *(double *)((uint8_t *)dp + ofs) = cc->fpr[i].d; #endif ofs += 8; } } } else { #if !LJ_ABI_SOFTFP if (ft) sp = (uint8_t *)&cc->fpr[0]; #endif memcpy(dp, sp, ctr->size); } } #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; } #if LJ_TARGET_ARM64 && LJ_ABI_WIN if ((ct->info & CTF_VARARG)) { nsp -= maxgpr * CTSIZE_PTR; /* May end up with negative nsp. */ ngpr = maxgpr; nfpr = CCALL_NARG_FPR; } #endif /* 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; lj_assertL(ctype_isfield(ctf->info), "field expected"); 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 if (!(CCALL_PACK_STACKARG && ctype_isenum(d->info))) { sz = CTSIZE_PTR; } n = (sz + CTSIZE_PTR-1) / CTSIZE_PTR; /* Number of GPRs or stack slots needed. */ CCALL_HANDLE_REGARG /* Handle register arguments. */ /* Otherwise pass argument on stack. */ if (CCALL_ALIGN_STACKARG) { /* Align argument on stack. */ MSize align = (1u << ctype_align(d->info)) - 1; if (rp || (CCALL_PACK_STACKARG && isva && align < CTSIZE_PTR-1)) align = CTSIZE_PTR-1; nsp = (nsp + align) & ~align; } #if LJ_TARGET_ARM64 && LJ_ABI_WIN /* A negative nsp points into cc->gpr. Blame MS for their messy ABI. */ dp = ((uint8_t *)cc->stack) + (int32_t)nsp; #else dp = ((uint8_t *)cc->stack) + nsp; #endif nsp += CCALL_PACK_STACKARG ? sz : n * CTSIZE_PTR; if ((int32_t)nsp > CCALL_SIZE_STACK) { /* Too many arguments. */ err_nyi: lj_err_caller(L, LJ_ERR_FFI_NYICALL); } 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 && (!CCALL_PACK_STACKARG || !((uintptr_t)dp & 3))) { /* Assumes LJ_LE. */ 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_ARM64 && LJ_BE if (isfp && d->size == sizeof(float)) ((float *)dp)[1] = ((float *)dp)[0]; /* Floats occupy high slot. */ #endif #if LJ_TARGET_MIPS64 || (LJ_TARGET_ARM64 && LJ_BE) if ((ctype_isinteger_or_bool(d->info) || ctype_isenum(d->info) #if LJ_TARGET_MIPS64 || (isfp && nsp == 0) #endif ) && d->size <= 4) { *(int64_t *)dp = (int64_t)*(int32_t *)dp; /* Sign-extend to 64 bit. */ } #endif #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; } #elif LJ_TARGET_ARM64 || (LJ_TARGET_MIPS64 && !LJ_ABI_SOFTFP) if (isfp == 2 && (uint8_t *)dp < (uint8_t *)cc->stack) { /* Split float HFA or complex float into separate registers. */ CTSize i = (sz >> 2) - 1; do { ((uint64_t *)dp)[i] = ((uint32_t *)dp)[i]; } while (i--); } #else UNUSED(isfp); #endif } if (fid) lj_err_caller(L, LJ_ERR_FFI_NUMARG); /* Too few arguments. */ #if LJ_TARGET_ARM64 && LJ_ABI_WIN if ((int32_t)nsp < 0) nsp = 0; #endif #if LJ_TARGET_X64 || (LJ_TARGET_PPC && !LJ_ABI_SOFTFP) cc->nfpr = nfpr; /* Required for vararg functions. */ #endif cc->nsp = (nsp + CTSIZE_PTR-1) & ~(CTSIZE_PTR-1); cc->spadj = (CCALL_SPS_FREE + CCALL_SPS_EXTRA) * CTSIZE_PTR; if (cc->nsp > CCALL_SPS_FREE * CTSIZE_PTR) cc->spadj += (((cc->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 && ctr->size < CTSIZE_PTR && (ctype_isinteger_or_bool(ctr->info) || ctype_isenum(ctr->info))) 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. */ lj_assertL(!(ctype_isrefarray(ctr->info) || ctype_isstruct(ctr->info)), "unexpected reference ctype"); 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; tv.u64 = ((uintptr_t)(void *)cc.func >> 2) | U64x(800000000, 00000000); 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 subprojects/luajit/src/lib_debug.c0000644000175000017500000002251414741067622016563 0ustar aniolaniol/* ** Debug library. ** Copyright (C) 2005-2023 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) LJLIB_REC(.) { 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); lua_pushlightuserdata(L, 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 /* ------------------------------------------------------------------------ */ #define KEY_HOOK (U64x(80000000,00000000)|'h') static void hookf(lua_State *L, lua_Debug *ar) { static const char *const hooknames[] = {"call", "return", "line", "count", "tail return"}; (L->top++)->u64 = 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); } (L->top++)->u64 = 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 { (L->top++)->u64 = 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)) { const char *s = lua_tostring(L, -1); fputs(s ? s : "(error object is not a string)", 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; } subprojects/luajit/src/vm_x86.dasc0000644000175000017500000046575214741067622016505 0ustar aniolaniol|// Low-level VM code for x86 CPUs. |// Bytecode interpreter, fast functions and helper functions. |// Copyright (C) 2005-2023 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 |.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 |.type SBUF, SBuf | |// Stack layout while in interpreter. Must match with lj_frame.h. |//----------------------------------------------------------------------- |.if not X64 // x86 stack layout. | |.if WIN | |.define CFRAME_SPACE, aword*9 // Delta for esp (see <--). |.macro saveregs_ | push edi; push esi; push ebx | push extern lj_err_unwind_win | fs; push dword [0] | fs; mov [0], esp | sub esp, CFRAME_SPACE |.endmacro |.macro restoreregs | add esp, CFRAME_SPACE | fs; pop dword [0] | pop edi // Short for esp += 4. | pop ebx; pop esi; pop edi; pop ebp |.endmacro | |.else | |.define CFRAME_SPACE, aword*7 // Delta for esp (see <--). |.macro saveregs_ | push edi; push esi; push ebx | sub esp, CFRAME_SPACE |.endmacro |.macro restoreregs | add esp, CFRAME_SPACE | pop ebx; pop esi; pop edi; pop ebp |.endmacro | |.endif | |.macro saveregs | push ebp; saveregs_ |.endmacro | |.if WIN |.define SAVE_ERRF, aword [esp+aword*19] // vm_pcall/vm_cpcall only. |.define SAVE_NRES, aword [esp+aword*18] |.define SAVE_CFRAME, aword [esp+aword*17] |.define SAVE_L, aword [esp+aword*16] |//----- 16 byte aligned, ^^^ arguments from C caller |.define SAVE_RET, aword [esp+aword*15] //<-- esp entering interpreter. |.define SAVE_R4, aword [esp+aword*14] |.define SAVE_R3, aword [esp+aword*13] |.define SAVE_R2, aword [esp+aword*12] |//----- 16 byte aligned |.define SAVE_R1, aword [esp+aword*11] |.define SEH_FUNC, aword [esp+aword*10] |.define SEH_NEXT, aword [esp+aword*9] //<-- esp after register saves. |.define UNUSED2, aword [esp+aword*8] |//----- 16 byte aligned |.define UNUSED1, aword [esp+aword*7] |.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 |.else |.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 |.endif | |// 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 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_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 |.if WIN | lea FCARG1, SEH_NEXT | fs; mov [0], FCARG1 |.endif |.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 |.if WIN | lea FCARG1, SEH_NEXT | fs; mov [0], FCARG1 |.endif |.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. | |.if WIN and not X64 |->vm_rtlunwind@16: // Thin layer around RtlUnwind. | // (void *cframe, void *excptrec, void *unwinder, int errcode) | mov [esp], FCARG1 // Return value for RtlUnwind. | push FCARG2 // Exception record for RtlUnwind. | push 0 // Ignored by RtlUnwind. | push dword [FCARG1+CFRAME_OFS_SEH] | call extern RtlUnwind@16 // Violates ABI (clobbers too much). | mov FCARG1, eax | mov FCARG2, [esp+4] // errcode (for vm_unwind_c). | ret // Jump to unwinder. |.endif | |//----------------------------------------------------------------------- |//-- 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 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 | mov L:RB->cframe, KBASEa | cmp byte L:RB->status, RDL | je >2 // Initial resume (like a call). | | // Resume after yield (like a return). | mov [DISPATCH+DISPATCH_GL(cur_L)], L:RB | 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 DISPATCH, L:RB->glref // Setup pointer to dispatch table. | 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. | add DISPATCH, GG_G2DISP |.if X64 | mov L:RB->cframe, rsp |.else | mov L:RB->cframe, esp |.endif | |2: // Entry point for vm_resume/vm_cpcall (RA = base, RB = L, PC = ftype). | mov [DISPATCH+DISPATCH_GL(cur_L)], L:RB | 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 DISPATCH, L:RB->glref // Setup pointer to dispatch table. | mov SAVE_ERRF, 0 // No error function. | mov SAVE_NRES, KBASE // Neg. delta means cframe w/o frame. | add DISPATCH, GG_G2DISP | // 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 | mov [DISPATCH+DISPATCH_GL(cur_L)], L:RB | | 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 | mov [DISPATCH+DISPATCH_GL(cur_L)], L:RB | | 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 |.else | cvtsi2sd xmm0, RC | movsd TMPQ, xmm0 |.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_tgetr: | mov FCARG1, TAB:RB | mov RB, BASE // Save BASE. | mov FCARG2, RC // Caveat: FCARG2 == BASE | call extern lj_tab_getinth@8 // (GCtab *t, int32_t key) | // cTValue * or NULL returned in eax (RC). | movzx RA, PC_RA | mov BASE, RB // Restore BASE. | test RC, RC | jnz ->BC_TGETR_Z | mov dword [BASE+RA*8+4], LJ_TNIL | jmp ->BC_TGETR2_Z | |//----------------------------------------------------------------------- | |->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 |.else | cvtsi2sd xmm0, RC | movsd TMPQ, xmm0 |.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 | |->vmeta_tsetr: |.if X64WIN | mov L:CARG1d, SAVE_L | mov CARG3d, RC | mov L:CARG1d->base, BASE | xchg CARG2d, TAB:RB // Caveat: CARG2d == BASE. |.elif X64 | mov L:CARG1d, SAVE_L | mov CARG2d, TAB:RB | mov L:CARG1d->base, BASE | mov RB, BASE // Save BASE. | mov CARG3d, RC // Caveat: CARG3d == BASE. |.else | mov L:RA, SAVE_L | mov ARG2, TAB:RB | mov RB, BASE // Save BASE. | mov ARG3, RC | mov ARG1, L:RA | mov L:RA->base, BASE |.endif | mov SAVE_PC, PC | call extern lj_tab_setinth // (lua_State *L, GCtab *t, int32_t key) | // TValue * returned in eax (RC). | movzx RA, PC_RA | mov BASE, RB // Restore BASE. | jmp ->BC_TSETR_Z | |//-- 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 | |->vmeta_istype: |.if X64 | mov L:RB, SAVE_L | mov L:RB->base, BASE // Caveat: CARG2d/CARG3d may be BASE. | mov CARG2d, RA | movzx CARG3d, PC_RD | mov L:CARG1d, L:RB |.else | movzx RD, PC_RD | mov ARG2, RA | mov L:RB, SAVE_L | mov ARG3, RD | mov ARG1, L:RB | mov L:RB->base, BASE |.endif | mov SAVE_PC, PC | call extern lj_meta_istype // (lua_State *L, BCReg ra, BCReg tp) | mov BASE, L:RB->base | jmp <6 | |//-- 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. |.if X64 | cmp KBASEa, rdx // Continue with CALLT if flag set. |.else | cmp KBASE, BASE // Continue with CALLT if flag set. |.endif | 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_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_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->sid | 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 | movsd xmm0, qword [BASE]; jmp ->fff_resxmm0 | |.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_strfmt_number@8 // (lua_State *L, cTValue *o) |.else | call extern lj_strfmt_num@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 PC, [BASE-4] | mov RB, BASE // Save BASE. |.if X64WIN | mov CARG1d, [BASE] | lea CARG3d, [BASE-8] | lea CARG2d, [BASE+8] // Caveat: CARG2d == BASE. |.elif X64 | mov CARG1d, [BASE] | lea CARG2d, [BASE+8] | lea CARG3d, [BASE-8] // Caveat: CARG3d == BASE. |.else | mov TAB:RD, [BASE] | mov ARG1, TAB:RD | add BASE, 8 | mov ARG2, BASE | sub BASE, 8+8 | mov ARG3, BASE |.endif | call extern lj_tab_next // (GCtab *t, cTValue *key, TValue *o) | // 1=found, 0=end, -1=error returned in eax (RD). | mov BASE, RB // Restore BASE. | test RD, RD; jg ->fff_res2 // Found key/value. | js ->fff_fallback_2 // Invalid key. | // End of traversal: return nil. | mov dword [BASE-4], LJ_TNIL | jmp ->fff_res1 |2: // Set missing 2nd arg to nil. | mov dword [BASE+12], LJ_TNIL | jmp <1 | |.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 |.else | movsd xmm0, qword [BASE+8] | sseconst_1 xmm1, RBa | addsd xmm0, xmm1 | cvttsd2si RD, xmm0 | movsd qword [BASE-8], xmm0 |.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 |->fff_res2: | mov RD, 1+2 | jmp ->fff_res |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 |.else | xorps xmm0, xmm0 | movsd qword [BASE+8], xmm0 |.endif | mov RD, 1+3 | jmp ->fff_res | |//-- Base library: catch errors ---------------------------------------- | |.ffunc_1 pcall | mov L:RB, SAVE_L | lea RA, [BASE+NARGS:RD*8] | cmp RA, L:RB->maxstack; ja ->fff_fallback | 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 | mov L:RB, SAVE_L | lea RA, [BASE+NARGS:RD*8] | cmp RA, L:RB->maxstack; ja ->fff_fallback | 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) | | 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 | mov [DISPATCH+DISPATCH_GL(cur_L)], L:RB | set_vmstate INTERP | | 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 | |->fff_resn: | mov PC, [BASE-4] | fstp qword [BASE-8] | jmp ->fff_res1 | | .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 | movsd xmm0, qword [BASE] | sseconst_abs xmm1, RDa | andps xmm0, xmm1 |->fff_resxmm0: | mov PC, [BASE-4] | movsd qword [BASE-8], xmm0 | // fallthrough | |->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 | |.if X64 |.define fff_resfp, fff_resxmm0 |.else |.define fff_resfp, fff_resn |.endif | |.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 | movsd xmm0, qword [BASE] | call ->vm_ .. func .. _sse |.if DUALNUM | cvttsd2si RB, xmm0 | cmp RB, 0x80000000 | jne ->fff_resi | cvtsi2sd xmm1, RB | ucomisd xmm0, xmm1 | jp ->fff_resxmm0 | je ->fff_resi |.endif | jmp ->fff_resxmm0 |.endmacro | | math_round floor | math_round ceil | |.ffunc_nsse math_sqrt, sqrtsd; jmp ->fff_resxmm0 | |.ffunc math_log | cmp NARGS:RD, 1+1; jne ->fff_fallback // Exactly one argument. | cmp dword [BASE+4], LJ_TISNUM; jae ->fff_fallback | movsd xmm0, qword [BASE] |.if not X64 | movsd FPARG1, xmm0 |.endif | mov RB, BASE | call extern log | mov BASE, RB | jmp ->fff_resfp | |.macro math_extern, func | .ffunc_nsse math_ .. func |.if not X64 | movsd FPARG1, xmm0 |.endif | mov RB, BASE | call extern func | mov BASE, RB | jmp ->fff_resfp |.endmacro | |.macro math_extern2, func | .ffunc_nnsse math_ .. func |.if not X64 | movsd FPARG1, xmm0 | movsd FPARG3, xmm1 |.endif | mov RB, BASE | call extern func | mov BASE, RB | jmp ->fff_resfp |.endmacro | | 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_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. | cvtsi2sd xmm0, RB | 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: | movsd qword [BASE], xmm0 | mov RD, 1+2 | jmp ->fff_res |3: // Return +-0, +-Inf, NaN unmodified and an exponent of 0. | xorps xmm0, xmm0; jmp <2 |4: // Handle denormals by multiplying with 2^54 and adjusting the bias. | movsd xmm0, qword [BASE] | sseconst_hi xmm1, RBa, 43500000 // 2^54. | mulsd xmm0, xmm1 | movsd qword [BASE-8], xmm0 | mov RB, [BASE-4]; mov RC, 1076; shl RB, 1; jmp <1 | |.ffunc_nsse math_modf | mov RB, [BASE+4] | mov PC, [BASE-4] | shl RB, 1; cmp RB, 0xffe00000; je >4 // +-Inf? | movaps xmm4, xmm0 | call ->vm_trunc_sse | subsd xmm4, xmm0 |1: | movsd qword [BASE-8], xmm0 | movsd qword [BASE], xmm4 | 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: | xorps xmm4, xmm4; jmp <1 // Return +-Inf and +-0. | |.macro math_minmax, name, cmovop, sseop | .ffunc_1 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. | cvtsi2sd xmm0, RB | jmp >6 |4: | ja ->fff_fallback |.else | jae ->fff_fallback |.endif | | 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 |.endmacro | | math_minmax math_min, cmovg, minsd | math_minmax math_max, cmovl, maxsd | |//-- String library ----------------------------------------------------- | |.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 |.else | cvtsi2sd xmm0, RB; jmp ->fff_resxmm0 |.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 |.else | jae ->fff_fallback | cvttsd2si RB, qword [BASE] | cmp RB, 255; ja ->fff_fallback | mov TMP2, RB |.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) |->fff_resstr: | // 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 |.else | jae ->fff_fallback | cvttsd2si RB, qword [BASE+16] | mov TMP2, RB |.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] |.else | cvttsd2si RA, qword [BASE+8] |.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 | |.macro ffstring_op, name | .ffunc_1 string_ .. name | ffgccheck | cmp dword [BASE+4], LJ_TSTR; jne ->fff_fallback | mov L:RB, SAVE_L | lea SBUF:FCARG1, [DISPATCH+DISPATCH_GL(tmpbuf)] | mov L:RB->base, BASE | mov STR:FCARG2, [BASE] // Caveat: FCARG2 == BASE | mov RCa, SBUF:FCARG1->b | mov SBUF:FCARG1->L, L:RB | mov SBUF:FCARG1->w, RCa | mov SAVE_PC, PC | call extern lj_buf_putstr_ .. name .. @8 | mov FCARG1, eax | call extern lj_buf_tostr@4 | jmp ->fff_resstr |.endmacro | |ffstring_op reverse |ffstring_op lower |ffstring_op upper | |//-- Bit library -------------------------------------------------------- | |.macro .ffunc_bit, name, kind, fdef | fdef name |.if kind == 2 | sseconst_tobit xmm1, RBa |.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 | movsd xmm0, qword [BASE] |.if kind < 2 | sseconst_tobit xmm1, RBa |.endif | addsd xmm0, xmm1 | movd RB, xmm0 |2: |.endmacro | |.macro .ffunc_bit, name, kind | .ffunc_bit name, kind, .ffunc_1 |.endmacro | |.ffunc_bit bit_tobit, 0 | jmp ->fff_resbit | |.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 | movsd xmm0, qword [RD] | addsd xmm0, xmm1 | movd RA, xmm0 | ins RB, RA | 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 |.else |->fff_resbit: | cvtsi2sd xmm0, RB | jmp ->fff_resxmm0 |.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] |.else | .ffunc_nnsse name | sseconst_tobit xmm2, RBa | addsd xmm0, xmm2 | addsd xmm1, xmm2 | movd RB, xmm0 | movd RA, xmm1 |.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, const 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 | |->cont_stitch: // Trace stitching. |.if JIT | // BASE = base, RC = result, RB = mbase | mov TRACE:RA, [RB-24] // Save previous trace. | mov TMP1, TRACE:RA | mov TMP3, DISPATCH // Need one more register. | mov DISPATCH, MULTRES | movzx RA, PC_RA | lea RA, [BASE+RA*8] // Call base. | sub DISPATCH, 1 | jz >2 |1: // Move results down. |.if X64 | mov RBa, [RC] | mov [RA], RBa |.else | mov RB, [RC] | mov [RA], RB | mov RB, [RC+4] | mov [RA+4], RB |.endif | add RC, 8 | add RA, 8 | sub DISPATCH, 1 | jnz <1 |2: | movzx RC, PC_RA | movzx RB, PC_RB | add RC, RB | lea RC, [BASE+RC*8-8] |3: | cmp RC, RA | ja >9 // More results wanted? | | mov DISPATCH, TMP3 | mov TRACE:RD, TMP1 // Get previous trace. | movzx RB, word TRACE:RD->traceno | movzx RD, word TRACE:RD->link | cmp RD, RB | je ->cont_nop // Blacklisted. | test RD, RD | jne =>BC_JLOOP // Jump to stitched trace. | | // Stitch a new trace to the previous trace. | mov [DISPATCH+DISPATCH_J(exitno)], RB | mov L:RB, SAVE_L | mov L:RB->base, BASE | mov FCARG2, PC | lea FCARG1, [DISPATCH+GG_DISP2J] | mov aword [DISPATCH+DISPATCH_J(L)], L:RBa | call extern lj_dispatch_stitch@8 // (jit_State *J, const BCIns *pc) | mov BASE, L:RB->base | jmp ->cont_nop | |9: // Fill up results with nil. | mov dword [RA+4], LJ_TNIL | add RA, 8 | jmp <3 |.endif | |->vm_profhook: // Dispatch target for profiler hook. #if LJ_HASPROFILE | mov L:RB, SAVE_L | mov L:RB->base, BASE | mov FCARG2, PC // Caveat: FCARG2 == BASE | mov FCARG1, L:RB | call extern lj_dispatch_profile@8 // (lua_State *L, const BCIns *pc) | mov BASE, L:RB->base | // HOOK_PROFILE is off again, so re-dispatch to dynamic instruction. | sub PC, 4 | jmp ->cont_nop #endif | |//----------------------------------------------------------------------- |//-- 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(cur_L)] | mov BASE, [DISPATCH+DISPATCH_GL(jit_base)] | mov aword [DISPATCH+DISPATCH_J(L)], L:RBa | 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] | mov dword [DISPATCH+DISPATCH_GL(jit_base)], 0 | 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 | cmp RD, -LUA_ERRERR; jae >9 // Check for error from exit. | mov L:RB, SAVE_L | mov MULTRES, RD | mov LFUNC:KBASE, [BASE-8] | mov KBASE, LFUNC:KBASE->pc | mov KBASE, [KBASE+PC2PROTO(k)] | mov L:RB->base, BASE | mov dword [DISPATCH+DISPATCH_GL(jit_base)], 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 MULTRES, -17 // Static dispatch? | je >5 | cmp OP, BC_FUNCF // Function header? | jb >3 | cmp OP, BC_FUNCC+2 // Fast function? | jae >4 |2: | mov RC, MULTRES // RC/RD holds nres+1. |3: |.if X64 | jmp aword [DISPATCH+OP*8] |.else | jmp aword [DISPATCH+OP*4] |.endif | |4: // Check frame below fast function. | mov RC, [BASE-4] | test RC, FRAME_TYPE | jnz <2 // Trace stitching continuation? | // Otherwise set KBASE for Lua function below fast function. | movzx RC, byte [RC-3] | not RCa | mov LFUNC:KBASE, [BASE+RC*8-8] | mov KBASE, LFUNC:KBASE->pc | mov KBASE, [KBASE+PC2PROTO(k)] | jmp <2 | |5: // Dispatch to static entry of original ins replaced by BC_JLOOP. | mov RA, [DISPATCH+DISPATCH_J(trace)] | mov TRACE:RA, [RA+RD*4] | mov RC, TRACE:RA->startins | movzx RA, RCH | movzx OP, RCL | shr RC, 16 |.if X64 | jmp aword [DISPATCH+OP*8+GG_DISP2STATIC] |.else | jmp aword [DISPATCH+OP*4+GG_DISP2STATIC] |.endif | |9: // Rethrow error from the right C frame. | mov FCARG2, RD | mov FCARG1, L:RB | neg FCARG2 | call extern lj_err_trace@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. arg/ret is xmm0. xmm0-xmm3 and RD (eax) modified. |.macro vm_round, name, mode, cond |->name: |.if not X64 and cond | movsd xmm0, qword [esp+4] | call ->name .. _sse | movsd qword [esp+4], xmm0 // Overwrite callee-owned arg. | fld qword [esp+4] | ret |.endif | |->name .. _sse: | 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. | sseconst_1 xmm3, RDa | .if mode == 1 // ceil(x)? | cmpsd xmm0, xmm1, 6 // x > result? | andpd xmm0, xmm3 | addsd xmm1, xmm0 // If yes, add 1. | orpd xmm1, xmm2 // Merge sign bit back in (again). | .else // floor(x)? | cmpsd xmm0, xmm1, 1 // x < result? | andpd xmm0, xmm3 | subsd xmm1, xmm0 // If yes, subtract 1. | .endif |.endif | movaps xmm0, xmm1 |1: | ret |.endmacro | | vm_round vm_floor, 0, 1 | vm_round vm_ceil, 1, JIT | vm_round vm_trunc, 2, JIT | |// FP modulo x%y. Called by BC_MOD* and vm_arith. |->vm_mod: |// 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 | |//----------------------------------------------------------------------- |//-- 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 | xor ecx, ecx | 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 | xor ecx, ecx | 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 | |.define NEXT_TAB, TAB:FCARG1 |.define NEXT_IDX, FCARG2 |.define NEXT_PTR, RCa |.define NEXT_PTRd, RC |.macro NEXT_RES_IDXL, op2; lea edx, [NEXT_IDX+op2]; .endmacro |.if X64 |.define NEXT_TMP, CARG3d |.define NEXT_TMPq, CARG3 |.define NEXT_ASIZE, CARG4d |.macro NEXT_ENTER; .endmacro |.macro NEXT_LEAVE; ret; .endmacro |.if X64WIN |.define NEXT_RES_PTR, [rsp+aword*5] |.macro NEXT_RES_IDX, op2; add NEXT_IDX, op2; .endmacro |.else |.define NEXT_RES_PTR, [rsp+aword*1] |.macro NEXT_RES_IDX, op2; lea edx, [NEXT_IDX+op2]; .endmacro |.endif |.else |.define NEXT_ASIZE, esi |.define NEXT_TMP, edi |.macro NEXT_ENTER; push esi; push edi; .endmacro |.macro NEXT_LEAVE; pop edi; pop esi; ret; .endmacro |.define NEXT_RES_PTR, [esp+dword*3] |.macro NEXT_RES_IDX, op2; add NEXT_IDX, op2; .endmacro |.endif | |// TValue *lj_vm_next(GCtab *t, uint32_t idx) |// Next idx returned in edx. |->vm_next: |.if JIT | NEXT_ENTER | mov NEXT_ASIZE, NEXT_TAB->asize |1: // Traverse array part. | cmp NEXT_IDX, NEXT_ASIZE; jae >5 | mov NEXT_TMP, NEXT_TAB->array | cmp dword [NEXT_TMP+NEXT_IDX*8+4], LJ_TNIL; je >2 | lea NEXT_PTR, NEXT_RES_PTR |.if X64 | mov NEXT_TMPq, qword [NEXT_TMP+NEXT_IDX*8] | mov qword [NEXT_PTR], NEXT_TMPq |.else | mov NEXT_ASIZE, dword [NEXT_TMP+NEXT_IDX*8+4] | mov NEXT_TMP, dword [NEXT_TMP+NEXT_IDX*8] | mov dword [NEXT_PTR+4], NEXT_ASIZE | mov dword [NEXT_PTR], NEXT_TMP |.endif |.if DUALNUM | mov dword [NEXT_PTR+dword*3], LJ_TISNUM | mov dword [NEXT_PTR+dword*2], NEXT_IDX |.else | cvtsi2sd xmm0, NEXT_IDX | movsd qword [NEXT_PTR+dword*2], xmm0 |.endif | NEXT_RES_IDX 1 | NEXT_LEAVE |2: // Skip holes in array part. | add NEXT_IDX, 1 | jmp <1 | |5: // Traverse hash part. | sub NEXT_IDX, NEXT_ASIZE |6: | cmp NEXT_IDX, NEXT_TAB->hmask; ja >9 | imul NEXT_PTRd, NEXT_IDX, #NODE | add NODE:NEXT_PTRd, dword NEXT_TAB->node | cmp dword NODE:NEXT_PTR->val.it, LJ_TNIL; je >7 | NEXT_RES_IDXL NEXT_ASIZE+1 | NEXT_LEAVE |7: // Skip holes in hash part. | add NEXT_IDX, 1 | jmp <6 | |9: // End of iteration. Set the key to nil (not the value). | NEXT_RES_IDX NEXT_ASIZE | lea NEXT_PTR, NEXT_RES_PTR | mov dword [NEXT_PTR+dword*3], LJ_TNIL | NEXT_LEAVE |.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 |.if X64 | sub ecx, 8 | js >2 |1: | mov rax, [CCSTATE+rcx+offsetof(CCallState, stack)] | mov [rsp+rcx+CCALL_SPS_EXTRA*8], rax | sub ecx, 8 | jns <1 |2: |.else | sub ecx, 4 | js >2 |1: | mov eax, [CCSTATE+ecx+offsetof(CCallState, stack)] | mov [esp+ecx], eax | sub ecx, 4 | jns <1 |2: |.endif | |.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. | cvtsi2sd xmm0, dword [BASE+RD*8] | jmp >2 | |8: // RA is an integer, RD is not an integer. | ja ->vmeta_comp | // RA is an integer, RD is a number. | 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 | checknum RA, ->vmeta_comp | checknum RD, ->vmeta_comp |.endif |1: | movsd xmm0, qword [BASE+RD*8] |2: | add PC, 4 | ucomisd xmm0, qword [BASE+RA*8] |3: | // 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. | cvtsi2sd xmm0, dword [BASE+RA*8] | jmp >2 | |8: // RD is an integer, RA is not an integer. | ja >5 | // RD is an integer, RA is a number. | cvtsi2sd xmm0, dword [BASE+RD*8] | ucomisd xmm0, qword [BASE+RA*8] | jmp >4 | |.else | cmp RB, LJ_TISNUM; jae >5 | checknum RA, >5 |.endif |1: | movsd xmm0, qword [BASE+RA*8] |2: | ucomisd xmm0, qword [BASE+RD*8] |4: 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. | cvtsi2sd xmm0, dword [KBASE+RD*8] | jmp >2 | |8: // RA is an integer, RD is a number. | cvtsi2sd xmm0, dword [BASE+RA*8] | ucomisd xmm0, qword [KBASE+RD*8] | jmp >4 |.else | cmp RB, LJ_TISNUM; jae >3 |.endif |1: | movsd xmm0, qword [KBASE+RD*8] |2: | ucomisd xmm0, qword [BASE+RA*8] |4: 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; case BC_ISTYPE: | ins_AD // RA = src, RD = -type | add RD, [BASE+RA*8+4] | jne ->vmeta_istype | ins_next break; case BC_ISNUM: | ins_AD // RA = src, RD = -(TISNUM-1) | checknum RA, ->vmeta_istype | 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 | movsd xmm0, qword [BASE+RD*8] | sseconst_sign xmm1, RDa | xorps xmm0, xmm1 | movsd qword [BASE+RA*8], xmm0 |.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 |.else | xorps xmm0, xmm0 | cvtsi2sd xmm0, dword STR:RD->len |1: | movsd qword [BASE+RA*8], xmm0 |.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. |.else | cvtsi2sd xmm0, RD |.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, 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 | movsd xmm0, qword [BASE+RB*8] | sseins ssereg, qword [KBASE+RC*8] || break; ||case 1: | checknum RB, ->vmeta_arith_nv | .if DUALNUM | cmp dword [KBASE+RC*8+4], LJ_TISNUM; jae ->vmeta_arith_nv | .endif | movsd xmm0, qword [KBASE+RC*8] | sseins ssereg, qword [BASE+RB*8] || break; ||default: | checknum RB, ->vmeta_arith_vv | checknum RC, ->vmeta_arith_vv | movsd xmm0, qword [BASE+RB*8] | sseins ssereg, qword [BASE+RC*8] || 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 | movsd qword [BASE+RA*8], xmm0 |.endmacro | |.macro ins_arith, sseins | ins_arithpre sseins, xmm0 | ins_arithpost | ins_next |.endmacro | |.macro ins_arith, intins, sseins |.if DUALNUM | ins_arithdn intins |.else | ins_arith, 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, addsd break; case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: | ins_arith sub, subsd break; case BC_MULVN: case BC_MULNV: case BC_MULVV: | ins_arith imul, mulsd break; case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: | ins_arith divsd break; case BC_MODVN: | ins_arithpre movsd, xmm1 |->BC_MODVN_Z: | call ->vm_mod | ins_arithpost | ins_next break; case BC_MODNV: case BC_MODVV: | ins_arithpre movsd, xmm1 | jmp ->BC_MODVN_Z // Avoid 3 copies. It's slow anyway. break; case BC_POW: | ins_arithpre movsd, xmm1 | mov RB, BASE |.if not X64 | movsd FPARG1, xmm0 | movsd FPARG3, xmm1 |.endif | call extern pow | movzx RA, PC_RA | mov BASE, RB |.if X64 | ins_arithpost |.else | fstp qword [BASE+RA*8] |.endif | 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 |.else | movsx RD, RDW // Sign-extend literal. | cvtsi2sd xmm0, RD | movsd qword [BASE+RA*8], xmm0 |.endif | ins_next break; case BC_KNUM: | ins_AD // RA = dst, RD = num const | movsd xmm0, qword [KBASE+RD*8] | movsd qword [BASE+RA*8], xmm0 | 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] | movsd xmm0, qword [KBASE+RD*8] | mov UPVAL:RB, [LFUNC:RB+RA*4+offsetof(GCfuncL, uvptr)] | mov RA, UPVAL:RB->v | movsd qword [RA], xmm0 | 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 | movsd xmm0, qword [BASE+RC*8] | cvttsd2si RC, xmm0 | cvtsi2sd xmm1, RC | ucomisd xmm0, xmm1 | 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->sid | 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_TGETR: | ins_ABC // RA = dst, RB = table, RC = key | mov TAB:RB, [BASE+RB*8] |.if DUALNUM | mov RC, dword [BASE+RC*8] |.else | cvttsd2si RC, qword [BASE+RC*8] |.endif | cmp RC, TAB:RB->asize | jae ->vmeta_tgetr // Not in array part? Use fallback. | shl RC, 3 | add RC, TAB:RB->array | // Get array slot. |->BC_TGETR_Z: |.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 |->BC_TGETR2_Z: | ins_next 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 | movsd xmm0, qword [BASE+RC*8] | cvttsd2si RC, xmm0 | cvtsi2sd xmm1, RC | ucomisd xmm0, xmm1 | 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->sid | 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_TSETR: | ins_ABC // RA = src, RB = table, RC = key | mov TAB:RB, [BASE+RB*8] |.if DUALNUM | mov RC, dword [BASE+RC*8] |.else | cvttsd2si RC, qword [BASE+RC*8] |.endif | test byte TAB:RB->marked, LJ_GC_BLACK // isblack(table) | jnz >7 |2: | cmp RC, TAB:RB->asize | jae ->vmeta_tsetr | shl RC, 3 | add RC, TAB:RB->array | // Set array slot. |->BC_TSETR_Z: |.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 | |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: |.if JIT | hotloop RB |.endif |->vm_IITERN: | ins_A // RA = base, (RB = nresults+1, RC = nargs+1 (2+1)) | 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 |.else | cvtsi2sd xmm0, RC |.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. |.else | movsd qword [BASE+RA*8], xmm0 |.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 | 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], LJ_KEYINDEX |1: | ins_next |5: // Despecialize bytecode if any of the checks fail. | mov PC_OP, BC_JMP | branchPC RD |.if JIT | cmp byte [PC], BC_ITERN | jne >6 |.endif | mov byte [PC], BC_ITERC | jmp <1 |.if JIT |6: // Unpatch JLOOP. | mov RA, [DISPATCH+DISPATCH_J(trace)] | movzx RC, word [PC+2] | mov TRACE:RA, [RA+RC*4] | mov eax, TRACE:RA->startins | mov al, BC_ITERC | mov dword [PC], eax | jmp <1 |.endif 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 } | 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 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 | |3: // Invert comparison if step is negative. | ucomisd xmm0, xmm1 | jmp <1 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(tmpbuf.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)] } | // nresults returned in eax (RD). | mov BASE, L:RB->base | mov [DISPATCH+DISPATCH_GL(cur_L)], L:RB | set_vmstate INTERP | 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 LJ_TARGET_SOLARIS #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.non_lazy_symbol_pointer\n" "L_lj_err_unwind_dwarf$non_lazy_ptr:\n" ".indirect_symbol _lj_err_unwind_dwarf\n" ".long 0\n\n"); fprintf(ctx->fp, "\t.section __IMPORT,__jump_table,symbol_stubs,pure_instructions+self_modifying_code,5\n"); { const char *const *xn; for (xn = ctx->extnames; *xn; xn++) if (strncmp(*xn, LABEL_PREFIX, sizeof(LABEL_PREFIX)-1)) fprintf(ctx->fp, "L_%s$stub:\n\t.indirect_symbol _%s\n\t.ascii \"\\364\\364\\364\\364\\364\"\n", *xn, *xn); } #endif } break; #endif default: /* Difficult for other modes. */ break; } } subprojects/luajit/src/lj_strfmt.c0000644000175000017500000004034214741067622016652 0ustar aniolaniol/* ** String formatting. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #include #define lj_strfmt_c #define LUA_CORE #include "lj_obj.h" #include "lj_err.h" #include "lj_buf.h" #include "lj_str.h" #include "lj_meta.h" #include "lj_state.h" #include "lj_char.h" #include "lj_strfmt.h" #if LJ_HASFFI #include "lj_ctype.h" #endif #include "lj_lib.h" /* -- Format parser ------------------------------------------------------- */ static const uint8_t strfmt_map[('x'-'A')+1] = { STRFMT_A,0,0,0,STRFMT_E,STRFMT_F,STRFMT_G,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,STRFMT_X,0,0, 0,0,0,0,0,0, STRFMT_A,0,STRFMT_C,STRFMT_D,STRFMT_E,STRFMT_F,STRFMT_G,0,STRFMT_I,0,0,0,0, 0,STRFMT_O,STRFMT_P,STRFMT_Q,0,STRFMT_S,0,STRFMT_U,0,0,STRFMT_X }; SFormat LJ_FASTCALL lj_strfmt_parse(FormatState *fs) { const uint8_t *p = fs->p, *e = fs->e; fs->str = (const char *)p; for (; p < e; p++) { if (*p == '%') { /* Escape char? */ if (p[1] == '%') { /* '%%'? */ fs->p = ++p+1; goto retlit; } else { SFormat sf = 0; uint32_t c; if (p != (const uint8_t *)fs->str) break; for (p++; (uint32_t)*p - ' ' <= (uint32_t)('0' - ' '); p++) { /* Parse flags. */ if (*p == '-') sf |= STRFMT_F_LEFT; else if (*p == '+') sf |= STRFMT_F_PLUS; else if (*p == '0') sf |= STRFMT_F_ZERO; else if (*p == ' ') sf |= STRFMT_F_SPACE; else if (*p == '#') sf |= STRFMT_F_ALT; else break; } if ((uint32_t)*p - '0' < 10) { /* Parse width. */ uint32_t width = (uint32_t)*p++ - '0'; if ((uint32_t)*p - '0' < 10) width = (uint32_t)*p++ - '0' + width*10; sf |= (width << STRFMT_SH_WIDTH); } if (*p == '.') { /* Parse precision. */ uint32_t prec = 0; p++; if ((uint32_t)*p - '0' < 10) { prec = (uint32_t)*p++ - '0'; if ((uint32_t)*p - '0' < 10) prec = (uint32_t)*p++ - '0' + prec*10; } sf |= ((prec+1) << STRFMT_SH_PREC); } /* Parse conversion. */ c = (uint32_t)*p - 'A'; if (LJ_LIKELY(c <= (uint32_t)('x' - 'A'))) { uint32_t sx = strfmt_map[c]; if (sx) { fs->p = p+1; return (sf | sx | ((c & 0x20) ? 0 : STRFMT_F_UPPER)); } } /* Return error location. */ if (*p >= 32) p++; fs->len = (MSize)(p - (const uint8_t *)fs->str); fs->p = fs->e; return STRFMT_ERR; } } } fs->p = p; retlit: fs->len = (MSize)(p - (const uint8_t *)fs->str); return fs->len ? STRFMT_LIT : STRFMT_EOF; } /* -- Raw conversions ----------------------------------------------------- */ #define WINT_R(x, sh, sc) \ { uint32_t d = (x*(((1<>sh; x -= d*sc; *p++ = (char)('0'+d); } /* Write integer to buffer. */ char * LJ_FASTCALL lj_strfmt_wint(char *p, int32_t k) { uint32_t u = (uint32_t)k; if (k < 0) { u = ~u+1u; *p++ = '-'; } if (u < 10000) { if (u < 10) goto dig1; if (u < 100) goto dig2; if (u < 1000) goto dig3; } else { uint32_t v = u / 10000; u -= v * 10000; if (v < 10000) { if (v < 10) goto dig5; if (v < 100) goto dig6; if (v < 1000) goto dig7; } else { uint32_t w = v / 10000; v -= w * 10000; if (w >= 10) WINT_R(w, 10, 10) *p++ = (char)('0'+w); } WINT_R(v, 23, 1000) dig7: WINT_R(v, 12, 100) dig6: WINT_R(v, 10, 10) dig5: *p++ = (char)('0'+v); } WINT_R(u, 23, 1000) dig3: WINT_R(u, 12, 100) dig2: WINT_R(u, 10, 10) dig1: *p++ = (char)('0'+u); return p; } #undef WINT_R /* Write pointer to buffer. */ char * LJ_FASTCALL lj_strfmt_wptr(char *p, const void *v) { ptrdiff_t x = (ptrdiff_t)v; MSize i, n = STRFMT_MAXBUF_PTR; if (x == 0) { *p++ = 'N'; *p++ = 'U'; *p++ = 'L'; *p++ = 'L'; return p; } #if LJ_64 /* Shorten output for 64 bit pointers. */ n = 2+2*4+((x >> 32) ? 2+2*(lj_fls((uint32_t)(x >> 32))>>3) : 0); #endif p[0] = '0'; p[1] = 'x'; for (i = n-1; i >= 2; i--, x >>= 4) p[i] = "0123456789abcdef"[(x & 15)]; return p+n; } /* Write ULEB128 to buffer. */ char * LJ_FASTCALL lj_strfmt_wuleb128(char *p, uint32_t v) { for (; v >= 0x80; v >>= 7) *p++ = (char)((v & 0x7f) | 0x80); *p++ = (char)v; return p; } /* Return string or write number to tmp buffer and return pointer to start. */ const char *lj_strfmt_wstrnum(lua_State *L, cTValue *o, MSize *lenp) { SBuf *sb; if (tvisstr(o)) { *lenp = strV(o)->len; return strVdata(o); } else if (tvisbuf(o)) { SBufExt *sbx = bufV(o); *lenp = sbufxlen(sbx); return sbx->r; } else if (tvisint(o)) { sb = lj_strfmt_putint(lj_buf_tmp_(L), intV(o)); } else if (tvisnum(o)) { sb = lj_strfmt_putfnum(lj_buf_tmp_(L), STRFMT_G14, o->n); } else { return NULL; } *lenp = sbuflen(sb); return sb->b; } /* -- Unformatted conversions to buffer ----------------------------------- */ /* Add integer to buffer. */ SBuf * LJ_FASTCALL lj_strfmt_putint(SBuf *sb, int32_t k) { sb->w = lj_strfmt_wint(lj_buf_more(sb, STRFMT_MAXBUF_INT), k); return sb; } #if LJ_HASJIT /* Add number to buffer. */ SBuf * LJ_FASTCALL lj_strfmt_putnum(SBuf *sb, cTValue *o) { return lj_strfmt_putfnum(sb, STRFMT_G14, o->n); } #endif SBuf * LJ_FASTCALL lj_strfmt_putptr(SBuf *sb, const void *v) { sb->w = lj_strfmt_wptr(lj_buf_more(sb, STRFMT_MAXBUF_PTR), v); return sb; } /* Add quoted string to buffer. */ static SBuf *strfmt_putquotedlen(SBuf *sb, const char *s, MSize len) { lj_buf_putb(sb, '"'); while (len--) { uint32_t c = (uint32_t)(uint8_t)*s++; char *w = lj_buf_more(sb, 4); if (c == '"' || c == '\\' || c == '\n') { *w++ = '\\'; } else if (lj_char_iscntrl(c)) { /* This can only be 0-31 or 127. */ uint32_t d; *w++ = '\\'; if (c >= 100 || lj_char_isdigit((uint8_t)*s)) { *w++ = (char)('0'+(c >= 100)); if (c >= 100) c -= 100; goto tens; } else if (c >= 10) { tens: d = (c * 205) >> 11; c -= d * 10; *w++ = (char)('0'+d); } c += '0'; } *w++ = (char)c; sb->w = w; } lj_buf_putb(sb, '"'); return sb; } #if LJ_HASJIT SBuf * LJ_FASTCALL lj_strfmt_putquoted(SBuf *sb, GCstr *str) { return strfmt_putquotedlen(sb, strdata(str), str->len); } #endif /* -- Formatted conversions to buffer ------------------------------------- */ /* Add formatted char to buffer. */ SBuf *lj_strfmt_putfchar(SBuf *sb, SFormat sf, int32_t c) { MSize width = STRFMT_WIDTH(sf); char *w = lj_buf_more(sb, width > 1 ? width : 1); if ((sf & STRFMT_F_LEFT)) *w++ = (char)c; while (width-- > 1) *w++ = ' '; if (!(sf & STRFMT_F_LEFT)) *w++ = (char)c; sb->w = w; return sb; } /* Add formatted string to buffer. */ static SBuf *strfmt_putfstrlen(SBuf *sb, SFormat sf, const char *s, MSize len) { MSize width = STRFMT_WIDTH(sf); char *w; if (len > STRFMT_PREC(sf)) len = STRFMT_PREC(sf); w = lj_buf_more(sb, width > len ? width : len); if ((sf & STRFMT_F_LEFT)) w = lj_buf_wmem(w, s, len); while (width-- > len) *w++ = ' '; if (!(sf & STRFMT_F_LEFT)) w = lj_buf_wmem(w, s, len); sb->w = w; return sb; } #if LJ_HASJIT SBuf *lj_strfmt_putfstr(SBuf *sb, SFormat sf, GCstr *str) { return strfmt_putfstrlen(sb, sf, strdata(str), str->len); } #endif /* Add formatted signed/unsigned integer to buffer. */ SBuf *lj_strfmt_putfxint(SBuf *sb, SFormat sf, uint64_t k) { char buf[STRFMT_MAXBUF_XINT], *q = buf + sizeof(buf), *w; #ifdef LUA_USE_ASSERT char *ws; #endif MSize prefix = 0, len, prec, pprec, width, need; /* Figure out signed prefixes. */ if (STRFMT_TYPE(sf) == STRFMT_INT) { if ((int64_t)k < 0) { k = ~k+1u; prefix = 256 + '-'; } else if ((sf & STRFMT_F_PLUS)) { prefix = 256 + '+'; } else if ((sf & STRFMT_F_SPACE)) { prefix = 256 + ' '; } } /* Convert number and store to fixed-size buffer in reverse order. */ prec = STRFMT_PREC(sf); if ((int32_t)prec >= 0) sf &= ~STRFMT_F_ZERO; if (k == 0) { /* Special-case zero argument. */ if (prec != 0 || (sf & (STRFMT_T_OCT|STRFMT_F_ALT)) == (STRFMT_T_OCT|STRFMT_F_ALT)) *--q = '0'; } else if (!(sf & (STRFMT_T_HEX|STRFMT_T_OCT))) { /* Decimal. */ uint32_t k2; while ((k >> 32)) { *--q = (char)('0' + k % 10); k /= 10; } k2 = (uint32_t)k; do { *--q = (char)('0' + k2 % 10); k2 /= 10; } while (k2); } else if ((sf & STRFMT_T_HEX)) { /* Hex. */ const char *hexdig = (sf & STRFMT_F_UPPER) ? "0123456789ABCDEF" : "0123456789abcdef"; do { *--q = hexdig[(k & 15)]; k >>= 4; } while (k); if ((sf & STRFMT_F_ALT)) prefix = 512 + ((sf & STRFMT_F_UPPER) ? 'X' : 'x'); } else { /* Octal. */ do { *--q = (char)('0' + (uint32_t)(k & 7)); k >>= 3; } while (k); if ((sf & STRFMT_F_ALT)) *--q = '0'; } /* Calculate sizes. */ len = (MSize)(buf + sizeof(buf) - q); if ((int32_t)len >= (int32_t)prec) prec = len; width = STRFMT_WIDTH(sf); pprec = prec + (prefix >> 8); need = width > pprec ? width : pprec; w = lj_buf_more(sb, need); #ifdef LUA_USE_ASSERT ws = w; #endif /* Format number with leading/trailing whitespace and zeros. */ if ((sf & (STRFMT_F_LEFT|STRFMT_F_ZERO)) == 0) while (width-- > pprec) *w++ = ' '; if (prefix) { if ((char)prefix >= 'X') *w++ = '0'; *w++ = (char)prefix; } if ((sf & (STRFMT_F_LEFT|STRFMT_F_ZERO)) == STRFMT_F_ZERO) while (width-- > pprec) *w++ = '0'; while (prec-- > len) *w++ = '0'; while (q < buf + sizeof(buf)) *w++ = *q++; /* Add number itself. */ if ((sf & STRFMT_F_LEFT)) while (width-- > pprec) *w++ = ' '; lj_assertX(need == (MSize)(w - ws), "miscalculated format size"); sb->w = w; return sb; } /* Add number formatted as signed integer to buffer. */ SBuf *lj_strfmt_putfnum_int(SBuf *sb, SFormat sf, lua_Number n) { int64_t k = (int64_t)n; if (checki32(k) && sf == STRFMT_INT) return lj_strfmt_putint(sb, (int32_t)k); /* Shortcut for plain %d. */ else return lj_strfmt_putfxint(sb, sf, (uint64_t)k); } /* Add number formatted as unsigned integer to buffer. */ SBuf *lj_strfmt_putfnum_uint(SBuf *sb, SFormat sf, lua_Number n) { int64_t k; if (n >= 9223372036854775808.0) k = (int64_t)(n - 18446744073709551616.0); else k = (int64_t)n; return lj_strfmt_putfxint(sb, sf, (uint64_t)k); } /* Format stack arguments to buffer. */ int lj_strfmt_putarg(lua_State *L, SBuf *sb, int arg, int retry) { int narg = (int)(L->top - L->base); GCstr *fmt = lj_lib_checkstr(L, arg); FormatState fs; SFormat sf; lj_strfmt_init(&fs, strdata(fmt), fmt->len); while ((sf = lj_strfmt_parse(&fs)) != STRFMT_EOF) { if (sf == STRFMT_LIT) { lj_buf_putmem(sb, fs.str, fs.len); } else if (sf == STRFMT_ERR) { lj_err_callerv(L, LJ_ERR_STRFMT, strdata(lj_str_new(L, fs.str, fs.len))); } else { TValue *o = &L->base[arg++]; if (arg > narg) lj_err_arg(L, arg, LJ_ERR_NOVAL); switch (STRFMT_TYPE(sf)) { case STRFMT_INT: if (tvisint(o)) { int32_t k = intV(o); if (sf == STRFMT_INT) lj_strfmt_putint(sb, k); /* Shortcut for plain %d. */ else lj_strfmt_putfxint(sb, sf, k); break; } #if LJ_HASFFI if (tviscdata(o)) { GCcdata *cd = cdataV(o); if (cd->ctypeid == CTID_INT64 || cd->ctypeid == CTID_UINT64) { lj_strfmt_putfxint(sb, sf, *(uint64_t *)cdataptr(cd)); break; } } #endif lj_strfmt_putfnum_int(sb, sf, lj_lib_checknum(L, arg)); break; case STRFMT_UINT: if (tvisint(o)) { lj_strfmt_putfxint(sb, sf, intV(o)); break; } #if LJ_HASFFI if (tviscdata(o)) { GCcdata *cd = cdataV(o); if (cd->ctypeid == CTID_INT64 || cd->ctypeid == CTID_UINT64) { lj_strfmt_putfxint(sb, sf, *(uint64_t *)cdataptr(cd)); break; } } #endif lj_strfmt_putfnum_uint(sb, sf, lj_lib_checknum(L, arg)); break; case STRFMT_NUM: lj_strfmt_putfnum(sb, sf, lj_lib_checknum(L, arg)); break; case STRFMT_STR: { MSize len; const char *s; cTValue *mo; if (LJ_UNLIKELY(!tvisstr(o) && !tvisbuf(o)) && retry >= 0 && !tvisnil(mo = lj_meta_lookup(L, o, MM_tostring))) { /* Call __tostring metamethod once. */ copyTV(L, L->top++, mo); copyTV(L, L->top++, o); lua_call(L, 1, 1); o = &L->base[arg-1]; /* Stack may have been reallocated. */ copyTV(L, o, --L->top); /* Replace inline for retry. */ if (retry < 2) { /* Global buffer may have been overwritten. */ retry = 1; break; } } if (LJ_LIKELY(tvisstr(o))) { len = strV(o)->len; s = strVdata(o); #if LJ_HASBUFFER } else if (tvisbuf(o)) { SBufExt *sbx = bufV(o); if (sbx == (SBufExt *)sb) lj_err_arg(L, arg+1, LJ_ERR_BUFFER_SELF); len = sbufxlen(sbx); s = sbx->r; #endif } else { GCstr *str = lj_strfmt_obj(L, o); len = str->len; s = strdata(str); } if ((sf & STRFMT_T_QUOTED)) strfmt_putquotedlen(sb, s, len); /* No formatting. */ else strfmt_putfstrlen(sb, sf, s, len); break; } case STRFMT_CHAR: lj_strfmt_putfchar(sb, sf, lj_lib_checkint(L, arg)); break; case STRFMT_PTR: /* No formatting. */ lj_strfmt_putptr(sb, lj_obj_ptr(G(L), o)); break; default: lj_assertL(0, "bad string format type"); break; } } } return retry; } /* -- Conversions to strings ---------------------------------------------- */ /* Convert integer to string. */ GCstr * LJ_FASTCALL lj_strfmt_int(lua_State *L, int32_t k) { char buf[STRFMT_MAXBUF_INT]; MSize len = (MSize)(lj_strfmt_wint(buf, k) - buf); return lj_str_new(L, buf, len); } /* Convert integer or number to string. */ GCstr * LJ_FASTCALL lj_strfmt_number(lua_State *L, cTValue *o) { return tvisint(o) ? lj_strfmt_int(L, intV(o)) : lj_strfmt_num(L, o); } #if LJ_HASJIT /* Convert char value to string. */ GCstr * LJ_FASTCALL lj_strfmt_char(lua_State *L, int c) { char buf[1]; buf[0] = c; return lj_str_new(L, buf, 1); } #endif /* Raw conversion of object to string. */ GCstr * LJ_FASTCALL lj_strfmt_obj(lua_State *L, cTValue *o) { if (tvisstr(o)) { return strV(o); } else if (tvisnumber(o)) { return lj_strfmt_number(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 { char buf[8+2+2+16], *p = buf; p = lj_buf_wmem(p, lj_typename(o), (MSize)strlen(lj_typename(o))); *p++ = ':'; *p++ = ' '; if (tvisfunc(o) && isffunc(funcV(o))) { p = lj_buf_wmem(p, "builtin#", 8); p = lj_strfmt_wint(p, funcV(o)->c.ffid); } else { p = lj_strfmt_wptr(p, lj_obj_ptr(G(L), o)); } return lj_str_new(L, buf, (size_t)(p - buf)); } } /* -- Internal string formatting ------------------------------------------ */ /* ** These functions are only used for lua_pushfstring(), lua_pushvfstring() ** and for internal string formatting (e.g. error messages). Caveat: unlike ** string.format(), only a limited subset of formats and flags are supported! ** ** LuaJIT has support for a couple more formats than Lua 5.1/5.2: ** - %d %u %o %x with full formatting, 32 bit integers only. ** - %f and other FP formats are really %.14g. ** - %s %c %p without formatting. */ /* Push formatted message as a string object to Lua stack. va_list variant. */ const char *lj_strfmt_pushvf(lua_State *L, const char *fmt, va_list argp) { SBuf *sb = lj_buf_tmp_(L); FormatState fs; SFormat sf; GCstr *str; lj_strfmt_init(&fs, fmt, (MSize)strlen(fmt)); while ((sf = lj_strfmt_parse(&fs)) != STRFMT_EOF) { switch (STRFMT_TYPE(sf)) { case STRFMT_LIT: lj_buf_putmem(sb, fs.str, fs.len); break; case STRFMT_INT: lj_strfmt_putfxint(sb, sf, va_arg(argp, int32_t)); break; case STRFMT_UINT: lj_strfmt_putfxint(sb, sf, va_arg(argp, uint32_t)); break; case STRFMT_NUM: lj_strfmt_putfnum(sb, STRFMT_G14, va_arg(argp, lua_Number)); break; case STRFMT_STR: { const char *s = va_arg(argp, char *); if (s == NULL) s = "(null)"; lj_buf_putmem(sb, s, (MSize)strlen(s)); break; } case STRFMT_CHAR: lj_buf_putb(sb, va_arg(argp, int)); break; case STRFMT_PTR: lj_strfmt_putptr(sb, va_arg(argp, void *)); break; case STRFMT_ERR: default: lj_buf_putb(sb, '?'); lj_assertL(0, "bad string format near offset %d", fs.len); break; } } str = lj_buf_str(L, sb); setstrV(L, L->top, str); incr_top(L); return strdata(str); } /* Push formatted message as a string object to Lua stack. Vararg variant. */ const char *lj_strfmt_pushf(lua_State *L, const char *fmt, ...) { const char *msg; va_list argp; va_start(argp, fmt); msg = lj_strfmt_pushvf(L, fmt, argp); va_end(argp); return msg; } subprojects/luajit/src/lj_ffrecord.c0000644000175000017500000014524414741067622017134 0ustar aniolaniol/* ** Fast function call recorder. ** Copyright (C) 2005-2023 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_buf.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" #include "lj_strfmt.h" #include "lj_serialize.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); s = lj_strfmt_number(J->L, o); 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; } static TValue *rec_stop_stitch_cp(lua_State *L, lua_CFunction dummy, void *ud) { jit_State *J = (jit_State *)ud; lj_record_stop(J, LJ_TRLINK_STITCH, 0); UNUSED(L); UNUSED(dummy); return NULL; } /* Trace stitching: add continuation below frame to start a new trace. */ static void recff_stitch(jit_State *J) { ASMFunction cont = lj_cont_stitch; lua_State *L = J->L; TValue *base = L->base; BCReg nslot = J->maxslot + 1 + LJ_FR2; TValue *nframe = base + 1 + LJ_FR2; const BCIns *pc = frame_pc(base-1); TValue *pframe = frame_prevl(base-1); int errcode; /* Move func + args up in Lua stack and insert continuation. */ memmove(&base[1], &base[-1-LJ_FR2], sizeof(TValue)*nslot); setframe_ftsz(nframe, ((char *)nframe - (char *)pframe) + FRAME_CONT); setcont(base-LJ_FR2, cont); setframe_pc(base, pc); setnilV(base-1-LJ_FR2); /* Incorrect, but rec_check_slots() won't run anymore. */ L->base += 2 + LJ_FR2; L->top += 2 + LJ_FR2; /* Ditto for the IR. */ memmove(&J->base[1], &J->base[-1-LJ_FR2], sizeof(TRef)*nslot); #if LJ_FR2 J->base[2] = TREF_FRAME; J->base[-1] = lj_ir_k64(J, IR_KNUM, u64ptr(contptr(cont))); J->base[0] = lj_ir_k64(J, IR_KNUM, u64ptr(pc)) | TREF_CONT; #else J->base[0] = lj_ir_kptr(J, contptr(cont)) | TREF_CONT; #endif J->ktrace = tref_ref((J->base[-1-LJ_FR2] = lj_ir_ktrace(J))); J->base += 2 + LJ_FR2; J->baseslot += 2 + LJ_FR2; J->framedepth++; errcode = lj_vm_cpcall(L, NULL, J, rec_stop_stitch_cp); /* Undo Lua stack changes. */ memmove(&base[-1-LJ_FR2], &base[1], sizeof(TValue)*nslot); setframe_pc(base-1, pc); L->base -= 2 + LJ_FR2; L->top -= 2 + LJ_FR2; if (errcode) { if (errcode == LUA_ERRRUN) copyTV(L, L->top-1, L->top + (1 + LJ_FR2)); else setintV(L->top-1, (int32_t)LJ_TRERR_RECERR); lj_err_throw(L, errcode); /* Propagate errors. */ } } /* Fallback handler for fast functions that are not recorded (yet). */ static void LJ_FASTCALL recff_nyi(jit_State *J, RecordFFData *rd) { if (J->cur.nins < (IRRef)J->param[JIT_P_minstitch] + REF_BASE) { lj_trace_err_info(J, LJ_TRERR_TRACEUV); } else { /* Can only stitch from Lua call. */ if (J->framedepth && frame_islua(J->L->base-1)) { BCOp op = bc_op(*frame_pc(J->L->base-1)); /* Stitched trace cannot start with *M op with variable # of args. */ if (!(op == BC_CALLM || op == BC_CALLMT || op == BC_RETM || op == BC_TSETM)) { switch (J->fn->c.ffid) { case FF_error: case FF_debug_sethook: case FF_jit_flush: break; /* Don't stitch across special builtins. */ default: recff_stitch(J); /* Use trace stitching. */ rd->nres = -1; return; } } } /* Otherwise stop trace and return to interpreter. */ lj_record_stop(J, LJ_TRLINK_RETURN, 0); rd->nres = -1; } } /* Fallback handler for unsupported variants of fast functions. */ #define recff_nyiu recff_nyi /* Must stop the trace for classic C functions with arbitrary side-effects. */ #define recff_c recff_nyi /* Emit BUFHDR for the global temporary buffer. */ static TRef recff_bufhdr(jit_State *J) { return emitir(IRT(IR_BUFHDR, IRT_PGC), lj_ir_kptr(J, &J2G(J)->tmpbuf), IRBUFHDR_RESET); } /* Emit TMPREF. */ static TRef recff_tmpref(jit_State *J, TRef tr, int mode) { if (!LJ_DUALNUM && tref_isinteger(tr)) tr = emitir(IRTN(IR_CONV), tr, IRCONV_NUM_INT); return emitir(IRT(IR_TMPREF, IRT_PGC), tr, mode); } /* -- 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 && !LJ_GC64 && 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_PGC), 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_NIL), 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] = emitir(IRTI(IR_ALEN), tr, TREF_NIL); /* 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_PGC), tr, lj_ir_kint(J, 0)); TRef trchar = emitir(IRT(IR_XLOAD, IRT_U8), trptr, IRXLOAD_READONLY); emitir(IRTGI(IR_EQ), 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; if (start >= 1) { ptrdiff_t i; rd->nres = n - start; for (i = 0; i < n - start; i++) J->base[i] = J->base[start+i]; } /* else: Interpreter will throw. */ } else { recff_nyiu(J, rd); return; } } /* 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, rd); return; } } if (tref_isnumber_str(tr)) { if (tref_isstr(tr)) { TValue tmp; if (!lj_strscan_num(strV(&rd->argv[0]), &tmp)) { recff_nyiu(J, rd); /* Would need an inverted STRTO for this case. */ return; } 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+LJ_FR2] = J->base[0]; J->base[0] = ix.mobj; copyTV(J->L, &argv0, &rd->argv[0]); copyTV(J->L, &rd->argv[1+LJ_FR2], &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 (tr && !recff_metacall(J, rd, MM_tostring)) { if (tref_isnumber(tr)) { J->base[0] = emitir(IRT(IR_TOSTR, IRT_STR), tr, tref_isnum(tr) ? IRTOSTR_NUM : IRTOSTR_INT); } else if (tref_ispri(tr)) { J->base[0] = lj_ir_kstr(J, lj_strfmt_obj(J->L, &rd->argv[0])); } else { recff_nyiu(J, rd); return; } } } 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_xpairs(jit_State *J, RecordFFData *rd) { TRef tr = J->base[0]; if (!((LJ_52 || (LJ_HASFFI && tref_iscdata(tr))) && recff_metacall(J, rd, MM_pairs + rd->data))) { if (tref_istab(tr)) { J->base[0] = lj_ir_kfunc(J, funcV(&J->fn->c.upvalue[0])); J->base[1] = tr; J->base[2] = rd->data ? lj_ir_kint(J, 0) : TREF_NIL; rd->nres = 3; } /* else: Interpreter will throw. */ } } static void LJ_FASTCALL recff_pcall(jit_State *J, RecordFFData *rd) { if (J->maxslot >= 1) { #if LJ_FR2 /* Shift function arguments up. */ memmove(J->base + 1, J->base, sizeof(TRef) * J->maxslot); #endif lj_record_call(J, 0, J->maxslot - 1); rd->nres = -1; /* Pending call. */ J->needsnap = 1; /* Start catching on-trace errors. */ } /* 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); #if LJ_FR2 /* Shift function arguments up. */ memmove(J->base + 2, J->base + 1, sizeof(TRef) * (J->maxslot-1)); #endif /* 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. */ J->needsnap = 1; /* Start catching on-trace errors. */ } /* else: Interpreter will throw. */ } static void LJ_FASTCALL recff_getfenv(jit_State *J, RecordFFData *rd) { TRef tr = J->base[0]; /* Only support getfenv(0) for now. */ if (tref_isint(tr) && tref_isk(tr) && IR(tref_ref(tr))->i == 0) { TRef trl = emitir(IRT(IR_LREF, IRT_THREAD), 0, 0); J->base[0] = emitir(IRT(IR_FLOAD, IRT_TAB), trl, IRFL_THREAD_ENV); return; } recff_nyiu(J, rd); } static void LJ_FASTCALL recff_next(jit_State *J, RecordFFData *rd) { #if LJ_BE /* YAGNI: Disabled on big-endian due to issues with lj_vm_next, ** IR_HIOP, RID_RETLO/RID_RETHI and ra_destpair. */ recff_nyi(J, rd); #else TRef tab = J->base[0]; if (tref_istab(tab)) { RecordIndex ix; cTValue *keyv; ix.tab = tab; if (tref_isnil(J->base[1])) { /* Shortcut for start of traversal. */ ix.key = lj_ir_kint(J, 0); keyv = niltvg(J2G(J)); } else { TRef tmp = recff_tmpref(J, J->base[1], IRTMPREF_IN1); ix.key = lj_ir_call(J, IRCALL_lj_tab_keyindex, tab, tmp); keyv = &rd->argv[1]; } copyTV(J->L, &ix.tabv, &rd->argv[0]); ix.keyv.u32.lo = lj_tab_keyindex(tabV(&ix.tabv), keyv); /* Omit the value, if not used by the caller. */ ix.idxchain = (J->framedepth && frame_islua(J->L->base-1) && bc_b(frame_pc(J->L->base-1)[-1])-1 < 2); ix.mobj = 0; /* We don't need the next index. */ rd->nres = lj_record_next(J, &ix); J->base[0] = ix.key; J->base[1] = ix.val; } /* else: Interpreter will throw. */ #endif } /* -- 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_ksimd(J, LJ_KSIMD_ABS)); 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] = lj_ir_call(J, IRCALL_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); } static void LJ_FASTCALL recff_math_call(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_pow(jit_State *J, RecordFFData *rd) { J->base[0] = lj_opt_narrow_arith(J, J->base[0], J->base[1], &rd->argv[0], &rd->argv[1], IR_POW); 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_prng_u64d, 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 bit.tobit. */ static void LJ_FASTCALL recff_bit_tobit(jit_State *J, RecordFFData *rd) { TRef tr = J->base[0]; #if LJ_HASFFI if (tref_iscdata(tr)) { recff_bit64_tobit(J, rd); return; } #endif J->base[0] = lj_opt_narrow_tobit(J, tr); UNUSED(rd); } /* Record unary bit.bnot, bit.bswap. */ static void LJ_FASTCALL recff_bit_unary(jit_State *J, RecordFFData *rd) { #if LJ_HASFFI if (recff_bit64_unary(J, rd)) return; #endif J->base[0] = emitir(IRTI(rd->data), lj_opt_narrow_tobit(J, J->base[0]), 0); } /* Record N-ary bit.band, bit.bor, bit.bxor. */ static void LJ_FASTCALL recff_bit_nary(jit_State *J, RecordFFData *rd) { #if LJ_HASFFI if (recff_bit64_nary(J, rd)) return; #endif { TRef tr = lj_opt_narrow_tobit(J, J->base[0]); uint32_t ot = IRTI(rd->data); BCReg i; for (i = 1; J->base[i] != 0; i++) tr = emitir(ot, 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) { #if LJ_HASFFI if (recff_bit64_shift(J, rd)) return; #endif { 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); } } static void LJ_FASTCALL recff_bit_tohex(jit_State *J, RecordFFData *rd) { #if LJ_HASFFI TRef hdr = recff_bufhdr(J); TRef tr = recff_bit64_tohex(J, rd, hdr); J->base[0] = emitir(IRTG(IR_BUFSTR, IRT_STR), tr, hdr); #else recff_nyiu(J, rd); /* Don't bother working around this NYI. */ #endif } /* -- String library fast functions --------------------------------------- */ /* Specialize to relative starting position for string. */ static TRef recff_string_start(jit_State *J, GCstr *s, int32_t *st, TRef tr, TRef trlen, TRef tr0) { int32_t start = *st; if (start < 0) { emitir(IRTGI(IR_LT), tr, tr0); tr = emitir(IRTI(IR_ADD), trlen, tr); start = start + (int32_t)s->len; emitir(start < 0 ? IRTGI(IR_LT) : IRTGI(IR_GE), tr, tr0); if (start < 0) { tr = tr0; start = 0; } } else if (start == 0) { emitir(IRTGI(IR_EQ), tr, tr0); tr = tr0; } else { tr = emitir(IRTI(IR_ADD), tr, lj_ir_kint(J, -1)); emitir(IRTGI(IR_GE), tr, tr0); start--; } *st = start; return tr; } /* 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_UGT), trend, trlen); end = (int32_t)str->len; trend = trlen; } trstart = recff_string_start(J, str, &start, trstart, trlen, tr0); 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_PGC), 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, &J2G(J)->strempty); } } 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_PGC), 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; } } } static void LJ_FASTCALL recff_string_char(jit_State *J, RecordFFData *rd) { TRef k255 = lj_ir_kint(J, 255); BCReg i; for (i = 0; J->base[i] != 0; i++) { /* Convert char values to strings. */ TRef tr = lj_opt_narrow_toint(J, J->base[i]); emitir(IRTGI(IR_ULE), tr, k255); J->base[i] = emitir(IRT(IR_TOSTR, IRT_STR), tr, IRTOSTR_CHAR); } if (i > 1) { /* Concatenate the strings, if there's more than one. */ TRef hdr = recff_bufhdr(J), tr = hdr; for (i = 0; J->base[i] != 0; i++) tr = emitir(IRTG(IR_BUFPUT, IRT_PGC), tr, J->base[i]); J->base[0] = emitir(IRTG(IR_BUFSTR, IRT_STR), tr, hdr); } else if (i == 0) { J->base[0] = lj_ir_kstr(J, &J2G(J)->strempty); } UNUSED(rd); } static void LJ_FASTCALL recff_string_rep(jit_State *J, RecordFFData *rd) { TRef str = lj_ir_tostr(J, J->base[0]); TRef rep = lj_opt_narrow_toint(J, J->base[1]); TRef hdr, tr, str2 = 0; if (!tref_isnil(J->base[2])) { TRef sep = lj_ir_tostr(J, J->base[2]); int32_t vrep = argv2int(J, &rd->argv[1]); emitir(IRTGI(vrep > 1 ? IR_GT : IR_LE), rep, lj_ir_kint(J, 1)); if (vrep > 1) { TRef hdr2 = recff_bufhdr(J); TRef tr2 = emitir(IRTG(IR_BUFPUT, IRT_PGC), hdr2, sep); tr2 = emitir(IRTG(IR_BUFPUT, IRT_PGC), tr2, str); str2 = emitir(IRTG(IR_BUFSTR, IRT_STR), tr2, hdr2); } } tr = hdr = recff_bufhdr(J); if (str2) { tr = emitir(IRTG(IR_BUFPUT, IRT_PGC), tr, str); str = str2; rep = emitir(IRTI(IR_ADD), rep, lj_ir_kint(J, -1)); } tr = lj_ir_call(J, IRCALL_lj_buf_putstr_rep, tr, str, rep); J->base[0] = emitir(IRTG(IR_BUFSTR, IRT_STR), tr, hdr); } static void LJ_FASTCALL recff_string_op(jit_State *J, RecordFFData *rd) { TRef str = lj_ir_tostr(J, J->base[0]); TRef hdr = recff_bufhdr(J); TRef tr = lj_ir_call(J, rd->data, hdr, str); J->base[0] = emitir(IRTG(IR_BUFSTR, IRT_STR), tr, hdr); } static void LJ_FASTCALL recff_string_find(jit_State *J, RecordFFData *rd) { TRef trstr = lj_ir_tostr(J, J->base[0]); TRef trpat = lj_ir_tostr(J, J->base[1]); TRef trlen = emitir(IRTI(IR_FLOAD), trstr, IRFL_STR_LEN); TRef tr0 = lj_ir_kint(J, 0); TRef trstart; GCstr *str = argv2str(J, &rd->argv[0]); GCstr *pat = argv2str(J, &rd->argv[1]); int32_t start; J->needsnap = 1; if (tref_isnil(J->base[2])) { trstart = lj_ir_kint(J, 1); start = 1; } else { trstart = lj_opt_narrow_toint(J, J->base[2]); start = argv2int(J, &rd->argv[2]); } trstart = recff_string_start(J, str, &start, trstart, trlen, tr0); if ((MSize)start <= str->len) { emitir(IRTGI(IR_ULE), trstart, trlen); } else { emitir(IRTGI(IR_UGT), trstart, trlen); #if LJ_52 J->base[0] = TREF_NIL; return; #else trstart = trlen; start = str->len; #endif } /* Fixed arg or no pattern matching chars? (Specialized to pattern string.) */ if ((J->base[2] && tref_istruecond(J->base[3])) || (emitir(IRTG(IR_EQ, IRT_STR), trpat, lj_ir_kstr(J, pat)), !lj_str_haspattern(pat))) { /* Search for fixed string. */ TRef trsptr = emitir(IRT(IR_STRREF, IRT_PGC), trstr, trstart); TRef trpptr = emitir(IRT(IR_STRREF, IRT_PGC), trpat, tr0); TRef trslen = emitir(IRTI(IR_SUB), trlen, trstart); TRef trplen = emitir(IRTI(IR_FLOAD), trpat, IRFL_STR_LEN); TRef tr = lj_ir_call(J, IRCALL_lj_str_find, trsptr, trpptr, trslen, trplen); TRef trp0 = lj_ir_kkptr(J, NULL); if (lj_str_find(strdata(str)+(MSize)start, strdata(pat), str->len-(MSize)start, pat->len)) { TRef pos; emitir(IRTG(IR_NE, IRT_PGC), tr, trp0); /* Recompute offset. trsptr may not point into trstr after folding. */ pos = emitir(IRTI(IR_ADD), emitir(IRTI(IR_SUB), tr, trsptr), trstart); J->base[0] = emitir(IRTI(IR_ADD), pos, lj_ir_kint(J, 1)); J->base[1] = emitir(IRTI(IR_ADD), pos, trplen); rd->nres = 2; } else { emitir(IRTG(IR_EQ, IRT_PGC), tr, trp0); J->base[0] = TREF_NIL; } } else { /* Search for pattern. */ recff_nyiu(J, rd); return; } } static void recff_format(jit_State *J, RecordFFData *rd, TRef hdr, int sbufx) { ptrdiff_t arg = sbufx; TRef tr = hdr, trfmt = lj_ir_tostr(J, J->base[arg]); GCstr *fmt = argv2str(J, &rd->argv[arg]); FormatState fs; SFormat sf; int nfmt = 0; /* Specialize to the format string. */ emitir(IRTG(IR_EQ, IRT_STR), trfmt, lj_ir_kstr(J, fmt)); lj_strfmt_init(&fs, strdata(fmt), fmt->len); while ((sf = lj_strfmt_parse(&fs)) != STRFMT_EOF) { /* Parse format. */ TRef tra = sf == STRFMT_LIT ? 0 : J->base[++arg]; TRef trsf = lj_ir_kint(J, (int32_t)sf); IRCallID id; switch (STRFMT_TYPE(sf)) { case STRFMT_LIT: tr = emitir(IRTG(IR_BUFPUT, IRT_PGC), tr, lj_ir_kstr(J, lj_str_new(J->L, fs.str, fs.len))); break; case STRFMT_INT: id = IRCALL_lj_strfmt_putfnum_int; handle_int: if (!tref_isinteger(tra)) { #if LJ_HASFFI if (tref_iscdata(tra)) { tra = lj_crecord_loadiu64(J, tra, &rd->argv[arg]); tr = lj_ir_call(J, IRCALL_lj_strfmt_putfxint, tr, trsf, tra); break; } #endif goto handle_num; } if (sf == STRFMT_INT) { /* Shortcut for plain %d. */ tr = emitir(IRTG(IR_BUFPUT, IRT_PGC), tr, emitir(IRT(IR_TOSTR, IRT_STR), tra, IRTOSTR_INT)); } else { #if LJ_HASFFI tra = emitir(IRT(IR_CONV, IRT_U64), tra, (IRT_INT|(IRT_U64<<5)|IRCONV_SEXT)); tr = lj_ir_call(J, IRCALL_lj_strfmt_putfxint, tr, trsf, tra); lj_needsplit(J); #else recff_nyiu(J, rd); /* Don't bother working around this NYI. */ return; #endif } break; case STRFMT_UINT: id = IRCALL_lj_strfmt_putfnum_uint; goto handle_int; case STRFMT_NUM: id = IRCALL_lj_strfmt_putfnum; handle_num: tra = lj_ir_tonum(J, tra); tr = lj_ir_call(J, id, tr, trsf, tra); if (LJ_SOFTFP32) lj_needsplit(J); break; case STRFMT_STR: if (!tref_isstr(tra)) { recff_nyiu(J, rd); /* NYI: __tostring and non-string types for %s. */ /* NYI: also buffers. */ return; } if (sf == STRFMT_STR) /* Shortcut for plain %s. */ tr = emitir(IRTG(IR_BUFPUT, IRT_PGC), tr, tra); else if ((sf & STRFMT_T_QUOTED)) tr = lj_ir_call(J, IRCALL_lj_strfmt_putquoted, tr, tra); else tr = lj_ir_call(J, IRCALL_lj_strfmt_putfstr, tr, trsf, tra); break; case STRFMT_CHAR: tra = lj_opt_narrow_toint(J, tra); if (sf == STRFMT_CHAR) /* Shortcut for plain %c. */ tr = emitir(IRTG(IR_BUFPUT, IRT_PGC), tr, emitir(IRT(IR_TOSTR, IRT_STR), tra, IRTOSTR_CHAR)); else tr = lj_ir_call(J, IRCALL_lj_strfmt_putfchar, tr, trsf, tra); break; case STRFMT_PTR: /* NYI */ case STRFMT_ERR: default: recff_nyiu(J, rd); return; } if (++nfmt > 100) lj_trace_err(J, LJ_TRERR_TRACEOV); } if (sbufx) { emitir(IRT(IR_USE, IRT_NIL), tr, 0); } else { J->base[0] = emitir(IRTG(IR_BUFSTR, IRT_STR), tr, hdr); } } static void LJ_FASTCALL recff_string_format(jit_State *J, RecordFFData *rd) { recff_format(J, rd, recff_bufhdr(J), 0); } /* -- Buffer library fast functions --------------------------------------- */ #if LJ_HASBUFFER static LJ_AINLINE TRef recff_sbufx_get_L(jit_State *J, TRef ud) { return emitir(IRT(IR_FLOAD, IRT_PGC), ud, IRFL_SBUF_L); } static LJ_AINLINE void recff_sbufx_set_L(jit_State *J, TRef ud, TRef val) { TRef fref = emitir(IRT(IR_FREF, IRT_PGC), ud, IRFL_SBUF_L); emitir(IRT(IR_FSTORE, IRT_PGC), fref, val); } static LJ_AINLINE TRef recff_sbufx_get_ptr(jit_State *J, TRef ud, IRFieldID fl) { return emitir(IRT(IR_FLOAD, IRT_PTR), ud, fl); } static LJ_AINLINE void recff_sbufx_set_ptr(jit_State *J, TRef ud, IRFieldID fl, TRef val) { TRef fref = emitir(IRT(IR_FREF, IRT_PTR), ud, fl); emitir(IRT(IR_FSTORE, IRT_PTR), fref, val); } static LJ_AINLINE TRef recff_sbufx_len(jit_State *J, TRef trr, TRef trw) { TRef len = emitir(IRT(IR_SUB, IRT_INTP), trw, trr); if (LJ_64) len = emitir(IRTI(IR_CONV), len, (IRT_INT<<5)|IRT_INTP|IRCONV_NONE); return len; } /* Emit typecheck for string buffer. */ static TRef recff_sbufx_check(jit_State *J, RecordFFData *rd, ptrdiff_t arg) { TRef trtype, ud = J->base[arg]; if (!tvisbuf(&rd->argv[arg])) lj_trace_err(J, LJ_TRERR_BADTYPE); trtype = emitir(IRT(IR_FLOAD, IRT_U8), ud, IRFL_UDATA_UDTYPE); emitir(IRTGI(IR_EQ), trtype, lj_ir_kint(J, UDTYPE_BUFFER)); J->needsnap = 1; return ud; } /* Emit BUFHDR for write to extended string buffer. */ static TRef recff_sbufx_write(jit_State *J, TRef ud) { TRef trbuf = emitir(IRT(IR_ADD, IRT_PGC), ud, lj_ir_kintpgc(J, sizeof(GCudata))); return emitir(IRT(IR_BUFHDR, IRT_PGC), trbuf, IRBUFHDR_WRITE); } /* Check for integer in range for the buffer API. */ static TRef recff_sbufx_checkint(jit_State *J, RecordFFData *rd, ptrdiff_t arg) { TRef tr = J->base[arg]; TRef trlim = lj_ir_kint(J, LJ_MAX_BUF); if (tref_isinteger(tr)) { emitir(IRTGI(IR_ULE), tr, trlim); } else if (tref_isnum(tr)) { tr = emitir(IRTI(IR_CONV), tr, IRCONV_INT_NUM|IRCONV_ANY); emitir(IRTGI(IR_ULE), tr, trlim); #if LJ_HASFFI } else if (tref_iscdata(tr)) { tr = lj_crecord_loadiu64(J, tr, &rd->argv[arg]); emitir(IRTG(IR_ULE, IRT_U64), tr, lj_ir_kint64(J, LJ_MAX_BUF)); tr = emitir(IRTI(IR_CONV), tr, (IRT_INT<<5)|IRT_I64|IRCONV_NONE); #else UNUSED(rd); #endif } else { lj_trace_err(J, LJ_TRERR_BADTYPE); } return tr; } static void LJ_FASTCALL recff_buffer_method_reset(jit_State *J, RecordFFData *rd) { TRef ud = recff_sbufx_check(J, rd, 0); SBufExt *sbx = bufV(&rd->argv[0]); int iscow = (int)sbufiscow(sbx); TRef trl = recff_sbufx_get_L(J, ud); TRef trcow = emitir(IRT(IR_BAND, IRT_IGC), trl, lj_ir_kintpgc(J, SBUF_FLAG_COW)); TRef zeropgc = lj_ir_kintpgc(J, 0); emitir(IRTG(iscow ? IR_NE : IR_EQ, IRT_IGC), trcow, zeropgc); if (iscow) { TRef zerop = lj_ir_kintp(J, 0); trl = emitir(IRT(IR_BXOR, IRT_IGC), trl, lj_ir_kintpgc(J, SBUF_FLAG_COW)); recff_sbufx_set_ptr(J, ud, IRFL_SBUF_W, zerop); recff_sbufx_set_ptr(J, ud, IRFL_SBUF_E, zerop); recff_sbufx_set_ptr(J, ud, IRFL_SBUF_B, zerop); recff_sbufx_set_L(J, ud, trl); emitir(IRT(IR_FSTORE, IRT_PGC), emitir(IRT(IR_FREF, IRT_PGC), ud, IRFL_SBUF_REF), zeropgc); recff_sbufx_set_ptr(J, ud, IRFL_SBUF_R, zerop); } else { TRef trb = recff_sbufx_get_ptr(J, ud, IRFL_SBUF_B); recff_sbufx_set_ptr(J, ud, IRFL_SBUF_W, trb); recff_sbufx_set_ptr(J, ud, IRFL_SBUF_R, trb); } } static void LJ_FASTCALL recff_buffer_method_skip(jit_State *J, RecordFFData *rd) { TRef ud = recff_sbufx_check(J, rd, 0); TRef trr = recff_sbufx_get_ptr(J, ud, IRFL_SBUF_R); TRef trw = recff_sbufx_get_ptr(J, ud, IRFL_SBUF_W); TRef len = recff_sbufx_len(J, trr, trw); TRef trn = recff_sbufx_checkint(J, rd, 1); len = emitir(IRTI(IR_MIN), len, trn); trr = emitir(IRT(IR_ADD, IRT_PTR), trr, len); recff_sbufx_set_ptr(J, ud, IRFL_SBUF_R, trr); } static void LJ_FASTCALL recff_buffer_method_set(jit_State *J, RecordFFData *rd) { TRef ud = recff_sbufx_check(J, rd, 0); TRef trbuf = recff_sbufx_write(J, ud); TRef tr = J->base[1]; if (tref_isstr(tr)) { TRef trp = emitir(IRT(IR_STRREF, IRT_PGC), tr, lj_ir_kint(J, 0)); TRef len = emitir(IRTI(IR_FLOAD), tr, IRFL_STR_LEN); IRIns *irp = IR(tref_ref(trp)); /* trp must point into the anchored obj, even after folding. */ if (irp->o == IR_STRREF) tr = irp->op1; else if (!tref_isk(tr)) trp = emitir(IRT(IR_ADD, IRT_PGC), tr, lj_ir_kintpgc(J, sizeof(GCstr))); lj_ir_call(J, IRCALL_lj_bufx_set, trbuf, trp, len, tr); #if LJ_HASFFI } else if (tref_iscdata(tr)) { TRef trp = lj_crecord_topcvoid(J, tr, &rd->argv[1]); TRef len = recff_sbufx_checkint(J, rd, 2); lj_ir_call(J, IRCALL_lj_bufx_set, trbuf, trp, len, tr); #endif } /* else: Interpreter will throw. */ } static void LJ_FASTCALL recff_buffer_method_put(jit_State *J, RecordFFData *rd) { TRef ud = recff_sbufx_check(J, rd, 0); TRef trbuf = recff_sbufx_write(J, ud); TRef tr; ptrdiff_t arg; if (!J->base[1]) return; for (arg = 1; (tr = J->base[arg]); arg++) { if (tref_isudata(tr)) { TRef ud2 = recff_sbufx_check(J, rd, arg); emitir(IRTG(IR_NE, IRT_PGC), ud, ud2); } } for (arg = 1; (tr = J->base[arg]); arg++) { if (tref_isstr(tr)) { trbuf = emitir(IRTG(IR_BUFPUT, IRT_PGC), trbuf, tr); } else if (tref_isnumber(tr)) { trbuf = emitir(IRTG(IR_BUFPUT, IRT_PGC), trbuf, emitir(IRT(IR_TOSTR, IRT_STR), tr, tref_isnum(tr) ? IRTOSTR_NUM : IRTOSTR_INT)); } else if (tref_isudata(tr)) { TRef trr = recff_sbufx_get_ptr(J, tr, IRFL_SBUF_R); TRef trw = recff_sbufx_get_ptr(J, tr, IRFL_SBUF_W); TRef len = recff_sbufx_len(J, trr, trw); trbuf = lj_ir_call(J, IRCALL_lj_buf_putmem, trbuf, trr, len); } else { recff_nyiu(J, rd); } } emitir(IRT(IR_USE, IRT_NIL), trbuf, 0); } static void LJ_FASTCALL recff_buffer_method_putf(jit_State *J, RecordFFData *rd) { TRef ud = recff_sbufx_check(J, rd, 0); TRef trbuf = recff_sbufx_write(J, ud); recff_format(J, rd, trbuf, 1); } static void LJ_FASTCALL recff_buffer_method_get(jit_State *J, RecordFFData *rd) { TRef ud = recff_sbufx_check(J, rd, 0); TRef trr = recff_sbufx_get_ptr(J, ud, IRFL_SBUF_R); TRef trw = recff_sbufx_get_ptr(J, ud, IRFL_SBUF_W); TRef tr; ptrdiff_t arg; if (!J->base[1]) { J->base[1] = TREF_NIL; J->base[2] = 0; } for (arg = 0; (tr = J->base[arg+1]); arg++) { if (!tref_isnil(tr)) { J->base[arg+1] = recff_sbufx_checkint(J, rd, arg+1); } } for (arg = 0; (tr = J->base[arg+1]); arg++) { TRef len = recff_sbufx_len(J, trr, trw); if (tref_isnil(tr)) { J->base[arg] = emitir(IRT(IR_XSNEW, IRT_STR), trr, len); trr = trw; } else { TRef tru; len = emitir(IRTI(IR_MIN), len, tr); tru = emitir(IRT(IR_ADD, IRT_PTR), trr, len); J->base[arg] = emitir(IRT(IR_XSNEW, IRT_STR), trr, len); trr = tru; /* Doing the ADD before the SNEW generates better code. */ } recff_sbufx_set_ptr(J, ud, IRFL_SBUF_R, trr); } rd->nres = arg; } static void LJ_FASTCALL recff_buffer_method___tostring(jit_State *J, RecordFFData *rd) { TRef ud = recff_sbufx_check(J, rd, 0); TRef trr = recff_sbufx_get_ptr(J, ud, IRFL_SBUF_R); TRef trw = recff_sbufx_get_ptr(J, ud, IRFL_SBUF_W); J->base[0] = emitir(IRT(IR_XSNEW, IRT_STR), trr, recff_sbufx_len(J, trr, trw)); } static void LJ_FASTCALL recff_buffer_method___len(jit_State *J, RecordFFData *rd) { TRef ud = recff_sbufx_check(J, rd, 0); TRef trr = recff_sbufx_get_ptr(J, ud, IRFL_SBUF_R); TRef trw = recff_sbufx_get_ptr(J, ud, IRFL_SBUF_W); J->base[0] = recff_sbufx_len(J, trr, trw); } #if LJ_HASFFI static void LJ_FASTCALL recff_buffer_method_putcdata(jit_State *J, RecordFFData *rd) { TRef ud = recff_sbufx_check(J, rd, 0); TRef trbuf = recff_sbufx_write(J, ud); TRef tr = lj_crecord_topcvoid(J, J->base[1], &rd->argv[1]); TRef len = recff_sbufx_checkint(J, rd, 2); trbuf = lj_ir_call(J, IRCALL_lj_buf_putmem, trbuf, tr, len); emitir(IRT(IR_USE, IRT_NIL), trbuf, 0); } static void LJ_FASTCALL recff_buffer_method_reserve(jit_State *J, RecordFFData *rd) { TRef ud = recff_sbufx_check(J, rd, 0); TRef trbuf = recff_sbufx_write(J, ud); TRef trsz = recff_sbufx_checkint(J, rd, 1); J->base[1] = lj_ir_call(J, IRCALL_lj_bufx_more, trbuf, trsz); J->base[0] = lj_crecord_topuint8(J, recff_sbufx_get_ptr(J, ud, IRFL_SBUF_W)); rd->nres = 2; } static void LJ_FASTCALL recff_buffer_method_commit(jit_State *J, RecordFFData *rd) { TRef ud = recff_sbufx_check(J, rd, 0); TRef len = recff_sbufx_checkint(J, rd, 1); TRef trw = recff_sbufx_get_ptr(J, ud, IRFL_SBUF_W); TRef tre = recff_sbufx_get_ptr(J, ud, IRFL_SBUF_E); TRef left = emitir(IRT(IR_SUB, IRT_INTP), tre, trw); if (LJ_64) left = emitir(IRTI(IR_CONV), left, (IRT_INT<<5)|IRT_INTP|IRCONV_NONE); emitir(IRTGI(IR_ULE), len, left); trw = emitir(IRT(IR_ADD, IRT_PTR), trw, len); recff_sbufx_set_ptr(J, ud, IRFL_SBUF_W, trw); } static void LJ_FASTCALL recff_buffer_method_ref(jit_State *J, RecordFFData *rd) { TRef ud = recff_sbufx_check(J, rd, 0); TRef trr = recff_sbufx_get_ptr(J, ud, IRFL_SBUF_R); TRef trw = recff_sbufx_get_ptr(J, ud, IRFL_SBUF_W); J->base[0] = lj_crecord_topuint8(J, trr); J->base[1] = recff_sbufx_len(J, trr, trw); rd->nres = 2; } #endif static void LJ_FASTCALL recff_buffer_method_encode(jit_State *J, RecordFFData *rd) { TRef ud = recff_sbufx_check(J, rd, 0); TRef trbuf = recff_sbufx_write(J, ud); TRef tmp = recff_tmpref(J, J->base[1], IRTMPREF_IN1); lj_ir_call(J, IRCALL_lj_serialize_put, trbuf, tmp); /* No IR_USE needed, since the call is a store. */ } static void LJ_FASTCALL recff_buffer_method_decode(jit_State *J, RecordFFData *rd) { TRef ud = recff_sbufx_check(J, rd, 0); TRef trbuf = recff_sbufx_write(J, ud); TRef tmp = recff_tmpref(J, TREF_NIL, IRTMPREF_OUT1); TRef trr = lj_ir_call(J, IRCALL_lj_serialize_get, trbuf, tmp); IRType t = (IRType)lj_serialize_peektype(bufV(&rd->argv[0])); /* No IR_USE needed, since the call is a store. */ J->base[0] = lj_record_vload(J, tmp, 0, t); /* The sbx->r store must be after the VLOAD type check, in case it fails. */ recff_sbufx_set_ptr(J, ud, IRFL_SBUF_R, trr); } static void LJ_FASTCALL recff_buffer_encode(jit_State *J, RecordFFData *rd) { TRef tmp = recff_tmpref(J, J->base[0], IRTMPREF_IN1); J->base[0] = lj_ir_call(J, IRCALL_lj_serialize_encode, tmp); /* IR_USE needed for IR_CALLA, because the encoder may throw non-OOM. */ emitir(IRT(IR_USE, IRT_NIL), J->base[0], 0); UNUSED(rd); } static void LJ_FASTCALL recff_buffer_decode(jit_State *J, RecordFFData *rd) { if (tvisstr(&rd->argv[0])) { GCstr *str = strV(&rd->argv[0]); SBufExt sbx; IRType t; TRef tmp = recff_tmpref(J, TREF_NIL, IRTMPREF_OUT1); TRef tr = lj_ir_call(J, IRCALL_lj_serialize_decode, tmp, J->base[0]); /* IR_USE needed for IR_CALLA, because the decoder may throw non-OOM. ** That's why IRCALL_lj_serialize_decode needs a fake INT result. */ emitir(IRT(IR_USE, IRT_NIL), tr, 0); memset(&sbx, 0, sizeof(SBufExt)); lj_bufx_set_cow(J->L, &sbx, strdata(str), str->len); t = (IRType)lj_serialize_peektype(&sbx); J->base[0] = lj_record_vload(J, tmp, 0, t); } /* else: Interpreter will throw. */ } #endif /* -- Table library fast functions ---------------------------------------- */ 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 = emitir(IRTI(IR_ALEN), ix.tab, TREF_NIL); 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, rd); return; } } /* else: Interpreter will throw. */ } static void LJ_FASTCALL recff_table_concat(jit_State *J, RecordFFData *rd) { TRef tab = J->base[0]; if (tref_istab(tab)) { TRef sep = !tref_isnil(J->base[1]) ? lj_ir_tostr(J, J->base[1]) : lj_ir_knull(J, IRT_STR); TRef tri = (J->base[1] && !tref_isnil(J->base[2])) ? lj_opt_narrow_toint(J, J->base[2]) : lj_ir_kint(J, 1); TRef tre = (J->base[1] && J->base[2] && !tref_isnil(J->base[3])) ? lj_opt_narrow_toint(J, J->base[3]) : emitir(IRTI(IR_ALEN), tab, TREF_NIL); TRef hdr = recff_bufhdr(J); TRef tr = lj_ir_call(J, IRCALL_lj_buf_puttab, hdr, tab, sep, tri, tre); emitir(IRTG(IR_NE, IRT_PTR), tr, lj_ir_kptr(J, NULL)); J->base[0] = emitir(IRTG(IR_BUFSTR, IRT_STR), tr, hdr); } /* else: Interpreter will throw. */ UNUSED(rd); } static void LJ_FASTCALL recff_table_new(jit_State *J, RecordFFData *rd) { TRef tra = lj_opt_narrow_toint(J, J->base[0]); TRef trh = lj_opt_narrow_toint(J, J->base[1]); if (tref_isk(tra) && tref_isk(trh)) { int32_t a = IR(tref_ref(tra))->i; if (a < 0x7fff) { uint32_t hbits = hsize2hbits(IR(tref_ref(trh))->i); a = a > 0 ? a+1 : 0; J->base[0] = emitir(IRTG(IR_TNEW, IRT_TAB), (uint32_t)a, hbits); return; } } J->base[0] = lj_ir_call(J, IRCALL_lj_tab_new_ah, tra, trh); UNUSED(rd); } static void LJ_FASTCALL recff_table_clear(jit_State *J, RecordFFData *rd) { TRef tr = J->base[0]; if (tref_istab(tr)) { rd->nres = 0; lj_ir_call(J, IRCALL_lj_tab_clear, tr); J->needsnap = 1; } /* 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() */ ud = lj_ir_ggfload(J, IRT_UDATA, GG_OFS(g.gcroot[id])); } 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_PGC), str, zero); TRef len = emitir(IRTI(IR_FLOAD), str, IRFL_STR_LEN); if (tref_isk(len) && IR(tref_ref(len))->i == 1) { IRIns *irs = IR(tref_ref(str)); TRef tr = (irs->o == IR_TOSTR && irs->op2 == IRTOSTR_CHAR) ? irs->op1 : 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; } /* -- Debug library fast functions ---------------------------------------- */ static void LJ_FASTCALL recff_debug_getmetatable(jit_State *J, RecordFFData *rd) { GCtab *mt; TRef mtref; TRef tr = J->base[0]; if (tref_istab(tr)) { mt = tabref(tabV(&rd->argv[0])->metatable); mtref = emitir(IRT(IR_FLOAD, IRT_TAB), tr, IRFL_TAB_META); } else if (tref_isudata(tr)) { mt = tabref(udataV(&rd->argv[0])->metatable); mtref = emitir(IRT(IR_FLOAD, IRT_TAB), tr, IRFL_UDATA_META); } else { mt = tabref(basemt_obj(J2G(J), &rd->argv[0])); J->base[0] = mt ? lj_ir_ktab(J, mt) : TREF_NIL; return; } emitir(IRTG(mt ? IR_NE : IR_EQ, IRT_TAB), mtref, lj_ir_knull(J, IRT_TAB)); J->base[0] = mt ? mtref : TREF_NIL; } /* -- 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 subprojects/luajit/src/lj_record.h0000644000175000017500000000337414741067622016622 0ustar aniolaniol/* ** Trace recorder (bytecode -> SSA IR). ** Copyright (C) 2005-2023 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 void lj_record_stop(jit_State *J, TraceLink linktype, TraceNo lnk); LJ_FUNC TRef lj_record_constify(jit_State *J, cTValue *o); LJ_FUNC TRef lj_record_vload(jit_State *J, TRef ref, MSize idx, IRType t); 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 int lj_record_next(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 subprojects/luajit/src/vm_arm64.dasc0000644000175000017500000035134314741067622016777 0ustar aniolaniol|// Low-level VM code for ARM64 CPUs. |// Bytecode interpreter, fast functions and helper functions. |// Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h | |.arch arm64 |.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. | |//----------------------------------------------------------------------- | |// ARM64 registers and the AAPCS64 ABI 1.0 at a glance: |// |// x0-x17 temp, x19-x28 callee-saved, x29 fp, x30 lr |// x18 is reserved on most platforms. Don't use it, save it or restore it. |// x31 doesn't exist. Register number 31 either means xzr/wzr (zero) or sp, |// depending on the instruction. |// v0-v7 temp, v8-v15 callee-saved (only d8-d15 preserved), v16-v31 temp |// |// x0-x7/v0-v7 hold parameters and results. | |// Fixed register assignments for the interpreter. | |// The following must be C callee-save. |.define BASE, x19 // Base of current Lua stack frame. |.define KBASE, x20 // Constants of current Lua function. |.define PC, x21 // Next PC. |.define GLREG, x22 // Global state. |.define LREG, x23 // Register holding lua_State (also in SAVE_L). |.define TISNUM, x24 // Constant LJ_TISNUM << 47. |.define TISNUMhi, x25 // Constant LJ_TISNUM << 15. |.define TISNIL, x26 // Constant -1LL. |.define fp, x29 // Yes, we have to maintain a frame pointer. | |.define ST_INTERP, w26 // Constant -1. | |// The following temporaries are not saved across C calls, except for RA/RC. |.define RA, x27 |.define RC, x28 |.define RB, x17 |.define RAw, w27 |.define RCw, w28 |.define RBw, w17 |.define INS, x16 |.define INSw, w16 |.define ITYPE, x15 |.define TMP0, x8 |.define TMP1, x9 |.define TMP2, x10 |.define TMP3, x11 |.define TMP0w, w8 |.define TMP1w, w9 |.define TMP2w, w10 |.define TMP3w, w11 | |// Calling conventions. Also used as temporaries. |.define CARG1, x0 |.define CARG2, x1 |.define CARG3, x2 |.define CARG4, x3 |.define CARG5, x4 |.define CARG1w, w0 |.define CARG2w, w1 |.define CARG3w, w2 |.define CARG4w, w3 |.define CARG5w, w4 | |.define FARG1, d0 |.define FARG2, d1 | |.define CRET1, x0 |.define CRET1w, w0 | |//----------------------------------------------------------------------- | |// ARM64e pointer authentication codes (PAC). |.if PAUTH |.macro sp_auth; pacibsp; .endmacro |.macro br_auth, reg; braaz reg; .endmacro |.macro blr_auth, reg; blraaz reg; .endmacro |.macro ret_auth; retab; .endmacro |.else |.macro sp_auth; .endmacro |.macro br_auth, reg; br reg; .endmacro |.macro blr_auth, reg; blr reg; .endmacro |.macro ret_auth; ret; .endmacro |.endif | |//----------------------------------------------------------------------- | |// Stack layout while in interpreter. Must match with lj_frame.h. | |.define CFRAME_SPACE, 208 |//----- 16 byte aligned, <-- sp entering interpreter |.define SAVE_FP_LR_, 192 |.define SAVE_GPR_, 112 // 112+10*8: 64 bit GPR saves |.define SAVE_FPR_, 48 // 48+8*8: 64 bit FPR saves |// Unused [sp, #44] // 32 bit values |.define SAVE_NRES, [sp, #40] |.define SAVE_ERRF, [sp, #36] |.define SAVE_MULTRES, [sp, #32] |.define TMPD, [sp, #24] // 64 bit values |.define SAVE_L, [sp, #16] |.define SAVE_PC, [sp, #8] |.define SAVE_CFRAME, [sp, #0] |//----- 16 byte aligned, <-- sp while in interpreter. | |.define TMPDofs, #24 | |.if WIN |// Windows unwind data is suited to r1 stored first. |.macro stp_unwind, r1, r2, where | stp r1, r2, where |.endmacro |.macro ldp_unwind, r1, r2, where | ldp r1, r2, where |.endmacro |.macro ldp_unwind, r1, r2, where, post_index | ldp r1, r2, where, post_index |.endmacro |.else |// Otherwise store r2 first for compact unwind info (OSX). |.macro stp_unwind, r1, r2, where | stp r2, r1, where |.endmacro |.macro ldp_unwind, r1, r2, where | ldp r2, r1, where |.endmacro |.macro ldp_unwind, r1, r2, where, post_index | ldp r2, r1, where, post_index |.endmacro |.endif | |.macro save_, gpr1, gpr2, fpr1, fpr2 | stp_unwind d..fpr1, d..fpr2, [sp, # SAVE_FPR_+(14-fpr1)*8] | stp_unwind x..gpr1, x..gpr2, [sp, # SAVE_GPR_+(27-gpr1)*8] |.endmacro |.macro rest_, gpr1, gpr2, fpr1, fpr2 | ldp_unwind d..fpr1, d..fpr2, [sp, # SAVE_FPR_+(14-fpr1)*8] | ldp_unwind x..gpr1, x..gpr2, [sp, # SAVE_GPR_+(27-gpr1)*8] |.endmacro | |.macro saveregs | sp_auth | sub sp, sp, # CFRAME_SPACE | stp fp, lr, [sp, # SAVE_FP_LR_] | add fp, sp, # SAVE_FP_LR_ | stp_unwind x19, x20, [sp, # SAVE_GPR_+(27-19)*8] | save_ 21, 22, 8, 9 | save_ 23, 24, 10, 11 | save_ 25, 26, 12, 13 | save_ 27, 28, 14, 15 |.endmacro |.macro restoreregs | ldp_unwind x19, x20, [sp, # SAVE_GPR_+(27-19)*8] | rest_ 21, 22, 8, 9 | rest_ 23, 24, 10, 11 | rest_ 25, 26, 12, 13 | rest_ 27, 28, 14, 15 | ldp fp, lr, [sp, # SAVE_FP_LR_] | add sp, sp, # CFRAME_SPACE |.endmacro | |// Type definitions. Some of these are only used for documentation. |.type L, lua_State, LREG |.type GL, global_State, GLREG |.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 |.type SBUF, SBuf | |//----------------------------------------------------------------------- | |// Trap for not-yet-implemented parts. |.macro NYI; brk; .endmacro | |//----------------------------------------------------------------------- | |// Access to frame relative to BASE. |.define FRAME_FUNC, #-16 |.define FRAME_PC, #-8 | |// Endian-specific defines. |.if ENDIAN_LE |.define LO, 0 |.define OFS_RD, 2 |.define OFS_RB, 3 |.define OFS_RA, 1 |.define OFS_OP, 0 |.else |.define LO, 4 |.define OFS_RD, 0 |.define OFS_RB, 0 |.define OFS_RA, 2 |.define OFS_OP, 3 |.endif | |.macro decode_RA, dst, ins; ubfx dst, ins, #8, #8; .endmacro |.macro decode_RB, dst, ins; ubfx dst, ins, #24, #8; .endmacro |.macro decode_RC, dst, ins; ubfx dst, ins, #16, #8; .endmacro |.macro decode_RD, dst, ins; ubfx dst, ins, #16, #16; .endmacro |.macro decode_RC8RD, dst, src; ubfiz dst, src, #3, #8; .endmacro | |// Instruction decode+dispatch. |.macro ins_NEXT | ldr INSw, [PC], #4 | add TMP1, GL, INS, uxtb #3 | decode_RA RA, INS | ldr TMP0, [TMP1, #GG_G2DISP] | decode_RD RC, INS | br_auth TMP0 |.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). | .macro ins_next | b ->ins_next | .endmacro | .macro ins_next_ | ->ins_next: | ins_NEXT | .endmacro |.endif | |// Call decode and dispatch. |.macro ins_callt | // BASE = new base, CARG3 = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC | ldr PC, LFUNC:CARG3->pc | ldr INSw, [PC], #4 | add TMP1, GL, INS, uxtb #3 | decode_RA RA, INS | ldr TMP0, [TMP1, #GG_G2DISP] | add RA, BASE, RA, lsl #3 | br_auth TMP0 |.endmacro | |.macro ins_call | // BASE = new base, CARG3 = LFUNC/CFUNC, RC = nargs*8, PC = caller PC | str PC, [BASE, FRAME_PC] | ins_callt |.endmacro | |//----------------------------------------------------------------------- | |// Macros to check the TValue type and extract the GCobj. Branch on failure. |.macro checktp, reg, tp, target | asr ITYPE, reg, #47 | cmn ITYPE, #-tp | and reg, reg, #LJ_GCVMASK | bne target |.endmacro |.macro checktp, dst, reg, tp, target | asr ITYPE, reg, #47 | cmn ITYPE, #-tp | and dst, reg, #LJ_GCVMASK | bne target |.endmacro |.macro checkstr, reg, target; checktp reg, LJ_TSTR, target; .endmacro |.macro checktab, reg, target; checktp reg, LJ_TTAB, target; .endmacro |.macro checkfunc, reg, target; checktp reg, LJ_TFUNC, target; .endmacro |.macro checkint, reg, target | cmp TISNUMhi, reg, lsr #32 | bne target |.endmacro |.macro checknum, reg, target | cmp TISNUMhi, reg, lsr #32 | bls target |.endmacro |.macro checknumber, reg, target | cmp TISNUMhi, reg, lsr #32 | blo target |.endmacro | |.macro init_constants | movn TISNIL, #0 | movz TISNUM, #(LJ_TISNUM>>1)&0xffff, lsl #48 | movz TISNUMhi, #(LJ_TISNUM>>1)&0xffff, lsl #16 |.endmacro | |.macro mov_false, reg; movn reg, #0x8000, lsl #32; .endmacro |.macro mov_true, reg; movn reg, #0x0001, lsl #48; .endmacro |.macro mov_nil, reg; mov reg, TISNIL; .endmacro |.macro cmp_nil, reg; cmp reg, TISNIL; .endmacro |.macro add_TISNUM, dst, src; add dst, src, TISNUM; .endmacro | #define GL_J(field) (GG_G2J + (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 | add CARG1, CARG1, #GG_G2DISP+GG_DISP2HOT | ldrh CARG2w, [GL, CARG1] | subs CARG2, CARG2, #delta | strh CARG2w, [GL, 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; movn reg, #LJ_VMST_..st; .endmacro |.macro st_vmstate, reg; str reg, GL->vmstate; .endmacro | |// Move table write barrier back. Overwrites mark and tmp. |.macro barrierback, tab, mark, tmp | ldr tmp, GL->gc.grayagain | and mark, mark, #~LJ_GC_BLACK // black2gray(tab) | str tab, GL->gc.grayagain | strb mark, tab->marked | str tmp, tab->gclist |.endmacro | |//----------------------------------------------------------------------- #if !LJ_DUALNUM #error "Only dual-number mode supported for ARM64 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. | tbz PC, #2, ->cont_dispatch // (PC & FRAME_P) == 0? | | // Return from pcall or xpcall fast func. | ldr PC, [RB, FRAME_PC] // Fetch PC of previous frame. | mov_true TMP0 | mov BASE, RB | // Prepending may overwrite the pcall frame, so do it at the end. | str TMP0, [RA, #-8]! // Prepend true to results. | |->vm_returnc: | adds RC, RC, #8 // RC = (nresults+1)*8. | mov CRET1, #LUA_YIELD | beq ->vm_unwind_c_eh | str RCw, 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 | and RB, PC, #~FRAME_TYPEP | cmp CARG1, #FRAME_C | sub RB, BASE, RB // RB = previous base. | bne ->vm_returnp | | str RB, L->base | ldrsw CARG2, SAVE_NRES // CARG2 = nresults+1. | mv_vmstate TMP0w, C | sub BASE, BASE, #16 | subs TMP2, RC, #8 | st_vmstate TMP0w | beq >2 |1: | subs TMP2, TMP2, #8 | ldr TMP0, [RA], #8 | str TMP0, [BASE], #8 | bne <1 |2: | cmp RC, CARG2, lsl #3 // 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_auth | |6: | bgt >7 // Less results wanted? | // More results wanted. Check stack size and fill up results with nil. | ldr CARG3, L->maxstack | cmp BASE, CARG3 | bhs >8 | str TISNIL, [BASE], #8 | add RC, RC, #8 | b <2 | |7: // Less results wanted. | cbz CARG2, <3 // LUA_MULTRET+1 case? | sub CARG1, RC, CARG2, lsl #3 | sub BASE, BASE, CARG1 // Shrink top. | 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). | mov CARG1, L | bl extern lj_state_growstack // (lua_State *L, int n) | ldr BASE, L->top // Need the (realloced) L->top in BASE. | ldrsw CARG2, SAVE_NRES | b <2 | |->vm_unwind_c: // Unwind C stack, return from vm_pcall. | // (void *cframe, int errcode) | add fp, CARG1, # SAVE_FP_LR_ | mov sp, CARG1 | mov CRET1, CARG2 | ldr L, SAVE_L | ldr GL, L->glref |->vm_unwind_c_eh: // Landing pad for external unwinder. | mv_vmstate TMP0w, C | st_vmstate TMP0w | b ->vm_leave_unw | |->vm_unwind_ff: // Unwind C stack, return from ff pcall. | // (void *cframe) | add fp, CARG1, # SAVE_FP_LR_ | mov sp, CARG1 | ldr L, SAVE_L | init_constants | ldr GL, L->glref // Setup pointer to global state. |->vm_unwind_ff_eh: // Landing pad for external unwinder. | mov RC, #16 // 2 results: false + error message. | ldr BASE, L->base | mov_false TMP0 | sub RA, BASE, #8 // Results start at BASE-8. | ldr PC, [BASE, FRAME_PC] // Fetch PC of previous frame. | str TMP0, [BASE, #-8] // Prepend false to error message. | st_vmstate ST_INTERP | 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 | stp BASE, RC, L->base | add PC, PC, #4 // Must point after first instruction. | 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) | ldp BASE, RC, L->base | ldr LFUNC:CARG3, [BASE, FRAME_FUNC] | sub NARGS8:RC, RC, BASE | and LFUNC:CARG3, CARG3, #LJ_GCVMASK | // 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 GL, L->glref // Setup pointer to global state. | mov BASE, CARG2 | str L, SAVE_L | mov PC, #FRAME_CP | str wzr, SAVE_NRES | add TMP0, sp, #CFRAME_RESUME | ldrb TMP1w, L->status | str wzr, SAVE_ERRF | str L, SAVE_PC // Any value outside of bytecode is ok. | str xzr, SAVE_CFRAME | str TMP0, L->cframe | cbz TMP1w, >3 | | // Resume after yield (like a return). | str L, GL->cur_L | mov RA, BASE | ldp BASE, CARG1, L->base | init_constants | ldr PC, [BASE, FRAME_PC] | strb wzr, L->status | sub RC, CARG1, BASE | ands CARG1, PC, #FRAME_TYPE | add RC, RC, #8 | st_vmstate ST_INTERP | str RCw, 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 CARG4w, 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 CARG3w, SAVE_NRES | mov L, CARG1 | str CARG1, SAVE_L | ldr GL, L->glref // Setup pointer to global state. | mov BASE, CARG2 | str CARG1, SAVE_PC // Any value outside of bytecode is ok. | add TMP0, sp, #0 | str RC, SAVE_CFRAME | str TMP0, L->cframe // Add our C frame to cframe chain. | |3: // Entry point for vm_cpcall/vm_resume (BASE = base, PC = ftype). | str L, GL->cur_L | ldp RB, CARG1, L->base // RB = old base (for vmeta_call). | add PC, PC, BASE | init_constants | sub PC, PC, RB // PC = frame delta + frame type | sub NARGS8:RC, CARG1, BASE | st_vmstate ST_INTERP | |->vm_call_dispatch: | // RB = old base, BASE = new base, RC = nargs*8, PC = caller PC | ldr CARG3, [BASE, FRAME_FUNC] | checkfunc CARG3, ->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 GL, L->glref // Setup pointer to global state. | 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 RAw, SAVE_NRES // Neg. delta means cframe w/o frame. | str wzr, SAVE_ERRF // No error function. | add TMP0, sp, #0 | str RC, SAVE_CFRAME | str TMP0, L->cframe // Add our C frame to cframe chain. | str L, GL->cur_L | blr_auth CARG4 // (lua_State *L, lua_CFunction func, void *ud) | mov BASE, CRET1 | mov PC, #FRAME_CP | cbnz BASE, <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, #-32] // Get continuation. | mov CARG4, BASE | mov BASE, RB // Restore caller BASE. | and LFUNC:CARG3, CARG3, #LJ_GCVMASK |.if FFI | cmp CARG1, #1 |.endif | ldr PC, [CARG4, #-24] // Restore PC from [cont|PC]. | add TMP0, RA, RC | str TISNIL, [TMP0, #-8] // Ensure one valid arg. |.if FFI | bls >1 |.endif | ldr CARG3, LFUNC:CARG3->pc | ldr KBASE, [CARG3, #PC2PROTO(k)] | // BASE = base, RA = resultptr, CARG4 = meta base | br_auth CARG1 | |.if FFI |1: | beq ->cont_ffi_callback // cont = 1: return from FFI callback. | // cont = 0: tailcall from C function. | sub CARG4, CARG4, #32 | sub RC, CARG4, BASE | b ->vm_call_tail |.endif | |->cont_cat: // RA = resultptr, CARG4 = meta base | ldr INSw, [PC, #-4] | sub CARG2, CARG4, #32 | ldr TMP0, [RA] | str BASE, L->base | decode_RB RB, INS | decode_RA RA, INS | add TMP1, BASE, RB, lsl #3 | subs TMP1, CARG2, TMP1 | beq >1 | str TMP0, [CARG2] | lsr CARG3, TMP1, #3 | b ->BC_CAT_Z | |1: | str TMP0, [BASE, RA, lsl #3] | b ->cont_nop | |//-- Table indexing metamethods ----------------------------------------- | |->vmeta_tgets1: | movn CARG4, #~LJ_TSTR | add CARG2, BASE, RB, lsl #3 | add CARG4, STR:RC, CARG4, lsl #47 | b >2 | |->vmeta_tgets: | movk CARG2, #(LJ_TTAB>>1)&0xffff, lsl #48 | str CARG2, GL->tmptv | add CARG2, GL, #offsetof(global_State, tmptv) |2: | add CARG3, sp, TMPDofs | str CARG4, TMPD | b >1 | |->vmeta_tgetb: // RB = table, RC = index | add_TISNUM RC, RC | add CARG2, BASE, RB, lsl #3 | add CARG3, sp, TMPDofs | str RC, TMPD | b >1 | |->vmeta_tgetv: // RB = table, RC = key | add CARG2, BASE, RB, lsl #3 | add CARG3, BASE, RC, lsl #3 |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). | cbz CRET1, >3 | ldr TMP0, [CRET1] | str TMP0, [BASE, RA, lsl #3] | ins_next | |3: // Call __index metamethod. | // BASE = base, L->top = new base, stack = cont/func/t/k | sub TMP1, BASE, #FRAME_CONT | ldr BASE, L->top | mov NARGS8:RC, #16 // 2 args for func(t, k). | ldr LFUNC:CARG3, [BASE, FRAME_FUNC] // Guaranteed to be a function here. | str PC, [BASE, #-24] // [cont|PC] | sub PC, BASE, TMP1 | and LFUNC:CARG3, CARG3, #LJ_GCVMASK | b ->vm_call_dispatch_f | |->vmeta_tgetr: | sxtw CARG2, TMP1w | bl extern lj_tab_getinth // (GCtab *t, int32_t key) | // Returns cTValue * or NULL. | mov_nil TMP0 | cbz CRET1, ->BC_TGETR_Z | ldr TMP0, [CRET1] | b ->BC_TGETR_Z | |//----------------------------------------------------------------------- | |->vmeta_tsets1: | movn CARG4, #~LJ_TSTR | add CARG2, BASE, RB, lsl #3 | add CARG4, STR:RC, CARG4, lsl #47 | b >2 | |->vmeta_tsets: | movk CARG2, #(LJ_TTAB>>1)&0xffff, lsl #48 | str CARG2, GL->tmptv | add CARG2, GL, #offsetof(global_State, tmptv) |2: | add CARG3, sp, TMPDofs | str CARG4, TMPD | b >1 | |->vmeta_tsetb: // RB = table, RC = index | add_TISNUM RC, RC | add CARG2, BASE, RB, lsl #3 | add CARG3, sp, TMPDofs | str RC, TMPD | b >1 | |->vmeta_tsetv: | add CARG2, BASE, RB, lsl #3 | add CARG3, BASE, RC, lsl #3 |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). | ldr TMP0, [BASE, RA, lsl #3] | cbz CRET1, >3 | // NOBARRIER: lj_meta_tset ensures the table is not black. | str TMP0, [CRET1] | ins_next | |3: // Call __newindex metamethod. | // BASE = base, L->top = new base, stack = cont/func/t/k/(v) | sub TMP1, BASE, #FRAME_CONT | ldr BASE, L->top | mov NARGS8:RC, #24 // 3 args for func(t, k, v). | ldr LFUNC:CARG3, [BASE, FRAME_FUNC] // Guaranteed to be a function here. | str TMP0, [BASE, #16] // Copy value to third argument. | str PC, [BASE, #-24] // [cont|PC] | sub PC, BASE, TMP1 | and LFUNC:CARG3, CARG3, #LJ_GCVMASK | b ->vm_call_dispatch_f | |->vmeta_tsetr: | sxtw CARG3, TMP1w | str BASE, L->base | mov CARG1, L | str PC, SAVE_PC | bl extern lj_tab_setinth // (lua_State *L, GCtab *t, int32_t key) | // Returns TValue *. | b ->BC_TSETR_Z | |//-- Comparison metamethods --------------------------------------------- | |->vmeta_comp: | add CARG2, BASE, RA, lsl #3 | sub PC, PC, #4 | add CARG3, BASE, RC, lsl #3 | str BASE, L->base | mov CARG1, L | str PC, SAVE_PC | uxtb CARG4w, INSw | bl extern lj_meta_comp // (lua_State *L, TValue *o1, *o2, int op) | // Returns 0/1 or TValue * (metamethod). |3: | cmp CRET1, #1 | bhi ->vmeta_binop |4: | ldrh RBw, [PC, # OFS_RD] | add PC, PC, #4 | add RB, PC, RB, lsl #2 | sub RB, RB, #0x20000 | csel PC, PC, RB, lo |->cont_nop: | ins_next | |->cont_ra: // RA = resultptr | ldr INSw, [PC, #-4] | ldr TMP0, [RA] | decode_RA TMP1, INS | str TMP0, [BASE, TMP1, lsl #3] | b ->cont_nop | |->cont_condt: // RA = resultptr | ldr TMP0, [RA] | mov_true TMP1 | cmp TMP1, TMP0 // Branch if result is true. | b <4 | |->cont_condf: // RA = resultptr | ldr TMP0, [RA] | mov_false TMP1 | cmp TMP0, TMP1 // Branch if result is false. | b <4 | |->vmeta_equal: | // CARG2, CARG3, CARG4 are already set by BC_ISEQV/BC_ISNEV. | and TAB:CARG3, CARG3, #LJ_GCVMASK | 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 | |->vmeta_istype: | sub PC, PC, #4 | str BASE, L->base | mov CARG1, L | mov CARG2, RA | mov CARG3, RC | str PC, SAVE_PC | bl extern lj_meta_istype // (lua_State *L, BCReg ra, BCReg tp) | b ->cont_nop | |//-- Arithmetic metamethods --------------------------------------------- | |->vmeta_arith_vn: | add CARG3, BASE, RB, lsl #3 | add CARG4, KBASE, RC, lsl #3 | b >1 | |->vmeta_arith_nv: | add CARG4, BASE, RB, lsl #3 | add CARG3, KBASE, RC, lsl #3 | b >1 | |->vmeta_unm: | add CARG3, BASE, RC, lsl #3 | mov CARG4, CARG3 | b >1 | |->vmeta_arith_vv: | add CARG3, BASE, RB, lsl #3 | add CARG4, BASE, RC, lsl #3 |1: | uxtb CARG5w, INSw | add CARG2, BASE, RA, lsl #3 | str BASE, L->base | mov CARG1, L | str PC, SAVE_PC | bl extern lj_meta_arith // (lua_State *L, TValue *ra,*rb,*rc, BCReg op) | // Returns NULL (finished) or TValue * (metamethod). | cbz CRET1, ->cont_nop | | // Call metamethod for binary op. |->vmeta_binop: | // BASE = old base, CRET1 = new base, stack = cont/func/o1/o2 | sub TMP1, CRET1, BASE | str PC, [CRET1, #-24] // [cont|PC] | add PC, TMP1, #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, lsl #3 #if LJ_52 | mov TAB:RC, TAB:CARG1 // Save table (ignored for other types). #endif | 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). #if LJ_52 | cbnz CRET1, ->vmeta_binop // Binop call for compatibility. | mov TAB:CARG1, TAB: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, #16 | str PC, SAVE_PC | add CARG3, BASE, NARGS8:RC | bl extern lj_meta_call // (lua_State *L, TValue *func, TValue *top) | ldr LFUNC:CARG3, [BASE, FRAME_FUNC] // Guaranteed to be a function here. | add NARGS8:RC, NARGS8:RC, #8 // Got one more argument now. | and LFUNC:CARG3, CARG3, #LJ_GCVMASK | 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, #16 | str PC, SAVE_PC | add CARG3, RA, NARGS8:RC | bl extern lj_meta_call // (lua_State *L, TValue *func, TValue *top) | ldr TMP1, [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. | and LFUNC:CARG3, TMP1, #LJ_GCVMASK | 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) | ldr INSw, [PC, #-4] |.if JIT | uxtb TMP0w, INSw |.endif | decode_RA RA, INS | decode_RD RC, INS |.if JIT | cmp TMP0, #BC_JFORI | beq =>BC_JFORI |.endif | b =>BC_FORI | |//----------------------------------------------------------------------- |//-- Fast functions ----------------------------------------------------- |//----------------------------------------------------------------------- | |.macro .ffunc, name |->ff_ .. name: |.endmacro | |.macro .ffunc_1, name |->ff_ .. name: | ldr CARG1, [BASE] | cmp NARGS8:RC, #8 | blo ->fff_fallback |.endmacro | |.macro .ffunc_2, name |->ff_ .. name: | ldp CARG1, CARG2, [BASE] | cmp NARGS8:RC, #16 | blo ->fff_fallback |.endmacro | |.macro .ffunc_n, name | .ffunc name | ldr CARG1, [BASE] | cmp NARGS8:RC, #8 | ldr FARG1, [BASE] | blo ->fff_fallback | checknum CARG1, ->fff_fallback |.endmacro | |.macro .ffunc_nn, name | .ffunc name | ldp CARG1, CARG2, [BASE] | cmp NARGS8:RC, #16 | ldp FARG1, FARG2, [BASE] | blo ->fff_fallback | checknum CARG1, ->fff_fallback | checknum CARG2, ->fff_fallback |.endmacro | |// Inlined GC threshold check. Caveat: uses CARG1 and CARG2. |.macro ffgccheck | ldp CARG1, CARG2, GL->gc.total // Assumes threshold follows total. | cmp CARG1, CARG2 | blt >1 | bl ->fff_gcstep |1: |.endmacro | |//-- Base library: checks ----------------------------------------------- | |.ffunc_1 assert | ldr PC, [BASE, FRAME_PC] | mov_false TMP1 | cmp CARG1, TMP1 | bhs ->fff_fallback | str CARG1, [BASE, #-16] | sub RB, BASE, #8 | subs RA, NARGS8:RC, #8 | add RC, NARGS8:RC, #8 // Compute (nresults+1)*8. | cbz RA, ->fff_res // Done if exactly 1 argument. |1: | ldr CARG1, [RB, #16] | sub RA, RA, #8 | str CARG1, [RB], #8 | cbnz RA, <1 | b ->fff_res | |.ffunc_1 type | mov TMP0, #~LJ_TISNUM | asr ITYPE, CARG1, #47 | cmn ITYPE, #~LJ_TISNUM | csinv TMP1, TMP0, ITYPE, lo | add TMP1, TMP1, #offsetof(GCfuncC, upvalue)/8 | ldr CARG1, [CFUNC:CARG3, TMP1, lsl #3] | b ->fff_restv | |//-- Base library: getters and setters --------------------------------- | |.ffunc_1 getmetatable | asr ITYPE, CARG1, #47 | cmn ITYPE, #-LJ_TTAB | ccmn ITYPE, #-LJ_TUDATA, #4, ne | and TAB:CARG1, CARG1, #LJ_GCVMASK | bne >6 |1: // Field metatable must be at same offset for GCtab and GCudata! | ldr TAB:RB, TAB:CARG1->metatable |2: | mov_nil CARG1 | ldr STR:RC, GL->gcroot[GCROOT_MMNAME+MM_metatable] | cbz TAB:RB, ->fff_restv | ldr TMP1w, TAB:RB->hmask | ldr TMP2w, STR:RC->sid | ldr NODE:CARG3, TAB:RB->node | and TMP1w, TMP1w, TMP2w // idx = str->sid & tab->hmask | add TMP1, TMP1, TMP1, lsl #1 | movn CARG4, #~LJ_TSTR | add NODE:CARG3, NODE:CARG3, TMP1, lsl #3 // node = tab->node + idx*3*8 | add CARG4, STR:RC, CARG4, lsl #47 // Tagged key to look for. |3: // Rearranged logic, because we expect _not_ to find the key. | ldp CARG1, TMP0, NODE:CARG3->val | ldr NODE:CARG3, NODE:CARG3->next | cmp TMP0, CARG4 | beq >5 | cbnz NODE:CARG3, <3 |4: | mov CARG1, RB // Use metatable as default result. | movk CARG1, #(LJ_TTAB>>1)&0xffff, lsl #48 | b ->fff_restv |5: | cmp_nil TMP0 | bne ->fff_restv | b <4 | |6: | movn TMP0, #~LJ_TISNUM | cmp ITYPE, TMP0 | csel ITYPE, ITYPE, TMP0, hs | sub TMP1, GL, ITYPE, lsl #3 | ldr TAB:RB, [TMP1, #offsetof(global_State, gcroot[GCROOT_BASEMT])-8] | b <2 | |.ffunc_2 setmetatable | // Fast path: no mt for table yet and not clearing the mt. | checktp TMP1, CARG1, LJ_TTAB, ->fff_fallback | ldr TAB:TMP0, TAB:TMP1->metatable | asr ITYPE, CARG2, #47 | ldrb TMP2w, TAB:TMP1->marked | cmn ITYPE, #-LJ_TTAB | and TAB:CARG2, CARG2, #LJ_GCVMASK | ccmp TAB:TMP0, #0, #0, eq | bne ->fff_fallback | str TAB:CARG2, TAB:TMP1->metatable | tbz TMP2w, #2, ->fff_restv // isblack(table) | barrierback TAB:TMP1, TMP2w, TMP0 | b ->fff_restv | |.ffunc rawget | ldr CARG2, [BASE] | cmp NARGS8:RC, #16 | blo ->fff_fallback | checktab CARG2, ->fff_fallback | mov CARG1, L | add CARG3, BASE, #8 | bl extern lj_tab_get // (lua_State *L, GCtab *t, cTValue *key) | // Returns cTValue *. | ldr CARG1, [CRET1] | b ->fff_restv | |//-- Base library: conversions ------------------------------------------ | |.ffunc tonumber | // Only handles the number case inline (without a base argument). | ldr CARG1, [BASE] | cmp NARGS8:RC, #8 | bne ->fff_fallback | checknumber CARG1, ->fff_fallback | b ->fff_restv | |.ffunc_1 tostring | // Only handles the string or number case inline. | asr ITYPE, CARG1, #47 | cmn ITYPE, #-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 TMP1, GL->gcroot[GCROOT_BASEMT_NUM] | str BASE, L->base | cmn ITYPE, #-LJ_TISNUM | ccmp TMP1, #0, #0, ls | str PC, SAVE_PC // Redundant (but a defined value). | bne ->fff_fallback | ffgccheck | mov CARG1, L | mov CARG2, BASE | bl extern lj_strfmt_number // (lua_State *L, cTValue *o) | // Returns GCstr *. | movn TMP1, #~LJ_TSTR | ldr BASE, L->base | add CARG1, CARG1, TMP1, lsl #47 | b ->fff_restv | |//-- Base library: iterators ------------------------------------------- | |.ffunc_1 next | checktp CARG1, LJ_TTAB, ->fff_fallback | str TISNIL, [BASE, NARGS8:RC] // Set missing 2nd arg to nil. | ldr PC, [BASE, FRAME_PC] | add CARG2, BASE, #8 | sub CARG3, BASE, #16 | bl extern lj_tab_next // (GCtab *t, cTValue *key, TValue *o) | // Returns 1=found, 0=end, -1=error. | mov RC, #(2+1)*8 | tbnz CRET1w, #31, ->fff_fallback // Invalid key. | cbnz CRET1, ->fff_res // Found key/value. | // End of traversal: return nil. | str TISNIL, [BASE, #-16] | b ->fff_res1 | |.ffunc_1 pairs | checktp TMP1, CARG1, LJ_TTAB, ->fff_fallback #if LJ_52 | ldr TAB:CARG2, TAB:TMP1->metatable #endif | ldr CFUNC:CARG4, CFUNC:CARG3->upvalue[0] | ldr PC, [BASE, FRAME_PC] #if LJ_52 | cbnz TAB:CARG2, ->fff_fallback #endif | mov RC, #(3+1)*8 | stp CFUNC:CARG4, CARG1, [BASE, #-16] | str TISNIL, [BASE] | b ->fff_res | |.ffunc_2 ipairs_aux | checktab CARG1, ->fff_fallback | checkint CARG2, ->fff_fallback | ldr TMP1w, TAB:CARG1->asize | ldr CARG3, TAB:CARG1->array | ldr TMP0w, TAB:CARG1->hmask | add CARG2w, CARG2w, #1 | cmp CARG2w, TMP1w | ldr PC, [BASE, FRAME_PC] | add_TISNUM TMP2, CARG2 | mov RC, #(0+1)*8 | str TMP2, [BASE, #-16] | bhs >2 // Not in array part? | ldr TMP0, [CARG3, CARG2, lsl #3] |1: | mov TMP1, #(2+1)*8 | cmp_nil TMP0 | str TMP0, [BASE, #-8] | csel RC, RC, TMP1, eq | b ->fff_res |2: // Check for empty hash part first. Otherwise call C function. | cbz TMP0w, ->fff_res | bl extern lj_tab_getinth // (GCtab *t, int32_t key) | // Returns cTValue * or NULL. | cbz CRET1, ->fff_res | ldr TMP0, [CRET1] | b <1 | |.ffunc_1 ipairs | checktp TMP1, CARG1, LJ_TTAB, ->fff_fallback #if LJ_52 | ldr TAB:CARG2, TAB:TMP1->metatable #endif | ldr CFUNC:CARG4, CFUNC:CARG3->upvalue[0] | ldr PC, [BASE, FRAME_PC] #if LJ_52 | cbnz TAB:CARG2, ->fff_fallback #endif | mov RC, #(3+1)*8 | stp CFUNC:CARG4, CARG1, [BASE, #-16] | str TISNUM, [BASE] | b ->fff_res | |//-- Base library: catch errors ---------------------------------------- | |.ffunc pcall | ldr TMP1, L->maxstack | add TMP2, BASE, NARGS8:RC | cmp TMP1, TMP2 | blo ->fff_fallback | cmp NARGS8:RC, #8 | ldrb TMP0w, GL->hookmask | blo ->fff_fallback | sub NARGS8:RC, NARGS8:RC, #8 | mov RB, BASE | add BASE, BASE, #16 | ubfx TMP0w, TMP0w, #HOOK_ACTIVE_SHIFT, #1 | add PC, TMP0, #16+FRAME_PCALL | beq ->vm_call_dispatch |1: | add TMP2, BASE, NARGS8:RC |2: | ldr TMP0, [TMP2, #-16] | str TMP0, [TMP2, #-8]! | cmp TMP2, BASE | bne <2 | b ->vm_call_dispatch | |.ffunc xpcall | ldr TMP1, L->maxstack | add TMP2, BASE, NARGS8:RC | cmp TMP1, TMP2 | blo ->fff_fallback | ldp CARG1, CARG2, [BASE] | ldrb TMP0w, GL->hookmask | subs NARGS8:TMP1, NARGS8:RC, #16 | blo ->fff_fallback | mov RB, BASE | asr ITYPE, CARG2, #47 | ubfx TMP0w, TMP0w, #HOOK_ACTIVE_SHIFT, #1 | cmn ITYPE, #-LJ_TFUNC | add PC, TMP0, #24+FRAME_PCALL | bne ->fff_fallback // Traceback must be a function. | mov NARGS8:RC, NARGS8:TMP1 | add BASE, BASE, #24 | stp CARG2, CARG1, [RB] // Swap function and traceback. | cbz NARGS8:RC, ->vm_call_dispatch | b <1 | |//-- Coroutine library -------------------------------------------------- | |.macro coroutine_resume_wrap, resume |.if resume |.ffunc_1 coroutine_resume | checktp CARG1, LJ_TTHREAD, ->fff_fallback |.else |.ffunc coroutine_wrap_aux | ldr L:CARG1, CFUNC:CARG3->upvalue[0].gcr | and L:CARG1, CARG1, #LJ_GCVMASK |.endif | ldr PC, [BASE, FRAME_PC] | str BASE, L->base | ldp RB, CARG2, L:CARG1->base | ldrb TMP1w, L:CARG1->status | add TMP0, CARG2, TMP1 | str PC, SAVE_PC | cmp TMP0, RB | beq ->fff_fallback | cmp TMP1, #LUA_YIELD | add TMP0, CARG2, #8 | csel CARG2, CARG2, TMP0, hs | ldr CARG4, L:CARG1->maxstack | add CARG3, CARG2, NARGS8:RC | ldr RB, L:CARG1->cframe | ccmp CARG3, CARG4, #2, ls | ccmp RB, #0, #2, ls | bhi ->fff_fallback |.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 | cbz NARGS8:RC, >3 |2: // Move args to coroutine. | ldr TMP0, [BASE, RB] | cmp RB, NARGS8:RC | str TMP0, [CARG2, RB] | add RB, RB, #8 | bne <2 |3: | 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: | ldp CARG3, CARG4, L:RA->base | cmp CRET1, #LUA_YIELD | ldr BASE, L->base | str L, GL->cur_L | st_vmstate ST_INTERP | bhi >8 | sub RC, CARG4, CARG3 | ldr CARG1, L->maxstack | add CARG2, BASE, RC | cbz RC, >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. | ldr TMP0, [CARG3, RB] | cmp RB, CARG4 | str TMP0, [BASE, RB] | add RB, RB, #8 | bne <5 |6: |.if resume | mov_true TMP1 | add RC, RC, #16 |7: | str TMP1, [BASE, #-8] // 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 RCw, SAVE_MULTRES | beq ->BC_RET_Z | b ->vm_return | |8: // Coroutine returned with error (at co->top-1). |.if resume | ldr TMP0, [CARG4, #-8]! | mov_false TMP1 | mov RC, #(2+1)*8 | str CARG4, L:RA->top // Remove error from coroutine stack. | str TMP0, [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 TMP0, L->cframe | add TMP1, BASE, NARGS8:RC | mov CRET1, #LUA_YIELD | stp BASE, TMP1, L->base | tbz TMP0, #0, ->fff_fallback | str xzr, L->cframe | strb CRET1w, L->status | b ->vm_leave_unw | |//-- Math library ------------------------------------------------------- | |.macro math_round, func, round | .ffunc math_ .. func | ldr CARG1, [BASE] | cmp NARGS8:RC, #8 | ldr d0, [BASE] | blo ->fff_fallback | cmp TISNUMhi, CARG1, lsr #32 | beq ->fff_restv | blo ->fff_fallback | round d0, d0 | b ->fff_resn |.endmacro | | math_round floor, frintm | math_round ceil, frintp | |.ffunc_1 math_abs | checknumber CARG1, ->fff_fallback | and CARG1, CARG1, #U64x(7fffffff,ffffffff) | bne ->fff_restv | eor CARG2w, CARG1w, CARG1w, asr #31 | movz CARG3, #0x41e0, lsl #48 // 2^31. | subs CARG1w, CARG2w, CARG1w, asr #31 | add_TISNUM CARG1, CARG1 | csel CARG1, CARG1, CARG3, pl | // Fallthrough. | |->fff_restv: | // CARG1 = TValue result. | ldr PC, [BASE, FRAME_PC] | str CARG1, [BASE, #-16] |->fff_res1: | // PC = return. | mov RC, #(1+1)*8 |->fff_res: | // RC = (nresults+1)*8, PC = return. | ands CARG1, PC, #FRAME_TYPE | str RCw, SAVE_MULTRES | sub RA, BASE, #16 | bne ->vm_return | ldr INSw, [PC, #-4] | decode_RB RB, INS |5: | cmp RC, RB, lsl #3 // More results expected? | blo >6 | decode_RA TMP1, INS | // Adjust BASE. KBASE is assumed to be set for the calling frame. | sub BASE, RA, TMP1, lsl #3 | ins_next | |6: // Fill up results with nil. | add TMP1, RA, RC | add RC, RC, #8 | str TISNIL, [TMP1, #-8] | b <5 | |.macro math_extern, func | .ffunc_n math_ .. func | bl extern func | b ->fff_resn |.endmacro | |.macro math_extern2, func | .ffunc_nn math_ .. func | bl extern func | b ->fff_resn |.endmacro | |.ffunc_n math_sqrt | fsqrt d0, d0 |->fff_resn: | ldr PC, [BASE, FRAME_PC] | str d0, [BASE, #-16] | b ->fff_res1 | |.ffunc math_log | ldr CARG1, [BASE] | cmp NARGS8:RC, #8 | ldr FARG1, [BASE] | bne ->fff_fallback // Need exactly 1 argument. | checknum CARG1, ->fff_fallback | bl extern 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 | |.ffunc_2 math_ldexp | ldr FARG1, [BASE] | checknum CARG1, ->fff_fallback | checkint CARG2, ->fff_fallback | sxtw CARG1, CARG2w | bl extern ldexp // (double x, int exp) | b ->fff_resn | |.ffunc_n math_frexp | add CARG1, sp, TMPDofs | bl extern frexp | ldr CARG2w, TMPD | ldr PC, [BASE, FRAME_PC] | str d0, [BASE, #-16] | mov RC, #(2+1)*8 | add_TISNUM CARG2, CARG2 | str CARG2, [BASE, #-8] | b ->fff_res | |.ffunc_n math_modf | sub CARG1, BASE, #16 | ldr PC, [BASE, FRAME_PC] | bl extern modf | mov RC, #(2+1)*8 | str d0, [BASE, #-8] | b ->fff_res | |.macro math_minmax, name, cond, fcond | .ffunc_1 name | add RB, BASE, RC | add RA, BASE, #8 | checkint CARG1, >4 |1: // Handle integers. | ldr CARG2, [RA] | cmp RA, RB | bhs ->fff_restv | checkint CARG2, >3 | cmp CARG1w, CARG2w | add RA, RA, #8 | csel CARG1, CARG2, CARG1, cond | b <1 |3: // Convert intermediate result to number and continue below. | scvtf d0, CARG1w | blo ->fff_fallback | ldr d1, [RA] | b >6 | |4: | ldr d0, [BASE] | blo ->fff_fallback |5: // Handle numbers. | ldr CARG2, [RA] | ldr d1, [RA] | cmp RA, RB | bhs ->fff_resn | checknum CARG2, >7 |6: | fcmp d0, d1 | add RA, RA, #8 | fcsel d0, d1, d0, fcond | b <5 |7: // Convert integer to number and continue above. | scvtf d1, CARG2w | blo ->fff_fallback | b <6 |.endmacro | | math_minmax math_min, gt, pl | math_minmax math_max, lt, le | |//-- String library ----------------------------------------------------- | |.ffunc string_byte // Only handle the 1-arg case here. | ldp PC, CARG1, [BASE, FRAME_PC] | cmp NARGS8:RC, #8 | asr ITYPE, CARG1, #47 | ccmn ITYPE, #-LJ_TSTR, #0, eq | and STR:CARG1, CARG1, #LJ_GCVMASK | bne ->fff_fallback | ldrb TMP0w, STR:CARG1[1] // Access is always ok (NUL at end). | ldr CARG3w, STR:CARG1->len | add_TISNUM TMP0, TMP0 | str TMP0, [BASE, #-16] | mov RC, #(0+1)*8 | cbz CARG3, ->fff_res | b ->fff_res1 | |.ffunc string_char // Only handle the 1-arg case here. | ffgccheck | ldp PC, CARG1, [BASE, FRAME_PC] | cmp CARG1w, #255 | ccmp NARGS8:RC, #8, #0, ls // Need exactly 1 argument. | bne ->fff_fallback | checkint CARG1, ->fff_fallback | mov CARG3, #1 | // Point to the char inside the integer in the stack slot. |.if ENDIAN_LE | mov CARG2, BASE |.else | add CARG2, BASE, #7 |.endif |->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) |->fff_resstr: | // Returns GCstr *. | ldr BASE, L->base | movn TMP1, #~LJ_TSTR | add CARG1, CARG1, TMP1, lsl #47 | b ->fff_restv | |.ffunc string_sub | ffgccheck | ldr CARG1, [BASE] | ldr CARG3, [BASE, #16] | cmp NARGS8:RC, #16 | movn RB, #0 | beq >1 | blo ->fff_fallback | checkint CARG3, ->fff_fallback | sxtw RB, CARG3w |1: | ldr CARG2, [BASE, #8] | checkstr CARG1, ->fff_fallback | ldr TMP1w, STR:CARG1->len | checkint CARG2, ->fff_fallback | sxtw CARG2, CARG2w | // CARG1 = str, TMP1 = str->len, CARG2 = start, RB = end | add TMP2, RB, TMP1 | cmp RB, #0 | add TMP0, CARG2, TMP1 | csinc RB, RB, TMP2, ge // if (end < 0) end += len+1 | cmp CARG2, #0 | csinc CARG2, CARG2, TMP0, ge // if (start < 0) start += len+1 | cmp RB, #0 | csel RB, RB, xzr, ge // if (end < 0) end = 0 | cmp CARG2, #1 | csinc CARG2, CARG2, xzr, ge // if (start < 1) start = 1 | cmp RB, TMP1 | csel RB, RB, TMP1, le // if (end > len) end = len | add CARG1, STR:CARG1, #sizeof(GCstr)-1 | subs CARG3, RB, CARG2 // len = end - start | add CARG2, CARG1, CARG2 | add CARG3, CARG3, #1 // len += 1 | bge ->fff_newstr | add STR:CARG1, GL, #offsetof(global_State, strempty) | movn TMP1, #~LJ_TSTR | add CARG1, CARG1, TMP1, lsl #47 | b ->fff_restv | |.macro ffstring_op, name | .ffunc string_ .. name | ffgccheck | ldr CARG2, [BASE] | cmp NARGS8:RC, #8 | asr ITYPE, CARG2, #47 | ccmn ITYPE, #-LJ_TSTR, #0, hs | and STR:CARG2, CARG2, #LJ_GCVMASK | bne ->fff_fallback | ldr TMP0, GL->tmpbuf.b | add SBUF:CARG1, GL, #offsetof(global_State, tmpbuf) | str BASE, L->base | str PC, SAVE_PC | str L, GL->tmpbuf.L | str TMP0, GL->tmpbuf.w | bl extern lj_buf_putstr_ .. name | bl extern lj_buf_tostr | b ->fff_resstr |.endmacro | |ffstring_op reverse |ffstring_op lower |ffstring_op upper | |//-- Bit library -------------------------------------------------------- | |// FP number to bit conversion. Clobbers CARG1-CARG2, FARG1-FARG2. |->vm_tobit_fb: | bls ->fff_fallback | fmov FARG1, CARG1 | movz CARG2, #0x4338, lsl #48 | fmov FARG2, CARG2 | fadd FARG1, FARG1, FARG2 | fmov CARG1w, s0 | br lr | |.macro .ffunc_bit, name | .ffunc_1 bit_..name | adr lr, >1 | checkint CARG1, ->vm_tobit_fb |1: |.endmacro | |.macro .ffunc_bit_op, name, ins | .ffunc_bit name | mov RA, #8 | mov TMP0w, CARG1w | adr lr, >2 |1: | ldr CARG1, [BASE, RA] | cmp RA, NARGS8:RC | add RA, RA, #8 | bge >9 | checkint CARG1, ->vm_tobit_fb |2: | ins TMP0w, TMP0w, CARG1w | b <1 |.endmacro | |.ffunc_bit_op band, and |.ffunc_bit_op bor, orr |.ffunc_bit_op bxor, eor | |.ffunc_bit tobit | mov TMP0w, CARG1w |9: // Label reused by .ffunc_bit_op users. | add_TISNUM CARG1, TMP0 | b ->fff_restv | |.ffunc_bit bswap | rev TMP0w, CARG1w | add_TISNUM CARG1, TMP0 | b ->fff_restv | |.ffunc_bit bnot | mvn TMP0w, CARG1w | add_TISNUM CARG1, TMP0 | b ->fff_restv | |.macro .ffunc_bit_sh, name, ins, shmod | .ffunc bit_..name | ldp TMP0, CARG1, [BASE] | cmp NARGS8:RC, #16 | blo ->fff_fallback | adr lr, >1 | checkint CARG1, ->vm_tobit_fb |1: |.if shmod == 0 | mov TMP1, CARG1 |.else | neg TMP1, CARG1 |.endif | mov CARG1, TMP0 | adr lr, >2 | checkint CARG1, ->vm_tobit_fb |2: | ins TMP0w, CARG1w, TMP1w | add_TISNUM CARG1, TMP0 | 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 | ldp CFUNC:CARG3, PC, [BASE, FRAME_FUNC] // Fallback may overwrite PC. | ldr TMP2, L->maxstack | add TMP1, BASE, NARGS8:RC | stp BASE, TMP1, L->base | and CFUNC:CARG3, CARG3, #LJ_GCVMASK | add TMP1, TMP1, #8*LUA_MINSTACK | ldr CARG3, CFUNC:CARG3->f | str PC, SAVE_PC // Redundant (but a defined value). | cmp TMP1, TMP2 | mov CARG1, L | bhi >5 // Need to grow stack. | blr_auth CARG3 // (lua_State *L) | // Either throws an error, or recovers and returns -1, 0 or nresults+1. | ldr BASE, L->base | cmp CRET1w, #0 | lsl RC, CRET1, #3 | sub RA, BASE, #16 | bgt ->fff_res // Returned nresults+1? |1: // Returned 0 or -1: retry fast path. | ldr CARG1, L->top | ldr CFUNC:CARG3, [BASE, FRAME_FUNC] | sub NARGS8:RC, CARG1, BASE | bne ->vm_call_tail // Returned -1? | and CFUNC:CARG3, CARG3, #LJ_GCVMASK | ins_callt // Returned 0: retry fast path. | |// Reconstruct previous base for vmeta_call during tailcall. |->vm_call_tail: | ands TMP0, PC, #FRAME_TYPE | and TMP1, PC, #~FRAME_TYPEP | bne >3 | ldrb RAw, [PC, #-4+OFS_RA] | lsl RA, RA, #3 | add TMP1, RA, #16 |3: | sub RB, BASE, TMP1 | 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 | sp_auth | add CARG2, BASE, NARGS8:RC // Calculate L->top. | mov RA, lr | stp BASE, CARG2, L->base | str PC, SAVE_PC // Redundant (but a defined value). | mov CARG1, L | bl extern lj_gc_step // (lua_State *L) | ldp BASE, CARG2, L->base | ldr CFUNC:CARG3, [BASE, FRAME_FUNC] | mov lr, RA // Help return address predictor. | sub NARGS8:RC, CARG2, BASE // Calculate nargs*8. | and CFUNC:CARG3, CARG3, #LJ_GCVMASK | ret_auth | |//----------------------------------------------------------------------- |//-- Special dispatch targets ------------------------------------------- |//----------------------------------------------------------------------- | |->vm_record: // Dispatch target for recording phase. |.if JIT | ldrb CARG1w, GL->hookmask | tst CARG1, #HOOK_VMEVENT // No recording while in vmevent. | bne >5 | // Decrement the hookcount for consistency, but always do the call. | ldr CARG2w, GL->hookcount | tst CARG1, #HOOK_ACTIVE | bne >1 | sub CARG2w, CARG2w, #1 | tst CARG1, #LUA_MASKLINE|LUA_MASKCOUNT | beq >1 | str CARG2w, GL->hookcount | b >1 |.endif | |->vm_rethook: // Dispatch target for return hooks. | ldrb TMP2w, GL->hookmask | tbz TMP2w, #HOOK_ACTIVE_SHIFT, >1 // Hook already active? |5: // Re-dispatch to static ins. | ldr TMP0, [TMP1, #GG_G2DISP+GG_DISP2STATIC] | br_auth TMP0 | |->vm_inshook: // Dispatch target for instr/line hooks. | ldrb TMP2w, GL->hookmask | ldr TMP3w, GL->hookcount | tbnz TMP2w, #HOOK_ACTIVE_SHIFT, <5 // Hook already active? | tst TMP2w, #LUA_MASKLINE|LUA_MASKCOUNT | beq <5 | sub TMP3w, TMP3w, #1 | str TMP3w, GL->hookcount | cbz TMP3w, >1 | tbz TMP2w, #LUA_HOOKLINE, <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. | ldr INSw, [PC, #-4] | add TMP1, GL, INS, uxtb #3 | decode_RA RA, INS | ldr TMP0, [TMP1, #GG_G2DISP+GG_DISP2STATIC] | decode_RD RC, INS | br_auth TMP0 | |->cont_hook: // Continue from hook yield. | ldr CARG1, [CARG4, #-40] | add PC, PC, #4 | str CARG1w, 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). | add CARG1, GL, #GG_G2DISP+GG_DISP2J | and LFUNC:CARG3, CARG3, #LJ_GCVMASK | str PC, SAVE_PC | ldr CARG3, LFUNC:CARG3->pc | mov CARG2, PC | str L, [GL, #GL_J(L)] | ldrb CARG3w, [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 TMP1, BASE, NARGS8:RC | str PC, SAVE_PC | mov CARG1, L | sub RA, RA, BASE | stp BASE, TMP1, L->base | bl extern lj_dispatch_call // (lua_State *L, const BCIns *pc) | // Returns ASMFunction. | ldp BASE, TMP1, L->base | str xzr, SAVE_PC // Invalidate for subsequent line hook. | ldr LFUNC:CARG3, [BASE, FRAME_FUNC] | add RA, BASE, RA | sub NARGS8:RC, TMP1, BASE | ldr INSw, [PC, #-4] | and LFUNC:CARG3, CARG3, #LJ_GCVMASK | br_auth CRET1 | |->cont_stitch: // Trace stitching. |.if JIT | // RA = resultptr, CARG4 = meta base | ldr RBw, SAVE_MULTRES | ldr INSw, [PC, #-4] | ldr TRACE:CARG3, [CARG4, #-40] // Save previous trace. | subs RB, RB, #8 | decode_RA RC, INS // Call base. | and CARG3, CARG3, #LJ_GCVMASK | beq >2 |1: // Move results down. | ldr CARG1, [RA], #8 | subs RB, RB, #8 | str CARG1, [BASE, RC, lsl #3] | add RC, RC, #1 | bne <1 |2: | decode_RA RA, INS | decode_RB RB, INS | add RA, RA, RB |3: | cmp RA, RC | bhi >9 // More results wanted? | | ldrh RAw, TRACE:CARG3->traceno | ldrh RCw, TRACE:CARG3->link | cmp RCw, RAw | beq ->cont_nop // Blacklisted. | cmp RCw, #0 | bne =>BC_JLOOP // Jump to stitched trace. | | // Stitch a new trace to the previous trace. | mov CARG1, #GL_J(exitno) | str RAw, [GL, CARG1] | mov CARG1, #GL_J(L) | str L, [GL, CARG1] | str BASE, L->base | add CARG1, GL, #GG_G2J | mov CARG2, PC | bl extern lj_dispatch_stitch // (jit_State *J, const BCIns *pc) | ldr BASE, L->base | b ->cont_nop | |9: // Fill up results with nil. | str TISNIL, [BASE, RC, lsl #3] | add RC, RC, #1 | b <3 |.endif | |->vm_profhook: // Dispatch target for profiler hook. #if LJ_HASPROFILE | mov CARG1, L | str BASE, L->base | mov CARG2, PC | bl extern lj_dispatch_profile // (lua_State *L, const BCIns *pc) | // HOOK_PROFILE is off again, so re-dispatch to dynamic instruction. | ldr BASE, L->base | sub PC, PC, #4 | b ->cont_nop #endif | |//----------------------------------------------------------------------- |//-- Trace exit handler ------------------------------------------------- |//----------------------------------------------------------------------- | |.macro savex_, a, b | stp d..a, d..b, [sp, #a*8] | stp x..a, x..b, [sp, #32*8+a*8] |.endmacro | |->vm_exit_handler: |.if JIT | sub sp, sp, #(64*8) | 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 | savex_, 28, 29 | stp d30, d31, [sp, #30*8] | ldr CARG1, [sp, #64*8] // Load original value of lr. | add CARG3, sp, #64*8 // Recompute original value of sp. | mv_vmstate CARG4w, EXIT | stp xzr, CARG3, [sp, #62*8] // Store 0/sp in RID_LR/RID_SP. | sub CARG1, CARG1, lr | ldr L, GL->cur_L | lsr CARG1, CARG1, #2 | ldr BASE, GL->jit_base | sub CARG1, CARG1, #2 | ldr CARG2w, [lr] // Load trace number. | st_vmstate CARG4w |.if ENDIAN_BE | rev32 CARG2, CARG2 |.endif | str BASE, L->base | ubfx CARG2w, CARG2w, #5, #16 | str CARG1w, [GL, #GL_J(exitno)] | str CARG2w, [GL, #GL_J(parent)] | str L, [GL, #GL_J(L)] | str xzr, GL->jit_base | add CARG1, GL, #GG_G2J | 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 | and sp, CARG2, #CFRAME_RAWMASK | 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 GL set. |.if JIT | ldr L, SAVE_L |1: | init_constants | cmn CARG1w, #LUA_ERRERR | bhs >9 // Check for error from exit. | ldr LFUNC:CARG2, [BASE, FRAME_FUNC] | lsl RC, CARG1, #3 | and LFUNC:CARG2, CARG2, #LJ_GCVMASK | str RCw, SAVE_MULTRES | str BASE, L->base | ldr CARG2, LFUNC:CARG2->pc | str xzr, GL->jit_base | mv_vmstate CARG4w, INTERP | ldr KBASE, [CARG2, #PC2PROTO(k)] | // Modified copy of ins_next which handles function header dispatch, too. | ldrb RBw, [PC, # OFS_OP] | ldr INSw, [PC], #4 | st_vmstate CARG4w | cmn CARG1w, #17 // Static dispatch? | beq >5 | cmp RBw, #BC_FUNCC+2 // Fast function? | add TMP1, GL, INS, uxtb #3 | bhs >4 |2: | cmp RBw, #BC_FUNCF // Function header? | add TMP0, GL, RB, uxtb #3 | ldr RB, [TMP0, #GG_G2DISP] | decode_RA RA, INS | lsr TMP0, INS, #16 | csel RC, TMP0, RC, lo | blo >3 | ldr CARG3, [BASE, FRAME_FUNC] | sub RC, RC, #8 | add RA, BASE, RA, lsl #3 // Yes: RA = BASE+framesize*8, RC = nargs*8 | and LFUNC:CARG3, CARG3, #LJ_GCVMASK |3: | br_auth RB | |4: // Check frame below fast function. | ldr CARG1, [BASE, FRAME_PC] | ands CARG2, CARG1, #FRAME_TYPE | bne <2 // Trace stitching continuation? | // Otherwise set KBASE for Lua function below fast function. | ldr CARG3w, [CARG1, #-4] | decode_RA CARG1, CARG3 | sub CARG2, BASE, CARG1, lsl #3 | ldr LFUNC:CARG3, [CARG2, #-32] | and LFUNC:CARG3, CARG3, #LJ_GCVMASK | ldr CARG3, LFUNC:CARG3->pc | ldr KBASE, [CARG3, #PC2PROTO(k)] | b <2 | |5: // Dispatch to static entry of original ins replaced by BC_JLOOP. | ldr RA, [GL, #GL_J(trace)] | decode_RD RC, INS | ldr TRACE:RA, [RA, RC, lsl #3] | ldr INSw, TRACE:RA->startins | add TMP0, GL, INS, uxtb #3 | decode_RA RA, INS | ldr RB, [TMP0, #GG_G2DISP+GG_DISP2STATIC] | decode_RD RC, INS | br_auth RB | |9: // Rethrow error from the right C frame. | neg CARG2w, CARG1w | mov CARG1, L | bl extern lj_err_trace // (lua_State *L, int errcode) |.endif | |//----------------------------------------------------------------------- |//-- Math helper functions ---------------------------------------------- |//----------------------------------------------------------------------- | | // int lj_vm_modi(int dividend, int divisor); |->vm_modi: | eor CARG4w, CARG1w, CARG2w | cmp CARG4w, #0 | eor CARG3w, CARG1w, CARG1w, asr #31 | eor CARG4w, CARG2w, CARG2w, asr #31 | sub CARG3w, CARG3w, CARG1w, asr #31 | sub CARG4w, CARG4w, CARG2w, asr #31 | udiv CARG1w, CARG3w, CARG4w | msub CARG1w, CARG1w, CARG4w, CARG3w | ccmp CARG1w, #0, #4, mi | sub CARG3w, CARG1w, CARG4w | csel CARG1w, CARG1w, CARG3w, eq | eor CARG3w, CARG1w, CARG2w | cmp CARG3w, #0 | cneg CARG1w, CARG1w, mi | ret | |//----------------------------------------------------------------------- |//-- Miscellaneous functions -------------------------------------------- |//----------------------------------------------------------------------- | |.define NEXT_TAB, TAB:CARG1 |.define NEXT_RES, CARG1 |.define NEXT_IDX, CARG2w |.define NEXT_LIM, CARG3w |.define NEXT_TMP0, TMP0 |.define NEXT_TMP0w, TMP0w |.define NEXT_TMP1, TMP1 |.define NEXT_TMP1w, TMP1w |.define NEXT_RES_PTR, sp |.define NEXT_RES_VAL, [sp] |.define NEXT_RES_KEY, [sp, #8] | |// TValue *lj_vm_next(GCtab *t, uint32_t idx) |// Next idx returned in CRET2w. |->vm_next: |.if JIT | ldr NEXT_LIM, NEXT_TAB->asize | ldr NEXT_TMP1, NEXT_TAB->array |1: // Traverse array part. | subs NEXT_TMP0w, NEXT_IDX, NEXT_LIM | bhs >5 // Index points after array part? | ldr NEXT_TMP0, [NEXT_TMP1, NEXT_IDX, uxtw #3] | cmn NEXT_TMP0, #-LJ_TNIL | cinc NEXT_IDX, NEXT_IDX, eq | beq <1 // Skip holes in array part. | str NEXT_TMP0, NEXT_RES_VAL | movz NEXT_TMP0w, #(LJ_TISNUM>>1)&0xffff, lsl #16 | stp NEXT_IDX, NEXT_TMP0w, NEXT_RES_KEY | add NEXT_IDX, NEXT_IDX, #1 | mov NEXT_RES, NEXT_RES_PTR |4: | ret | |5: // Traverse hash part. | ldr NEXT_TMP1w, NEXT_TAB->hmask | ldr NODE:NEXT_RES, NEXT_TAB->node | add NEXT_TMP0w, NEXT_TMP0w, NEXT_TMP0w, lsl #1 | add NEXT_LIM, NEXT_LIM, NEXT_TMP1w | add NODE:NEXT_RES, NODE:NEXT_RES, NEXT_TMP0w, uxtw #3 |6: | cmp NEXT_IDX, NEXT_LIM | bhi >9 | ldr NEXT_TMP0, NODE:NEXT_RES->val | cmn NEXT_TMP0, #-LJ_TNIL | add NEXT_IDX, NEXT_IDX, #1 | bne <4 | // Skip holes in hash part. | add NODE:NEXT_RES, NODE:NEXT_RES, #sizeof(Node) | b <6 | |9: // End of iteration. Set the key to nil (not the value). | movn NEXT_TMP0, #0 | str NEXT_TMP0, NEXT_RES_KEY | mov NEXT_RES, NEXT_RES_PTR | ret |.endif | |//----------------------------------------------------------------------- |//-- FFI helper functions ----------------------------------------------- |//----------------------------------------------------------------------- | |// Handler for callback functions. |// Saveregs already performed. Callback slot number in w9, g in x10. |->vm_ffi_callback: |.if FFI |.type CTSTATE, CTState, PC | saveregs | ldr CTSTATE, GL:x10->ctype_state | mov GL, x10 | add x10, sp, # CFRAME_SPACE | str w9, CTSTATE->cb.slot | stp x0, x1, CTSTATE->cb.gpr[0] | stp d0, d1, CTSTATE->cb.fpr[0] | stp x2, x3, CTSTATE->cb.gpr[2] | stp d2, d3, CTSTATE->cb.fpr[2] | stp x4, x5, CTSTATE->cb.gpr[4] | stp d4, d5, CTSTATE->cb.fpr[4] | stp x6, x7, CTSTATE->cb.gpr[6] | stp d6, d7, CTSTATE->cb.fpr[6] | str x10, CTSTATE->cb.stack | mov CARG1, CTSTATE | str CTSTATE, SAVE_PC // Any value outside of bytecode is ok. | mov CARG2, sp | bl extern lj_ccallback_enter // (CTState *cts, void *cf) | // Returns lua_State *. | ldp BASE, RC, L:CRET1->base | init_constants | mov L, CRET1 | ldr LFUNC:CARG3, [BASE, FRAME_FUNC] | sub RC, RC, BASE | st_vmstate ST_INTERP | and LFUNC:CARG3, CARG3, #LJ_GCVMASK | ins_callt |.endif | |->cont_ffi_callback: // Return from FFI callback. |.if FFI | ldr CTSTATE, GL->ctype_state | stp BASE, CARG4, L->base | str L, CTSTATE->L | mov CARG1, CTSTATE | mov CARG2, RA | bl extern lj_ccallback_leave // (CTState *cts, TValue *o) | ldp x0, x1, CTSTATE->cb.gpr[0] | ldp d0, d1, CTSTATE->cb.fpr[0] | 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, x19 | sp_auth | stp_unwind CCSTATE, x20, [sp, #-32]! | stp fp, lr, [sp, #16] | add fp, sp, #16 | mov CCSTATE, x0 | ldr TMP0w, CCSTATE:x0->spadj | ldrb TMP1w, CCSTATE->nsp | add TMP2, CCSTATE, #offsetof(CCallState, stack) | subs TMP1, TMP1, #8 | ldr TMP3, CCSTATE->func | sub sp, sp, TMP0 | bmi >2 |1: // Copy stack slots | ldr TMP0, [TMP2, TMP1] | str TMP0, [sp, TMP1] | subs TMP1, TMP1, #8 | bpl <1 |2: | ldp x0, x1, CCSTATE->gpr[0] | ldp d0, d1, CCSTATE->fpr[0] | ldp x2, x3, CCSTATE->gpr[2] | ldp d2, d3, CCSTATE->fpr[2] | ldp x4, x5, CCSTATE->gpr[4] | ldp d4, d5, CCSTATE->fpr[4] | ldp x6, x7, CCSTATE->gpr[6] | ldp d6, d7, CCSTATE->fpr[6] | ldr x8, CCSTATE->retp | blr_auth TMP3 | sub sp, fp, #16 | stp x0, x1, CCSTATE->gpr[0] | stp d0, d1, CCSTATE->fpr[0] | stp d2, d3, CCSTATE->fpr[2] | ldp fp, lr, [sp, #16] | ldp_unwind CCSTATE, x20, [sp], #32 | ret_auth |.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, RC = src2, JMP with RC = target | ldr CARG1, [BASE, RA, lsl #3] | ldrh RBw, [PC, # OFS_RD] | ldr CARG2, [BASE, RC, lsl #3] | add PC, PC, #4 | add RB, PC, RB, lsl #2 | sub RB, RB, #0x20000 | checkint CARG1, >3 | checkint CARG2, >4 | cmp CARG1w, CARG2w if (op == BC_ISLT) { | csel PC, RB, PC, lt } else if (op == BC_ISGE) { | csel PC, RB, PC, ge } else if (op == BC_ISLE) { | csel PC, RB, PC, le } else { | csel PC, RB, PC, gt } |1: | ins_next | |3: // RA not int. | ldr FARG1, [BASE, RA, lsl #3] | blo ->vmeta_comp | ldr FARG2, [BASE, RC, lsl #3] | cmp TISNUMhi, CARG2, lsr #32 | bhi >5 | bne ->vmeta_comp | // RA number, RC int. | scvtf FARG2, CARG2w | b >5 | |4: // RA int, RC not int | ldr FARG2, [BASE, RC, lsl #3] | blo ->vmeta_comp | // RA int, RC number. | scvtf FARG1, CARG1w | |5: // RA number, RC number | fcmp FARG1, FARG2 | // To preserve NaN semantics GE/GT branch on unordered, but LT/LE don't. if (op == BC_ISLT) { | csel PC, RB, PC, lo } else if (op == BC_ISGE) { | csel PC, RB, PC, hs } else if (op == BC_ISLE) { | csel PC, RB, PC, ls } else { | csel PC, RB, PC, hi } | b <1 break; case BC_ISEQV: case BC_ISNEV: vk = op == BC_ISEQV; | // RA = src1, RC = src2, JMP with RC = target | ldr CARG1, [BASE, RA, lsl #3] | add RC, BASE, RC, lsl #3 | ldrh RBw, [PC, # OFS_RD] | ldr CARG3, [RC] | add PC, PC, #4 | add RB, PC, RB, lsl #2 | sub RB, RB, #0x20000 | asr ITYPE, CARG3, #47 | cmn ITYPE, #-LJ_TISNUM if (vk) { | bls ->BC_ISEQN_Z } else { | bls ->BC_ISNEN_Z } | // RC is not a number. | asr TMP0, CARG1, #47 |.if FFI | // Check if RC or RA is a cdata. | cmn ITYPE, #-LJ_TCDATA | ccmn TMP0, #-LJ_TCDATA, #4, ne | beq ->vmeta_equal_cd |.endif | cmp CARG1, CARG3 | bne >2 | // Tag and value are equal. if (vk) { |->BC_ISEQV_Z: | mov PC, RB // Perform branch. } |1: | ins_next | |2: // Check if the tags are the same and it's a table or userdata. | cmp ITYPE, TMP0 | ccmn ITYPE, #-LJ_TISTABUD, #2, eq if (vk) { | bhi <1 } else { | bhi ->BC_ISEQV_Z // Reuse code from opposite instruction. } | // Different tables or userdatas. Need to check __eq metamethod. | // Field metatable must be at same offset for GCtab and GCudata! | and TAB:CARG2, CARG1, #LJ_GCVMASK | ldr TAB:TMP2, TAB:CARG2->metatable if (vk) { | cbz TAB:TMP2, <1 // No metatable? | ldrb TMP1w, TAB:TMP2->nomm | mov CARG4, #0 // ne = 0 | tbnz TMP1w, #MM_eq, <1 // 'no __eq' flag set: done. } else { | cbz TAB:TMP2, ->BC_ISEQV_Z // No metatable? | ldrb TMP1w, TAB:TMP2->nomm | mov CARG4, #1 // ne = 1. | tbnz TMP1w, #MM_eq, ->BC_ISEQV_Z // 'no __eq' flag set: done. } | b ->vmeta_equal break; case BC_ISEQS: case BC_ISNES: vk = op == BC_ISEQS; | // RA = src, RC = str_const (~), JMP with RC = target | ldr CARG1, [BASE, RA, lsl #3] | mvn RC, RC | ldrh RBw, [PC, # OFS_RD] | ldr CARG2, [KBASE, RC, lsl #3] | add PC, PC, #4 | movn TMP0, #~LJ_TSTR |.if FFI | asr ITYPE, CARG1, #47 |.endif | add RB, PC, RB, lsl #2 | add CARG2, CARG2, TMP0, lsl #47 | sub RB, RB, #0x20000 |.if FFI | cmn ITYPE, #-LJ_TCDATA | beq ->vmeta_equal_cd |.endif | cmp CARG1, CARG2 if (vk) { | csel PC, RB, PC, eq } else { | csel PC, RB, PC, ne } | ins_next break; case BC_ISEQN: case BC_ISNEN: vk = op == BC_ISEQN; | // RA = src, RC = num_const (~), JMP with RC = target | ldr CARG1, [BASE, RA, lsl #3] | add RC, KBASE, RC, lsl #3 | ldrh RBw, [PC, # OFS_RD] | ldr CARG3, [RC] | add PC, PC, #4 | add RB, PC, RB, lsl #2 | sub RB, RB, #0x20000 if (vk) { |->BC_ISEQN_Z: } else { |->BC_ISNEN_Z: } | checkint CARG1, >4 | checkint CARG3, >6 | cmp CARG1w, CARG3w |1: if (vk) { | csel PC, RB, PC, eq |2: } else { |2: | csel PC, RB, PC, ne } |3: | ins_next | |4: // RA not int. |.if FFI | blo >7 |.else | blo <2 |.endif | ldr FARG1, [BASE, RA, lsl #3] | ldr FARG2, [RC] | cmp TISNUMhi, CARG3, lsr #32 | bne >5 | // RA number, RC int. | scvtf FARG2, CARG3w |5: | // RA number, RC number. | fcmp FARG1, FARG2 | b <1 | |6: // RA int, RC number | ldr FARG2, [RC] | scvtf FARG1, CARG1w | fcmp FARG1, FARG2 | b <1 | |.if FFI |7: | asr ITYPE, CARG1, #47 | cmn ITYPE, #-LJ_TCDATA | bne <2 | b ->vmeta_equal_cd |.endif break; case BC_ISEQP: case BC_ISNEP: vk = op == BC_ISEQP; | // RA = src, RC = primitive_type (~), JMP with RC = target | ldr TMP0, [BASE, RA, lsl #3] | ldrh RBw, [PC, # OFS_RD] | add PC, PC, #4 | add RC, RC, #1 | add RB, PC, RB, lsl #2 |.if FFI | asr ITYPE, TMP0, #47 | cmn ITYPE, #-LJ_TCDATA | beq ->vmeta_equal_cd | cmn RC, ITYPE |.else | cmn RC, TMP0, asr #47 |.endif | sub RB, RB, #0x20000 if (vk) { | csel PC, RB, PC, eq } else { | csel PC, RB, PC, ne } | ins_next break; /* -- Unary test and copy ops ------------------------------------------- */ case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: | // RA = dst or unused, RC = src, JMP with RC = target | ldrh RBw, [PC, # OFS_RD] | ldr TMP0, [BASE, RC, lsl #3] | add PC, PC, #4 | mov_false TMP1 | add RB, PC, RB, lsl #2 | cmp TMP0, TMP1 | sub RB, RB, #0x20000 if (op == BC_ISTC || op == BC_IST) { if (op == BC_ISTC) { | csel RA, RA, RC, lo } | csel PC, RB, PC, lo } else { if (op == BC_ISFC) { | csel RA, RA, RC, hs } | csel PC, RB, PC, hs } if (op == BC_ISTC || op == BC_ISFC) { | str TMP0, [BASE, RA, lsl #3] } | ins_next break; case BC_ISTYPE: | // RA = src, RC = -type | ldr TMP0, [BASE, RA, lsl #3] | cmn RC, TMP0, asr #47 | bne ->vmeta_istype | ins_next break; case BC_ISNUM: | // RA = src, RC = -(TISNUM-1) | ldr TMP0, [BASE, RA] | checknum TMP0, ->vmeta_istype | ins_next break; /* -- Unary ops --------------------------------------------------------- */ case BC_MOV: | // RA = dst, RC = src | ldr TMP0, [BASE, RC, lsl #3] | str TMP0, [BASE, RA, lsl #3] | ins_next break; case BC_NOT: | // RA = dst, RC = src | ldr TMP0, [BASE, RC, lsl #3] | mov_false TMP1 | mov_true TMP2 | cmp TMP0, TMP1 | csel TMP0, TMP1, TMP2, lo | str TMP0, [BASE, RA, lsl #3] | ins_next break; case BC_UNM: | // RA = dst, RC = src | ldr TMP0, [BASE, RC, lsl #3] | asr ITYPE, TMP0, #47 | cmn ITYPE, #-LJ_TISNUM | bhi ->vmeta_unm | eor TMP0, TMP0, #U64x(80000000,00000000) | bne >5 | negs TMP0w, TMP0w | movz CARG3, #0x41e0, lsl #48 // 2^31. | add_TISNUM TMP0, TMP0 | csel TMP0, TMP0, CARG3, vc |5: | str TMP0, [BASE, RA, lsl #3] | ins_next break; case BC_LEN: | // RA = dst, RC = src | ldr CARG1, [BASE, RC, lsl #3] | asr ITYPE, CARG1, #47 | cmn ITYPE, #-LJ_TSTR | and CARG1, CARG1, #LJ_GCVMASK | bne >2 | ldr CARG1w, STR:CARG1->len |1: | add_TISNUM CARG1, CARG1 | str CARG1, [BASE, RA, lsl #3] | ins_next | |2: | cmn ITYPE, #-LJ_TTAB | bne ->vmeta_len #if LJ_52 | ldr TAB:CARG2, TAB:CARG1->metatable | cbnz TAB:CARG2, >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: | ldrb TMP1w, TAB:CARG2->nomm | tbnz TMP1w, #MM_len, <3 // 'no __len' flag set: done. | b ->vmeta_len #endif break; /* -- Binary ops -------------------------------------------------------- */ |.macro ins_arithcheck_int, target | checkint CARG1, target | checkint CARG2, target |.endmacro | |.macro ins_arithcheck_num, target | checknum CARG1, target | checknum CARG2, target |.endmacro | |.macro ins_arithcheck_nzdiv, target | cbz CARG2w, target |.endmacro | |.macro ins_arithhead ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); ||if (vk == 1) { | and RC, RC, #255 | decode_RB RB, INS ||} else { | decode_RB RB, INS | and RC, RC, #255 ||} |.endmacro | |.macro ins_arithload, reg1, reg2 | // RA = dst, RB = src1, RC = src2 | num_const ||switch (vk) { ||case 0: | ldr reg1, [BASE, RB, lsl #3] | ldr reg2, [KBASE, RC, lsl #3] || break; ||case 1: | ldr reg1, [KBASE, RC, lsl #3] | ldr reg2, [BASE, RB, lsl #3] || break; ||default: | ldr reg1, [BASE, RB, lsl #3] | ldr reg2, [BASE, RC, lsl #3] || break; ||} |.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_arithmod, res, reg1, reg2 | fdiv d2, reg1, reg2 | frintm d2, d2 | // Cannot use fmsub, because FMA is not enabled by default. | fmul d2, d2, reg2 | fsub res, reg1, d2 |.endmacro | |.macro ins_arithdn, intins, fpins | ins_arithhead | ins_arithload CARG1, CARG2 | ins_arithcheck_int >5 |.if "intins" == "smull" | smull CARG1, CARG1w, CARG2w | cmp CARG1, CARG1, sxtw | mov CARG1w, CARG1w | ins_arithfallback bne |.elif "intins" == "ins_arithmodi" | ins_arithfallback ins_arithcheck_nzdiv | bl ->vm_modi |.else | intins CARG1w, CARG1w, CARG2w | ins_arithfallback bvs |.endif | add_TISNUM CARG1, CARG1 | str CARG1, [BASE, RA, lsl #3] |4: | ins_next | |5: // FP variant. | ins_arithload FARG1, FARG2 | ins_arithfallback ins_arithcheck_num | fpins FARG1, FARG1, FARG2 | str FARG1, [BASE, RA, lsl #3] | b <4 |.endmacro | |.macro ins_arithfp, fpins | ins_arithhead | ins_arithload CARG1, CARG2 | ins_arithload FARG1, FARG2 | ins_arithfallback ins_arithcheck_num |.if "fpins" == "fpow" | bl extern pow |.else | fpins FARG1, FARG1, FARG2 |.endif | str FARG1, [BASE, RA, lsl #3] | ins_next |.endmacro case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: | ins_arithdn adds, fadd break; case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: | ins_arithdn subs, fsub break; case BC_MULVN: case BC_MULNV: case BC_MULVV: | ins_arithdn smull, fmul break; case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: | ins_arithfp fdiv break; case BC_MODVN: case BC_MODNV: case BC_MODVV: | ins_arithdn ins_arithmodi, ins_arithmod break; case BC_POW: | // NYI: (partial) integer arithmetic. | ins_arithfp fpow break; case BC_CAT: | decode_RB RB, INS | and RC, RC, #255 | // RA = dst, RB = src_start, RC = src_end | str BASE, L->base | sub CARG3, RC, RB | add CARG2, BASE, RC, lsl #3 |->BC_CAT_Z: | // RA = dst, CARG2 = top-1, CARG3 = left | mov CARG1, L | str PC, SAVE_PC | bl extern lj_meta_cat // (lua_State *L, TValue *top, int left) | // Returns NULL (finished) or TValue * (metamethod). | ldrb RBw, [PC, #-4+OFS_RB] | ldr BASE, L->base | cbnz CRET1, ->vmeta_binop | ldr TMP0, [BASE, RB, lsl #3] | str TMP0, [BASE, RA, lsl #3] // Copy result to RA. | ins_next break; /* -- Constant ops ------------------------------------------------------ */ case BC_KSTR: | // RA = dst, RC = str_const (~) | mvn RC, RC | ldr TMP0, [KBASE, RC, lsl #3] | movn TMP1, #~LJ_TSTR | add TMP0, TMP0, TMP1, lsl #47 | str TMP0, [BASE, RA, lsl #3] | ins_next break; case BC_KCDATA: |.if FFI | // RA = dst, RC = cdata_const (~) | mvn RC, RC | ldr TMP0, [KBASE, RC, lsl #3] | movn TMP1, #~LJ_TCDATA | add TMP0, TMP0, TMP1, lsl #47 | str TMP0, [BASE, RA, lsl #3] | ins_next |.endif break; case BC_KSHORT: | // RA = dst, RC = int16_literal | sxth RCw, RCw | add_TISNUM TMP0, RC | str TMP0, [BASE, RA, lsl #3] | ins_next break; case BC_KNUM: | // RA = dst, RC = num_const | ldr TMP0, [KBASE, RC, lsl #3] | str TMP0, [BASE, RA, lsl #3] | ins_next break; case BC_KPRI: | // RA = dst, RC = primitive_type (~) | mvn TMP0, RC, lsl #47 | str TMP0, [BASE, RA, lsl #3] | ins_next break; case BC_KNIL: | // RA = base, RC = end | add RA, BASE, RA, lsl #3 | add RC, BASE, RC, lsl #3 | str TISNIL, [RA], #8 |1: | cmp RA, RC | str TISNIL, [RA], #8 | blt <1 | ins_next_ break; /* -- Upvalue and function ops ------------------------------------------ */ case BC_UGET: | // RA = dst, RC = uvnum | ldr LFUNC:CARG2, [BASE, FRAME_FUNC] | add RC, RC, #offsetof(GCfuncL, uvptr)/8 | and LFUNC:CARG2, CARG2, #LJ_GCVMASK | ldr UPVAL:CARG2, [LFUNC:CARG2, RC, lsl #3] | ldr CARG2, UPVAL:CARG2->v | ldr TMP0, [CARG2] | str TMP0, [BASE, RA, lsl #3] | ins_next break; case BC_USETV: | // RA = uvnum, RC = src | ldr LFUNC:CARG2, [BASE, FRAME_FUNC] | add RA, RA, #offsetof(GCfuncL, uvptr)/8 | and LFUNC:CARG2, CARG2, #LJ_GCVMASK | ldr UPVAL:CARG1, [LFUNC:CARG2, RA, lsl #3] | ldr CARG3, [BASE, RC, lsl #3] | ldr CARG2, UPVAL:CARG1->v | ldrb TMP2w, UPVAL:CARG1->marked | ldrb TMP0w, UPVAL:CARG1->closed | asr ITYPE, CARG3, #47 | str CARG3, [CARG2] | add ITYPE, ITYPE, #-LJ_TISGCV | tst TMP2w, #LJ_GC_BLACK // isblack(uv) | ccmp TMP0w, #0, #4, ne // && uv->closed | ccmn ITYPE, #-(LJ_TNUMX - LJ_TISGCV), #0, ne // && tvisgcv(v) | bhi >2 |1: | ins_next | |2: // Check if new value is white. | and GCOBJ:CARG3, CARG3, #LJ_GCVMASK | ldrb TMP1w, GCOBJ:CARG3->gch.marked | tst TMP1w, #LJ_GC_WHITES // iswhite(str) | beq <1 | // Crossed a write barrier. Move the barrier forward. | mov CARG1, GL | bl extern lj_gc_barrieruv // (global_State *g, TValue *tv) | b <1 break; case BC_USETS: | // RA = uvnum, RC = str_const (~) | ldr LFUNC:CARG2, [BASE, FRAME_FUNC] | add RA, RA, #offsetof(GCfuncL, uvptr)/8 | mvn RC, RC | and LFUNC:CARG2, CARG2, #LJ_GCVMASK | ldr UPVAL:CARG1, [LFUNC:CARG2, RA, lsl #3] | ldr STR:CARG3, [KBASE, RC, lsl #3] | movn TMP0, #~LJ_TSTR | ldr CARG2, UPVAL:CARG1->v | ldrb TMP2w, UPVAL:CARG1->marked | add TMP0, STR:CARG3, TMP0, lsl #47 | ldrb TMP1w, STR:CARG3->marked | str TMP0, [CARG2] | tbnz TMP2w, #2, >2 // isblack(uv) |1: | ins_next | |2: // Check if string is white and ensure upvalue is closed. | ldrb TMP0w, UPVAL:CARG1->closed | tst TMP1w, #LJ_GC_WHITES // iswhite(str) | ccmp TMP0w, #0, #4, ne | beq <1 | // Crossed a write barrier. Move the barrier forward. | mov CARG1, GL | bl extern lj_gc_barrieruv // (global_State *g, TValue *tv) | b <1 break; case BC_USETN: | // RA = uvnum, RC = num_const | ldr LFUNC:CARG2, [BASE, FRAME_FUNC] | add RA, RA, #offsetof(GCfuncL, uvptr)/8 | and LFUNC:CARG2, CARG2, #LJ_GCVMASK | ldr UPVAL:CARG2, [LFUNC:CARG2, RA, lsl #3] | ldr TMP0, [KBASE, RC, lsl #3] | ldr CARG2, UPVAL:CARG2->v | str TMP0, [CARG2] | ins_next break; case BC_USETP: | // RA = uvnum, RC = primitive_type (~) | ldr LFUNC:CARG2, [BASE, FRAME_FUNC] | add RA, RA, #offsetof(GCfuncL, uvptr)/8 | and LFUNC:CARG2, CARG2, #LJ_GCVMASK | ldr UPVAL:CARG2, [LFUNC:CARG2, RA, lsl #3] | mvn TMP0, RC, lsl #47 | ldr CARG2, UPVAL:CARG2->v | str TMP0, [CARG2] | ins_next break; case BC_UCLO: | // RA = level, RC = target | ldr CARG3, L->openupval | add RC, PC, RC, lsl #2 | str BASE, L->base | sub PC, RC, #0x20000 | cbz CARG3, >1 | mov CARG1, L | add CARG2, BASE, RA, lsl #3 | bl extern lj_func_closeuv // (lua_State *L, TValue *level) | ldr BASE, L->base |1: | ins_next break; case BC_FNEW: | // RA = dst, RC = proto_const (~) (holding function prototype) | mvn RC, RC | str BASE, L->base | ldr LFUNC:CARG3, [BASE, FRAME_FUNC] | str PC, SAVE_PC | ldr CARG2, [KBASE, RC, lsl #3] | mov CARG1, L | and LFUNC:CARG3, CARG3, #LJ_GCVMASK | // (lua_State *L, GCproto *pt, GCfuncL *parent) | bl extern lj_func_newL_gc | // Returns GCfuncL *. | ldr BASE, L->base | movn TMP0, #~LJ_TFUNC | add CRET1, CRET1, TMP0, lsl #47 | str CRET1, [BASE, RA, lsl #3] | ins_next break; /* -- Table ops --------------------------------------------------------- */ case BC_TNEW: case BC_TDUP: | // RA = dst, RC = (hbits|asize) | tab_const (~) | ldp CARG3, CARG4, GL->gc.total // Assumes threshold follows total. | str BASE, L->base | str PC, SAVE_PC | mov CARG1, L | cmp CARG3, CARG4 | bhs >5 |1: if (op == BC_TNEW) { | and CARG2, RC, #0x7ff | lsr CARG3, RC, #11 | cmp CARG2, #0x7ff | mov TMP0, #0x801 | csel CARG2, CARG2, TMP0, ne | bl extern lj_tab_new // (lua_State *L, int32_t asize, uint32_t hbits) | // Returns GCtab *. } else { | mvn RC, RC | ldr CARG2, [KBASE, RC, lsl #3] | bl extern lj_tab_dup // (lua_State *L, Table *kt) | // Returns GCtab *. } | ldr BASE, L->base | movk CRET1, #(LJ_TTAB>>1)&0xffff, lsl #48 | str CRET1, [BASE, RA, lsl #3] | ins_next | |5: | bl extern lj_gc_step_fixtop // (lua_State *L) | mov CARG1, L | b <1 break; case BC_GGET: | // RA = dst, RC = str_const (~) case BC_GSET: | // RA = src, RC = str_const (~) | ldr LFUNC:CARG1, [BASE, FRAME_FUNC] | mvn RC, RC | and LFUNC:CARG1, CARG1, #LJ_GCVMASK | ldr TAB:CARG2, LFUNC:CARG1->env | ldr STR:RC, [KBASE, RC, lsl #3] if (op == BC_GGET) { | b ->BC_TGETS_Z } else { | b ->BC_TSETS_Z } break; case BC_TGETV: | decode_RB RB, INS | and RC, RC, #255 | // RA = dst, RB = table, RC = key | ldr CARG2, [BASE, RB, lsl #3] | ldr TMP1, [BASE, RC, lsl #3] | checktab CARG2, ->vmeta_tgetv | checkint TMP1, >9 // Integer key? | ldr CARG3, TAB:CARG2->array | ldr CARG1w, TAB:CARG2->asize | add CARG3, CARG3, TMP1, uxtw #3 | cmp TMP1w, CARG1w // In array part? | bhs ->vmeta_tgetv | ldr TMP0, [CARG3] | cmp_nil TMP0 | beq >5 |1: | str TMP0, [BASE, RA, lsl #3] | ins_next | |5: // Check for __index if table value is nil. | ldr TAB:CARG1, TAB:CARG2->metatable | cbz TAB:CARG1, <1 // No metatable: done. | ldrb TMP1w, TAB:CARG1->nomm | tbnz TMP1w, #MM_index, <1 // 'no __index' flag set: done. | b ->vmeta_tgetv | |9: | asr ITYPE, TMP1, #47 | cmn ITYPE, #-LJ_TSTR // String key? | bne ->vmeta_tgetv | and STR:RC, TMP1, #LJ_GCVMASK | b ->BC_TGETS_Z break; case BC_TGETS: | decode_RB RB, INS | and RC, RC, #255 | // RA = dst, RB = table, RC = str_const (~) | ldr CARG2, [BASE, RB, lsl #3] | mvn RC, RC | ldr STR:RC, [KBASE, RC, lsl #3] | checktab CARG2, ->vmeta_tgets1 |->BC_TGETS_Z: | // TAB:CARG2 = GCtab *, STR:RC = GCstr *, RA = dst | ldr TMP1w, TAB:CARG2->hmask | ldr TMP2w, STR:RC->sid | ldr NODE:CARG3, TAB:CARG2->node | and TMP1w, TMP1w, TMP2w // idx = str->sid & tab->hmask | add TMP1, TMP1, TMP1, lsl #1 | movn CARG4, #~LJ_TSTR | add NODE:CARG3, NODE:CARG3, TMP1, lsl #3 // node = tab->node + idx*3*8 | add CARG4, STR:RC, CARG4, lsl #47 // Tagged key to look for. |1: | ldp TMP0, CARG1, NODE:CARG3->val | ldr NODE:CARG3, NODE:CARG3->next | cmp CARG1, CARG4 | bne >4 | cmp_nil TMP0 | beq >5 |3: | str TMP0, [BASE, RA, lsl #3] | ins_next | |4: // Follow hash chain. | cbnz NODE:CARG3, <1 | // End of hash chain: key not found, nil result. | mov_nil TMP0 | |5: // Check for __index if table value is nil. | ldr TAB:CARG1, TAB:CARG2->metatable | cbz TAB:CARG1, <3 // No metatable: done. | ldrb TMP1w, TAB:CARG1->nomm | tbnz TMP1w, #MM_index, <3 // 'no __index' flag set: done. | b ->vmeta_tgets break; case BC_TGETB: | decode_RB RB, INS | and RC, RC, #255 | // RA = dst, RB = table, RC = index | ldr CARG2, [BASE, RB, lsl #3] | checktab CARG2, ->vmeta_tgetb | ldr CARG3, TAB:CARG2->array | ldr CARG1w, TAB:CARG2->asize | add CARG3, CARG3, RC, lsl #3 | cmp RCw, CARG1w // In array part? | bhs ->vmeta_tgetb | ldr TMP0, [CARG3] | cmp_nil TMP0 | beq >5 |1: | str TMP0, [BASE, RA, lsl #3] | ins_next | |5: // Check for __index if table value is nil. | ldr TAB:CARG1, TAB:CARG2->metatable | cbz TAB:CARG1, <1 // No metatable: done. | ldrb TMP1w, TAB:CARG1->nomm | tbnz TMP1w, #MM_index, <1 // 'no __index' flag set: done. | b ->vmeta_tgetb break; case BC_TGETR: | decode_RB RB, INS | and RC, RC, #255 | // RA = dst, RB = table, RC = key | ldr CARG1, [BASE, RB, lsl #3] | ldr TMP1, [BASE, RC, lsl #3] | and TAB:CARG1, CARG1, #LJ_GCVMASK | ldr CARG3, TAB:CARG1->array | ldr TMP2w, TAB:CARG1->asize | add CARG3, CARG3, TMP1w, uxtw #3 | cmp TMP1w, TMP2w // In array part? | bhs ->vmeta_tgetr | ldr TMP0, [CARG3] |->BC_TGETR_Z: | str TMP0, [BASE, RA, lsl #3] | ins_next break; case BC_TSETV: | decode_RB RB, INS | and RC, RC, #255 | // RA = src, RB = table, RC = key | ldr CARG2, [BASE, RB, lsl #3] | ldr TMP1, [BASE, RC, lsl #3] | checktab CARG2, ->vmeta_tsetv | checkint TMP1, >9 // Integer key? | ldr CARG3, TAB:CARG2->array | ldr CARG1w, TAB:CARG2->asize | add CARG3, CARG3, TMP1, uxtw #3 | cmp TMP1w, CARG1w // In array part? | bhs ->vmeta_tsetv | ldr TMP1, [CARG3] | ldr TMP0, [BASE, RA, lsl #3] | ldrb TMP2w, TAB:CARG2->marked | cmp_nil TMP1 // Previous value is nil? | beq >5 |1: | str TMP0, [CARG3] | tbnz TMP2w, #2, >7 // isblack(table) |2: | ins_next | |5: // Check for __newindex if previous value is nil. | ldr TAB:CARG1, TAB:CARG2->metatable | cbz TAB:CARG1, <1 // No metatable: done. | ldrb TMP1w, TAB:CARG1->nomm | tbnz TMP1w, #MM_newindex, <1 // 'no __newindex' flag set: done. | b ->vmeta_tsetv | |7: // Possible table write barrier for the value. Skip valiswhite check. | barrierback TAB:CARG2, TMP2w, TMP1 | b <2 | |9: | asr ITYPE, TMP1, #47 | cmn ITYPE, #-LJ_TSTR // String key? | bne ->vmeta_tsetv | and STR:RC, TMP1, #LJ_GCVMASK | b ->BC_TSETS_Z break; case BC_TSETS: | decode_RB RB, INS | and RC, RC, #255 | // RA = dst, RB = table, RC = str_const (~) | ldr CARG2, [BASE, RB, lsl #3] | mvn RC, RC | ldr STR:RC, [KBASE, RC, lsl #3] | checktab CARG2, ->vmeta_tsets1 |->BC_TSETS_Z: | // TAB:CARG2 = GCtab *, STR:RC = GCstr *, RA = src | ldr TMP1w, TAB:CARG2->hmask | ldr TMP2w, STR:RC->sid | ldr NODE:CARG3, TAB:CARG2->node | and TMP1w, TMP1w, TMP2w // idx = str->sid & tab->hmask | add TMP1, TMP1, TMP1, lsl #1 | movn CARG4, #~LJ_TSTR | add NODE:CARG3, NODE:CARG3, TMP1, lsl #3 // node = tab->node + idx*3*8 | add CARG4, STR:RC, CARG4, lsl #47 // Tagged key to look for. | strb wzr, TAB:CARG2->nomm // Clear metamethod cache. |1: | ldp TMP1, CARG1, NODE:CARG3->val | ldr NODE:TMP3, NODE:CARG3->next | ldrb TMP2w, TAB:CARG2->marked | cmp CARG1, CARG4 | bne >5 | ldr TMP0, [BASE, RA, lsl #3] | cmp_nil TMP1 // Previous value is nil? | beq >4 |2: | str TMP0, NODE:CARG3->val | tbnz TMP2w, #2, >7 // isblack(table) |3: | ins_next | |4: // Check for __newindex if previous value is nil. | ldr TAB:CARG1, TAB:CARG2->metatable | cbz TAB:CARG1, <2 // No metatable: done. | ldrb TMP1w, TAB:CARG1->nomm | tbnz TMP1w, #MM_newindex, <2 // 'no __newindex' flag set: done. | b ->vmeta_tsets | |5: // Follow hash chain. | mov NODE:CARG3, NODE:TMP3 | cbnz NODE:TMP3, <1 | // End of hash chain: key not found, add a new one. | | // But check for __newindex first. | ldr TAB:CARG1, TAB:CARG2->metatable | cbz TAB:CARG1, >6 // No metatable: continue. | ldrb TMP1w, TAB:CARG1->nomm | // 'no __newindex' flag NOT set: check. | tbz TMP1w, #MM_newindex, ->vmeta_tsets |6: | movn TMP1, #~LJ_TSTR | str PC, SAVE_PC | add TMP0, STR:RC, TMP1, lsl #47 | str BASE, L->base | mov CARG1, L | str TMP0, TMPD | add CARG3, sp, TMPDofs | bl extern lj_tab_newkey // (lua_State *L, GCtab *t, TValue *k) | // Returns TValue *. | ldr BASE, L->base | ldr TMP0, [BASE, RA, lsl #3] | str TMP0, [CRET1] | b <3 // No 2nd write barrier needed. | |7: // Possible table write barrier for the value. Skip valiswhite check. | barrierback TAB:CARG2, TMP2w, TMP1 | b <3 break; case BC_TSETB: | decode_RB RB, INS | and RC, RC, #255 | // RA = src, RB = table, RC = index | ldr CARG2, [BASE, RB, lsl #3] | checktab CARG2, ->vmeta_tsetb | ldr CARG3, TAB:CARG2->array | ldr CARG1w, TAB:CARG2->asize | add CARG3, CARG3, RC, lsl #3 | cmp RCw, CARG1w // In array part? | bhs ->vmeta_tsetb | ldr TMP1, [CARG3] | ldr TMP0, [BASE, RA, lsl #3] | ldrb TMP2w, TAB:CARG2->marked | cmp_nil TMP1 // Previous value is nil? | beq >5 |1: | str TMP0, [CARG3] | tbnz TMP2w, #2, >7 // isblack(table) |2: | ins_next | |5: // Check for __newindex if previous value is nil. | ldr TAB:CARG1, TAB:CARG2->metatable | cbz TAB:CARG1, <1 // No metatable: done. | ldrb TMP1w, TAB:CARG1->nomm | tbnz TMP1w, #MM_newindex, <1 // 'no __newindex' flag set: done. | b ->vmeta_tsetb | |7: // Possible table write barrier for the value. Skip valiswhite check. | barrierback TAB:CARG2, TMP2w, TMP1 | b <2 break; case BC_TSETR: | decode_RB RB, INS | and RC, RC, #255 | // RA = src, RB = table, RC = key | ldr CARG2, [BASE, RB, lsl #3] | ldr TMP1, [BASE, RC, lsl #3] | and TAB:CARG2, CARG2, #LJ_GCVMASK | ldr CARG1, TAB:CARG2->array | ldrb TMP2w, TAB:CARG2->marked | ldr CARG4w, TAB:CARG2->asize | add CARG1, CARG1, TMP1, uxtw #3 | tbnz TMP2w, #2, >7 // isblack(table) |2: | cmp TMP1w, CARG4w // In array part? | bhs ->vmeta_tsetr |->BC_TSETR_Z: | ldr TMP0, [BASE, RA, lsl #3] | str TMP0, [CARG1] | ins_next | |7: // Possible table write barrier for the value. Skip valiswhite check. | barrierback TAB:CARG2, TMP2w, TMP0 | b <2 break; case BC_TSETM: | // RA = base (table at base-1), RC = num_const (start index) | add RA, BASE, RA, lsl #3 |1: | ldr RBw, SAVE_MULTRES | ldr TAB:CARG2, [RA, #-8] // Guaranteed to be a table. | ldr TMP1, [KBASE, RC, lsl #3] // Integer constant is in lo-word. | sub RB, RB, #8 | cbz RB, >4 // Nothing to copy? | and TAB:CARG2, CARG2, #LJ_GCVMASK | ldr CARG1w, TAB:CARG2->asize | add CARG3w, TMP1w, RBw, lsr #3 | ldr CARG4, TAB:CARG2->array | cmp CARG3, CARG1 | add RB, RA, RB | bhi >5 | add TMP1, CARG4, TMP1w, uxtw #3 | ldrb TMP2w, TAB:CARG2->marked |3: // Copy result slots to table. | ldr TMP0, [RA], #8 | str TMP0, [TMP1], #8 | cmp RA, RB | blo <3 | tbnz TMP2w, #2, >7 // isblack(table) |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. | b <1 | |7: // Possible table write barrier for any value. Skip valiswhite check. | barrierback TAB:CARG2, TMP2w, TMP1 | b <4 break; /* -- Calls and vararg handling ----------------------------------------- */ case BC_CALLM: | // RA = base, (RB = nresults+1,) RC = extra_nargs | ldr TMP0w, SAVE_MULTRES | decode_RC8RD NARGS8:RC, RC | add NARGS8:RC, NARGS8:RC, TMP0 | b ->BC_CALL_Z break; case BC_CALL: | decode_RC8RD NARGS8:RC, RC | // RA = base, (RB = nresults+1,) RC = (nargs+1)*8 |->BC_CALL_Z: | mov RB, BASE // Save old BASE for vmeta_call. | add BASE, BASE, RA, lsl #3 | ldr CARG3, [BASE], #16 | sub NARGS8:RC, NARGS8:RC, #8 | checkfunc CARG3, ->vmeta_call | ins_call break; case BC_CALLMT: | // RA = base, (RB = 0,) RC = extra_nargs | ldr TMP0w, SAVE_MULTRES | add NARGS8:RC, TMP0, RC, lsl #3 | b ->BC_CALLT1_Z break; case BC_CALLT: | lsl NARGS8:RC, RC, #3 | // RA = base, (RB = 0,) RC = (nargs+1)*8 |->BC_CALLT1_Z: | add RA, BASE, RA, lsl #3 | ldr TMP1, [RA], #16 | sub NARGS8:RC, NARGS8:RC, #8 | checktp CARG3, TMP1, LJ_TFUNC, ->vmeta_callt | ldr PC, [BASE, FRAME_PC] |->BC_CALLT2_Z: | mov RB, #0 | ldrb TMP2w, LFUNC:CARG3->ffid | tst PC, #FRAME_TYPE | bne >7 |1: | str TMP1, [BASE, FRAME_FUNC] // Copy function down, but keep PC. | cbz NARGS8:RC, >3 |2: | ldr TMP0, [RA, RB] | add TMP1, RB, #8 | cmp TMP1, NARGS8:RC | str TMP0, [BASE, RB] | mov RB, TMP1 | bne <2 |3: | cmp TMP2, #1 // (> FF_C) Calling a fast function? | bhi >5 |4: | ins_callt | |5: // Tailcall to a fast function with a Lua frame below. | ldrb RAw, [PC, #-4+OFS_RA] | sub CARG1, BASE, RA, lsl #3 | ldr LFUNC:CARG1, [CARG1, #-32] | and LFUNC:CARG1, CARG1, #LJ_GCVMASK | ldr CARG1, LFUNC:CARG1->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? | csel TMP2, RB, TMP2, ne // Clear ffid if no Lua function below. | bne <1 | sub BASE, BASE, PC | ldr PC, [BASE, FRAME_PC] | tst PC, #FRAME_TYPE | csel TMP2, RB, TMP2, ne // Clear ffid if no Lua function below. | b <1 break; case BC_ITERC: | // RA = base, (RB = nresults+1, RC = nargs+1 (2+1)) | add RA, BASE, RA, lsl #3 | ldr CARG3, [RA, #-24] | mov RB, BASE // Save old BASE for vmeta_call. | ldp CARG1, CARG2, [RA, #-16] | add BASE, RA, #16 | mov NARGS8:RC, #16 // Iterators get 2 arguments. | str CARG3, [RA] // Copy callable. | stp CARG1, CARG2, [RA, #16] // Copy state and control var. | checkfunc CARG3, ->vmeta_call | ins_call break; case BC_ITERN: |.if JIT | hotloop |.endif |->vm_IITERN: | // RA = base, (RB = nresults+1, RC = nargs+1 (2+1)) | add RA, BASE, RA, lsl #3 | ldr TAB:RB, [RA, #-16] | ldrh TMP3w, [PC, # OFS_RD] | ldr CARG1w, [RA, #-8+LO] // Get index from control var. | add PC, PC, #4 | add TMP3, PC, TMP3, lsl #2 | and TAB:RB, RB, #LJ_GCVMASK | sub TMP3, TMP3, #0x20000 | ldr TMP1w, TAB:RB->asize | ldr CARG2, TAB:RB->array |1: // Traverse array part. | subs RC, CARG1, TMP1 | add CARG3, CARG2, CARG1, lsl #3 | bhs >5 // Index points after array part? | ldr TMP0, [CARG3] | cmp_nil TMP0 | cinc CARG1, CARG1, eq // Skip holes in array part. | beq <1 | add_TISNUM CARG1, CARG1 | stp CARG1, TMP0, [RA] | add CARG1, CARG1, #1 |3: | str CARG1w, [RA, #-8+LO] // Update control var. | mov PC, TMP3 |4: | ins_next | |5: // Traverse hash part. | ldr TMP2w, TAB:RB->hmask | ldr NODE:RB, TAB:RB->node |6: | add CARG1, RC, RC, lsl #1 | cmp RC, TMP2 // End of iteration? Branch to ITERN+1. | add NODE:CARG3, NODE:RB, CARG1, lsl #3 // node = tab->node + idx*3*8 | bhi <4 | ldp TMP0, CARG1, NODE:CARG3->val | cmp_nil TMP0 | add RC, RC, #1 | beq <6 // Skip holes in hash part. | stp CARG1, TMP0, [RA] | add CARG1, RC, TMP1 | b <3 break; case BC_ISNEXT: | // RA = base, RC = target (points to ITERN) | add RA, BASE, RA, lsl #3 | ldr CFUNC:CARG1, [RA, #-24] | add RC, PC, RC, lsl #2 | ldp TAB:CARG3, CARG4, [RA, #-16] | sub RC, RC, #0x20000 | checkfunc CFUNC:CARG1, >5 | asr TMP0, TAB:CARG3, #47 | ldrb TMP1w, CFUNC:CARG1->ffid | cmp_nil CARG4 | ccmn TMP0, #-LJ_TTAB, #0, eq | ccmp TMP1w, #FF_next_N, #0, eq | bne >5 | mov TMP0w, #0xfffe7fff // LJ_KEYINDEX | lsl TMP0, TMP0, #32 | str TMP0, [RA, #-8] // Initialize control var. |1: | mov PC, RC | ins_next | |5: // Despecialize bytecode if any of the checks fail. |.if JIT | ldrb TMP2w, [RC, # OFS_OP] |.endif | mov TMP0, #BC_JMP | mov TMP1, #BC_ITERC | strb TMP0w, [PC, #-4+OFS_OP] |.if JIT | cmp TMP2w, #BC_ITERN | bne >6 |.endif | strb TMP1w, [RC, # OFS_OP] | b <1 |.if JIT |6: // Unpatch JLOOP. | ldr RA, [GL, #GL_J(trace)] | ldrh TMP2w, [RC, # OFS_RD] | ldr TRACE:RA, [RA, TMP2, lsl #3] | ldr TMP2w, TRACE:RA->startins | bfxil TMP2w, TMP1w, #0, #8 | str TMP2w, [RC] | b <1 |.endif break; case BC_VARG: | decode_RB RB, INS | and RC, RC, #255 | // RA = base, RB = (nresults+1), RC = numparams | ldr TMP1, [BASE, FRAME_PC] | add TMP0, BASE, RC, lsl #3 | add RC, BASE, RA, lsl #3 // RC = destination | add TMP0, TMP0, #FRAME_VARG | add TMP2, RC, RB, lsl #3 | sub RA, TMP0, TMP1 // RA = vbase | // Note: RA may now be even _above_ BASE if nargs was < numparams. | sub TMP3, BASE, #16 // TMP3 = vtop | cbz RB, >5 | sub TMP2, TMP2, #16 |1: // Copy vararg slots to destination slots. | cmp RA, TMP3 | ldr TMP0, [RA], #8 | csinv TMP0, TMP0, xzr, lo // TISNIL = ~xzr | cmp RC, TMP2 | str TMP0, [RC], #8 | blo <1 |2: | ins_next | |5: // Copy all varargs. | ldr TMP0, L->maxstack | subs TMP2, TMP3, RA | csel RB, xzr, TMP2, le // MULTRES = (max(vtop-vbase,0)+1)*8 | add RB, RB, #8 | add TMP1, RC, TMP2 | str RBw, SAVE_MULTRES | ble <2 // Nothing to copy. | cmp TMP1, TMP0 | bhi >7 |6: | ldr TMP0, [RA], #8 | str TMP0, [RC], #8 | cmp RA, TMP3 | blo <6 | b <2 | |7: // Grow stack for varargs. | lsr CARG2, TMP2, #3 | stp BASE, RC, L->base | mov CARG1, L | sub RA, RA, BASE // Need delta, because BASE may change. | str PC, SAVE_PC | bl extern lj_state_growstack // (lua_State *L, int n) | ldp BASE, RC, L->base | add RA, BASE, RA | sub TMP3, BASE, #16 | b <6 break; /* -- Returns ----------------------------------------------------------- */ case BC_RETM: | // RA = results, RC = extra results | ldr TMP0w, SAVE_MULTRES | ldr PC, [BASE, FRAME_PC] | add RA, BASE, RA, lsl #3 | add RC, TMP0, RC, lsl #3 | b ->BC_RETM_Z break; case BC_RET: | // RA = results, RC = nresults+1 | ldr PC, [BASE, FRAME_PC] | lsl RC, RC, #3 | add RA, BASE, RA, lsl #3 |->BC_RETM_Z: | str RCw, 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 INSw, [PC, #-4] | subs TMP1, RC, #8 | sub CARG3, BASE, #16 | beq >3 |2: | ldr TMP0, [RA], #8 | add BASE, BASE, #8 | sub TMP1, TMP1, #8 | str TMP0, [BASE, #-24] | cbnz TMP1, <2 |3: | decode_RA RA, INS | sub CARG4, CARG3, RA, lsl #3 | decode_RB RB, INS | ldr LFUNC:CARG1, [CARG4, FRAME_FUNC] |5: | cmp RC, RB, lsl #3 // More results expected? | blo >6 | and LFUNC:CARG1, CARG1, #LJ_GCVMASK | mov BASE, CARG4 | ldr CARG2, LFUNC:CARG1->pc | ldr KBASE, [CARG2, #PC2PROTO(k)] | ins_next | |6: // Fill up results with nil. | add BASE, BASE, #8 | add RC, RC, #8 | str TISNIL, [BASE, #-24] | b <5 | |->BC_RETV1_Z: // Non-standard return case. | add RA, BASE, RA, lsl #3 |->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, RC = nresults+1 | ldr PC, [BASE, FRAME_PC] | lsl RC, RC, #3 | str RCw, SAVE_MULTRES | ands CARG1, PC, #FRAME_TYPE | eor CARG2, PC, #FRAME_VARG | bne ->BC_RETV1_Z | ldr INSw, [PC, #-4] if (op == BC_RET1) { | ldr TMP0, [BASE, RA, lsl #3] } | sub CARG4, BASE, #16 | decode_RA RA, INS | sub BASE, CARG4, RA, lsl #3 if (op == BC_RET1) { | str TMP0, [CARG4], #8 } | decode_RB RB, INS | ldr LFUNC:CARG1, [BASE, FRAME_FUNC] |5: | cmp RC, RB, lsl #3 | blo >6 | and LFUNC:CARG1, CARG1, #LJ_GCVMASK | ldr CARG2, LFUNC:CARG1->pc | ldr KBASE, [CARG2, #PC2PROTO(k)] | ins_next | |6: // Fill up results with nil. | add RC, RC, #8 | str TISNIL, [CARG4], #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, RC = target (after end of loop or start of loop) vk = (op == BC_IFORL || op == BC_JFORL); | add RA, BASE, RA, lsl #3 | ldp CARG1, CARG2, FOR_IDX // CARG1 = IDX, CARG2 = STOP | ldr CARG3, FOR_STEP // CARG3 = STEP if (op != BC_JFORL) { | add RC, PC, RC, lsl #2 | sub RC, RC, #0x20000 } | checkint CARG1, >5 if (!vk) { | checkint CARG2, ->vmeta_for | checkint CARG3, ->vmeta_for | tbnz CARG3w, #31, >4 | cmp CARG1w, CARG2w } else { | adds CARG1w, CARG1w, CARG3w | bvs >2 | add_TISNUM TMP0, CARG1 | tbnz CARG3w, #31, >4 | cmp CARG1w, CARG2w } |1: if (op == BC_FORI) { | csel PC, RC, PC, gt } else if (op == BC_JFORI) { | mov PC, RC | ldrh RCw, [RC, #-4+OFS_RD] } else if (op == BC_IFORL) { | csel PC, RC, PC, le } if (vk) { | str TMP0, FOR_IDX | str TMP0, FOR_EXT } else { | str CARG1, FOR_EXT } if (op == BC_JFORI || op == BC_JFORL) { | ble =>BC_JLOOP } |2: | ins_next | |4: // Invert check for negative step. | cmp CARG2w, CARG1w | b <1 | |5: // FP loop. | ldp d0, d1, FOR_IDX | blo ->vmeta_for if (!vk) { | checknum CARG2, ->vmeta_for | checknum CARG3, ->vmeta_for | str d0, FOR_EXT } else { | ldr d2, FOR_STEP | fadd d0, d0, d2 } | tbnz CARG3, #63, >7 | fcmp d0, d1 |6: if (vk) { | str d0, FOR_IDX | str d0, FOR_EXT } if (op == BC_FORI) { | csel PC, RC, PC, hi } else if (op == BC_JFORI) { | ldrh RCw, [RC, #-4+OFS_RD] | bls =>BC_JLOOP } else if (op == BC_IFORL) { | csel PC, RC, PC, ls } else { | bls =>BC_JLOOP } | b <2 | |7: // Invert check for negative step. | fcmp d1, d0 | b <6 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, RC = target | ldr CARG1, [BASE, RA, lsl #3] | add TMP1, BASE, RA, lsl #3 | cmp_nil CARG1 | beq >1 // Stop if iterator returned nil. if (op == BC_JITERL) { | str CARG1, [TMP1, #-8] | b =>BC_JLOOP } else { | add TMP0, PC, RC, lsl #2 // Otherwise save control var + branch. | sub PC, TMP0, #0x20000 | str CARG1, [TMP1, #-8] } |1: | ins_next break; case BC_LOOP: | // RA = base, 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, RC = target (loop extent) | ins_next break; case BC_JLOOP: |.if JIT | // RA = base (ignored), RC = traceno | ldr CARG1, [GL, #GL_J(trace)] | st_vmstate wzr // Traces on ARM64 don't store the trace #, so use 0. | ldr TRACE:RC, [CARG1, RC, lsl #3] |.if PAUTH | ldr RA, TRACE:RC->mcauth |.else | ldr RA, TRACE:RC->mcode |.endif | str BASE, GL->jit_base | str L, GL->tmpbuf.L | sub sp, sp, #16 // See SPS_FIXED. Avoids sp adjust in every root trace. |.if PAUTH | braa RA, RC |.else | br RA |.endif |.endif break; case BC_JMP: | // RA = base (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 TMP1w, [PC, #-4+PC2PROTO(numparams)] | ldr KBASE, [PC, #-4+PC2PROTO(k)] | cmp RA, CARG1 | bhi ->vm_growstack_l |2: | cmp NARGS8:RC, TMP1, lsl #3 // Check for missing parameters. | blo >3 if (op == BC_JFUNCF) { | decode_RD RC, INS | b =>BC_JLOOP } else { | ins_next } | |3: // Clear missing parameters. | str TISNIL, [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 | movn TMP0, #~LJ_TFUNC | add TMP2, BASE, RC | add LFUNC:CARG3, CARG3, TMP0, lsl #47 | add RA, RA, RC | sub CARG1, CARG1, #8 | add TMP0, RC, #16+FRAME_VARG | str LFUNC:CARG3, [TMP2], #8 // Store (tagged) copy of LFUNC. | ldr KBASE, [PC, #-4+PC2PROTO(k)] | cmp RA, CARG1 | str TMP0, [TMP2], #8 // Store delta + FRAME_VARG. | bhs ->vm_growstack_l | sub RC, TMP2, #16 | ldrb TMP1w, [PC, #-4+PC2PROTO(numparams)] | mov RA, BASE | mov BASE, TMP2 | cbz TMP1, >2 |1: | cmp RA, RC // Less args than parameters? | bhs >3 | ldr TMP0, [RA] | sub TMP1, TMP1, #1 | str TISNIL, [RA], #8 // Clear old fixarg slot (help the GC). | str TMP0, [TMP2], #8 | cbnz TMP1, <1 |2: | ins_next | |3: | sub TMP1, TMP1, #1 | str TISNIL, [TMP2], #8 | cbz TMP1, <2 | b <3 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, GL->wrapf } | add CARG2, RA, NARGS8:RC | ldr CARG1, L->maxstack | add RC, BASE, NARGS8:RC | cmp CARG2, CARG1 | stp BASE, RC, L->base if (op == BC_FUNCCW) { | ldr CARG2, CFUNC:CARG3->f } | mv_vmstate TMP0w, C | mov CARG1, L | bhi ->vm_growstack_c // Need to grow stack. | st_vmstate TMP0w | blr_auth CARG4 // (lua_State *L [, lua_CFunction f]) | // Returns nresults. | ldp BASE, TMP1, L->base | str L, GL->cur_L | sbfiz RC, CRET1, #3, #32 | st_vmstate ST_INTERP | ldr PC, [BASE, FRAME_PC] | sub RA, TMP1, 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 -8\n" "\t.byte 30\n" /* Return address is in lr. */ "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 16\n" /* def_cfa fp 16 */ "\t.align 3\n" ".LECIE0:\n\n"); fprintf(ctx->fp, ".LSFDE0:\n" "\t.long .LEFDE0-.LASFDE0\n" ".LASFDE0:\n" "\t.long .Lframe0\n" "\t.quad .Lbegin\n" "\t.quad %d\n" "\t.byte 0x9e\n\t.uleb128 1\n" /* offset lr */ "\t.byte 0x9d\n\t.uleb128 2\n", /* offset fp */ fcofs); for (i = 19; i <= 28; i++) /* offset x19-x28 */ fprintf(ctx->fp, "\t.byte 0x%x\n\t.uleb128 %d\n", 0x80+i, i+(3-19)); for (i = 8; i <= 15; i++) /* offset d8-d15 */ fprintf(ctx->fp, "\t.byte 5\n\t.uleb128 0x%x\n\t.uleb128 %d\n", 64+i, i+(3+(28-19+1)-8)); fprintf(ctx->fp, "\t.align 3\n" ".LEFDE0:\n\n"); #if LJ_HASFFI fprintf(ctx->fp, ".LSFDE1:\n" "\t.long .LEFDE1-.LASFDE1\n" ".LASFDE1:\n" "\t.long .Lframe0\n" "\t.quad lj_vm_ffi_call\n" "\t.quad %d\n" "\t.byte 0x9e\n\t.uleb128 1\n" /* offset lr */ "\t.byte 0x9d\n\t.uleb128 2\n" /* offset fp */ "\t.byte 0x93\n\t.uleb128 3\n" /* offset x19 */ "\t.byte 0x94\n\t.uleb128 4\n" /* offset x20 */ "\t.align 3\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 -8\n" "\t.byte 30\n" /* Return address is in lr. */ "\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 29\n\t.uleb128 16\n" /* def_cfa fp 16 */ "\t.align 3\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 0x9e\n\t.uleb128 1\n" /* offset lr */ "\t.byte 0x9d\n\t.uleb128 2\n", /* offset fp */ fcofs); for (i = 19; i <= 28; i++) /* offset x19-x28 */ fprintf(ctx->fp, "\t.byte 0x%x\n\t.uleb128 %d\n", 0x80+i, i+(3-19)); for (i = 8; i <= 15; i++) /* offset d8-d15 */ fprintf(ctx->fp, "\t.byte 5\n\t.uleb128 0x%x\n\t.uleb128 %d\n", 64+i, i+(3+(28-19+1)-8)); fprintf(ctx->fp, "\t.align 3\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 -8\n" "\t.byte 30\n" /* Return address is in lr. */ "\t.uleb128 1\n" /* augmentation length */ "\t.byte 0x1b\n" /* pcrel|sdata4 */ "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 16\n" /* def_cfa fp 16 */ "\t.align 3\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 0x9e\n\t.uleb128 1\n" /* offset lr */ "\t.byte 0x9d\n\t.uleb128 2\n" /* offset fp */ "\t.byte 0x93\n\t.uleb128 3\n" /* offset x19 */ "\t.byte 0x94\n\t.uleb128 4\n" /* offset x20 */ "\t.align 3\n" ".LEFDE3:\n\n", (int)ctx->codesz - fcofs); #endif #endif break; #if !LJ_NO_UNWIND case BUILD_machasm: { #if LJ_HASFFI int fcsize = 0; #endif int j; 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.uleb128 0x1\n" "\t.sleb128 -8\n" "\t.byte 30\n" /* Return address is in lr. */ "\t.uleb128 6\n" /* augmentation length */ "\t.byte 0x9b\n" /* indirect|pcrel|sdata4 */ "\t.long _lj_err_unwind_dwarf@GOT-.\n" "\t.byte 0x1b\n" /* pcrel|sdata4 */ "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 16\n" /* def_cfa fp 16 */ "\t.align 3\n" "LECIEX:\n\n"); for (j = 0; j < ctx->nsym; j++) { const char *name = ctx->sym[j].name; int32_t size = ctx->sym[j+1].ofs - ctx->sym[j].ofs; if (size == 0) continue; #if LJ_HASFFI if (!strcmp(name, "_lj_vm_ffi_call")) { fcsize = size; continue; } #endif fprintf(ctx->fp, "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.uleb128 0\n" /* augmentation length */ "\t.byte 0x9e\n\t.uleb128 1\n" /* offset lr */ "\t.byte 0x9d\n\t.uleb128 2\n", /* offset fp */ j, j, j, j, j, j, j, name, size); for (i = 19; i <= 28; i++) /* offset x19-x28 */ fprintf(ctx->fp, "\t.byte 0x%x\n\t.uleb128 %d\n", 0x80+i, i+(3-19)); for (i = 8; i <= 15; i++) /* offset d8-d15 */ fprintf(ctx->fp, "\t.byte 5\n\t.uleb128 0x%x\n\t.uleb128 %d\n", 64+i, i+(3+(28-19+1)-8)); fprintf(ctx->fp, "\t.align 3\n" "LEFDE%d:\n\n", j); } #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.uleb128 0x1\n" "\t.sleb128 -8\n" "\t.byte 30\n" /* Return address is in lr. */ "\t.uleb128 1\n" /* augmentation length */ "\t.byte 0x1b\n" /* pcrel|sdata4 */ "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 16\n" /* def_cfa fp 16 */ "\t.align 3\n" "LECIEY:\n\n"); fprintf(ctx->fp, "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.uleb128 0\n" /* augmentation length */ "\t.byte 0x9e\n\t.uleb128 1\n" /* offset lr */ "\t.byte 0x9d\n\t.uleb128 2\n" /* offset fp */ "\t.byte 0x93\n\t.uleb128 3\n" /* offset x19 */ "\t.byte 0x94\n\t.uleb128 4\n" /* offset x20 */ "\t.align 3\n" "LEFDEY:\n\n", fcsize); } #endif } break; #endif default: break; } } subprojects/luajit/src/lj_asm_ppc.h0000644000175000017500000022402714741067622016766 0ustar aniolaniol/* ** PPC IR assembler (SSA IR -> machine code). ** Copyright (C) 2005-2023 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); } } } else if (ir->o == IR_TMPREF) { *ofsp = (int32_t)(offsetof(global_State, tmptv)-32768); return RID_JGL; } } *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) { lj_assertA(ofs == 0, "bad usage"); 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); } #if !LJ_SOFTFP /* 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 ((as->flags & JIT_F_OPT_FMA) && 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; } #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_XNARGS(ci); int32_t ofs = 8; Reg gpr = REGARG_FIRSTGPR; #if !LJ_SOFTFP Reg fpr = REGARG_FIRSTFPR; #endif 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 !LJ_SOFTFP if (irt_isfp(ir->t)) { if (fpr <= REGARG_LASTFPR) { lj_assertA(rset_test(as->freeset, fpr), "reg %d not free", 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 #endif { if (gpr <= REGARG_LASTGPR) { lj_assertA(rset_test(as->freeset, gpr), "reg %d not free", 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 !LJ_SOFTFP 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); #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 = ((ir+1)->o == IR_HIOP && !irt_isnil((ir+1)->t)); #if !LJ_SOFTFP if ((ci->flags & CCI_NOFPRCLOBBER)) drop &= ~RSET_FPR; #endif 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)) { lj_assertA(!irt_ispri(ir->t), "PRI dest"); if (!LJ_SOFTFP && 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_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 *)(intptr_t)(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); } /* -- 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+LJ_FR2+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); } /* -- Buffer operations --------------------------------------------------- */ #if LJ_HASBUFFER static void asm_bufhdr_write(ASMState *as, Reg sb) { Reg tmp = ra_scratch(as, rset_exclude(RSET_GPR, sb)); IRIns irgc; irgc.ot = IRT(0, IRT_PGC); /* GC type. */ emit_storeofs(as, &irgc, RID_TMP, sb, offsetof(SBuf, L)); emit_rot(as, PPCI_RLWIMI, RID_TMP, tmp, 0, 31-lj_fls(SBUF_MASK_FLAG), 31); emit_getgl(as, RID_TMP, cur_L); emit_loadofs(as, &irgc, tmp, sb, offsetof(SBuf, L)); } #endif /* -- Type conversions ---------------------------------------------------- */ #if !LJ_SOFTFP 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 *)&as->J->k32[LJ_K32_2P52_2P31], 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); } #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. */ lj_assertA(!(irt_isint64(ir->t) || (st == IRT_I64 || st == IRT_U64)), "IR %04d has unsplit 64 bit type", (int)(ir - as->ir) - REF_BIAS); #if LJ_SOFTFP /* FP conversions are handled by SPLIT. */ lj_assertA(!irt_isfp(ir->t) && !(st == IRT_NUM || st == IRT_FLOAT), "IR %04d has FP type", (int)(ir - as->ir) - REF_BIAS); /* Can't check for same types: SPLIT uses CONV int.int + BXOR for sfp NEG. */ #else lj_assertA(irt_type(ir->t) != st, "inconsistent types for CONV"); 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)); 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); emit_lsptr(as, PPCI_LFS, (fbias & 31), &as->J->k32[st == IRT_U32 ? LJ_K32_2P52 : LJ_K32_2P52_2P31], 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. */ lj_assertA(irt_isint(ir->t) && st == IRT_NUM, "bad type for checked CONV"); 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 *)&as->J->k32[LJ_K32_2P31], 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 #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, ir->op1, RSET_GPR); lj_assertA(irt_isint(ir->t) || irt_isu32(ir->t), "bad type for CONV EXT"); 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. */ } } } static void asm_strto(ASMState *as, IRIns *ir) { const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_strscan_num]; IRRef args[2]; int32_t ofs = SPOFS_TMP; #if LJ_SOFTFP ra_evictset(as, RSET_SCRATCH); if (ra_used(ir)) { if (ra_hasspill(ir->s) && ra_hasspill((ir+1)->s) && (ir->s & 1) == LJ_BE && (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 & ~1); } else { Reg rhi = ra_dest(as, ir+1, RSET_GPR); Reg rlo = ra_dest(as, ir, rset_exclude(RSET_GPR, rhi)); emit_tai(as, PPCI_LWZ, rhi, RID_SP, ofs); emit_tai(as, PPCI_LWZ, rlo, RID_SP, ofs+4); } } #else RegSet drop = RSET_SCRATCH; if (ra_hasreg(ir->r)) rset_set(drop, ir->r); /* Spill dest reg (if any). */ ra_evictset(as, drop); if (ir->s) ofs = sps_scale(ir->s); #endif 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. */ emit_tai(as, PPCI_ADDI, ra_releasetmp(as, ASMREF_TMP1), RID_SP, ofs); } /* -- Memory references --------------------------------------------------- */ /* Get pointer to TValue. */ static void asm_tvptr(ASMState *as, Reg dest, IRRef ref, MSize mode) { int32_t tmpofs = (int32_t)(offsetof(global_State, tmptv)-32768); if ((mode & IRTMPREF_IN1)) { IRIns *ir = IR(ref); if (irt_isnum(ir->t)) { if ((mode & IRTMPREF_OUT1)) { #if LJ_SOFTFP lj_assertA(irref_isk(ref), "unsplit FP op"); emit_tai(as, PPCI_ADDI, dest, RID_JGL, tmpofs); emit_setgl(as, ra_allock(as, (int32_t)ir_knum(ir)->u32.lo, RSET_GPR), tmptv.u32.lo); emit_setgl(as, ra_allock(as, (int32_t)ir_knum(ir)->u32.hi, RSET_GPR), tmptv.u32.hi); #else Reg src = ra_alloc1(as, ref, RSET_FPR); emit_tai(as, PPCI_ADDI, dest, RID_JGL, tmpofs); emit_fai(as, PPCI_STFD, src, RID_JGL, tmpofs); #endif } else if (irref_isk(ref)) { /* Use the number constant itself as a TValue. */ ra_allockreg(as, i32ptr(ir_knum(ir)), dest); } else { #if LJ_SOFTFP lj_assertA(0, "unsplit FP op"); #else /* Otherwise force a spill and use the spill slot. */ emit_tai(as, PPCI_ADDI, dest, RID_SP, ra_spill(as, ir)); #endif } } else { /* Otherwise use g->tmptv to hold the TValue. */ Reg type; emit_tai(as, PPCI_ADDI, dest, RID_JGL, tmpofs); if (!irt_ispri(ir->t)) { Reg src = ra_alloc1(as, ref, RSET_GPR); emit_setgl(as, src, tmptv.gcr); } if (LJ_SOFTFP && (ir+1)->o == IR_HIOP && !irt_isnil((ir+1)->t)) type = ra_alloc1(as, ref+1, RSET_GPR); else type = ra_allock(as, irt_toitype(ir->t), RSET_GPR); emit_setgl(as, type, tmptv.it); } } else { emit_tai(as, PPCI_ADDI, dest, RID_JGL, tmpofs); } } 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); int isk = irref_isk(refkey); IRType1 kt = irkey->t; uint32_t khash; MCLabel l_end, l_loop, l_next; rset_clear(allow, tab); #if LJ_SOFTFP if (!isk) { key = ra_alloc1(as, refkey, allow); rset_clear(allow, key); if (irkey[1].o == IR_HIOP) { if (ra_hasreg((irkey+1)->r)) { tmpnum = (irkey+1)->r; ra_noweak(as, tmpnum); } else { tmpnum = ra_allocref(as, refkey+1, allow); } rset_clear(allow, tmpnum); } } #else 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); } #endif 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 (!LJ_SOFTFP && 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); } if (LJ_SOFTFP && ra_hasreg(tmpnum)) emit_ab(as, PPCI_CMPW, tmp1, tmpnum); else 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 = isk ? ir_khash(as, irkey) : 1; if (khash == 0) { emit_tai(as, PPCI_LWZ, dest, tab, (int32_t)offsetof(GCtab, node)); } else { Reg tmphash = tmp1; if (isk) 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 (isk) { /* Nothing to do. */ } else if (irt_isstr(kt)) { emit_tai(as, PPCI_LWZ, tmp1, key, (int32_t)offsetof(GCstr, sid)); } 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 (LJ_SOFTFP ? (irkey[1].o == IR_HIOP) : irt_isnum(kt)) { #if LJ_SOFTFP emit_asb(as, PPCI_XOR, tmp2, key, tmp1); emit_rotlwi(as, dest, tmp1, HASH_ROT1); emit_tab(as, PPCI_ADD, tmp1, tmpnum, tmpnum); #else 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); #endif } 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); lj_assertA(ofs % sizeof(Node) == 0, "unaligned HREFK slot"); 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_uref(ASMState *as, IRIns *ir) { Reg dest = ra_dest(as, ir, RSET_GPR); int guarded = (irt_t(ir->t) & (IRT_GUARD|IRT_TYPE)) == (IRT_GUARD|IRT_PGC); if (irref_isk(ir->op1) && !guarded) { 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 { if (guarded) { asm_guardcc(as, ir->o == IR_UREFC ? CC_NE : CC_EQ); emit_ai(as, PPCI_CMPWI, RID_TMP, 1); } if (ir->o == IR_UREFC) emit_tai(as, PPCI_ADDI, dest, dest, (int32_t)offsetof(GCupval, tv)); else emit_tai(as, PPCI_LWZ, dest, dest, (int32_t)offsetof(GCupval, v)); if (guarded) emit_tai(as, PPCI_LBZ, RID_TMP, dest, (int32_t)offsetof(GCupval, closed)); if (irref_isk(ir->op1)) { GCfunc *fn = ir_kfunc(IR(ir->op1)); int32_t k = (int32_t)gcrefu(fn->l.uvptr[(ir->op2 >> 8)]); emit_loadi(as, dest, k); } else { emit_tai(as, PPCI_LWZ, dest, ra_alloc1(as, ir->op1, RSET_GPR), (int32_t)offsetof(GCfuncL, uvptr) + 4*(int32_t)(ir->op2 >> 8)); } } } static void asm_fref(ASMState *as, IRIns *ir) { UNUSED(as); UNUSED(ir); lj_assertA(!ra_used(ir), "unfused FREF"); } 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(ASMState *as, IRIns *ir) { UNUSED(as); 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: lj_assertA(!LJ_SOFTFP, "unsplit FP op"); return PPCI_LFD; case IRT_FLOAT: if (!LJ_SOFTFP) return PPCI_LFS; default: return PPCI_LWZ; } } static PPCIns asm_fxstoreins(ASMState *as, IRIns *ir) { UNUSED(as); 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: lj_assertA(!LJ_SOFTFP, "unsplit FP op"); return PPCI_STFD; case IRT_FLOAT: if (!LJ_SOFTFP) return PPCI_STFS; default: return PPCI_STW; } } static void asm_fload(ASMState *as, IRIns *ir) { Reg dest = ra_dest(as, ir, RSET_GPR); PPCIns pi = asm_fxloadins(as, ir); Reg idx; int32_t ofs; if (ir->op1 == REF_NIL) { /* FLOAD from GG_State with offset. */ idx = RID_JGL; ofs = (ir->op2 << 2) - 32768 - GG_OFS(g); } else { idx = ra_alloc1(as, ir->op1, RSET_GPR); 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]; } lj_assertA(!irt_isi8(ir->t), "unsupported FLOAD I8"); 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(as, ir); emit_tai(as, pi, 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); lj_assertA(!(ir->op2 & IRXLOAD_UNALIGNED), "unaligned XLOAD"); if (irt_isi8(ir->t)) emit_as(as, PPCI_EXTSB, dest, dest); asm_fusexref(as, asm_fxloadins(as, 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, (!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR); asm_fusexref(as, asm_fxstoreins(as, ir), src, ir->op1, rset_exclude(RSET_GPR, src), ofs); } } #define asm_xstore(as, ir) asm_xstore_(as, ir, 0) 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 (LJ_SOFTFP && (ir+1)->o == IR_HIOP) { t.irt = IRT_NUM; if (ra_used(ir+1)) { type = ra_dest(as, ir+1, allow); rset_clear(allow, type); } ofs = 0; } if (ra_used(ir)) { lj_assertA((LJ_SOFTFP ? 0 : irt_isnum(ir->t)) || irt_isint(ir->t) || irt_isaddr(ir->t), "bad load type %d", irt_type(ir->t)); if (LJ_SOFTFP || !irt_isnum(t)) ofs = 0; dest = ra_dest(as, ir, (!LJ_SOFTFP && irt_isnum(t)) ? RSET_FPR : allow); rset_clear(allow, dest); } idx = asm_fuseahuref(as, ir->op1, &ofs, allow); if (ir->o == IR_VLOAD) { ofs = ofs != AHUREF_LSX ? ofs + 8 * ir->op2 : ir->op2 ? 8 * ir->op2 : AHUREF_LSX; } 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 (!LJ_SOFTFP && 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, LJ_SOFTFP ? PPCI_LWZ : PPCI_LFD, dest, idx, ofs+4*LJ_SOFTFP); } } } 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 (!LJ_SOFTFP && 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; } if (LJ_SOFTFP && (ir+1)->o == IR_HIOP) type = ra_alloc1(as, (ir+1)->op2, allow); else type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow); rset_clear(allow, type); } idx = asm_fuseahuref(as, ir->op1, &ofs, allow); if (!LJ_SOFTFP && 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; int hiop = (LJ_SOFTFP && (ir+1)->o == IR_HIOP); if (hiop) t.irt = IRT_NUM; lj_assertA(!(ir->op2 & IRSLOAD_PARENT), "bad parent SLOAD"); /* Handled by asm_head_side(). */ lj_assertA(irt_isguard(ir->t) || !(ir->op2 & IRSLOAD_TYPECHECK), "inconsistent SLOAD variant"); lj_assertA(LJ_DUALNUM || !irt_isint(t) || (ir->op2 & (IRSLOAD_CONVERT|IRSLOAD_FRAME|IRSLOAD_KEYINDEX)), "bad SLOAD type"); #if LJ_SOFTFP lj_assertA(!(ir->op2 & IRSLOAD_CONVERT), "unsplit SLOAD 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(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 #endif if (ra_used(ir)) { lj_assertA(irt_isnum(t) || irt_isint(t) || irt_isaddr(t), "bad SLOAD type %d", irt_type(ir->t)); dest = ra_dest(as, ir, (!LJ_SOFTFP && irt_isnum(t)) ? RSET_FPR : allow); rset_clear(allow, dest); base = ra_alloc1(as, REF_BASE, allow); rset_clear(allow, base); if (!LJ_SOFTFP && (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 *)&as->J->k32[LJ_K32_2P52_2P31], 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); #if !LJ_SOFTFP type = RID_TMP; #endif emit_ab(as, PPCI_CMPLW, type, tisnum); } if (ra_hasreg(dest)) emit_fai(as, LJ_SOFTFP ? PPCI_LWZ : PPCI_LFD, dest, base, ofs-(LJ_SOFTFP?0:4)); } else { if ((ir->op2 & IRSLOAD_TYPECHECK)) { asm_guardcc(as, CC_NE); if ((ir->op2 & IRSLOAD_KEYINDEX)) { emit_ai(as, PPCI_CMPWI, RID_TMP, (LJ_KEYINDEX & 0xffff)); emit_asi(as, PPCI_XORIS, RID_TMP, RID_TMP, (LJ_KEYINDEX >> 16)); } else { 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 id = (CTypeID)IR(ir->op1)->i; CTSize sz; CTInfo info = lj_ctype_info(cts, id, &sz); const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_mem_newgco]; IRRef args[4]; RegSet drop = RSET_SCRATCH; lj_assertA(sz != CTSIZE_INVALID || (ir->o == IR_CNEW && ir->op2 != REF_NIL), "bad CNEW/CNEWI operands"); 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) { RegSet allow = (RSET_GPR & ~RSET_SCRATCH); int32_t ofs = sizeof(GCcdata); lj_assertA(sz == 4 || sz == 8, "bad CNEWI size %d", sz); if (sz == 8) { ofs += 4; lj_assertA((ir+1)->o == IR_HIOP, "expected HIOP for CNEWI"); } 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++; } } else if (ir->op2 != REF_NIL) { /* Create VLA/VLS/aligned cdata. */ ci = &lj_ir_callinfo[IRCALL_lj_cdata_newv]; args[0] = ASMREF_L; /* lua_State *L */ args[1] = ir->op1; /* CTypeID id */ args[2] = ir->op2; /* CTSize sz */ args[3] = ASMREF_TMP1; /* CTSize align */ asm_gencall(as, ci, args); emit_loadi(as, ra_releasetmp(as, ASMREF_TMP1), (int32_t)ctype_align(info)); return; } /* 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, id); /* Lower 16 bit used. Sign-ext ok. */ args[0] = ASMREF_L; /* lua_State *L */ args[1] = ASMREF_TMP1; /* MSize size */ asm_gencall(as, ci, args); ra_allockreg(as, (int32_t)(sz+sizeof(GCcdata)), ra_releasetmp(as, ASMREF_TMP1)); } #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); lj_assertA(LJ_GC_BLACK == 0x04, "bad LJ_GC_BLACK"); 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). */ lj_assertA(IR(ir->op1)->o == IR_UREFC, "bad OBAR type"); 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 ------------------------------------- */ #if !LJ_SOFTFP 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 void asm_fpmath(ASMState *as, IRIns *ir) { 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); } #endif static void asm_add(ASMState *as, IRIns *ir) { #if !LJ_SOFTFP if (irt_isnum(ir->t)) { if (!asm_fusemadd(as, ir, PPCI_FMADD, PPCI_FMADD)) asm_fparith(as, ir, PPCI_FADD); } else #endif { 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 !LJ_SOFTFP if (irt_isnum(ir->t)) { if (!asm_fusemadd(as, ir, PPCI_FMSUB, PPCI_FNMSUB)) asm_fparith(as, ir, PPCI_FSUB); } else #endif { 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 !LJ_SOFTFP if (irt_isnum(ir->t)) { asm_fparith(as, ir, PPCI_FMUL); } else #endif { 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); } } #define asm_fpdiv(as, ir) asm_fparith(as, ir, PPCI_FDIV) static void asm_neg(ASMState *as, IRIns *ir) { #if !LJ_SOFTFP if (irt_isnum(ir->t)) { asm_fpunary(as, ir, PPCI_FNEG); } else #endif { 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); } } #define asm_abs(as, ir) asm_fpunary(as, ir, PPCI_FABS) 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); } #define asm_addov(as, ir) asm_arithov(as, ir, PPCI_ADDO) #define asm_subov(as, ir) asm_arithov(as, ir, PPCI_SUBFO) #define asm_mulov(as, ir) asm_arithov(as, ir, PPCI_MULLWO) #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_bnot(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_bswap(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); } } /* 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_band(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_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); } #define asm_bor(as, ir) asm_bitop(as, ir, PPCI_OR, PPCI_ORI) #define asm_bxor(as, ir) asm_bitop(as, ir, PPCI_XOR, PPCI_XORI) 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); } } #define asm_bshl(as, ir) asm_bitshift(as, ir, PPCI_SLW, 0) #define asm_bshr(as, ir) asm_bitshift(as, ir, PPCI_SRW, 1) #define asm_bsar(as, ir) asm_bitshift(as, ir, PPCI_SRAW, PPCI_SRAWI) #define asm_brol(as, ir) \ asm_bitshift(as, ir, PPCI_RLWNM|PPCF_MB(0)|PPCF_ME(31), \ PPCI_RLWINM|PPCF_MB(0)|PPCF_ME(31)) #define asm_bror(as, ir) lj_assertA(0, "unexpected BROR") #if LJ_SOFTFP static void asm_sfpmin_max(ASMState *as, IRIns *ir) { CCallInfo ci = lj_ir_callinfo[IRCALL_softfp_cmp]; IRRef args[4]; MCLabel l_right, l_end; Reg desthi = ra_dest(as, ir, RSET_GPR), destlo = ra_dest(as, ir+1, RSET_GPR); Reg righthi, lefthi = ra_alloc2(as, ir, RSET_GPR); Reg rightlo, leftlo = ra_alloc2(as, ir+1, RSET_GPR); PPCCC cond = (IROp)ir->o == IR_MIN ? CC_EQ : CC_NE; righthi = (lefthi >> 8); lefthi &= 255; rightlo = (leftlo >> 8); leftlo &= 255; args[0^LJ_BE] = ir->op1; args[1^LJ_BE] = (ir+1)->op1; args[2^LJ_BE] = ir->op2; args[3^LJ_BE] = (ir+1)->op2; l_end = emit_label(as); if (desthi != righthi) emit_mr(as, desthi, righthi); if (destlo != rightlo) emit_mr(as, destlo, rightlo); l_right = emit_label(as); if (l_end != l_right) emit_jmp(as, l_end); if (desthi != lefthi) emit_mr(as, desthi, lefthi); if (destlo != leftlo) emit_mr(as, destlo, leftlo); if (l_right == as->mcp+1) { cond ^= 4; l_right = l_end; ++as->mcp; } emit_condbranch(as, PPCI_BC, cond, l_right); ra_evictset(as, RSET_SCRATCH); emit_cmpi(as, RID_RET, 1); asm_gencall(as, &ci, args); } #endif static void asm_min_max(ASMState *as, IRIns *ir, int ismax) { if (!LJ_SOFTFP && 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, left, right); emit_fab(as, PPCI_FSUB, tmp, ismax ? left : right, ismax ? right : left); } 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); } } #define asm_min(as, ir) asm_min_max(as, ir, 0) #define asm_max(as, ir) asm_min_max(as, ir, 1) /* -- 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 (!LJ_SOFTFP && 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); } } #define asm_equal(as, ir) asm_comp(as, ir) #if LJ_SOFTFP /* SFP 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]; args[0^LJ_BE] = ir->op1; args[1^LJ_BE] = (ir+1)->op1; args[2^LJ_BE] = ir->op2; args[3^LJ_BE] = (ir+1)->op2; for (r = REGARG_FIRSTGPR; r <= REGARG_FIRSTGPR+3; r++) { if (!rset_test(as->freeset, r) && regcost_ref(as->cost[r]) == args[r-REGARG_FIRSTGPR]) rset_clear(drop, r); } ra_evictset(as, drop); asm_setupresult(as, ir, ci); switch ((IROp)ir->o) { case IR_ULT: asm_guardcc(as, CC_EQ); emit_ai(as, PPCI_CMPWI, RID_RET, 0); case IR_ULE: asm_guardcc(as, CC_EQ); emit_ai(as, PPCI_CMPWI, RID_RET, 1); break; case IR_GE: case IR_GT: asm_guardcc(as, CC_EQ); emit_ai(as, PPCI_CMPWI, RID_RET, 2); default: asm_guardcc(as, (asm_compmap[ir->o] & 0xf)); emit_ai(as, PPCI_CMPWI, RID_RET, 0); break; } asm_gencall(as, ci, args); } #endif #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 /* -- Split register ops -------------------------------------------------- */ /* Hiword op of a split 32/32 bit op. Previous op is be the loword op. */ static void asm_hiop(ASMState *as, IRIns *ir) { /* 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 LJ_HASFFI || LJ_SOFTFP if ((ir-1)->o == IR_CONV) { /* Conversions to/from 64 bit. */ as->curins--; /* Always skip the CONV. */ #if LJ_HASFFI && !LJ_SOFTFP if (usehi || uselo) asm_conv64(as, ir); return; #endif } else if ((ir-1)->o <= IR_NE) { /* 64 bit integer 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_comp64(as, ir); #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); return; #endif } 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; } #endif if (!usehi) return; /* Skip unused hiword op for all remaining ops. */ switch ((ir-1)->o) { #if LJ_HASFFI 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_CNEWI: /* Nothing to do here. Handled by lo op itself. */ 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; case IR_ASTORE: case IR_HSTORE: case IR_USTORE: case IR_TOSTR: case IR_TMPREF: /* Nothing to do here. Handled by lo op itself. */ break; #endif case IR_CALLN: case IR_CALLL: case IR_CALLS: case IR_CALLXS: if (!uselo) ra_allocref(as, ir->op1, RID2RSET(RID_RETLO)); /* Mark lo op as used. */ break; default: lj_assertA(0, "bad HIOP for op %d", (ir-1)->o); break; } } /* -- Profiling ----------------------------------------------------------- */ static void asm_prof(ASMState *as, IRIns *ir) { UNUSED(ir); asm_guardcc(as, CC_NE); emit_asi(as, PPCI_ANDIDOT, RID_TMP, RID_TMP, HOOK_PROFILE); emit_lsglptr(as, PPCI_LBZ, RID_TMP, (int32_t)offsetof(global_State, hookmask)); } /* -- 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, cur_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)) { #if LJ_SOFTFP Reg tmp; RegSet allow = rset_exclude(RSET_GPR, RID_BASE); /* LJ_SOFTFP: must be a number constant. */ lj_assertA(irref_isk(ref), "unsplit FP op"); tmp = ra_allock(as, (int32_t)ir_knum(ir)->u32.lo, allow); emit_tai(as, PPCI_STW, tmp, RID_BASE, ofs+(LJ_BE?4:0)); if (rset_test(as->freeset, tmp+1)) allow = RID2RSET(tmp+1); tmp = ra_allock(as, (int32_t)ir_knum(ir)->u32.hi, allow); emit_tai(as, PPCI_STW, tmp, RID_BASE, ofs+(LJ_BE?0:4)); #else Reg src = ra_alloc1(as, ref, RSET_FPR); emit_fai(as, PPCI_STFD, src, RID_BASE, ofs); #endif } else { Reg type; RegSet allow = rset_exclude(RSET_GPR, RID_BASE); lj_assertA(irt_ispri(ir->t) || irt_isaddr(ir->t) || irt_isinteger(ir->t), "restore of IR type %d", irt_type(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); #if LJ_SOFTFP } else if ((sn & SNAP_SOFTFPNUM)) { type = ra_alloc1(as, ref+1, rset_exclude(RSET_GPR, RID_BASE)); #endif } else if ((sn & SNAP_KEYINDEX)) { type = ra_allock(as, (int32_t)LJ_KEYINDEX, allow); } else { type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow); } emit_tai(as, PPCI_STW, type, RID_BASE, ofs); } checkmclim(as); } lj_assertA(map + nent == flinks, "inconsistent frames in snapshot"); } /* -- GC handling --------------------------------------------------------- */ /* Marker to prevent patching the GC check exit. */ #define PPC_NOPATCH_GC_CHECK PPCI_ORIS /* 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. */ *--as->mcp = PPC_NOPATCH_GC_CHECK; 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); } } /* Fixup the tail of the loop. */ static void asm_loop_tail_fixup(ASMState *as) { UNUSED(as); /* Nothing to do. */ } /* -- 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 Reg asm_head_side_base(ASMState *as, IRIns *irp) { 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) { return r; /* Same BASE register already coalesced. */ } else if (ra_hasreg(irp->r) && rset_test(as->freeset, irp->r)) { emit_mr(as, r, irp->r); /* Move from coalesced parent reg. */ return irp->r; } else { emit_getgl(as, r, jit_base); /* Otherwise reload BASE. */ } } return RID_NONE; } /* -- 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. */ lj_assertA(checki16(CFRAME_SIZE+spadj), "stack adjustment out of range"); 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; } } /* -- 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 = CCI_XNARGS(ci); int nslots = 2, ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR; asm_collectargs(as, ir, ci, args); for (i = 0; i < nargs; i++) if (!LJ_SOFTFP && 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 (!LJ_SOFTFP && 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, patchlong = 1; 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 (p[-1] == PPC_NOPATCH_GC_CHECK) { patchlong = 0; } else 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; lj_assertJ(((delta + 0x02000000) >> 26) == 0, "branch target out of range"); *p = PPCI_B | ((uint32_t)delta & 0x03ffffffu); if (!cstart) cstart = p; } } /* Always patch long-range branch in exit stub itself. Except, if we can't. */ if (patchlong) { ptrdiff_t delta = (char *)target - (char *)px - clearso; lj_assertJ(((delta + 0x02000000) >> 26) == 0, "branch target out of range"); *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); } subprojects/luajit/src/jit/0000755000175000017500000000000014741067622015265 5ustar aniolaniolsubprojects/luajit/src/jit/v.lua0000644000175000017500000001335514741067622016244 0ustar aniolaniol---------------------------------------------------------------------------- -- Verbose mode of the LuaJIT compiler. -- -- Copyright (C) 2005-2023 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") local jutil = require("jit.util") local vmdef = require("jit.vmdef") local funcinfo, traceinfo = jutil.funcinfo, jutil.traceinfo local type, sub, format = type, string.sub, 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 local fmt = vmdef.traceerr[err] if fmt == "NYI: bytecode %s" then local oidx = 6 * info info = sub(vmdef.bcnames, oidx+1, oidx+6) end err = format(fmt, 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 == -1 and "stitch" or 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 ltype == "stitch" then out:write(format("[TRACE %3s %s%s %s %s]\n", tr, startex, startloc, ltype, fmtfunc(func, pc))) 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. return { on = dumpon, off = dumpoff, start = dumpon -- For -j command line option. } subprojects/luajit/src/jit/p.lua0000644000175000017500000002157714741067622016243 0ustar aniolaniol---------------------------------------------------------------------------- -- LuaJIT profiler. -- -- Copyright (C) 2005-2023 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h ---------------------------------------------------------------------------- -- -- This module is a simple command line interface to the built-in -- low-overhead profiler of LuaJIT. -- -- The lower-level API of the profiler is accessible via the "jit.profile" -- module or the luaJIT_profile_* C API. -- -- Example usage: -- -- luajit -jp myapp.lua -- luajit -jp=s myapp.lua -- luajit -jp=-s myapp.lua -- luajit -jp=vl myapp.lua -- luajit -jp=G,profile.txt myapp.lua -- -- The following dump features are available: -- -- f Stack dump: function name, otherwise module:line. Default mode. -- F Stack dump: ditto, but always prepend module. -- l Stack dump: module:line. -- stack dump depth (callee < caller). Default: 1. -- - Inverse stack dump depth (caller > callee). -- s Split stack dump after first stack level. Implies abs(depth) >= 2. -- p Show full path for module names. -- v Show VM states. Can be combined with stack dumps, e.g. vf or fv. -- z Show zones. Can be combined with stack dumps, e.g. zf or fz. -- r Show raw sample counts. Default: show percentages. -- a Annotate excerpts from source code files. -- A Annotate complete source code files. -- G Produce raw output suitable for graphical tools (e.g. flame graphs). -- m Minimum sample percentage to be shown. Default: 3. -- i Sampling interval in milliseconds. Default: 10. -- ---------------------------------------------------------------------------- -- Cache some library functions and objects. local jit = require("jit") local profile = require("jit.profile") local vmdef = require("jit.vmdef") local math = math local pairs, ipairs, tonumber, floor = pairs, ipairs, tonumber, math.floor local sort, format = table.sort, string.format local stdout = io.stdout local zone -- Load jit.zone module on demand. -- Output file handle. local out ------------------------------------------------------------------------------ local prof_ud local prof_states, prof_split, prof_min, prof_raw, prof_fmt, prof_depth local prof_ann, prof_count1, prof_count2, prof_samples local map_vmmode = { N = "Compiled", I = "Interpreted", C = "C code", G = "Garbage Collector", J = "JIT Compiler", } -- Profiler callback. local function prof_cb(th, samples, vmmode) prof_samples = prof_samples + samples local key_stack, key_stack2, key_state -- Collect keys for sample. if prof_states then if prof_states == "v" then key_state = map_vmmode[vmmode] or vmmode else key_state = zone:get() or "(none)" end end if prof_fmt then key_stack = profile.dumpstack(th, prof_fmt, prof_depth) key_stack = key_stack:gsub("%[builtin#(%d+)%]", function(x) return vmdef.ffnames[tonumber(x)] end) if prof_split == 2 then local k1, k2 = key_stack:match("(.-) [<>] (.*)") if k2 then key_stack, key_stack2 = k1, k2 end elseif prof_split == 3 then key_stack2 = profile.dumpstack(th, "l", 1) end end -- Order keys. local k1, k2 if prof_split == 1 then if key_state then k1 = key_state if key_stack then k2 = key_stack end end elseif key_stack then k1 = key_stack if key_stack2 then k2 = key_stack2 elseif key_state then k2 = key_state end end -- Coalesce samples in one or two levels. if k1 then local t1 = prof_count1 t1[k1] = (t1[k1] or 0) + samples if k2 then local t2 = prof_count2 local t3 = t2[k1] if not t3 then t3 = {}; t2[k1] = t3 end t3[k2] = (t3[k2] or 0) + samples end end end ------------------------------------------------------------------------------ -- Show top N list. local function prof_top(count1, count2, samples, indent) local t, n = {}, 0 for k in pairs(count1) do n = n + 1 t[n] = k end sort(t, function(a, b) return count1[a] > count1[b] end) for i=1,n do local k = t[i] local v = count1[k] local pct = floor(v*100/samples + 0.5) if pct < prof_min then break end if not prof_raw then out:write(format("%s%2d%% %s\n", indent, pct, k)) elseif prof_raw == "r" then out:write(format("%s%5d %s\n", indent, v, k)) else out:write(format("%s %d\n", k, v)) end if count2 then local r = count2[k] if r then prof_top(r, nil, v, (prof_split == 3 or prof_split == 1) and " -- " or (prof_depth < 0 and " -> " or " <- ")) end end end end -- Annotate source code local function prof_annotate(count1, samples) local files = {} local ms = 0 for k, v in pairs(count1) do local pct = floor(v*100/samples + 0.5) ms = math.max(ms, v) if pct >= prof_min then local file, line = k:match("^(.*):(%d+)$") if not file then file = k; line = 0 end local fl = files[file] if not fl then fl = {}; files[file] = fl; files[#files+1] = file end line = tonumber(line) fl[line] = prof_raw and v or pct end end sort(files) local fmtv, fmtn = " %3d%% | %s\n", " | %s\n" if prof_raw then local n = math.max(5, math.ceil(math.log10(ms))) fmtv = "%"..n.."d | %s\n" fmtn = (" "):rep(n).." | %s\n" end local ann = prof_ann for _, file in ipairs(files) do local f0 = file:byte() if f0 == 40 or f0 == 91 then out:write(format("\n====== %s ======\n[Cannot annotate non-file]\n", file)) break end local fp, err = io.open(file) if not fp then out:write(format("====== ERROR: %s: %s\n", file, err)) break end out:write(format("\n====== %s ======\n", file)) local fl = files[file] local n, show = 1, false if ann ~= 0 then for i=1,ann do if fl[i] then show = true; out:write("@@ 1 @@\n"); break end end end for line in fp:lines() do if line:byte() == 27 then out:write("[Cannot annotate bytecode file]\n") break end local v = fl[n] if ann ~= 0 then local v2 = fl[n+ann] if show then if v2 then show = n+ann elseif v then show = n elseif show+ann < n then show = false end elseif v2 then show = n+ann out:write(format("@@ %d @@\n", n)) end if not show then goto next end end if v then out:write(format(fmtv, v, line)) else out:write(format(fmtn, line)) end ::next:: n = n + 1 end fp:close() end end ------------------------------------------------------------------------------ -- Finish profiling and dump result. local function prof_finish() if prof_ud then profile.stop() local samples = prof_samples if samples == 0 then if prof_raw ~= true then out:write("[No samples collected]\n") end elseif prof_ann then prof_annotate(prof_count1, samples) else prof_top(prof_count1, prof_count2, samples, "") end prof_count1 = nil prof_count2 = nil prof_ud = nil if out ~= stdout then out:close() end end end -- Start profiling. local function prof_start(mode) local interval = "" mode = mode:gsub("i%d*", function(s) interval = s; return "" end) prof_min = 3 mode = mode:gsub("m(%d+)", function(s) prof_min = tonumber(s); return "" end) prof_depth = 1 mode = mode:gsub("%-?%d+", function(s) prof_depth = tonumber(s); return "" end) local m = {} for c in mode:gmatch(".") do m[c] = c end prof_states = m.z or m.v if prof_states == "z" then zone = require("jit.zone") end local scope = m.l or m.f or m.F or (prof_states and "" or "f") local flags = (m.p or "") prof_raw = m.r if m.s then prof_split = 2 if prof_depth == -1 or m["-"] then prof_depth = -2 elseif prof_depth == 1 then prof_depth = 2 end elseif mode:find("[fF].*l") then scope = "l" prof_split = 3 else prof_split = (scope == "" or mode:find("[zv].*[lfF]")) and 1 or 0 end prof_ann = m.A and 0 or (m.a and 3) if prof_ann then scope = "l" prof_fmt = "pl" prof_split = 0 prof_depth = 1 elseif m.G and scope ~= "" then prof_fmt = flags..scope.."Z;" prof_depth = -100 prof_raw = true prof_min = 0 elseif scope == "" then prof_fmt = false else local sc = prof_split == 3 and m.f or m.F or scope prof_fmt = flags..sc..(prof_depth >= 0 and "Z < " or "Z > ") end prof_count1 = {} prof_count2 = {} prof_samples = 0 profile.start(scope:lower()..interval, prof_cb) prof_ud = newproxy(true) getmetatable(prof_ud).__gc = prof_finish end ------------------------------------------------------------------------------ local function start(mode, outfile) if not outfile then outfile = os.getenv("LUAJIT_PROFILEFILE") end if outfile then out = outfile == "-" and stdout or assert(io.open(outfile, "w")) else out = stdout end prof_start(mode or "f") end -- Public module functions. return { start = start, -- For -j command line option. stop = prof_finish } subprojects/luajit/src/jit/dis_arm.lua0000644000175000017500000004562014741067622017415 0ustar aniolaniol---------------------------------------------------------------------------- -- LuaJIT ARM disassembler module. -- -- Copyright (C) 2005-2023 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. return { create = create, disass = disass, regname = regname } subprojects/luajit/src/jit/dis_mips64r6el.lua0000644000175000017500000000133014741067622020537 0ustar aniolaniol---------------------------------------------------------------------------- -- LuaJIT MIPS64R6EL disassembler wrapper module. -- -- Copyright (C) 2005-2023 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h ---------------------------------------------------------------------------- -- This module just exports the r6 little-endian functions from the -- MIPS disassembler module. All the interesting stuff is there. ------------------------------------------------------------------------------ local dis_mips = require((string.match(..., ".*%.") or "").."dis_mips") return { create = dis_mips.create_r6_el, disass = dis_mips.disass_r6_el, regname = dis_mips.regname } subprojects/luajit/src/jit/dis_x86.lua0000644000175000017500000010204214741067622017253 0ustar aniolaniol---------------------------------------------------------------------------- -- LuaJIT x86/x64 disassembler module. -- -- Copyright (C) 2005-2023 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, AVX, AVX2 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. ------------------------------------------------------------------------------ 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 local bit = require("bit") local tohex = bit.tohex -- 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","vex*3$lesVrm","vex*2$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]="vex*3", [0xc5]="vex*2", [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|movssXrvm|movupdXrm|movsdXrvm", "movupsXmr|movssXmvr|movupdXmr|movsdXmvr", "movhlpsXrm$movlpsXrm|movsldupXrm|movlpdXrm|movddupXrm", "movlpsXmr||movlpdXmr", "unpcklpsXrvm||unpcklpdXrvm", "unpckhpsXrvm||unpckhpdXrvm", "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|cvtsi2ssXrvVmt|cvtpi2pdXrMm|cvtsi2sdXrvVmt", "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|rsqrtssXrvm","rcppsXrm|rcpssXrvm", "andpsXrvm||andpdXrvm","andnpsXrvm||andnpdXrvm", "orpsXrvm||orpdXrvm","xorpsXrvm||xorpdXrvm", "addpsXrvm|addssXrvm|addpdXrvm|addsdXrvm","mulpsXrvm|mulssXrvm|mulpdXrvm|mulsdXrvm", "cvtps2pdXrm|cvtss2sdXrvm|cvtpd2psXrm|cvtsd2ssXrvm", "cvtdq2psXrm|cvttps2dqXrm|cvtps2dqXrm", "subpsXrvm|subssXrvm|subpdXrvm|subsdXrvm","minpsXrvm|minssXrvm|minpdXrvm|minsdXrvm", "divpsXrvm|divssXrvm|divpdXrvm|divsdXrvm","maxpsXrvm|maxssXrvm|maxpdXrvm|maxsdXrvm", --6x "punpcklbwPrvm","punpcklwdPrvm","punpckldqPrvm","packsswbPrvm", "pcmpgtbPrvm","pcmpgtwPrvm","pcmpgtdPrvm","packuswbPrvm", "punpckhbwPrvm","punpckhwdPrvm","punpckhdqPrvm","packssdwPrvm", "||punpcklqdqXrvm","||punpckhqdqXrvm", "movPrVSm","movqMrm|movdquXrm|movdqaXrm", --7x "pshufwMrmu|pshufhwXrmu|pshufdXrmu|pshuflwXrmu","pshiftw!Pvmu", "pshiftd!Pvmu","pshiftq!Mvmu||pshiftdq!Xvmu", "pcmpeqbPrvm","pcmpeqwPrvm","pcmpeqdPrvm","emms*|", "vmreadUmr||extrqXmuu$|insertqXrmuu$","vmwriteUrm||extrqXrm$|insertqXrm$", nil,nil, "||haddpdXrvm|haddpsXrvm","||hsubpdXrvm|hsubpsXrvm", "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", "cmppsXrvmu|cmpssXrvmu|cmppdXrvmu|cmpsdXrvmu","$movntiVmr|", "pinsrwPrvWmu","pextrwDrPmu", "shufpsXrvmu||shufpdXrvmu","$cmpxchg!Qmp", "bswapVR","bswapVR","bswapVR","bswapVR","bswapVR","bswapVR","bswapVR","bswapVR", --Dx "||addsubpdXrvm|addsubpsXrvm","psrlwPrvm","psrldPrvm","psrlqPrvm", "paddqPrvm","pmullwPrvm", "|movq2dqXrMm|movqXmr|movdq2qMrXm$","pmovmskbVrMm||pmovmskbVrXm", "psubusbPrvm","psubuswPrvm","pminubPrvm","pandPrvm", "paddusbPrvm","padduswPrvm","pmaxubPrvm","pandnPrvm", --Ex "pavgbPrvm","psrawPrvm","psradPrvm","pavgwPrvm", "pmulhuwPrvm","pmulhwPrvm", "|cvtdq2pdXrm|cvttpd2dqXrm|cvtpd2dqXrm","$movntqMmr||$movntdqXmr", "psubsbPrvm","psubswPrvm","pminswPrvm","porPrvm", "paddsbPrvm","paddswPrvm","pmaxswPrvm","pxorPrvm", --Fx "|||lddquXrm","psllwPrvm","pslldPrvm","psllqPrvm", "pmuludqPrvm","pmaddwdPrvm","psadbwPrvm","maskmovqMrm||maskmovdquXrm$", "psubbPrvm","psubwPrvm","psubdPrvm","psubqPrvm", "paddbPrvm","paddwPrvm","padddPrvm","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]="pshufbPrvm","phaddwPrvm","phadddPrvm","phaddswPrvm", "pmaddubswPrvm","phsubwPrvm","phsubdPrvm","phsubswPrvm", "psignbPrvm","psignwPrvm","psigndPrvm","pmulhrswPrvm", "||permilpsXrvm","||permilpdXrvm",nil,nil, --1x "||pblendvbXrma",nil,nil,nil, "||blendvpsXrma","||blendvpdXrma","||permpsXrvm","||ptestXrm", "||broadcastssXrm","||broadcastsdXrm","||broadcastf128XrlXm",nil, "pabsbPrm","pabswPrm","pabsdPrm",nil, --2x "||pmovsxbwXrm","||pmovsxbdXrm","||pmovsxbqXrm","||pmovsxwdXrm", "||pmovsxwqXrm","||pmovsxdqXrm",nil,nil, "||pmuldqXrvm","||pcmpeqqXrvm","||$movntdqaXrm","||packusdwXrvm", "||maskmovpsXrvm","||maskmovpdXrvm","||maskmovpsXmvr","||maskmovpdXmvr", --3x "||pmovzxbwXrm","||pmovzxbdXrm","||pmovzxbqXrm","||pmovzxwdXrm", "||pmovzxwqXrm","||pmovzxdqXrm","||permdXrvm","||pcmpgtqXrvm", "||pminsbXrvm","||pminsdXrvm","||pminuwXrvm","||pminudXrvm", "||pmaxsbXrvm","||pmaxsdXrvm","||pmaxuwXrvm","||pmaxudXrvm", --4x "||pmulddXrvm","||phminposuwXrm",nil,nil, nil,"||psrlvVSXrvm","||psravdXrvm","||psllvVSXrvm", --5x [0x58] = "||pbroadcastdXrlXm",[0x59] = "||pbroadcastqXrlXm", [0x5a] = "||broadcasti128XrlXm", --7x [0x78] = "||pbroadcastbXrlXm",[0x79] = "||pbroadcastwXrlXm", --8x [0x8c] = "||pmaskmovXrvVSm", [0x8e] = "||pmaskmovVSmXvr", --9x [0x96] = "||fmaddsub132pHXrvm",[0x97] = "||fmsubadd132pHXrvm", [0x98] = "||fmadd132pHXrvm",[0x99] = "||fmadd132sHXrvm", [0x9a] = "||fmsub132pHXrvm",[0x9b] = "||fmsub132sHXrvm", [0x9c] = "||fnmadd132pHXrvm",[0x9d] = "||fnmadd132sHXrvm", [0x9e] = "||fnmsub132pHXrvm",[0x9f] = "||fnmsub132sHXrvm", --Ax [0xa6] = "||fmaddsub213pHXrvm",[0xa7] = "||fmsubadd213pHXrvm", [0xa8] = "||fmadd213pHXrvm",[0xa9] = "||fmadd213sHXrvm", [0xaa] = "||fmsub213pHXrvm",[0xab] = "||fmsub213sHXrvm", [0xac] = "||fnmadd213pHXrvm",[0xad] = "||fnmadd213sHXrvm", [0xae] = "||fnmsub213pHXrvm",[0xaf] = "||fnmsub213sHXrvm", --Bx [0xb6] = "||fmaddsub231pHXrvm",[0xb7] = "||fmsubadd231pHXrvm", [0xb8] = "||fmadd231pHXrvm",[0xb9] = "||fmadd231sHXrvm", [0xba] = "||fmsub231pHXrvm",[0xbb] = "||fmsub231sHXrvm", [0xbc] = "||fnmadd231pHXrvm",[0xbd] = "||fnmadd231sHXrvm", [0xbe] = "||fnmsub231pHXrvm",[0xbf] = "||fnmsub231sHXrvm", --Dx [0xdc] = "||aesencXrvm", [0xdd] = "||aesenclastXrvm", [0xde] = "||aesdecXrvm", [0xdf] = "||aesdeclastXrvm", --Fx [0xf0] = "|||crc32TrBmt",[0xf1] = "|||crc32TrVmt", [0xf7] = "| sarxVrmv| shlxVrmv| shrxVrmv", }, ["3a"] = { -- [66] 0f 3a xx --0x [0x00]="||permqXrmu","||permpdXrmu","||pblenddXrvmu",nil, "||permilpsXrmu","||permilpdXrmu","||perm2f128Xrvmu",nil, "||roundpsXrmu","||roundpdXrmu","||roundssXrvmu","||roundsdXrvmu", "||blendpsXrvmu","||blendpdXrvmu","||pblendwXrvmu","palignrPrvmu", --1x nil,nil,nil,nil, "||pextrbVmXru","||pextrwVmXru","||pextrVmSXru","||extractpsVmXru", "||insertf128XrvlXmu","||extractf128XlXmYru",nil,nil, nil,nil,nil,nil, --2x "||pinsrbXrvVmu","||insertpsXrvmu","||pinsrXrvVmuS",nil, --3x [0x38] = "||inserti128Xrvmu",[0x39] = "||extracti128XlXmYru", --4x [0x40] = "||dppsXrvmu", [0x41] = "||dppdXrvmu", [0x42] = "||mpsadbwXrvmu", [0x44] = "||pclmulqdqXrvmu", [0x46] = "||perm2i128Xrvmu", [0x4a] = "||blendvpsXrvmb",[0x4b] = "||blendvpdXrvmb", [0x4c] = "||pblendvbXrvmb", --6x [0x60] = "||pcmpestrmXrmu",[0x61] = "||pcmpestriXrmu", [0x62] = "||pcmpistrmXrmu",[0x63] = "||pcmpistriXrmu", [0xdf] = "||aeskeygenassistXrmu", --Fx [0xf0] = "||| rorxVrmu", }, } -- 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" }, Y = { "ymm0", "ymm1", "ymm2", "ymm3", "ymm4", "ymm5", "ymm6", "ymm7", "ymm8", "ymm9", "ymm10", "ymm11", "ymm12", "ymm13", "ymm14", "ymm15" }, } 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, Y = 32, } local map_sz2prefix = { B = "byte", W = "word", D = "dword", Q = "qword", M = "qword", X = "xword", Y = "yword", 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 "").. (ctx.vexl and "l" or "") if ctx.vexv and ctx.vexv ~= 0 then t = t.."v"..ctx.vexv end if t ~= "" then text = ctx.rex.."."..t.." "..gsub(text, "^ ", "") elseif ctx.rex == "vex" then text = gsub("v"..text, "^v ", "") end ctx.rexw = false; ctx.rexr = false; ctx.rexx = false; ctx.rexb = false ctx.rex = false; ctx.vexl = false; ctx.vexv = 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.vexv = 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; ctx.vexl = 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, vexl = ctx.code, ctx.pos, ctx.stop, ctx.vexl -- Chars used: 1DFGHIMPQRSTUVWXYabcdfgijlmoprstuvwxyz 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, "[WDQMXYFG]") then sz = p if sz == "X" and vexl then sz = "Y"; ctx.vexl = false end regs = map_regs[sz] elseif p == "P" then sz = ctx.o16 and "X" or "M"; ctx.o16 = false if sz == "X" and vexl then sz = "Y"; ctx.vexl = false end regs = map_regs[sz] elseif p == "H" then name = name..(ctx.rexw and "d" or "s") ctx.rexw = false 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 == "b" then local imm = getimm(ctx, pos, 1); if not imm then return end x = regs[imm/16+1] 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 = "0x"..tohex(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 == "v" then if ctx.vexv then x = regs[ctx.vexv+1]; ctx.vexv = false end elseif p == "y" then x = "DR"..sp elseif p == "z" then x = "TR"..sp elseif p == "l" then vexl = false 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, Y = putpat, H = 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 or VEX prefix allowed. for p in gmatch(pat, ".") do ctx["rex"..p] = true end ctx.rex = "rex" end, -- VEX prefix. vex = function(ctx, name, pat) if ctx.rex then return unknown(ctx) end -- Only 1 REX or VEX prefix allowed. ctx.rex = "vex" local pos = ctx.pos if ctx.mrm then ctx.mrm = nil pos = pos-1 end local b = byte(ctx.code, pos, pos) if not b then return incomplete(ctx) end pos = pos+1 if b < 128 then ctx.rexr = true end local m = 1 if pat == "3" then m = b%32; b = (b-m)/32 local nb = b%2; b = (b-nb)/2 if nb == 0 then ctx.rexb = true end local nx = b%2 if nx == 0 then ctx.rexx = true end b = byte(ctx.code, pos, pos) if not b then return incomplete(ctx) end pos = pos+1 if b >= 128 then ctx.rexw = true end end ctx.pos = pos local map if m == 1 then map = map_opc2 elseif m == 2 then map = map_opc3["38"] elseif m == 3 then map = map_opc3["3a"] else return unknown(ctx) end local p = b%4; b = (b-p)/4 if p == 1 then ctx.o16 = "o16" elseif p == 2 then ctx.rep = "rep" elseif p == 3 then ctx.rep = "repne" end local l = b%2; b = (b-l)/2 if l ~= 0 then ctx.vexl = true end ctx.vexv = (-1-b)%16 return dispatchmap(ctx, map) end, -- Special case for nop with REX prefix. nop = function(ctx, name, pat) return dispatch(ctx, ctx.rex and pat or "nop") end, -- Special case for 0F 77. emms = function(ctx, name, pat) if ctx.rex ~= "vex" then return putop(ctx, "emms") elseif ctx.vexl then ctx.vexl = false return putop(ctx, "zeroall") else return putop(ctx, "zeroupper") end 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. return { create = create, create64 = create64, disass = disass, disass64 = disass64, regname = regname, regname64 = regname64 } subprojects/luajit/src/jit/dis_mipsel.lua0000644000175000017500000000131314741067622020116 0ustar aniolaniol---------------------------------------------------------------------------- -- LuaJIT MIPSEL disassembler wrapper module. -- -- Copyright (C) 2005-2023 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 dis_mips = require((string.match(..., ".*%.") or "").."dis_mips") return { create = dis_mips.create_el, disass = dis_mips.disass_el, regname = dis_mips.regname } subprojects/luajit/src/jit/bc.lua0000644000175000017500000001265314741067622016363 0ustar aniolaniol---------------------------------------------------------------------------- -- LuaJIT bytecode listing module. -- -- Copyright (C) 2005-2023 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h ---------------------------------------------------------------------------- -- -- This module lists the bytecode of a Lua function. If it's loaded by -jbc -- it hooks into the parser and lists all functions of a chunk as they -- are parsed. -- -- Example usage: -- -- luajit -jbc -e 'local x=0; for i=1,1e6 do x=x+i end; print(x)' -- luajit -jbc=- foo.lua -- luajit -jbc=foo.list foo.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_LISTFILE. The file is overwritten every time the module -- is started. -- -- This module can also be used programmatically: -- -- local bc = require("jit.bc") -- -- local function foo() print("hello") end -- -- bc.dump(foo) --> -- 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") 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. return { line = bcline, dump = bcdump, targets = bctargets, on = bcliston, off = bclistoff, start = bcliston -- For -j command line option. } subprojects/luajit/src/jit/zone.lua0000644000175000017500000000175214741067622016750 0ustar aniolaniol---------------------------------------------------------------------------- -- LuaJIT profiler zones. -- -- Copyright (C) 2005-2023 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h ---------------------------------------------------------------------------- -- -- This module implements a simple hierarchical zone model. -- -- Example usage: -- -- local zone = require("jit.zone") -- zone("AI") -- ... -- zone("A*") -- ... -- print(zone:get()) --> "A*" -- ... -- zone() -- ... -- print(zone:get()) --> "AI" -- ... -- zone() -- ---------------------------------------------------------------------------- local remove = table.remove return setmetatable({ flush = function(t) for i=#t,1,-1 do t[i] = nil end end, get = function(t) return t[#t] end }, { __call = function(t, zone) if zone then t[#t+1] = zone else return (assert(remove(t), "empty zone stack")) end end }) subprojects/luajit/src/jit/dis_ppc.lua0000644000175000017500000004751514741067622017425 0ustar aniolaniol---------------------------------------------------------------------------- -- LuaJIT PPC disassembler module. -- -- Copyright (C) 2005-2023 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. return { create = create, disass = disass, regname = regname } subprojects/luajit/src/jit/dis_mips64el.lua0000644000175000017500000000131514741067622020272 0ustar aniolaniol---------------------------------------------------------------------------- -- LuaJIT MIPS64EL disassembler wrapper module. -- -- Copyright (C) 2005-2023 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 dis_mips = require((string.match(..., ".*%.") or "").."dis_mips") return { create = dis_mips.create_el, disass = dis_mips.disass_el, regname = dis_mips.regname } subprojects/luajit/src/jit/bcsave.lua0000644000175000017500000004213414741067622017237 0ustar aniolaniol---------------------------------------------------------------------------- -- LuaJIT module to save/list bytecode. -- -- Copyright (C) 2005-2023 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 == 20199, "LuaJIT core/library version mismatch") local bit = require("bit") -- Symbol name prefix for LuaJIT bytecode. local LJBC_PREFIX = "luaJIT_BC_" local type, assert = type, assert local format = string.format local tremove, tconcat = table.remove, table.concat ------------------------------------------------------------------------------ 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. -W Generate 32 bit (non-GC64) bytecode. -X Generate 64 bit (GC64) bytecode. -d Generate bytecode in deterministic manner. -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). -F name Override filename (default: input filename). -e chunk Use chunk string as input. -- Stop handling options. - Use stdin as input and/or stdout as output. File types: c cc 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(ctx, input) if ctx.string then return check(loadstring(input, nil, ctx.mode)) elseif ctx.filename then local data if input == "-" then data = io.stdin:read("*a") else local fp = assert(io.open(input, "rb")) data = assert(fp:read("*a")) assert(fp:close()) end return check(load(data, ctx.filename, ctx.mode)) else if input == "-" then input = nil end return check(loadfile(input, ctx.mode)) end end local function savefile(name, mode) if name == "-" then return io.stdout end return check(io.open(name, mode)) end local function set_stdout_binary(ffi) ffi.cdef[[int _setmode(int fd, int mode);]] ffi.C._setmode(1, 0x8000) end ------------------------------------------------------------------------------ local map_type = { raw = "raw", c = "c", cc = "c", h = "h", o = "obj", obj = "obj", } local map_arch = { x86 = { e = "le", b = 32, m = 3, p = 0x14c, }, x64 = { e = "le", b = 64, m = 62, p = 0x8664, }, arm = { e = "le", b = 32, m = 40, p = 0x1c0, }, arm64 = { e = "le", b = 64, m = 183, p = 0xaa64, }, arm64be = { e = "be", b = 64, m = 183, }, ppc = { e = "be", b = 32, m = 20, }, mips = { e = "be", b = 32, m = 8, f = 0x50001006, }, mipsel = { e = "le", b = 32, m = 8, f = 0x50001006, }, mips64 = { e = "be", b = 64, m = 8, f = 0x80000007, }, mips64el = { e = "le", b = 64, m = 8, f = 0x80000007, }, mips64r6 = { e = "be", b = 64, m = 8, f = 0xa0000407, }, mips64r6el = { e = "le", b = 64, m = 8, f = 0xa0000407, }, } 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 = str:lower() local s = check(map[str], "unknown ", err) return type(s) == "string" and s or str end local function detecttype(str) local ext = str:lower():match("%.(%a+)$") return map_type[ext] or "raw" end local function checkmodname(str) check(str:match("^[%w_.%-]+$"), "bad module name") return str:gsub("[%.%-]", "_") end local function detectmodname(str) if type(str) == "string" then local tail = str:match("[^/\\]+$") if tail then str = tail end local head = str:match("^(.*)%.[^.]*$") if head then str = head end str = str:match("^[%w_.%-]+") else str = nil end check(str, "cannot derive module name, use -n name") return str:gsub("[%.%-]", "_") 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) if output == "-" and jit.os == "Windows" then local ok, ffi = pcall(require, "ffi") check(ok, "FFI library required to write binary file to stdout") set_stdout_binary(ffi) end 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(format([[ #ifdef __cplusplus extern "C" #endif #ifdef _WIN32 __declspec(dllexport) #endif const unsigned char %s%s[] = { ]], LJBC_PREFIX, ctx.modname)) else fp:write(format([[ #define %s%s_SIZE %d static const unsigned 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(tconcat(t, ",", 1, n), ",\n") n, m = 0, #b + 1 end n = n + 1 t[n] = b end bcsave_tail(fp, output, tconcat(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 ai = assert(map_arch[ctx.arch]) local is64, isbe = ai.b == 64, ai.e == "be" -- 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(ai.m) hdr.flags = f32(ai.f or 0) 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+2) 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 ai = assert(map_arch[ctx.arch]) local is64 = ai.b == 64 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(assert(ai.p)) 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]; uint64_t vmaddr, vmsize, fileoff, filesize; uint32_t maxprot, initprot, nsects, flags; } mach_segment_command_64; 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; uint16_t desc; uint64_t value; } mach_nlist_64; typedef struct { mach_header_64 hdr; mach_segment_command_64 seg; mach_section_64 sec; mach_symtab_command sym; mach_nlist_64 sym_entry; uint8_t space[4096]; } mach_obj_64; ]] local symname = '_'..LJBC_PREFIX..ctx.modname local cputype, cpusubtype = 0x01000007, 3 if ctx.arch ~= "x64" then check(ctx.arch == "arm64", "unsupported architecture for OSX") cputype, cpusubtype = 0x0100000c, 0 end local function aligned(v, a) return bit.band(v+a-1, -a) end -- Create Mach-O object and fill in header. local o = ffi.new("mach_obj_64") local mach_size = aligned(ffi.offsetof(o, "space")+#symname+2, 8) -- Fill in sections and symbols. o.hdr.magic = 0xfeedfacf o.hdr.cputype = cputype o.hdr.cpusubtype = cpusubtype o.hdr.filetype = 1 o.hdr.ncmds = 2 o.hdr.sizeofcmds = ffi.sizeof(o.seg)+ffi.sizeof(o.sec)+ffi.sizeof(o.sym) o.seg.cmd = 0x19 o.seg.cmdsize = ffi.sizeof(o.seg)+ffi.sizeof(o.sec) o.seg.vmsize = #s o.seg.fileoff = mach_size o.seg.filesize = #s o.seg.maxprot = 1 o.seg.initprot = 1 o.seg.nsects = 1 ffi.copy(o.sec.sectname, "__data") ffi.copy(o.sec.segname, "__DATA") o.sec.size = #s o.sec.offset = mach_size o.sym.cmd = 2 o.sym.cmdsize = ffi.sizeof(o.sym) o.sym.symoff = ffi.offsetof(o, "sym_entry") o.sym.nsyms = 1 o.sym.stroff = ffi.offsetof(o, "sym_entry")+ffi.sizeof(o.sym_entry) o.sym.strsize = aligned(#symname+2, 8) o.sym_entry.type = 0xf o.sym_entry.sect = 1 o.sym_entry.strx = 1 ffi.copy(o.space+1, symname) -- Write Mach-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 output == "-" and jit.os == "Windows" then set_stdout_binary(ffi) end 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(ctx, input, output) local f = readfile(ctx, input) require("jit.bc").dump(f, savefile(output, "w"), true) end local function bcsave(ctx, input, output) local f = readfile(ctx, input) local s = string.dump(f, ctx.mode) 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 = { mode = "bt", arch = jit.arch, os = jit.os:lower(), type = false, modname = false, string = false, } local strip = "s" local gc64 = "" while n <= #arg do local a = arg[n] if type(a) == "string" and a:sub(1, 1) == "-" and a ~= "-" then tremove(arg, n) if a == "--" then break end for m=2,#a do local opt = a:sub(m, m) if opt == "l" then list = true elseif opt == "s" then strip = "s" elseif opt == "g" then strip = "" elseif opt == "W" or opt == "X" then gc64 = opt elseif opt == "d" then ctx.mode = ctx.mode .. opt else if arg[n] == nil or m ~= #a then usage() end if opt == "e" then if n ~= 1 then usage() end ctx.string = true elseif opt == "n" then ctx.modname = checkmodname(tremove(arg, n)) elseif opt == "t" then ctx.type = checkarg(tremove(arg, n), map_type, "file type") elseif opt == "a" then ctx.arch = checkarg(tremove(arg, n), map_arch, "architecture") elseif opt == "o" then ctx.os = checkarg(tremove(arg, n), map_os, "OS name") elseif opt == "F" then ctx.filename = "@"..tremove(arg, n) else usage() end end end else n = n + 1 end end ctx.mode = ctx.mode .. strip .. gc64 if list then if #arg == 0 or #arg > 2 then usage() end bclist(ctx, arg[1], arg[2] or "-") else if #arg ~= 2 then usage() end bcsave(ctx, arg[1], arg[2]) end end ------------------------------------------------------------------------------ -- Public module functions. return { start = docmd -- Process -b command line option. } subprojects/luajit/src/jit/dis_mips64r6.lua0000644000175000017500000000131514741067622020221 0ustar aniolaniol---------------------------------------------------------------------------- -- LuaJIT MIPS64R6 disassembler wrapper module. -- -- Copyright (C) 2005-2023 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h ---------------------------------------------------------------------------- -- This module just exports the r6 big-endian functions from the -- MIPS disassembler module. All the interesting stuff is there. ------------------------------------------------------------------------------ local dis_mips = require((string.match(..., ".*%.") or "").."dis_mips") return { create = dis_mips.create_r6, disass = dis_mips.disass_r6, regname = dis_mips.regname } subprojects/luajit/src/jit/dis_mips64.lua0000644000175000017500000000130214741067622017745 0ustar aniolaniol---------------------------------------------------------------------------- -- LuaJIT MIPS64 disassembler wrapper module. -- -- Copyright (C) 2005-2023 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h ---------------------------------------------------------------------------- -- This module just exports the big-endian functions from the -- MIPS disassembler module. All the interesting stuff is there. ------------------------------------------------------------------------------ local dis_mips = require((string.match(..., ".*%.") or "").."dis_mips") return { create = dis_mips.create, disass = dis_mips.disass, regname = dis_mips.regname } subprojects/luajit/src/jit/dis_mips.lua0000644000175000017500000005277214741067622017614 0ustar aniolaniol---------------------------------------------------------------------------- -- LuaJIT MIPS disassembler module. -- -- Copyright (C) 2005-2023 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 ------------------------------------------------------------------------------ -- Extended opcode maps common to all MIPS releases ------------------------------------------------------------------------------ local map_srl = { shift = 21, mask = 1, [0] = "srlDTA", "rotrDTA", } local map_srlv = { shift = 6, mask = 1, [0] = "srlvDTS", "rotrvDTS", } 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", }, } ------------------------------------------------------------------------------ -- Primary and extended opcode maps for MIPS R1-R5 ------------------------------------------------------------------------------ local map_movci = { shift = 16, mask = 1, [0] = "movfDSC", "movtDSC", } 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", "dsllvDST", false, "dsrlvDST", "dsravDST", "multST", "multuST", "divST", "divuST", "dmultST", "dmultuST", "ddivST", "ddivuST", "addDST", "addu|moveDST0", "subDST", "subu|neguDS0T", "andDST", "or|moveDST0", "xorDST", "nor|notDST0", false, false, "sltDST", "sltuDST", "daddDST", "dadduDST", "dsubDST", "dsubuDST", "tgeSTZ", "tgeuSTZ", "tltSTZ", "tltuSTZ", "teqSTZ", false, "tneSTZ", false, "dsllDTA", false, "dsrlDTA", "dsraDTA", "dsll32DTA", false, "dsrl32DTA", "dsra32DTA", } 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_dbshfl = { shift = 6, mask = 31, [2] = "dsbhDT", [5] = "dshdDT", } local map_special3 = { shift = 0, mask = 63, [0] = "extTSAK", [1] = "dextmTSAP", [3] = "dextTSAK", [4] = "insTSAL", [6] = "dinsuTSEQ", [7] = "dinsTSAL", [32] = map_bshfl, [36] = map_dbshfl, [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_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", "dmfc1TG", "cfc1TG", "mfhc1TG", "mtc1TG", "dmtc1TG", "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", "daddiTSI", "daddiuTSI", false, false, map_special2, "jalxJ", 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", "ldTSO", "scTSO", "swc1HSO", "swc2TSO", false, false, "sdc1HSO", "sdc2TSO", "sdTSO", } ------------------------------------------------------------------------------ -- Primary and extended opcode maps for MIPS R6 ------------------------------------------------------------------------------ local map_mul_r6 = { shift = 6, mask = 3, [2] = "mulDST", [3] = "muhDST" } local map_mulu_r6 = { shift = 6, mask = 3, [2] = "muluDST", [3] = "muhuDST" } local map_div_r6 = { shift = 6, mask = 3, [2] = "divDST", [3] = "modDST" } local map_divu_r6 = { shift = 6, mask = 3, [2] = "divuDST", [3] = "moduDST" } local map_dmul_r6 = { shift = 6, mask = 3, [2] = "dmulDST", [3] = "dmuhDST" } local map_dmulu_r6 = { shift = 6, mask = 3, [2] = "dmuluDST", [3] = "dmuhuDST" } local map_ddiv_r6 = { shift = 6, mask = 3, [2] = "ddivDST", [3] = "dmodDST" } local map_ddivu_r6 = { shift = 6, mask = 3, [2] = "ddivuDST", [3] = "dmoduDST" } local map_special_r6 = { shift = 0, mask = 63, [0] = { shift = 0, mask = -1, [0] = "nop", _ = "sllDTA" }, false, map_srl, "sraDTA", "sllvDTS", false, map_srlv, "sravDTS", "jrS", "jalrD1S", false, false, "syscallY", "breakY", false, "sync", "clzDS", "cloDS", "dclzDS", "dcloDS", "dsllvDST", "dlsaDSTA", "dsrlvDST", "dsravDST", map_mul_r6, map_mulu_r6, map_div_r6, map_divu_r6, map_dmul_r6, map_dmulu_r6, map_ddiv_r6, map_ddivu_r6, "addDST", "addu|moveDST0", "subDST", "subu|neguDS0T", "andDST", "or|moveDST0", "xorDST", "nor|notDST0", false, false, "sltDST", "sltuDST", "daddDST", "dadduDST", "dsubDST", "dsubuDST", "tgeSTZ", "tgeuSTZ", "tltSTZ", "tltuSTZ", "teqSTZ", "seleqzDST", "tneSTZ", "selnezDST", "dsllDTA", false, "dsrlDTA", "dsraDTA", "dsll32DTA", false, "dsrl32DTA", "dsra32DTA", } local map_bshfl_r6 = { shift = 9, mask = 3, [1] = "alignDSTa", _ = { shift = 6, mask = 31, [0] = "bitswapDT", [2] = "wsbhDT", [16] = "sebDT", [24] = "sehDT", } } local map_dbshfl_r6 = { shift = 9, mask = 3, [1] = "dalignDSTa", _ = { shift = 6, mask = 31, [0] = "dbitswapDT", [2] = "dsbhDT", [5] = "dshdDT", } } local map_special3_r6 = { shift = 0, mask = 63, [0] = "extTSAK", [1] = "dextmTSAP", [3] = "dextTSAK", [4] = "insTSAL", [6] = "dinsuTSEQ", [7] = "dinsTSAL", [32] = map_bshfl_r6, [36] = map_dbshfl_r6, [59] = "rdhwrTD", } local map_regimm_r6 = { shift = 16, mask = 31, [0] = "bltzSB", [1] = "bgezSB", [6] = "dahiSI", [30] = "datiSI", [23] = "sigrieI", [31] = "synciSO", } local map_pcrel_r6 = { shift = 19, mask = 3, [0] = "addiupcS2", "lwpcS2", "lwupcS2", { shift = 18, mask = 1, [0] = "ldpcS3", { shift = 16, mask = 3, [2] = "auipcSI", [3] = "aluipcSI" } } } local map_cop1s_r6 = { 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", "sel.sFGH", false, false, false, "seleqz.sFGH", "recip.sFG", "rsqrt.sFG", "selnez.sFGH", "maddf.sFGH", "msubf.sFGH", "rint.sFG", "class.sFG", "min.sFGH", "mina.sFGH", "max.sFGH", "maxa.sFGH", false, "cvt.d.sFG", false, false, "cvt.w.sFG", "cvt.l.sFG", } local map_cop1d_r6 = { 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", "sel.dFGH", false, false, false, "seleqz.dFGH", "recip.dFG", "rsqrt.dFG", "selnez.dFGH", "maddf.dFGH", "msubf.dFGH", "rint.dFG", "class.dFG", "min.dFGH", "mina.dFGH", "max.dFGH", "maxa.dFGH", "cvt.s.dFG", false, false, false, "cvt.w.dFG", "cvt.l.dFG", } local map_cop1w_r6 = { shift = 0, mask = 63, [0] = "cmp.af.sFGH", "cmp.un.sFGH", "cmp.eq.sFGH", "cmp.ueq.sFGH", "cmp.lt.sFGH", "cmp.ult.sFGH", "cmp.le.sFGH", "cmp.ule.sFGH", "cmp.saf.sFGH", "cmp.sun.sFGH", "cmp.seq.sFGH", "cmp.sueq.sFGH", "cmp.slt.sFGH", "cmp.sult.sFGH", "cmp.sle.sFGH", "cmp.sule.sFGH", false, "cmp.or.sFGH", "cmp.une.sFGH", "cmp.ne.sFGH", false, false, false, false, false, "cmp.sor.sFGH", "cmp.sune.sFGH", "cmp.sne.sFGH", false, false, false, false, "cvt.s.wFG", "cvt.d.wFG", } local map_cop1l_r6 = { shift = 0, mask = 63, [0] = "cmp.af.dFGH", "cmp.un.dFGH", "cmp.eq.dFGH", "cmp.ueq.dFGH", "cmp.lt.dFGH", "cmp.ult.dFGH", "cmp.le.dFGH", "cmp.ule.dFGH", "cmp.saf.dFGH", "cmp.sun.dFGH", "cmp.seq.dFGH", "cmp.sueq.dFGH", "cmp.slt.dFGH", "cmp.sult.dFGH", "cmp.sle.dFGH", "cmp.sule.dFGH", false, "cmp.or.dFGH", "cmp.une.dFGH", "cmp.ne.dFGH", false, false, false, false, false, "cmp.sor.dFGH", "cmp.sune.dFGH", "cmp.sne.dFGH", false, false, false, false, "cvt.s.lFG", "cvt.d.lFG", } local map_cop1_r6 = { shift = 21, mask = 31, [0] = "mfc1TG", "dmfc1TG", "cfc1TG", "mfhc1TG", "mtc1TG", "dmtc1TG", "ctc1TG", "mthc1TG", false, "bc1eqzHB", false, false, false, "bc1nezHB", false, false, map_cop1s_r6, map_cop1d_r6, false, false, map_cop1w_r6, map_cop1l_r6, } local function maprs_popTS(rs, rt) if rt == 0 then return 0 elseif rs == 0 then return 1 elseif rs == rt then return 2 else return 3 end end local map_pop06_r6 = { maprs = maprs_popTS, [0] = "blezSB", "blezalcTB", "bgezalcTB", "bgeucSTB" } local map_pop07_r6 = { maprs = maprs_popTS, [0] = "bgtzSB", "bgtzalcTB", "bltzalcTB", "bltucSTB" } local map_pop26_r6 = { maprs = maprs_popTS, "blezcTB", "bgezcTB", "bgecSTB" } local map_pop27_r6 = { maprs = maprs_popTS, "bgtzcTB", "bltzcTB", "bltcSTB" } local function maprs_popS(rs, rt) if rs == 0 then return 0 else return 1 end end local map_pop66_r6 = { maprs = maprs_popS, [0] = "jicTI", "beqzcSb" } local map_pop76_r6 = { maprs = maprs_popS, [0] = "jialcTI", "bnezcSb" } local function maprs_popST(rs, rt) if rs >= rt then return 0 elseif rs == 0 then return 1 else return 2 end end local map_pop10_r6 = { maprs = maprs_popST, [0] = "bovcSTB", "beqzalcTB", "beqcSTB" } local map_pop30_r6 = { maprs = maprs_popST, [0] = "bnvcSTB", "bnezalcTB", "bnecSTB" } local map_pri_r6 = { [0] = map_special_r6, map_regimm_r6, "jJ", "jalJ", "beq|beqz|bST00B", "bne|bnezST0B", map_pop06_r6, map_pop07_r6, map_pop10_r6, "addiu|liTS0I", "sltiTSI", "sltiuTSI", "andiTSU", "ori|liTS0U", "xoriTSU", "aui|luiTS0U", map_cop0, map_cop1_r6, false, false, false, false, map_pop26_r6, map_pop27_r6, map_pop30_r6, "daddiuTSI", false, false, false, "dauiTSI", false, map_special3_r6, "lbTSO", "lhTSO", false, "lwTSO", "lbuTSO", "lhuTSO", false, false, "sbTSO", "shTSO", false, "swTSO", false, false, false, false, false, "lwc1HSO", "bc#", false, false, "ldc1HSO", map_pop66_r6, "ldTSO", false, "swc1HSO", "balc#", map_pcrel_r6, false, "sdc1HSO", map_pop76_r6, "sdTSO", } ------------------------------------------------------------------------------ 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 = ctx.map_pri[rshift(op, 26)] while type(opat) ~= "string" do if not opat then return unknown(ctx) end if opat.maprs then opat = opat[opat.maprs(band(rshift(op,21),31), band(rshift(op,16),31))] else opat = opat[band(rshift(op, opat.shift), opat.mask)] or opat._ end 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 == "a" then x = band(rshift(op, 6), 7) elseif p == "E" then x = band(rshift(op, 6), 31) + 32 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 == "P" then x = band(rshift(op, 11), 31) + 33 elseif p == "L" then x = band(rshift(op, 11), 31) - last + 1 elseif p == "Q" then x = band(rshift(op, 11), 31) - last + 33 elseif p == "I" then x = arshift(lshift(op, 16), 16) elseif p == "2" then x = arshift(lshift(op, 13), 11) elseif p == "3" then x = arshift(lshift(op, 14), 11) 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), 14) + 4 ctx.rel = x x = format("0x%08x", x) elseif p == "b" then x = ctx.addr + ctx.pos + arshift(lshift(op, 11), 9) + 4 ctx.rel = x x = format("0x%08x", x) elseif p == "#" then x = ctx.addr + ctx.pos + arshift(lshift(op, 6), 4) + 4 ctx.rel = x x = format("0x%08x", x) elseif p == "J" then local a = ctx.addr + ctx.pos x = a - band(a, 0x0fffffff) + band(op, 0x03ffffff)*4 ctx.rel = x x = format("0x%08x", 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 ctx.map_pri = map_pri return ctx end local function create_el(code, addr, out) local ctx = create(code, addr, out) ctx.get = get_le return ctx end local function create_r6(code, addr, out) local ctx = create(code, addr, out) ctx.map_pri = map_pri_r6 return ctx end local function create_r6_el(code, addr, out) local ctx = create(code, addr, out) ctx.get = get_le ctx.map_pri = map_pri_r6 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 local function disass_r6(code, addr, out) create_r6(code, addr, out):disass() end local function disass_r6_el(code, addr, out) create_r6_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. return { create = create, create_el = create_el, create_r6 = create_r6, create_r6_el = create_r6_el, disass = disass, disass_el = disass_el, disass_r6 = disass_r6, disass_r6_el = disass_r6_el, regname = regname } subprojects/luajit/src/jit/dis_arm64be.lua0000644000175000017500000000115314741067622020067 0ustar aniolaniol---------------------------------------------------------------------------- -- LuaJIT ARM64BE disassembler wrapper module. -- -- Copyright (C) 2005-2023 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h ---------------------------------------------------------------------------- -- ARM64 instructions are always little-endian. So just forward to the -- common ARM64 disassembler module. All the interesting stuff is there. ------------------------------------------------------------------------------ return require((string.match(..., ".*%.") or "").."dis_arm64") subprojects/luajit/src/jit/dump.lua0000644000175000017500000005042314741067622016741 0ustar aniolaniol---------------------------------------------------------------------------- -- LuaJIT compiler dump module. -- -- Copyright (C) 2005-2023 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") 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, tohex = bit.band, bit.rshift, bit.tohex 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:sub(1, 4) == "mips" then t[traceexitstub(tr, 0)] = "exit" return end for i=0,nexit-1 do local addr = traceexitstub(tr, i) if addr < 0 then addr = addr + 2^32 end 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 maskaddr = jit.arch == "arm" and -2 local ircall = vmdef.ircall for i=0,#ircall do local addr = ircalladdr(i) if addr ~= 0 then if maskaddr then addr = band(addr, maskaddr) end if addr < 0 then addr = addr + 2^32 end 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 if addr < 0 then addr = addr + 2^32 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 if addr < 0 then addr = addr + 2^32 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, extra) local out = format(colortype_ansi[t], s) if extra then out = "\027[3m"..out end return out 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, extra) s = gsub(s, "[<>&]", html_escape) return format('%s', irtype_text[t], extra and " irt_extra" or "", 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 if band(mode, 64) ~= 0 then s = s.."K" 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, 0x800) ~= 0 then s = s.." sext" end local c = shr(mode, 12) if c == 1 then s = s.." none" elseif 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, ["TMPREF"] = { [0] = "", "IN", "OUT", "INOUT", "", "", "OUT2", "INOUT2" }, ["BUFHDR"] = { [0] = "RESET", "APPEND", "WRITE" }, ["TOSTR "] = { [0] = "INT", "NUM", "CHAR" }, } 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, sn) local k, t, slot = tracek(tr, idx) local tn = type(k) local s if tn == "number" then if t < 12 then s = k == 0 and "NULL" or format("[0x%08x]", k) elseif band(sn or 0, 0x30000) ~= 0 then s = band(sn, 0x20000) ~= 0 and "contpc" or "ftsz" elseif k == 2^52+2^51 then s = "bias" else s = format(0 < k and k < 0x1p-1026 and "%+a" or "%+.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 elseif sn == 0x1057fff then -- SNAP(1, SNAP_FRAME | SNAP_NORESTORE, REF_NIL) return "----" -- Special case for LJ_FR2 slot 1. else s = tostring(k) -- For primitives. end s = colorize(format("%-4s", s), t, band(sn or 0, 0x100000) ~= 0) 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, sn)) 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), band(sn, 0x100000) ~= 0)) 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 local fmt = vmdef.traceerr[err] if fmt == "NYI: bytecode %s" then local oidx = 6 * info info = sub(vmdef.bcnames, oidx+1, oidx+6) end err = format(fmt, 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 == -1 and "stitch" or 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) 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" 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 ------------------------------------------------------------------------------ local gpr64 = jit.arch:match("64") local fprmips32 = jit.arch == "mips" or jit.arch == "mipsel" -- 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 gpr64 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(" ", tohex(regs[i])) if i % 8 == 0 then out:write("\n") end end end if fprmips32 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. return { on = dumpon, off = dumpoff, start = dumpon -- For -j command line option. } subprojects/luajit/src/jit/dis_x64.lua0000644000175000017500000000131014741067622017243 0ustar aniolaniol---------------------------------------------------------------------------- -- LuaJIT x64 disassembler wrapper module. -- -- Copyright (C) 2005-2023 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 dis_x86 = require((string.match(..., ".*%.") or "").."dis_x86") return { create = dis_x86.create64, disass = dis_x86.disass64, regname = dis_x86.regname64 } subprojects/luajit/src/jit/.gitignore0000644000175000017500000000001214741067622017246 0ustar aniolaniolvmdef.lua subprojects/luajit/src/jit/dis_arm64.lua0000644000175000017500000007374214741067622017575 0ustar aniolaniol---------------------------------------------------------------------------- -- LuaJIT ARM64 disassembler module. -- -- Copyright (C) 2005-2023 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h -- -- Contributed by Djordje Kovacevic and Stefan Pejic from RT-RK.com. -- Sponsored by Cisco Systems, Inc. ---------------------------------------------------------------------------- -- This is a helper module used by the LuaJIT machine code dumper module. -- -- It disassembles most user-mode AArch64 instructions. -- NYI: Advanced SIMD and VFP instructions. ------------------------------------------------------------------------------ local type = type local sub, byte, format = string.sub, 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, bxor, tohex = bit.band, bit.bor, bit.bxor, bit.tohex local lshift, rshift, arshift = bit.lshift, bit.rshift, bit.arshift local ror = bit.ror ------------------------------------------------------------------------------ -- Opcode maps ------------------------------------------------------------------------------ local map_adr = { -- PC-relative addressing. shift = 31, mask = 1, [0] = "adrDBx", "adrpDBx" } local map_addsubi = { -- Add/subtract immediate. shift = 29, mask = 3, [0] = "add|movDNIg", "adds|cmnD0NIg", "subDNIg", "subs|cmpD0NIg", } local map_logi = { -- Logical immediate. shift = 31, mask = 1, [0] = { shift = 22, mask = 1, [0] = { shift = 29, mask = 3, [0] = "andDNig", "orr|movDN0ig", "eorDNig", "ands|tstD0Nig" }, false -- unallocated }, { shift = 29, mask = 3, [0] = "andDNig", "orr|movDN0ig", "eorDNig", "ands|tstD0Nig" } } local map_movwi = { -- Move wide immediate. shift = 31, mask = 1, [0] = { shift = 22, mask = 1, [0] = { shift = 29, mask = 3, [0] = "movnDWRg", false, "movz|movDYRg", "movkDWRg" }, false -- unallocated }, { shift = 29, mask = 3, [0] = "movnDWRg", false, "movz|movDYRg", "movkDWRg" }, } local map_bitf = { -- Bitfield. shift = 31, mask = 1, [0] = { shift = 22, mask = 1, [0] = { shift = 29, mask = 3, [0] = "sbfm|sbfiz|sbfx|asr|sxtw|sxth|sxtbDN12w", "bfm|bfi|bfxilDN13w", "ubfm|ubfiz|ubfx|lsr|lsl|uxth|uxtbDN12w" } }, { shift = 22, mask = 1, { shift = 29, mask = 3, [0] = "sbfm|sbfiz|sbfx|asr|sxtw|sxth|sxtbDN12x", "bfm|bfi|bfxilDN13x", "ubfm|ubfiz|ubfx|lsr|lsl|uxth|uxtbDN12x" } } } local map_datai = { -- Data processing - immediate. shift = 23, mask = 7, [0] = map_adr, map_adr, map_addsubi, false, map_logi, map_movwi, map_bitf, { shift = 15, mask = 0x1c0c1, [0] = "extr|rorDNM4w", [0x10080] = "extr|rorDNM4x", [0x10081] = "extr|rorDNM4x" } } local map_logsr = { -- Logical, shifted register. shift = 31, mask = 1, [0] = { shift = 15, mask = 1, [0] = { shift = 29, mask = 3, [0] = { shift = 21, mask = 1, [0] = "andDNMSg", "bicDNMSg" }, { shift = 21, mask = 1, [0] = "orr|movDN0MSg", "orn|mvnDN0MSg" }, { shift = 21, mask = 1, [0] = "eorDNMSg", "eonDNMSg" }, { shift = 21, mask = 1, [0] = "ands|tstD0NMSg", "bicsDNMSg" } }, false -- unallocated }, { shift = 29, mask = 3, [0] = { shift = 21, mask = 1, [0] = "andDNMSg", "bicDNMSg" }, { shift = 21, mask = 1, [0] = "orr|movDN0MSg", "orn|mvnDN0MSg" }, { shift = 21, mask = 1, [0] = "eorDNMSg", "eonDNMSg" }, { shift = 21, mask = 1, [0] = "ands|tstD0NMSg", "bicsDNMSg" } } } local map_assh = { shift = 31, mask = 1, [0] = { shift = 15, mask = 1, [0] = { shift = 29, mask = 3, [0] = { shift = 22, mask = 3, [0] = "addDNMSg", "addDNMSg", "addDNMSg", "addDNMg" }, { shift = 22, mask = 3, [0] = "adds|cmnD0NMSg", "adds|cmnD0NMSg", "adds|cmnD0NMSg", "adds|cmnD0NMg" }, { shift = 22, mask = 3, [0] = "sub|negDN0MSg", "sub|negDN0MSg", "sub|negDN0MSg", "sub|negDN0Mg" }, { shift = 22, mask = 3, [0] = "subs|cmp|negsD0N0MzSg", "subs|cmp|negsD0N0MzSg", "subs|cmp|negsD0N0MzSg", "subs|cmp|negsD0N0Mzg" }, }, false -- unallocated }, { shift = 29, mask = 3, [0] = { shift = 22, mask = 3, [0] = "addDNMSg", "addDNMSg", "addDNMSg", "addDNMg" }, { shift = 22, mask = 3, [0] = "adds|cmnD0NMSg", "adds|cmnD0NMSg", "adds|cmnD0NMSg", "adds|cmnD0NMg" }, { shift = 22, mask = 3, [0] = "sub|negDN0MSg", "sub|negDN0MSg", "sub|negDN0MSg", "sub|negDN0Mg" }, { shift = 22, mask = 3, [0] = "subs|cmp|negsD0N0MzSg", "subs|cmp|negsD0N0MzSg", "subs|cmp|negsD0N0MzSg", "subs|cmp|negsD0N0Mzg" } } } local map_addsubsh = { -- Add/subtract, shifted register. shift = 22, mask = 3, [0] = map_assh, map_assh, map_assh } local map_addsubex = { -- Add/subtract, extended register. shift = 22, mask = 3, [0] = { shift = 29, mask = 3, [0] = "addDNMXg", "adds|cmnD0NMXg", "subDNMXg", "subs|cmpD0NMzXg", } } local map_addsubc = { -- Add/subtract, with carry. shift = 10, mask = 63, [0] = { shift = 29, mask = 3, [0] = "adcDNMg", "adcsDNMg", "sbc|ngcDN0Mg", "sbcs|ngcsDN0Mg", } } local map_ccomp = { shift = 4, mask = 1, [0] = { shift = 10, mask = 3, [0] = { -- Conditional compare register. shift = 29, mask = 3, "ccmnNMVCg", false, "ccmpNMVCg", }, [2] = { -- Conditional compare immediate. shift = 29, mask = 3, "ccmnN5VCg", false, "ccmpN5VCg", } } } local map_csel = { -- Conditional select. shift = 11, mask = 1, [0] = { shift = 10, mask = 1, [0] = { shift = 29, mask = 3, [0] = "cselDNMzCg", false, "csinv|cinv|csetmDNMcg", false, }, { shift = 29, mask = 3, [0] = "csinc|cinc|csetDNMcg", false, "csneg|cnegDNMcg", false, } } } local map_data1s = { -- Data processing, 1 source. shift = 29, mask = 1, [0] = { shift = 31, mask = 1, [0] = { shift = 10, mask = 0x7ff, [0] = "rbitDNg", "rev16DNg", "revDNw", false, "clzDNg", "clsDNg" }, { shift = 10, mask = 0x7ff, [0] = "rbitDNg", "rev16DNg", "rev32DNx", "revDNx", "clzDNg", "clsDNg" } } } local map_data2s = { -- Data processing, 2 sources. shift = 29, mask = 1, [0] = { shift = 10, mask = 63, false, "udivDNMg", "sdivDNMg", false, false, false, false, "lslDNMg", "lsrDNMg", "asrDNMg", "rorDNMg" } } local map_data3s = { -- Data processing, 3 sources. shift = 29, mask = 7, [0] = { shift = 21, mask = 7, [0] = { shift = 15, mask = 1, [0] = "madd|mulDNMA0g", "msub|mnegDNMA0g" } }, false, false, false, { shift = 15, mask = 1, [0] = { shift = 21, mask = 7, [0] = "madd|mulDNMA0g", "smaddl|smullDxNMwA0x", "smulhDNMx", false, false, "umaddl|umullDxNMwA0x", "umulhDNMx" }, { shift = 21, mask = 7, [0] = "msub|mnegDNMA0g", "smsubl|smneglDxNMwA0x", false, false, false, "umsubl|umneglDxNMwA0x" } } } local map_datar = { -- Data processing, register. shift = 28, mask = 1, [0] = { shift = 24, mask = 1, [0] = map_logsr, { shift = 21, mask = 1, [0] = map_addsubsh, map_addsubex } }, { shift = 21, mask = 15, [0] = map_addsubc, false, map_ccomp, false, map_csel, false, { shift = 30, mask = 1, [0] = map_data2s, map_data1s }, false, map_data3s, map_data3s, map_data3s, map_data3s, map_data3s, map_data3s, map_data3s, map_data3s } } local map_lrl = { -- Load register, literal. shift = 26, mask = 1, [0] = { shift = 30, mask = 3, [0] = "ldrDwB", "ldrDxB", "ldrswDxB" }, { shift = 30, mask = 3, [0] = "ldrDsB", "ldrDdB" } } local map_lsriind = { -- Load/store register, immediate pre/post-indexed. shift = 30, mask = 3, [0] = { shift = 26, mask = 1, [0] = { shift = 22, mask = 3, [0] = "strbDwzL", "ldrbDwzL", "ldrsbDxzL", "ldrsbDwzL" } }, { shift = 26, mask = 1, [0] = { shift = 22, mask = 3, [0] = "strhDwzL", "ldrhDwzL", "ldrshDxzL", "ldrshDwzL" } }, { shift = 26, mask = 1, [0] = { shift = 22, mask = 3, [0] = "strDwzL", "ldrDwzL", "ldrswDxzL" }, { shift = 22, mask = 3, [0] = "strDszL", "ldrDszL" } }, { shift = 26, mask = 1, [0] = { shift = 22, mask = 3, [0] = "strDxzL", "ldrDxzL" }, { shift = 22, mask = 3, [0] = "strDdzL", "ldrDdzL" } } } local map_lsriro = { shift = 21, mask = 1, [0] = { -- Load/store register immediate. shift = 10, mask = 3, [0] = { -- Unscaled immediate. shift = 26, mask = 1, [0] = { shift = 30, mask = 3, [0] = { shift = 22, mask = 3, [0] = "sturbDwK", "ldurbDwK" }, { shift = 22, mask = 3, [0] = "sturhDwK", "ldurhDwK" }, { shift = 22, mask = 3, [0] = "sturDwK", "ldurDwK" }, { shift = 22, mask = 3, [0] = "sturDxK", "ldurDxK" } } }, map_lsriind, false, map_lsriind }, { -- Load/store register, register offset. shift = 10, mask = 3, [2] = { shift = 26, mask = 1, [0] = { shift = 30, mask = 3, [0] = { shift = 22, mask = 3, [0] = "strbDwO", "ldrbDwO", "ldrsbDxO", "ldrsbDwO" }, { shift = 22, mask = 3, [0] = "strhDwO", "ldrhDwO", "ldrshDxO", "ldrshDwO" }, { shift = 22, mask = 3, [0] = "strDwO", "ldrDwO", "ldrswDxO" }, { shift = 22, mask = 3, [0] = "strDxO", "ldrDxO" } }, { shift = 30, mask = 3, [2] = { shift = 22, mask = 3, [0] = "strDsO", "ldrDsO" }, [3] = { shift = 22, mask = 3, [0] = "strDdO", "ldrDdO" } } } } } local map_lsp = { -- Load/store register pair, offset. shift = 22, mask = 1, [0] = { shift = 30, mask = 3, [0] = { shift = 26, mask = 1, [0] = "stpDzAzwP", "stpDzAzsP", }, { shift = 26, mask = 1, "stpDzAzdP" }, { shift = 26, mask = 1, [0] = "stpDzAzxP" } }, { shift = 30, mask = 3, [0] = { shift = 26, mask = 1, [0] = "ldpDzAzwP", "ldpDzAzsP", }, { shift = 26, mask = 1, [0] = "ldpswDAxP", "ldpDzAzdP" }, { shift = 26, mask = 1, [0] = "ldpDzAzxP" } } } local map_ls = { -- Loads and stores. shift = 24, mask = 0x31, [0x10] = map_lrl, [0x30] = map_lsriro, [0x20] = { shift = 23, mask = 3, map_lsp, map_lsp, map_lsp }, [0x21] = { shift = 23, mask = 3, map_lsp, map_lsp, map_lsp }, [0x31] = { shift = 26, mask = 1, [0] = { shift = 30, mask = 3, [0] = { shift = 22, mask = 3, [0] = "strbDwzU", "ldrbDwzU" }, { shift = 22, mask = 3, [0] = "strhDwzU", "ldrhDwzU" }, { shift = 22, mask = 3, [0] = "strDwzU", "ldrDwzU" }, { shift = 22, mask = 3, [0] = "strDxzU", "ldrDxzU" } }, { shift = 30, mask = 3, [2] = { shift = 22, mask = 3, [0] = "strDszU", "ldrDszU" }, [3] = { shift = 22, mask = 3, [0] = "strDdzU", "ldrDdzU" } } }, } local map_datafp = { -- Data processing, SIMD and FP. shift = 28, mask = 7, { -- 001 shift = 24, mask = 1, [0] = { shift = 21, mask = 1, { shift = 10, mask = 3, [0] = { shift = 12, mask = 1, [0] = { shift = 13, mask = 1, [0] = { shift = 14, mask = 1, [0] = { shift = 15, mask = 1, [0] = { -- FP/int conversion. shift = 31, mask = 1, [0] = { shift = 16, mask = 0xff, [0x20] = "fcvtnsDwNs", [0x21] = "fcvtnuDwNs", [0x22] = "scvtfDsNw", [0x23] = "ucvtfDsNw", [0x24] = "fcvtasDwNs", [0x25] = "fcvtauDwNs", [0x26] = "fmovDwNs", [0x27] = "fmovDsNw", [0x28] = "fcvtpsDwNs", [0x29] = "fcvtpuDwNs", [0x30] = "fcvtmsDwNs", [0x31] = "fcvtmuDwNs", [0x38] = "fcvtzsDwNs", [0x39] = "fcvtzuDwNs", [0x60] = "fcvtnsDwNd", [0x61] = "fcvtnuDwNd", [0x62] = "scvtfDdNw", [0x63] = "ucvtfDdNw", [0x64] = "fcvtasDwNd", [0x65] = "fcvtauDwNd", [0x68] = "fcvtpsDwNd", [0x69] = "fcvtpuDwNd", [0x70] = "fcvtmsDwNd", [0x71] = "fcvtmuDwNd", [0x78] = "fcvtzsDwNd", [0x79] = "fcvtzuDwNd" }, { shift = 16, mask = 0xff, [0x20] = "fcvtnsDxNs", [0x21] = "fcvtnuDxNs", [0x22] = "scvtfDsNx", [0x23] = "ucvtfDsNx", [0x24] = "fcvtasDxNs", [0x25] = "fcvtauDxNs", [0x28] = "fcvtpsDxNs", [0x29] = "fcvtpuDxNs", [0x30] = "fcvtmsDxNs", [0x31] = "fcvtmuDxNs", [0x38] = "fcvtzsDxNs", [0x39] = "fcvtzuDxNs", [0x60] = "fcvtnsDxNd", [0x61] = "fcvtnuDxNd", [0x62] = "scvtfDdNx", [0x63] = "ucvtfDdNx", [0x64] = "fcvtasDxNd", [0x65] = "fcvtauDxNd", [0x66] = "fmovDxNd", [0x67] = "fmovDdNx", [0x68] = "fcvtpsDxNd", [0x69] = "fcvtpuDxNd", [0x70] = "fcvtmsDxNd", [0x71] = "fcvtmuDxNd", [0x78] = "fcvtzsDxNd", [0x79] = "fcvtzuDxNd" } } }, { -- FP data-processing, 1 source. shift = 31, mask = 1, [0] = { shift = 22, mask = 3, [0] = { shift = 15, mask = 63, [0] = "fmovDNf", "fabsDNf", "fnegDNf", "fsqrtDNf", false, "fcvtDdNs", false, false, "frintnDNf", "frintpDNf", "frintmDNf", "frintzDNf", "frintaDNf", false, "frintxDNf", "frintiDNf", }, { shift = 15, mask = 63, [0] = "fmovDNf", "fabsDNf", "fnegDNf", "fsqrtDNf", "fcvtDsNd", false, false, false, "frintnDNf", "frintpDNf", "frintmDNf", "frintzDNf", "frintaDNf", false, "frintxDNf", "frintiDNf", } } } }, { -- FP compare. shift = 31, mask = 1, [0] = { shift = 14, mask = 3, [0] = { shift = 23, mask = 1, [0] = { shift = 0, mask = 31, [0] = "fcmpNMf", [8] = "fcmpNZf", [16] = "fcmpeNMf", [24] = "fcmpeNZf", } } } } }, { -- FP immediate. shift = 31, mask = 1, [0] = { shift = 5, mask = 31, [0] = { shift = 23, mask = 1, [0] = "fmovDFf" } } } }, { -- FP conditional compare. shift = 31, mask = 1, [0] = { shift = 23, mask = 1, [0] = { shift = 4, mask = 1, [0] = "fccmpNMVCf", "fccmpeNMVCf" } } }, { -- FP data-processing, 2 sources. shift = 31, mask = 1, [0] = { shift = 23, mask = 1, [0] = { shift = 12, mask = 15, [0] = "fmulDNMf", "fdivDNMf", "faddDNMf", "fsubDNMf", "fmaxDNMf", "fminDNMf", "fmaxnmDNMf", "fminnmDNMf", "fnmulDNMf" } } }, { -- FP conditional select. shift = 31, mask = 1, [0] = { shift = 23, mask = 1, [0] = "fcselDNMCf" } } } }, { -- FP data-processing, 3 sources. shift = 31, mask = 1, [0] = { shift = 15, mask = 1, [0] = { shift = 21, mask = 5, [0] = "fmaddDNMAf", "fnmaddDNMAf" }, { shift = 21, mask = 5, [0] = "fmsubDNMAf", "fnmsubDNMAf" } } } }, { -- 010 shift = 0, mask = 0x81f8fc00, [0x100e400] = "moviDdG" } } local map_br = { -- Branches, exception generating and system instructions. shift = 29, mask = 7, [0] = "bB", { -- Compare & branch, immediate. shift = 24, mask = 3, [0] = "cbzDBg", "cbnzDBg", "tbzDTBw", "tbnzDTBw" }, { -- Conditional branch, immediate. shift = 24, mask = 3, [0] = { shift = 4, mask = 1, [0] = { shift = 0, mask = 15, [0] = "beqB", "bneB", "bhsB", "bloB", "bmiB", "bplB", "bvsB", "bvcB", "bhiB", "blsB", "bgeB", "bltB", "bgtB", "bleB", "balB" } } }, false, "blB", { -- Compare & branch, immediate. shift = 24, mask = 3, [0] = "cbzDBg", "cbnzDBg", "tbzDTBx", "tbnzDTBx" }, { shift = 24, mask = 3, [0] = { -- Exception generation. shift = 0, mask = 0xe0001f, [0x200000] = "brkW" }, { -- System instructions. shift = 0, mask = 0x3fffff, [0x03201f] = "nop" }, { -- Unconditional branch, register. shift = 0, mask = 0xfffc1f, [0x1f0000] = "brNx", [0x3f0000] = "blrNx", [0x5f0000] = "retNx" }, } } local map_init = { shift = 25, mask = 15, [0] = false, false, false, false, map_ls, map_datar, map_ls, map_datafp, map_datai, map_datai, map_br, map_br, map_ls, map_datar, map_ls, map_datafp } ------------------------------------------------------------------------------ local map_regs = { x = {}, w = {}, d = {}, s = {} } for i=0,30 do map_regs.x[i] = "x"..i map_regs.w[i] = "w"..i map_regs.d[i] = "d"..i map_regs.s[i] = "s"..i end map_regs.x[31] = "sp" map_regs.w[31] = "wsp" map_regs.d[31] = "d31" map_regs.s[31] = "s31" local map_cond = { [0] = "eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc", "hi", "ls", "ge", "lt", "gt", "le", "al", } local map_shift = { [0] = "lsl", "lsr", "asr", "ror"} local map_extend = { [0] = "uxtb", "uxth", "uxtw", "uxtx", "sxtb", "sxth", "sxtw", "sxtx", } ------------------------------------------------------------------------------ -- 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 %-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 local function match_reg(p, pat, regnum) return map_regs[match(pat, p.."%w-([xwds])")][regnum] end local function fmt_hex32(x) if x < 0 then return tohex(x) else return format("%x", x) end end local imm13_rep = { 0x55555555, 0x11111111, 0x01010101, 0x00010001, 0x00000001 } local function decode_imm13(op) local imms = band(rshift(op, 10), 63) local immr = band(rshift(op, 16), 63) if band(op, 0x00400000) == 0 then local len = 5 if imms >= 56 then if imms >= 60 then len = 1 else len = 2 end elseif imms >= 48 then len = 3 elseif imms >= 32 then len = 4 end local l = lshift(1, len)-1 local s = band(imms, l) local r = band(immr, l) local imm = ror(rshift(-1, 31-s), r) if len ~= 5 then imm = band(imm, lshift(1, l)-1) + rshift(imm, 31-l) end imm = imm * imm13_rep[len] local ix = fmt_hex32(imm) if rshift(op, 31) ~= 0 then return ix..tohex(imm) else return ix end else local lo, hi = -1, 0 if imms < 32 then lo = rshift(-1, 31-imms) else hi = rshift(-1, 63-imms) end if immr ~= 0 then lo, hi = ror(lo, immr), ror(hi, immr) local x = immr == 32 and 0 or band(bxor(lo, hi), lshift(-1, 32-immr)) lo, hi = bxor(lo, x), bxor(hi, x) if immr >= 32 then lo, hi = hi, lo end end if hi ~= 0 then return fmt_hex32(hi)..tohex(lo) else return fmt_hex32(lo) end end end local function parse_immpc(op, name) if name == "b" or name == "bl" then return arshift(lshift(op, 6), 4) elseif name == "adr" or name == "adrp" then local immlo = band(rshift(op, 29), 3) local immhi = lshift(arshift(lshift(op, 8), 13), 2) return bor(immhi, immlo) elseif name == "tbz" or name == "tbnz" then return lshift(arshift(lshift(op, 13), 18), 2) else return lshift(arshift(lshift(op, 8), 13), 2) end end local function parse_fpimm8(op) local sign = band(op, 0x100000) == 0 and 1 or -1 local exp = bxor(rshift(arshift(lshift(op, 12), 5), 24), 0x80) - 131 local frac = 16+band(rshift(op, 13), 15) return sign * frac * 2^exp end local function decode_fpmovi(op) local lo = rshift(op, 5) local hi = rshift(op, 9) lo = bor(band(lo, 1) * 0xff, band(lo, 2) * 0x7f80, band(lo, 4) * 0x3fc000, band(lo, 8) * 0x1fe00000) hi = bor(band(hi, 1) * 0xff, band(hi, 0x80) * 0x1fe, band(hi, 0x100) * 0xff00, band(hi, 0x200) * 0x7f8000) if hi ~= 0 then return fmt_hex32(hi)..tohex(lo) else return fmt_hex32(lo) end end local function prefer_bfx(sf, uns, imms, immr) if imms < immr or imms == 31 or imms == 63 then return false end if immr == 0 then if sf == 0 and (imms == 7 or imms == 15) then return false end if sf ~= 0 and uns == 0 and (imms == 7 or imms == 15 or imms == 31) then return false end end return true 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 map_reg ctx.op = op ctx.rel = nil last = nil local opat opat = map_init[band(rshift(op, 25), 15)] 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]*)(.*)") local altname, pat2 = match(pat, "|([a-z0-9_.|]*)(.*)") if altname then pat = pat2 end if sub(pat, 1, 1) == "." then local s2, p2 = match(pat, "^([a-z0-9.]*)(.*)") suffix = suffix..s2 pat = p2 end local rt = match(pat, "[gf]") if rt then if rt == "g" then map_reg = band(op, 0x80000000) ~= 0 and map_regs.x or map_regs.w else map_reg = band(op, 0x400000) ~= 0 and map_regs.d or map_regs.s end end local second0, immr for p in gmatch(pat, ".") do local x = nil if p == "D" then local regnum = band(op, 31) x = rt and map_reg[regnum] or match_reg(p, pat, regnum) elseif p == "N" then local regnum = band(rshift(op, 5), 31) x = rt and map_reg[regnum] or match_reg(p, pat, regnum) elseif p == "M" then local regnum = band(rshift(op, 16), 31) x = rt and map_reg[regnum] or match_reg(p, pat, regnum) elseif p == "A" then local regnum = band(rshift(op, 10), 31) x = rt and map_reg[regnum] or match_reg(p, pat, regnum) elseif p == "B" then local addr = ctx.addr + pos + parse_immpc(op, name) ctx.rel = addr x = "0x"..tohex(addr) elseif p == "T" then x = bor(band(rshift(op, 26), 32), band(rshift(op, 19), 31)) elseif p == "V" then x = band(op, 15) elseif p == "C" then x = map_cond[band(rshift(op, 12), 15)] elseif p == "c" then local rn = band(rshift(op, 5), 31) local rm = band(rshift(op, 16), 31) local cond = band(rshift(op, 12), 15) local invc = bxor(cond, 1) x = map_cond[cond] if altname and cond ~= 14 and cond ~= 15 then local a1, a2 = match(altname, "([^|]*)|(.*)") if rn == rm then local n = #operands operands[n] = nil x = map_cond[invc] if rn ~= 31 then if a1 then name = a1 else name = altname end else operands[n-1] = nil name = a2 end end end elseif p == "W" then x = band(rshift(op, 5), 0xffff) elseif p == "Y" then x = band(rshift(op, 5), 0xffff) local hw = band(rshift(op, 21), 3) if altname and (hw == 0 or x ~= 0) then name = altname end elseif p == "L" then local rn = map_regs.x[band(rshift(op, 5), 31)] local imm9 = arshift(lshift(op, 11), 23) if band(op, 0x800) ~= 0 then x = "["..rn..", #"..imm9.."]!" else x = "["..rn.."], #"..imm9 end elseif p == "U" then local rn = map_regs.x[band(rshift(op, 5), 31)] local sz = band(rshift(op, 30), 3) local imm12 = lshift(rshift(lshift(op, 10), 20), sz) if imm12 ~= 0 then x = "["..rn..", #"..imm12.."]" else x = "["..rn.."]" end elseif p == "K" then local rn = map_regs.x[band(rshift(op, 5), 31)] local imm9 = arshift(lshift(op, 11), 23) if imm9 ~= 0 then x = "["..rn..", #"..imm9.."]" else x = "["..rn.."]" end elseif p == "O" then local rn, rm = map_regs.x[band(rshift(op, 5), 31)] local m = band(rshift(op, 13), 1) if m == 0 then rm = map_regs.w[band(rshift(op, 16), 31)] else rm = map_regs.x[band(rshift(op, 16), 31)] end x = "["..rn..", "..rm local opt = band(rshift(op, 13), 7) local s = band(rshift(op, 12), 1) local sz = band(rshift(op, 30), 3) -- extension to be applied if opt == 3 then if s == 0 then x = x.."]" else x = x..", lsl #"..sz.."]" end elseif opt == 2 or opt == 6 or opt == 7 then if s == 0 then x = x..", "..map_extend[opt].."]" else x = x..", "..map_extend[opt].." #"..sz.."]" end else x = x.."]" end elseif p == "P" then local sh = 2 + rshift(op, 31 - band(rshift(op, 26), 1)) local imm7 = lshift(arshift(lshift(op, 10), 25), sh) local rn = map_regs.x[band(rshift(op, 5), 31)] local ind = band(rshift(op, 23), 3) if ind == 1 then x = "["..rn.."], #"..imm7 elseif ind == 2 then if imm7 == 0 then x = "["..rn.."]" else x = "["..rn..", #"..imm7.."]" end elseif ind == 3 then x = "["..rn..", #"..imm7.."]!" end elseif p == "I" then local shf = band(rshift(op, 22), 3) local imm12 = band(rshift(op, 10), 0x0fff) local rn, rd = band(rshift(op, 5), 31), band(op, 31) if altname == "mov" and shf == 0 and imm12 == 0 and (rn == 31 or rd == 31) then name = altname x = nil elseif shf == 0 then x = imm12 elseif shf == 1 then x = imm12..", lsl #12" end elseif p == "i" then x = "#0x"..decode_imm13(op) elseif p == "1" then immr = band(rshift(op, 16), 63) x = immr elseif p == "2" then x = band(rshift(op, 10), 63) if altname then local a1, a2, a3, a4, a5, a6 = match(altname, "([^|]*)|([^|]*)|([^|]*)|([^|]*)|([^|]*)|(.*)") local sf = band(rshift(op, 26), 32) local uns = band(rshift(op, 30), 1) if prefer_bfx(sf, uns, x, immr) then name = a2 x = x - immr + 1 elseif immr == 0 and x == 7 then local n = #operands operands[n] = nil if sf ~= 0 then operands[n-1] = gsub(operands[n-1], "x", "w") end last = operands[n-1] name = a6 x = nil elseif immr == 0 and x == 15 then local n = #operands operands[n] = nil if sf ~= 0 then operands[n-1] = gsub(operands[n-1], "x", "w") end last = operands[n-1] name = a5 x = nil elseif x == 31 or x == 63 then if x == 31 and immr == 0 and name == "sbfm" then name = a4 local n = #operands operands[n] = nil if sf ~= 0 then operands[n-1] = gsub(operands[n-1], "x", "w") end last = operands[n-1] else name = a3 end x = nil elseif band(x, 31) ~= 31 and immr == x+1 and name == "ubfm" then name = a4 last = "#"..(sf+32 - immr) operands[#operands] = last x = nil elseif x < immr then name = a1 last = "#"..(sf+32 - immr) operands[#operands] = last x = x + 1 end end elseif p == "3" then x = band(rshift(op, 10), 63) if altname then local a1, a2 = match(altname, "([^|]*)|(.*)") if x < immr then name = a1 local sf = band(rshift(op, 26), 32) last = "#"..(sf+32 - immr) operands[#operands] = last x = x + 1 else name = a2 x = x - immr + 1 end end elseif p == "4" then x = band(rshift(op, 10), 63) local rn = band(rshift(op, 5), 31) local rm = band(rshift(op, 16), 31) if altname and rn == rm then local n = #operands operands[n] = nil last = operands[n-1] name = altname end elseif p == "5" then x = band(rshift(op, 16), 31) elseif p == "S" then x = band(rshift(op, 10), 63) if x == 0 then x = nil else x = map_shift[band(rshift(op, 22), 3)].." #"..x end elseif p == "X" then local opt = band(rshift(op, 13), 7) -- Width specifier . if opt ~= 3 and opt ~= 7 then last = map_regs.w[band(rshift(op, 16), 31)] operands[#operands] = last end x = band(rshift(op, 10), 7) -- Extension. if opt == 2 + band(rshift(op, 31), 1) and band(rshift(op, second0 and 5 or 0), 31) == 31 then if x == 0 then x = nil else x = "lsl #"..x end else if x == 0 then x = map_extend[band(rshift(op, 13), 7)] else x = map_extend[band(rshift(op, 13), 7)].." #"..x end end elseif p == "R" then x = band(rshift(op,21), 3) if x == 0 then x = nil else x = "lsl #"..x*16 end elseif p == "z" then local n = #operands if operands[n] == "sp" then operands[n] = "xzr" elseif operands[n] == "wsp" then operands[n] = "wzr" end elseif p == "Z" then x = 0 elseif p == "F" then x = parse_fpimm8(op) elseif p == "G" then x = "#0x"..decode_fpmovi(op) elseif p == "g" or p == "f" or p == "x" or p == "w" or p == "d" or p == "s" then -- These are handled in D/N/M/A. elseif p == "0" then if last == "sp" or last == "wsp" then local n = #operands operands[n] = nil last = operands[n-1] if altname then local a1, a2 = match(altname, "([^|]*)|(.*)") if not a1 then name = altname elseif second0 then name, altname = a2, a1 else name, altname = a1, a2 end end end second0 = true 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 < 32 then return map_regs.x[r] end return map_regs.d[r-32] end -- Public module functions. return { create = create, disass = disass, regname = regname } subprojects/luajit/src/lj_opt_loop.c0000644000175000017500000003640114741067622017167 0ustar aniolaniol/* ** LOOP: Loop Optimizations. ** Copyright (C) 2005-2023 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_buf.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 = (uint32_t)nmapofs; snap->ref = (IRRef1)J->cur.nins; snap->mcofs = 0; 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 = (uint32_t)(nmap - J->cur.snapmap); } typedef struct LoopState { jit_State *J; IRRef1 *subst; MSize sizesubst; } LoopState; /* Unroll loop. */ static void loop_unroll(LoopState *lps) { jit_State *J = lps->J; IRRef1 phi[LJ_MAX_PHI]; uint32_t nphi = 0; IRRef1 *subst; SnapNo onsnap; SnapShot *osnap, *loopsnap; SnapEntry *loopmap, *psentinel; IRRef ins, invar; /* Allocate substitution table. ** Only non-constant refs in [REF_BIAS,invar) are valid indexes. */ invar = J->cur.nins; lps->sizesubst = invar - REF_BIAS; lps->subst = lj_mem_newvec(J->L, lps->sizesubst, IRRef1); subst = lps->subst - 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]; lj_assertJ(*psentinel == J->cur.snapmap[J->cur.snap[0].nent], "mismatched PC for loop snapshot"); *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 && ref > invar && ((irr->o == IR_CONV && irr->op1 < invar) || (irr->o == IR_ALEN && irr->op2 < invar && irr->op2 != REF_NIL))) { /* May need an extra PHI for a CONV or ALEN hint. */ ref = irr->o == IR_CONV ? irr->op1 : irr->op2; 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 = (uint32_t)J->cur.snap[--J->cur.nsnap].mapofs; lj_assertJ(J->cur.nsnapmap <= J->sizesnapmap, "bad snapshot map index"); *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 = (uint32_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((LoopState *)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; LoopState lps; int errcode; lps.J = J; lps.subst = NULL; lps.sizesubst = 0; errcode = lj_vm_cpcall(J->L, NULL, &lps, cploop_opt); lj_mem_freevec(J2G(J), lps.subst, lps.sizesubst, IRRef1); 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 subprojects/luajit/src/lj_trace.h0000644000175000017500000000334514741067622016440 0ustar aniolaniol/* ** Trace management. ** Copyright (C) 2005-2023 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 GCtrace * LJ_FASTCALL lj_trace_alloc(lua_State *L, GCtrace *T); 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 void LJ_FASTCALL lj_trace_stitch(jit_State *J, const BCIns *pc); LJ_FUNCA int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr); #if LJ_UNWIND_EXT LJ_FUNC uintptr_t LJ_FASTCALL lj_trace_unwind(jit_State *J, uintptr_t addr, ExitNo *ep); #endif /* 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 subprojects/luajit/src/lj_bcwrite.c0000644000175000017500000003161714741067622016777 0ustar aniolaniol/* ** Bytecode writer. ** Copyright (C) 2005-2023 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_buf.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_strfmt.h" #include "lj_bcdump.h" #include "lj_vm.h" /* Context for bytecode writer. */ typedef struct BCWriteCtx { SBuf sb; /* Output buffer. */ GCproto *pt; /* Root prototype. */ lua_Writer wfunc; /* Writer callback. */ void *wdata; /* Writer callback data. */ TValue **heap; /* Heap used for deterministic sorting. */ uint32_t heapsz; /* Size of heap. */ uint32_t flags; /* BCDUMP_F_* flags. */ int status; /* Status from writer callback. */ #ifdef LUA_USE_ASSERT global_State *g; #endif } BCWriteCtx; #ifdef LUA_USE_ASSERT #define lj_assertBCW(c, ...) lj_assertG_(ctx->g, (c), __VA_ARGS__) #else #define lj_assertBCW(c, ...) ((void)ctx) #endif /* -- Bytecode writer ----------------------------------------------------- */ /* Write a single constant key/value of a template table. */ static void bcwrite_ktabk(BCWriteCtx *ctx, cTValue *o, int narrow) { char *p = lj_buf_more(&ctx->sb, 1+10); if (tvisstr(o)) { const GCstr *str = strV(o); MSize len = str->len; p = lj_buf_more(&ctx->sb, 5+len); p = lj_strfmt_wuleb128(p, BCDUMP_KTAB_STR+len); p = lj_buf_wmem(p, strdata(str), len); } else if (tvisint(o)) { *p++ = BCDUMP_KTAB_INT; p = lj_strfmt_wuleb128(p, 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. */ *p++ = BCDUMP_KTAB_INT; p = lj_strfmt_wuleb128(p, k); ctx->sb.w = p; return; } } *p++ = BCDUMP_KTAB_NUM; p = lj_strfmt_wuleb128(p, o->u32.lo); p = lj_strfmt_wuleb128(p, o->u32.hi); } else { lj_assertBCW(tvispri(o), "unhandled type %d", itype(o)); *p++ = BCDUMP_KTAB_NIL+~itype(o); } ctx->sb.w = p; } /* Compare two template table keys. */ static LJ_AINLINE int bcwrite_ktabk_lt(TValue *a, TValue *b) { uint32_t at = itype(a), bt = itype(b); if (at != bt) { /* This also handles false and true keys. */ return at < bt; } else if (at == LJ_TSTR) { return lj_str_cmp(strV(a), strV(b)) < 0; } else { return a->u64 < b->u64; /* This works for numbers and integers. */ } } /* Insert key into a sorted heap. */ static void bcwrite_ktabk_heap_insert(TValue **heap, MSize idx, MSize end, TValue *key) { MSize child; while ((child = idx * 2 + 1) < end) { /* Find lower of the two children. */ TValue *c0 = heap[child]; if (child + 1 < end) { TValue *c1 = heap[child + 1]; if (bcwrite_ktabk_lt(c1, c0)) { c0 = c1; child++; } } if (bcwrite_ktabk_lt(key, c0)) break; /* Key lower? Found our position. */ heap[idx] = c0; /* Move lower child up. */ idx = child; /* Descend. */ } heap[idx] = key; /* Insert key here. */ } /* Resize heap, dropping content. */ static void bcwrite_heap_resize(BCWriteCtx *ctx, uint32_t nsz) { lua_State *L = sbufL(&ctx->sb); if (ctx->heapsz) { lj_mem_freevec(G(L), ctx->heap, ctx->heapsz, TValue *); ctx->heapsz = 0; } if (nsz) { ctx->heap = lj_mem_newvec(L, nsz, TValue *); ctx->heapsz = nsz; } } /* Write hash part of template table in sorted order. */ static void bcwrite_ktab_sorted_hash(BCWriteCtx *ctx, Node *node, MSize nhash) { TValue **heap = ctx->heap; MSize i = nhash; for (;; node--) { /* Build heap. */ if (!tvisnil(&node->key)) { bcwrite_ktabk_heap_insert(heap, --i, nhash, &node->key); if (i == 0) break; } } do { /* Drain heap. */ TValue *key = heap[0]; /* Output lowest key from top. */ bcwrite_ktabk(ctx, key, 0); bcwrite_ktabk(ctx, (TValue *)((char *)key - offsetof(Node, key)), 1); key = heap[--nhash]; /* Remove last key. */ bcwrite_ktabk_heap_insert(heap, 0, nhash, key); /* Re-insert. */ } while (nhash); } /* Write a template table. */ static void bcwrite_ktab(BCWriteCtx *ctx, char *p, 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].key); } /* Write number of array slots and hash slots. */ p = lj_strfmt_wuleb128(p, narray); p = lj_strfmt_wuleb128(p, nhash); ctx->sb.w = p; 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. */ Node *node = noderef(t->node) + t->hmask; if ((ctx->flags & BCDUMP_F_DETERMINISTIC) && nhash > 1) { if (ctx->heapsz < nhash) bcwrite_heap_resize(ctx, t->hmask + 1); bcwrite_ktab_sorted_hash(ctx, node, nhash); } else { MSize i = nhash; for (;; node--) if (!tvisnil(&node->key)) { 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; char *p; /* 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) { lj_assertBCW((pt->flags & PROTO_CHILD), "prototype has unexpected 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 { lj_assertBCW(id == CTID_COMPLEX_DOUBLE, "bad cdata constant CTID %d", id); tp = BCDUMP_KGC_COMPLEX; } #endif } else { lj_assertBCW(o->gch.gct == ~LJ_TTAB, "bad constant GC type %d", o->gch.gct); tp = BCDUMP_KGC_TAB; need = 1+2*5; } /* Write constant type. */ p = lj_buf_more(&ctx->sb, need); p = lj_strfmt_wuleb128(p, tp); /* Write constant data (if any). */ if (tp >= BCDUMP_KGC_STR) { p = lj_buf_wmem(p, strdata(gco2str(o)), gco2str(o)->len); } else if (tp == BCDUMP_KGC_TAB) { bcwrite_ktab(ctx, p, gco2tab(o)); continue; #if LJ_HASFFI } else if (tp != BCDUMP_KGC_CHILD) { cTValue *q = (TValue *)cdataptr(gco2cd(o)); p = lj_strfmt_wuleb128(p, q[0].u32.lo); p = lj_strfmt_wuleb128(p, q[0].u32.hi); if (tp == BCDUMP_KGC_COMPLEX) { p = lj_strfmt_wuleb128(p, q[1].u32.lo); p = lj_strfmt_wuleb128(p, q[1].u32.hi); } #endif } ctx->sb.w = p; } } /* 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); char *p = lj_buf_more(&ctx->sb, 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 && o->u32.hi != LJ_KEYINDEX) { /* 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: p = lj_strfmt_wuleb128(p, 2*(uint32_t)k | ((uint32_t)k&0x80000000u)); if (k < 0) p[-1] = (p[-1] & 7) | ((k>>27) & 0x18); continue; } } p = lj_strfmt_wuleb128(p, 1+(2*o->u32.lo | (o->u32.lo & 0x80000000u))); if (o->u32.lo >= 0x80000000u) p[-1] = (p[-1] & 7) | ((o->u32.lo>>27) & 0x18); p = lj_strfmt_wuleb128(p, o->u32.hi); } } ctx->sb.w = p; } /* Write bytecode instructions. */ static char *bcwrite_bytecode(BCWriteCtx *ctx, char *p, GCproto *pt) { MSize nbc = pt->sizebc-1; /* Omit the [JI]FUNC* header. */ #if LJ_HASJIT uint8_t *q = (uint8_t *)p; #endif p = lj_buf_wmem(p, proto_bc(pt)+1, nbc*(MSize)sizeof(BCIns)); UNUSED(ctx); #if LJ_HASJIT /* Unpatch modified bytecode containing ILOOP/JLOOP etc. */ if ((pt->flags & PROTO_ILOOP) || pt->trace) { jit_State *J = L2J(sbufL(&ctx->sb)); MSize i; for (i = 0; i < nbc; i++, q += sizeof(BCIns)) { BCOp op = (BCOp)q[LJ_ENDIAN_SELECT(0, 3)]; if (op == BC_IFORL || op == BC_IITERL || op == BC_ILOOP || op == BC_JFORI) { q[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 = q[LJ_ENDIAN_SELECT(2, 1)] + (q[LJ_ENDIAN_SELECT(3, 0)] << 8); memcpy(q, &traceref(J, rd)->startins, 4); } } } #endif return p; } /* Write prototype. */ static void bcwrite_proto(BCWriteCtx *ctx, GCproto *pt) { MSize sizedbg = 0; char *p; /* 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. */ p = lj_buf_need(&ctx->sb, 5+4+6*5+(pt->sizebc-1)*(MSize)sizeof(BCIns)+pt->sizeuv*2); p += 5; /* Leave room for final size. */ /* Write prototype header. */ *p++ = (pt->flags & (PROTO_CHILD|PROTO_VARARG|PROTO_FFI)); *p++ = pt->numparams; *p++ = pt->framesize; *p++ = pt->sizeuv; p = lj_strfmt_wuleb128(p, pt->sizekgc); p = lj_strfmt_wuleb128(p, pt->sizekn); p = lj_strfmt_wuleb128(p, pt->sizebc-1); if (!(ctx->flags & BCDUMP_F_STRIP)) { if (proto_lineinfo(pt)) sizedbg = pt->sizept - (MSize)((char *)proto_lineinfo(pt) - (char *)pt); p = lj_strfmt_wuleb128(p, sizedbg); if (sizedbg) { p = lj_strfmt_wuleb128(p, pt->firstline); p = lj_strfmt_wuleb128(p, pt->numline); } } /* Write bytecode instructions and upvalue refs. */ p = bcwrite_bytecode(ctx, p, pt); p = lj_buf_wmem(p, proto_uv(pt), pt->sizeuv*2); ctx->sb.w = p; /* Write constants. */ bcwrite_kgc(ctx, pt); bcwrite_knum(ctx, pt); /* Write debug info, if not stripped. */ if (sizedbg) { p = lj_buf_more(&ctx->sb, sizedbg); p = lj_buf_wmem(p, proto_lineinfo(pt), sizedbg); ctx->sb.w = p; } /* Pass buffer to writer function. */ if (ctx->status == 0) { MSize n = sbuflen(&ctx->sb) - 5; MSize nn = (lj_fls(n)+8)*9 >> 6; char *q = ctx->sb.b + (5 - nn); p = lj_strfmt_wuleb128(q, n); /* Fill in final size. */ lj_assertBCW(p == ctx->sb.b + 5, "bad ULEB128 write"); ctx->status = ctx->wfunc(sbufL(&ctx->sb), q, 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; char *p = lj_buf_need(&ctx->sb, 5+5+len); *p++ = BCDUMP_HEAD1; *p++ = BCDUMP_HEAD2; *p++ = BCDUMP_HEAD3; *p++ = BCDUMP_VERSION; *p++ = (ctx->flags & (BCDUMP_F_STRIP | BCDUMP_F_FR2)) + LJ_BE*BCDUMP_F_BE + ((ctx->pt->flags & PROTO_FFI) ? BCDUMP_F_FFI : 0); if (!(ctx->flags & BCDUMP_F_STRIP)) { p = lj_strfmt_wuleb128(p, len); p = lj_buf_wmem(p, name, len); } ctx->status = ctx->wfunc(sbufL(&ctx->sb), ctx->sb.b, (MSize)(p - ctx->sb.b), 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(sbufL(&ctx->sb), &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(L); UNUSED(dummy); lj_buf_need(&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, uint32_t flags) { BCWriteCtx ctx; int status; ctx.pt = pt; ctx.wfunc = writer; ctx.wdata = data; ctx.heapsz = 0; if ((bc_op(proto_bc(pt)[0]) != BC_NOT) == LJ_FR2) flags |= BCDUMP_F_FR2; ctx.flags = flags; ctx.status = 0; #ifdef LUA_USE_ASSERT ctx.g = G(L); #endif lj_buf_init(L, &ctx.sb); status = lj_vm_cpcall(L, NULL, &ctx, cpwriter); if (status == 0) status = ctx.status; lj_buf_free(G(sbufL(&ctx.sb)), &ctx.sb); bcwrite_heap_resize(&ctx, 0); return status; } subprojects/luajit/src/lj_emit_mips.h0000644000175000017500000002165614741067622017335 0ustar aniolaniol/* ** MIPS instruction emitter. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #if LJ_64 static intptr_t get_k64val(ASMState *as, IRRef ref) { IRIns *ir = IR(ref); if (ir->o == IR_KINT64) { return (intptr_t)ir_kint64(ir)->u64; } else if (ir->o == IR_KGC) { return (intptr_t)ir_kgc(ir); } else if (ir->o == IR_KPTR || ir->o == IR_KKPTR) { return (intptr_t)ir_kptr(ir); } else if (LJ_SOFTFP && ir->o == IR_KNUM) { return (intptr_t)ir_knum(ir)->u64; } else { lj_assertA(ir->o == IR_KINT || ir->o == IR_KNULL, "bad 64 bit const IR op %d", ir->o); return ir->i; /* Sign-extended. */ } } #endif #if LJ_64 #define get_kval(as, ref) get_k64val(as, ref) #else #define get_kval(as, ref) (IR((ref))->i) #endif /* -- 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 (LJ_64 || (as->flags & JIT_F_MIPSXXR2)) { 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); } } #if LJ_64 || LJ_HASBUFFER static void emit_tsml(ASMState *as, MIPSIns mi, Reg rt, Reg rs, uint32_t msb, uint32_t lsb) { *--as->mcp = mi | MIPSF_T(rt) | MIPSF_S(rs) | MIPSF_M(msb) | MIPSF_L(lsb); } #endif /* -- 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 rd, intptr_t i) { RegSet work = ~as->freeset & RSET_GPR; while (work) { Reg r = rset_picktop(work); IRRef ref = regcost_ref(as->cost[r]); lj_assertA(r != rd, "dest reg %d not free", rd); if (ref < ASMREF_L) { intptr_t delta = (intptr_t)((uintptr_t)i - (uintptr_t)(ra_iskref(ref) ? ra_krefk(as, ref) : get_kval(as, ref))); if (checki16(delta)) { emit_tsi(as, MIPSI_AADDIU, rd, 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)) { intptr_t jgl = (intptr_t)(void *)J2G(as->J); if ((uintptr_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)); } } #if LJ_64 /* Load a 64 bit constant into a GPR. */ static void emit_loadu64(ASMState *as, Reg r, uint64_t u64) { if (checki32((int64_t)u64)) { emit_loadi(as, r, (int32_t)u64); } else { uint64_t delta = u64 - (uint64_t)(void *)J2G(as->J); if (delta < 65536) { emit_tsi(as, MIPSI_DADDIU, r, RID_JGL, (int32_t)(delta-32768)); } else if (emit_kdelta1(as, r, (intptr_t)u64)) { return; } else { /* TODO MIPSR6: Use DAHI & DATI. Caveat: sign-extension. */ if ((u64 & 0xffff)) { emit_tsi(as, MIPSI_ORI, r, r, u64 & 0xffff); } if (((u64 >> 16) & 0xffff)) { emit_dta(as, MIPSI_DSLL, r, r, 16); emit_tsi(as, MIPSI_ORI, r, r, (u64 >> 16) & 0xffff); emit_dta(as, MIPSI_DSLL, r, r, 16); } else { emit_dta(as, MIPSI_DSLL32, r, r, 0); } emit_loadi(as, r, (int32_t)(u64 >> 32)); } /* TODO: There are probably more optimization opportunities. */ } } #define emit_loada(as, r, addr) emit_loadu64(as, (r), u64ptr((addr))) #else #define emit_loada(as, r, addr) emit_loadi(as, (r), i32ptr((addr))) #endif static Reg ra_allock(ASMState *as, intptr_t k, RegSet allow); static void ra_allockreg(ASMState *as, intptr_t k, Reg r); /* Get/set from constant pointer. */ static void emit_lsptr(ASMState *as, MIPSIns mi, Reg r, void *p, RegSet allow) { intptr_t jgl = (intptr_t)(J2G(as->J)); intptr_t i = (intptr_t)(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); } #if LJ_64 static void emit_loadk64(ASMState *as, Reg r, IRIns *ir) { const uint64_t *k = &ir_k64(ir)->u64; Reg r64 = r; if (rset_test(RSET_FPR, r)) { r64 = RID_TMP; emit_tg(as, MIPSI_DMTC1, r64, r); } if ((uint32_t)((intptr_t)k-(intptr_t)J2G(as->J)) < 65536) emit_lsptr(as, MIPSI_LD, r64, (void *)k, 0); else emit_loadu64(as, r64, *k); } #else #define emit_loadk64(as, r, ir) \ emit_lsptr(as, MIPSI_LDC1, ((r) & 31), (void *)&ir_knum((ir))->u64, RSET_GPR) #endif /* 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_AL, (r), (int32_t)offsetof(global_State, field)) #define emit_setgl(as, r, field) \ emit_lsglptr(as, MIPSI_AS, (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; lj_assertA(((delta + 0x8000) >> 16) == 0, "branch target out of range"); *--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, int needcfa) { MCode *p = as->mcp; #if LJ_TARGET_MIPSR6 ptrdiff_t delta = (char *)target - (char *)p; if ((((delta>>2) + 0x02000000) >> 26) == 0) { /* Try compact call first. */ *--p = MIPSI_BALC | (((uintptr_t)delta >>2) & 0x03ffffffu); as->mcp = p; return; } #endif *--p = MIPSI_NOP; /* Delay slot. */ if ((((uintptr_t)target ^ (uintptr_t)p) >> 28) == 0) { #if !LJ_TARGET_MIPSR6 *--p = (((uintptr_t)target & 1) ? MIPSI_JALX : MIPSI_JAL) | (((uintptr_t)target >>2) & 0x03ffffffu); #else *--p = MIPSI_JAL | (((uintptr_t)target >>2) & 0x03ffffffu); #endif } else { /* Target out of range: need indirect call. */ *--p = MIPSI_JALR | MIPSF_S(RID_CFUNCADDR); needcfa = 1; } as->mcp = p; if (needcfa) ra_allockreg(as, (intptr_t)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 with base and (small) offset address. */ static void emit_loadofs(ASMState *as, IRIns *ir, Reg r, Reg base, int32_t ofs) { if (r < RID_MAX_GPR) emit_tsi(as, irt_is64(ir->t) ? MIPSI_LD : MIPSI_LW, r, base, ofs); else emit_tsi(as, irt_isnum(ir->t) ? MIPSI_LDC1 : MIPSI_LWC1, (r & 31), base, ofs); } /* Generic store of register with base and (small) offset address. */ static void emit_storeofs(ASMState *as, IRIns *ir, Reg r, Reg base, int32_t ofs) { if (r < RID_MAX_GPR) emit_tsi(as, irt_is64(ir->t) ? MIPSI_SD : MIPSI_SW, r, base, ofs); else emit_tsi(as, irt_isnum(ir->t) ? MIPSI_SDC1 : MIPSI_SWC1, (r&31), base, ofs); } /* Add offset to pointer. */ static void emit_addptr(ASMState *as, Reg r, int32_t ofs) { if (ofs) { lj_assertA(checki16(ofs), "offset %d out of range", ofs); emit_tsi(as, MIPSI_AADDIU, r, r, ofs); } } #define emit_spsub(as, ofs) emit_addptr(as, RID_SP, -(ofs)) subprojects/luajit/src/lua.h0000644000175000017500000003004414741067622015432 0ustar aniolaniol/* ** $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 (https://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 */ #define LUA_OK 0 #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 #define LUA_GCISRUNNING 9 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); LUA_API const lua_Number *lua_version (lua_State *L); LUA_API void lua_copy (lua_State *L, int fromidx, int toidx); LUA_API lua_Number lua_tonumberx (lua_State *L, int idx, int *isnum); LUA_API lua_Integer lua_tointegerx (lua_State *L, int idx, int *isnum); /* From Lua 5.3. */ LUA_API int lua_isyieldable (lua_State *L); 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 subprojects/luajit/src/meson.build0000644000175000017500000000540014741067416016641 0ustar aniolaniolljlib_src = files( 'lib_base.c', 'lib_bit.c', 'lib_buffer.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_assert.c', 'lj_bc.c', 'lj_bcread.c', 'lj_bcwrite.c', 'lj_buf.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_prng.c', 'lj_profile.c', 'lj_record.c', 'lj_serialize.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', 'lj_udata.c', 'lj_vmevent.c', 'lj_vmmath.c', ) src_inc = include_directories('.') minilua = executable('minilua', 'host/minilua.c', dependencies: system_deps, native: true) relver = vcs_tag(command: ['git', 'show', '-s', '--format=%ct'], fallback: 'ROLLING', input: 'luajit_relver.txt.in', output: 'luajit_relver.txt', replace_string: '@VCS_CT@') luajit_rolling_h = files('luajit_rolling.h') luajit_h = custom_target('luajit_h', command: [minilua, '@INPUT@', '@OUTPUT@'], input: ['host/genversion.lua', 'luajit_rolling.h', relver], output: 'luajit.h') subdir('host') hdrgen = [ 'bcdef', 'ffdef', 'libdef', 'recdef', ] genheaders = [luajit_h] 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) subprojects/luajit/src/lib_io.c0000644000175000017500000003310114741067622016076 0ustar aniolaniol/* ** I/O library. ** Copyright (C) 2005-2023 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_buf.h" #include "lj_str.h" #include "lj_state.h" #include "lj_strfmt.h" #include "lj_ff.h" #include "lj_lib.h" /* 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 IOFileUD *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; } 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); iof->fp = fopen(fname, mode); if (iof->fp == NULL) luaL_argerror(L, 1, lj_strfmt_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 && !LJ_TARGET_XBOXONE && !LJ_TARGET_UWP stat = _pclose(iof->fp); #endif #if LJ_52 iof->fp = NULL; return luaL_execresult(L, stat); #else ok = (stat != -1); #endif } else { lj_assertL((iof->type & IOFILE_TYPE_MASK) == IOFILE_TYPE_STDF, "close of unknown FILE* type"); 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_buf_tmp(L, 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_buf_tmp(L, 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_buf_tmp(L, 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; } 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, IOFileUD *iof, int start) { FILE *fp = iof->fp; 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] == '*') p++; if (p[0] == 'n') ok = io_file_readnum(L, fp); else if ((p[0] & ~0x20) == 'L') ok = io_file_readline(L, fp, (p[0] == 'l')); else if (p[0] == '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, IOFileUD *iof, int start) { FILE *fp = iof->fp; cTValue *tv; int status = 1; for (tv = L->base+start; tv < L->top; tv++) { MSize len; const char *p = lj_strfmt_wstrnum(L, tv, &len); if (!p) lj_err_argt(L, (int)(tv - L->base) + 1, LUA_TSTRING); status = status && (fwrite(p, 1, len, fp) == len); } 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. */ 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, 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; if (L->base < L->top) { iof = io_tofile(L); } else { iof = IOSTDF_IOF(L, GCROOT_IO_OUTPUT); if (iof->fp == NULL) lj_err_caller(L, LJ_ERR_IOCLFL); } return io_file_close(L, iof); } LJLIB_CF(io_method_read) { return io_file_read(L, io_tofile(L), 1); } LJLIB_CF(io_method_write) LJLIB_REC(io_write 0) { return io_file_write(L, io_tofile(L), 1); } LJLIB_CF(io_method_flush) LJLIB_REC(io_flush 0) { return luaL_fileresult(L, fflush(io_tofile(L)->fp) == 0, NULL); } #if LJ_32 && defined(__ANDROID__) && __ANDROID_API__ < 24 /* The Android NDK is such an unmatched marvel of engineering. */ extern int fseeko32(FILE *, long int, int) __asm__("fseeko"); extern long int ftello32(FILE *) __asm__("ftello"); #define fseeko(fp, pos, whence) (fseeko32((fp), (pos), (whence))) #define ftello(fp) (ftello32((fp))) #endif 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); iof->fp = fopen(fname, mode); return iof->fp != NULL ? 1 : luaL_fileresult(L, 0, fname); } LJLIB_CF(io_popen) { #if LJ_TARGET_POSIX || (LJ_TARGET_WINDOWS && !LJ_TARGET_XBOXONE && !LJ_TARGET_UWP) 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 iof->fp = _popen(fname, mode); #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_PS5 || LJ_TARGET_PSVITA || LJ_TARGET_NX 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)->fp) == 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; } subprojects/luajit/src/lj_frame.h0000644000175000017500000002162514741067622016435 0ustar aniolaniol/* ** Stack frames. ** Copyright (C) 2005-2023 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 LSB of PC (4-byte aligned) or delta (8-byte aligned: ** ** PC 00 Lua frame ** delta 001 C frame ** delta 010 Continuation frame ** delta 011 Lua vararg frame ** delta 101 cpcall() frame ** delta 110 ff pcall() frame ** delta 111 ff pcall() frame with active hook */ 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. */ #if LJ_FR2 /* Two-slot frame info, required for 64 bit PC/GCRef: ** ** base-2 base-1 | base base+1 ... ** [func PC/delta/ft] | [slots ...] ** ^-- frame | ^-- base ^-- top ** ** Continuation frames: ** ** base-4 base-3 base-2 base-1 | base base+1 ... ** [cont PC ] [func PC/delta/ft] | [slots ...] ** ^-- frame | ^-- base ^-- top */ #define frame_gc(f) (gcval((f)-1)) #define frame_ftsz(f) ((ptrdiff_t)(f)->ftsz) #define frame_pc(f) ((const BCIns *)frame_ftsz(f)) #define setframe_gc(f, p, tp) (setgcVraw((f), (p), (tp))) #define setframe_ftsz(f, sz) ((f)->ftsz = (sz)) #define setframe_pc(f, pc) ((f)->ftsz = (int64_t)(intptr_t)(pc)) #else /* One-slot frame info, sufficient for 32 bit PC/GCRef: ** ** base-1 | base base+1 ... ** lo hi | ** [func | PC/delta/ft] | [slots ...] ** ^-- frame | ^-- base ^-- top ** ** Continuation frames: ** ** base-2 base-1 | base base+1 ... ** lo hi lo hi | ** [cont | PC] [func | PC/delta/ft] | [slots ...] ** ^-- frame | ^-- base ^-- top */ #define frame_gc(f) (gcref((f)->fr.func)) #define frame_ftsz(f) ((ptrdiff_t)(f)->fr.tp.ftsz) #define frame_pc(f) (mref((f)->fr.tp.pcr, const BCIns)) #define setframe_gc(f, p, tp) (setgcref((f)->fr.func, (p)), UNUSED(tp)) #define setframe_ftsz(f, sz) ((f)->fr.tp.ftsz = (int32_t)(sz)) #define setframe_pc(f, pc) (setmref((f)->fr.tp.pcr, (pc))) #endif #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_func(f) (&frame_gc(f)->fn) #define frame_delta(f) (frame_ftsz(f) >> 3) #define frame_sized(f) (frame_ftsz(f) & ~FRAME_TYPEP) enum { LJ_CONT_TAILCALL, LJ_CONT_FFI_CALLBACK }; /* Special continuations. */ #if LJ_FR2 #define frame_contpc(f) (frame_pc((f)-2)) #define frame_contv(f) (((f)-3)->u64) #else #define frame_contpc(f) (frame_pc((f)-1)) #define frame_contv(f) (((f)-1)->u32.lo) #endif #if LJ_FR2 #define frame_contf(f) ((ASMFunction)(uintptr_t)((f)-3)->u64) #elif 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_iscont_fficb(f) \ (LJ_HASFFI && frame_contv(f) == LJ_CONT_FFI_CALLBACK) #define frame_prevl(f) ((f) - (1+LJ_FR2+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. */ /* -- 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 #if LJ_ABI_WIN #define CFRAME_OFS_ERRF (19*4) #define CFRAME_OFS_NRES (18*4) #define CFRAME_OFS_PREV (17*4) #define CFRAME_OFS_L (16*4) #define CFRAME_OFS_SEH (9*4) #define CFRAME_OFS_PC (6*4) #define CFRAME_OFS_MULTRES (5*4) #define CFRAME_SIZE (16*4) #define CFRAME_SHIFT_MULTRES 0 #else #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 #endif #elif LJ_TARGET_X64 #if LJ_ABI_WIN #define CFRAME_OFS_PREV (13*8) #if LJ_GC64 #define CFRAME_OFS_PC (12*8) #define CFRAME_OFS_L (11*8) #define CFRAME_OFS_ERRF (21*4) #define CFRAME_OFS_NRES (20*4) #define CFRAME_OFS_MULTRES (8*4) #else #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) #endif #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) #if LJ_GC64 #define CFRAME_OFS_PC (3*8) #define CFRAME_OFS_L (2*8) #define CFRAME_OFS_ERRF (3*4) #define CFRAME_OFS_NRES (2*4) #define CFRAME_OFS_MULTRES (0*4) #else #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) #endif #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_ARM64 #define CFRAME_OFS_ERRF 36 #define CFRAME_OFS_NRES 40 #define CFRAME_OFS_PREV 0 #define CFRAME_OFS_L 16 #define CFRAME_OFS_PC 8 #define CFRAME_OFS_MULTRES 32 #define CFRAME_SIZE 208 #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_PPC32ON64 #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 (LJ_ARCH_HASFPU ? 272 : 128) #define CFRAME_SHIFT_MULTRES 3 #endif #elif LJ_TARGET_MIPS32 #if LJ_ARCH_HASFPU #define CFRAME_OFS_ERRF 124 #define CFRAME_OFS_NRES 120 #define CFRAME_OFS_PREV 116 #define CFRAME_OFS_L 112 #define CFRAME_SIZE 112 #else #define CFRAME_OFS_ERRF 76 #define CFRAME_OFS_NRES 72 #define CFRAME_OFS_PREV 68 #define CFRAME_OFS_L 64 #define CFRAME_SIZE 64 #endif #define CFRAME_OFS_PC 20 #define CFRAME_OFS_MULTRES 16 #define CFRAME_SHIFT_MULTRES 3 #elif LJ_TARGET_MIPS64 #if LJ_ARCH_HASFPU #define CFRAME_OFS_ERRF 188 #define CFRAME_OFS_NRES 184 #define CFRAME_OFS_PREV 176 #define CFRAME_OFS_L 168 #define CFRAME_OFS_PC 160 #define CFRAME_SIZE 192 #else #define CFRAME_OFS_ERRF 124 #define CFRAME_OFS_NRES 120 #define CFRAME_OFS_PREV 112 #define CFRAME_OFS_L 104 #define CFRAME_OFS_PC 96 #define CFRAME_SIZE 128 #endif #define CFRAME_OFS_MULTRES 0 #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 subprojects/luajit/src/lj_snap.h0000644000175000017500000000165314741067622016303 0ustar aniolaniol/* ** Snapshot handling. ** Copyright (C) 2005-2023 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(jit_State *J, 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 subprojects/luajit/src/lj_traceerr.h0000644000175000017500000000406514741067622017151 0ustar aniolaniol/* ** Trace compiler error messages. ** Copyright (C) 2005-2023 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(TRACEUV, "trace too short") TREDEF(TRACEOV, "trace too long") TREDEF(STACKOV, "trace too deep") TREDEF(SNAPOV, "too many snapshots") TREDEF(BLACKL, "blacklisted") TREDEF(RETRY, "retry recording") TREDEF(NYIBC, "NYI: bytecode %s") /* 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(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 */ subprojects/luajit/src/lj_target_arm.h0000644000175000017500000001573014741067622017470 0ustar aniolaniol/* ** Definitions for ARM CPUs. ** Copyright (C) 2005-2023 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, ARMI_BFI = 0xe7c00010, /* 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_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 subprojects/luajit/src/luajit.c0000644000175000017500000003502614741067622016141 0ustar aniolaniol/* ** LuaJIT frontend. Runs commands, scripts, read-eval-print (REPL) etc. ** Copyright (C) 2005-2023 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; static char *empty_argv[2] = { NULL, NULL }; #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) { fputs("usage: ", stderr); fputs(progname, stderr); fputs(" [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", stderr); fflush(stderr); } static void l_message(const char *msg) { if (progname) { fputs(progname, stderr); fputc(':', stderr); fputc(' ', stderr); } fputs(msg, stderr); fputc('\n', stderr); 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(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 != LUA_OK) 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); lua_settop(L, 0); /* clear stack */ } static void createargtable(lua_State *L, char **argv, int argc, int argf) { int i; lua_createtable(L, argc - argf, argf); for (i = 0; i < argc; i++) { lua_pushstring(L, argv[i]); lua_rawseti(L, -2, i - argf); } lua_setglobal(L, "arg"); } 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 == LUA_OK) status = docall(L, 0, 0); report(L, status); if (status == LUA_OK && 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(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 **argx) { int status; const char *fname = argx[0]; if (strcmp(fname, "-") == 0 && strcmp(argx[-1], "--") != 0) fname = NULL; /* stdin */ status = luaL_loadfile(L, fname); if (status == LUA_OK) { /* Fetch args from arg table. LUA_INIT or -e might have changed them. */ int narg = 0; lua_getglobal(L, "arg"); if (lua_istable(L, -1)) { do { narg++; lua_rawgeti(L, -narg, narg); } while (!lua_isnil(L, -1)); lua_pop(L, 1); lua_remove(L, -narg); narg--; } else { lua_pop(L, 1); } status = docall(L, narg, 0); } 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("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); report(L, lua_pcall(L, narg, 0, 0)); return -1; } /* 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 i+1; 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; /* fallthrough */ 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 i+1; case 'E': *flags |= FLAGS_NOENV; break; default: return -1; /* invalid option */ } } return i; } static int runargs(lua_State *L, char **argv, int argn) { int i; for (i = 1; i < argn; i++) { if (argv[i] == NULL) continue; lua_assert(argv[i][0] == '-'); switch (argv[i][1]) { 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; 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 LUA_OK; } 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 LUA_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 argn; int flags = 0; globalL = L; LUAJIT_VERSION_SYM(); /* Linker-enforced version check. */ argn = collectargs(argv, &flags); if (argn < 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"); } /* Stop collector during library initialization. */ lua_gc(L, LUA_GCSTOP, 0); luaL_openlibs(L); lua_gc(L, LUA_GCRESTART, -1); createargtable(L, argv, s->argc, argn); if (!(flags & FLAGS_NOENV)) { s->status = handle_luainit(L); if (s->status != LUA_OK) return 0; } if ((flags & FLAGS_VERSION)) print_version(); s->status = runargs(L, argv, argn); if (s->status != LUA_OK) return 0; if (s->argc > argn) { s->status = handle_script(L, argv + argn); if (s->status != LUA_OK) return 0; } if ((flags & FLAGS_INTERACTIVE)) { print_jit_status(L); dotty(L); } else if (s->argc == argn && !(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; if (!argv[0]) argv = empty_argv; else if (argv[0][0]) progname = argv[0]; L = lua_open(); if (L == NULL) { l_message("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 > 0) ? EXIT_FAILURE : EXIT_SUCCESS; } subprojects/luajit/src/lj_opt_dce.c0000644000175000017500000000357314741067622016755 0ustar aniolaniol/* ** DCE: Dead Code Elimination. Pre-LOOP only -- ASM already performs DCE. ** Copyright (C) 2005-2023 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); } else if (!ir_sideeff(ir)) { *pchain[ir->o] = ir->prev; /* Reroute original instruction chain. */ lj_ir_nop(ir); continue; } pchain[ir->o] = &ir->prev; 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 subprojects/luajit/src/vm_mips64.dasc0000644000175000017500000044411114741067622017164 0ustar aniolaniol|// Low-level VM code for MIPS64 CPUs. |// Bytecode interpreter, fast functions and helper functions. |// Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h |// |// Contributed by Djordje Kovacevic and Stefan Pejic from RT-RK.com. |// Sponsored by Cisco Systems, Inc. | |.arch mips64 |.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 | |.macro .FPU, a, b |.if FPU | a, b |.endif |.endmacro | |// 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. | |.define JGL, r30 // On-trace: global_State + 32768. | |// Constants for type-comparisons, stores and conversions. C callee-save. |.define TISNIL, r30 |.define TISNUM, r22 |.if FPU |.define TOBIT, f30 // 2^52 + 2^51. |.endif | |// 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 | |// MIPS n64 calling convention. |.define CFUNCADDR, r25 |.define CARG1, r4 |.define CARG2, r5 |.define CARG3, r6 |.define CARG4, r7 |.define CARG5, r8 |.define CARG6, r9 |.define CARG7, r10 |.define CARG8, r11 | |.define CRET1, r2 |.define CRET2, r3 | |.if FPU |.define FARG1, f12 |.define FARG2, f13 |.define FARG3, f14 |.define FARG4, f15 |.define FARG5, f16 |.define FARG6, f17 |.define FARG7, f18 |.define FARG8, f19 | |.define FRET1, f0 |.define FRET2, f2 | |.define FTMP0, f20 |.define FTMP1, f21 |.define FTMP2, f22 |.endif | |// Stack layout while in interpreter. Must match with lj_frame.h. |.if FPU // MIPS64 hard-float. | |.define CFRAME_SPACE, 192 // Delta for sp. | |//----- 16 byte aligned, <-- sp entering interpreter |.define SAVE_ERRF, 188(sp) // 32 bit values. |.define SAVE_NRES, 184(sp) |.define SAVE_CFRAME, 176(sp) // 64 bit values. |.define SAVE_L, 168(sp) |.define SAVE_PC, 160(sp) |//----- 16 byte aligned |.define SAVE_GPR_, 80 // .. 80+10*8: 64 bit GPR saves. |.define SAVE_FPR_, 16 // .. 16+8*8: 64 bit FPR saves. | |.else // MIPS64 soft-float | |.define CFRAME_SPACE, 128 // Delta for sp. | |//----- 16 byte aligned, <-- sp entering interpreter |.define SAVE_ERRF, 124(sp) // 32 bit values. |.define SAVE_NRES, 120(sp) |.define SAVE_CFRAME, 112(sp) // 64 bit values. |.define SAVE_L, 104(sp) |.define SAVE_PC, 96(sp) |//----- 16 byte aligned |.define SAVE_GPR_, 16 // .. 16+10*8: 64 bit GPR saves. | |.endif | |.define TMPX, 8(sp) // Unused by interpreter, temp for JIT code. |.define TMPD, 0(sp) |//----- 16 byte aligned | |.define TMPD_OFS, 0 | |.define SAVE_MULTRES, TMPD | |//----------------------------------------------------------------------- | |.macro saveregs | daddiu sp, sp, -CFRAME_SPACE | sd ra, SAVE_GPR_+9*8(sp) | sd r30, SAVE_GPR_+8*8(sp) | .FPU sdc1 f31, SAVE_FPR_+7*8(sp) | sd r23, SAVE_GPR_+7*8(sp) | .FPU sdc1 f30, SAVE_FPR_+6*8(sp) | sd r22, SAVE_GPR_+6*8(sp) | .FPU sdc1 f29, SAVE_FPR_+5*8(sp) | sd r21, SAVE_GPR_+5*8(sp) | .FPU sdc1 f28, SAVE_FPR_+4*8(sp) | sd r20, SAVE_GPR_+4*8(sp) | .FPU sdc1 f27, SAVE_FPR_+3*8(sp) | sd r19, SAVE_GPR_+3*8(sp) | .FPU sdc1 f26, SAVE_FPR_+2*8(sp) | sd r18, SAVE_GPR_+2*8(sp) | .FPU sdc1 f25, SAVE_FPR_+1*8(sp) | sd r17, SAVE_GPR_+1*8(sp) | .FPU sdc1 f24, SAVE_FPR_+0*8(sp) | sd r16, SAVE_GPR_+0*8(sp) |.endmacro | |.macro restoreregs_ret | ld ra, SAVE_GPR_+9*8(sp) | ld r30, SAVE_GPR_+8*8(sp) | ld r23, SAVE_GPR_+7*8(sp) | .FPU ldc1 f31, SAVE_FPR_+7*8(sp) | ld r22, SAVE_GPR_+6*8(sp) | .FPU ldc1 f30, SAVE_FPR_+6*8(sp) | ld r21, SAVE_GPR_+5*8(sp) | .FPU ldc1 f29, SAVE_FPR_+5*8(sp) | ld r20, SAVE_GPR_+4*8(sp) | .FPU ldc1 f28, SAVE_FPR_+4*8(sp) | ld r19, SAVE_GPR_+3*8(sp) | .FPU ldc1 f27, SAVE_FPR_+3*8(sp) | ld r18, SAVE_GPR_+2*8(sp) | .FPU ldc1 f26, SAVE_FPR_+2*8(sp) | ld r17, SAVE_GPR_+1*8(sp) | .FPU ldc1 f25, SAVE_FPR_+1*8(sp) | ld r16, SAVE_GPR_+0*8(sp) | .FPU ldc1 f24, SAVE_FPR_+0*8(sp) | jr ra | daddiu 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 |.type SBUF, SBuf | |//----------------------------------------------------------------------- | |// Trap for not-yet-implemented parts. |.macro NYI; .long 0xec1cf0f0; .endmacro | |// Macros to mark delay slots. |.macro ., a; a; .endmacro |.macro ., a,b; a,b; .endmacro |.macro ., a,b,c; a,b,c; .endmacro |.macro ., a,b,c,d; a,b,c,d; .endmacro | |.define FRAME_PC, -8 |.define FRAME_FUNC, -16 | |//----------------------------------------------------------------------- | |// Endian-specific defines. |.if ENDIAN_LE |.define HI, 4 |.define LO, 0 |.define OFS_RD, 2 |.define OFS_RA, 1 |.define OFS_OP, 0 |.else |.define HI, 0 |.define LO, 4 |.define OFS_RD, 0 |.define OFS_RA, 2 |.define OFS_OP, 3 |.endif | |// Instruction decode. |.macro decode_OP1, dst, ins; andi dst, ins, 0xff; .endmacro |.macro decode_OP8a, dst, ins; andi dst, ins, 0xff; .endmacro |.macro decode_OP8b, dst; sll dst, dst, 3; .endmacro |.macro decode_RC8a, dst, ins; srl dst, ins, 13; .endmacro |.macro decode_RC8b, dst; andi dst, dst, 0x7f8; .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) | daddiu PC, PC, 4 |.endmacro |// Instruction decode+dispatch. |.macro ins_NEXT2 | decode_OP8a TMP1, INS | decode_OP8b TMP1 | daddu TMP0, DISPATCH, TMP1 | decode_RD8a RD, INS | ld 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 | ld PC, LFUNC:RB->pc | lw INS, 0(PC) | daddiu PC, PC, 4 | decode_OP8a TMP1, INS | decode_RA8a RA, INS | decode_OP8b TMP1 | decode_RA8b RA | daddu TMP0, DISPATCH, TMP1 | ld TMP0, 0(TMP0) | jr TMP0 | daddu RA, RA, BASE |.endmacro | |.macro ins_call | // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, PC = caller PC | sd 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 | daddu 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 + sizeof(void*)*LJ_GOT_##name) | #define PC2PROTO(field) ((int)offsetof(GCproto, field)-(int)sizeof(GCproto)) | |.macro load_got, func | ld 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 | dsrl TMP1, PC, 1 | andi TMP1, TMP1, 126 | daddu 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 | ld tmp, DISPATCH_GL(gc.grayagain)(DISPATCH) | andi mark, mark, ~LJ_GC_BLACK & 255 // black2gray(tab) | sd tab, DISPATCH_GL(gc.grayagain)(DISPATCH) | sb mark, tab->marked | b target |. sd tmp, tab->gclist |.endmacro | |// Clear type tag. Isolate lowest 14+32+1=47 bits of reg. |.macro cleartp, reg; dextm reg, reg, 0, 14; .endmacro |.macro cleartp, dst, reg; dextm dst, reg, 0, 14; .endmacro | |// Set type tag: Merge 17 type bits into bits [15+32=47, 31+32+1=64) of dst. |.macro settp, dst, tp; dinsu dst, tp, 15, 31; .endmacro | |// Extract (negative) type tag. |.macro gettp, dst, src; dsra dst, src, 47; .endmacro | |// Macros to check the TValue type and extract the GCobj. Branch on failure. |.macro checktp, reg, tp, target | gettp AT, reg | daddiu AT, AT, tp | bnez AT, target |. cleartp reg |.endmacro |.macro checktp, dst, reg, tp, target | gettp AT, reg | daddiu AT, AT, tp | bnez AT, target |. cleartp dst, reg |.endmacro |.macro checkstr, reg, target; checktp reg, -LJ_TSTR, target; .endmacro |.macro checktab, reg, target; checktp reg, -LJ_TTAB, target; .endmacro |.macro checkfunc, reg, target; checktp reg, -LJ_TFUNC, target; .endmacro |.macro checkint, reg, target // Caveat: has delay slot! | gettp AT, reg | bne AT, TISNUM, target |.endmacro |.macro checknum, reg, target // Caveat: has delay slot! | gettp AT, reg | sltiu AT, AT, LJ_TISNUM | beqz AT, target |.endmacro | |.macro mov_false, reg | lu reg, 0x8000 | dsll reg, reg, 32 | not reg, reg |.endmacro |.macro mov_true, reg | li reg, 0x0001 | dsll reg, reg, 48 | not reg, 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: | // See vm_return. Also: TMP2 = previous base. | andi AT, PC, FRAME_P | beqz AT, ->cont_dispatch | | // Return from pcall or xpcall fast func. |. mov_true TMP1 | ld 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. | sd TMP1, -8(RA) // Prepend true to results. | daddiu 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 | dsubu TMP2, BASE, TMP2 // TMP2 = previous base. | | addiu TMP1, RD, -8 | sd TMP2, L->base | li_vmstate C | lw TMP2, SAVE_NRES | daddiu BASE, BASE, -16 | st_vmstate | beqz TMP1, >2 |. sll TMP2, TMP2, 3 |1: | addiu TMP1, TMP1, -8 | ld CRET1, 0(RA) | daddiu RA, RA, 8 | sd CRET1, 0(BASE) | bnez TMP1, <1 |. daddiu BASE, BASE, 8 | |2: | bne TMP2, RD, >6 |3: |. sd BASE, L->top // Store new top. | |->vm_leave_cp: | ld TMP0, SAVE_CFRAME // Restore previous C frame. | move CRET1, r0 // Ok return status for vm_pcall. | sd TMP0, L->cframe | |->vm_leave_unw: | restoreregs_ret | |6: | ld 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 | sd TISNIL, 0(BASE) | addiu RD, RD, 8 | b <2 |. daddiu BASE, BASE, 8 | |7: // Less results wanted. | subu TMP0, RD, TMP2 | dsubu TMP0, BASE, TMP0 // Either keep top or shrink it. |.if MIPSR6 | selnez TMP0, TMP0, TMP2 // LUA_MULTRET+1 case? | seleqz BASE, BASE, TMP2 | b <3 |. or BASE, BASE, TMP0 |.else | b <3 |. movn BASE, TMP0, TMP2 // LUA_MULTRET+1 case? |.endif | |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 | ld 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. | ld L, SAVE_L | li TMP0, ~LJ_VMST_C | ld 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. | ld L, SAVE_L | .FPU lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). | li TISNIL, LJ_TNIL | li TISNUM, LJ_TISNUM | ld BASE, L->base | ld DISPATCH, L->glref // Setup pointer to dispatch table. | .FPU mtc1 TMP3, TOBIT | mov_false TMP1 | li_vmstate INTERP | ld PC, FRAME_PC(BASE) // Fetch PC of previous frame. | .FPU cvt.d.s TOBIT, TOBIT | daddiu RA, BASE, -8 // Results start at BASE-8. | daddiu DISPATCH, DISPATCH, GG_G2DISP | sd TMP1, 0(RA) // Prepend false to error message. | st_vmstate | b ->vm_returnc |. li RD, 16 // 2 results: false + error message. | |->vm_unwind_stub: // Jump to exit stub from unwinder. | jr CARG1 |. move ra, CARG2 | |//----------------------------------------------------------------------- |//-- 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 | daddu RC, BASE, RC | dsubu RA, RA, BASE | sd BASE, L->base | daddiu PC, PC, 4 // Must point after first instruction. | sd RC, L->top | srl CARG2, RA, 3 |2: | // L->base = new base, L->top = top | load_got lj_state_growstack | sd PC, SAVE_PC | call_intern lj_state_growstack // (lua_State *L, int n) |. move CARG1, L | ld BASE, L->base | ld RC, L->top | ld LFUNC:RB, FRAME_FUNC(BASE) | dsubu RC, RC, BASE | cleartp LFUNC:RB | // 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 | ld DISPATCH, L->glref // Setup pointer to dispatch table. | move BASE, CARG2 | lbu TMP1, L->status | sd L, SAVE_L | li PC, FRAME_CP | daddiu TMP0, sp, CFRAME_RESUME | daddiu DISPATCH, DISPATCH, GG_G2DISP | sw r0, SAVE_NRES | sw r0, SAVE_ERRF | sd CARG1, SAVE_PC // Any value outside of bytecode is ok. | sd r0, SAVE_CFRAME | beqz TMP1, >3 |. sd TMP0, L->cframe | | // Resume after yield (like a return). | sd L, DISPATCH_GL(cur_L)(DISPATCH) | move RA, BASE | ld BASE, L->base | ld TMP1, L->top | ld PC, FRAME_PC(BASE) | .FPU lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). | dsubu RD, TMP1, BASE | .FPU mtc1 TMP3, TOBIT | sb r0, L->status | .FPU cvt.d.s TOBIT, TOBIT | li_vmstate INTERP | daddiu RD, RD, 8 | st_vmstate | move MULTRES, RD | andi TMP0, PC, FRAME_TYPE | li TISNIL, LJ_TNIL | beqz TMP0, ->BC_RET_Z |. li TISNUM, LJ_TISNUM | 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). | ld TMP1, L:CARG1->cframe | move L, CARG1 | sw CARG3, SAVE_NRES | ld DISPATCH, L->glref // Setup pointer to dispatch table. | sd CARG1, SAVE_L | move BASE, CARG2 | daddiu DISPATCH, DISPATCH, GG_G2DISP | sd CARG1, SAVE_PC // Any value outside of bytecode is ok. | sd TMP1, SAVE_CFRAME | sd sp, L->cframe // Add our C frame to cframe chain. | |3: // Entry point for vm_cpcall/vm_resume (BASE = base, PC = ftype). | sd L, DISPATCH_GL(cur_L)(DISPATCH) | ld TMP2, L->base // TMP2 = old base (used in vmeta_call). | .FPU lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). | ld TMP1, L->top | .FPU mtc1 TMP3, TOBIT | daddu PC, PC, BASE | dsubu NARGS8:RC, TMP1, BASE | li TISNUM, LJ_TISNUM | dsubu PC, PC, TMP2 // PC = frame delta + frame type | .FPU 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 | ld LFUNC:RB, FRAME_FUNC(BASE) | checkfunc LFUNC:RB, ->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 | move L, CARG1 | ld TMP0, L:CARG1->stack | sd CARG1, SAVE_L | ld TMP1, L->top | ld DISPATCH, L->glref // Setup pointer to dispatch table. | sd CARG1, SAVE_PC // Any value outside of bytecode is ok. | dsubu TMP0, TMP0, TMP1 // Compute -savestack(L, L->top). | ld TMP1, L->cframe | daddiu DISPATCH, DISPATCH, GG_G2DISP | sw TMP0, SAVE_NRES // Neg. delta means cframe w/o frame. | sw r0, SAVE_ERRF // No error function. | sd TMP1, SAVE_CFRAME | sd sp, L->cframe // Add our C frame to cframe chain. | sd L, DISPATCH_GL(cur_L)(DISPATCH) | jalr CARG4 // (lua_State *L, lua_CFunction func, void *ud) |. move CFUNCADDR, CARG4 | move BASE, CRET1 | bnez CRET1, <3 // Else continue with the call. |. li PC, FRAME_CP | 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 | ld TMP0, -32(BASE) // Continuation. | move RB, BASE | move BASE, TMP2 // Restore caller BASE. | ld LFUNC:TMP1, FRAME_FUNC(TMP2) |.if FFI | sltiu AT, TMP0, 2 |.endif | ld PC, -24(RB) // Restore PC from [cont|PC]. | cleartp LFUNC:TMP1 | daddu TMP2, RA, RD |.if FFI | bnez AT, >1 |.endif |. sd TISNIL, -8(TMP2) // Ensure one valid arg. | ld TMP1, LFUNC:TMP1->pc | // BASE = base, RA = resultptr, RB = meta base | jr TMP0 // Jump to continuation. |. ld KBASE, PC2PROTO(k)(TMP1) | |.if FFI |1: | bnez TMP0, ->cont_ffi_callback // cont = 1: return from FFI callback. | // cont = 0: tailcall from C function. |. daddiu TMP1, RB, -32 | b ->vm_call_tail |. dsubu RC, TMP1, BASE |.endif | |->cont_cat: // RA = resultptr, RB = meta base | lw INS, -4(PC) | daddiu CARG2, RB, -32 | ld CRET1, 0(RA) | decode_RB8a MULTRES, INS | decode_RA8a RA, INS | decode_RB8b MULTRES | decode_RA8b RA | daddu TMP1, BASE, MULTRES | sd BASE, L->base | dsubu CARG3, CARG2, TMP1 | bne TMP1, CARG2, ->BC_CAT_Z |. sd CRET1, 0(CARG2) | daddu RA, BASE, RA | b ->cont_nop |. sd CRET1, 0(RA) | |//-- Table indexing metamethods ----------------------------------------- | |->vmeta_tgets1: | daddiu CARG3, DISPATCH, DISPATCH_GL(tmptv) | li TMP0, LJ_TSTR | settp STR:RC, TMP0 | b >1 |. sd STR:RC, 0(CARG3) | |->vmeta_tgets: | daddiu CARG2, DISPATCH, DISPATCH_GL(tmptv) | li TMP0, LJ_TTAB | li TMP1, LJ_TSTR | settp TAB:RB, TMP0 | daddiu CARG3, DISPATCH, DISPATCH_GL(tmptv2) | sd TAB:RB, 0(CARG2) | settp STR:RC, TMP1 | b >1 |. sd STR:RC, 0(CARG3) | |->vmeta_tgetb: // TMP0 = index | daddiu CARG3, DISPATCH, DISPATCH_GL(tmptv) | settp TMP0, TISNUM | sd TMP0, 0(CARG3) | |->vmeta_tgetv: |1: | load_got lj_meta_tget | sd BASE, L->base | sd 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 |. daddiu TMP1, BASE, -FRAME_CONT | ld CARG1, 0(CRET1) | ins_next1 | sd CARG1, 0(RA) | ins_next2 | |3: // Call __index metamethod. | // BASE = base, L->top = new base, stack = cont/func/t/k | ld BASE, L->top | sd PC, -24(BASE) // [cont|PC] | dsubu PC, BASE, TMP1 | ld LFUNC:RB, FRAME_FUNC(BASE) // Guaranteed to be a function here. | cleartp LFUNC:RB | b ->vm_call_dispatch_f |. li NARGS8:RC, 16 // 2 args for func(t, k). | |->vmeta_tgetr: | load_got lj_tab_getinth | call_intern lj_tab_getinth // (GCtab *t, int32_t key) |. nop | // Returns cTValue * or NULL. | beqz CRET1, ->BC_TGETR_Z |. move CARG2, TISNIL | b ->BC_TGETR_Z |. ld CARG2, 0(CRET1) | |//----------------------------------------------------------------------- | |->vmeta_tsets1: | daddiu CARG3, DISPATCH, DISPATCH_GL(tmptv) | li TMP0, LJ_TSTR | settp STR:RC, TMP0 | b >1 |. sd STR:RC, 0(CARG3) | |->vmeta_tsets: | daddiu CARG2, DISPATCH, DISPATCH_GL(tmptv) | li TMP0, LJ_TTAB | li TMP1, LJ_TSTR | settp TAB:RB, TMP0 | daddiu CARG3, DISPATCH, DISPATCH_GL(tmptv2) | sd TAB:RB, 0(CARG2) | settp STR:RC, TMP1 | b >1 |. sd STR:RC, 0(CARG3) | |->vmeta_tsetb: // TMP0 = index | daddiu CARG3, DISPATCH, DISPATCH_GL(tmptv) | settp TMP0, TISNUM | sd TMP0, 0(CARG3) | |->vmeta_tsetv: |1: | load_got lj_meta_tset | sd BASE, L->base | sd 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 |. ld CARG1, 0(RA) | // NOBARRIER: lj_meta_tset ensures the table is not black. | ins_next1 | sd CARG1, 0(CRET1) | ins_next2 | |3: // Call __newindex metamethod. | // BASE = base, L->top = new base, stack = cont/func/t/k/(v) | daddiu TMP1, BASE, -FRAME_CONT | ld BASE, L->top | sd PC, -24(BASE) // [cont|PC] | dsubu PC, BASE, TMP1 | ld LFUNC:RB, FRAME_FUNC(BASE) // Guaranteed to be a function here. | cleartp LFUNC:RB | sd CARG1, 16(BASE) // Copy value to third argument. | b ->vm_call_dispatch_f |. li NARGS8:RC, 24 // 3 args for func(t, k, v) | |->vmeta_tsetr: | load_got lj_tab_setinth | sd BASE, L->base | sd PC, SAVE_PC | call_intern lj_tab_setinth // (lua_State *L, GCtab *t, int32_t key) |. move CARG1, L | // Returns TValue *. | b ->BC_TSETR_Z |. nop | |//-- Comparison metamethods --------------------------------------------- | |->vmeta_comp: | // RA/RD point to o1/o2. | move CARG2, RA | move CARG3, RD | load_got lj_meta_comp | daddiu PC, PC, -4 | sd BASE, L->base | sd 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) | daddiu PC, PC, 4 | lui TMP1, (-(BCBIAS_J*4 >> 16) & 65535) | sll RD, RD, 2 | addu RD, RD, TMP1 | and RD, RD, TMP2 | daddu PC, PC, RD |->cont_nop: | ins_next | |->cont_ra: // RA = resultptr | lbu TMP1, -4+OFS_RA(PC) | ld CRET1, 0(RA) | sll TMP1, TMP1, 3 | daddu TMP1, BASE, TMP1 | b ->cont_nop |. sd CRET1, 0(TMP1) | |->cont_condt: // RA = resultptr | ld TMP0, 0(RA) | gettp TMP0, TMP0 | sltiu AT, TMP0, LJ_TISTRUECOND | b <4 |. negu TMP2, AT // Branch if result is true. | |->cont_condf: // RA = resultptr | ld TMP0, 0(RA) | gettp TMP0, TMP0 | sltiu AT, TMP0, LJ_TISTRUECOND | b <4 |. addiu TMP2, AT, -1 // Branch if result is false. | |->vmeta_equal: | // CARG1/CARG2 point to o1/o2. TMP0 is set to 0/1. | load_got lj_meta_equal | cleartp LFUNC:CARG3, CARG2 | cleartp LFUNC:CARG2, CARG1 | move CARG4, TMP0 | daddiu PC, PC, -4 | sd BASE, L->base | sd 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 | daddiu PC, PC, -4 | sd BASE, L->base | sd 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 | |->vmeta_istype: | load_got lj_meta_istype | daddiu PC, PC, -4 | sd BASE, L->base | srl CARG2, RA, 3 | srl CARG3, RD, 3 | sd PC, SAVE_PC | call_intern lj_meta_istype // (lua_State *L, BCReg ra, BCReg tp) |. move CARG1, L | b ->cont_nop |. nop | |//-- Arithmetic metamethods --------------------------------------------- | |->vmeta_unm: | move RC, RB | |->vmeta_arith: | load_got lj_meta_arith | sd BASE, L->base | move CARG2, RA | sd PC, SAVE_PC | move CARG3, RB | move CARG4, RC | decode_OP1 CARG5, INS // CARG5 == RB. | 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 | dsubu TMP1, CRET1, BASE | sd PC, -24(CRET1) // [cont|PC] | move TMP2, BASE | daddiu 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 | sd BASE, L->base | sd 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 | sd TMP2, L->base // This is the callers base! | daddiu CARG2, BASE, -16 | sd PC, SAVE_PC | daddu CARG3, BASE, RC | move MULTRES, NARGS8:RC | call_intern lj_meta_call // (lua_State *L, TValue *func, TValue *top) |. move CARG1, L | ld LFUNC:RB, FRAME_FUNC(BASE) // Guaranteed to be a function here. | daddiu NARGS8:RC, MULTRES, 8 // Got one more argument now. | cleartp LFUNC:RB | ins_call | |->vmeta_callt: // Resolve __call for BC_CALLT. | // BASE = old base, RA = new base, RC = nargs*8 | load_got lj_meta_call | sd BASE, L->base | daddiu CARG2, RA, -16 | sd PC, SAVE_PC | daddu CARG3, RA, RC | move MULTRES, NARGS8:RC | call_intern lj_meta_call // (lua_State *L, TValue *func, TValue *top) |. move CARG1, L | ld RB, FRAME_FUNC(RA) // Guaranteed to be a function here. | ld TMP1, FRAME_PC(BASE) | daddiu NARGS8:RC, MULTRES, 8 // Got one more argument now. | b ->BC_CALLT_Z |. cleartp LFUNC:CARG3, RB | |//-- Argument coercion for 'for' statement ------------------------------ | |->vmeta_for: | load_got lj_meta_for | sd BASE, L->base | move CARG2, RA | sd 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 |. ld CARG1, 0(BASE) |.endmacro | |.macro .ffunc_2, name |->ff_ .. name: | sltiu AT, NARGS8:RC, 16 | ld CARG1, 0(BASE) | bnez AT, ->fff_fallback |. ld CARG2, 8(BASE) |.endmacro | |.macro .ffunc_n, name // Caveat: has delay slot! |->ff_ .. name: | ld CARG1, 0(BASE) | beqz NARGS8:RC, ->fff_fallback | // Either ldc1 or the 1st instruction of checknum is in the delay slot. | .FPU ldc1 FARG1, 0(BASE) | checknum CARG1, ->fff_fallback |.endmacro | |.macro .ffunc_nn, name // Caveat: has delay slot! |->ff_ .. name: | ld CARG1, 0(BASE) | sltiu AT, NARGS8:RC, 16 | ld CARG2, 8(BASE) | bnez AT, ->fff_fallback |. gettp TMP0, CARG1 | gettp TMP1, CARG2 | sltiu TMP0, TMP0, LJ_TISNUM | sltiu TMP1, TMP1, LJ_TISNUM | .FPU ldc1 FARG1, 0(BASE) | and TMP0, TMP0, TMP1 | .FPU ldc1 FARG2, 8(BASE) | beqz TMP0, ->fff_fallback |.endmacro | |// Inlined GC threshold check. Caveat: uses TMP0 and TMP1 and has delay slot! |// MIPSR6: no delay slot, but a forbidden slot. |.macro ffgccheck | ld TMP0, DISPATCH_GL(gc.total)(DISPATCH) | ld TMP1, DISPATCH_GL(gc.threshold)(DISPATCH) | dsubu AT, TMP0, TMP1 |.if MIPSR6 | bgezalc AT, ->fff_gcstep |.else | bgezal AT, ->fff_gcstep |.endif |.endmacro | |//-- Base library: checks ----------------------------------------------- |.ffunc_1 assert | gettp AT, CARG1 | sltiu AT, AT, LJ_TISTRUECOND | beqz AT, ->fff_fallback |. daddiu RA, BASE, -16 | ld PC, FRAME_PC(BASE) | addiu RD, NARGS8:RC, 8 // Compute (nresults+1)*8. | daddu TMP2, RA, RD | daddiu TMP1, BASE, 8 | beq BASE, TMP2, ->fff_res // Done if exactly 1 argument. |. sd CARG1, 0(RA) |1: | ld CRET1, 0(TMP1) | sd CRET1, -16(TMP1) | bne TMP1, TMP2, <1 |. daddiu TMP1, TMP1, 8 | b ->fff_res |. nop | |.ffunc_1 type | gettp TMP0, CARG1 | sltu TMP1, TISNUM, TMP0 | not TMP2, TMP0 | li TMP3, ~LJ_TISNUM |.if MIPSR6 | selnez TMP2, TMP2, TMP1 | seleqz TMP3, TMP3, TMP1 | or TMP2, TMP2, TMP3 |.else | movz TMP2, TMP3, TMP1 |.endif | dsll TMP2, TMP2, 3 | daddu TMP2, CFUNC:RB, TMP2 | b ->fff_restv |. ld CARG1, CFUNC:TMP2->upvalue | |//-- Base library: getters and setters --------------------------------- | |.ffunc_1 getmetatable | gettp TMP2, CARG1 | daddiu TMP0, TMP2, -LJ_TTAB | daddiu TMP1, TMP2, -LJ_TUDATA |.if MIPSR6 | selnez TMP0, TMP1, TMP0 |.else | movn TMP0, TMP1, TMP0 |.endif | bnez TMP0, >6 |. cleartp TAB:CARG1 |1: // Field metatable must be at same offset for GCtab and GCudata! | ld TAB:RB, TAB:CARG1->metatable |2: | ld STR:RC, DISPATCH_GL(gcroot[GCROOT_MMNAME+MM_metatable])(DISPATCH) | beqz TAB:RB, ->fff_restv |. li CARG1, LJ_TNIL | lw TMP0, TAB:RB->hmask | lw TMP1, STR:RC->sid | ld NODE:TMP2, TAB:RB->node | and TMP1, TMP1, TMP0 // idx = str->sid & tab->hmask | dsll TMP0, TMP1, 5 | dsll TMP1, TMP1, 3 | dsubu TMP1, TMP0, TMP1 | daddu NODE:TMP2, NODE:TMP2, TMP1 // node = tab->node + (idx*32-idx*8) | li CARG4, LJ_TSTR | settp STR:RC, CARG4 // Tagged key to look for. |3: // Rearranged logic, because we expect _not_ to find the key. | ld TMP0, NODE:TMP2->key | ld CARG1, NODE:TMP2->val | ld NODE:TMP2, NODE:TMP2->next | beq RC, TMP0, >5 |. li AT, LJ_TTAB | bnez NODE:TMP2, <3 |. nop |4: | move CARG1, RB | b ->fff_restv // Not found, keep default result. |. settp CARG1, AT |5: | bne CARG1, TISNIL, ->fff_restv |. nop | b <4 // Ditto for nil value. |. nop | |6: | sltiu AT, TMP2, LJ_TISNUM |.if MIPSR6 | selnez TMP0, TISNUM, AT | seleqz AT, TMP2, AT | or TMP2, TMP0, AT |.else | movn TMP2, TISNUM, AT |.endif | dsll TMP2, TMP2, 3 | dsubu TMP0, DISPATCH, TMP2 | b <2 |. ld TAB:RB, DISPATCH_GL(gcroot[GCROOT_BASEMT])-8(TMP0) | |.ffunc_2 setmetatable | // Fast path: no mt for table yet and not clearing the mt. | checktp TMP1, CARG1, -LJ_TTAB, ->fff_fallback | gettp TMP3, CARG2 | ld TAB:TMP0, TAB:TMP1->metatable | lbu TMP2, TAB:TMP1->marked | daddiu AT, TMP3, -LJ_TTAB | cleartp TAB:CARG2 | or AT, AT, TAB:TMP0 | bnez AT, ->fff_fallback |. andi AT, TMP2, LJ_GC_BLACK // isblack(table) | beqz AT, ->fff_restv |. sd TAB:CARG2, TAB:TMP1->metatable | barrierback TAB:TMP1, TMP2, TMP0, ->fff_restv | |.ffunc rawget | ld CARG2, 0(BASE) | sltiu AT, NARGS8:RC, 16 | load_got lj_tab_get | gettp TMP0, CARG2 | cleartp CARG2 | daddiu TMP0, TMP0, -LJ_TTAB | or AT, AT, TMP0 | bnez AT, ->fff_fallback |. daddiu CARG3, BASE, 8 | call_intern lj_tab_get // (lua_State *L, GCtab *t, cTValue *key) |. move CARG1, L | b ->fff_restv |. ld CARG1, 0(CRET1) | |//-- Base library: conversions ------------------------------------------ | |.ffunc tonumber | // Only handles the number case inline (without a base argument). | ld CARG1, 0(BASE) | xori AT, NARGS8:RC, 8 // Exactly one number argument. | gettp TMP1, CARG1 | sltu TMP0, TISNUM, TMP1 | or AT, AT, TMP0 | bnez AT, ->fff_fallback |. nop | b ->fff_restv |. nop | |.ffunc_1 tostring | // Only handles the string or number case inline. | gettp TMP0, CARG1 | daddiu AT, TMP0, -LJ_TSTR | // A __tostring method in the string base metatable is ignored. | beqz AT, ->fff_restv // String key? | // Handle numbers inline, unless a number base metatable is present. |. ld TMP1, DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM])(DISPATCH) | sltu TMP0, TISNUM, TMP0 | or TMP0, TMP0, TMP1 | bnez TMP0, ->fff_fallback |. sd BASE, L->base // Add frame since C call can throw. |.if MIPSR6 | sd PC, SAVE_PC // Redundant (but a defined value). | ffgccheck |.else | ffgccheck |. sd PC, SAVE_PC // Redundant (but a defined value). |.endif | load_got lj_strfmt_number | move CARG1, L | call_intern lj_strfmt_number // (lua_State *L, cTValue *o) |. move CARG2, BASE | // Returns GCstr *. | li AT, LJ_TSTR | settp CRET1, AT | b ->fff_restv |. move CARG1, CRET1 | |//-- Base library: iterators ------------------------------------------- | |.ffunc_1 next | checktp CARG1, -LJ_TTAB, ->fff_fallback | daddu TMP2, BASE, NARGS8:RC | sd TISNIL, 0(TMP2) // Set missing 2nd arg to nil. | load_got lj_tab_next | ld PC, FRAME_PC(BASE) | daddiu CARG2, BASE, 8 | call_intern lj_tab_next // (GCtab *t, cTValue *key, TValue *o) |. daddiu CARG3, BASE, -16 | // Returns 1=found, 0=end, -1=error. | daddiu RA, BASE, -16 | bgtz CRET1, ->fff_res // Found key/value. |. li RD, (2+1)*8 | beqz CRET1, ->fff_restv // End of traversal: return nil. |. move CARG1, TISNIL | ld CFUNC:RB, FRAME_FUNC(BASE) | cleartp CFUNC:RB | b ->fff_fallback // Invalid key. |. li RC, 2*8 | |.ffunc_1 pairs | checktp TAB:TMP1, CARG1, -LJ_TTAB, ->fff_fallback | ld PC, FRAME_PC(BASE) #if LJ_52 | ld TAB:TMP2, TAB:TMP1->metatable | ld TMP0, CFUNC:RB->upvalue[0] | bnez TAB:TMP2, ->fff_fallback #else | ld TMP0, CFUNC:RB->upvalue[0] #endif |. daddiu RA, BASE, -16 | sd TISNIL, 0(BASE) | sd CARG1, -8(BASE) | sd TMP0, 0(RA) | b ->fff_res |. li RD, (3+1)*8 | |.ffunc_2 ipairs_aux | checktab CARG1, ->fff_fallback | checkint CARG2, ->fff_fallback |. lw TMP0, TAB:CARG1->asize | ld TMP1, TAB:CARG1->array | ld PC, FRAME_PC(BASE) | sextw TMP2, CARG2 | addiu TMP2, TMP2, 1 | sltu AT, TMP2, TMP0 | daddiu RA, BASE, -16 | zextw TMP0, TMP2 | settp TMP0, TISNUM | beqz AT, >2 // Not in array part? |. sd TMP0, 0(RA) | dsll TMP3, TMP2, 3 | daddu TMP3, TMP1, TMP3 | ld TMP1, 0(TMP3) |1: | beq TMP1, TISNIL, ->fff_res // End of iteration, return 0 results. |. li RD, (0+1)*8 | sd TMP1, -8(BASE) | b ->fff_res |. li RD, (2+1)*8 |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 | b <1 |. ld TMP1, 0(CRET1) | |.ffunc_1 ipairs | checktp TAB:TMP1, CARG1, -LJ_TTAB, ->fff_fallback | ld PC, FRAME_PC(BASE) #if LJ_52 | ld TAB:TMP2, TAB:TMP1->metatable | ld CFUNC:TMP0, CFUNC:RB->upvalue[0] | bnez TAB:TMP2, ->fff_fallback #else | ld TMP0, CFUNC:RB->upvalue[0] #endif | daddiu RA, BASE, -16 | dsll AT, TISNUM, 47 | sd CARG1, -8(BASE) | sd AT, 0(BASE) | sd CFUNC:TMP0, 0(RA) | b ->fff_res |. li RD, (3+1)*8 | |//-- Base library: catch errors ---------------------------------------- | |.ffunc pcall | ld TMP1, L->maxstack | daddu TMP2, BASE, NARGS8:RC | sltu AT, TMP1, TMP2 | bnez AT, ->fff_fallback |. lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH) | daddiu NARGS8:TMP0, NARGS8:RC, -8 | bltz NARGS8:TMP0, ->fff_fallback |. move TMP2, BASE | move NARGS8:RC, NARGS8:TMP0 | daddiu BASE, BASE, 16 | // Remember active hook before pcall. | srl TMP3, TMP3, HOOK_ACTIVE_SHIFT | andi TMP3, TMP3, 1 | daddiu PC, TMP3, 16+FRAME_PCALL | beqz NARGS8:RC, ->vm_call_dispatch |1: |. daddu TMP0, BASE, NARGS8:RC |2: | ld TMP1, -16(TMP0) | sd TMP1, -8(TMP0) | daddiu TMP0, TMP0, -8 | bne TMP0, BASE, <2 |. nop | b ->vm_call_dispatch |. nop | |.ffunc xpcall | ld TMP1, L->maxstack | daddu TMP2, BASE, NARGS8:RC | sltu AT, TMP1, TMP2 | bnez AT, ->fff_fallback |. ld CARG1, 0(BASE) | daddiu NARGS8:TMP0, NARGS8:RC, -16 | ld CARG2, 8(BASE) | bltz NARGS8:TMP0, ->fff_fallback |. lbu TMP1, DISPATCH_GL(hookmask)(DISPATCH) | gettp AT, CARG2 | daddiu AT, AT, -LJ_TFUNC | bnez AT, ->fff_fallback // Traceback must be a function. |. move TMP2, BASE | move NARGS8:RC, NARGS8:TMP0 | daddiu BASE, BASE, 24 | // Remember active hook before pcall. | srl TMP3, TMP3, HOOK_ACTIVE_SHIFT | sd CARG2, 0(TMP2) // Swap function and traceback. | andi TMP3, TMP3, 1 | sd CARG1, 8(TMP2) | beqz NARGS8:RC, ->vm_call_dispatch |. daddiu PC, TMP3, 24+FRAME_PCALL | b <1 |. nop | |//-- Coroutine library -------------------------------------------------- | |.macro coroutine_resume_wrap, resume |.if resume |.ffunc_1 coroutine_resume | checktp CARG1, CARG1, -LJ_TTHREAD, ->fff_fallback |.else |.ffunc coroutine_wrap_aux | ld L:CARG1, CFUNC:RB->upvalue[0].gcr | cleartp L:CARG1 |.endif | lbu TMP0, L:CARG1->status | ld TMP1, L:CARG1->cframe | ld CARG2, L:CARG1->top | ld TMP2, L:CARG1->base | addiu AT, TMP0, -LUA_YIELD | daddu CARG3, CARG2, TMP0 | daddiu TMP3, CARG2, 8 |.if MIPSR6 | seleqz CARG2, CARG2, AT | selnez TMP3, TMP3, AT | bgtz AT, ->fff_fallback // st > LUA_YIELD? |. or CARG2, TMP3, CARG2 |.else | bgtz AT, ->fff_fallback // st > LUA_YIELD? |. movn CARG2, TMP3, AT |.endif | xor TMP2, TMP2, CARG3 | bnez TMP1, ->fff_fallback // cframe != 0? |. or AT, TMP2, TMP0 | ld TMP0, L:CARG1->maxstack | beqz AT, ->fff_fallback // base == top && st == 0? |. ld PC, FRAME_PC(BASE) | daddu TMP2, CARG2, NARGS8:RC | sltu AT, TMP0, TMP2 | bnez AT, ->fff_fallback // Stack overflow? |. sd PC, SAVE_PC | sd BASE, L->base |1: |.if resume | daddiu BASE, BASE, 8 // Keep resumed thread in stack for GC. | daddiu NARGS8:RC, NARGS8:RC, -8 | daddiu TMP2, TMP2, -8 |.endif | sd TMP2, L:CARG1->top | daddu TMP1, BASE, NARGS8:RC | move CARG3, CARG2 | sd BASE, L->top |2: // Move args to coroutine. | ld CRET1, 0(BASE) | sltu AT, BASE, TMP1 | beqz AT, >3 |. daddiu BASE, BASE, 8 | sd CRET1, 0(CARG3) | b <2 |. daddiu CARG3, CARG3, 8 |3: | bal ->vm_resume // (lua_State *L, TValue *base, 0, 0) |. move L:RA, L:CARG1 | // Returns thread status. |4: | ld TMP2, L:RA->base | sltiu AT, CRET1, LUA_YIELD+1 | ld TMP3, L:RA->top | li_vmstate INTERP | ld BASE, L->base | sd L, DISPATCH_GL(cur_L)(DISPATCH) | st_vmstate | beqz AT, >8 |. dsubu RD, TMP3, TMP2 | ld TMP0, L->maxstack | beqz RD, >6 // No results? |. daddu TMP1, BASE, RD | sltu AT, TMP0, TMP1 | bnez AT, >9 // Need to grow stack? |. daddu TMP3, TMP2, RD | sd TMP2, L:RA->top // Clear coroutine stack. | move TMP1, BASE |5: // Move results from coroutine. | ld CRET1, 0(TMP2) | daddiu TMP2, TMP2, 8 | sltu AT, TMP2, TMP3 | sd CRET1, 0(TMP1) | bnez AT, <5 |. daddiu TMP1, TMP1, 8 |6: | andi TMP0, PC, FRAME_TYPE |.if resume | mov_true TMP1 | daddiu RA, BASE, -8 | sd TMP1, -8(BASE) // Prepend true to results. | daddiu RD, RD, 16 |.else | move RA, BASE | daddiu RD, RD, 8 |.endif |7: | sd 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 | daddiu TMP3, TMP3, -8 | mov_false TMP1 | ld CRET1, 0(TMP3) | sd TMP3, L:RA->top // Remove error from coroutine stack. | li RD, (2+1)*8 | sd TMP1, -8(BASE) // Prepend false to results. | daddiu RA, BASE, -8 | sd CRET1, 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 | ld TMP0, L->cframe | daddu TMP1, BASE, NARGS8:RC | sd BASE, L->base | andi TMP0, TMP0, CFRAME_RESUME | sd TMP1, L->top | beqz TMP0, ->fff_fallback |. li CRET1, LUA_YIELD | sd r0, L->cframe | b ->vm_leave_unw |. sb CRET1, L->status | |//-- Math library ------------------------------------------------------- | |.ffunc_1 math_abs | gettp CARG2, CARG1 | daddiu AT, CARG2, -LJ_TISNUM | bnez AT, >1 |. sextw TMP1, CARG1 | sra TMP0, TMP1, 31 // Extract sign. | xor TMP1, TMP1, TMP0 | dsubu CARG1, TMP1, TMP0 | dsll TMP3, CARG1, 32 | bgez TMP3, ->fff_restv |. settp CARG1, TISNUM | li CARG1, 0x41e0 // 2^31 as a double. | b ->fff_restv |. dsll CARG1, CARG1, 48 |1: | sltiu AT, CARG2, LJ_TISNUM | beqz AT, ->fff_fallback |. dextm CARG1, CARG1, 0, 30 |// fallthrough | |->fff_restv: | // CARG1 = TValue result. | ld PC, FRAME_PC(BASE) | daddiu RA, BASE, -16 | sd CARG1, -16(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. | dsubu BASE, RA, TMP0 | ins_next2 | |6: // Fill up results with nil. | daddu TMP1, RA, RD | daddiu RD, RD, 8 | b <5 |. sd TISNIL, -8(TMP1) | |.macro math_extern, func | .ffunc_n math_ .. func | load_got func | call_extern |. nop | b ->fff_resn |. nop |.endmacro | |.macro math_extern2, func | .ffunc_nn math_ .. func |. load_got func | call_extern |. nop | b ->fff_resn |. nop |.endmacro | |// TODO: Return integer type if result is integer (own sf implementation). |.macro math_round, func |->ff_math_ .. func: | ld CARG1, 0(BASE) | beqz NARGS8:RC, ->fff_fallback |. gettp TMP0, CARG1 | beq TMP0, TISNUM, ->fff_restv |. sltu AT, TMP0, TISNUM | beqz AT, ->fff_fallback |.if FPU |. ldc1 FARG1, 0(BASE) | bal ->vm_ .. func |. nop |.else |. load_got func | call_extern |. nop |.endif | b ->fff_resn |. nop |.endmacro | | math_round floor | math_round ceil | |.ffunc math_log | li AT, 8 | bne NARGS8:RC, AT, ->fff_fallback // Exactly 1 argument. |. ld CARG1, 0(BASE) | checknum CARG1, ->fff_fallback |. load_got log |.if FPU | call_extern |. ldc1 FARG1, 0(BASE) |.else | call_extern |. nop |.endif | 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 | |.if FPU |.ffunc_n math_sqrt |. sqrt.d FRET1, FARG1 |// fallthrough to ->fff_resn |.else | math_extern sqrt |.endif | |->fff_resn: | ld PC, FRAME_PC(BASE) | daddiu RA, BASE, -16 | b ->fff_res1 |.if FPU |. sdc1 FRET1, 0(RA) |.else |. sd CRET1, 0(RA) |.endif | | |.ffunc_2 math_ldexp | checknum CARG1, ->fff_fallback | checkint CARG2, ->fff_fallback |. load_got ldexp | .FPU ldc1 FARG1, 0(BASE) | call_extern |. lw CARG2, 8+LO(BASE) | b ->fff_resn |. nop | |.ffunc_n math_frexp | load_got frexp | ld PC, FRAME_PC(BASE) | call_extern |. daddiu CARG2, DISPATCH, DISPATCH_GL(tmptv) | lw TMP1, DISPATCH_GL(tmptv)(DISPATCH) | daddiu RA, BASE, -16 |.if FPU | mtc1 TMP1, FARG2 | sdc1 FRET1, 0(RA) | cvt.d.w FARG2, FARG2 | sdc1 FARG2, 8(RA) |.else | sd CRET1, 0(RA) | zextw TMP1, TMP1 | settp TMP1, TISNUM | sd TMP1, 8(RA) |.endif | b ->fff_res |. li RD, (2+1)*8 | |.ffunc_n math_modf | load_got modf | ld PC, FRAME_PC(BASE) | call_extern |. daddiu CARG2, BASE, -16 | daddiu RA, BASE, -16 |.if FPU | sdc1 FRET1, -8(BASE) |.else | sd CRET1, -8(BASE) |.endif | b ->fff_res |. li RD, (2+1)*8 | |.macro math_minmax, name, intins, intinsc, fpins | .ffunc_1 name | daddu TMP3, BASE, NARGS8:RC | checkint CARG1, >5 |. daddiu TMP2, BASE, 8 |1: // Handle integers. | beq TMP2, TMP3, ->fff_restv |. ld CARG2, 0(TMP2) | checkint CARG2, >3 |. sextw CARG1, CARG1 | lw CARG2, LO(TMP2) |. slt AT, CARG1, CARG2 |.if MIPSR6 | intins TMP1, CARG2, AT | intinsc CARG1, CARG1, AT | or CARG1, CARG1, TMP1 |.else | intins CARG1, CARG2, AT |.endif | daddiu TMP2, TMP2, 8 | zextw CARG1, CARG1 | b <1 |. settp CARG1, TISNUM | |3: // Convert intermediate result to number and continue with number loop. | checknum CARG2, ->fff_fallback |.if FPU |. mtc1 CARG1, FRET1 | cvt.d.w FRET1, FRET1 | b >7 |. ldc1 FARG1, 0(TMP2) |.else |. nop | bal ->vm_sfi2d_1 |. nop | b >7 |. nop |.endif | |5: | .FPU ldc1 FRET1, 0(BASE) | checknum CARG1, ->fff_fallback |6: // Handle numbers. |. ld CARG2, 0(TMP2) | beq TMP2, TMP3, ->fff_resn |.if FPU | ldc1 FARG1, 0(TMP2) |.else | move CRET1, CARG1 |.endif | checknum CARG2, >8 |. nop |7: |.if FPU |.if MIPSR6 | fpins FRET1, FRET1, FARG1 |.else |.if fpins // ismax | c.olt.d FARG1, FRET1 |.else | c.olt.d FRET1, FARG1 |.endif | movf.d FRET1, FARG1 |.endif |.else |.if fpins // ismax | bal ->vm_sfcmpogt |.else | bal ->vm_sfcmpolt |.endif |. nop |.if MIPSR6 | seleqz AT, CARG2, CRET1 | selnez CARG1, CARG1, CRET1 | or CARG1, CARG1, AT |.else | movz CARG1, CARG2, CRET1 |.endif |.endif | b <6 |. daddiu TMP2, TMP2, 8 | |8: // Convert integer to number and continue with number loop. | checkint CARG2, ->fff_fallback |.if FPU |. lwc1 FARG1, LO(TMP2) | b <7 |. cvt.d.w FARG1, FARG1 |.else |. lw CARG2, LO(TMP2) | bal ->vm_sfi2d_2 |. nop | b <7 |. nop |.endif | |.endmacro | |.if MIPSR6 | math_minmax math_min, seleqz, selnez, min.d | math_minmax math_max, selnez, seleqz, max.d |.else | math_minmax math_min, movz, _, 0 | math_minmax math_max, movn, _, 1 |.endif | |//-- String library ----------------------------------------------------- | |.ffunc string_byte // Only handle the 1-arg case here. | ld CARG1, 0(BASE) | gettp TMP0, CARG1 | xori AT, NARGS8:RC, 8 | daddiu TMP0, TMP0, -LJ_TSTR | or AT, AT, TMP0 | bnez AT, ->fff_fallback // Need exactly 1 string argument. |. cleartp STR:CARG1 | lw TMP0, STR:CARG1->len | daddiu RA, BASE, -16 | ld PC, FRAME_PC(BASE) | sltu RD, r0, TMP0 | lbu TMP1, STR:CARG1[1] // Access is always ok (NUL at end). | addiu RD, RD, 1 | sll RD, RD, 3 // RD = ((str->len != 0)+1)*8 | settp TMP1, TISNUM | b ->fff_res |. sd TMP1, 0(RA) | |.ffunc string_char // Only handle the 1-arg case here. | ffgccheck |.if not MIPSR6 |. nop |.endif | ld CARG1, 0(BASE) | gettp TMP0, CARG1 | xori AT, NARGS8:RC, 8 // Exactly 1 argument. | daddiu TMP0, TMP0, -LJ_TISNUM // Integer. | li TMP1, 255 | sextw CARG1, CARG1 | or AT, AT, TMP0 | sltu TMP1, TMP1, CARG1 // !(255 < n). | or AT, AT, TMP1 | bnez AT, ->fff_fallback |. li CARG3, 1 | daddiu CARG2, sp, TMPD_OFS | sb CARG1, TMPD |->fff_newstr: | load_got lj_str_new | sd BASE, L->base | sd PC, SAVE_PC | call_intern lj_str_new // (lua_State *L, char *str, size_t l) |. move CARG1, L | // Returns GCstr *. | ld BASE, L->base |->fff_resstr: | li AT, LJ_TSTR | settp CRET1, AT | b ->fff_restv |. move CARG1, CRET1 | |.ffunc string_sub | ffgccheck |.if not MIPSR6 |. nop |.endif | addiu AT, NARGS8:RC, -16 | ld TMP0, 0(BASE) | bltz AT, ->fff_fallback |. gettp TMP3, TMP0 | cleartp STR:CARG1, TMP0 | ld CARG2, 8(BASE) | beqz AT, >1 |. li CARG4, -1 | ld CARG3, 16(BASE) | checkint CARG3, ->fff_fallback |. sextw CARG4, CARG3 |1: | checkint CARG2, ->fff_fallback |. li AT, LJ_TSTR | bne TMP3, AT, ->fff_fallback |. sextw CARG3, CARG2 | lw CARG2, STR:CARG1->len | // 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 |.if MIPSR6 | seleqz CARG4, CARG4, AT | selnez TMP1, TMP1, AT | or CARG4, TMP1, CARG4 // if (end < 0) end += len+1 |.else | movn CARG4, TMP1, AT // if (end < 0) end += len+1 |.endif | addu TMP1, CARG3, TMP0 |.if MIPSR6 | selnez TMP1, TMP1, TMP3 | seleqz CARG3, CARG3, TMP3 | or CARG3, TMP1, CARG3 // if (start < 0) start += len+1 | li TMP2, 1 | slt AT, CARG4, r0 | slt TMP3, r0, CARG3 | seleqz CARG4, CARG4, AT // if (end < 0) end = 0 | selnez CARG3, CARG3, TMP3 | seleqz TMP2, TMP2, TMP3 | or CARG3, TMP2, CARG3 // if (start < 1) start = 1 | slt AT, CARG2, CARG4 | seleqz CARG4, CARG4, AT | selnez CARG2, CARG2, AT | or CARG4, CARG2, CARG4 // if (end > len) end = len |.else | 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 |.endif | daddu CARG2, STR:CARG1, CARG3 | subu CARG3, CARG4, CARG3 // len = end - start | daddiu CARG2, CARG2, sizeof(GCstr)-1 | bgez CARG3, ->fff_newstr |. addiu CARG3, CARG3, 1 // len++ |->fff_emptystr: // Return empty string. | li AT, LJ_TSTR | daddiu STR:CARG1, DISPATCH, DISPATCH_GL(strempty) | b ->fff_restv |. settp CARG1, AT | |.macro ffstring_op, name | .ffunc string_ .. name | ffgccheck |. nop | beqz NARGS8:RC, ->fff_fallback |. ld CARG2, 0(BASE) | checkstr STR:CARG2, ->fff_fallback | daddiu SBUF:CARG1, DISPATCH, DISPATCH_GL(tmpbuf) | load_got lj_buf_putstr_ .. name | ld TMP0, SBUF:CARG1->b | sd L, SBUF:CARG1->L | sd BASE, L->base | sd TMP0, SBUF:CARG1->w | call_intern extern lj_buf_putstr_ .. name |. sd PC, SAVE_PC | load_got lj_buf_tostr | call_intern lj_buf_tostr |. move SBUF:CARG1, SBUF:CRET1 | b ->fff_resstr |. ld BASE, L->base |.endmacro | |ffstring_op reverse |ffstring_op lower |ffstring_op upper | |//-- Bit library -------------------------------------------------------- | |->vm_tobit_fb: | beqz TMP1, ->fff_fallback |.if FPU |. ldc1 FARG1, 0(BASE) | add.d FARG1, FARG1, TOBIT | mfc1 CRET1, FARG1 | jr ra |. zextw CRET1, CRET1 |.else |// FP number to bit conversion for soft-float. |->vm_tobit: | dsll TMP0, CARG1, 1 | li CARG3, 1076 | dsrl AT, TMP0, 53 | dsubu CARG3, CARG3, AT | sltiu AT, CARG3, 54 | beqz AT, >1 |. dextm TMP0, TMP0, 0, 20 | dinsu TMP0, AT, 21, 21 | slt AT, CARG1, r0 | dsrlv CRET1, TMP0, CARG3 | dsubu TMP0, r0, CRET1 |.if MIPSR6 | selnez TMP0, TMP0, AT | seleqz CRET1, CRET1, AT | or CRET1, CRET1, TMP0 |.else | movn CRET1, TMP0, AT |.endif | jr ra |. zextw CRET1, CRET1 |1: | jr ra |. move CRET1, r0 | |// FP number to int conversion with a check for soft-float. |// Modifies CARG1, CRET1, CRET2, TMP0, AT. |->vm_tointg: |.if JIT | dsll CRET2, CARG1, 1 | beqz CRET2, >2 |. li TMP0, 1076 | dsrl AT, CRET2, 53 | dsubu TMP0, TMP0, AT | sltiu AT, TMP0, 54 | beqz AT, >1 |. dextm CRET2, CRET2, 0, 20 | dinsu CRET2, AT, 21, 21 | slt AT, CARG1, r0 | dsrlv CRET1, CRET2, TMP0 | dsubu CARG1, r0, CRET1 |.if MIPSR6 | seleqz CRET1, CRET1, AT | selnez CARG1, CARG1, AT | or CRET1, CRET1, CARG1 |.else | movn CRET1, CARG1, AT |.endif | li CARG1, 64 | subu TMP0, CARG1, TMP0 | dsllv CRET2, CRET2, TMP0 // Integer check. | sextw AT, CRET1 | xor AT, CRET1, AT // Range check. |.if MIPSR6 | seleqz AT, AT, CRET2 | selnez CRET2, CRET2, CRET2 | jr ra |. or CRET2, AT, CRET2 |.else | jr ra |. movz CRET2, AT, CRET2 |.endif |1: | jr ra |. li CRET2, 1 |2: | jr ra |. move CRET1, r0 |.endif |.endif | |.macro .ffunc_bit, name | .ffunc_1 bit_..name | gettp TMP0, CARG1 | beq TMP0, TISNUM, >6 |. zextw CRET1, CARG1 | bal ->vm_tobit_fb |. sltiu TMP1, TMP0, LJ_TISNUM |6: |.endmacro | |.macro .ffunc_bit_op, name, bins | .ffunc_bit name | daddiu TMP2, BASE, 8 | daddu TMP3, BASE, NARGS8:RC |1: | beq TMP2, TMP3, ->fff_resi |. ld CARG1, 0(TMP2) | gettp TMP0, CARG1 |.if FPU | bne TMP0, TISNUM, >2 |. daddiu TMP2, TMP2, 8 | zextw CARG1, CARG1 | b <1 |. bins CRET1, CRET1, CARG1 |2: | ldc1 FARG1, -8(TMP2) | sltiu AT, TMP0, LJ_TISNUM | beqz AT, ->fff_fallback |. add.d FARG1, FARG1, TOBIT | mfc1 CARG1, FARG1 | zextw CARG1, CARG1 | b <1 |. bins CRET1, CRET1, CARG1 |.else | beq TMP0, TISNUM, >2 |. move CRET2, CRET1 | bal ->vm_tobit_fb |. sltiu TMP1, TMP0, LJ_TISNUM | move CARG1, CRET2 |2: | zextw CARG1, CARG1 | bins CRET1, CRET1, CARG1 | b <1 |. daddiu TMP2, TMP2, 8 |.endif |.endmacro | |.ffunc_bit_op band, and |.ffunc_bit_op bor, or |.ffunc_bit_op bxor, xor | |.ffunc_bit bswap | dsrl TMP0, CRET1, 8 | dsrl TMP1, CRET1, 24 | andi TMP2, TMP0, 0xff00 | dins TMP1, CRET1, 24, 31 | dins TMP2, TMP0, 16, 23 | b ->fff_resi |. or CRET1, TMP1, TMP2 | |.ffunc_bit bnot | not CRET1, CRET1 | b ->fff_resi |. zextw CRET1, CRET1 | |.macro .ffunc_bit_sh, name, shins, shmod | .ffunc_2 bit_..name | gettp TMP0, CARG1 | beq TMP0, TISNUM, >1 |. nop | bal ->vm_tobit_fb |. sltiu TMP1, TMP0, LJ_TISNUM | move CARG1, CRET1 |1: | gettp TMP0, CARG2 | bne TMP0, TISNUM, ->fff_fallback |. zextw CARG2, CARG2 | sextw CARG1, CARG1 |.if shmod == 1 | negu CARG2, CARG2 |.endif | shins CRET1, CARG1, CARG2 | b ->fff_resi |. zextw CRET1, CRET1 |.endmacro | |.ffunc_bit_sh lshift, sllv, 0 |.ffunc_bit_sh rshift, srlv, 0 |.ffunc_bit_sh arshift, srav, 0 |.ffunc_bit_sh rol, rotrv, 1 |.ffunc_bit_sh ror, rotrv, 0 | |.ffunc_bit tobit |->fff_resi: | ld PC, FRAME_PC(BASE) | daddiu RA, BASE, -16 | settp CRET1, TISNUM | b ->fff_res1 |. sd CRET1, -16(BASE) | |//----------------------------------------------------------------------- |->fff_fallback: // Call fast function fallback handler. | // BASE = new base, RB = CFUNC, RC = nargs*8 | ld TMP3, CFUNC:RB->f | daddu TMP1, BASE, NARGS8:RC | ld PC, FRAME_PC(BASE) // Fallback may overwrite PC. | daddiu TMP0, TMP1, 8*LUA_MINSTACK | ld TMP2, L->maxstack | sd PC, SAVE_PC // Redundant (but a defined value). | sltu AT, TMP2, TMP0 | sd BASE, L->base | sd 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. | ld BASE, L->base | sll RD, CRET1, 3 | bgtz CRET1, ->fff_res // Returned nresults+1? |. daddiu RA, BASE, -16 |1: // Returned 0 or -1: retry fast path. | ld LFUNC:RB, FRAME_FUNC(BASE) | ld TMP0, L->top | cleartp LFUNC:RB | bnez CRET1, ->vm_call_tail // Returned -1? |. dsubu 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, 16 |3: | b ->vm_call_dispatch // Resolve again for tailcall. |. dsubu 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 | ld 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 | sd BASE, L->base | daddu TMP0, BASE, NARGS8:RC | sd PC, SAVE_PC // Redundant (but a defined value). | sd TMP0, L->top | call_intern lj_gc_step // (lua_State *L) |. move CARG1, L | ld BASE, L->base | move ra, MULTRES | ld TMP0, L->top | ld CFUNC:RB, FRAME_FUNC(BASE) | cleartp CFUNC:RB | jr ra |. dsubu 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. |. ld 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 | sd 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: | ld BASE, L->base |4: // Re-dispatch to static ins. | lw INS, -4(PC) | decode_OP8a TMP1, INS | decode_OP8b TMP1 | daddu TMP0, DISPATCH, TMP1 | decode_RD8a RD, INS | ld AT, GG_DISP2STATIC(TMP0) | decode_RA8a RA, INS | decode_RD8b RD | jr AT | decode_RA8b RA | |->cont_hook: // Continue from hook yield. | daddiu PC, PC, 4 | b <4 |. lw MULTRES, -24+LO(RB) // Restore MULTRES for *M ins. | |->vm_hotloop: // Hot loop counter underflow. |.if JIT | ld LFUNC:TMP1, FRAME_FUNC(BASE) | daddiu CARG1, DISPATCH, GG_DISP2J | cleartp LFUNC:TMP1 | sd PC, SAVE_PC | ld TMP1, LFUNC:TMP1->pc | move CARG2, PC | sd L, DISPATCH_J(L)(DISPATCH) | lbu TMP1, PC2PROTO(framesize)(TMP1) | load_got lj_trace_hot | sd BASE, L->base | dsll TMP1, TMP1, 3 | daddu TMP1, BASE, TMP1 | call_intern lj_trace_hot // (jit_State *J, const BCIns *pc) |. sd 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 | daddu TMP0, BASE, RC | sd PC, SAVE_PC | sd BASE, L->base | dsubu RA, RA, BASE | sd TMP0, L->top | call_intern lj_dispatch_call // (lua_State *L, const BCIns *pc) |. move CARG1, L | // Returns ASMFunction. | ld BASE, L->base | ld TMP0, L->top | sd r0, SAVE_PC // Invalidate for subsequent line hook. | dsubu NARGS8:RC, TMP0, BASE | daddu RA, BASE, RA | ld LFUNC:RB, FRAME_FUNC(BASE) | cleartp LFUNC:RB | jr CRET1 |. lw INS, -4(PC) | |->cont_stitch: // Trace stitching. |.if JIT | // RA = resultptr, RB = meta base | lw INS, -4(PC) | ld TRACE:TMP2, -40(RB) // Save previous trace. | decode_RA8a RC, INS | daddiu AT, MULTRES, -8 | cleartp TRACE:TMP2 | decode_RA8b RC | beqz AT, >2 |. daddu RC, BASE, RC // Call base. |1: // Move results down. | ld CARG1, 0(RA) | daddiu AT, AT, -8 | daddiu RA, RA, 8 | sd CARG1, 0(RC) | bnez AT, <1 |. daddiu RC, RC, 8 |2: | decode_RA8a RA, INS | decode_RB8a RB, INS | decode_RA8b RA | decode_RB8b RB | daddu RA, RA, RB | daddu RA, BASE, RA |3: | sltu AT, RC, RA | bnez AT, >9 // More results wanted? |. nop | | lhu TMP3, TRACE:TMP2->traceno | lhu RD, TRACE:TMP2->link | beq RD, TMP3, ->cont_nop // Blacklisted. |. load_got lj_dispatch_stitch | bnez RD, =>BC_JLOOP // Jump to stitched trace. |. sll RD, RD, 3 | | // Stitch a new trace to the previous trace. | sw TMP3, DISPATCH_J(exitno)(DISPATCH) | sd L, DISPATCH_J(L)(DISPATCH) | sd BASE, L->base | daddiu CARG1, DISPATCH, GG_DISP2J | call_intern lj_dispatch_stitch // (jit_State *J, const BCIns *pc) |. move CARG2, PC | b ->cont_nop |. ld BASE, L->base | |9: | sd TISNIL, 0(RC) | b <3 |. daddiu RC, RC, 8 |.endif | |->vm_profhook: // Dispatch target for profiler hook. #if LJ_HASPROFILE | load_got lj_dispatch_profile | sw MULTRES, SAVE_MULTRES | move CARG2, PC | sd BASE, L->base | call_intern lj_dispatch_profile // (lua_State *L, const BCIns *pc) |. move CARG1, L | // HOOK_PROFILE is off again, so re-dispatch to dynamic instruction. | daddiu PC, PC, -4 | b ->cont_nop |. ld BASE, L->base #endif | |//----------------------------------------------------------------------- |//-- Trace exit handler ------------------------------------------------- |//----------------------------------------------------------------------- | |.macro savex_, a, b |.if FPU | sdc1 f..a, a*8(sp) | sdc1 f..b, b*8(sp) | sd r..a, 32*8+a*8(sp) | sd r..b, 32*8+b*8(sp) |.else | sd r..a, a*8(sp) | sd r..b, b*8(sp) |.endif |.endmacro | |->vm_exit_handler: |.if JIT |.if FPU | daddiu sp, sp, -(32*8+32*8) |.else | daddiu sp, sp, -(32*8) |.endif | 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 | savex_ 28, 30 |.if FPU | sdc1 f29, 29*8(sp) | sdc1 f31, 31*8(sp) | sd r0, 32*8+31*8(sp) // Clear RID_TMP. | daddiu TMP2, sp, 32*8+32*8 // Recompute original value of sp. | sd TMP2, 32*8+29*8(sp) // Store sp in RID_SP |.else | sd r0, 31*8(sp) // Clear RID_TMP. | daddiu TMP2, sp, 32*8 // Recompute original value of sp. | sd TMP2, 29*8(sp) // Store sp in RID_SP |.endif | li_vmstate EXIT | daddiu DISPATCH, JGL, -GG_DISP2G-32768 | lw TMP1, 0(TMP2) // Load exit number. | st_vmstate | ld L, DISPATCH_GL(cur_L)(DISPATCH) | ld BASE, DISPATCH_GL(jit_base)(DISPATCH) | load_got lj_trace_exit | sd L, DISPATCH_J(L)(DISPATCH) | sw ra, DISPATCH_J(parent)(DISPATCH) // Store trace number. | sd BASE, L->base | sw TMP1, DISPATCH_J(exitno)(DISPATCH) // Store exit number. | daddiu CARG1, DISPATCH, GG_DISP2J | sd r0, DISPATCH_GL(jit_base)(DISPATCH) | call_intern lj_trace_exit // (jit_State *J, ExitState *ex) |. move CARG2, sp | // Returns MULTRES (unscaled) or negated error code. | ld TMP1, L->cframe | li AT, -4 | ld BASE, L->base | and sp, TMP1, AT | ld PC, SAVE_PC // Get SAVE_PC. | b >1 |. sd 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. | ld L, SAVE_L | daddiu DISPATCH, JGL, -GG_DISP2G-32768 | sd BASE, L->base |1: | sltiu TMP0, CRET1, -LUA_ERRERR // Check for error from exit. | beqz TMP0, >9 |. ld LFUNC:RB, FRAME_FUNC(BASE) | .FPU lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). | dsll MULTRES, CRET1, 3 | cleartp LFUNC:RB | sw MULTRES, SAVE_MULTRES | li TISNIL, LJ_TNIL | li TISNUM, LJ_TISNUM // Setup type comparison constants. | .FPU mtc1 TMP3, TOBIT | ld TMP1, LFUNC:RB->pc | sd r0, DISPATCH_GL(jit_base)(DISPATCH) | ld KBASE, PC2PROTO(k)(TMP1) | .FPU cvt.d.s TOBIT, TOBIT | // Modified copy of ins_next which handles function header dispatch, too. | lw INS, 0(PC) | addiu CRET1, CRET1, 17 // Static dispatch? | // Assumes TISNIL == ~LJ_VMST_INTERP == -1 | sw TISNIL, DISPATCH_GL(vmstate)(DISPATCH) | decode_RD8a RD, INS | beqz CRET1, >5 |. daddiu PC, PC, 4 | decode_OP8a TMP1, INS | decode_OP8b TMP1 | daddu TMP0, DISPATCH, TMP1 | sltiu TMP2, TMP1, BC_FUNCF*8 | ld AT, 0(TMP0) | decode_RA8a RA, INS | beqz TMP2, >2 |. decode_RA8b RA | jr AT |. decode_RD8b RD |2: | sltiu TMP2, TMP1, (BC_FUNCC+2)*8 // Fast function? | bnez TMP2, >3 |. ld TMP1, FRAME_PC(BASE) | // Check frame below fast function. | andi TMP0, TMP1, FRAME_TYPE | bnez TMP0, >3 // Trace stitching continuation? |. nop | // Otherwise set KBASE for Lua function below fast function. | lw TMP2, -4(TMP1) | decode_RA8a TMP0, TMP2 | decode_RA8b TMP0 | dsubu TMP1, BASE, TMP0 | ld LFUNC:TMP2, -32(TMP1) | cleartp LFUNC:TMP2 | ld TMP1, LFUNC:TMP2->pc | ld KBASE, PC2PROTO(k)(TMP1) |3: | daddiu RC, MULTRES, -8 | jr AT |. daddu RA, RA, BASE | |5: // Dispatch to static entry of original ins replaced by BC_JLOOP. | ld TMP0, DISPATCH_J(trace)(DISPATCH) | decode_RD8b RD | daddu TMP0, TMP0, RD | ld TRACE:TMP2, 0(TMP0) | lw INS, TRACE:TMP2->startins | decode_OP8a TMP1, INS | decode_OP8b TMP1 | daddu TMP0, DISPATCH, TMP1 | decode_RD8a RD, INS | ld AT, GG_DISP2STATIC(TMP0) | decode_RA8a RA, INS | decode_RD8b RD | jr AT |. decode_RA8b RA | |9: // Rethrow error from the right C frame. | load_got lj_err_trace | sub CARG2, r0, CRET1 | call_intern lj_err_trace // (lua_State *L, int errcode) |. move CARG1, L |.endif | |//----------------------------------------------------------------------- |//-- Math helper functions ---------------------------------------------- |//----------------------------------------------------------------------- | |// Hard-float round to integer. |// Modifies AT, TMP0, FRET1, FRET2, f4. Keeps all others incl. FARG1. |// MIPSR6: Modifies FTMP1, too. |.macro vm_round_hf, func | lui TMP0, 0x4330 // Hiword of 2^52 (double). | dsll TMP0, TMP0, 32 | dmtc1 TMP0, f4 | abs.d FRET2, FARG1 // |x| | dmfc1 AT, FARG1 |.if MIPSR6 | cmp.lt.d FTMP1, FRET2, f4 | add.d FRET1, FRET2, f4 // (|x| + 2^52) - 2^52 | bc1eqz FTMP1, >1 // Truncate only if |x| < 2^52. |.else | 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. |.endif |. 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" | dsll TMP0, TMP0, 32 | dmtc1 TMP0, f4 |.if MIPSR6 | cmp.lt.d FTMP1, FRET2, FRET1 // |x| < result? | sub.d FRET2, FRET1, f4 | sel.d FTMP1, FRET1, FRET2 // If yes, subtract +1. | dmtc1 AT, FRET1 | neg.d FRET2, FTMP1 | jr ra |. sel.d FRET1, FTMP1, FRET2 // Merge sign bit back in. |.else | 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. |.endif |.else | neg.d FRET2, FRET1 | dsll TMP0, TMP0, 32 | dmtc1 TMP0, f4 |.if MIPSR6 | dmtc1 AT, FTMP1 | sel.d FTMP1, FRET1, FRET2 |.if "func" == "ceil" | cmp.lt.d FRET1, FTMP1, FARG1 // x > result? |.else | cmp.lt.d FRET1, FARG1, FTMP1 // x < result? |.endif | sub.d FRET2, FTMP1, f4 // If yes, subtract +-1. | jr ra |. sel.d FRET1, FTMP1, FRET2 |.else | 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 |.endif |1: | jr ra |. mov.d FRET1, FARG1 |.endmacro | |.macro vm_round, func |.if FPU | vm_round_hf, func |.endif |.endmacro | |->vm_floor: | vm_round floor |->vm_ceil: | vm_round ceil |->vm_trunc: |.if JIT | vm_round trunc |.endif | |// Soft-float integer to number conversion. |.macro sfi2d, ARG |.if not FPU | beqz ARG, >9 // Handle zero first. |. sra TMP0, ARG, 31 | xor TMP1, ARG, TMP0 | dsubu TMP1, TMP1, TMP0 // Absolute value in TMP1. | dclz ARG, TMP1 | addiu ARG, ARG, -11 | li AT, 0x3ff+63-11-1 | dsllv TMP1, TMP1, ARG // Align mantissa left with leading 1. | subu ARG, AT, ARG // Exponent - 1. | ins ARG, TMP0, 11, 11 // Sign | Exponent. | dsll ARG, ARG, 52 // Align left. | jr ra |. daddu ARG, ARG, TMP1 // Add mantissa, increment exponent. |9: | jr ra |. nop |.endif |.endmacro | |// Input CARG1. Output: CARG1. Temporaries: AT, TMP0, TMP1. |->vm_sfi2d_1: | sfi2d CARG1 | |// Input CARG2. Output: CARG2. Temporaries: AT, TMP0, TMP1. |->vm_sfi2d_2: | sfi2d CARG2 | |// Soft-float comparison. Equivalent to c.eq.d. |// Input: CARG*. Output: CRET1. Temporaries: AT, TMP0, TMP1. |->vm_sfcmpeq: |.if not FPU | dsll AT, CARG1, 1 | dsll TMP0, CARG2, 1 | or TMP1, AT, TMP0 | beqz TMP1, >8 // Both args +-0: return 1. |. lui TMP1, 0xffe0 | dsll TMP1, TMP1, 32 | sltu AT, TMP1, AT | sltu TMP0, TMP1, TMP0 | or TMP1, AT, TMP0 | bnez TMP1, >9 // Either arg is NaN: return 0; |. xor AT, CARG1, CARG2 | jr ra |. sltiu CRET1, AT, 1 // Same values: return 1. |8: | jr ra |. li CRET1, 1 |9: | jr ra |. li CRET1, 0 |.endif | |// Soft-float comparison. Equivalent to c.ult.d and c.olt.d. |// Input: CARG1, CARG2. Output: CRET1. Temporaries: AT, TMP0, TMP1, CRET2. |->vm_sfcmpult: |.if not FPU | b >1 |. li CRET2, 1 |.endif | |->vm_sfcmpolt: |.if not FPU | li CRET2, 0 |1: | dsll AT, CARG1, 1 | dsll TMP0, CARG2, 1 | or TMP1, AT, TMP0 | beqz TMP1, >8 // Both args +-0: return 0. |. lui TMP1, 0xffe0 | dsll TMP1, TMP1, 32 | sltu AT, TMP1, AT | sltu TMP0, TMP1, TMP0 | or TMP1, AT, TMP0 | bnez TMP1, >9 // Either arg is NaN: return 0 or 1; |. and AT, CARG1, CARG2 | bltz AT, >5 // Both args negative? |. nop | jr ra |. slt CRET1, CARG1, CARG2 |5: // Swap conditions if both operands are negative. | jr ra |. slt CRET1, CARG2, CARG1 |8: | jr ra |. li CRET1, 0 |9: | jr ra |. move CRET1, CRET2 |.endif | |->vm_sfcmpogt: |.if not FPU | dsll AT, CARG2, 1 | dsll TMP0, CARG1, 1 | or TMP1, AT, TMP0 | beqz TMP1, >8 // Both args +-0: return 0. |. lui TMP1, 0xffe0 | dsll TMP1, TMP1, 32 | sltu AT, TMP1, AT | sltu TMP0, TMP1, TMP0 | or TMP1, AT, TMP0 | bnez TMP1, >9 // Either arg is NaN: return 0 or 1; |. and AT, CARG2, CARG1 | bltz AT, >5 // Both args negative? |. nop | jr ra |. slt CRET1, CARG2, CARG1 |5: // Swap conditions if both operands are negative. | jr ra |. slt CRET1, CARG1, CARG2 |8: | jr ra |. li CRET1, 0 |9: | jr ra |. li CRET1, 0 |.endif | |// Soft-float comparison. Equivalent to c.ole.d a, b or c.ole.d b, a. |// Input: CARG1, CARG2, TMP3. Output: CRET1. Temporaries: AT, TMP0, TMP1. |->vm_sfcmpolex: |.if not FPU | dsll AT, CARG1, 1 | dsll TMP0, CARG2, 1 | or TMP1, AT, TMP0 | beqz TMP1, >8 // Both args +-0: return 1. |. lui TMP1, 0xffe0 | dsll TMP1, TMP1, 32 | sltu AT, TMP1, AT | sltu TMP0, TMP1, TMP0 | or TMP1, AT, TMP0 | bnez TMP1, >9 // Either arg is NaN: return 0; |. and AT, CARG1, CARG2 | xor AT, AT, TMP3 | bltz AT, >5 // Both args negative? |. nop | jr ra |. slt CRET1, CARG2, CARG1 |5: // Swap conditions if both operands are negative. | jr ra |. slt CRET1, CARG1, CARG2 |8: | jr ra |. li CRET1, 1 |9: | jr ra |. li CRET1, 0 |.endif | |.macro sfmin_max, name, fpcall |->vm_sf .. name: |.if JIT and not FPU | move TMP2, ra | bal ->fpcall |. nop | move ra, TMP2 | move TMP0, CRET1 | move CRET1, CARG1 |.if MIPSR6 | selnez CRET1, CRET1, TMP0 | seleqz TMP0, CARG2, TMP0 | jr ra |. or CRET1, CRET1, TMP0 |.else | jr ra |. movz CRET1, CARG2, TMP0 |.endif |.endif |.endmacro | | sfmin_max min, vm_sfcmpolt | sfmin_max max, vm_sfcmpogt | |//----------------------------------------------------------------------- |//-- Miscellaneous functions -------------------------------------------- |//----------------------------------------------------------------------- | |.define NEXT_TAB, TAB:CARG1 |.define NEXT_IDX, CARG2 |.define NEXT_ASIZE, CARG3 |.define NEXT_NIL, CARG4 |.define NEXT_TMP0, r12 |.define NEXT_TMP1, r13 |.define NEXT_TMP2, r14 |.define NEXT_RES_VK, CRET1 |.define NEXT_RES_IDX, CRET2 |.define NEXT_RES_PTR, sp |.define NEXT_RES_VAL, 0(sp) |.define NEXT_RES_KEY, 8(sp) | |// TValue *lj_vm_next(GCtab *t, uint32_t idx) |// Next idx returned in CRET2. |->vm_next: |.if JIT and ENDIAN_LE | lw NEXT_ASIZE, NEXT_TAB->asize | ld NEXT_TMP0, NEXT_TAB->array | li NEXT_NIL, LJ_TNIL |1: // Traverse array part. | sltu AT, NEXT_IDX, NEXT_ASIZE | sll NEXT_TMP1, NEXT_IDX, 3 | beqz AT, >5 |. daddu NEXT_TMP1, NEXT_TMP0, NEXT_TMP1 | li AT, LJ_TISNUM | ld NEXT_TMP2, 0(NEXT_TMP1) | dsll AT, AT, 47 | or NEXT_TMP1, NEXT_IDX, AT | beq NEXT_TMP2, NEXT_NIL, <1 |. addiu NEXT_IDX, NEXT_IDX, 1 | sd NEXT_TMP2, NEXT_RES_VAL | sd NEXT_TMP1, NEXT_RES_KEY | move NEXT_RES_VK, NEXT_RES_PTR | jr ra |. move NEXT_RES_IDX, NEXT_IDX | |5: // Traverse hash part. | subu NEXT_RES_IDX, NEXT_IDX, NEXT_ASIZE | ld NODE:NEXT_RES_VK, NEXT_TAB->node | sll NEXT_TMP2, NEXT_RES_IDX, 5 | lw NEXT_TMP0, NEXT_TAB->hmask | sll AT, NEXT_RES_IDX, 3 | subu AT, NEXT_TMP2, AT | daddu NODE:NEXT_RES_VK, NODE:NEXT_RES_VK, AT |6: | sltu AT, NEXT_TMP0, NEXT_RES_IDX | bnez AT, >8 |. nop | ld NEXT_TMP2, NODE:NEXT_RES_VK->val | bne NEXT_TMP2, NEXT_NIL, >9 |. addiu NEXT_RES_IDX, NEXT_RES_IDX, 1 | // Skip holes in hash part. | b <6 |. daddiu NODE:NEXT_RES_VK, NODE:NEXT_RES_VK, sizeof(Node) | |8: // End of iteration. Set the key to nil (not the value). | sd NEXT_NIL, NEXT_RES_KEY | move NEXT_RES_VK, NEXT_RES_PTR |9: | jr ra |. addu NEXT_RES_IDX, NEXT_RES_IDX, NEXT_ASIZE |.endif | |//----------------------------------------------------------------------- |//-- 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 | ld CTSTATE, GL:r2->ctype_state | daddiu DISPATCH, r2, GG_G2DISP | load_got lj_ccallback_enter | sw r1, CTSTATE->cb.slot | sd CARG1, CTSTATE->cb.gpr[0] | .FPU sdc1 FARG1, CTSTATE->cb.fpr[0] | sd CARG2, CTSTATE->cb.gpr[1] | .FPU sdc1 FARG2, CTSTATE->cb.fpr[1] | sd CARG3, CTSTATE->cb.gpr[2] | .FPU sdc1 FARG3, CTSTATE->cb.fpr[2] | sd CARG4, CTSTATE->cb.gpr[3] | .FPU sdc1 FARG4, CTSTATE->cb.fpr[3] | sd CARG5, CTSTATE->cb.gpr[4] | .FPU sdc1 FARG5, CTSTATE->cb.fpr[4] | sd CARG6, CTSTATE->cb.gpr[5] | .FPU sdc1 FARG6, CTSTATE->cb.fpr[5] | sd CARG7, CTSTATE->cb.gpr[6] | .FPU sdc1 FARG7, CTSTATE->cb.fpr[6] | sd CARG8, CTSTATE->cb.gpr[7] | .FPU sdc1 FARG8, CTSTATE->cb.fpr[7] | daddiu TMP0, sp, CFRAME_SPACE | sd TMP0, CTSTATE->cb.stack | sd 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 *. | ld BASE, L:CRET1->base | ld RC, L:CRET1->top | move L, CRET1 | .FPU lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). | ld LFUNC:RB, FRAME_FUNC(BASE) | .FPU mtc1 TMP3, TOBIT | li TISNIL, LJ_TNIL | li TISNUM, LJ_TISNUM | li_vmstate INTERP | subu RC, RC, BASE | cleartp LFUNC:RB | st_vmstate | .FPU cvt.d.s TOBIT, TOBIT | ins_callt |.endif | |->cont_ffi_callback: // Return from FFI callback. |.if FFI | load_got lj_ccallback_leave | ld CTSTATE, DISPATCH_GL(ctype_state)(DISPATCH) | sd BASE, L->base | sd RB, L->top | sd L, CTSTATE->L | move CARG2, RA | call_intern lj_ccallback_leave // (CTState *cts, TValue *o) |. move CARG1, CTSTATE | .FPU ldc1 FRET1, CTSTATE->cb.fpr[0] | ld CRET1, CTSTATE->cb.gpr[0] | .FPU ldc1 FRET2, CTSTATE->cb.fpr[1] | b ->vm_leave_unw |. ld CRET2, CTSTATE->cb.gpr[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 | dsubu sp, sp, TMP1 | sd ra, -8(TMP2) | sd r16, -16(TMP2) | sd CCSTATE, -24(TMP2) | move r16, TMP2 | daddiu TMP1, CCSTATE, offsetof(CCallState, stack) | move TMP2, sp | beqz CARG2, >2 |. daddu TMP3, TMP1, CARG2 |1: | ld TMP0, 0(TMP1) | daddiu TMP1, TMP1, 8 | sltu AT, TMP1, TMP3 | sd TMP0, 0(TMP2) | bnez AT, <1 |. daddiu TMP2, TMP2, 8 |2: | ld CFUNCADDR, CCSTATE->func | .FPU ldc1 FARG1, CCSTATE->gpr[0] | ld CARG2, CCSTATE->gpr[1] | .FPU ldc1 FARG2, CCSTATE->gpr[1] | ld CARG3, CCSTATE->gpr[2] | .FPU ldc1 FARG3, CCSTATE->gpr[2] | ld CARG4, CCSTATE->gpr[3] | .FPU ldc1 FARG4, CCSTATE->gpr[3] | ld CARG5, CCSTATE->gpr[4] | .FPU ldc1 FARG5, CCSTATE->gpr[4] | ld CARG6, CCSTATE->gpr[5] | .FPU ldc1 FARG6, CCSTATE->gpr[5] | ld CARG7, CCSTATE->gpr[6] | .FPU ldc1 FARG7, CCSTATE->gpr[6] | ld CARG8, CCSTATE->gpr[7] | .FPU ldc1 FARG8, CCSTATE->gpr[7] | jalr CFUNCADDR |. ld CARG1, CCSTATE->gpr[0] // Do this last, since CCSTATE is CARG1. | ld CCSTATE:TMP1, -24(r16) | ld TMP2, -16(r16) | ld ra, -8(r16) | sd CRET1, CCSTATE:TMP1->gpr[0] | sd CRET2, CCSTATE:TMP1->gpr[1] |.if FPU | sdc1 FRET1, CCSTATE:TMP1->fpr[0] | sdc1 FRET2, CCSTATE:TMP1->fpr[1] |.else | sd CARG1, CCSTATE:TMP1->gpr[2] // 2nd FP struct field for soft-float. |.endif | 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 |.macro bc_comp, FRA, FRD, ARGRA, ARGRD, movop, fmovop, fcomp, sfcomp | daddu RA, BASE, RA | daddu RD, BASE, RD | ld ARGRA, 0(RA) | ld ARGRD, 0(RD) | lhu TMP2, OFS_RD(PC) | gettp CARG3, ARGRA | gettp CARG4, ARGRD | bne CARG3, TISNUM, >2 |. daddiu PC, PC, 4 | bne CARG4, TISNUM, >5 |. decode_RD4b TMP2 | sextw ARGRA, ARGRA | sextw ARGRD, ARGRD | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) | slt AT, CARG1, CARG2 | addu TMP2, TMP2, TMP3 |.if MIPSR6 | movop TMP2, TMP2, AT |.else | movop TMP2, r0, AT |.endif |1: | daddu PC, PC, TMP2 | ins_next | |2: // RA is not an integer. | sltiu AT, CARG3, LJ_TISNUM | beqz AT, ->vmeta_comp |. lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) | sltiu AT, CARG4, LJ_TISNUM | beqz AT, >4 |. decode_RD4b TMP2 |.if FPU | ldc1 FRA, 0(RA) | ldc1 FRD, 0(RD) |.endif |3: // RA and RD are both numbers. |.if FPU |.if MIPSR6 | fcomp FTMP0, FTMP0, FTMP2 | addu TMP2, TMP2, TMP3 | mfc1 TMP3, FTMP0 | b <1 |. fmovop TMP2, TMP2, TMP3 |.else | fcomp FTMP0, FTMP2 | addu TMP2, TMP2, TMP3 | b <1 |. fmovop TMP2, r0 |.endif |.else | bal sfcomp |. addu TMP2, TMP2, TMP3 | b <1 |.if MIPSR6 |. movop TMP2, TMP2, CRET1 |.else |. movop TMP2, r0, CRET1 |.endif |.endif | |4: // RA is a number, RD is not a number. | bne CARG4, TISNUM, ->vmeta_comp | // RA is a number, RD is an integer. Convert RD to a number. |.if FPU |. lwc1 FRD, LO(RD) | ldc1 FRA, 0(RA) | b <3 |. cvt.d.w FRD, FRD |.else |.if "ARGRD" == "CARG1" |. sextw CARG1, CARG1 | bal ->vm_sfi2d_1 |. nop |.else |. sextw CARG2, CARG2 | bal ->vm_sfi2d_2 |. nop |.endif | b <3 |. nop |.endif | |5: // RA is an integer, RD is not an integer | sltiu AT, CARG4, LJ_TISNUM | beqz AT, ->vmeta_comp |. lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) | // RA is an integer, RD is a number. Convert RA to a number. |.if FPU | lwc1 FRA, LO(RA) | ldc1 FRD, 0(RD) | b <3 | cvt.d.w FRA, FRA |.else |.if "ARGRA" == "CARG1" | bal ->vm_sfi2d_1 |. sextw CARG1, CARG1 |.else | bal ->vm_sfi2d_2 |. sextw CARG2, CARG2 |.endif | b <3 |. nop |.endif |.endmacro | |.if MIPSR6 if (op == BC_ISLT) { | bc_comp FTMP0, FTMP2, CARG1, CARG2, selnez, selnez, cmp.lt.d, ->vm_sfcmpolt } else if (op == BC_ISGE) { | bc_comp FTMP0, FTMP2, CARG1, CARG2, seleqz, seleqz, cmp.lt.d, ->vm_sfcmpolt } else if (op == BC_ISLE) { | bc_comp FTMP2, FTMP0, CARG2, CARG1, seleqz, seleqz, cmp.ult.d, ->vm_sfcmpult } else { | bc_comp FTMP2, FTMP0, CARG2, CARG1, selnez, selnez, cmp.ult.d, ->vm_sfcmpult } |.else if (op == BC_ISLT) { | bc_comp FTMP0, FTMP2, CARG1, CARG2, movz, movf, c.olt.d, ->vm_sfcmpolt } else if (op == BC_ISGE) { | bc_comp FTMP0, FTMP2, CARG1, CARG2, movn, movt, c.olt.d, ->vm_sfcmpolt } else if (op == BC_ISLE) { | bc_comp FTMP2, FTMP0, CARG2, CARG1, movn, movt, c.ult.d, ->vm_sfcmpult } else { | bc_comp FTMP2, FTMP0, CARG2, CARG1, movz, movf, c.ult.d, ->vm_sfcmpult } |.endif break; case BC_ISEQV: case BC_ISNEV: vk = op == BC_ISEQV; | // RA = src1*8, RD = src2*8, JMP with RD = target | daddu RA, BASE, RA | daddiu PC, PC, 4 | daddu RD, BASE, RD | ld CARG1, 0(RA) | lhu TMP2, -4+OFS_RD(PC) | ld CARG2, 0(RD) | gettp CARG3, CARG1 | gettp CARG4, CARG2 | sltu AT, TISNUM, CARG3 | sltu TMP1, TISNUM, CARG4 | or AT, AT, TMP1 if (vk) { | beqz AT, ->BC_ISEQN_Z } else { | beqz AT, ->BC_ISNEN_Z } | // Either or both types are not numbers. | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) |.if FFI |. li AT, LJ_TCDATA | beq CARG3, AT, ->vmeta_equal_cd |.endif | decode_RD4b TMP2 |.if FFI | beq CARG4, AT, ->vmeta_equal_cd |. nop |.endif | bne CARG1, CARG2, >2 |. addu TMP2, TMP2, TMP3 | // Tag and value are equal. if (vk) { |->BC_ISEQV_Z: | daddu PC, PC, TMP2 } |1: | ins_next | |2: // Check if the tags are the same and it's a table or userdata. | xor AT, CARG3, CARG4 // Same type? | sltiu TMP0, CARG3, LJ_TISTABUD+1 // Table or userdata? |.if MIPSR6 | seleqz TMP0, TMP0, AT |.else | movn TMP0, r0, AT |.endif if (vk) { | beqz TMP0, <1 } else { | beqz TMP0, ->BC_ISEQV_Z // Reuse code from opposite instruction. } | // Different tables or userdatas. Need to check __eq metamethod. | // Field metatable must be at same offset for GCtab and GCudata! |. cleartp TAB:TMP1, CARG1 | ld TAB:TMP3, TAB:TMP1->metatable if (vk) { | beqz TAB:TMP3, <1 // No metatable? |. nop | lbu TMP3, TAB:TMP3->nomm | andi TMP3, TMP3, 1<1 // Or 'no __eq' flag set? } else { | beqz TAB:TMP3,->BC_ISEQV_Z // No metatable? |. nop | lbu TMP3, TAB:TMP3->nomm | andi TMP3, TMP3, 1<BC_ISEQV_Z // Or 'no __eq' flag set? } |. nop | b ->vmeta_equal // Handle __eq metamethod. |. li TMP0, 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 | daddu RA, BASE, RA | daddiu PC, PC, 4 | ld CARG1, 0(RA) | dsubu RD, KBASE, RD | lhu TMP2, -4+OFS_RD(PC) | ld CARG2, -8(RD) // KBASE-8-str_const*8 |.if FFI | gettp TMP0, CARG1 | li AT, LJ_TCDATA |.endif | li TMP1, LJ_TSTR | decode_RD4b TMP2 |.if FFI | beq TMP0, AT, ->vmeta_equal_cd |.endif |. settp CARG2, TMP1 | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) | xor TMP1, CARG1, CARG2 | addu TMP2, TMP2, TMP3 |.if MIPSR6 if (vk) { | seleqz TMP2, TMP2, TMP1 } else { | selnez TMP2, TMP2, TMP1 } |.else if (vk) { | movn TMP2, r0, TMP1 } else { | movz TMP2, r0, TMP1 } |.endif | daddu 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 | daddu RA, BASE, RA | daddu RD, KBASE, RD | ld CARG1, 0(RA) | ld CARG2, 0(RD) | lhu TMP2, OFS_RD(PC) | gettp CARG3, CARG1 | gettp CARG4, CARG2 | daddiu PC, PC, 4 | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) if (vk) { |->BC_ISEQN_Z: } else { |->BC_ISNEN_Z: } | bne CARG3, TISNUM, >3 |. decode_RD4b TMP2 | bne CARG4, TISNUM, >6 |. addu TMP2, TMP2, TMP3 | xor AT, CARG1, CARG2 |.if MIPSR6 if (vk) { | seleqz TMP2, TMP2, AT |1: | daddu PC, PC, TMP2 |2: } else { | selnez TMP2, TMP2, AT |1: |2: | daddu PC, PC, TMP2 } |.else if (vk) { | movn TMP2, r0, AT |1: | daddu PC, PC, TMP2 |2: } else { | movz TMP2, r0, AT |1: |2: | daddu PC, PC, TMP2 } |.endif | ins_next | |3: // RA is not an integer. | sltu AT, CARG3, TISNUM |.if FFI | beqz AT, >8 |.else | beqz AT, <2 |.endif |. addu TMP2, TMP2, TMP3 | sltu AT, CARG4, TISNUM |.if FPU | ldc1 FTMP0, 0(RA) | ldc1 FTMP2, 0(RD) |.endif | beqz AT, >5 |. nop |4: // RA and RD are both numbers. |.if FPU |.if MIPSR6 | cmp.eq.d FTMP0, FTMP0, FTMP2 | dmfc1 TMP1, FTMP0 | b <1 if (vk) { |. selnez TMP2, TMP2, TMP1 } else { |. seleqz TMP2, TMP2, TMP1 } |.else | c.eq.d FTMP0, FTMP2 | b <1 if (vk) { |. movf TMP2, r0 } else { |. movt TMP2, r0 } |.endif |.else | bal ->vm_sfcmpeq |. nop | b <1 |.if MIPSR6 if (vk) { |. selnez TMP2, TMP2, CRET1 } else { |. seleqz TMP2, TMP2, CRET1 } |.else if (vk) { |. movz TMP2, r0, CRET1 } else { |. movn TMP2, r0, CRET1 } |.endif |.endif | |5: // RA is a number, RD is not a number. |.if FFI | bne CARG4, TISNUM, >9 |.else | bne CARG4, TISNUM, <2 |.endif | // RA is a number, RD is an integer. Convert RD to a number. |.if FPU |. lwc1 FTMP2, LO(RD) | b <4 |. cvt.d.w FTMP2, FTMP2 |.else |. sextw CARG2, CARG2 | bal ->vm_sfi2d_2 |. nop | b <4 |. nop |.endif | |6: // RA is an integer, RD is not an integer | sltu AT, CARG4, TISNUM |.if FFI | beqz AT, >9 |.else | beqz AT, <2 |.endif | // RA is an integer, RD is a number. Convert RA to a number. |.if FPU |. lwc1 FTMP0, LO(RA) | ldc1 FTMP2, 0(RD) | b <4 | cvt.d.w FTMP0, FTMP0 |.else |. sextw CARG1, CARG1 | bal ->vm_sfi2d_1 |. nop | b <4 |. nop |.endif | |.if FFI |8: | li AT, LJ_TCDATA | bne CARG3, AT, <2 |. nop | b ->vmeta_equal_cd |. nop |9: | li AT, LJ_TCDATA | bne CARG4, AT, <2 |. nop | b ->vmeta_equal_cd |. nop |.endif break; case BC_ISEQP: case BC_ISNEP: vk = op == BC_ISEQP; | // RA = src*8, RD = primitive_type*8 (~), JMP with RD = target | daddu RA, BASE, RA | srl TMP1, RD, 3 | ld TMP0, 0(RA) | lhu TMP2, OFS_RD(PC) | not TMP1, TMP1 | gettp TMP0, TMP0 | daddiu 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 MIPSR6 if (vk) { | seleqz TMP2, TMP2, TMP0 } else { | selnez TMP2, TMP2, TMP0 } |.else if (vk) { | movn TMP2, r0, TMP0 } else { | movz TMP2, r0, TMP0 } |.endif | daddu 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 | daddu RD, BASE, RD | lhu TMP2, OFS_RD(PC) | ld TMP0, 0(RD) | daddiu PC, PC, 4 | gettp TMP0, TMP0 | sltiu TMP0, TMP0, LJ_TISTRUECOND if (op == BC_IST || op == BC_ISF) { | decode_RD4b TMP2 | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) | addu TMP2, TMP2, TMP3 |.if MIPSR6 if (op == BC_IST) { | selnez TMP2, TMP2, TMP0; } else { | seleqz TMP2, TMP2, TMP0; } |.else if (op == BC_IST) { | movz TMP2, r0, TMP0 } else { | movn TMP2, r0, TMP0 } |.endif | daddu PC, PC, TMP2 } else { | ld CRET1, 0(RD) if (op == BC_ISTC) { | beqz TMP0, >1 } else { | bnez TMP0, >1 } |. daddu RA, BASE, RA | decode_RD4b TMP2 | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) | addu TMP2, TMP2, TMP3 | sd CRET1, 0(RA) | daddu PC, PC, TMP2 |1: } | ins_next break; case BC_ISTYPE: | // RA = src*8, RD = -type*8 | daddu TMP2, BASE, RA | srl TMP1, RD, 3 | ld TMP0, 0(TMP2) | ins_next1 | gettp TMP0, TMP0 | daddu AT, TMP0, TMP1 | bnez AT, ->vmeta_istype |. ins_next2 break; case BC_ISNUM: | // RA = src*8, RD = -(TISNUM-1)*8 | daddu TMP2, BASE, RA | ld TMP0, 0(TMP2) | ins_next1 | checknum TMP0, ->vmeta_istype |. ins_next2 break; /* -- Unary ops --------------------------------------------------------- */ case BC_MOV: | // RA = dst*8, RD = src*8 | daddu RD, BASE, RD | daddu RA, BASE, RA | ld CRET1, 0(RD) | ins_next1 | sd CRET1, 0(RA) | ins_next2 break; case BC_NOT: | // RA = dst*8, RD = src*8 | daddu RD, BASE, RD | daddu RA, BASE, RA | ld TMP0, 0(RD) | li AT, LJ_TTRUE | gettp TMP0, TMP0 | sltu TMP0, AT, TMP0 | addiu TMP0, TMP0, 1 | dsll TMP0, TMP0, 47 | not TMP0, TMP0 | ins_next1 | sd TMP0, 0(RA) | ins_next2 break; case BC_UNM: | // RA = dst*8, RD = src*8 | daddu RB, BASE, RD | ld CARG1, 0(RB) | daddu RA, BASE, RA | gettp CARG3, CARG1 | bne CARG3, TISNUM, >2 |. lui TMP1, 0x8000 | sextw CARG1, CARG1 | beq CARG1, TMP1, ->vmeta_unm // Meta handler deals with -2^31. |. negu CARG1, CARG1 | zextw CARG1, CARG1 | settp CARG1, TISNUM |1: | ins_next1 | sd CARG1, 0(RA) | ins_next2 |2: | sltiu AT, CARG3, LJ_TISNUM | beqz AT, ->vmeta_unm |. dsll TMP1, TMP1, 32 | b <1 |. xor CARG1, CARG1, TMP1 break; case BC_LEN: | // RA = dst*8, RD = src*8 | daddu CARG2, BASE, RD | daddu RA, BASE, RA | ld TMP0, 0(CARG2) | gettp TMP1, TMP0 | daddiu AT, TMP1, -LJ_TSTR | bnez AT, >2 |. cleartp STR:CARG1, TMP0 | lw CRET1, STR:CARG1->len |1: | settp CRET1, TISNUM | ins_next1 | sd CRET1, 0(RA) | ins_next2 |2: | daddiu AT, TMP1, -LJ_TTAB | bnez AT, ->vmeta_len |. nop #if LJ_52 | ld 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 fpmod, a, b, c | 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 sfpmod | daddiu sp, sp, -16 | | load_got __divdf3 | sd CARG1, 0(sp) | call_extern |. sd CARG2, 8(sp) | | load_got floor | call_extern |. move CARG1, CRET1 | | load_got __muldf3 | move CARG1, CRET1 | call_extern |. ld CARG2, 8(sp) | | load_got __subdf3 | ld CARG1, 0(sp) | call_extern |. move CARG2, CRET1 | | daddiu sp, sp, 16 |.endmacro |.macro ins_arithpre, label ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | // RA = dst*8, RB = src1*8, RC = src2*8 | num_const*8 ||switch (vk) { ||case 0: | decode_RB8a RB, INS | decode_RB8b RB | decode_RDtoRC8 RC, RD | // RA = dst*8, RB = src1*8, RC = num_const*8 | daddu RB, BASE, RB |.if "label" ~= "none" | b label |.endif |. daddu RC, KBASE, RC || break; ||case 1: | decode_RB8a RC, INS | decode_RB8b RC | decode_RDtoRC8 RB, RD | // RA = dst*8, RB = num_const*8, RC = src1*8 | daddu RC, BASE, RC |.if "label" ~= "none" | b label |.endif |. daddu RB, KBASE, RB || break; ||default: | decode_RB8a RB, INS | decode_RB8b RB | decode_RDtoRC8 RC, RD | // RA = dst*8, RB = src1*8, RC = src2*8 | daddu RB, BASE, RB |.if "label" ~= "none" | b label |.endif |. daddu RC, BASE, RC || break; ||} |.endmacro | |.macro ins_arith, intins, fpins, fpcall, label | ins_arithpre none | |.if "label" ~= "none" |label: |.endif | |// Used in 5. | ld CARG1, 0(RB) | ld CARG2, 0(RC) | gettp TMP0, CARG1 | gettp TMP1, CARG2 | |.if "intins" ~= "div" | | // Check for two integers. | sextw CARG3, CARG1 | bne TMP0, TISNUM, >5 |. sextw CARG4, CARG2 | bne TMP1, TISNUM, >5 | |.if "intins" == "addu" |. intins CRET1, CARG3, CARG4 | xor TMP1, CRET1, CARG3 // ((y^a) & (y^b)) < 0: overflow. | xor TMP2, CRET1, CARG4 | and TMP1, TMP1, TMP2 | bltz TMP1, ->vmeta_arith |. daddu RA, BASE, RA |.elif "intins" == "subu" |. intins CRET1, CARG3, CARG4 | xor TMP1, CRET1, CARG3 // ((y^a) & (a^b)) < 0: overflow. | xor TMP2, CARG3, CARG4 | and TMP1, TMP1, TMP2 | bltz TMP1, ->vmeta_arith |. daddu RA, BASE, RA |.elif "intins" == "mult" |.if MIPSR6 |. nop | mul CRET1, CARG3, CARG4 | muh TMP2, CARG3, CARG4 |.else |. intins CARG3, CARG4 | mflo CRET1 | mfhi TMP2 |.endif | sra TMP1, CRET1, 31 | bne TMP1, TMP2, ->vmeta_arith |. daddu RA, BASE, RA |.else |. load_got lj_vm_modi | beqz CARG4, ->vmeta_arith |. daddu RA, BASE, RA | move CARG1, CARG3 | call_extern |. move CARG2, CARG4 |.endif | | zextw CRET1, CRET1 | settp CRET1, TISNUM | ins_next1 | sd CRET1, 0(RA) |3: | ins_next2 | |.endif | |5: // Check for two numbers. | .FPU ldc1 FTMP0, 0(RB) | sltu AT, TMP0, TISNUM | sltu TMP0, TMP1, TISNUM | .FPU ldc1 FTMP2, 0(RC) | and AT, AT, TMP0 | beqz AT, ->vmeta_arith |. daddu RA, BASE, RA | |.if FPU | fpins FRET1, FTMP0, FTMP2 |.elif "fpcall" == "sfpmod" | sfpmod |.else | load_got fpcall | call_extern |. nop |.endif | | ins_next1 |.if "intins" ~= "div" | b <3 |.endif |.if FPU |. sdc1 FRET1, 0(RA) |.else |. sd CRET1, 0(RA) |.endif |.if "intins" == "div" | ins_next2 |.endif | |.endmacro case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: | ins_arith addu, add.d, __adddf3, none break; case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: | ins_arith subu, sub.d, __subdf3, none break; case BC_MULVN: case BC_MULNV: case BC_MULVV: | ins_arith mult, mul.d, __muldf3, none break; case BC_DIVVN: | ins_arith div, div.d, __divdf3, ->BC_DIVVN_Z break; case BC_DIVNV: case BC_DIVVV: | ins_arithpre ->BC_DIVVN_Z break; case BC_MODVN: | ins_arith modi, fpmod, sfpmod, ->BC_MODVN_Z break; case BC_MODNV: case BC_MODVV: | ins_arithpre ->BC_MODVN_Z break; case BC_POW: | ins_arithpre none | ld CARG1, 0(RB) | ld CARG2, 0(RC) | gettp TMP0, CARG1 | gettp TMP1, CARG2 | sltiu TMP0, TMP0, LJ_TISNUM | sltiu TMP1, TMP1, LJ_TISNUM | and AT, TMP0, TMP1 | load_got pow | beqz AT, ->vmeta_arith |. daddu RA, BASE, RA |.if FPU | ldc1 FARG1, 0(RB) | ldc1 FARG2, 0(RC) |.endif | call_extern |. nop | ins_next1 |.if FPU | sdc1 FRET1, 0(RA) |.else | sd CRET1, 0(RA) |.endif | 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 | dsubu CARG3, RC, RB | sd BASE, L->base | daddu CARG2, BASE, RC | move MULTRES, RB |->BC_CAT_Z: | load_got lj_meta_cat | srl CARG3, CARG3, 3 | sd 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 |. ld BASE, L->base | daddu RB, BASE, MULTRES | ld CRET1, 0(RB) | daddu RA, BASE, RA | ins_next1 | sd CRET1, 0(RA) | ins_next2 break; /* -- Constant ops ------------------------------------------------------ */ case BC_KSTR: | // RA = dst*8, RD = str_const*8 (~) | dsubu TMP1, KBASE, RD | ins_next1 | li TMP2, LJ_TSTR | ld TMP0, -8(TMP1) // KBASE-8-str_const*8 | daddu RA, BASE, RA | settp TMP0, TMP2 | sd TMP0, 0(RA) | ins_next2 break; case BC_KCDATA: |.if FFI | // RA = dst*8, RD = cdata_const*8 (~) | dsubu TMP1, KBASE, RD | ins_next1 | ld TMP0, -8(TMP1) // KBASE-8-cdata_const*8 | li TMP2, LJ_TCDATA | daddu RA, BASE, RA | settp TMP0, TMP2 | sd TMP0, 0(RA) | ins_next2 |.endif break; case BC_KSHORT: | // RA = dst*8, RD = int16_literal*8 | sra RD, INS, 16 | daddu RA, BASE, RA | zextw RD, RD | ins_next1 | settp RD, TISNUM | sd RD, 0(RA) | ins_next2 break; case BC_KNUM: | // RA = dst*8, RD = num_const*8 | daddu RD, KBASE, RD | daddu RA, BASE, RA | ld CRET1, 0(RD) | ins_next1 | sd CRET1, 0(RA) | ins_next2 break; case BC_KPRI: | // RA = dst*8, RD = primitive_type*8 (~) | daddu RA, BASE, RA | dsll TMP0, RD, 44 | not TMP0, TMP0 | ins_next1 | sd TMP0, 0(RA) | ins_next2 break; case BC_KNIL: | // RA = base*8, RD = end*8 | daddu RA, BASE, RA | sd TISNIL, 0(RA) | daddiu RA, RA, 8 | daddu RD, BASE, RD |1: | sd TISNIL, 0(RA) | slt AT, RA, RD | bnez AT, <1 |. daddiu RA, RA, 8 | ins_next_ break; /* -- Upvalue and function ops ------------------------------------------ */ case BC_UGET: | // RA = dst*8, RD = uvnum*8 | ld LFUNC:RB, FRAME_FUNC(BASE) | daddu RA, BASE, RA | cleartp LFUNC:RB | daddu RD, RD, LFUNC:RB | ld UPVAL:RB, LFUNC:RD->uvptr | ins_next1 | ld TMP1, UPVAL:RB->v | ld CRET1, 0(TMP1) | sd CRET1, 0(RA) | ins_next2 break; case BC_USETV: | // RA = uvnum*8, RD = src*8 | ld LFUNC:RB, FRAME_FUNC(BASE) | daddu RD, BASE, RD | cleartp LFUNC:RB | daddu RA, RA, LFUNC:RB | ld UPVAL:RB, LFUNC:RA->uvptr | ld CRET1, 0(RD) | lbu TMP3, UPVAL:RB->marked | ld CARG2, UPVAL:RB->v | andi TMP3, TMP3, LJ_GC_BLACK // isblack(uv) | lbu TMP0, UPVAL:RB->closed | gettp TMP2, CRET1 | sd CRET1, 0(CARG2) | li AT, LJ_GC_BLACK|1 | or TMP3, TMP3, TMP0 | beq TMP3, AT, >2 // Upvalue is closed and black? |. daddiu 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) |. cleartp GCOBJ:CRET1, CRET1 | lbu TMP3, GCOBJ:CRET1->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) |. daddiu CARG1, DISPATCH, GG_DISP2G | b <1 |. nop break; case BC_USETS: | // RA = uvnum*8, RD = str_const*8 (~) | ld LFUNC:RB, FRAME_FUNC(BASE) | dsubu TMP1, KBASE, RD | cleartp LFUNC:RB | daddu RA, RA, LFUNC:RB | ld UPVAL:RB, LFUNC:RA->uvptr | ld STR:TMP1, -8(TMP1) // KBASE-8-str_const*8 | lbu TMP2, UPVAL:RB->marked | ld 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 | settp TMP1, TMP0 | bnez AT, >2 |. sd TMP1, 0(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) |. daddiu CARG1, DISPATCH, GG_DISP2G | b <1 |. nop break; case BC_USETN: | // RA = uvnum*8, RD = num_const*8 | ld LFUNC:RB, FRAME_FUNC(BASE) | daddu RD, KBASE, RD | cleartp LFUNC:RB | daddu RA, RA, LFUNC:RB | ld UPVAL:RB, LFUNC:RA->uvptr | ld CRET1, 0(RD) | ld TMP1, UPVAL:RB->v | ins_next1 | sd CRET1, 0(TMP1) | ins_next2 break; case BC_USETP: | // RA = uvnum*8, RD = primitive_type*8 (~) | ld LFUNC:RB, FRAME_FUNC(BASE) | dsll TMP0, RD, 44 | cleartp LFUNC:RB | daddu RA, RA, LFUNC:RB | not TMP0, TMP0 | ld UPVAL:RB, LFUNC:RA->uvptr | ins_next1 | ld TMP1, UPVAL:RB->v | sd TMP0, 0(TMP1) | ins_next2 break; case BC_UCLO: | // RA = level*8, RD = target | ld TMP2, L->openupval | branch_RD // Do this first since RD is not saved. | load_got lj_func_closeuv | sd BASE, L->base | beqz TMP2, >1 |. move CARG1, L | call_intern lj_func_closeuv // (lua_State *L, TValue *level) |. daddu CARG2, BASE, RA | ld BASE, L->base |1: | ins_next break; case BC_FNEW: | // RA = dst*8, RD = proto_const*8 (~) (holding function prototype) | load_got lj_func_newL_gc | dsubu TMP1, KBASE, RD | ld CARG3, FRAME_FUNC(BASE) | ld CARG2, -8(TMP1) // KBASE-8-tab_const*8 | sd BASE, L->base | sd PC, SAVE_PC | cleartp CARG3 | // (lua_State *L, GCproto *pt, GCfuncL *parent) | call_intern lj_func_newL_gc |. move CARG1, L | // Returns GCfuncL *. | li TMP0, LJ_TFUNC | ld BASE, L->base | ins_next1 | settp CRET1, TMP0 | daddu RA, BASE, RA | sd CRET1, 0(RA) | ins_next2 break; /* -- Table ops --------------------------------------------------------- */ case BC_TNEW: case BC_TDUP: | // RA = dst*8, RD = (hbits|asize)*8 | tab_const*8 (~) | ld TMP0, DISPATCH_GL(gc.total)(DISPATCH) | ld TMP1, DISPATCH_GL(gc.threshold)(DISPATCH) | sd BASE, L->base | sd 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 |.if MIPSR6 | seleqz TMP0, TMP0, AT | selnez CARG2, CARG2, AT | or CARG2, CARG2, TMP0 |.else | movz CARG2, TMP0, AT |.endif | // (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 | dsubu TMP1, KBASE, RD | move CARG1, L | call_intern lj_tab_dup // (lua_State *L, Table *kt) |. ld CARG2, -8(TMP1) // KBASE-8-str_const*8 | // Returns Table *. } | li TMP0, LJ_TTAB | ld BASE, L->base | ins_next1 | daddu RA, BASE, RA | settp CRET1, TMP0 | sd CRET1, 0(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 (~) | ld LFUNC:TMP2, FRAME_FUNC(BASE) | dsubu TMP1, KBASE, RD | ld STR:RC, -8(TMP1) // KBASE-8-str_const*8 | cleartp LFUNC:TMP2 | ld TAB:RB, LFUNC:TMP2->env if (op == BC_GGET) { | b ->BC_TGETS_Z } else { | b ->BC_TSETS_Z } |. daddu 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 | daddu CARG2, BASE, RB | daddu CARG3, BASE, RC | ld TAB:RB, 0(CARG2) | ld TMP2, 0(CARG3) | daddu RA, BASE, RA | checktab TAB:RB, ->vmeta_tgetv | gettp TMP3, TMP2 | bne TMP3, TISNUM, >5 // Integer key? |. lw TMP0, TAB:RB->asize | sextw TMP2, TMP2 | ld TMP1, TAB:RB->array | sltu AT, TMP2, TMP0 | sll TMP2, TMP2, 3 | beqz AT, ->vmeta_tgetv // Integer key and in array part? |. daddu TMP2, TMP1, TMP2 | ld AT, 0(TMP2) | beq AT, TISNIL, >2 |. ld CRET1, 0(TMP2) |1: | ins_next1 | sd CRET1, 0(RA) | ins_next2 | |2: // Check for __index if table value is nil. | ld 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: | li AT, LJ_TSTR | bne TMP3, AT, ->vmeta_tgetv |. cleartp RC, TMP2 | b ->BC_TGETS_Z // String key? |. nop break; case BC_TGETS: | // RA = dst*8, RB = table*8, RC = str_const*8 (~) | decode_RB8a RB, INS | decode_RB8b RB | decode_RC8a RC, INS | daddu CARG2, BASE, RB | decode_RC8b RC | ld TAB:RB, 0(CARG2) | dsubu CARG3, KBASE, RC | daddu RA, BASE, RA | ld STR:RC, -8(CARG3) // KBASE-8-str_const*8 | checktab TAB:RB, ->vmeta_tgets1 |->BC_TGETS_Z: | // TAB:RB = GCtab *, STR:RC = GCstr *, RA = dst*8 | lw TMP0, TAB:RB->hmask | lw TMP1, STR:RC->sid | ld NODE:TMP2, TAB:RB->node | and TMP1, TMP1, TMP0 // idx = str->sid & tab->hmask | sll TMP0, TMP1, 5 | sll TMP1, TMP1, 3 | subu TMP1, TMP0, TMP1 | li TMP3, LJ_TSTR | daddu NODE:TMP2, NODE:TMP2, TMP1 // node = tab->node + (idx*32-idx*8) | settp STR:RC, TMP3 // Tagged key to look for. |1: | ld CARG1, NODE:TMP2->key | ld CRET1, NODE:TMP2->val | ld NODE:TMP1, NODE:TMP2->next | bne CARG1, RC, >4 |. ld TAB:TMP3, TAB:RB->metatable | beq CRET1, TISNIL, >5 // Key found, but nil value? |. nop |3: | ins_next1 | sd CRET1, 0(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. |. move CRET1, TISNIL | 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 | daddu CARG2, BASE, RB | decode_RDtoRC8 RC, RD | ld TAB:RB, 0(CARG2) | daddu RA, BASE, RA | srl TMP0, RC, 3 | checktab TAB:RB, ->vmeta_tgetb | lw TMP1, TAB:RB->asize | ld TMP2, TAB:RB->array | sltu AT, TMP0, TMP1 | beqz AT, ->vmeta_tgetb |. daddu RC, TMP2, RC | ld AT, 0(RC) | beq AT, TISNIL, >5 |. ld CRET1, 0(RC) |1: | ins_next1 | sd CRET1, 0(RA) | ins_next2 | |5: // Check for __index if table value is nil. | ld 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 and CARG2! |. nop break; case BC_TGETR: | // RA = dst*8, RB = table*8, RC = key*8 | decode_RB8a RB, INS | decode_RB8b RB | decode_RDtoRC8 RC, RD | daddu RB, BASE, RB | daddu RC, BASE, RC | ld TAB:CARG1, 0(RB) | lw CARG2, LO(RC) | daddu RA, BASE, RA | cleartp TAB:CARG1 | lw TMP0, TAB:CARG1->asize | ld TMP1, TAB:CARG1->array | sltu AT, CARG2, TMP0 | sll TMP2, CARG2, 3 | beqz AT, ->vmeta_tgetr // In array part? |. daddu CRET1, TMP1, TMP2 | ld CARG2, 0(CRET1) |->BC_TGETR_Z: | ins_next1 | sd CARG2, 0(RA) | ins_next2 break; case BC_TSETV: | // RA = src*8, RB = table*8, RC = key*8 | decode_RB8a RB, INS | decode_RB8b RB | decode_RDtoRC8 RC, RD | daddu CARG2, BASE, RB | daddu CARG3, BASE, RC | ld RB, 0(CARG2) | ld TMP2, 0(CARG3) | daddu RA, BASE, RA | checktab RB, ->vmeta_tsetv | checkint TMP2, >5 |. sextw RC, TMP2 | lw TMP0, TAB:RB->asize | ld TMP1, TAB:RB->array | sltu AT, RC, TMP0 | sll TMP2, RC, 3 | beqz AT, ->vmeta_tsetv // Integer key and in array part? |. daddu TMP1, TMP1, TMP2 | ld TMP0, 0(TMP1) | lbu TMP3, TAB:RB->marked | beq TMP0, TISNIL, >3 |. ld CRET1, 0(RA) |1: | andi AT, TMP3, LJ_GC_BLACK // isblack(table) | bnez AT, >7 |. sd CRET1, 0(TMP1) |2: | ins_next | |3: // Check for __newindex if previous value is nil. | ld 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: | gettp AT, TMP2 | daddiu AT, AT, -LJ_TSTR | bnez AT, ->vmeta_tsetv |. nop | b ->BC_TSETS_Z // String key? |. cleartp STR:RC, TMP2 | |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 | daddu CARG2, BASE, RB | decode_RC8a RC, INS | ld TAB:RB, 0(CARG2) | decode_RC8b RC | dsubu CARG3, KBASE, RC | ld RC, -8(CARG3) // KBASE-8-str_const*8 | daddu RA, BASE, RA | cleartp STR:RC | checktab TAB:RB, ->vmeta_tsets1 |->BC_TSETS_Z: | // TAB:RB = GCtab *, STR:RC = GCstr *, RA = BASE+src*8 | lw TMP0, TAB:RB->hmask | lw TMP1, STR:RC->sid | ld NODE:TMP2, TAB:RB->node | sb r0, TAB:RB->nomm // Clear metamethod cache. | and TMP1, TMP1, TMP0 // idx = str->sid & tab->hmask | sll TMP0, TMP1, 5 | sll TMP1, TMP1, 3 | subu TMP1, TMP0, TMP1 | li TMP3, LJ_TSTR | daddu NODE:TMP2, NODE:TMP2, TMP1 // node = tab->node + (idx*32-idx*8) | settp STR:RC, TMP3 // Tagged key to look for. |.if FPU | ldc1 FTMP0, 0(RA) |.else | ld CRET1, 0(RA) |.endif |1: | ld TMP0, NODE:TMP2->key | ld CARG2, NODE:TMP2->val | ld NODE:TMP1, NODE:TMP2->next | bne TMP0, RC, >5 |. lbu TMP3, TAB:RB->marked | beq CARG2, TISNIL, >4 // Key found, but nil value? |. ld TAB:TMP0, TAB:RB->metatable |2: | andi AT, TMP3, LJ_GC_BLACK // isblack(table) | bnez AT, >7 |.if FPU |. sdc1 FTMP0, NODE:TMP2->val |.else |. sd CRET1, NODE:TMP2->val |.endif |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. | ld TAB:TMP2, TAB:RB->metatable | beqz TAB:TMP2, >6 // No metatable: continue. |. daddiu CARG3, DISPATCH, DISPATCH_GL(tmptv) | lbu TMP0, TAB:TMP2->nomm | andi TMP0, TMP0, 1<vmeta_tsets // 'no __newindex' flag NOT set: check. |6: | load_got lj_tab_newkey | sd RC, 0(CARG3) | sd BASE, L->base | move CARG2, TAB:RB | sd PC, SAVE_PC | call_intern lj_tab_newkey // (lua_State *L, GCtab *t, TValue *k |. move CARG1, L | // Returns TValue *. | ld BASE, L->base |.if FPU | b <3 // No 2nd write barrier needed. |. sdc1 FTMP0, 0(CRET1) |.else | ld CARG1, 0(RA) | b <3 // No 2nd write barrier needed. |. sd CARG1, 0(CRET1) |.endif | |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 | daddu CARG2, BASE, RB | decode_RDtoRC8 RC, RD | ld TAB:RB, 0(CARG2) | daddu RA, BASE, RA | srl TMP0, RC, 3 | checktab RB, ->vmeta_tsetb | lw TMP1, TAB:RB->asize | ld TMP2, TAB:RB->array | sltu AT, TMP0, TMP1 | beqz AT, ->vmeta_tsetb |. daddu RC, TMP2, RC | ld TMP1, 0(RC) | lbu TMP3, TAB:RB->marked | beq TMP1, TISNIL, >5 |1: |. ld CRET1, 0(RA) | andi AT, TMP3, LJ_GC_BLACK // isblack(table) | bnez AT, >7 |. sd CRET1, 0(RC) |2: | ins_next | |5: // Check for __newindex if previous value is nil. | ld 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 and CARG2! |. nop | |7: // Possible table write barrier for the value. Skip valiswhite check. | barrierback TAB:RB, TMP3, TMP0, <2 break; case BC_TSETR: | // RA = dst*8, RB = table*8, RC = key*8 | decode_RB8a RB, INS | decode_RB8b RB | decode_RDtoRC8 RC, RD | daddu CARG1, BASE, RB | daddu CARG3, BASE, RC | ld TAB:CARG2, 0(CARG1) | lw CARG3, LO(CARG3) | cleartp TAB:CARG2 | lbu TMP3, TAB:CARG2->marked | lw TMP0, TAB:CARG2->asize | ld TMP1, TAB:CARG2->array | andi AT, TMP3, LJ_GC_BLACK // isblack(table) | bnez AT, >7 |. daddu RA, BASE, RA |2: | sltu AT, CARG3, TMP0 | sll TMP2, CARG3, 3 | beqz AT, ->vmeta_tsetr // In array part? |. daddu CRET1, TMP1, TMP2 |->BC_TSETR_Z: | ld CARG1, 0(RA) | ins_next1 | sd CARG1, 0(CRET1) | ins_next2 | |7: // Possible table write barrier for the value. Skip valiswhite check. | barrierback TAB:CARG2, TMP3, CRET1, <2 break; case BC_TSETM: | // RA = base*8 (table at base-1), RD = num_const*8 (start index) | daddu RA, BASE, RA |1: | daddu TMP3, KBASE, RD | ld TAB:CARG2, -8(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 | cleartp CARG2 | addu CARG3, CARG3, TMP3 | lw TMP2, TAB:CARG2->asize | sll TMP1, TMP3, 3 | lbu TMP3, TAB:CARG2->marked | ld CARG1, TAB:CARG2->array | sltu AT, TMP2, CARG3 | bnez AT, >5 |. daddu TMP2, RA, TMP0 | daddu TMP1, TMP1, CARG1 | andi TMP0, TMP3, LJ_GC_BLACK // isblack(table) |3: // Copy result slots to table. | ld CRET1, 0(RA) | daddiu RA, RA, 8 | sltu AT, RA, TMP2 | sd CRET1, 0(TMP1) | bnez AT, <3 |. daddiu TMP1, TMP1, 8 | bnez TMP0, >7 |. nop |4: | ins_next | |5: // Need to resize array part. | load_got lj_tab_reasize | sd BASE, L->base | sd 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 |. ld 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 | daddu BASE, BASE, RA | ld LFUNC:RB, 0(BASE) | daddiu BASE, BASE, 16 | addiu NARGS8:RC, NARGS8:RC, -8 | checkfunc RB, ->vmeta_call | 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 | daddu RA, BASE, RA | ld RB, 0(RA) | move NARGS8:RC, RD | ld TMP1, FRAME_PC(BASE) | daddiu RA, RA, 16 | addiu NARGS8:RC, NARGS8:RC, -8 | checktp CARG3, RB, -LJ_TFUNC, ->vmeta_callt |->BC_CALLT_Z: | andi TMP0, TMP1, FRAME_TYPE // Caveat: preserve TMP0 until the 'or'. | lbu TMP3, LFUNC:CARG3->ffid | bnez TMP0, >7 |. xori TMP2, TMP1, FRAME_VARG |1: | sd RB, FRAME_FUNC(BASE) // Copy function down, but keep PC. | sltiu AT, TMP3, 2 // (> FF_C) Calling a fast function? | move TMP2, BASE | move RB, CARG3 | beqz NARGS8:RC, >3 |. move TMP3, NARGS8:RC |2: | ld CRET1, 0(RA) | daddiu RA, RA, 8 | addiu TMP3, TMP3, -8 | sd CRET1, 0(TMP2) | bnez TMP3, <2 |. daddiu 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 | dsubu TMP1, BASE, RA | ld TMP1, -32(TMP1) | cleartp LFUNC:TMP1 | ld TMP1, LFUNC:TMP1->pc | b <4 |. ld 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? |. dsubu TMP2, BASE, TMP2 // Relocate BASE down. | move BASE, TMP2 | ld 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 // Save old BASE fir vmeta_call. | daddu BASE, BASE, RA | ld RB, -24(BASE) | ld CARG1, -16(BASE) | ld CARG2, -8(BASE) | li NARGS8:RC, 16 // Iterators get 2 arguments. | sd RB, 0(BASE) // Copy callable. | sd CARG1, 16(BASE) // Copy state. | sd CARG2, 24(BASE) // Copy control var. | daddiu BASE, BASE, 16 | checkfunc RB, ->vmeta_call | ins_call break; case BC_ITERN: |.if JIT and ENDIAN_LE | hotloop |.endif |->vm_IITERN: | // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 (2+1)*8) | daddu RA, BASE, RA | ld TAB:RB, -16(RA) | lw RC, -8+LO(RA) // Get index from control var. | cleartp TAB:RB | daddiu PC, PC, 4 | lw TMP0, TAB:RB->asize | ld TMP1, TAB:RB->array | dsll CARG3, TISNUM, 47 |1: // Traverse array part. | sltu AT, RC, TMP0 | beqz AT, >5 // Index points after array part? |. sll TMP3, RC, 3 | daddu TMP3, TMP1, TMP3 | ld CARG1, 0(TMP3) | lhu RD, -4+OFS_RD(PC) | or TMP2, RC, CARG3 | beq CARG1, TISNIL, <1 // Skip holes in array part. |. addiu RC, RC, 1 | sd TMP2, 0(RA) | sd CARG1, 8(RA) | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) | decode_RD4b RD | daddu RD, RD, TMP3 | sw RC, -8+LO(RA) // Update control var. | daddu PC, PC, RD |3: | ins_next | |5: // Traverse hash part. | lw TMP1, TAB:RB->hmask | subu RC, RC, TMP0 | ld 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 | daddu NODE:TMP3, TMP3, TMP2 | ld CARG1, 0(NODE:TMP3) | lhu RD, -4+OFS_RD(PC) | beq CARG1, TISNIL, <6 // Skip holes in hash part. |. addiu RC, RC, 1 | ld CARG2, NODE:TMP3->key | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) | sd CARG1, 8(RA) | addu RC, RC, TMP0 | decode_RD4b RD | addu RD, RD, TMP3 | sd CARG2, 0(RA) | daddu 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) | daddu RA, BASE, RA | srl TMP0, RD, 1 | ld CFUNC:CARG1, -24(RA) | daddu TMP0, PC, TMP0 | ld CARG2, -16(RA) | ld CARG3, -8(RA) | lui TMP2, (-(BCBIAS_J*4 >> 16) & 65535) | checkfunc CFUNC:CARG1, >5 | gettp CARG2, CARG2 | daddiu CARG2, CARG2, -LJ_TTAB | lbu TMP1, CFUNC:CARG1->ffid | daddiu CARG3, CARG3, -LJ_TNIL | or AT, CARG2, CARG3 | daddiu TMP1, TMP1, -FF_next_N | or AT, AT, TMP1 | bnez AT, >5 |. lui TMP1, (LJ_KEYINDEX >> 16) | daddu PC, TMP0, TMP2 | ori TMP1, TMP1, (LJ_KEYINDEX & 0xffff) | dsll TMP1, TMP1, 32 | sd TMP1, -8(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) | daddu PC, TMP0, TMP2 |.if JIT | lb TMP0, OFS_OP(PC) | li AT, BC_ITERN | bne TMP0, AT, >6 |. lhu TMP2, OFS_RD(PC) |.endif | b <1 |. sb TMP1, OFS_OP(PC) |.if JIT |6: // Unpatch JLOOP. | ld TMP0, DISPATCH_J(trace)(DISPATCH) | sll TMP2, TMP2, 3 | daddu TMP0, TMP0, TMP2 | ld TRACE:TMP2, 0(TMP0) | lw TMP0, TRACE:TMP2->startins | li AT, -256 | and TMP0, TMP0, AT | or TMP0, TMP0, TMP1 | b <1 |. sw TMP0, 0(PC) |.endif break; case BC_VARG: | // RA = base*8, RB = (nresults+1)*8, RC = numparams*8 | ld TMP0, FRAME_PC(BASE) | decode_RDtoRC8 RC, RD | decode_RB8a RB, INS | daddu RC, BASE, RC | decode_RB8b RB | daddu RA, BASE, RA | daddiu RC, RC, FRAME_VARG | daddu TMP2, RA, RB | daddiu TMP3, BASE, -16 // TMP3 = vtop | dsubu RC, RC, TMP0 // RC = vbase | // Note: RC may now be even _above_ BASE if nargs was < numparams. | beqz RB, >5 // Copy all varargs? |. dsubu TMP1, TMP3, RC | daddiu TMP2, TMP2, -16 |1: // Copy vararg slots to destination slots. | ld CARG1, 0(RC) | sltu AT, RC, TMP3 | daddiu RC, RC, 8 |.if MIPSR6 | selnez CARG1, CARG1, AT | seleqz AT, TISNIL, AT | or CARG1, CARG1, AT |.else | movz CARG1, TISNIL, AT |.endif | sd CARG1, 0(RA) | sltu AT, RA, TMP2 | bnez AT, <1 |. daddiu RA, RA, 8 |3: | ins_next | |5: // Copy all varargs. | ld TMP0, L->maxstack | blez TMP1, <3 // No vararg slots? |. li MULTRES, 8 // MULTRES = (0+1)*8 | daddu TMP2, RA, TMP1 | sltu AT, TMP0, TMP2 | bnez AT, >7 |. daddiu MULTRES, TMP1, 8 |6: | ld CRET1, 0(RC) | daddiu RC, RC, 8 | sd CRET1, 0(RA) | sltu AT, RC, TMP3 | bnez AT, <6 // More vararg slots? |. daddiu RA, RA, 8 | b <3 |. nop | |7: // Grow stack for varargs. | load_got lj_state_growstack | sd RA, L->top | dsubu RA, RA, BASE | sd BASE, L->base | dsubu BASE, RC, BASE // Need delta, because BASE may change. | sd PC, SAVE_PC | srl CARG2, TMP1, 3 | call_intern lj_state_growstack // (lua_State *L, int n) |. move CARG1, L | move RC, BASE | ld BASE, L->base | daddu RA, BASE, RA | daddu RC, BASE, RC | b <6 |. daddiu TMP3, BASE, -16 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 | ld PC, FRAME_PC(BASE) | daddu 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) | daddiu TMP2, BASE, -16 | daddiu RC, RD, -8 | decode_RA8a TMP0, INS | decode_RB8a RB, INS | decode_RA8b TMP0 | decode_RB8b RB | daddu TMP3, TMP2, RB | beqz RC, >3 |. dsubu BASE, TMP2, TMP0 |2: | ld CRET1, 0(RA) | daddiu RA, RA, 8 | daddiu RC, RC, -8 | sd CRET1, 0(TMP2) | bnez RC, <2 |. daddiu TMP2, TMP2, 8 |3: | daddiu TMP3, TMP3, -8 |5: | sltu AT, TMP2, TMP3 | bnez AT, >6 |. ld LFUNC:TMP1, FRAME_FUNC(BASE) | ins_next1 | cleartp LFUNC:TMP1 | ld TMP1, LFUNC:TMP1->pc | ld KBASE, PC2PROTO(k)(TMP1) | ins_next2 | |6: // Fill up results with nil. | sd TISNIL, 0(TMP2) | b <5 |. daddiu 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. | dsubu BASE, BASE, TMP1 | b <1 |. ld PC, FRAME_PC(BASE) break; case BC_RET0: case BC_RET1: | // RA = results*8, RD = (nresults+1)*8 | ld PC, FRAME_PC(BASE) | daddu 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) | daddiu TMP2, BASE, -16 if (op == BC_RET1) { | ld CRET1, 0(RA) } | decode_RB8a RB, INS | decode_RA8a RA, INS | decode_RB8b RB | decode_RA8b RA | dsubu BASE, TMP2, RA if (op == BC_RET1) { | sd CRET1, 0(TMP2) } |5: | sltu AT, RD, RB | bnez AT, >6 |. ld TMP1, FRAME_FUNC(BASE) | ins_next1 | cleartp LFUNC:TMP1 | ld TMP1, LFUNC:TMP1->pc | ld KBASE, PC2PROTO(k)(TMP1) | ins_next2 | |6: // Fill up results with nil. | daddiu TMP2, TMP2, 8 | daddiu RD, RD, 8 | b <5 if (op == BC_RET1) { |. sd TISNIL, 0(TMP2) } else { |. sd TISNIL, -8(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); | daddu RA, BASE, RA | ld CARG1, FORL_IDX*8(RA) // IDX CARG1 - CARG3 type | gettp CARG3, CARG1 if (op != BC_JFORL) { | srl RD, RD, 1 | lui TMP2, (-(BCBIAS_J*4 >> 16) & 65535) | daddu TMP2, RD, TMP2 } if (!vk) { | ld CARG2, FORL_STOP*8(RA) // STOP CARG2 - CARG4 type | ld CRET1, FORL_STEP*8(RA) // STEP CRET1 - CRET2 type | gettp CARG4, CARG2 | bne CARG3, TISNUM, >5 |. gettp CRET2, CRET1 | bne CARG4, TISNUM, ->vmeta_for |. sextw CARG3, CARG1 | bne CRET2, TISNUM, ->vmeta_for |. sextw CARG2, CARG2 | dext AT, CRET1, 31, 0 | slt CRET1, CARG2, CARG3 | slt TMP1, CARG3, CARG2 |.if MIPSR6 | selnez TMP1, TMP1, AT | seleqz CRET1, CRET1, AT | or CRET1, CRET1, TMP1 |.else | movn CRET1, TMP1, AT |.endif } else { | bne CARG3, TISNUM, >5 |. ld CARG2, FORL_STEP*8(RA) // STEP CARG2 - CARG4 type | ld CRET1, FORL_STOP*8(RA) // STOP CRET1 - CRET2 type | sextw TMP3, CARG1 | sextw CARG2, CARG2 | sextw CRET1, CRET1 | addu CARG1, TMP3, CARG2 | xor TMP0, CARG1, TMP3 | xor TMP1, CARG1, CARG2 | and TMP0, TMP0, TMP1 | slt TMP1, CARG1, CRET1 | slt CRET1, CRET1, CARG1 | slt AT, CARG2, r0 | slt TMP0, TMP0, r0 // ((y^a) & (y^b)) < 0: overflow. |.if MIPSR6 | selnez TMP1, TMP1, AT | seleqz CRET1, CRET1, AT | or CRET1, CRET1, TMP1 |.else | movn CRET1, TMP1, AT |.endif | or CRET1, CRET1, TMP0 | zextw CARG1, CARG1 | settp CARG1, TISNUM } |1: if (op == BC_FORI) { |.if MIPSR6 | selnez TMP2, TMP2, CRET1 |.else | movz TMP2, r0, CRET1 |.endif | daddu PC, PC, TMP2 } else if (op == BC_JFORI) { | daddu PC, PC, TMP2 | lhu RD, -4+OFS_RD(PC) } else if (op == BC_IFORL) { |.if MIPSR6 | seleqz TMP2, TMP2, CRET1 |.else | movn TMP2, r0, CRET1 |.endif | daddu PC, PC, TMP2 } if (vk) { | sd CARG1, FORL_IDX*8(RA) } | ins_next1 | sd CARG1, FORL_EXT*8(RA) |2: if (op == BC_JFORI) { | beqz CRET1, =>BC_JLOOP |. decode_RD8b RD } else if (op == BC_JFORL) { | beqz CRET1, =>BC_JLOOP } | ins_next2 | |5: // FP loop. |.if FPU if (!vk) { | ldc1 f0, FORL_IDX*8(RA) | ldc1 f2, FORL_STOP*8(RA) | sltiu TMP0, CARG3, LJ_TISNUM | sltiu TMP1, CARG4, LJ_TISNUM | sltiu AT, CRET2, LJ_TISNUM | ld TMP3, FORL_STEP*8(RA) | and TMP0, TMP0, TMP1 | and AT, AT, TMP0 | beqz AT, ->vmeta_for |. slt TMP3, TMP3, r0 |.if MIPSR6 | dmtc1 TMP3, FTMP2 | cmp.lt.d FTMP0, f0, f2 | cmp.lt.d FTMP1, f2, f0 | sel.d FTMP2, FTMP1, FTMP0 | b <1 |. dmfc1 CRET1, FTMP2 |.else | c.ole.d 0, f0, f2 | c.ole.d 1, f2, f0 | li CRET1, 1 | movt CRET1, r0, 0 | movt AT, r0, 1 | b <1 |. movn CRET1, AT, TMP3 |.endif } else { | ldc1 f0, FORL_IDX*8(RA) | ldc1 f4, FORL_STEP*8(RA) | ldc1 f2, FORL_STOP*8(RA) | ld TMP3, FORL_STEP*8(RA) | add.d f0, f0, f4 |.if MIPSR6 | slt TMP3, TMP3, r0 | dmtc1 TMP3, FTMP2 | cmp.lt.d FTMP0, f0, f2 | cmp.lt.d FTMP1, f2, f0 | sel.d FTMP2, FTMP1, FTMP0 | dmfc1 CRET1, FTMP2 if (op == BC_IFORL) { | seleqz TMP2, TMP2, CRET1 | daddu PC, PC, TMP2 } |.else | c.ole.d 0, f0, f2 | c.ole.d 1, f2, f0 | slt TMP3, TMP3, r0 | li CRET1, 1 | li AT, 1 | movt CRET1, r0, 0 | movt AT, r0, 1 | movn CRET1, AT, TMP3 if (op == BC_IFORL) { | movn TMP2, r0, CRET1 | daddu PC, PC, TMP2 } |.endif | sdc1 f0, FORL_IDX*8(RA) | ins_next1 | b <2 |. sdc1 f0, FORL_EXT*8(RA) } |.else if (!vk) { | sltiu TMP0, CARG3, LJ_TISNUM | sltiu TMP1, CARG4, LJ_TISNUM | sltiu AT, CRET2, LJ_TISNUM | and TMP0, TMP0, TMP1 | and AT, AT, TMP0 | beqz AT, ->vmeta_for |. nop | bal ->vm_sfcmpolex |. lw TMP3, FORL_STEP*8+HI(RA) | b <1 |. nop } else { | load_got __adddf3 | call_extern |. sw TMP2, TMPD | ld CARG2, FORL_STOP*8(RA) | move CARG1, CRET1 if ( op == BC_JFORL ) { | lhu RD, -4+OFS_RD(PC) | decode_RD8b RD } | bal ->vm_sfcmpolex |. lw TMP3, FORL_STEP*8+HI(RA) | b <1 |. lw TMP2, TMPD } |.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, RD = target | daddu RA, BASE, RA | ld TMP1, 0(RA) | beq TMP1, TISNIL, >1 // Stop if iterator returned nil. |. nop if (op == BC_JITERL) { | b =>BC_JLOOP |. sd TMP1, -8(RA) } else { | branch_RD // Otherwise save control var + branch. | sd TMP1, -8(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 | ld TMP1, DISPATCH_J(trace)(DISPATCH) | li AT, 0 | daddu TMP1, TMP1, RD | // Traces on MIPS don't store the trace number, so use 0. | sd AT, DISPATCH_GL(vmstate)(DISPATCH) | ld TRACE:TMP2, 0(TMP1) | sd BASE, DISPATCH_GL(jit_base)(DISPATCH) | ld TMP2, TRACE:TMP2->mcode | sd L, DISPATCH_GL(tmpbuf.L)(DISPATCH) | jr TMP2 |. daddiu 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 | ld TMP2, L->maxstack | lbu TMP1, -4+PC2PROTO(numparams)(PC) | ld 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 |. daddu 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. | sd TISNIL, 0(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 | li TMP0, LJ_TFUNC | daddu TMP1, BASE, RC | ld TMP2, L->maxstack | settp LFUNC:RB, TMP0 | daddu TMP0, RA, RC | sd LFUNC:RB, 0(TMP1) // Store (tagged) copy of LFUNC. | daddiu TMP2, TMP2, -8 | daddiu TMP3, RC, 16+FRAME_VARG | sltu AT, TMP0, TMP2 | ld KBASE, -4+PC2PROTO(k)(PC) | beqz AT, ->vm_growstack_l |. sd TMP3, 8(TMP1) // Store delta + FRAME_VARG. | lbu TMP2, -4+PC2PROTO(numparams)(PC) | move RA, BASE | move RC, TMP1 | ins_next1 | beqz TMP2, >3 |. daddiu BASE, TMP1, 16 |1: | ld TMP0, 0(RA) | sltu AT, RA, RC // Less args than parameters? | move CARG1, TMP0 |.if MIPSR6 | selnez TMP0, TMP0, AT | seleqz TMP3, TISNIL, AT | or TMP0, TMP0, TMP3 | seleqz TMP3, CARG1, AT | selnez CARG1, TISNIL, AT | or CARG1, CARG1, TMP3 |.else | movz TMP0, TISNIL, AT // Clear missing parameters. | movn CARG1, TISNIL, AT // Clear old fixarg slot (help the GC). |.endif | addiu TMP2, TMP2, -1 | sd TMP0, 16(TMP1) | daddiu TMP1, TMP1, 8 | sd CARG1, 0(RA) | bnez TMP2, <1 |. daddiu 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) { | ld CFUNCADDR, CFUNC:RB->f } else { | ld CFUNCADDR, DISPATCH_GL(wrapf)(DISPATCH) } | daddu TMP1, RA, NARGS8:RC | ld TMP2, L->maxstack | daddu RC, BASE, NARGS8:RC | sd BASE, L->base | sltu AT, TMP2, TMP1 | sd RC, L->top | li_vmstate C if (op == BC_FUNCCW) { | ld 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. | ld BASE, L->base | sll RD, CRET1, 3 | ld TMP1, L->top | li_vmstate INTERP | ld PC, FRAME_PC(BASE) // Fetch PC of caller. | dsubu RA, TMP1, RD // RA = L->top - nresults*8 | sd L, DISPATCH_GL(cur_L)(DISPATCH) | 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.8byte .Lbegin\n" "\t.8byte %d\n" "\t.byte 0xe\n\t.uleb128 %d\n" "\t.byte 0x9f\n\t.sleb128 2*5\n" "\t.byte 0x9e\n\t.sleb128 2*6\n", fcofs, CFRAME_SIZE); for (i = 23; i >= 16; i--) fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+i, 2*(30-i)); #if !LJ_SOFTFP for (i = 31; i >= 24; i--) fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+32+i, 2*(46-i)); #endif 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 2*1\n" "\t.byte 0x90\n\t.uleb128 2*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 /* NYI */ #endif break; default: break; } } subprojects/luajit/src/lj_cconv.h0000644000175000017500000000406514741067622016452 0ustar aniolaniol/* ** C type conversions. ** Copyright (C) 2005-2023 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. */ lj_assertX(ctype_type(info) <= CT_MAYCONVERT, "cannot convert ctype %08x", info); #if LJ_64 idx = ((uint32_t)(U64x(f436fff5,fff7f021) >> 4*idx) & 15u); #else idx = (((idx < 8 ? 0xfff7f021u : 0xf436fff5) >> 4*(idx & 7u)) & 15u); #endif lj_assertX(idx < 8, "cannot convert ctype %08x", info); 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 subprojects/luajit/src/lj_func.h0000644000175000017500000000141014741067622016264 0ustar aniolaniol/* ** Function handling (prototypes, functions and upvalues). ** Copyright (C) 2005-2023 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 subprojects/luajit/src/luajit_relver.txt.in0000644000175000017500000000001114741067416020505 0ustar aniolaniol@VCS_CT@ subprojects/luajit/src/ps4build.bat0000644000175000017500000000766614741067622016734 0ustar aniolaniol@rem Script to build LuaJIT with the PS4 SDK. @rem Donated to the public domain. @rem @rem Open a "Visual Studio .NET Command Prompt" (64 bit host compiler) @rem or "VS2015 x64 Native Tools Command Prompt". @rem @rem Then cd to this directory and run this script. @rem @rem Recommended invocation: @rem @rem ps4build release build, amalgamated, 64-bit GC @rem ps4build debug debug build, amalgamated, 64-bit GC @rem @rem Additional command-line options (not generally recommended): @rem @rem gc32 (before debug) 32-bit GC @rem noamalg (after debug) non-amalgamated build @if not defined INCLUDE goto :FAIL @if not defined SCE_ORBIS_SDK_DIR goto :FAIL @setlocal @rem ---- Host compiler ---- @set LJCOMPILE=cl /nologo /c /MD /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE @set LJLINK=link /nologo @set LJMT=mt /nologo @set DASMDIR=..\dynasm @set DASM=%DASMDIR%\dynasm.lua @set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c lib_buffer.c @set GC64= @set DASC=vm_x64.dasc @if "%1" neq "gc32" goto :NOGC32 @shift @set GC64=-DLUAJIT_DISABLE_GC64 @set DASC=vm_x86.dasc :NOGC32 %LJCOMPILE% host\minilua.c @if errorlevel 1 goto :BAD %LJLINK% /out:minilua.exe minilua.obj @if errorlevel 1 goto :BAD if exist minilua.exe.manifest^ %LJMT% -manifest minilua.exe.manifest -outputresource:minilua.exe @rem Check for 64 bit host compiler. @minilua @if not errorlevel 8 goto :FAIL @set DASMFLAGS=-D P64 -D NO_UNWIND minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h %DASC% @if errorlevel 1 goto :BAD if exist ..\.git ( git show -s --format=%%ct >luajit_relver.txt ) else ( type ..\.relver >luajit_relver.txt ) minilua host\genversion.lua %LJCOMPILE% /I "." /I %DASMDIR% %GC64% -DLUAJIT_TARGET=LUAJIT_ARCH_X64 -DLUAJIT_OS=LUAJIT_OS_OTHER -DLUAJIT_DISABLE_JIT -DLUAJIT_DISABLE_FFI -DLUAJIT_USE_SYSMALLOC -DLUAJIT_NO_UNWIND host\buildvm*.c @if errorlevel 1 goto :BAD %LJLINK% /out:buildvm.exe buildvm*.obj @if errorlevel 1 goto :BAD if exist buildvm.exe.manifest^ %LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe buildvm -m elfasm -o lj_vm.s @if errorlevel 1 goto :BAD buildvm -m bcdef -o lj_bcdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m ffdef -o lj_ffdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m libdef -o lj_libdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m recdef -o lj_recdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m vmdef -o jit\vmdef.lua %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m folddef -o lj_folddef.h lj_opt_fold.c @if errorlevel 1 goto :BAD @rem ---- Cross compiler ---- @set LJCOMPILE="%SCE_ORBIS_SDK_DIR%\host_tools\bin\orbis-clang" -c -Wall -DLUAJIT_DISABLE_FFI %GC64% @set LJLIB="%SCE_ORBIS_SDK_DIR%\host_tools\bin\orbis-ar" rcus @set INCLUDE="" "%SCE_ORBIS_SDK_DIR%\host_tools\bin\orbis-as" -o lj_vm.o lj_vm.s @if "%1" neq "debug" goto :NODEBUG @shift @set LJCOMPILE=%LJCOMPILE% -g -O0 @set TARGETLIB=libluajitD_ps4.a goto :BUILD :NODEBUG @set LJCOMPILE=%LJCOMPILE% -O2 @set TARGETLIB=libluajit_ps4.a :BUILD del %TARGETLIB% @if "%1" neq "noamalg" goto :AMALG for %%f in (lj_*.c lib_*.c) do ( %LJCOMPILE% %%f @if errorlevel 1 goto :BAD ) %LJLIB% %TARGETLIB% lj_*.o lib_*.o @if errorlevel 1 goto :BAD @goto :NOAMALG :AMALG %LJCOMPILE% ljamalg.c @if errorlevel 1 goto :BAD %LJLIB% %TARGETLIB% ljamalg.o lj_vm.o @if errorlevel 1 goto :BAD :NOAMALG @del *.o *.obj *.manifest minilua.exe buildvm.exe @echo. @echo === Successfully built LuaJIT for PS4 === @goto :END :BAD @echo. @echo ******************************************************* @echo *** Build FAILED -- Please check the error messages *** @echo ******************************************************* @goto :END :FAIL @echo To run this script you must open a "Visual Studio .NET Command Prompt" @echo (64 bit host compiler). The PS4 Orbis SDK must be installed, too. :END subprojects/luajit/src/lj_gc.h0000644000175000017500000001157514741067622015737 0ustar aniolaniol/* ** Garbage collector. ** Copyright (C) 2005-2023 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); lj_assertG(isblack(o) && !isdead(g, o), "bad object states for backward barrier"); lj_assertG(g->gc.state != GCSfinalize && g->gc.state != GCSpause, "bad GC state"); 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, GCSize osz, GCSize nsz); LJ_FUNC void * LJ_FASTCALL lj_mem_newgco(lua_State *L, GCSize 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 -= (GCSize)osize; g->allocf(g->allocd, p, osize, 0); } #define lj_mem_newvec(L, n, t) ((t *)lj_mem_new(L, (GCSize)((n)*sizeof(t)))) #define lj_mem_reallocvec(L, p, on, n, t) \ ((p) = (t *)lj_mem_realloc(L, p, (on)*sizeof(t), (GCSize)((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 subprojects/luajit/src/lj_buf.c0000644000175000017500000001672514741067622016117 0ustar aniolaniol/* ** Buffer handling. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #define lj_buf_c #define LUA_CORE #include "lj_obj.h" #include "lj_gc.h" #include "lj_err.h" #include "lj_buf.h" #include "lj_str.h" #include "lj_tab.h" #include "lj_strfmt.h" /* -- Buffer management --------------------------------------------------- */ static void buf_grow(SBuf *sb, MSize sz) { MSize osz = sbufsz(sb), len = sbuflen(sb), nsz = osz; char *b; GCSize flag; if (nsz < LJ_MIN_SBUF) nsz = LJ_MIN_SBUF; while (nsz < sz) nsz += nsz; flag = sbufflag(sb); if ((flag & SBUF_FLAG_COW)) { /* Copy-on-write semantics. */ lj_assertG_(G(sbufL(sb)), sb->w == sb->e, "bad SBuf COW"); b = (char *)lj_mem_new(sbufL(sb), nsz); setsbufflag(sb, flag & ~(GCSize)SBUF_FLAG_COW); setgcrefnull(sbufX(sb)->cowref); memcpy(b, sb->b, osz); } else { b = (char *)lj_mem_realloc(sbufL(sb), sb->b, osz, nsz); } if ((flag & SBUF_FLAG_EXT)) { sbufX(sb)->r = sbufX(sb)->r - sb->b + b; /* Adjust read pointer, too. */ } /* Adjust buffer pointers. */ sb->b = b; sb->w = b + len; sb->e = b + nsz; if ((flag & SBUF_FLAG_BORROW)) { /* Adjust borrowed buffer pointers. */ SBuf *bsb = mref(sbufX(sb)->bsb, SBuf); bsb->b = b; bsb->w = b + len; bsb->e = b + nsz; } } LJ_NOINLINE char *LJ_FASTCALL lj_buf_need2(SBuf *sb, MSize sz) { lj_assertG_(G(sbufL(sb)), sz > sbufsz(sb), "SBuf overflow"); if (LJ_UNLIKELY(sz > LJ_MAX_BUF)) lj_err_mem(sbufL(sb)); buf_grow(sb, sz); return sb->b; } LJ_NOINLINE char *LJ_FASTCALL lj_buf_more2(SBuf *sb, MSize sz) { if (sbufisext(sb)) { SBufExt *sbx = (SBufExt *)sb; MSize len = sbufxlen(sbx); if (LJ_UNLIKELY(sz > LJ_MAX_BUF || len + sz > LJ_MAX_BUF)) lj_err_mem(sbufL(sbx)); if (len + sz > sbufsz(sbx)) { /* Must grow. */ buf_grow((SBuf *)sbx, len + sz); } else if (sbufiscow(sb) || sbufxslack(sbx) < (sbufsz(sbx) >> 3)) { /* Also grow to avoid excessive compactions, if slack < size/8. */ buf_grow((SBuf *)sbx, sbuflen(sbx) + sz); /* Not sbufxlen! */ return sbx->w; } if (sbx->r != sbx->b) { /* Compact by moving down. */ memmove(sbx->b, sbx->r, len); sbx->r = sbx->b; sbx->w = sbx->b + len; lj_assertG_(G(sbufL(sbx)), len + sz <= sbufsz(sbx), "bad SBuf compact"); } } else { MSize len = sbuflen(sb); lj_assertG_(G(sbufL(sb)), sz > sbufleft(sb), "SBuf overflow"); if (LJ_UNLIKELY(sz > LJ_MAX_BUF || len + sz > LJ_MAX_BUF)) lj_err_mem(sbufL(sb)); buf_grow(sb, len + sz); } return sb->w; } void LJ_FASTCALL lj_buf_shrink(lua_State *L, SBuf *sb) { char *b = sb->b; MSize osz = (MSize)(sb->e - b); if (osz > 2*LJ_MIN_SBUF) { b = lj_mem_realloc(L, b, osz, (osz >> 1)); sb->w = sb->b = b; /* Not supposed to keep data across shrinks. */ sb->e = b + (osz >> 1); } lj_assertG_(G(sbufL(sb)), !sbufisext(sb), "YAGNI shrink SBufExt"); } char * LJ_FASTCALL lj_buf_tmp(lua_State *L, MSize sz) { SBuf *sb = &G(L)->tmpbuf; setsbufL(sb, L); return lj_buf_need(sb, sz); } #if LJ_HASBUFFER && LJ_HASJIT void lj_bufx_set(SBufExt *sbx, const char *p, MSize len, GCobj *ref) { lua_State *L = sbufL(sbx); lj_bufx_free(L, sbx); lj_bufx_set_cow(L, sbx, p, len); setgcref(sbx->cowref, ref); lj_gc_objbarrier(L, (GCudata *)sbx - 1, ref); } #if LJ_HASFFI MSize LJ_FASTCALL lj_bufx_more(SBufExt *sbx, MSize sz) { lj_buf_more((SBuf *)sbx, sz); return sbufleft(sbx); } #endif #endif /* -- Low-level buffer put operations ------------------------------------- */ SBuf *lj_buf_putmem(SBuf *sb, const void *q, MSize len) { char *w = lj_buf_more(sb, len); w = lj_buf_wmem(w, q, len); sb->w = w; return sb; } #if LJ_HASJIT || LJ_HASFFI static LJ_NOINLINE SBuf * LJ_FASTCALL lj_buf_putchar2(SBuf *sb, int c) { char *w = lj_buf_more2(sb, 1); *w++ = (char)c; sb->w = w; return sb; } SBuf * LJ_FASTCALL lj_buf_putchar(SBuf *sb, int c) { char *w = sb->w; if (LJ_LIKELY(w < sb->e)) { *w++ = (char)c; sb->w = w; return sb; } return lj_buf_putchar2(sb, c); } #endif SBuf * LJ_FASTCALL lj_buf_putstr(SBuf *sb, GCstr *s) { MSize len = s->len; char *w = lj_buf_more(sb, len); w = lj_buf_wmem(w, strdata(s), len); sb->w = w; return sb; } /* -- High-level buffer put operations ------------------------------------ */ SBuf * LJ_FASTCALL lj_buf_putstr_reverse(SBuf *sb, GCstr *s) { MSize len = s->len; char *w = lj_buf_more(sb, len), *e = w+len; const char *q = strdata(s)+len-1; while (w < e) *w++ = *q--; sb->w = w; return sb; } SBuf * LJ_FASTCALL lj_buf_putstr_lower(SBuf *sb, GCstr *s) { MSize len = s->len; char *w = lj_buf_more(sb, len), *e = w+len; const char *q = strdata(s); for (; w < e; w++, q++) { uint32_t c = *(unsigned char *)q; #if LJ_TARGET_PPC *w = c + ((c >= 'A' && c <= 'Z') << 5); #else if (c >= 'A' && c <= 'Z') c += 0x20; *w = c; #endif } sb->w = w; return sb; } SBuf * LJ_FASTCALL lj_buf_putstr_upper(SBuf *sb, GCstr *s) { MSize len = s->len; char *w = lj_buf_more(sb, len), *e = w+len; const char *q = strdata(s); for (; w < e; w++, q++) { uint32_t c = *(unsigned char *)q; #if LJ_TARGET_PPC *w = c - ((c >= 'a' && c <= 'z') << 5); #else if (c >= 'a' && c <= 'z') c -= 0x20; *w = c; #endif } sb->w = w; return sb; } SBuf *lj_buf_putstr_rep(SBuf *sb, GCstr *s, int32_t rep) { MSize len = s->len; if (rep > 0 && len) { uint64_t tlen = (uint64_t)rep * len; char *w; if (LJ_UNLIKELY(tlen > LJ_MAX_STR)) lj_err_mem(sbufL(sb)); w = lj_buf_more(sb, (MSize)tlen); if (len == 1) { /* Optimize a common case. */ uint32_t c = strdata(s)[0]; do { *w++ = c; } while (--rep > 0); } else { const char *e = strdata(s) + len; do { const char *q = strdata(s); do { *w++ = *q++; } while (q < e); } while (--rep > 0); } sb->w = w; } return sb; } SBuf *lj_buf_puttab(SBuf *sb, GCtab *t, GCstr *sep, int32_t i, int32_t e) { MSize seplen = sep ? sep->len : 0; if (i <= e) { for (;;) { cTValue *o = lj_tab_getint(t, i); char *w; if (!o) { badtype: /* Error: bad element type. */ sb->w = (char *)(intptr_t)i; /* Store failing index. */ return NULL; } else if (tvisstr(o)) { MSize len = strV(o)->len; w = lj_buf_wmem(lj_buf_more(sb, len + seplen), strVdata(o), len); } else if (tvisint(o)) { w = lj_strfmt_wint(lj_buf_more(sb, STRFMT_MAXBUF_INT+seplen), intV(o)); } else if (tvisnum(o)) { w = lj_buf_more(lj_strfmt_putfnum(sb, STRFMT_G14, numV(o)), seplen); } else { goto badtype; } if (i++ == e) { sb->w = w; break; } if (seplen) w = lj_buf_wmem(w, strdata(sep), seplen); sb->w = w; } } return sb; } /* -- Miscellaneous buffer operations ------------------------------------- */ GCstr * LJ_FASTCALL lj_buf_tostr(SBuf *sb) { return lj_str_new(sbufL(sb), sb->b, sbuflen(sb)); } /* Concatenate two strings. */ GCstr *lj_buf_cat2str(lua_State *L, GCstr *s1, GCstr *s2) { MSize len1 = s1->len, len2 = s2->len; char *buf = lj_buf_tmp(L, len1 + len2); memcpy(buf, strdata(s1), len1); memcpy(buf+len1, strdata(s2), len2); return lj_str_new(L, buf, len1 + len2); } /* Read ULEB128 from buffer. */ uint32_t LJ_FASTCALL lj_buf_ruleb128(const char **pp) { const uint8_t *w = (const uint8_t *)*pp; uint32_t v = *w++; if (LJ_UNLIKELY(v >= 0x80)) { int sh = 0; v &= 0x7f; do { v |= ((*w & 0x7f) << (sh += 7)); } while (*w++ >= 0x80); } *pp = (const char *)w; return v; } subprojects/luajit/src/lj_profile.h0000644000175000017500000000065614741067622017004 0ustar aniolaniol/* ** Low-overhead profiling. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #ifndef _LJ_PROFILE_H #define _LJ_PROFILE_H #include "lj_obj.h" #if LJ_HASPROFILE LJ_FUNC void LJ_FASTCALL lj_profile_interpreter(lua_State *L); #if !LJ_PROFILE_SIGPROF LJ_FUNC void LJ_FASTCALL lj_profile_hook_enter(global_State *g); LJ_FUNC void LJ_FASTCALL lj_profile_hook_leave(global_State *g); #endif #endif #endif subprojects/luajit/src/lj_target_arm64.h0000644000175000017500000002337714741067622017650 0ustar aniolaniol/* ** Definitions for ARM64 CPUs. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #ifndef _LJ_TARGET_ARM64_H #define _LJ_TARGET_ARM64_H /* -- Registers IDs ------------------------------------------------------- */ #define GPRDEF(_) \ _(X0) _(X1) _(X2) _(X3) _(X4) _(X5) _(X6) _(X7) \ _(X8) _(X9) _(X10) _(X11) _(X12) _(X13) _(X14) _(X15) \ _(X16) _(X17) _(X18) _(X19) _(X20) _(X21) _(X22) _(X23) \ _(X24) _(X25) _(X26) _(X27) _(X28) _(FP) _(LR) _(SP) #define FPRDEF(_) \ _(D0) _(D1) _(D2) _(D3) _(D4) _(D5) _(D6) _(D7) \ _(D8) _(D9) _(D10) _(D11) _(D12) _(D13) _(D14) _(D15) \ _(D16) _(D17) _(D18) _(D19) _(D20) _(D21) _(D22) _(D23) \ _(D24) _(D25) _(D26) _(D27) _(D28) _(D29) _(D30) _(D31) #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, RID_ZERO = RID_SP, /* Calling conventions. */ RID_RET = RID_X0, RID_RETLO = RID_X0, RID_RETHI = RID_X1, RID_FPRET = RID_D0, /* These definitions must match with the *.dasc file(s): */ RID_BASE = RID_X19, /* Interpreter BASE. */ RID_LPC = RID_X21, /* Interpreter PC. */ RID_GL = RID_X22, /* Interpreter GL. */ RID_LREG = RID_X23, /* Interpreter L. */ /* Register ranges [min, max) and number of registers. */ RID_MIN_GPR = RID_X0, RID_MAX_GPR = RID_SP+1, RID_MIN_FPR = RID_MAX_GPR, RID_MAX_FPR = RID_D31+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_X0 /* -- Register sets ------------------------------------------------------- */ /* Make use of all registers, except for x18, fp, lr and sp. */ #define RSET_FIXED \ (RID2RSET(RID_X18)|RID2RSET(RID_FP)|RID2RSET(RID_LR)|RID2RSET(RID_SP)|\ RID2RSET(RID_GL)) #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 /* lr is an implicit scratch register. */ #define RSET_SCRATCH_GPR (RSET_RANGE(RID_X0, RID_X17+1)) #define RSET_SCRATCH_FPR \ (RSET_RANGE(RID_D0, RID_D7+1)|RSET_RANGE(RID_D16, RID_D31+1)) #define RSET_SCRATCH (RSET_SCRATCH_GPR|RSET_SCRATCH_FPR) #define REGARG_FIRSTGPR RID_X0 #define REGARG_LASTGPR RID_X7 #define REGARG_NUMGPR 8 #define REGARG_FIRSTFPR RID_D0 #define REGARG_LASTFPR RID_D7 #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 vm_arm64.dasc file. ** Pre-allocate some slots to avoid sp adjust in every root trace. ** ** SPS_FIRST: First spill slot for general use. Reserve min. two 32 bit slots. */ #define SPS_FIXED 4 #define SPS_FIRST 2 #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; /* 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 == (LJ_LE ? 0xd503201f : 0x1f2003d5)) p++; /* Skip A64I_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 -------------------------------------------------------- */ /* ARM64 instructions are always little-endian. Swap for ARM64BE. */ #if LJ_BE #define A64I_LE(x) (lj_bswap(x)) #else #define A64I_LE(x) (x) #endif /* Instruction fields. */ #define A64F_D(r) (r) #define A64F_N(r) ((r) << 5) #define A64F_A(r) ((r) << 10) #define A64F_M(r) ((r) << 16) #define A64F_IMMS(x) ((x) << 10) #define A64F_IMMR(x) ((x) << 16) #define A64F_U16(x) ((x) << 5) #define A64F_U12(x) ((x) << 10) #define A64F_S26(x) (((uint32_t)(x) & 0x03ffffffu)) #define A64F_S19(x) (((uint32_t)(x) & 0x7ffffu) << 5) #define A64F_S14(x) (((uint32_t)(x) & 0x3fffu) << 5) #define A64F_S9(x) ((x) << 12) #define A64F_BIT(x) ((x) << 19) #define A64F_SH(sh, x) (((sh) << 22) | ((x) << 10)) #define A64F_EX(ex) (A64I_EX | ((ex) << 13)) #define A64F_EXSH(ex,x) (A64I_EX | ((ex) << 13) | ((x) << 10)) #define A64F_FP8(x) ((x) << 13) #define A64F_CC(cc) ((cc) << 12) #define A64F_LSL16(x) (((x) / 16) << 21) #define A64F_BSH(sh) ((sh) << 10) /* Check for valid field range. */ #define A64F_S_OK(x, b) ((((x) + (1 << (b-1))) >> (b)) == 0) typedef enum A64Ins { A64I_S = 0x20000000, A64I_X = 0x80000000, A64I_EX = 0x00200000, A64I_ON = 0x00200000, A64I_K12 = 0x1a000000, A64I_K13 = 0x18000000, A64I_LS_U = 0x01000000, A64I_LS_S = 0x00800000, A64I_LS_R = 0x01200800, A64I_LS_SH = 0x00001000, A64I_LS_UXTWx = 0x00004000, A64I_LS_SXTWx = 0x0000c000, A64I_LS_SXTXx = 0x0000e000, A64I_LS_LSLx = 0x00006000, A64I_ADDw = 0x0b000000, A64I_ADDx = 0x8b000000, A64I_ADDSw = 0x2b000000, A64I_ADDSx = 0xab000000, A64I_NEGw = 0x4b0003e0, A64I_NEGx = 0xcb0003e0, A64I_SUBw = 0x4b000000, A64I_SUBx = 0xcb000000, A64I_SUBSw = 0x6b000000, A64I_SUBSx = 0xeb000000, A64I_MULw = 0x1b007c00, A64I_MULx = 0x9b007c00, A64I_SMULL = 0x9b207c00, A64I_ANDw = 0x0a000000, A64I_ANDx = 0x8a000000, A64I_ANDSw = 0x6a000000, A64I_ANDSx = 0xea000000, A64I_EORw = 0x4a000000, A64I_EORx = 0xca000000, A64I_ORRw = 0x2a000000, A64I_ORRx = 0xaa000000, A64I_TSTw = 0x6a00001f, A64I_TSTx = 0xea00001f, A64I_CMPw = 0x6b00001f, A64I_CMPx = 0xeb00001f, A64I_CMNw = 0x2b00001f, A64I_CMNx = 0xab00001f, A64I_CCMPw = 0x7a400000, A64I_CCMPx = 0xfa400000, A64I_CSELw = 0x1a800000, A64I_CSELx = 0x9a800000, A64I_ASRw = 0x13007c00, A64I_ASRx = 0x9340fc00, A64I_LSLx = 0xd3400000, A64I_LSRx = 0xd340fc00, A64I_SHRw = 0x1ac02000, A64I_SHRx = 0x9ac02000, /* lsl/lsr/asr/ror x0, x0, x0 */ A64I_REVw = 0x5ac00800, A64I_REVx = 0xdac00c00, A64I_EXTRw = 0x13800000, A64I_EXTRx = 0x93c00000, A64I_BFMw = 0x33000000, A64I_BFMx = 0xb3400000, A64I_SBFMw = 0x13000000, A64I_SBFMx = 0x93400000, A64I_SXTBw = 0x13001c00, A64I_SXTHw = 0x13003c00, A64I_SXTW = 0x93407c00, A64I_UBFMw = 0x53000000, A64I_UBFMx = 0xd3400000, A64I_UXTBw = 0x53001c00, A64I_UXTHw = 0x53003c00, A64I_MOVw = 0x2a0003e0, A64I_MOVx = 0xaa0003e0, A64I_MVNw = 0x2a2003e0, A64I_MVNx = 0xaa2003e0, A64I_MOVKw = 0x72800000, A64I_MOVKx = 0xf2800000, A64I_MOVZw = 0x52800000, A64I_MOVZx = 0xd2800000, A64I_MOVNw = 0x12800000, A64I_MOVNx = 0x92800000, A64I_ADR = 0x10000000, A64I_ADRP = 0x90000000, A64I_LDRB = 0x39400000, A64I_LDRH = 0x79400000, A64I_LDRw = 0xb9400000, A64I_LDRx = 0xf9400000, A64I_LDRLw = 0x18000000, A64I_LDRLx = 0x58000000, A64I_STRB = 0x39000000, A64I_STRH = 0x79000000, A64I_STRw = 0xb9000000, A64I_STRx = 0xf9000000, A64I_STPw = 0x29000000, A64I_STPx = 0xa9000000, A64I_LDPw = 0x29400000, A64I_LDPx = 0xa9400000, A64I_B = 0x14000000, A64I_BCC = 0x54000000, A64I_BL = 0x94000000, A64I_BR = 0xd61f0000, A64I_BLR = 0xd63f0000, A64I_TBZ = 0x36000000, A64I_TBNZ = 0x37000000, A64I_CBZ = 0x34000000, A64I_CBNZ = 0x35000000, A64I_BRAAZ = 0xd61f081f, A64I_BLRAAZ = 0xd63f081f, A64I_NOP = 0xd503201f, /* FP */ A64I_FADDd = 0x1e602800, A64I_FSUBd = 0x1e603800, A64I_FMADDd = 0x1f400000, A64I_FMSUBd = 0x1f408000, A64I_FNMADDd = 0x1f600000, A64I_FNMSUBd = 0x1f608000, A64I_FMULd = 0x1e600800, A64I_FDIVd = 0x1e601800, A64I_FNEGd = 0x1e614000, A64I_FABS = 0x1e60c000, A64I_FSQRTd = 0x1e61c000, A64I_LDRs = 0xbd400000, A64I_LDRd = 0xfd400000, A64I_LDRLd = 0x5c000000, A64I_STRs = 0xbd000000, A64I_STRd = 0xfd000000, A64I_LDPs = 0x2d400000, A64I_LDPd = 0x6d400000, A64I_STPs = 0x2d000000, A64I_STPd = 0x6d000000, A64I_FCMPd = 0x1e602000, A64I_FCMPZd = 0x1e602008, A64I_FCSELd = 0x1e600c00, A64I_FRINTMd = 0x1e654000, A64I_FRINTPd = 0x1e64c000, A64I_FRINTZd = 0x1e65c000, A64I_FCVT_F32_F64 = 0x1e624000, A64I_FCVT_F64_F32 = 0x1e22c000, A64I_FCVT_F32_S32 = 0x1e220000, A64I_FCVT_F64_S32 = 0x1e620000, A64I_FCVT_F32_U32 = 0x1e230000, A64I_FCVT_F64_U32 = 0x1e630000, A64I_FCVT_F32_S64 = 0x9e220000, A64I_FCVT_F64_S64 = 0x9e620000, A64I_FCVT_F32_U64 = 0x9e230000, A64I_FCVT_F64_U64 = 0x9e630000, A64I_FCVT_S32_F64 = 0x1e780000, A64I_FCVT_S32_F32 = 0x1e380000, A64I_FCVT_U32_F64 = 0x1e790000, A64I_FCVT_U32_F32 = 0x1e390000, A64I_FCVT_S64_F64 = 0x9e780000, A64I_FCVT_S64_F32 = 0x9e380000, A64I_FCVT_U64_F64 = 0x9e790000, A64I_FCVT_U64_F32 = 0x9e390000, A64I_FMOV_S = 0x1e204000, A64I_FMOV_D = 0x1e604000, A64I_FMOV_R_S = 0x1e260000, A64I_FMOV_S_R = 0x1e270000, A64I_FMOV_R_D = 0x9e660000, A64I_FMOV_D_R = 0x9e670000, A64I_FMOV_DI = 0x1e601000, A64I_MOVI_DI = 0x2f000400, } A64Ins; #define A64I_BR_AUTH (LJ_ABI_PAUTH ? A64I_BRAAZ : A64I_BR) #define A64I_BLR_AUTH (LJ_ABI_PAUTH ? A64I_BLRAAZ : A64I_BLR) typedef enum A64Shift { A64SH_LSL, A64SH_LSR, A64SH_ASR, A64SH_ROR } A64Shift; typedef enum A64Extend { A64EX_UXTB, A64EX_UXTH, A64EX_UXTW, A64EX_UXTX, A64EX_SXTB, A64EX_SXTH, A64EX_SXTW, A64EX_SXTX, } A64Extend; /* ARM condition codes. */ typedef enum A64CC { 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 } A64CC; #endif subprojects/luajit/src/luaconf.h0000644000175000017500000001075414741067622016306 0ustar aniolaniol/* ** Configuration header. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #ifndef luaconf_h #define luaconf_h #ifndef WINVER #define WINVER 0x0501 #endif #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/" #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 #ifndef LUA_LJDIR #define LUA_LJDIR LUA_JROOT "/share/luajit-2.1" #endif #define LUA_JPATH ";" 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 "\n" /* 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. */ /* 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 /* Compatibility support for 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 subprojects/luajit/src/lj_buf.h0000644000175000017500000001341114741067622016111 0ustar aniolaniol/* ** Buffer handling. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #ifndef _LJ_BUF_H #define _LJ_BUF_H #include "lj_obj.h" #include "lj_gc.h" #include "lj_str.h" /* Resizable string buffers. */ /* The SBuf struct definition is in lj_obj.h: ** char *w; Write pointer. ** char *e; End pointer. ** char *b; Base pointer. ** MRef L; lua_State, used for buffer resizing. Extension bits in 3 LSB. */ /* Extended string buffer. */ typedef struct SBufExt { SBufHeader; union { GCRef cowref; /* Copy-on-write object reference. */ MRef bsb; /* Borrowed string buffer. */ }; char *r; /* Read pointer. */ GCRef dict_str; /* Serialization string dictionary table. */ GCRef dict_mt; /* Serialization metatable dictionary table. */ int depth; /* Remaining recursion depth. */ } SBufExt; #define sbufsz(sb) ((MSize)((sb)->e - (sb)->b)) #define sbuflen(sb) ((MSize)((sb)->w - (sb)->b)) #define sbufleft(sb) ((MSize)((sb)->e - (sb)->w)) #define sbufxlen(sbx) ((MSize)((sbx)->w - (sbx)->r)) #define sbufxslack(sbx) ((MSize)((sbx)->r - (sbx)->b)) #define SBUF_MASK_FLAG (7) #define SBUF_MASK_L (~(GCSize)SBUF_MASK_FLAG) #define SBUF_FLAG_EXT 1 /* Extended string buffer. */ #define SBUF_FLAG_COW 2 /* Copy-on-write buffer. */ #define SBUF_FLAG_BORROW 4 /* Borrowed string buffer. */ #define sbufL(sb) \ ((lua_State *)(void *)(uintptr_t)(mrefu((sb)->L) & SBUF_MASK_L)) #define setsbufL(sb, l) (setmref((sb)->L, (l))) #define setsbufXL(sb, l, flag) \ (setmrefu((sb)->L, (GCSize)(uintptr_t)(void *)(l) + (flag))) #define setsbufXL_(sb, l) \ (setmrefu((sb)->L, (GCSize)(uintptr_t)(void *)(l) | (mrefu((sb)->L) & SBUF_MASK_FLAG))) #define sbufflag(sb) (mrefu((sb)->L)) #define sbufisext(sb) (sbufflag((sb)) & SBUF_FLAG_EXT) #define sbufiscow(sb) (sbufflag((sb)) & SBUF_FLAG_COW) #define sbufisborrow(sb) (sbufflag((sb)) & SBUF_FLAG_BORROW) #define sbufiscoworborrow(sb) (sbufflag((sb)) & (SBUF_FLAG_COW|SBUF_FLAG_BORROW)) #define sbufX(sb) \ (lj_assertG_(G(sbufL(sb)), sbufisext(sb), "not an SBufExt"), (SBufExt *)(sb)) #define setsbufflag(sb, flag) (setmrefu((sb)->L, (flag))) #define tvisbuf(o) \ (LJ_HASBUFFER && tvisudata(o) && udataV(o)->udtype == UDTYPE_BUFFER) #define bufV(o) check_exp(tvisbuf(o), ((SBufExt *)uddata(udataV(o)))) /* Buffer management */ LJ_FUNC char *LJ_FASTCALL lj_buf_need2(SBuf *sb, MSize sz); LJ_FUNC char *LJ_FASTCALL lj_buf_more2(SBuf *sb, MSize sz); LJ_FUNC void LJ_FASTCALL lj_buf_shrink(lua_State *L, SBuf *sb); LJ_FUNC char * LJ_FASTCALL lj_buf_tmp(lua_State *L, MSize sz); static LJ_AINLINE void lj_buf_init(lua_State *L, SBuf *sb) { setsbufL(sb, L); sb->w = sb->e = sb->b = NULL; } static LJ_AINLINE void lj_buf_reset(SBuf *sb) { sb->w = sb->b; } static LJ_AINLINE SBuf *lj_buf_tmp_(lua_State *L) { SBuf *sb = &G(L)->tmpbuf; setsbufL(sb, L); lj_buf_reset(sb); return sb; } static LJ_AINLINE void lj_buf_free(global_State *g, SBuf *sb) { lj_assertG(!sbufisext(sb), "bad free of SBufExt"); lj_mem_free(g, sb->b, sbufsz(sb)); } static LJ_AINLINE char *lj_buf_need(SBuf *sb, MSize sz) { if (LJ_UNLIKELY(sz > sbufsz(sb))) return lj_buf_need2(sb, sz); return sb->b; } static LJ_AINLINE char *lj_buf_more(SBuf *sb, MSize sz) { if (LJ_UNLIKELY(sz > sbufleft(sb))) return lj_buf_more2(sb, sz); return sb->w; } /* Extended buffer management */ static LJ_AINLINE void lj_bufx_init(lua_State *L, SBufExt *sbx) { memset(sbx, 0, sizeof(SBufExt)); setsbufXL(sbx, L, SBUF_FLAG_EXT); } static LJ_AINLINE void lj_bufx_set_borrow(lua_State *L, SBufExt *sbx, SBuf *sb) { setsbufXL(sbx, L, SBUF_FLAG_EXT | SBUF_FLAG_BORROW); setmref(sbx->bsb, sb); sbx->r = sbx->w = sbx->b = sb->b; sbx->e = sb->e; } static LJ_AINLINE void lj_bufx_set_cow(lua_State *L, SBufExt *sbx, const char *p, MSize len) { setsbufXL(sbx, L, SBUF_FLAG_EXT | SBUF_FLAG_COW); sbx->r = sbx->b = (char *)p; sbx->w = sbx->e = (char *)p + len; } static LJ_AINLINE void lj_bufx_reset(SBufExt *sbx) { if (sbufiscow(sbx)) { setmrefu(sbx->L, (mrefu(sbx->L) & ~(GCSize)SBUF_FLAG_COW)); setgcrefnull(sbx->cowref); sbx->b = sbx->e = NULL; } sbx->r = sbx->w = sbx->b; } static LJ_AINLINE void lj_bufx_free(lua_State *L, SBufExt *sbx) { if (!sbufiscoworborrow(sbx)) lj_mem_free(G(L), sbx->b, sbufsz(sbx)); setsbufXL(sbx, L, SBUF_FLAG_EXT); setgcrefnull(sbx->cowref); sbx->r = sbx->w = sbx->b = sbx->e = NULL; } #if LJ_HASBUFFER && LJ_HASJIT LJ_FUNC void lj_bufx_set(SBufExt *sbx, const char *p, MSize len, GCobj *o); #if LJ_HASFFI LJ_FUNC MSize LJ_FASTCALL lj_bufx_more(SBufExt *sbx, MSize sz); #endif #endif /* Low-level buffer put operations */ LJ_FUNC SBuf *lj_buf_putmem(SBuf *sb, const void *q, MSize len); #if LJ_HASJIT || LJ_HASFFI LJ_FUNC SBuf * LJ_FASTCALL lj_buf_putchar(SBuf *sb, int c); #endif LJ_FUNC SBuf * LJ_FASTCALL lj_buf_putstr(SBuf *sb, GCstr *s); static LJ_AINLINE char *lj_buf_wmem(char *p, const void *q, MSize len) { return (char *)memcpy(p, q, len) + len; } static LJ_AINLINE void lj_buf_putb(SBuf *sb, int c) { char *w = lj_buf_more(sb, 1); *w++ = (char)c; sb->w = w; } /* High-level buffer put operations */ LJ_FUNCA SBuf * LJ_FASTCALL lj_buf_putstr_reverse(SBuf *sb, GCstr *s); LJ_FUNCA SBuf * LJ_FASTCALL lj_buf_putstr_lower(SBuf *sb, GCstr *s); LJ_FUNCA SBuf * LJ_FASTCALL lj_buf_putstr_upper(SBuf *sb, GCstr *s); LJ_FUNC SBuf *lj_buf_putstr_rep(SBuf *sb, GCstr *s, int32_t rep); LJ_FUNC SBuf *lj_buf_puttab(SBuf *sb, GCtab *t, GCstr *sep, int32_t i, int32_t e); /* Miscellaneous buffer operations */ LJ_FUNCA GCstr * LJ_FASTCALL lj_buf_tostr(SBuf *sb); LJ_FUNC GCstr *lj_buf_cat2str(lua_State *L, GCstr *s1, GCstr *s2); LJ_FUNC uint32_t LJ_FASTCALL lj_buf_ruleb128(const char **pp); static LJ_AINLINE GCstr *lj_buf_str(lua_State *L, SBuf *sb) { return lj_str_new(L, sb->b, sbuflen(sb)); } #endif subprojects/luajit/src/lj_bc.c0000644000175000017500000000040514741067622015713 0ustar aniolaniol/* ** Bytecode instruction modes. ** Copyright (C) 2005-2023 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" subprojects/luajit/src/lj_obj.c0000644000175000017500000000247614741067622016113 0ustar aniolaniol/* ** Miscellaneous object handling. ** Copyright (C) 2005-2023 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_FASTCALL 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); } /* Return pointer to object or its object data. */ const void * LJ_FASTCALL lj_obj_ptr(global_State *g, cTValue *o) { UNUSED(g); if (tvisudata(o)) return uddata(udataV(o)); else if (tvislightud(o)) return lightudV(g, o); else if (LJ_HASFFI && tviscdata(o)) return cdataptr(cdataV(o)); else if (tvisgcv(o)) return gcV(o); else return NULL; } subprojects/luajit/src/lj_target_ppc.h0000644000175000017500000001653614741067622017500 0ustar aniolaniol/* ** Definitions for PPC CPUs. ** Copyright (C) 2005-2023 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. */ intptr_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 subprojects/luajit/src/lib_math.c0000644000175000017500000001232614741067622016426 0ustar aniolaniol/* ** Math library. ** Copyright (C) 2005-2023 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_err.h" #include "lj_lib.h" #include "lj_vm.h" #include "lj_prng.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_call IRCALL_log10) LJLIB_ASM_(math_exp) LJLIB_REC(math_call IRCALL_exp) LJLIB_ASM_(math_sin) LJLIB_REC(math_call IRCALL_sin) LJLIB_ASM_(math_cos) LJLIB_REC(math_call IRCALL_cos) LJLIB_ASM_(math_tan) LJLIB_REC(math_call IRCALL_tan) LJLIB_ASM_(math_asin) LJLIB_REC(math_call IRCALL_asin) LJLIB_ASM_(math_acos) LJLIB_REC(math_call IRCALL_acos) LJLIB_ASM_(math_atan) LJLIB_REC(math_call IRCALL_atan) LJLIB_ASM_(math_sinh) LJLIB_REC(math_call IRCALL_sinh) LJLIB_ASM_(math_cosh) LJLIB_REC(math_call IRCALL_cosh) LJLIB_ASM_(math_tanh) LJLIB_REC(math_call IRCALL_tanh) LJLIB_ASM_(math_frexp) LJLIB_ASM_(math_modf) 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-LJ_FR2, x*y); /* Do NOT join the expression to x / y. */ return FFH_RES(1); } return FFH_RETRY; } LJLIB_LUA(math_deg) /* function(x) return x * 57.29577951308232 end */ LJLIB_LUA(math_rad) /* function(x) return x * 0.017453292519943295 end */ 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. */ /* Union needed for bit-pattern conversion between uint64_t and double. */ typedef union { uint64_t u64; double d; } U64double; /* PRNG seeding function. */ static void random_seed(PRNGState *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 u[i] are non-zero. */ rs->u[i] = u.u64; } for (i = 0; i < 10; i++) (void)lj_prng_u64(rs); } /* PRNG extract function. */ LJLIB_PUSH(top-2) /* Upvalue holds userdata with PRNGState. */ LJLIB_CF(math_random) LJLIB_REC(.) { int n = (int)(L->top - L->base); PRNGState *rs = (PRNGState *)(uddata(udataV(lj_lib_upvalue(L, 1)))); U64double u; double d; u.u64 = lj_prng_u64d(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 PRNGState. */ LJLIB_CF(math_randomseed) { PRNGState *rs = (PRNGState *)(uddata(udataV(lj_lib_upvalue(L, 1)))); if (L->base != L->top) random_seed(rs, lj_lib_checknum(L, 1)); else if (!lj_prng_seed_secure(rs)) lj_err_caller(L, LJ_ERR_PRNGSD); return 0; } /* ------------------------------------------------------------------------ */ #include "lj_libdef.h" LUALIB_API int luaopen_math(lua_State *L) { PRNGState *rs = (PRNGState *)lua_newuserdata(L, sizeof(PRNGState)); lj_prng_seed_fixed(rs); LJ_LIB_REG(L, LUA_MATHLIBNAME, math); return 1; } subprojects/luajit/src/xb1build.bat0000644000175000017500000000635314741067622016710 0ustar aniolaniol@rem Script to build LuaJIT with the Xbox One SDK. @rem Donated to the public domain. @rem @rem Open a "Visual Studio .NET Command Prompt" (64 bit host compiler) @rem Then cd to this directory and run this script. @if not defined INCLUDE goto :FAIL @if not defined DurangoXDK goto :FAIL @setlocal @echo ---- Host compiler ---- @set LJCOMPILE=cl /nologo /c /MD /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE @set LJLINK=link /nologo @set LJMT=mt /nologo @set DASMDIR=..\dynasm @set DASM=%DASMDIR%\dynasm.lua @set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c lib_buffer.c %LJCOMPILE% host\minilua.c @if errorlevel 1 goto :BAD %LJLINK% /out:minilua.exe minilua.obj @if errorlevel 1 goto :BAD if exist minilua.exe.manifest^ %LJMT% -manifest minilua.exe.manifest -outputresource:minilua.exe @rem Error out for 64 bit host compiler @minilua @if not errorlevel 8 goto :FAIL @set DASMFLAGS=-D WIN -D FFI -D P64 minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_x64.dasc @if errorlevel 1 goto :BAD if exist ..\.git ( git show -s --format=%%ct >luajit_relver.txt ) else ( type ..\.relver >luajit_relver.txt ) minilua host\genversion.lua %LJCOMPILE% /I "." /I %DASMDIR% /D_DURANGO host\buildvm*.c @if errorlevel 1 goto :BAD %LJLINK% /out:buildvm.exe buildvm*.obj @if errorlevel 1 goto :BAD if exist buildvm.exe.manifest^ %LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe buildvm -m peobj -o lj_vm.obj @if errorlevel 1 goto :BAD buildvm -m bcdef -o lj_bcdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m ffdef -o lj_ffdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m libdef -o lj_libdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m recdef -o lj_recdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m vmdef -o jit\vmdef.lua %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m folddef -o lj_folddef.h lj_opt_fold.c @if errorlevel 1 goto :BAD @echo ---- Cross compiler ---- @set CWD=%cd% @call "%DurangoXDK%\xdk\DurangoVars.cmd" XDK @cd /D "%CWD%" @shift @set LJCOMPILE="cl" /nologo /c /W3 /GF /Gm- /GR- /GS- /Gy /openmp- /D_CRT_SECURE_NO_DEPRECATE /D_LIB /D_UNICODE /D_DURANGO @set LJLIB="lib" /nologo @if "%1"=="debug" ( @shift @set LJCOMPILE=%LJCOMPILE% /Zi /MDd /Od @set LJLINK=%LJLINK% /debug ) else ( @set LJCOMPILE=%LJCOMPILE% /MD /O2 /DNDEBUG ) @if "%1"=="amalg" goto :AMALG %LJCOMPILE% /DLUA_BUILD_AS_DLL lj_*.c lib_*.c @if errorlevel 1 goto :BAD %LJLIB% /OUT:luajit.lib lj_*.obj lib_*.obj @if errorlevel 1 goto :BAD @goto :NOAMALG :AMALG %LJCOMPILE% /DLUA_BUILD_AS_DLL ljamalg.c @if errorlevel 1 goto :BAD %LJLIB% /OUT:luajit.lib ljamalg.obj lj_vm.obj @if errorlevel 1 goto :BAD :NOAMALG @del *.obj *.manifest minilua.exe buildvm.exe @echo. @echo === Successfully built LuaJIT for Xbox One === @goto :END :BAD @echo. @echo ******************************************************* @echo *** Build FAILED -- Please check the error messages *** @echo ******************************************************* @goto :END :FAIL @echo To run this script you must open a "Visual Studio .NET Command Prompt" @echo (64 bit host compiler). The Xbox One SDK must be installed, too. :END subprojects/luajit/src/lj_serialize.c0000644000175000017500000003644614741067622017334 0ustar aniolaniol/* ** Object de/serialization. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #define lj_serialize_c #define LUA_CORE #include "lj_obj.h" #if LJ_HASBUFFER #include "lj_err.h" #include "lj_buf.h" #include "lj_str.h" #include "lj_tab.h" #include "lj_udata.h" #if LJ_HASFFI #include "lj_ctype.h" #include "lj_cdata.h" #endif #if LJ_HASJIT #include "lj_ir.h" #endif #include "lj_serialize.h" /* Tags for internal serialization format. */ enum { SER_TAG_NIL, /* 0x00 */ SER_TAG_FALSE, SER_TAG_TRUE, SER_TAG_NULL, SER_TAG_LIGHTUD32, SER_TAG_LIGHTUD64, SER_TAG_INT, SER_TAG_NUM, SER_TAG_TAB, /* 0x08 */ SER_TAG_DICT_MT = SER_TAG_TAB+6, SER_TAG_DICT_STR, SER_TAG_INT64, /* 0x10 */ SER_TAG_UINT64, SER_TAG_COMPLEX, SER_TAG_0x13, SER_TAG_0x14, SER_TAG_0x15, SER_TAG_0x16, SER_TAG_0x17, SER_TAG_0x18, /* 0x18 */ SER_TAG_0x19, SER_TAG_0x1a, SER_TAG_0x1b, SER_TAG_0x1c, SER_TAG_0x1d, SER_TAG_0x1e, SER_TAG_0x1f, SER_TAG_STR, /* 0x20 + str->len */ }; LJ_STATIC_ASSERT((SER_TAG_TAB & 7) == 0); /* -- Helper functions ---------------------------------------------------- */ static LJ_AINLINE char *serialize_more(char *w, SBufExt *sbx, MSize sz) { if (LJ_UNLIKELY(sz > (MSize)(sbx->e - w))) { sbx->w = w; w = lj_buf_more2((SBuf *)sbx, sz); } return w; } /* Write U124 to buffer. */ static LJ_NOINLINE char *serialize_wu124_(char *w, uint32_t v) { if (v < 0x1fe0) { v -= 0xe0; *w++ = (char)(0xe0 | (v >> 8)); *w++ = (char)v; } else { *w++ = (char)0xff; #if LJ_BE v = lj_bswap(v); #endif memcpy(w, &v, 4); w += 4; } return w; } static LJ_AINLINE char *serialize_wu124(char *w, uint32_t v) { if (LJ_LIKELY(v < 0xe0)) { *w++ = (char)v; return w; } else { return serialize_wu124_(w, v); } } static LJ_NOINLINE char *serialize_ru124_(char *r, char *w, uint32_t *pv) { uint32_t v = *pv; if (v != 0xff) { if (r >= w) return NULL; v = ((v & 0x1f) << 8) + *(uint8_t *)r + 0xe0; r++; } else { if (r + 4 > w) return NULL; v = lj_getu32(r); r += 4; #if LJ_BE v = lj_bswap(v); #endif } *pv = v; return r; } static LJ_AINLINE char *serialize_ru124(char *r, char *w, uint32_t *pv) { if (LJ_LIKELY(r < w)) { uint32_t v = *(uint8_t *)r; r++; *pv = v; if (LJ_UNLIKELY(v >= 0xe0)) { r = serialize_ru124_(r, w, pv); } return r; } return NULL; } /* Prepare string dictionary for use (once). */ void LJ_FASTCALL lj_serialize_dict_prep_str(lua_State *L, GCtab *dict) { if (!dict->hmask) { /* No hash part means not prepared, yet. */ MSize i, len = lj_tab_len(dict); if (!len) return; lj_tab_resize(L, dict, dict->asize, hsize2hbits(len)); for (i = 1; i <= len && i < dict->asize; i++) { cTValue *o = arrayslot(dict, i); if (tvisstr(o)) { if (!lj_tab_getstr(dict, strV(o))) { /* Ignore dups. */ lj_tab_newkey(L, dict, o)->u64 = (uint64_t)(i-1); } } else if (!tvisfalse(o)) { lj_err_caller(L, LJ_ERR_BUFFER_BADOPT); } } } } /* Prepare metatable dictionary for use (once). */ void LJ_FASTCALL lj_serialize_dict_prep_mt(lua_State *L, GCtab *dict) { if (!dict->hmask) { /* No hash part means not prepared, yet. */ MSize i, len = lj_tab_len(dict); if (!len) return; lj_tab_resize(L, dict, dict->asize, hsize2hbits(len)); for (i = 1; i <= len && i < dict->asize; i++) { cTValue *o = arrayslot(dict, i); if (tvistab(o)) { if (tvisnil(lj_tab_get(L, dict, o))) { /* Ignore dups. */ lj_tab_newkey(L, dict, o)->u64 = (uint64_t)(i-1); } } else if (!tvisfalse(o)) { lj_err_caller(L, LJ_ERR_BUFFER_BADOPT); } } } } /* -- Internal serializer ------------------------------------------------- */ /* Put serialized object into buffer. */ static char *serialize_put(char *w, SBufExt *sbx, cTValue *o) { if (LJ_LIKELY(tvisstr(o))) { const GCstr *str = strV(o); MSize len = str->len; w = serialize_more(w, sbx, 5+len); w = serialize_wu124(w, SER_TAG_STR + len); w = lj_buf_wmem(w, strdata(str), len); } else if (tvisint(o)) { uint32_t x = LJ_BE ? lj_bswap((uint32_t)intV(o)) : (uint32_t)intV(o); w = serialize_more(w, sbx, 1+4); *w++ = SER_TAG_INT; memcpy(w, &x, 4); w += 4; } else if (tvisnum(o)) { uint64_t x = LJ_BE ? lj_bswap64(o->u64) : o->u64; w = serialize_more(w, sbx, 1+sizeof(lua_Number)); *w++ = SER_TAG_NUM; memcpy(w, &x, 8); w += 8; } else if (tvispri(o)) { w = serialize_more(w, sbx, 1); *w++ = (char)(SER_TAG_NIL + ~itype(o)); } else if (tvistab(o)) { const GCtab *t = tabV(o); uint32_t narray = 0, nhash = 0, one = 2; if (sbx->depth <= 0) lj_err_caller(sbufL(sbx), LJ_ERR_BUFFER_DEPTH); sbx->depth--; 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 = (uint32_t)(i+1); if (narray && tvisnil(&array[0])) one = 4; } if (t->hmask > 0) { /* Count number of used hash slots. */ uint32_t i, hmask = t->hmask; Node *node = noderef(t->node); for (i = 0; i <= hmask; i++) nhash += !tvisnil(&node[i].val); } /* Write metatable index. */ if (LJ_UNLIKELY(tabref(sbx->dict_mt)) && tabref(t->metatable)) { TValue mto; Node *n; settabV(sbufL(sbx), &mto, tabref(t->metatable)); n = hashgcref(tabref(sbx->dict_mt), mto.gcr); do { if (n->key.u64 == mto.u64) { uint32_t idx = n->val.u32.lo; w = serialize_more(w, sbx, 1+5); *w++ = SER_TAG_DICT_MT; w = serialize_wu124(w, idx); break; } } while ((n = nextnode(n))); } /* Write number of array slots and hash slots. */ w = serialize_more(w, sbx, 1+2*5); *w++ = (char)(SER_TAG_TAB + (nhash ? 1 : 0) + (narray ? one : 0)); if (narray) w = serialize_wu124(w, narray); if (nhash) w = serialize_wu124(w, nhash); if (narray) { /* Write array entries. */ cTValue *oa = tvref(t->array) + (one >> 2); cTValue *oe = tvref(t->array) + narray; while (oa < oe) w = serialize_put(w, sbx, oa++); } if (nhash) { /* Write hash entries. */ const Node *node = noderef(t->node) + t->hmask; GCtab *dict_str = tabref(sbx->dict_str); if (LJ_UNLIKELY(dict_str)) { for (;; node--) if (!tvisnil(&node->val)) { if (LJ_LIKELY(tvisstr(&node->key))) { /* Inlined lj_tab_getstr is 30% faster. */ const GCstr *str = strV(&node->key); Node *n = hashstr(dict_str, str); do { if (tvisstr(&n->key) && strV(&n->key) == str) { uint32_t idx = n->val.u32.lo; w = serialize_more(w, sbx, 1+5); *w++ = SER_TAG_DICT_STR; w = serialize_wu124(w, idx); break; } n = nextnode(n); if (!n) { MSize len = str->len; w = serialize_more(w, sbx, 5+len); w = serialize_wu124(w, SER_TAG_STR + len); w = lj_buf_wmem(w, strdata(str), len); break; } } while (1); } else { w = serialize_put(w, sbx, &node->key); } w = serialize_put(w, sbx, &node->val); if (--nhash == 0) break; } } else { for (;; node--) if (!tvisnil(&node->val)) { w = serialize_put(w, sbx, &node->key); w = serialize_put(w, sbx, &node->val); if (--nhash == 0) break; } } } sbx->depth++; #if LJ_HASFFI } else if (tviscdata(o)) { CTState *cts = ctype_cts(sbufL(sbx)); CType *s = ctype_raw(cts, cdataV(o)->ctypeid); uint8_t *sp = cdataptr(cdataV(o)); if (ctype_isinteger(s->info) && s->size == 8) { w = serialize_more(w, sbx, 1+8); *w++ = (s->info & CTF_UNSIGNED) ? SER_TAG_UINT64 : SER_TAG_INT64; #if LJ_BE { uint64_t u = lj_bswap64(*(uint64_t *)sp); memcpy(w, &u, 8); } #else memcpy(w, sp, 8); #endif w += 8; } else if (ctype_iscomplex(s->info) && s->size == 16) { w = serialize_more(w, sbx, 1+16); *w++ = SER_TAG_COMPLEX; #if LJ_BE { /* Only swap the doubles. The re/im order stays the same. */ uint64_t u = lj_bswap64(((uint64_t *)sp)[0]); memcpy(w, &u, 8); u = lj_bswap64(((uint64_t *)sp)[1]); memcpy(w+8, &u, 8); } #else memcpy(w, sp, 16); #endif w += 16; } else { goto badenc; /* NYI other cdata */ } #endif } else if (tvislightud(o)) { uintptr_t ud = (uintptr_t)lightudV(G(sbufL(sbx)), o); w = serialize_more(w, sbx, 1+sizeof(ud)); if (ud == 0) { *w++ = SER_TAG_NULL; } else if (LJ_32 || checku32(ud)) { #if LJ_BE && LJ_64 ud = lj_bswap64(ud); #elif LJ_BE ud = lj_bswap(ud); #endif *w++ = SER_TAG_LIGHTUD32; memcpy(w, &ud, 4); w += 4; #if LJ_64 } else { #if LJ_BE ud = lj_bswap64(ud); #endif *w++ = SER_TAG_LIGHTUD64; memcpy(w, &ud, 8); w += 8; #endif } } else { /* NYI userdata */ #if LJ_HASFFI badenc: #endif lj_err_callerv(sbufL(sbx), LJ_ERR_BUFFER_BADENC, lj_typename(o)); } return w; } /* Get serialized object from buffer. */ static char *serialize_get(char *r, SBufExt *sbx, TValue *o) { char *w = sbx->w; uint32_t tp; r = serialize_ru124(r, w, &tp); if (LJ_UNLIKELY(!r)) goto eob; if (LJ_LIKELY(tp >= SER_TAG_STR)) { uint32_t len = tp - SER_TAG_STR; if (LJ_UNLIKELY(len > (uint32_t)(w - r))) goto eob; setstrV(sbufL(sbx), o, lj_str_new(sbufL(sbx), r, len)); r += len; } else if (tp == SER_TAG_INT) { if (LJ_UNLIKELY(r + 4 > w)) goto eob; setintV(o, (int32_t)(LJ_BE ? lj_bswap(lj_getu32(r)) : lj_getu32(r))); r += 4; } else if (tp == SER_TAG_NUM) { if (LJ_UNLIKELY(r + 8 > w)) goto eob; memcpy(o, r, 8); r += 8; #if LJ_BE o->u64 = lj_bswap64(o->u64); #endif if (!tvisnum(o)) setnanV(o); /* Fix non-canonical NaNs. */ } else if (tp <= SER_TAG_TRUE) { setpriV(o, ~tp); } else if (tp == SER_TAG_DICT_STR) { GCtab *dict_str; uint32_t idx; r = serialize_ru124(r, w, &idx); if (LJ_UNLIKELY(!r)) goto eob; idx++; dict_str = tabref(sbx->dict_str); if (dict_str && idx < dict_str->asize && tvisstr(arrayslot(dict_str, idx))) copyTV(sbufL(sbx), o, arrayslot(dict_str, idx)); else lj_err_callerv(sbufL(sbx), LJ_ERR_BUFFER_BADDICTX, idx); } else if (tp >= SER_TAG_TAB && tp <= SER_TAG_DICT_MT) { uint32_t narray = 0, nhash = 0; GCtab *t, *mt = NULL; if (sbx->depth <= 0) lj_err_caller(sbufL(sbx), LJ_ERR_BUFFER_DEPTH); sbx->depth--; if (tp == SER_TAG_DICT_MT) { GCtab *dict_mt; uint32_t idx; r = serialize_ru124(r, w, &idx); if (LJ_UNLIKELY(!r)) goto eob; idx++; dict_mt = tabref(sbx->dict_mt); if (dict_mt && idx < dict_mt->asize && tvistab(arrayslot(dict_mt, idx))) mt = tabV(arrayslot(dict_mt, idx)); else lj_err_callerv(sbufL(sbx), LJ_ERR_BUFFER_BADDICTX, idx); r = serialize_ru124(r, w, &tp); if (LJ_UNLIKELY(!r)) goto eob; if (!(tp >= SER_TAG_TAB && tp < SER_TAG_DICT_MT)) goto badtag; } if (tp >= SER_TAG_TAB+2) { r = serialize_ru124(r, w, &narray); if (LJ_UNLIKELY(!r)) goto eob; } if ((tp & 1)) { r = serialize_ru124(r, w, &nhash); if (LJ_UNLIKELY(!r)) goto eob; } t = lj_tab_new(sbufL(sbx), narray, hsize2hbits(nhash)); /* NOBARRIER: The table is new (marked white). */ setgcref(t->metatable, obj2gco(mt)); settabV(sbufL(sbx), o, t); if (narray) { TValue *oa = tvref(t->array) + (tp >= SER_TAG_TAB+4); TValue *oe = tvref(t->array) + narray; while (oa < oe) r = serialize_get(r, sbx, oa++); } if (nhash) { do { TValue k, *v; r = serialize_get(r, sbx, &k); v = lj_tab_set(sbufL(sbx), t, &k); if (LJ_UNLIKELY(!tvisnil(v))) lj_err_caller(sbufL(sbx), LJ_ERR_BUFFER_DUPKEY); r = serialize_get(r, sbx, v); } while (--nhash); } sbx->depth++; #if LJ_HASFFI } else if (tp >= SER_TAG_INT64 && tp <= SER_TAG_COMPLEX) { uint32_t sz = tp == SER_TAG_COMPLEX ? 16 : 8; GCcdata *cd; if (LJ_UNLIKELY(r + sz > w)) goto eob; if (LJ_UNLIKELY(!ctype_ctsG(G(sbufL(sbx))))) goto badtag; cd = lj_cdata_new_(sbufL(sbx), tp == SER_TAG_INT64 ? CTID_INT64 : tp == SER_TAG_UINT64 ? CTID_UINT64 : CTID_COMPLEX_DOUBLE, sz); memcpy(cdataptr(cd), r, sz); r += sz; #if LJ_BE *(uint64_t *)cdataptr(cd) = lj_bswap64(*(uint64_t *)cdataptr(cd)); if (sz == 16) ((uint64_t *)cdataptr(cd))[1] = lj_bswap64(((uint64_t *)cdataptr(cd))[1]); #endif if (sz == 16) { /* Fix non-canonical NaNs. */ TValue *cdo = (TValue *)cdataptr(cd); if (!tvisnum(&cdo[0])) setnanV(&cdo[0]); if (!tvisnum(&cdo[1])) setnanV(&cdo[1]); } setcdataV(sbufL(sbx), o, cd); #endif } else if (tp <= (LJ_64 ? SER_TAG_LIGHTUD64 : SER_TAG_LIGHTUD32)) { uintptr_t ud = 0; if (tp == SER_TAG_LIGHTUD32) { if (LJ_UNLIKELY(r + 4 > w)) goto eob; ud = (uintptr_t)(LJ_BE ? lj_bswap(lj_getu32(r)) : lj_getu32(r)); r += 4; } #if LJ_64 else if (tp == SER_TAG_LIGHTUD64) { if (LJ_UNLIKELY(r + 8 > w)) goto eob; memcpy(&ud, r, 8); r += 8; #if LJ_BE ud = lj_bswap64(ud); #endif } setrawlightudV(o, lj_lightud_intern(sbufL(sbx), (void *)ud)); #else setrawlightudV(o, (void *)ud); #endif } else { badtag: lj_err_callerv(sbufL(sbx), LJ_ERR_BUFFER_BADDEC, tp); } return r; eob: lj_err_caller(sbufL(sbx), LJ_ERR_BUFFER_EOB); return NULL; } /* -- External serialization API ------------------------------------------ */ /* Encode to buffer. */ SBufExt * LJ_FASTCALL lj_serialize_put(SBufExt *sbx, cTValue *o) { sbx->depth = LJ_SERIALIZE_DEPTH; sbx->w = serialize_put(sbx->w, sbx, o); return sbx; } /* Decode from buffer. */ char * LJ_FASTCALL lj_serialize_get(SBufExt *sbx, TValue *o) { sbx->depth = LJ_SERIALIZE_DEPTH; return serialize_get(sbx->r, sbx, o); } /* Stand-alone encoding, borrowing from global temporary buffer. */ GCstr * LJ_FASTCALL lj_serialize_encode(lua_State *L, cTValue *o) { SBufExt sbx; char *w; memset(&sbx, 0, sizeof(SBufExt)); lj_bufx_set_borrow(L, &sbx, &G(L)->tmpbuf); sbx.depth = LJ_SERIALIZE_DEPTH; w = serialize_put(sbx.w, &sbx, o); return lj_str_new(L, sbx.b, (size_t)(w - sbx.b)); } /* Stand-alone decoding, copy-on-write from string. */ void lj_serialize_decode(lua_State *L, TValue *o, GCstr *str) { SBufExt sbx; char *r; memset(&sbx, 0, sizeof(SBufExt)); lj_bufx_set_cow(L, &sbx, strdata(str), str->len); /* No need to set sbx.cowref here. */ sbx.depth = LJ_SERIALIZE_DEPTH; r = serialize_get(sbx.r, &sbx, o); if (r != sbx.w) lj_err_caller(L, LJ_ERR_BUFFER_LEFTOV); } #if LJ_HASJIT /* Peek into buffer to find the result IRType for specialization purposes. */ LJ_FUNC MSize LJ_FASTCALL lj_serialize_peektype(SBufExt *sbx) { uint32_t tp; if (serialize_ru124(sbx->r, sbx->w, &tp)) { /* This must match the handling of all tags in the decoder above. */ switch (tp) { case SER_TAG_NIL: return IRT_NIL; case SER_TAG_FALSE: return IRT_FALSE; case SER_TAG_TRUE: return IRT_TRUE; case SER_TAG_NULL: case SER_TAG_LIGHTUD32: case SER_TAG_LIGHTUD64: return IRT_LIGHTUD; case SER_TAG_INT: return LJ_DUALNUM ? IRT_INT : IRT_NUM; case SER_TAG_NUM: return IRT_NUM; case SER_TAG_TAB: case SER_TAG_TAB+1: case SER_TAG_TAB+2: case SER_TAG_TAB+3: case SER_TAG_TAB+4: case SER_TAG_TAB+5: case SER_TAG_DICT_MT: return IRT_TAB; case SER_TAG_INT64: case SER_TAG_UINT64: case SER_TAG_COMPLEX: return IRT_CDATA; case SER_TAG_DICT_STR: default: return IRT_STR; } } return IRT_NIL; /* Will fail on actual decode. */ } #endif #endif subprojects/luajit/src/lj_vmevent.c0000644000175000017500000000302014741067622017007 0ustar aniolaniol/* ** VM event handling. ** Copyright (C) 2005-2023 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)); if (LJ_FR2) setnilV(L->top++); 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. */ } subprojects/luajit/src/lj_record.c0000644000175000017500000027525214741067622016623 0ustar aniolaniol/* ** Trace recorder (bytecode -> SSA IR). ** Copyright (C) 2005-2023 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" #if LJ_HASPROFILE #include "lj_debug.h" #endif #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" #include "lj_prng.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; lj_assertJ(nk <= REF_BIAS && nins >= REF_BIAS && nins < 65536, "inconsistent IR layout"); for (i = nk; i < nins; i++) { IRIns *ir = IR(i); uint32_t mode = lj_ir_mode[ir->o]; IRRef op1 = ir->op1; IRRef op2 = ir->op2; const char *err = NULL; switch (irm_op1(mode)) { case IRMnone: if (op1 != 0) err = "IRMnone op1 used"; break; case IRMref: if (op1 < nk || (i >= REF_BIAS ? op1 >= i : op1 <= i)) err = "IRMref op1 out of range"; break; case IRMlit: break; case IRMcst: if (i >= REF_BIAS) { err = "constant in IR range"; break; } if (irt_is64(ir->t) && ir->o != IR_KNULL) i++; continue; } switch (irm_op2(mode)) { case IRMnone: if (op2) err = "IRMnone op2 used"; break; case IRMref: if (op2 < nk || (i >= REF_BIAS ? op2 >= i : op2 <= i)) err = "IRMref op2 out of range"; break; case IRMlit: break; case IRMcst: err = "IRMcst op2"; break; } if (!err && ir->prev) { if (ir->prev < nk || (i >= REF_BIAS ? ir->prev >= i : ir->prev <= i)) err = "chain out of range"; else if (ir->o != IR_NOP && IR(ir->prev)->o != ir->o) err = "chain to different op"; } lj_assertJ(!err, "bad IR %04d op %d(%04d,%04d): %s", i-REF_BIAS, ir->o, irm_op1(mode) == IRMref ? op1-REF_BIAS : op1, irm_op2(mode) == IRMref ? op2-REF_BIAS : op2, err); } } /* 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; lj_assertJ(J->baseslot >= 1+LJ_FR2, "bad baseslot"); lj_assertJ(J->baseslot == 1+LJ_FR2 || (J->slot[J->baseslot-1] & TREF_FRAME), "baseslot does not point to frame"); lj_assertJ(nslots <= LJ_MAX_JSLOTS, "slot overflow"); for (s = 0; s < nslots; s++) { TRef tr = J->slot[s]; if (tr) { cTValue *tv = &base[s]; IRRef ref = tref_ref(tr); IRIns *ir = NULL; /* Silence compiler. */ lj_assertJ(tv < J->L->top, "slot %d above top of Lua stack", s); if (!LJ_FR2 || ref || !(tr & (TREF_FRAME | TREF_CONT))) { lj_assertJ(ref >= J->cur.nk && ref < J->cur.nins, "slot %d ref %04d out of range", s, ref - REF_BIAS); ir = IR(ref); lj_assertJ(irt_t(ir->t) == tref_t(tr), "slot %d IR type mismatch", s); } if (s == 0) { lj_assertJ(tref_isfunc(tr), "frame slot 0 is not a function"); #if LJ_FR2 } else if (s == 1) { lj_assertJ((tr & ~TREF_FRAME) == 0, "bad frame slot 1"); #endif } else if ((tr & TREF_FRAME)) { GCfunc *fn = gco2func(frame_gc(tv)); BCReg delta = (BCReg)(tv - frame_prev(tv)); #if LJ_FR2 lj_assertJ(!ref || ir_knum(ir)->u64 == tv->u64, "frame slot %d PC mismatch", s); tr = J->slot[s-1]; ir = IR(tref_ref(tr)); #endif lj_assertJ(tref_isfunc(tr), "frame slot %d is not a function", s-LJ_FR2); lj_assertJ(!tref_isk(tr) || fn == ir_kfunc(ir), "frame slot %d function mismatch", s-LJ_FR2); lj_assertJ(s > delta + LJ_FR2 ? (J->slot[s-delta] & TREF_FRAME) : (s == delta + LJ_FR2), "frame slot %d broken chain", s-LJ_FR2); depth++; } else if ((tr & TREF_CONT)) { #if LJ_FR2 lj_assertJ(!ref || ir_knum(ir)->u64 == tv->u64, "cont slot %d continuation mismatch", s); #else lj_assertJ(ir_kptr(ir) == gcrefp(tv->gcr, void), "cont slot %d continuation mismatch", s); #endif lj_assertJ((J->slot[s+1+LJ_FR2] & TREF_FRAME), "cont slot %d not followed by frame", s); depth++; } else if ((tr & TREF_KEYINDEX)) { lj_assertJ(tref_isint(tr), "keyindex slot %d bad type %d", s, tref_type(tr)); } else { /* Number repr. may differ, but other types must be the same. */ lj_assertJ(tvisnumber(tv) ? tref_isnumber(tr) : itype2irt(tv) == tref_type(tr), "slot %d type mismatch: stack type %d vs IR type %d", s, itypemap(tv), tref_type(tr)); if (tref_isk(tr)) { /* Compare constants. */ TValue tvk; lj_ir_kvalue(J->L, &tvk, ir); lj_assertJ((tvisnum(&tvk) && tvisnan(&tvk)) ? (tvisnum(tv) && tvisnan(tv)) : lj_obj_equal(tv, &tvk), "slot %d const mismatch: stack %016llx vs IR %016llx", s, tv->u64, tvk.u64); } } } } lj_assertJ(J->framedepth == depth, "frame depth mismatch %d vs %d", 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-LJ_FR2]) return J->base[-1-LJ_FR2]; /* Non-base frame functions ought to be loaded already. */ lj_assertJ(J->baseslot == 1+LJ_FR2, "bad baseslot"); return sloadt(J, -1-LJ_FR2, 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). */ } /* Emit a VLOAD with the correct type. */ TRef lj_record_vload(jit_State *J, TRef ref, MSize idx, IRType t) { TRef tr = emitir(IRTG(IR_VLOAD, t), ref, idx); if (irtype_ispri(t)) tr = TREF_PRI(t); /* Canonicalize primitives. */ return tr; } /* -- 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) && !(tr & TREF_KEYINDEX)) { 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. */ void lj_record_stop(jit_State *J, TraceLink linktype, TraceNo lnk) { #ifdef LUAJIT_ENABLE_TABLE_BUMP if (J->retryrec) lj_trace_err(J, LJ_TRERR_RETRY); #endif 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]); lj_assertJ(bc_op(*fori) == BC_FORI || bc_op(*fori) == BC_JFORI, "bad bytecode %d instead of FORI/JFORI", bc_op(*fori)); 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); lj_assertJ(tref_isnumber_str(tr[i]), "bad FORI argument type"); 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); if (!tref_isnil(getslot(J, 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, int skip) { if (ra < J->maxslot) J->maxslot = ra; J->pc += skip; 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 && J->exitno == 0) { if (pc == J->startpc && J->framedepth + J->retdepth == 0) { if (bc_op(J->cur.startins) == BC_ITERN) return; /* See rec_itern(). */ /* Same loop? */ if (ev == LOOPEV_LEAVE) /* Must loop back to form a root trace. */ lj_trace_err(J, LJ_TRERR_LLEAVE); lj_record_stop(J, LJ_TRLINK_LOOP, J->cur.traceno); /* Looping 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 && J->exitno == 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) lj_record_stop(J, LJ_TRLINK_LOOP, J->cur.traceno); /* Form extra loop. */ else lj_record_stop(J, LJ_TRLINK_ROOT, lnk); /* Link to the loop. */ } /* Side trace continues across a loop that's left or not entered. */ } /* Record ITERN. */ static LoopEvent rec_itern(jit_State *J, BCReg ra, BCReg rb) { #if LJ_BE /* YAGNI: Disabled on big-endian due to issues with lj_vm_next, ** IR_HIOP, RID_RETLO/RID_RETHI and ra_destpair. */ UNUSED(ra); UNUSED(rb); setintV(&J->errinfo, (int32_t)BC_ITERN); lj_trace_err_info(J, LJ_TRERR_NYIBC); #else RecordIndex ix; /* Since ITERN is recorded at the start, we need our own loop detection. */ if (J->pc == J->startpc && J->framedepth + J->retdepth == 0 && J->parent == 0 && J->exitno == 0) { IRRef ref = REF_FIRST + LJ_HASPROFILE; #ifdef LUAJIT_ENABLE_CHECKHOOK ref += 3; #endif if (J->cur.nins > ref || (LJ_HASPROFILE && J->cur.nins == ref && J->cur.ir[ref-1].o != IR_PROF)) { J->instunroll = 0; /* Cannot continue unrolling across an ITERN. */ lj_record_stop(J, LJ_TRLINK_LOOP, J->cur.traceno); /* Looping trace. */ return LOOPEV_ENTER; } } J->maxslot = ra; lj_snap_add(J); /* Required to make JLOOP the first ins in a side-trace. */ ix.tab = getslot(J, ra-2); ix.key = J->base[ra-1] ? J->base[ra-1] : sloadt(J, (int32_t)(ra-1), IRT_GUARD|IRT_INT, IRSLOAD_TYPECHECK|IRSLOAD_KEYINDEX); copyTV(J->L, &ix.tabv, &J->L->base[ra-2]); copyTV(J->L, &ix.keyv, &J->L->base[ra-1]); ix.idxchain = (rb < 3); /* Omit value type check, if unused. */ ix.mobj = 1; /* We need the next index, too. */ J->maxslot = ra + lj_record_next(J, &ix); J->needsnap = 1; if (!tref_isnil(ix.key)) { /* Looping back? */ J->base[ra-1] = ix.mobj | TREF_KEYINDEX; /* Control var has next index. */ J->base[ra] = ix.key; J->base[ra+1] = ix.val; J->pc += bc_j(J->pc[1])+2; return LOOPEV_ENTER; } else { J->maxslot = ra-3; J->pc += 2; return LOOPEV_LEAVE; } #endif } /* Record ISNEXT. */ static void rec_isnext(jit_State *J, BCReg ra) { cTValue *b = &J->L->base[ra-3]; if (tvisfunc(b) && funcV(b)->c.ffid == FF_next && tvistab(b+1) && tvisnil(b+2)) { /* These checks are folded away for a compiled pairs(). */ TRef func = getslot(J, ra-3); TRef trid = emitir(IRT(IR_FLOAD, IRT_U8), func, IRFL_FUNC_FFID); emitir(IRTGI(IR_EQ), trid, lj_ir_kint(J, FF_next)); (void)getslot(J, ra-2); /* Type check for table. */ (void)getslot(J, ra-1); /* Type check for nil key. */ J->base[ra-1] = lj_ir_kint(J, 0) | TREF_KEYINDEX; J->maxslot = ra; } else { /* Abort trace. Interpreter will despecialize bytecode. */ lj_trace_err(J, LJ_TRERR_RECERR); } } /* -- Record profiler hook checks ----------------------------------------- */ #if LJ_HASPROFILE /* Need to insert profiler hook check? */ static int rec_profile_need(jit_State *J, GCproto *pt, const BCIns *pc) { GCproto *ppt; lj_assertJ(J->prof_mode == 'f' || J->prof_mode == 'l', "bad profiler mode %c", J->prof_mode); if (!pt) return 0; ppt = J->prev_pt; J->prev_pt = pt; if (pt != ppt && ppt) { J->prev_line = -1; return 1; } if (J->prof_mode == 'l') { BCLine line = lj_debug_line(pt, proto_bcpos(pt, pc)); BCLine pline = J->prev_line; J->prev_line = line; if (pline != line) return 1; } return 0; } static void rec_profile_ins(jit_State *J, const BCIns *pc) { if (J->prof_mode && rec_profile_need(J, J->pt, pc)) { emitir(IRTG(IR_PROF, IRT_NIL), 0, 0); lj_snap_add(J); } } static void rec_profile_ret(jit_State *J) { if (J->prof_mode == 'f') { emitir(IRTG(IR_PROF, IRT_NIL), 0, 0); J->prev_pt = NULL; lj_snap_add(J); } } #endif /* -- 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_PGC), tr, IRFL_FUNC_PC); emitir(IRTG(IR_EQ, IRT_PGC), trpt, lj_ir_kptr(J, proto_bc(pt))); (void)lj_ir_kgc(J, obj2gco(pt), IRT_PROTO); /* Prevent GC of proto. */ return tr; } } else { /* Don't specialize to non-monomorphic builtins. */ switch (fn->c.ffid) { case FF_coroutine_wrap_aux: case FF_string_gmatch_aux: /* NYI: io_file_iter doesn't have an ffid, yet. */ { /* Specialize to the ffid. */ TRef trid = emitir(IRT(IR_FLOAD, IRT_U8), tr, IRFL_FUNC_FFID); emitir(IRTGI(IR_EQ), trid, lj_ir_kint(J, fn->c.ffid)); } return tr; default: /* NYI: don't specialize to non-monomorphic C functions. */ break; } } /* 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 kfunc, *fbase = &J->base[func]; ptrdiff_t i; (void)getslot(J, func); /* Ensure func has a reference. */ for (i = 1; i <= nargs; i++) (void)getslot(J, func+LJ_FR2+i); /* Ensure 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 > LJ_FR2; i--) /* Shift arguments up. */ fbase[i+LJ_FR2] = fbase[i+LJ_FR2-1]; #if LJ_FR2 fbase[2] = fbase[0]; #endif fbase[0] = ix.mobj; /* Replace function. */ functv = &ix.mobjv; } kfunc = rec_call_specialize(J, funcV(functv), fbase[0]); #if LJ_FR2 fbase[0] = kfunc; fbase[1] = TREF_FRAME; #else fbase[0] = kfunc | TREF_FRAME; #endif 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+LJ_FR2; J->baseslot += func+1+LJ_FR2; if (J->baseslot + J->maxslot >= LJ_MAX_JSLOTS) lj_trace_err(J, LJ_TRERR_STACKOV); } /* 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. */ if (LJ_FR2 && J->baseslot == 2) J->base[func+1] = TREF_FRAME; memmove(&J->base[-1-LJ_FR2], &J->base[func], sizeof(TRef)*(J->maxslot+1+LJ_FR2)); /* 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; } static TRef rec_cat(jit_State *J, BCReg baseslot, BCReg topslot); /* Record return. */ void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults) { TValue *frame = J->L->base - 1; ptrdiff_t i; BCReg baseadj = 0; 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); lj_assertJ(J->baseslot > 1+LJ_FR2, "bad baseslot for return"); gotresults++; baseadj += cbase; rbase += cbase; J->baseslot -= (BCReg)cbase; J->base -= cbase; J->base[--rbase] = TREF_TRUE; /* Prepend true to results. */ frame = frame_prevd(frame); J->needsnap = 1; /* Stop catching on-trace errors. */ } /* 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 && J->exitno == 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; lj_record_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); lj_assertJ(J->baseslot > 1+LJ_FR2, "bad baseslot for return"); baseadj += cbase; 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+LJ_FR2))); if ((pt->flags & PROTO_NOJIT)) lj_trace_err(J, LJ_TRERR_CJITOFF); if (J->framedepth == 0 && J->pt && frame == J->L->base - 1) { if (!J->cur.root && check_downrec_unroll(J, pt)) { J->maxslot = (BCReg)(rbase + gotresults); lj_snap_purge(J); lj_record_stop(J, LJ_TRLINK_DOWNREC, J->cur.traceno); /* Down-rec. */ return; } lj_snap_add(J); } for (i = 0; i < nresults; i++) /* Adjust results. */ J->base[i-1-LJ_FR2] = 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--; lj_assertJ(J->baseslot > cbase+1+LJ_FR2, "bad baseslot for return"); J->baseslot -= cbase+1+LJ_FR2; J->base -= cbase+1+LJ_FR2; } else if (J->parent == 0 && J->exitno == 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 if (1 + pt->framesize >= LJ_MAX_JSLOTS) { lj_trace_err(J, LJ_TRERR_STACKOV); } 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_PGC), trpt, trpc); J->retdepth++; J->needsnap = 1; J->scev.idx = REF_NIL; lj_assertJ(J->baseslot == 1+LJ_FR2, "bad baseslot for return"); /* Shift result slots up and clear the slots of the new frame below. */ memmove(J->base + cbase, J->base-1-LJ_FR2, sizeof(TRef)*nresults); memset(J->base-1-LJ_FR2, 0, sizeof(TRef)*(cbase+1+LJ_FR2)); } } 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<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) { BCReg bslot = bc_b(*(frame_contpc(frame)-1)); TRef tr = gotresults ? J->base[cbase+rbase] : TREF_NIL; if (bslot != J->maxslot) { /* Concatenate the remainder. */ /* Simulate lower frame and result. */ TValue *b = J->L->base - baseadj, save; /* Can't handle MM_concat + CALLT + fast func side-effects. */ if (J->postproc != LJ_POST_NONE) lj_trace_err(J, LJ_TRERR_NYIRETL); J->base[J->maxslot] = tr; copyTV(J->L, &save, b-(2<L, b-(2<L->base = b - cbase; tr = rec_cat(J, bslot, cbase-(2<L->base + cbase; /* Undo. */ J->L->base = b + baseadj; copyTV(J->L, b-(2<= 0xffffff00) { lj_err_throw(J->L, -(int32_t)tr); /* Propagate errors. */ } else if (tr) { /* Store final result. */ BCReg dst = bc_a(*(frame_contpc(frame)-1)); J->base[dst] = tr; if (dst >= J->maxslot) { J->maxslot = dst+1; } } /* Otherwise continue with another __concat call. */ } else { /* Result type already specialized. */ lj_assertJ(cont == lj_cont_condf || cont == lj_cont_condt, "bad continuation type"); } } else { lj_trace_err(J, LJ_TRERR_NYIRETL); /* NYI: handle return to C frame. */ } lj_assertJ(J->baseslot >= 1+LJ_FR2, "bad baseslot for return"); } /* -- Metamethod handling ------------------------------------------------- */ /* Prepare to record call to metamethod. */ static BCReg rec_mm_prep(jit_State *J, ASMFunction cont) { BCReg s, top = cont == lj_cont_cat ? J->maxslot : curr_proto(J->L)->framesize; #if LJ_FR2 J->base[top] = lj_ir_k64(J, IR_KNUM, u64ptr(contptr(cont))); J->base[top+1] = TREF_CONT; #else J->base[top] = lj_ir_kptr(J, contptr(cont)) | TREF_CONT; #endif J->framedepth++; for (s = J->maxslot; s < top; s++) J->base[s] = 0; /* Clear frame gap to avoid resurrecting previous refs. */ return top+1+LJ_FR2; } /* 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); mix.tab = emitir(IRT(IR_FLOAD, IRT_TAB), ix->tab, IRFL_UDATA_META); /* 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_PGC), 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)); ix->mt = mix.tab; ix->mtv = mt; 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); return 1; /* Got metamethod or index table. */ } } 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_ggfload(J, IRT_TAB, GG_OFS(g.gcroot[GCROOT_BASEMT+itypemap(&ix->tabv)])); 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, mm == MM_concat ? lj_cont_cat : lj_cont_ra); TRef *base = J->base + func; TValue *basev = J->L->base + func; base[1+LJ_FR2] = ix->tab; base[2+LJ_FR2] = ix->key; copyTV(J->L, basev+1+LJ_FR2, &ix->tabv); copyTV(J->L, basev+2+LJ_FR2, &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; #if LJ_FR2 base[1] = 0; #endif 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 += LJ_FR2; basev += LJ_FR2; 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 emitir(IRTI(IR_ALEN), tr, TREF_NIL); 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 + LJ_FR2; TValue *tv = J->L->base + func + LJ_FR2; base[-LJ_FR2] = ix->mobj; base[1] = ix->val; base[2] = ix->key; copyTV(J->L, tv-LJ_FR2, &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 { lj_assertJ(tref_iscdata(ix->key), "cdata expected"); 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 ------------------------------------------------------ */ #ifdef LUAJIT_ENABLE_TABLE_BUMP /* Bump table allocations in bytecode when they grow during recording. */ static void rec_idx_bump(jit_State *J, RecordIndex *ix) { RBCHashEntry *rbc = &J->rbchash[(ix->tab & (RBCHASH_SLOTS-1))]; if (tref_ref(ix->tab) == rbc->ref) { const BCIns *pc = mref(rbc->pc, const BCIns); GCtab *tb = tabV(&ix->tabv); uint32_t nhbits; IRIns *ir; if (!tvisnil(&ix->keyv)) (void)lj_tab_set(J->L, tb, &ix->keyv); /* Grow table right now. */ nhbits = tb->hmask > 0 ? lj_fls(tb->hmask)+1 : 0; ir = IR(tref_ref(ix->tab)); if (ir->o == IR_TNEW) { uint32_t ah = bc_d(*pc); uint32_t asize = ah & 0x7ff, hbits = ah >> 11; if (nhbits > hbits) hbits = nhbits; if (tb->asize > asize) { asize = tb->asize <= 0x7ff ? tb->asize : 0x7ff; } if ((asize | (hbits<<11)) != ah) { /* Has the size changed? */ /* Patch bytecode, but continue recording (for more patching). */ setbc_d(pc, (asize | (hbits<<11))); /* Patching TNEW operands is only safe if the trace is aborted. */ ir->op1 = asize; ir->op2 = hbits; J->retryrec = 1; /* Abort the trace at the end of recording. */ } } else if (ir->o == IR_TDUP) { GCtab *tpl = gco2tab(proto_kgc(&gcref(rbc->pt)->pt, ~(ptrdiff_t)bc_d(*pc))); /* Grow template table, but preserve keys with nil values. */ if ((tb->asize > tpl->asize && (1u << nhbits)-1 == tpl->hmask) || (tb->asize == tpl->asize && (1u << nhbits)-1 > tpl->hmask)) { Node *node = noderef(tpl->node); uint32_t i, hmask = tpl->hmask, asize; TValue *array; for (i = 0; i <= hmask; i++) { if (!tvisnil(&node[i].key) && tvisnil(&node[i].val)) settabV(J->L, &node[i].val, tpl); } if (!tvisnil(&ix->keyv) && tref_isk(ix->key)) { TValue *o = lj_tab_set(J->L, tpl, &ix->keyv); if (tvisnil(o)) settabV(J->L, o, tpl); } lj_tab_resize(J->L, tpl, tb->asize, nhbits); node = noderef(tpl->node); hmask = tpl->hmask; for (i = 0; i <= hmask; i++) { /* This is safe, since template tables only hold immutable values. */ if (tvistab(&node[i].val)) setnilV(&node[i].val); } /* The shape of the table may have changed. Clean up array part, too. */ asize = tpl->asize; array = tvref(tpl->array); for (i = 0; i < asize; i++) { if (tvistab(&array[i])) setnilV(&array[i]); } J->retryrec = 1; /* Abort the trace at the end of recording. */ } } } } #endif /* 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; lj_assertJ(irt_isint(J->scev.t) && ir->o == IR_SLOAD, "only int SCEV supported"); 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. */ uint32_t abc = IRTG(IR_ABC, tref_isk(asizeref) ? IRT_U32 : IRT_P32); emitir(abc, 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(abc, 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, IRRef *rbref, IRType1 *rbguard) { TRef key; GCtab *t = tabV(&ix->tabv); ix->oldv = lj_tab_get(J->L, t, &ix->keyv); /* Lookup previous value. */ *rbref = 0; rbguard->irt = 0; /* 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_PGC), ix->tab, IRFL_TAB_ARRAY); return emitir(IRT(IR_AREF, IRT_PGC), 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. */ GCSize hslot = (GCSize)((char *)ix->oldv-(char *)&noderef(t->node)[0].val); if (hslot <= t->hmask*(GCSize)sizeof(Node) && hslot <= 65535*(GCSize)sizeof(Node)) { TRef node, kslot, hm; *rbref = J->cur.nins; /* Mark possible rollback point. */ *rbguard = J->guardemit; 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_PGC), ix->tab, IRFL_TAB_NODE); kslot = lj_ir_kslot(J, key, (IRRef)(hslot / sizeof(Node))); return emitir(IRTG(IR_HREFK, IRT_PGC), node, kslot); } } /* Fall back to a regular hash lookup. */ return emitir(IRT(IR_HREF, IRT_PGC), 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; IRRef rbref; IRType1 rbguard; cTValue *oldv; while (!tref_istab(ix->tab)) { /* Handle non-table lookup. */ /* Never call raw lj_record_idx() on non-table. */ lj_assertJ(ix->idxchain != 0, "bad usage"); 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 + LJ_FR2; TValue *tv = J->L->base + func + LJ_FR2; base[-LJ_FR2] = ix->mobj; base[1] = ix->tab; base[2] = ix->key; setfuncV(J->L, tv-LJ_FR2, 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. */ } } #if LJ_HASBUFFER /* The index table of buffer objects is treated as immutable. */ if (ix->mt == TREF_NIL && !ix->val && tref_isudata(ix->tab) && udataV(&ix->tabv)->udtype == UDTYPE_BUFFER && tref_istab(ix->mobj) && tref_isstr(ix->key) && tref_isk(ix->key)) { cTValue *val = lj_tab_getstr(tabV(&ix->mobjv), strV(&ix->keyv)); TRef tr = lj_record_constify(J, val); if (tr) return tr; /* Specialize to the value, i.e. a method. */ } #endif /* 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, &rbref, &rbguard); 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_PGC), xref, lj_ir_kkptr(J, niltvg(J2G(J)))); res = TREF_NIL; } else { res = emitir(IRTG(loadop, t), xref, 0); } if (tref_ref(res) < rbref) { /* HREFK + load forwarded? */ lj_ir_rollback(J, rbref); /* Rollback to eliminate hmask guard. */ J->guardemit = rbguard; } 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 (tref_ref(xref) < rbref) { /* HREFK forwarded? */ lj_ir_rollback(J, rbref); /* Rollback to eliminate hmask guard. */ J->guardemit = rbguard; } 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_PGC), xref, lj_ir_kkptr(J, niltvg(J2G(J)))); if (ix->idxchain && lj_record_mm_lookup(J, ix, MM_newindex)) { lj_assertJ(hasmm, "inconsistent metamethod handling"); goto handlemm; } lj_assertJ(!hasmm, "inconsistent metamethod handling"); 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); } else if (tref_isnum(key)) { if (tref_isk(key)) { if (tvismzero(&ix->keyv)) key = lj_ir_knum_zero(J); /* Canonicalize -0.0 to +0.0. */ } else { emitir(IRTG(IR_EQ, IRT_NUM), key, key); /* Check for !NaN. */ } } xref = emitir(IRT(IR_NEWREF, IRT_PGC), ix->tab, key); keybarrier = 0; /* NEWREF already takes care of the key barrier. */ #ifdef LUAJIT_ENABLE_TABLE_BUMP if ((J->flags & JIT_F_OPT_SINK)) /* Avoid a separate flag. */ rec_idx_bump(J, ix); #endif } } 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_PGC), 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_PGC), ix->tab, IRFL_TAB_NOMM); emitir(IRT(IR_FSTORE, IRT_U8), fref, lj_ir_kint(J, 0)); } J->needsnap = 1; return 0; } } /* Determine result type of table traversal. */ static IRType rec_next_types(GCtab *t, uint32_t idx) { for (; idx < t->asize; idx++) { cTValue *a = arrayslot(t, idx); if (LJ_LIKELY(!tvisnil(a))) return (LJ_DUALNUM ? IRT_INT : IRT_NUM) + (itype2irt(a) << 8); } idx -= t->asize; for (; idx <= t->hmask; idx++) { Node *n = &noderef(t->node)[idx]; if (!tvisnil(&n->val)) return itype2irt(&n->key) + (itype2irt(&n->val) << 8); } return IRT_NIL + (IRT_NIL << 8); } /* Record a table traversal step aka next(). */ int lj_record_next(jit_State *J, RecordIndex *ix) { IRType t, tkey, tval; TRef trvk; t = rec_next_types(tabV(&ix->tabv), ix->keyv.u32.lo); tkey = (t & 0xff); tval = (t >> 8); trvk = lj_ir_call(J, IRCALL_lj_vm_next, ix->tab, ix->key); if (ix->mobj || tkey == IRT_NIL) { TRef idx = emitir(IRTI(IR_HIOP), trvk, trvk); /* Always check for invalid key from next() for nil result. */ if (!ix->mobj) emitir(IRTGI(IR_NE), idx, lj_ir_kint(J, -1)); ix->mobj = idx; } ix->key = lj_record_vload(J, trvk, 1, tkey); if (tkey == IRT_NIL || ix->idxchain) { /* Omit value type check. */ ix->val = TREF_NIL; return 1; } else { /* Need value. */ ix->val = lj_record_vload(J, trvk, 0, tval); return 2; } } static void rec_tsetm(jit_State *J, BCReg ra, BCReg rn, int32_t i) { RecordIndex ix; cTValue *basev = J->L->base; GCtab *t = tabV(&basev[ra-1]); settabV(J->L, &ix.tabv, t); ix.tab = getslot(J, ra-1); ix.idxchain = 0; #ifdef LUAJIT_ENABLE_TABLE_BUMP if ((J->flags & JIT_F_OPT_SINK)) { if (t->asize < i+rn-ra) lj_tab_reasize(J->L, t, i+rn-ra); setnilV(&ix.keyv); rec_idx_bump(J, &ix); } #endif for (; ra < rn; i++, ra++) { setintV(&ix.keyv, i); ix.key = lj_ir_kint(J, i); copyTV(J->L, &ix.valv, &basev[ra]); ix.val = getslot(J, ra); lj_record_idx(J, &ix); } } /* -- 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; lj_assertJ(val == 0, "bad usage"); 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); #if LJ_FR2 J->base[-2] = kfunc; #else J->base[-1] = kfunc | TREF_FRAME; #endif 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) { /* 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? */ uref = tref_ref(emitir(IRT(IR_UREFO, IRT_PGC), fn, uv)); emitir(IRTG(IR_EQ, IRT_PGC), REF_BASE, emitir(IRT(IR_ADD, IRT_PGC), uref, lj_ir_kintpgc(J, (slot - 1 - LJ_FR2) * -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; } } } /* IR_UREFO+IRT_IGC is not checked for open-ness at runtime. ** Always marked as a guard, since it might get promoted to IRT_PGC later. */ uref = emitir(IRTG(IR_UREFO, tref_isgcv(val) ? IRT_PGC : IRT_IGC), fn, uv); uref = tref_ref(uref); emitir(IRTG(IR_UGT, IRT_PGC), emitir(IRT(IR_SUB, IRT_PGC), uref, REF_BASE), lj_ir_kintpgc(J, (J->baseslot + J->maxslot) * 8)); } else { /* If fn is constant, then so is the GCupval*, and the upvalue cannot ** transition back to open, so no guard is required in this case. */ IRType t = (tref_isk(fn) ? 0 : IRT_GUARD) | IRT_PGC; uref = tref_ref(emitir(IRT(IR_UREFC, t), fn, uv)); needbarrier = 1; } 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) lj_record_stop(J, LJ_TRLINK_TAILREC, J->cur.traceno); /* Tail-rec. */ else lj_record_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_u64(&J2G(J)->prng) & 15u); } 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+LJ_FR2; lj_assertJ((pt->flags & PROTO_VARARG), "FUNCV in non-vararg function"); if (J->baseslot + vframe + pt->framesize >= LJ_MAX_JSLOTS) lj_trace_err(J, LJ_TRERR_STACKOV); J->base[vframe-1-LJ_FR2] = J->base[-1-LJ_FR2]; /* Copy function up. */ #if LJ_FR2 J->base[vframe-1] = TREF_FRAME; #endif /* 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) lj_record_stop(J, LJ_TRLINK_TAILREC, J->cur.traceno); /* Extra tail-rec. */ else lj_record_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 - LJ_FR2; lj_assertJ(frame_isvarg(J->L->base-1), "VARG in non-vararg frame"); if (LJ_FR2 && dst > J->maxslot) J->base[dst-1] = 0; /* Prevent resurrection of unrelated slot. */ if (J->framedepth > 0) { /* Simple case: varargs defined on-trace. */ ptrdiff_t i; if (nvararg < 0) nvararg = 0; if (nresults != 1) { if (nresults == -1) nresults = nvararg; J->maxslot = dst + (BCReg)nresults; } else if (dst >= J->maxslot) { J->maxslot = dst + 1; } if (J->baseslot + J->maxslot >= LJ_MAX_JSLOTS) lj_trace_err(J, LJ_TRERR_STACKOV); for (i = 0; i < nresults; i++) J->base[dst+i] = i < nvararg ? getslot(J, i - nvararg - 1 - LJ_FR2) : TREF_NIL; } else { /* Unknown number of varargs passed to trace. */ TRef fr = emitir(IRTI(IR_SLOAD), LJ_FR2, IRSLOAD_READONLY|IRSLOAD_FRAME); int32_t frofs = 8*(1+LJ_FR2+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, (int32_t)frame_ftsz(J->L->base-1))); vbase = emitir(IRT(IR_SUB, IRT_IGC), REF_BASE, fr); vbase = emitir(IRT(IR_ADD, IRT_PGC), vbase, lj_ir_kintpgc(J, frofs-8*(1+LJ_FR2))); for (i = 0; i < nload; i++) { IRType t = itype2irt(&J->L->base[i-1-LJ_FR2-nvararg]); J->base[dst+i] = lj_record_vload(J, vbase, (MSize)i, t); } } 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 (nresults != 1 || dst >= 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)) { if (tref_isstr(tridx)) tridx = emitir(IRTG(IR_STRTO, IRT_NUM), tridx, 0); 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(IRT(IR_SUB, IRT_IGC), REF_BASE, fr); vbase = emitir(IRT(IR_ADD, IRT_PGC), vbase, lj_ir_kintpgc(J, frofs-(8<L->base[idx-2-LJ_FR2-nvararg]); aref = emitir(IRT(IR_AREF, IRT_PGC), vbase, tridx); tr = lj_record_vload(J, aref, 0, t); } J->base[dst-2-LJ_FR2] = tr; J->maxslot = dst-1-LJ_FR2; 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; TRef tr; if (asize == 0x7ff) asize = 0x801; tr = emitir(IRTG(IR_TNEW, IRT_TAB), asize, hbits); #ifdef LUAJIT_ENABLE_TABLE_BUMP J->rbchash[(tr & (RBCHASH_SLOTS-1))].ref = tref_ref(tr); setmref(J->rbchash[(tr & (RBCHASH_SLOTS-1))].pc, J->pc); setgcref(J->rbchash[(tr & (RBCHASH_SLOTS-1))].pt, obj2gco(J->pt)); #endif return tr; } /* -- Concatenation ------------------------------------------------------- */ typedef struct RecCatDataCP { jit_State *J; BCReg baseslot, topslot; TRef tr; } RecCatDataCP; static TValue *rec_mm_concat_cp(lua_State *L, lua_CFunction dummy, void *ud) { RecCatDataCP *rcd = (RecCatDataCP *)ud; jit_State *J = rcd->J; BCReg baseslot = rcd->baseslot, topslot = rcd->topslot; TRef *top = &J->base[topslot]; BCReg s; RecordIndex ix; UNUSED(L); UNUSED(dummy); lj_assertJ(baseslot < topslot, "bad CAT arg"); for (s = baseslot; s <= topslot; s++) (void)getslot(J, s); /* Ensure all arguments have a reference. */ if (tref_isnumber_str(top[0]) && tref_isnumber_str(top[-1])) { TRef tr, hdr, *trp, *xbase, *base = &J->base[baseslot]; /* First convert numbers to strings. */ for (trp = top; trp >= base; trp--) { if (tref_isnumber(*trp)) *trp = emitir(IRT(IR_TOSTR, IRT_STR), *trp, tref_isnum(*trp) ? IRTOSTR_NUM : IRTOSTR_INT); else if (!tref_isstr(*trp)) break; } xbase = ++trp; tr = hdr = emitir(IRT(IR_BUFHDR, IRT_PGC), lj_ir_kptr(J, &J2G(J)->tmpbuf), IRBUFHDR_RESET); do { tr = emitir(IRTG(IR_BUFPUT, IRT_PGC), tr, *trp++); } while (trp <= top); tr = emitir(IRTG(IR_BUFSTR, IRT_STR), tr, hdr); J->maxslot = (BCReg)(xbase - J->base); if (xbase == base) { rcd->tr = tr; /* Return simple concatenation result. */ return NULL; } /* Pass partial result. */ topslot = J->maxslot--; *xbase = tr; top = xbase; setstrV(J->L, &ix.keyv, &J2G(J)->strempty); /* Simulate string result. */ } else { J->maxslot = topslot-1; copyTV(J->L, &ix.keyv, &J->L->base[topslot]); } copyTV(J->L, &ix.tabv, &J->L->base[topslot-1]); ix.tab = top[-1]; ix.key = top[0]; rec_mm_arith(J, &ix, MM_concat); /* Call __concat metamethod. */ rcd->tr = 0; /* No result yet. */ return NULL; } static TRef rec_cat(jit_State *J, BCReg baseslot, BCReg topslot) { lua_State *L = J->L; ptrdiff_t delta = L->top - L->base; TValue savetv[5+LJ_FR2], errobj; RecCatDataCP rcd; int errcode; rcd.J = J; rcd.baseslot = baseslot; rcd.topslot = topslot; memcpy(savetv, &L->base[topslot-1], sizeof(savetv)); /* Save slots. */ errcode = lj_vm_cpcall(L, NULL, &rcd, rec_mm_concat_cp); if (errcode) copyTV(L, &errobj, L->top-1); memcpy(&L->base[topslot-1], savetv, sizeof(savetv)); /* Restore slots. */ if (errcode) { L->top = L->base + delta; copyTV(L, L->top++, &errobj); return (TRef)(-errcode); } return rcd.tr; } /* -- 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. */ #if LJ_FR2 SnapEntry *flink = &J->cur.snapmap[snap->mapofs + snap->nent]; uint64_t pcbase; memcpy(&pcbase, flink, sizeof(uint64_t)); pcbase = (pcbase & 0xff) | (u64ptr(npc) << 8); memcpy(flink, &pcbase, sizeof(uint64_t)); #else J->cur.snapmap[snap->mapofs + snap->nent] = SNAP_MKPC(npc); #endif 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 = (const BCIns *)(uintptr_t)J2G(J)->tmptv.u64; 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: lj_assertJ(0, "bad post-processing mode"); break; } J->postproc = LJ_POST_NONE; } /* Need snapshot before recording next bytecode (e.g. after a store). */ if (J->needsnap) { J->needsnap = 0; if (J->pt) 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 #if LJ_HASPROFILE rec_profile_ins(J, pc); #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: setpriV(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)) : tv->u32.hi == LJ_KEYINDEX ? (lj_ir_kint(J, 0) | TREF_KEYINDEX) : 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; case BC_ISTYPE: case BC_ISNUM: /* These coercions need to correspond with lj_meta_istype(). */ if (LJ_DUALNUM && rc == ~LJ_TNUMX+1) ra = lj_opt_narrow_toint(J, ra); else if (rc == ~LJ_TNUMX+2) ra = lj_ir_tonum(J, ra); else if (rc == ~LJ_TSTR+1) ra = lj_ir_tostr(J, ra); /* else: type specialization suffices. */ J->base[bc_a(ins)] = ra; 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 = emitir(IRTI(IR_ALEN), rc, TREF_NIL); 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_arith(J, rb, rc, rbv, rcv, IR_POW); else rc = rec_mm_arith(J, &ix, MM_pow); break; /* -- Miscellaneous ops ------------------------------------------------- */ case BC_CAT: rc = rec_cat(J, rb, rc); if (rc >= 0xffffff00) lj_err_throw(J->L, -(int32_t)rc); /* Propagate errors. */ break; /* -- Constant and move ops --------------------------------------------- */ case BC_MOV: /* Clear gap of method call to avoid resurrecting previous refs. */ if (ra > J->maxslot) { #if LJ_FR2 memset(J->base + J->maxslot, 0, (ra - J->maxslot) * sizeof(TRef)); #else J->base[ra-1] = 0; #endif } 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: if (LJ_FR2 && ra > J->maxslot) J->base[ra-1] = 0; 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_TGETR: case BC_TSETR: ix.idxchain = 0; rc = lj_record_idx(J, &ix); break; case BC_TSETM: rec_tsetm(J, ra, (BCReg)(J->L->top - J->L->base), (int32_t)rcv->u32.lo); J->maxslot = ra; /* The table slot at ra-1 is the highest used slot. */ 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); #ifdef LUAJIT_ENABLE_TABLE_BUMP J->rbchash[(rc & (RBCHASH_SLOTS-1))].ref = tref_ref(rc); setmref(J->rbchash[(rc & (RBCHASH_SLOTS-1))].pc, pc); setgcref(J->rbchash[(rc & (RBCHASH_SLOTS-1))].pt, obj2gco(J->pt)); #endif break; /* -- Calls and vararg handling ----------------------------------------- */ case BC_ITERC: J->base[ra] = getslot(J, ra-3); J->base[ra+1+LJ_FR2] = getslot(J, ra-2); J->base[ra+2+LJ_FR2] = 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+LJ_FR2, b-2); copyTV(J->L, b+2+LJ_FR2, 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 - LJ_FR2; /* 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 - LJ_FR2; /* 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: #if LJ_HASPROFILE rec_profile_ret(J); #endif 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: lj_assertJ(bc_op(pc[(ptrdiff_t)rc-BCBIAS_J]) == BC_JFORL, "JFORI does not point to JFORL"); if (rec_for(J, pc, 0) != LOOPEV_LEAVE) /* Link to existing loop. */ lj_record_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_ITERN: rec_loop_interp(J, pc, rec_itern(J, ra, rb)); break; case BC_LOOP: rec_loop_interp(J, pc, rec_loop(J, ra, 1)); 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, !bc_isret(bc_op(traceref(J, rc)->startins)) && bc_op(traceref(J, rc)->startins) != BC_ITERN)); 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; case BC_ISNEXT: rec_isnext(J, ra); 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: /* Cannot happen. No hotcall counting for varag funcs. */ lj_assertJ(0, "unsupported vararg hotcall"); 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_UCLO: case BC_FNEW: 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) { #if LJ_FR2 if (ra > J->maxslot) J->base[ra-1] = 0; #endif J->maxslot = ra+1; } } #undef rav #undef rbv #undef rcv /* Limit the number of recorded IR instructions and constants. */ if (J->cur.nins > REF_FIRST+(IRRef)J->param[JIT_P_maxrecord] || J->cur.nk < REF_BIAS-(IRRef)J->param[JIT_P_maxirconst]) 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: if (bc_op(pc[-1]) == BC_JLOOP) lj_trace_err(J, LJ_TRERR_LINNER); lj_assertJ(bc_op(pc[-1]) == BC_ITERC, "no ITERC before ITERL"); J->maxslot = ra + bc_b(pc[-1]) - 1; J->bc_extent = (MSize)(-bc_j(ins))*sizeof(BCIns); pc += 1+bc_j(ins); lj_assertJ(bc_op(pc[-1]) == BC_JMP, "ITERL does not point to JMP+1"); J->bc_min = pc; break; case BC_ITERN: lj_assertJ(bc_op(pc[1]) == BC_ITERL, "no ITERL after ITERN"); J->maxslot = ra; J->bc_extent = (MSize)(-bc_j(pc[1]))*sizeof(BCIns); J->bc_min = pc+2 + bc_j(pc[1]); J->state = LJ_TRACE_RECORD_1ST; /* Record the first ITERN, too. */ 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; case BC_CALLM: case BC_CALL: case BC_ITERC: /* No bytecode range check for stitched traces. */ pc++; break; default: lj_assertJ(0, "bad root trace start bytecode %d", bc_op(ins)); 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)); #ifdef LUAJIT_ENABLE_TABLE_BUMP memset(J->rbchash, 0, sizeof(J->rbchash)); #endif memset(J->bpropcache, 0, sizeof(J->bpropcache)); J->scev.idx = REF_NIL; setmref(J->scev.pc, NULL); J->baseslot = 1+LJ_FR2; /* Invoking function is at base[-1-LJ_FR2]. */ 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_PGC), 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])) { if (bc_op(*J->pc) == BC_JLOOP) { BCIns startins = traceref(J, bc_d(*J->pc))->startins; if (bc_op(startins) == BC_ITERN) rec_itern(J, bc_a(startins), bc_b(startins)); } lj_record_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. ** The one exception is BC_ITERN, which sets LJ_TRACE_RECORD_1ST. */ lj_snap_add(J); if (bc_op(J->cur.startins) == BC_FORL) rec_for_loop(J, J->pc-1, &J->scev, 1); else if (bc_op(J->cur.startins) == BC_ITERC) J->startpc = NULL; if (1 + J->pt->framesize >= LJ_MAX_JSLOTS) lj_trace_err(J, LJ_TRERR_STACKOV); } #if LJ_HASPROFILE J->prev_pt = NULL; J->prev_line = -1; #endif #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 subprojects/luajit/src/lj_char.c0000644000175000017500000000367414741067622016257 0ustar aniolaniol/* ** 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 }; subprojects/luajit/src/lj_load.c0000644000175000017500000001066714741067622016261 0ustar aniolaniol/* ** Load and dump code. ** Copyright (C) 2005-2023 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_buf.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) { int xmode = 1; const char *mode = ls->mode; char c; while ((c = *mode++)) { if (c == (bc ? 'b' : 't')) xmode = 0; if (c == (LJ_FR2 ? 'W' : 'X')) ls->fr2 = !LJ_FR2; } if (xmode) { 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); if (ls->fr2 == LJ_FR2) { fn = lj_func_newL_empty(L, pt, tabref(L->env)); /* Don't combine above/below into one statement. */ setfuncV(L, L->top++, fn); } else { /* Non-native generation returns a dumpable, but non-runnable prototype. */ setprotoV(L, L->top++, pt); } 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_buf_init(L, &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; int err = 0; if (filename) { chunkname = lua_pushfstring(L, "@%s", filename); ctx.fp = fopen(filename, "rb"); if (ctx.fp == NULL) { L->top--; lua_pushfstring(L, "cannot open %s: %s", filename, strerror(errno)); return LUA_ERRFILE; } } else { ctx.fp = stdin; chunkname = "=stdin"; } status = lua_loadx(L, reader_file, &ctx, chunkname, mode); if (ferror(ctx.fp)) err = errno; if (filename) { fclose(ctx.fp); L->top--; copyTV(L, L->top-1, L->top); } if (err) { L->top--; lua_pushfstring(L, "cannot read %s: %s", chunkname+1, strerror(err)); return LUA_ERRFILE; } 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; uint32_t flags = LJ_FR2*BCDUMP_F_FR2; /* Default mode for legacy C API. */ lj_checkapi(L->top > L->base, "top slot empty"); if (tvisfunc(o) && isluafunc(funcV(o))) return lj_bcwrite(L, funcproto(funcV(o)), writer, data, flags); else return 1; } subprojects/luajit/src/ljamalg.c0000644000175000017500000000362614741067622016261 0ustar aniolaniol/* ** LuaJIT core and libraries amalgamation. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #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_assert.c" #include "lj_gc.c" #include "lj_err.c" #include "lj_char.c" #include "lj_bc.c" #include "lj_obj.c" #include "lj_buf.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_prng.c" #include "lj_state.c" #include "lj_dispatch.c" #include "lj_vmevent.c" #include "lj_vmmath.c" #include "lj_strscan.c" #include "lj_strfmt.c" #include "lj_strfmt_num.c" #include "lj_serialize.c" #include "lj_api.c" #include "lj_profile.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_buffer.c" #include "lib_init.c" subprojects/luajit/src/lj_profile.c0000644000175000017500000002205314741067622016772 0ustar aniolaniol/* ** Low-overhead profiling. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #define lj_profile_c #define LUA_CORE #include "lj_obj.h" #if LJ_HASPROFILE #include "lj_buf.h" #include "lj_frame.h" #include "lj_debug.h" #include "lj_dispatch.h" #if LJ_HASJIT #include "lj_jit.h" #include "lj_trace.h" #endif #include "lj_profile.h" #include "luajit.h" #if LJ_PROFILE_SIGPROF #include #include #define profile_lock(ps) UNUSED(ps) #define profile_unlock(ps) UNUSED(ps) #elif LJ_PROFILE_PTHREAD #include #include #if LJ_TARGET_PS3 #include #endif #define profile_lock(ps) pthread_mutex_lock(&ps->lock) #define profile_unlock(ps) pthread_mutex_unlock(&ps->lock) #elif LJ_PROFILE_WTHREAD #define WIN32_LEAN_AND_MEAN #if LJ_TARGET_XBOX360 #include #include #else #include #endif typedef unsigned int (WINAPI *WMM_TPFUNC)(unsigned int); #define profile_lock(ps) EnterCriticalSection(&ps->lock) #define profile_unlock(ps) LeaveCriticalSection(&ps->lock) #endif /* Profiler state. */ typedef struct ProfileState { global_State *g; /* VM state that started the profiler. */ luaJIT_profile_callback cb; /* Profiler callback. */ void *data; /* Profiler callback data. */ SBuf sb; /* String buffer for stack dumps. */ int interval; /* Sample interval in milliseconds. */ int samples; /* Number of samples for next callback. */ int vmstate; /* VM state when profile timer triggered. */ #if LJ_PROFILE_SIGPROF struct sigaction oldsa; /* Previous SIGPROF state. */ #elif LJ_PROFILE_PTHREAD pthread_mutex_t lock; /* g->hookmask update lock. */ pthread_t thread; /* Timer thread. */ int abort; /* Abort timer thread. */ #elif LJ_PROFILE_WTHREAD #if LJ_TARGET_WINDOWS HINSTANCE wmm; /* WinMM library handle. */ WMM_TPFUNC wmm_tbp; /* WinMM timeBeginPeriod function. */ WMM_TPFUNC wmm_tep; /* WinMM timeEndPeriod function. */ #endif CRITICAL_SECTION lock; /* g->hookmask update lock. */ HANDLE thread; /* Timer thread. */ int abort; /* Abort timer thread. */ #endif } ProfileState; /* Sadly, we have to use a static profiler state. ** ** The SIGPROF variant needs a static pointer to the global state, anyway. ** And it would be hard to extend for multiple threads. You can still use ** multiple VMs in multiple threads, but only profile one at a time. */ static ProfileState profile_state; /* Default sample interval in milliseconds. */ #define LJ_PROFILE_INTERVAL_DEFAULT 10 /* -- Profiler/hook interaction ------------------------------------------- */ #if !LJ_PROFILE_SIGPROF void LJ_FASTCALL lj_profile_hook_enter(global_State *g) { ProfileState *ps = &profile_state; if (ps->g) { profile_lock(ps); hook_enter(g); profile_unlock(ps); } else { hook_enter(g); } } void LJ_FASTCALL lj_profile_hook_leave(global_State *g) { ProfileState *ps = &profile_state; if (ps->g) { profile_lock(ps); hook_leave(g); profile_unlock(ps); } else { hook_leave(g); } } #endif /* -- Profile callbacks --------------------------------------------------- */ /* Callback from profile hook (HOOK_PROFILE already cleared). */ void LJ_FASTCALL lj_profile_interpreter(lua_State *L) { ProfileState *ps = &profile_state; global_State *g = G(L); uint8_t mask; profile_lock(ps); mask = (g->hookmask & ~HOOK_PROFILE); if (!(mask & HOOK_VMEVENT)) { int samples = ps->samples; ps->samples = 0; g->hookmask = HOOK_VMEVENT; lj_dispatch_update(g); profile_unlock(ps); ps->cb(ps->data, L, samples, ps->vmstate); /* Invoke user callback. */ profile_lock(ps); mask |= (g->hookmask & HOOK_PROFILE); } g->hookmask = mask; lj_dispatch_update(g); profile_unlock(ps); } /* Trigger profile hook. Asynchronous call from OS-specific profile timer. */ static void profile_trigger(ProfileState *ps) { global_State *g = ps->g; uint8_t mask; profile_lock(ps); ps->samples++; /* Always increment number of samples. */ mask = g->hookmask; if (!(mask & (HOOK_PROFILE|HOOK_VMEVENT|HOOK_GC))) { /* Set profile hook. */ int st = g->vmstate; ps->vmstate = st >= 0 ? 'N' : st == ~LJ_VMST_INTERP ? 'I' : st == ~LJ_VMST_C ? 'C' : st == ~LJ_VMST_GC ? 'G' : 'J'; g->hookmask = (mask | HOOK_PROFILE); lj_dispatch_update(g); } profile_unlock(ps); } /* -- OS-specific profile timer handling ---------------------------------- */ #if LJ_PROFILE_SIGPROF /* SIGPROF handler. */ static void profile_signal(int sig) { UNUSED(sig); profile_trigger(&profile_state); } /* Start profiling timer. */ static void profile_timer_start(ProfileState *ps) { int interval = ps->interval; struct itimerval tm; struct sigaction sa; tm.it_value.tv_sec = tm.it_interval.tv_sec = interval / 1000; tm.it_value.tv_usec = tm.it_interval.tv_usec = (interval % 1000) * 1000; setitimer(ITIMER_PROF, &tm, NULL); #if LJ_TARGET_QNX sa.sa_flags = 0; #else sa.sa_flags = SA_RESTART; #endif sa.sa_handler = profile_signal; sigemptyset(&sa.sa_mask); sigaction(SIGPROF, &sa, &ps->oldsa); } /* Stop profiling timer. */ static void profile_timer_stop(ProfileState *ps) { struct itimerval tm; tm.it_value.tv_sec = tm.it_interval.tv_sec = 0; tm.it_value.tv_usec = tm.it_interval.tv_usec = 0; setitimer(ITIMER_PROF, &tm, NULL); sigaction(SIGPROF, &ps->oldsa, NULL); } #elif LJ_PROFILE_PTHREAD /* POSIX timer thread. */ static void *profile_thread(ProfileState *ps) { int interval = ps->interval; #if !LJ_TARGET_PS3 struct timespec ts; ts.tv_sec = interval / 1000; ts.tv_nsec = (interval % 1000) * 1000000; #endif while (1) { #if LJ_TARGET_PS3 sys_timer_usleep(interval * 1000); #else nanosleep(&ts, NULL); #endif if (ps->abort) break; profile_trigger(ps); } return NULL; } /* Start profiling timer thread. */ static void profile_timer_start(ProfileState *ps) { pthread_mutex_init(&ps->lock, 0); ps->abort = 0; pthread_create(&ps->thread, NULL, (void *(*)(void *))profile_thread, ps); } /* Stop profiling timer thread. */ static void profile_timer_stop(ProfileState *ps) { ps->abort = 1; pthread_join(ps->thread, NULL); pthread_mutex_destroy(&ps->lock); } #elif LJ_PROFILE_WTHREAD /* Windows timer thread. */ static DWORD WINAPI profile_thread(void *psx) { ProfileState *ps = (ProfileState *)psx; int interval = ps->interval; #if LJ_TARGET_WINDOWS && !LJ_TARGET_UWP ps->wmm_tbp(interval); #endif while (1) { Sleep(interval); if (ps->abort) break; profile_trigger(ps); } #if LJ_TARGET_WINDOWS && !LJ_TARGET_UWP ps->wmm_tep(interval); #endif return 0; } /* Start profiling timer thread. */ static void profile_timer_start(ProfileState *ps) { #if LJ_TARGET_WINDOWS && !LJ_TARGET_UWP if (!ps->wmm) { /* Load WinMM library on-demand. */ ps->wmm = LJ_WIN_LOADLIBA("winmm.dll"); if (ps->wmm) { ps->wmm_tbp = (WMM_TPFUNC)GetProcAddress(ps->wmm, "timeBeginPeriod"); ps->wmm_tep = (WMM_TPFUNC)GetProcAddress(ps->wmm, "timeEndPeriod"); if (!ps->wmm_tbp || !ps->wmm_tep) { ps->wmm = NULL; return; } } } #endif InitializeCriticalSection(&ps->lock); ps->abort = 0; ps->thread = CreateThread(NULL, 0, profile_thread, ps, 0, NULL); } /* Stop profiling timer thread. */ static void profile_timer_stop(ProfileState *ps) { ps->abort = 1; WaitForSingleObject(ps->thread, INFINITE); DeleteCriticalSection(&ps->lock); } #endif /* -- Public profiling API ------------------------------------------------ */ /* Start profiling. */ LUA_API void luaJIT_profile_start(lua_State *L, const char *mode, luaJIT_profile_callback cb, void *data) { ProfileState *ps = &profile_state; int interval = LJ_PROFILE_INTERVAL_DEFAULT; while (*mode) { int m = *mode++; switch (m) { case 'i': interval = 0; while (*mode >= '0' && *mode <= '9') interval = interval * 10 + (*mode++ - '0'); if (interval <= 0) interval = 1; break; #if LJ_HASJIT case 'l': case 'f': L2J(L)->prof_mode = m; lj_trace_flushall(L); break; #endif default: /* Ignore unknown mode chars. */ break; } } if (ps->g) { luaJIT_profile_stop(L); if (ps->g) return; /* Profiler in use by another VM. */ } ps->g = G(L); ps->interval = interval; ps->cb = cb; ps->data = data; ps->samples = 0; lj_buf_init(L, &ps->sb); profile_timer_start(ps); } /* Stop profiling. */ LUA_API void luaJIT_profile_stop(lua_State *L) { ProfileState *ps = &profile_state; global_State *g = ps->g; if (G(L) == g) { /* Only stop profiler if started by this VM. */ profile_timer_stop(ps); g->hookmask &= ~HOOK_PROFILE; lj_dispatch_update(g); #if LJ_HASJIT G2J(g)->prof_mode = 0; lj_trace_flushall(L); #endif lj_buf_free(g, &ps->sb); ps->sb.w = ps->sb.e = NULL; ps->g = NULL; } } /* Return a compact stack dump. */ LUA_API const char *luaJIT_profile_dumpstack(lua_State *L, const char *fmt, int depth, size_t *len) { ProfileState *ps = &profile_state; SBuf *sb = &ps->sb; setsbufL(sb, L); lj_buf_reset(sb); lj_debug_dumpstack(L, sb, fmt, depth); *len = (size_t)sbuflen(sb); return sb->b; } #endif subprojects/luajit/src/lj_asm_arm64.h0000644000175000017500000020617114741067622017135 0ustar aniolaniol/* ** ARM64 IR assembler (SSA IR -> machine code). ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h ** ** Contributed by Djordje Kovacevic and Stefan Pejic from RT-RK.com. ** Sponsored by Cisco Systems, Inc. */ /* -- 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 all needed exit stubs. */ 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: str lr,[sp]; bl ->vm_exit_handler; movz w0,traceno; bl <1; bl <1; ... */ for (i = nexits-1; (int32_t)i >= 0; i--) *--mxp = A64I_LE(A64I_BL | A64F_S26(-3-i)); *--mxp = A64I_LE(A64I_MOVZw | A64F_U16(as->T->traceno)); mxp--; *mxp = A64I_LE(A64I_BL | A64F_S26(((MCode *)(void *)lj_vm_exit_handler-mxp))); *--mxp = A64I_LE(A64I_STRx | A64F_D(RID_LR) | A64F_N(RID_SP)); 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, A64CC cc) { MCode *target = asm_exitstub_addr(as, as->snapno); MCode *p = as->mcp; if (LJ_UNLIKELY(p == as->invmcp)) { as->loopinv = 1; *p = A64I_B | A64F_S26(target-p); emit_cond_branch(as, cc^1, p-1); return; } emit_cond_branch(as, cc, target); } /* Emit test and branch instruction to exit for guard, if in range. */ static int asm_guardtnb(ASMState *as, A64Ins ai, Reg r, uint32_t bit) { MCode *target = asm_exitstub_addr(as, as->snapno); MCode *p = as->mcp; ptrdiff_t delta = target - p; if (LJ_UNLIKELY(p == as->invmcp)) { if (as->orignins > 1023) return 0; /* Delta might end up too large. */ as->loopinv = 1; *p = A64I_B | A64F_S26(delta); ai ^= 0x01000000u; target = p-1; } else if (LJ_UNLIKELY(delta >= 0x1fff)) { return 0; } emit_tnb(as, ai, r, bit, target); return 1; } /* Emit compare and branch instruction to exit for guard. */ static void asm_guardcnb(ASMState *as, A64Ins ai, Reg r) { MCode *target = asm_exitstub_addr(as, as->snapno); MCode *p = as->mcp; if (LJ_UNLIKELY(p == as->invmcp)) { as->loopinv = 1; *p = A64I_B | A64F_S26(target-p); emit_cnb(as, ai^0x01000000u, r, p-1); return; } emit_cnb(as, ai, r, target); } /* -- Operand fusion ------------------------------------------------------ */ /* Limit linear search to this distance. Avoids O(n^2) behavior. */ #define CONFLICT_SEARCH_LIM 31 static int asm_isk32(ASMState *as, IRRef ref, int32_t *k) { if (irref_isk(ref)) { IRIns *ir = IR(ref); if (ir->o == IR_KNULL || !irt_is64(ir->t)) { *k = ir->i; return 1; } else if (checki32((int64_t)ir_k64(ir)->u64)) { *k = (int32_t)ir_k64(ir)->u64; return 1; } } return 0; } /* 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; } #define FUSE_REG 0x40000000 /* Fuse array/hash/upvalue reference into register+offset operand. */ static Reg asm_fuseahuref(ASMState *as, IRRef ref, int32_t *ofsp, RegSet allow, A64Ins ins) { 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 (emit_checkofs(ins, ofs)) { *ofsp = ofs; return ra_alloc1(as, refa, allow); } } else { Reg base = ra_alloc1(as, ir->op1, allow); *ofsp = FUSE_REG|ra_alloc1(as, ir->op2, rset_exclude(allow, base)); return base; } } } else if (ir->o == IR_HREFK) { if (mayfuse(as, ref)) { int32_t ofs = (int32_t)(IR(ir->op2)->op2 * sizeof(Node)); if (emit_checkofs(ins, 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)); GCupval *uv = &gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv; int64_t ofs = glofs(as, &uv->tv); if (emit_checkofs(ins, ofs)) { *ofsp = (int32_t)ofs; return RID_GL; } } } else if (ir->o == IR_TMPREF) { *ofsp = (int32_t)glofs(as, &J2G(as->J)->tmptv); return RID_GL; } } *ofsp = 0; return ra_alloc1(as, ref, allow); } /* Fuse m operand into arithmetic/logic instructions. */ static uint32_t asm_fuseopm(ASMState *as, A64Ins ai, IRRef ref, RegSet allow) { IRIns *ir = IR(ref); int logical = (ai & 0x1f000000) == 0x0a000000; if (ra_hasreg(ir->r)) { ra_noweak(as, ir->r); return A64F_M(ir->r); } else if (irref_isk(ref)) { int64_t k = get_k64val(as, ref); uint32_t m = logical ? emit_isk13(k, irt_is64(ir->t)) : emit_isk12(irt_is64(ir->t) ? k : (int32_t)k); if (m) return m; } else if (mayfuse(as, ref)) { if ((ir->o >= IR_BSHL && ir->o <= IR_BSAR && irref_isk(ir->op2)) || (ir->o == IR_ADD && ir->op1 == ir->op2)) { A64Shift sh = ir->o == IR_BSHR ? A64SH_LSR : ir->o == IR_BSAR ? A64SH_ASR : A64SH_LSL; int shift = ir->o == IR_ADD ? 1 : (IR(ir->op2)->i & (irt_is64(ir->t) ? 63 : 31)); IRIns *irl = IR(ir->op1); if (sh == A64SH_LSL && irl->o == IR_CONV && !logical && irl->op2 == ((IRT_I64<op1, allow); return A64F_M(m) | A64F_EXSH(A64EX_SXTW, shift); } else { Reg m = ra_alloc1(as, ir->op1, allow); return A64F_M(m) | A64F_SH(sh, shift); } } else if (ir->o == IR_BROR && logical && irref_isk(ir->op2)) { Reg m = ra_alloc1(as, ir->op1, allow); int shift = (IR(ir->op2)->i & (irt_is64(ir->t) ? 63 : 31)); return A64F_M(m) | A64F_SH(A64SH_ROR, shift); } else if (ir->o == IR_CONV && !logical && ir->op2 == ((IRT_I64<op1, allow); return A64F_M(m) | A64F_EX(A64EX_SXTW); } } return A64F_M(ra_allocref(as, ref, allow)); } /* Fuse XLOAD/XSTORE reference into load/store operand. */ static void asm_fusexref(ASMState *as, A64Ins ai, Reg rd, IRRef ref, RegSet allow) { IRIns *ir = IR(ref); Reg base; int32_t ofs = 0; if (ra_noreg(ir->r) && canfuse(as, ir)) { if (ir->o == IR_ADD) { if (asm_isk32(as, ir->op2, &ofs) && emit_checkofs(ai, ofs)) { ref = ir->op1; } else { Reg rn, rm; IRRef lref = ir->op1, rref = ir->op2; IRIns *irl = IR(lref); if (mayfuse(as, irl->op1)) { unsigned int shift = 4; if (irl->o == IR_BSHL && irref_isk(irl->op2)) { shift = (IR(irl->op2)->i & 63); } else if (irl->o == IR_ADD && irl->op1 == irl->op2) { shift = 1; } if ((ai >> 30) == shift) { lref = irl->op1; irl = IR(lref); ai |= A64I_LS_SH; } } if (irl->o == IR_CONV && irl->op2 == ((IRT_I64<op1; ai |= A64I_LS_SXTWx; } else { ai |= A64I_LS_LSLx; } rm = ra_alloc1(as, lref, allow); rn = ra_alloc1(as, rref, rset_exclude(allow, rm)); emit_dnm(as, (ai^A64I_LS_R), (rd & 31), rn, rm); return; } } else if (ir->o == IR_STRREF) { if (asm_isk32(as, ir->op2, &ofs)) { ref = ir->op1; } else if (asm_isk32(as, ir->op1, &ofs)) { ref = ir->op2; } else { Reg refk = irref_isk(ir->op1) ? ir->op1 : ir->op2; Reg refv = irref_isk(ir->op1) ? ir->op2 : ir->op1; Reg rn = ra_alloc1(as, refv, allow); IRIns *irr = IR(refk); uint32_t m; if (irr+1 == ir && !ra_used(irr) && irr->o == IR_ADD && irref_isk(irr->op2)) { ofs = sizeof(GCstr) + IR(irr->op2)->i; if (emit_checkofs(ai, ofs)) { Reg rm = ra_alloc1(as, irr->op1, rset_exclude(allow, rn)); m = A64F_M(rm) | A64F_EX(A64EX_SXTW); goto skipopm; } } m = asm_fuseopm(as, 0, refk, rset_exclude(allow, rn)); ofs = sizeof(GCstr); skipopm: emit_lso(as, ai, rd, rd, ofs); emit_dn(as, A64I_ADDx^m, rd, rn); return; } ofs += sizeof(GCstr); if (!emit_checkofs(ai, ofs)) { Reg rn = ra_alloc1(as, ref, allow); Reg rm = ra_allock(as, ofs, rset_exclude(allow, rn)); emit_dnm(as, (ai^A64I_LS_R)|A64I_LS_UXTWx, rd, rn, rm); return; } } } base = ra_alloc1(as, ref, allow); emit_lso(as, ai, (rd & 31), base, ofs); } /* Fuse FP multiply-add/sub. */ static int asm_fusemadd(ASMState *as, IRIns *ir, A64Ins ai, A64Ins air) { IRRef lref = ir->op1, rref = ir->op2; IRIns *irm; if ((as->flags & JIT_F_OPT_FMA) && 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 left = ra_alloc2(as, irm, rset_exclude(rset_exclude(RSET_FPR, dest), add)); Reg right = (left >> 8); left &= 255; emit_dnma(as, ai, (dest & 31), (left & 31), (right & 31), (add & 31)); return 1; } return 0; } /* Fuse BAND + BSHL/BSHR into UBFM. */ static int asm_fuseandshift(ASMState *as, IRIns *ir) { IRIns *irl = IR(ir->op1); lj_assertA(ir->o == IR_BAND, "bad usage"); if (canfuse(as, irl) && irref_isk(ir->op2)) { uint64_t mask = get_k64val(as, ir->op2); if (irref_isk(irl->op2) && (irl->o == IR_BSHR || irl->o == IR_BSHL)) { int32_t shmask = irt_is64(irl->t) ? 63 : 31; int32_t shift = (IR(irl->op2)->i & shmask); int32_t imms = shift; if (irl->o == IR_BSHL) { mask >>= shift; shift = (shmask-shift+1) & shmask; imms = 0; } if (mask && !((mask+1) & mask)) { /* Contiguous 1-bits at the bottom. */ Reg dest = ra_dest(as, ir, RSET_GPR); Reg left = ra_alloc1(as, irl->op1, RSET_GPR); A64Ins ai = shmask == 63 ? A64I_UBFMx : A64I_UBFMw; imms += 63 - emit_clz64(mask); if (imms > shmask) imms = shmask; emit_dn(as, ai | A64F_IMMS(imms) | A64F_IMMR(shift), dest, left); return 1; } } } return 0; } /* Fuse BOR(BSHL, BSHR) into EXTR/ROR. */ static int asm_fuseorshift(ASMState *as, IRIns *ir) { IRIns *irl = IR(ir->op1), *irr = IR(ir->op2); lj_assertA(ir->o == IR_BOR, "bad usage"); if (canfuse(as, irl) && canfuse(as, irr) && ((irl->o == IR_BSHR && irr->o == IR_BSHL) || (irl->o == IR_BSHL && irr->o == IR_BSHR))) { if (irref_isk(irl->op2) && irref_isk(irr->op2)) { IRRef lref = irl->op1, rref = irr->op1; uint32_t lshift = IR(irl->op2)->i, rshift = IR(irr->op2)->i; if (irl->o == IR_BSHR) { /* BSHR needs to be the right operand. */ uint32_t tmp2; IRRef tmp1 = lref; lref = rref; rref = tmp1; tmp2 = lshift; lshift = rshift; rshift = tmp2; } if (rshift + lshift == (irt_is64(ir->t) ? 64 : 32)) { A64Ins ai = irt_is64(ir->t) ? A64I_EXTRx : A64I_EXTRw; Reg dest = ra_dest(as, ir, RSET_GPR); Reg left = ra_alloc1(as, lref, RSET_GPR); Reg right = ra_alloc1(as, rref, rset_exclude(RSET_GPR, left)); emit_dnm(as, ai | A64F_IMMS(rshift), dest, left, right); 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_XNARGS(ci); int32_t spofs = 0, spalign = LJ_HASFFI && LJ_TARGET_OSX ? 0 : 7; Reg gpr, fpr = REGARG_FIRSTFPR; if (ci->func) emit_call(as, ci->func); for (gpr = REGARG_FIRSTGPR; gpr <= REGARG_LASTGPR; gpr++) as->cost[gpr] = REGCOST(~0u, ASMREF_L); gpr = REGARG_FIRSTGPR; #if LJ_HASFFI && LJ_ABI_WIN if ((ci->flags & CCI_VARARG)) { fpr = REGARG_LASTFPR+1; } #endif for (n = 0; n < nargs; n++) { /* Setup args. */ IRRef ref = args[n]; IRIns *ir = IR(ref); if (ref) { if (irt_isfp(ir->t)) { if (fpr <= REGARG_LASTFPR) { lj_assertA(rset_test(as->freeset, fpr), "reg %d not free", fpr); /* Must have been evicted. */ ra_leftov(as, fpr, ref); fpr++; #if LJ_HASFFI && LJ_ABI_WIN } else if ((ci->flags & CCI_VARARG) && (gpr <= REGARG_LASTGPR)) { Reg rf = ra_alloc1(as, ref, RSET_FPR); emit_dn(as, A64I_FMOV_R_D, gpr++, rf & 31); #endif } else { Reg r = ra_alloc1(as, ref, RSET_FPR); int32_t al = spalign; #if LJ_HASFFI && LJ_TARGET_OSX al |= irt_isnum(ir->t) ? 7 : 3; #endif spofs = (spofs + al) & ~al; if (LJ_BE && al >= 7 && !irt_isnum(ir->t)) spofs += 4, al -= 4; emit_spstore(as, ir, r, spofs); spofs += al + 1; } } else { if (gpr <= REGARG_LASTGPR) { lj_assertA(rset_test(as->freeset, gpr), "reg %d not free", gpr); /* Must have been evicted. */ ra_leftov(as, gpr, ref); gpr++; } else { Reg r = ra_alloc1(as, ref, RSET_GPR); int32_t al = spalign; #if LJ_HASFFI && LJ_TARGET_OSX al |= irt_size(ir->t) - 1; #endif spofs = (spofs + al) & ~al; if (al >= 3) { if (LJ_BE && al >= 7 && !irt_is64(ir->t)) spofs += 4, al -= 4; emit_spstore(as, ir, r, spofs); } else { lj_assertA(al == 0 || al == 1, "size %d unexpected", al + 1); emit_lso(as, al ? A64I_STRH : A64I_STRB, r, RID_SP, spofs); } spofs += al + 1; } } #if LJ_HASFFI && LJ_TARGET_OSX } else { /* Marker for start of varargs. */ gpr = REGARG_LASTGPR+1; fpr = REGARG_LASTFPR+1; spalign = 7; #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 = ((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)) { lj_assertA(!irt_ispri(ir->t), "PRI dest"); if (irt_isfp(ir->t)) { if (ci->flags & CCI_CASTU64) { Reg dest = ra_dest(as, ir, RSET_FPR) & 31; emit_dn(as, irt_isnum(ir->t) ? A64I_FMOV_D_R : A64I_FMOV_S_R, dest, RID_RET); } 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_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)(ir_k64(irf)->u64); } else { /* Need a non-argument register for indirect calls. */ Reg freg = ra_alloc1(as, func, RSET_RANGE(RID_X8, RID_MAX_GPR)-RSET_FIXED); emit_n(as, A64I_BLR_AUTH, 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+LJ_FR2+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_nm(as, A64I_CMPx, RID_TMP, ra_allock(as, i64ptr(pc), rset_exclude(RSET_GPR, base))); emit_lso(as, A64I_LDRx, RID_TMP, base, -8); } /* -- Buffer operations --------------------------------------------------- */ #if LJ_HASBUFFER static void asm_bufhdr_write(ASMState *as, Reg sb) { Reg tmp = ra_scratch(as, rset_exclude(RSET_GPR, sb)); IRIns irgc; irgc.ot = IRT(0, IRT_PGC); /* GC type. */ emit_storeofs(as, &irgc, RID_TMP, sb, offsetof(SBuf, L)); emit_dn(as, A64I_BFMx | A64F_IMMS(lj_fls(SBUF_MASK_FLAG)) | A64F_IMMR(0), RID_TMP, tmp); emit_getgl(as, RID_TMP, cur_L); emit_loadofs(as, &irgc, tmp, sb, offsetof(SBuf, L)); } #endif /* -- 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_NE); emit_nm(as, A64I_FCMPd, (tmp & 31), (left & 31)); emit_dn(as, A64I_FCVT_F64_S32, (tmp & 31), dest); emit_dn(as, A64I_FCVT_S32_F64, dest, (left & 31)); } 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, A64I_FMOV_R_S, dest, (tmp & 31)); emit_dnm(as, A64I_FADDd, (tmp & 31), (left & 31), (right & 31)); } static void asm_conv(ASMState *as, IRIns *ir) { IRType st = (IRType)(ir->op2 & IRCONV_SRCMASK); int st64 = (st == IRT_I64 || st == IRT_U64 || st == IRT_P64); int stfp = (st == IRT_NUM || st == IRT_FLOAT); IRRef lref = ir->op1; lj_assertA(irt_type(ir->t) != st, "inconsistent types for CONV"); if (irt_isfp(ir->t)) { Reg dest = ra_dest(as, ir, RSET_FPR); if (stfp) { /* FP to FP conversion. */ emit_dn(as, st == IRT_NUM ? A64I_FCVT_F32_F64 : A64I_FCVT_F64_F32, (dest & 31), (ra_alloc1(as, lref, RSET_FPR) & 31)); } else { /* Integer to FP conversion. */ Reg left = ra_alloc1(as, lref, RSET_GPR); A64Ins ai = irt_isfloat(ir->t) ? (((IRT_IS64 >> st) & 1) ? (st == IRT_I64 ? A64I_FCVT_F32_S64 : A64I_FCVT_F32_U64) : (st == IRT_INT ? A64I_FCVT_F32_S32 : A64I_FCVT_F32_U32)) : (((IRT_IS64 >> st) & 1) ? (st == IRT_I64 ? A64I_FCVT_F64_S64 : A64I_FCVT_F64_U64) : (st == IRT_INT ? A64I_FCVT_F64_S32 : A64I_FCVT_F64_U32)); emit_dn(as, ai, (dest & 31), left); } } else if (stfp) { /* FP to integer conversion. */ if (irt_isguard(ir->t)) { /* Checked conversions are only supported from number to int. */ lj_assertA(irt_isint(ir->t) && st == IRT_NUM, "bad type for checked CONV"); asm_tointg(as, ir, ra_alloc1(as, lref, RSET_FPR)); } else { Reg left = ra_alloc1(as, lref, RSET_FPR); Reg dest = ra_dest(as, ir, RSET_GPR); A64Ins ai = irt_is64(ir->t) ? (st == IRT_NUM ? (irt_isi64(ir->t) ? A64I_FCVT_S64_F64 : A64I_FCVT_U64_F64) : (irt_isi64(ir->t) ? A64I_FCVT_S64_F32 : A64I_FCVT_U64_F32)) : (st == IRT_NUM ? (irt_isint(ir->t) ? A64I_FCVT_S32_F64 : A64I_FCVT_U32_F64) : (irt_isint(ir->t) ? A64I_FCVT_S32_F32 : A64I_FCVT_U32_F32)); emit_dn(as, ai, dest, (left & 31)); } } else if (st >= IRT_I8 && st <= IRT_U16) { /* Extend to 32 bit integer. */ Reg dest = ra_dest(as, ir, RSET_GPR); Reg left = ra_alloc1(as, lref, RSET_GPR); A64Ins ai = st == IRT_I8 ? A64I_SXTBw : st == IRT_U8 ? A64I_UXTBw : st == IRT_I16 ? A64I_SXTHw : A64I_UXTHw; lj_assertA(irt_isint(ir->t) || irt_isu32(ir->t), "bad type for CONV EXT"); emit_dn(as, ai, dest, left); } else { Reg dest = ra_dest(as, ir, RSET_GPR); if (irt_is64(ir->t)) { if (st64 || !(ir->op2 & IRCONV_SEXT)) { /* 64/64 bit no-op (cast) or 32 to 64 bit zero extension. */ ra_leftov(as, dest, lref); /* Do nothing, but may need to move regs. */ } else { /* 32 to 64 bit sign extension. */ Reg left = ra_alloc1(as, lref, RSET_GPR); emit_dn(as, A64I_SXTW, dest, left); } } else { if (st64 && !(ir->op2 & IRCONV_NONE)) { /* This is either a 32 bit reg/reg mov which zeroes the hiword ** or a load of the loword from a 64 bit address. */ Reg left = ra_alloc1(as, lref, RSET_GPR); emit_dm(as, A64I_MOVw, dest, left); } else { /* 32/32 bit no-op (cast). */ ra_leftov(as, dest, lref); /* Do nothing, but may need to move regs. */ } } } } static void asm_strto(ASMState *as, IRIns *ir) { const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_strscan_num]; IRRef args[2]; Reg tmp; int32_t ofs = 0; ra_evictset(as, RSET_SCRATCH); if (ra_used(ir)) { if (ra_hasspill(ir->s)) { ofs = sps_scale(ir->s); if (ra_hasreg(ir->r)) { ra_free(as, ir->r); ra_modified(as, ir->r); emit_spload(as, ir, ir->r, ofs); } } else { Reg dest = ra_dest(as, ir, RSET_FPR); emit_lso(as, A64I_LDRd, (dest & 31), RID_SP, 0); } } asm_guardcnb(as, A64I_CBZ, RID_RET); args[0] = ir->op1; /* GCstr *str */ args[1] = ASMREF_TMP1; /* TValue *n */ asm_gencall(as, ci, args); tmp = ra_releasetmp(as, ASMREF_TMP1); emit_opk(as, A64I_ADDx, tmp, RID_SP, ofs, RSET_GPR); } /* -- Memory references --------------------------------------------------- */ /* Store tagged value for ref at base+ofs. */ static void asm_tvstore64(ASMState *as, Reg base, int32_t ofs, IRRef ref) { RegSet allow = rset_exclude(RSET_GPR, base); IRIns *ir = IR(ref); lj_assertA(irt_ispri(ir->t) || irt_isaddr(ir->t) || irt_isinteger(ir->t), "store of IR type %d", irt_type(ir->t)); if (irref_isk(ref)) { TValue k; lj_ir_kvalue(as->J->L, &k, ir); emit_lso(as, A64I_STRx, ra_allock(as, k.u64, allow), base, ofs); } else { Reg src = ra_alloc1(as, ref, allow); rset_clear(allow, src); if (irt_isinteger(ir->t)) { Reg type = ra_allock(as, (int64_t)irt_toitype(ir->t) << 47, allow); emit_lso(as, A64I_STRx, RID_TMP, base, ofs); emit_dnm(as, A64I_ADDx | A64F_EX(A64EX_UXTW), RID_TMP, type, src); } else { Reg type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow); emit_lso(as, A64I_STRx, RID_TMP, base, ofs); emit_dnm(as, A64I_ADDx | A64F_SH(A64SH_LSL, 47), RID_TMP, src, type); } } } /* Get pointer to TValue. */ static void asm_tvptr(ASMState *as, Reg dest, IRRef ref, MSize mode) { if ((mode & IRTMPREF_IN1)) { IRIns *ir = IR(ref); if (irt_isnum(ir->t)) { if (irref_isk(ref) && !(mode & IRTMPREF_OUT1)) { /* Use the number constant itself as a TValue. */ ra_allockreg(as, i64ptr(ir_knum(ir)), dest); return; } emit_lso(as, A64I_STRd, (ra_alloc1(as, ref, RSET_FPR) & 31), dest, 0); } else { asm_tvstore64(as, dest, 0, ref); } } /* g->tmptv holds the TValue(s). */ emit_dn(as, A64I_ADDx^emit_isk12(glofs(as, &J2G(as->J)->tmptv)), dest, RID_GL); } 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(ofs + 8*IR(ir->op2)->i); if (k) { base = ra_alloc1(as, refa, RSET_GPR); emit_dn(as, A64I_ADDx^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, A64I_ADDx | A64F_EXSH(A64EX_UXTW, 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 tmp = RID_TMP, type = RID_NONE, key = RID_NONE, tkey; IRRef refkey = ir->op2; IRIns *irkey = IR(refkey); int isk = irref_isk(refkey); IRType1 kt = irkey->t; uint32_t k = 0; uint32_t khash; MCLabel l_end, l_loop; rset_clear(allow, tab); /* Allocate register for tkey outside of the loop. */ if (isk) { int64_t kk; if (irt_isaddr(kt)) { kk = ((int64_t)irt_toitype(kt) << 47) | irkey[1].tv.u64; } else if (irt_isnum(kt)) { kk = (int64_t)ir_knum(irkey)->u64; /* Assumes -0.0 is already canonicalized to +0.0. */ } else { lj_assertA(irt_ispri(kt) && !irt_isnil(kt), "bad HREF key type"); kk = ~((int64_t)~irt_toitype(kt) << 47); } k = emit_isk12(kk); tkey = k ? 0 : ra_allock(as, kk, allow); } else { tkey = ra_scratch(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) { uint32_t k12 = emit_isk12(offsetof(global_State, nilnode.val)); lj_assertA(k12 != 0, "Cannot k12 encode niltv(L)"); emit_dn(as, A64I_ADDx^k12, dest, RID_GL); } /* Follow hash chain until the end. */ l_loop = --as->mcp; if (destused) emit_lso(as, A64I_LDRx, dest, dest, offsetof(Node, next)); /* Type and value comparison. */ if (merge == IR_EQ) asm_guardcc(as, CC_EQ); else emit_cond_branch(as, CC_EQ, l_end); emit_nm(as, A64I_CMPx^k, tmp, tkey); if (!destused) emit_lso(as, A64I_LDRx, dest, dest, offsetof(Node, next)); emit_lso(as, A64I_LDRx, tmp, dest, offsetof(Node, key)); *l_loop = A64I_X | A64I_CBNZ | A64F_S19(as->mcp - l_loop) | dest; /* Construct tkey as canonicalized or tagged key. */ if (!isk) { if (irt_isnum(kt)) { key = ra_alloc1(as, refkey, RSET_FPR); emit_dnm(as, A64I_CSELx | A64F_CC(CC_EQ), tkey, RID_ZERO, tkey); /* A64I_FMOV_R_D from key to tkey done below. */ } else { lj_assertA(irt_isaddr(kt), "bad HREF key type"); key = ra_alloc1(as, refkey, allow); type = ra_allock(as, irt_toitype(kt) << 15, rset_clear(allow, key)); emit_dnm(as, A64I_ADDx | A64F_SH(A64SH_LSL, 32), tkey, key, type); } } /* Load main position relative to tab->node into dest. */ khash = isk ? ir_khash(as, irkey) : 1; if (khash == 0) { emit_lso(as, A64I_LDRx, dest, tab, offsetof(GCtab, node)); } else { emit_dnm(as, A64I_ADDx | A64F_SH(A64SH_LSL, 3), dest, tmp, dest); emit_dnm(as, A64I_ADDx | A64F_SH(A64SH_LSL, 1), dest, dest, dest); emit_lso(as, A64I_LDRx, tmp, tab, offsetof(GCtab, node)); if (isk) { Reg tmphash = ra_allock(as, khash, allow); emit_dnm(as, A64I_ANDw, dest, dest, tmphash); emit_lso(as, A64I_LDRw, dest, tab, offsetof(GCtab, hmask)); } else if (irt_isstr(kt)) { emit_dnm(as, A64I_ANDw, dest, dest, tmp); emit_lso(as, A64I_LDRw, tmp, key, offsetof(GCstr, sid)); emit_lso(as, A64I_LDRw, dest, tab, offsetof(GCtab, hmask)); } else { /* Must match with hash*() in lj_tab.c. */ emit_dnm(as, A64I_ANDw, dest, dest, tmp); emit_lso(as, A64I_LDRw, tmp, tab, offsetof(GCtab, hmask)); emit_dnm(as, A64I_SUBw, dest, dest, tmp); emit_dnm(as, A64I_EXTRw | (A64F_IMMS(32-HASH_ROT3)), tmp, tmp, tmp); emit_dnm(as, A64I_EORw | A64F_SH(A64SH_ROR, 32-HASH_ROT2), dest, tmp, dest); emit_dnm(as, A64I_SUBw, tmp, tmp, dest); emit_dnm(as, A64I_EXTRw | (A64F_IMMS(32-HASH_ROT1)), dest, dest, dest); if (irt_isnum(kt)) { emit_dnm(as, A64I_EORw, tmp, tkey, dest); emit_dnm(as, A64I_ADDw, dest, dest, dest); emit_dn(as, A64I_LSRx | A64F_IMMR(32)|A64F_IMMS(32), dest, tkey); emit_nm(as, A64I_FCMPZd, (key & 31), 0); emit_dn(as, A64I_FMOV_R_D, tkey, (key & 31)); } else { emit_dnm(as, A64I_EORw, tmp, key, dest); emit_dnm(as, A64I_EORx | A64F_SH(A64SH_LSR, 32), dest, type, 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); int bigofs = !emit_checkofs(A64I_LDRx, kofs); Reg dest = (ra_used(ir) || bigofs) ? ra_dest(as, ir, RSET_GPR) : RID_NONE; Reg node = ra_alloc1(as, ir->op1, RSET_GPR); Reg idx = node; RegSet allow = rset_exclude(RSET_GPR, node); uint64_t k; lj_assertA(ofs % sizeof(Node) == 0, "unaligned HREFK slot"); if (bigofs) { idx = dest; rset_clear(allow, dest); kofs = (int32_t)offsetof(Node, key); } else if (ra_hasreg(dest)) { emit_opk(as, A64I_ADDx, dest, node, ofs, allow); } asm_guardcc(as, CC_NE); if (irt_ispri(irkey->t)) { k = ~((int64_t)~irt_toitype(irkey->t) << 47); } else if (irt_isnum(irkey->t)) { k = ir_knum(irkey)->u64; } else { k = ((uint64_t)irt_toitype(irkey->t) << 47) | (uint64_t)ir_kgc(irkey); } emit_nm(as, A64I_CMPx, RID_TMP, ra_allock(as, k, allow)); emit_lso(as, A64I_LDRx, RID_TMP, idx, kofs); if (bigofs) emit_opk(as, A64I_ADDx, dest, node, ofs, rset_exclude(RSET_GPR, node)); } static void asm_uref(ASMState *as, IRIns *ir) { Reg dest = ra_dest(as, ir, RSET_GPR); int guarded = (irt_t(ir->t) & (IRT_GUARD|IRT_TYPE)) == (IRT_GUARD|IRT_PGC); if (irref_isk(ir->op1) && !guarded) { GCfunc *fn = ir_kfunc(IR(ir->op1)); MRef *v = &gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.v; emit_lsptr(as, A64I_LDRx, dest, v); } else { if (guarded) asm_guardcnb(as, ir->o == IR_UREFC ? A64I_CBZ : A64I_CBNZ, RID_TMP); if (ir->o == IR_UREFC) emit_opk(as, A64I_ADDx, dest, dest, (int32_t)offsetof(GCupval, tv), RSET_GPR); else emit_lso(as, A64I_LDRx, dest, dest, (int32_t)offsetof(GCupval, v)); if (guarded) emit_lso(as, A64I_LDRB, RID_TMP, dest, (int32_t)offsetof(GCupval, closed)); if (irref_isk(ir->op1)) { GCfunc *fn = ir_kfunc(IR(ir->op1)); uint64_t k = gcrefu(fn->l.uvptr[(ir->op2 >> 8)]); emit_loadu64(as, dest, k); } else { emit_lso(as, A64I_LDRx, dest, ra_alloc1(as, ir->op1, RSET_GPR), (int32_t)offsetof(GCfuncL, uvptr) + 8*(int32_t)(ir->op2 >> 8)); } } } static void asm_fref(ASMState *as, IRIns *ir) { UNUSED(as); UNUSED(ir); lj_assertA(!ra_used(ir), "unfused FREF"); } static void asm_strref(ASMState *as, IRIns *ir) { RegSet allow = RSET_GPR; Reg dest = ra_dest(as, ir, allow); Reg base = ra_alloc1(as, ir->op1, allow); IRIns *irr = IR(ir->op2); int32_t ofs = sizeof(GCstr); uint32_t m; rset_clear(allow, base); if (irref_isk(ir->op2) && (m = emit_isk12(ofs + irr->i))) { emit_dn(as, A64I_ADDx^m, dest, base); } else { emit_dn(as, (A64I_ADDx^A64I_K12) | A64F_U12(ofs), dest, dest); emit_dnm(as, A64I_ADDx, dest, base, ra_alloc1(as, ir->op2, allow)); } } /* -- Loads and stores ---------------------------------------------------- */ static A64Ins asm_fxloadins(IRIns *ir) { switch (irt_type(ir->t)) { case IRT_I8: return A64I_LDRB ^ A64I_LS_S; case IRT_U8: return A64I_LDRB; case IRT_I16: return A64I_LDRH ^ A64I_LS_S; case IRT_U16: return A64I_LDRH; case IRT_NUM: return A64I_LDRd; case IRT_FLOAT: return A64I_LDRs; default: return irt_is64(ir->t) ? A64I_LDRx : A64I_LDRw; } } static A64Ins asm_fxstoreins(IRIns *ir) { switch (irt_type(ir->t)) { case IRT_I8: case IRT_U8: return A64I_STRB; case IRT_I16: case IRT_U16: return A64I_STRH; case IRT_NUM: return A64I_STRd; case IRT_FLOAT: return A64I_STRs; default: return irt_is64(ir->t) ? A64I_STRx : A64I_STRw; } } static void asm_fload(ASMState *as, IRIns *ir) { Reg dest = ra_dest(as, ir, RSET_GPR); Reg idx; A64Ins ai = asm_fxloadins(ir); int32_t ofs; if (ir->op1 == REF_NIL) { /* FLOAD from GG_State with offset. */ idx = RID_GL; ofs = (ir->op2 << 2) - GG_OFS(g); } else { idx = ra_alloc1(as, ir->op1, RSET_GPR); 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, (A64I_ADDx^A64I_K12) | A64F_U12(ofs), dest, idx); return; } } ofs = field_ofs[ir->op2]; } emit_lso(as, ai, (dest & 31), 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]; emit_lso(as, asm_fxstoreins(ir), (src & 31), idx, ofs); } } static void asm_xload(ASMState *as, IRIns *ir) { Reg dest = ra_dest(as, ir, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR); lj_assertA(!(ir->op2 & IRXLOAD_UNALIGNED), "unaligned XLOAD"); asm_fusexref(as, asm_fxloadins(ir), dest, ir->op1, RSET_GPR); } static void asm_xstore(ASMState *as, IRIns *ir) { if (ir->r != RID_SINK) { 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)); } } static void asm_ahuvload(ASMState *as, IRIns *ir) { Reg idx, tmp; int32_t ofs = 0; RegSet gpr = RSET_GPR, allow = irt_isnum(ir->t) ? RSET_FPR : RSET_GPR; lj_assertA(irt_isnum(ir->t) || irt_ispri(ir->t) || irt_isaddr(ir->t) || irt_isint(ir->t), "bad load type %d", irt_type(ir->t)); if (ra_used(ir)) { Reg dest = ra_dest(as, ir, allow); tmp = irt_isnum(ir->t) ? ra_scratch(as, rset_clear(gpr, dest)) : dest; if (irt_isaddr(ir->t)) { emit_dn(as, A64I_ANDx^emit_isk13(LJ_GCVMASK, 1), dest, dest); } else if (irt_isnum(ir->t)) { emit_dn(as, A64I_FMOV_D_R, (dest & 31), tmp); } else if (irt_isint(ir->t)) { emit_dm(as, A64I_MOVw, dest, dest); } } else { tmp = ra_scratch(as, gpr); } idx = asm_fuseahuref(as, ir->op1, &ofs, rset_clear(gpr, tmp), A64I_LDRx); rset_clear(gpr, idx); if (ofs & FUSE_REG) rset_clear(gpr, ofs & 31); if (ir->o == IR_VLOAD) ofs += 8 * ir->op2; /* Always do the type check, even if the load result is unused. */ asm_guardcc(as, irt_isnum(ir->t) ? CC_LS : CC_NE); if (irt_type(ir->t) >= IRT_NUM) { lj_assertA(irt_isinteger(ir->t) || irt_isnum(ir->t), "bad load type %d", irt_type(ir->t)); emit_nm(as, A64I_CMPx | A64F_SH(A64SH_LSR, 32), ra_allock(as, LJ_TISNUM << 15, gpr), tmp); } else if (irt_isaddr(ir->t)) { emit_n(as, (A64I_CMNx^A64I_K12) | A64F_U12(-irt_toitype(ir->t)), RID_TMP); emit_dn(as, A64I_ASRx | A64F_IMMR(47), RID_TMP, tmp); } else if (irt_isnil(ir->t)) { emit_n(as, (A64I_CMNx^A64I_K12) | A64F_U12(1), tmp); } else { emit_nm(as, A64I_CMPx | A64F_SH(A64SH_LSR, 32), ra_allock(as, (irt_toitype(ir->t) << 15) | 0x7fff, gpr), tmp); } if (ofs & FUSE_REG) emit_dnm(as, (A64I_LDRx^A64I_LS_R)|A64I_LS_UXTWx|A64I_LS_SH, tmp, idx, (ofs & 31)); else emit_lso(as, A64I_LDRx, tmp, idx, ofs); } static void asm_ahustore(ASMState *as, IRIns *ir) { if (ir->r != RID_SINK) { RegSet allow = RSET_GPR; Reg idx, src = RID_NONE, tmp = RID_TMP, type = RID_NONE; int32_t ofs = 0; if (irt_isnum(ir->t)) { src = ra_alloc1(as, ir->op2, RSET_FPR); idx = asm_fuseahuref(as, ir->op1, &ofs, allow, A64I_STRd); if (ofs & FUSE_REG) emit_dnm(as, (A64I_STRd^A64I_LS_R)|A64I_LS_UXTWx|A64I_LS_SH, (src & 31), idx, (ofs &31)); else emit_lso(as, A64I_STRd, (src & 31), idx, ofs); } else { if (!irt_ispri(ir->t)) { src = ra_alloc1(as, ir->op2, allow); rset_clear(allow, src); if (irt_isinteger(ir->t)) type = ra_allock(as, (uint64_t)(int32_t)LJ_TISNUM << 47, allow); else type = ra_allock(as, irt_toitype(ir->t), allow); } else { tmp = type = ra_allock(as, ~((int64_t)~irt_toitype(ir->t)<<47), allow); } idx = asm_fuseahuref(as, ir->op1, &ofs, rset_exclude(allow, type), A64I_STRx); if (ofs & FUSE_REG) emit_dnm(as, (A64I_STRx^A64I_LS_R)|A64I_LS_UXTWx|A64I_LS_SH, tmp, idx, (ofs & 31)); else emit_lso(as, A64I_STRx, tmp, idx, ofs); if (ra_hasreg(src)) { if (irt_isinteger(ir->t)) { emit_dnm(as, A64I_ADDx | A64F_EX(A64EX_UXTW), tmp, type, src); } else { emit_dnm(as, A64I_ADDx | A64F_SH(A64SH_LSL, 47), tmp, src, type); } } } } } static void asm_sload(ASMState *as, IRIns *ir) { int32_t ofs = 8*((int32_t)ir->op1-2); IRType1 t = ir->t; Reg dest = RID_NONE, base; RegSet allow = RSET_GPR; lj_assertA(!(ir->op2 & IRSLOAD_PARENT), "bad parent SLOAD"); /* Handled by asm_head_side(). */ lj_assertA(irt_isguard(t) || !(ir->op2 & IRSLOAD_TYPECHECK), "inconsistent SLOAD variant"); 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)) { Reg tmp = RID_NONE; if ((ir->op2 & IRSLOAD_CONVERT)) tmp = ra_scratch(as, irt_isint(t) ? RSET_FPR : RSET_GPR); lj_assertA((irt_isnum(t)) || irt_isint(t) || irt_isaddr(t), "bad SLOAD type %d", irt_type(t)); dest = ra_dest(as, ir, irt_isnum(t) ? RSET_FPR : allow); base = ra_alloc1(as, REF_BASE, rset_clear(allow, dest)); if (irt_isaddr(t)) { emit_dn(as, A64I_ANDx^emit_isk13(LJ_GCVMASK, 1), dest, dest); } else if ((ir->op2 & IRSLOAD_CONVERT)) { if (irt_isint(t)) { emit_dn(as, A64I_FCVT_S32_F64, dest, (tmp & 31)); /* If value is already loaded for type check, move it to FPR. */ if ((ir->op2 & IRSLOAD_TYPECHECK)) emit_dn(as, A64I_FMOV_D_R, (tmp & 31), dest); else dest = tmp; t.irt = IRT_NUM; /* Check for original type. */ } else { emit_dn(as, A64I_FCVT_F64_S32, (dest & 31), tmp); dest = tmp; t.irt = IRT_INT; /* Check for original type. */ } } else if (irt_isint(t) && (ir->op2 & IRSLOAD_TYPECHECK)) { emit_dm(as, A64I_MOVw, dest, dest); } goto dotypecheck; } base = ra_alloc1(as, REF_BASE, allow); dotypecheck: rset_clear(allow, base); if ((ir->op2 & IRSLOAD_TYPECHECK)) { Reg tmp; if (ra_hasreg(dest) && rset_test(RSET_GPR, dest)) { tmp = dest; } else { tmp = ra_scratch(as, allow); rset_clear(allow, tmp); } if (ra_hasreg(dest) && tmp != dest) emit_dn(as, A64I_FMOV_D_R, (dest & 31), tmp); /* Need type check, even if the load result is unused. */ asm_guardcc(as, irt_isnum(t) ? CC_LS : CC_NE); if (irt_type(t) >= IRT_NUM) { lj_assertA(irt_isinteger(t) || irt_isnum(t), "bad SLOAD type %d", irt_type(t)); emit_nm(as, A64I_CMPx | A64F_SH(A64SH_LSR, 32), ra_allock(as, (ir->op2 & IRSLOAD_KEYINDEX) ? LJ_KEYINDEX : (LJ_TISNUM << 15), allow), tmp); } else if (irt_isnil(t)) { emit_n(as, (A64I_CMNx^A64I_K12) | A64F_U12(1), tmp); } else if (irt_ispri(t)) { emit_nm(as, A64I_CMPx, ra_allock(as, ~((int64_t)~irt_toitype(t) << 47) , allow), tmp); } else { emit_n(as, (A64I_CMNx^A64I_K12) | A64F_U12(-irt_toitype(t)), RID_TMP); emit_dn(as, A64I_ASRx | A64F_IMMR(47), RID_TMP, tmp); } emit_lso(as, A64I_LDRx, tmp, base, ofs); return; } if (ra_hasreg(dest)) { emit_lso(as, irt_isnum(t) ? A64I_LDRd : (irt_isint(t) ? A64I_LDRw : A64I_LDRx), (dest & 31), base, ofs ^ ((LJ_BE && irt_isint(t) ? 4 : 0))); } } /* -- Allocations --------------------------------------------------------- */ #if LJ_HASFFI static void asm_cnew(ASMState *as, IRIns *ir) { CTState *cts = ctype_ctsG(J2G(as->J)); CTypeID id = (CTypeID)IR(ir->op1)->i; CTSize sz; CTInfo info = lj_ctype_info(cts, id, &sz); const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_mem_newgco]; IRRef args[4]; RegSet allow = (RSET_GPR & ~RSET_SCRATCH); lj_assertA(sz != CTSIZE_INVALID || (ir->o == IR_CNEW && ir->op2 != REF_NIL), "bad CNEW/CNEWI operands"); as->gcsteps++; asm_setupresult(as, ir, ci); /* GCcdata * */ /* Initialize immutable cdata object. */ if (ir->o == IR_CNEWI) { int32_t ofs = sizeof(GCcdata); Reg r = ra_alloc1(as, ir->op2, allow); lj_assertA(sz == 4 || sz == 8, "bad CNEWI size %d", sz); emit_lso(as, sz == 8 ? A64I_STRx : A64I_STRw, r, RID_RET, ofs); } else if (ir->op2 != REF_NIL) { /* Create VLA/VLS/aligned cdata. */ ci = &lj_ir_callinfo[IRCALL_lj_cdata_newv]; args[0] = ASMREF_L; /* lua_State *L */ args[1] = ir->op1; /* CTypeID id */ args[2] = ir->op2; /* CTSize sz */ args[3] = ASMREF_TMP1; /* CTSize align */ asm_gencall(as, ci, args); emit_loadi(as, ra_releasetmp(as, ASMREF_TMP1), (int32_t)ctype_align(info)); return; } /* Initialize gct and ctypeid. lj_mem_newgco() already sets marked. */ { Reg r = (id < 65536) ? RID_X1 : ra_allock(as, id, allow); emit_lso(as, A64I_STRB, RID_TMP, RID_RET, offsetof(GCcdata, gct)); emit_lso(as, A64I_STRH, r, RID_RET, offsetof(GCcdata, ctypeid)); emit_d(as, A64I_MOVZw | A64F_U16(~LJ_TCDATA), RID_TMP); if (id < 65536) emit_d(as, A64I_MOVZw | A64F_U16(id), RID_X1); } args[0] = ASMREF_L; /* lua_State *L */ args[1] = ASMREF_TMP1; /* MSize size */ asm_gencall(as, ci, args); ra_allockreg(as, (int32_t)(sz+sizeof(GCcdata)), ra_releasetmp(as, ASMREF_TMP1)); } #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 mark = RID_TMP; MCLabel l_end = emit_label(as); emit_lso(as, A64I_STRB, mark, tab, (int32_t)offsetof(GCtab, marked)); /* Keep STRx in the middle to avoid LDP/STP fusion with surrounding code. */ emit_lso(as, A64I_STRx, link, tab, (int32_t)offsetof(GCtab, gclist)); emit_setgl(as, tab, gc.grayagain); emit_dn(as, A64I_ANDw^emit_isk13(~LJ_GC_BLACK, 0), mark, mark); emit_getgl(as, link, gc.grayagain); emit_cond_branch(as, CC_EQ, l_end); emit_n(as, A64I_TSTw^emit_isk13(LJ_GC_BLACK, 0), mark); emit_lso(as, A64I_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). */ lj_assertA(IR(ir->op1)->o == IR_UREFC, "bad OBAR type"); 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_dm(as, A64I_MOVx, ra_releasetmp(as, ASMREF_TMP1), RID_GL); obj = IR(ir->op1)->r; tmp = ra_scratch(as, rset_exclude(RSET_GPR, obj)); emit_tnb(as, A64I_TBZ, tmp, lj_ffs(LJ_GC_BLACK), l_end); emit_cond_branch(as, CC_EQ, l_end); emit_n(as, A64I_TSTw^emit_isk13(LJ_GC_WHITES, 0), RID_TMP); val = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, obj)); emit_lso(as, A64I_LDRB, tmp, obj, (int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv)); emit_lso(as, A64I_LDRB, RID_TMP, val, (int32_t)offsetof(GChead, marked)); } /* -- Arithmetic and logic operations ------------------------------------- */ static void asm_fparith(ASMState *as, IRIns *ir, A64Ins 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 & 31), (left & 31), (right & 31)); } static void asm_fpunary(ASMState *as, IRIns *ir, A64Ins ai) { Reg dest = ra_dest(as, ir, RSET_FPR); Reg left = ra_hintalloc(as, ir->op1, dest, RSET_FPR); emit_dn(as, ai, (dest & 31), (left & 31)); } static void asm_fpmath(ASMState *as, IRIns *ir) { IRFPMathOp fpm = (IRFPMathOp)ir->op2; if (fpm == IRFPM_SQRT) { asm_fpunary(as, ir, A64I_FSQRTd); } else if (fpm <= IRFPM_TRUNC) { asm_fpunary(as, ir, fpm == IRFPM_FLOOR ? A64I_FRINTMd : fpm == IRFPM_CEIL ? A64I_FRINTPd : A64I_FRINTZd); } else { asm_callid(as, ir, IRCALL_lj_vm_floor + fpm); } } 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) || (ir->o == IR_CONV && ir->op2 == ((IRT_I64<o >= IR_BSHL && ir->o <= IR_BROR) || (ir->o == IR_ADD && ir->op1 == ir->op2) || (ir->o == IR_CONV && ir->op2 == ((IRT_I64<op1, rref = ir->op2; Reg left, dest = ra_dest(as, ir, RSET_GPR); uint32_t m; if ((ai & ~A64I_S) != A64I_SUBw && asm_swapops(as, lref, rref)) { IRRef tmp = lref; lref = rref; rref = tmp; } left = ra_hintalloc(as, lref, dest, RSET_GPR); if (irt_is64(ir->t)) ai |= A64I_X; 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 |= A64I_S; } emit_dn(as, ai^m, dest, left); } static void asm_intop_s(ASMState *as, IRIns *ir, A64Ins ai) { if (as->flagmcp == as->mcp) { /* Drop cmp r, #0. */ as->flagmcp = NULL; as->mcp++; ai |= A64I_S; } asm_intop(as, ir, ai); } static void asm_intneg(ASMState *as, IRIns *ir) { Reg dest = ra_dest(as, ir, RSET_GPR); Reg left = ra_hintalloc(as, ir->op1, dest, RSET_GPR); emit_dm(as, irt_is64(ir->t) ? A64I_NEGx : A64I_NEGw, 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_GPR); Reg right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); if (irt_isguard(ir->t)) { /* IR_MULOV */ asm_guardcc(as, CC_NE); emit_dm(as, A64I_MOVw, dest, dest); /* Zero-extend. */ emit_nm(as, A64I_CMPx | A64F_EX(A64EX_SXTW), dest, dest); emit_dnm(as, A64I_SMULL, dest, right, left); } else { emit_dnm(as, irt_is64(ir->t) ? A64I_MULx : A64I_MULw, dest, left, right); } } static void asm_add(ASMState *as, IRIns *ir) { if (irt_isnum(ir->t)) { if (!asm_fusemadd(as, ir, A64I_FMADDd, A64I_FMADDd)) asm_fparith(as, ir, A64I_FADDd); return; } asm_intop_s(as, ir, A64I_ADDw); } static void asm_sub(ASMState *as, IRIns *ir) { if (irt_isnum(ir->t)) { if (!asm_fusemadd(as, ir, A64I_FNMSUBd, A64I_FMSUBd)) asm_fparith(as, ir, A64I_FSUBd); return; } asm_intop_s(as, ir, A64I_SUBw); } static void asm_mul(ASMState *as, IRIns *ir) { if (irt_isnum(ir->t)) { asm_fparith(as, ir, A64I_FMULd); return; } asm_intmul(as, ir); } #define asm_addov(as, ir) asm_add(as, ir) #define asm_subov(as, ir) asm_sub(as, ir) #define asm_mulov(as, ir) asm_mul(as, ir) #define asm_fpdiv(as, ir) asm_fparith(as, ir, A64I_FDIVd) #define asm_abs(as, ir) asm_fpunary(as, ir, A64I_FABS) static void asm_neg(ASMState *as, IRIns *ir) { if (irt_isnum(ir->t)) { asm_fpunary(as, ir, A64I_FNEGd); return; } asm_intneg(as, ir); } static void asm_band(ASMState *as, IRIns *ir) { A64Ins ai = A64I_ANDw; if (asm_fuseandshift(as, ir)) return; if (as->flagmcp == as->mcp) { /* Try to drop cmp r, #0. */ as->flagmcp = NULL; as->mcp++; ai = A64I_ANDSw; } asm_intop(as, ir, ai); } static void asm_borbxor(ASMState *as, IRIns *ir, A64Ins ai) { IRRef lref = ir->op1, rref = ir->op2; IRIns *irl = IR(lref), *irr = IR(rref); if ((canfuse(as, irl) && irl->o == IR_BNOT && !irref_isk(rref)) || (canfuse(as, irr) && irr->o == IR_BNOT && !irref_isk(lref))) { Reg left, dest = ra_dest(as, ir, RSET_GPR); uint32_t m; if (irl->o == IR_BNOT) { IRRef tmp = lref; lref = rref; rref = tmp; } left = ra_alloc1(as, lref, RSET_GPR); ai |= A64I_ON; if (irt_is64(ir->t)) ai |= A64I_X; m = asm_fuseopm(as, ai, IR(rref)->op1, rset_exclude(RSET_GPR, left)); emit_dn(as, ai^m, dest, left); } else { asm_intop(as, ir, ai); } } static void asm_bor(ASMState *as, IRIns *ir) { if (asm_fuseorshift(as, ir)) return; asm_borbxor(as, ir, A64I_ORRw); } #define asm_bxor(as, ir) asm_borbxor(as, ir, A64I_EORw) static void asm_bnot(ASMState *as, IRIns *ir) { A64Ins ai = A64I_MVNw; Reg dest = ra_dest(as, ir, RSET_GPR); uint32_t m = asm_fuseopm(as, ai, ir->op1, RSET_GPR); if (irt_is64(ir->t)) ai |= A64I_X; emit_d(as, ai^m, dest); } static void asm_bswap(ASMState *as, IRIns *ir) { Reg dest = ra_dest(as, ir, RSET_GPR); Reg left = ra_alloc1(as, ir->op1, RSET_GPR); emit_dn(as, irt_is64(ir->t) ? A64I_REVx : A64I_REVw, dest, left); } static void asm_bitshift(ASMState *as, IRIns *ir, A64Ins ai, A64Shift sh) { int32_t shmask = irt_is64(ir->t) ? 63 : 31; if (irref_isk(ir->op2)) { /* Constant shifts. */ Reg left, dest = ra_dest(as, ir, RSET_GPR); int32_t shift = (IR(ir->op2)->i & shmask); IRIns *irl = IR(ir->op1); if (shmask == 63) ai += A64I_UBFMx - A64I_UBFMw; /* Fuse BSHL + BSHR/BSAR into UBFM/SBFM aka UBFX/SBFX/UBFIZ/SBFIZ. */ if ((sh == A64SH_LSR || sh == A64SH_ASR) && canfuse(as, irl)) { if (irl->o == IR_BSHL && irref_isk(irl->op2)) { int32_t shift2 = (IR(irl->op2)->i & shmask); shift = ((shift - shift2) & shmask); shmask -= shift2; ir = irl; } } left = ra_alloc1(as, ir->op1, RSET_GPR); switch (sh) { case A64SH_LSL: emit_dn(as, ai | A64F_IMMS(shmask-shift) | A64F_IMMR((shmask-shift+1)&shmask), dest, left); break; case A64SH_LSR: case A64SH_ASR: emit_dn(as, ai | A64F_IMMS(shmask) | A64F_IMMR(shift), dest, left); break; case A64SH_ROR: emit_dnm(as, ai | A64F_IMMS(shift), dest, left, left); break; } } else { /* Variable-length shifts. */ 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_dnm(as, (shmask == 63 ? A64I_SHRx : A64I_SHRw) | A64F_BSH(sh), dest, left, right); } } #define asm_bshl(as, ir) asm_bitshift(as, ir, A64I_UBFMw, A64SH_LSL) #define asm_bshr(as, ir) asm_bitshift(as, ir, A64I_UBFMw, A64SH_LSR) #define asm_bsar(as, ir) asm_bitshift(as, ir, A64I_SBFMw, A64SH_ASR) #define asm_bror(as, ir) asm_bitshift(as, ir, A64I_EXTRw, A64SH_ROR) #define asm_brol(as, ir) lj_assertA(0, "unexpected BROL") static void asm_intmin_max(ASMState *as, IRIns *ir, A64CC cc) { Reg dest = ra_dest(as, ir, RSET_GPR); Reg left = ra_hintalloc(as, ir->op1, dest, RSET_GPR); Reg right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); emit_dnm(as, A64I_CSELw|A64F_CC(cc), dest, left, right); emit_nm(as, A64I_CMPw, left, right); } static void asm_fpmin_max(ASMState *as, IRIns *ir, A64CC fcc) { Reg dest = (ra_dest(as, ir, RSET_FPR) & 31); Reg right, left = ra_alloc2(as, ir, RSET_FPR); right = ((left >> 8) & 31); left &= 31; emit_dnm(as, A64I_FCSELd | A64F_CC(fcc), dest, right, left); emit_nm(as, A64I_FCMPd, left, right); } static void asm_min_max(ASMState *as, IRIns *ir, A64CC cc, A64CC fcc) { if (irt_isnum(ir->t)) asm_fpmin_max(as, ir, fcc); else asm_intmin_max(as, ir, cc); } #define asm_min(as, ir) asm_min_max(as, ir, CC_LT, CC_PL) #define asm_max(as, ir) asm_min_max(as, ir, CC_GT, CC_LE) /* -- 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. */ }; /* FP comparisons. */ static void asm_fpcomp(ASMState *as, IRIns *ir) { Reg left, right; A64Ins 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) & 31); right = 0; ai = A64I_FCMPZd; } else { left = ra_alloc2(as, ir, RSET_FPR); if (swp) { right = (left & 31); left = ((left >> 8) & 31); } else { right = ((left >> 8) & 31); left &= 31; } ai = A64I_FCMPd; } asm_guardcc(as, (asm_compmap[ir->o] >> 4)); emit_nm(as, ai, left, right); } /* Integer comparisons. */ static void asm_intcomp(ASMState *as, IRIns *ir) { A64CC oldcc, cc = (asm_compmap[ir->o] & 15); A64Ins ai = irt_is64(ir->t) ? A64I_CMPx : A64I_CMPw; IRRef lref = ir->op1, rref = ir->op2; Reg left; uint32_t m; int cmpprev0 = 0; lj_assertA(irt_is64(ir->t) || irt_isint(ir->t) || irt_isu32(ir->t) || irt_isaddr(ir->t) || irt_isu8(ir->t), "bad comparison data type %d", irt_type(ir->t)); if (asm_swapops(as, lref, rref)) { IRRef 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 */ } oldcc = cc; if (irref_isk(rref) && get_k64val(as, rref) == 0) { IRIns *irl = IR(lref); if (cc == CC_GE) cc = CC_PL; else if (cc == CC_LT) cc = CC_MI; else if (cc > CC_NE) goto nocombine; /* Other conds don't work with tst. */ cmpprev0 = (irl+1 == ir); /* Combine and-cmp-bcc into tbz/tbnz or and-cmp into tst. */ 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; } bleft = ra_alloc1(as, blref, RSET_GPR); if (irref_isk(brref)) { uint64_t k = get_k64val(as, brref); if (k && !(k & (k-1)) && (cc == CC_EQ || cc == CC_NE) && asm_guardtnb(as, cc == CC_EQ ? A64I_TBZ : A64I_TBNZ, bleft, emit_ctz64(k))) return; m2 = emit_isk13(k, irt_is64(irl->t)); } ai = (irt_is64(irl->t) ? A64I_TSTx : A64I_TSTw); if (!m2) m2 = asm_fuseopm(as, ai, brref, rset_exclude(RSET_GPR, bleft)); asm_guardcc(as, cc); emit_n(as, ai^m2, bleft); return; } if (cc == CC_EQ || cc == CC_NE) { /* Combine cmp-bcc into cbz/cbnz. */ ai = cc == CC_EQ ? A64I_CBZ : A64I_CBNZ; if (irt_is64(ir->t)) ai |= A64I_X; asm_guardcnb(as, ai, ra_alloc1(as, lref, RSET_GPR)); return; } } nocombine: left = ra_alloc1(as, lref, RSET_GPR); m = asm_fuseopm(as, ai, rref, rset_exclude(RSET_GPR, left)); asm_guardcc(as, cc); emit_n(as, ai^m, left); /* Signed comparison with zero and referencing previous ins? */ if (cmpprev0 && (oldcc <= CC_NE || oldcc >= CC_GE)) as->flagmcp = as->mcp; /* Allow elimination of the compare. */ } static void asm_comp(ASMState *as, IRIns *ir) { if (irt_isnum(ir->t)) asm_fpcomp(as, ir); else asm_intcomp(as, ir); } #define asm_equal(as, ir) asm_comp(as, ir) /* -- Split register ops -------------------------------------------------- */ /* Hiword op of a split 64/64 bit op. Previous op is the loword op. */ static void asm_hiop(ASMState *as, IRIns *ir) { /* 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 (!usehi) return; /* Skip unused hiword op for all remaining ops. */ switch ((ir-1)->o) { case IR_CALLN: case IR_CALLL: case IR_CALLS: case IR_CALLXS: if (!uselo) ra_allocref(as, ir->op1, RID2RSET(RID_RETLO)); /* Mark lo op as used. */ break; default: lj_assertA(0, "bad HIOP for op %d", (ir-1)->o); break; } } /* -- Profiling ----------------------------------------------------------- */ static void asm_prof(ASMState *as, IRIns *ir) { uint32_t k = emit_isk13(HOOK_PROFILE, 0); lj_assertA(k != 0, "HOOK_PROFILE does not fit in K13"); UNUSED(ir); asm_guardcc(as, CC_NE); emit_n(as, A64I_TSTw^k, RID_TMP); emit_lsptr(as, A64I_LDRB, RID_TMP, (void *)&J2G(as->J)->hookmask); } /* -- 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) { uint32_t k; Reg pbase = RID_BASE; if (irp) { pbase = irp->r; if (!ra_hasreg(pbase)) pbase = allow ? (0x40 | rset_pickbot(allow)) : (0xC0 | RID_RET); } emit_cond_branch(as, CC_LS, asm_exitstub_addr(as, exitno)); if (pbase & 0x80) /* Restore temp. register. */ emit_lso(as, A64I_LDRx, (pbase & 31), RID_SP, 0); k = emit_isk12((8*topslot)); lj_assertA(k, "slot offset %d does not fit in K12", 8*topslot); emit_n(as, A64I_CMPx^k, RID_TMP); emit_dnm(as, A64I_SUBx, RID_TMP, RID_TMP, (pbase & 31)); emit_lso(as, A64I_LDRx, RID_TMP, RID_TMP, (int32_t)offsetof(lua_State, maxstack)); if (pbase & 0x40) { emit_getgl(as, (pbase & 31), jit_base); if (pbase & 0x80) /* Save temp register. */ emit_lso(as, A64I_STRx, (pbase & 31), RID_SP, 0); } emit_getgl(as, RID_TMP, cur_L); } /* Restore Lua stack from on-trace state. */ static void asm_stack_restore(ASMState *as, SnapShot *snap) { SnapEntry *map = &as->T->snapmap[snap->mapofs]; #ifdef LUA_USE_ASSERT SnapEntry *flinks = &as->T->snapmap[snap_nextofs(as->T, snap)-1-LJ_FR2]; #endif 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-LJ_FR2); IRRef ref = snap_ref(sn); IRIns *ir = IR(ref); if ((sn & SNAP_NORESTORE)) continue; if ((sn & SNAP_KEYINDEX)) { RegSet allow = rset_exclude(RSET_GPR, RID_BASE); Reg r = irref_isk(ref) ? ra_allock(as, ir->i, allow) : ra_alloc1(as, ref, allow); rset_clear(allow, r); emit_lso(as, A64I_STRw, r, RID_BASE, ofs); emit_lso(as, A64I_STRw, ra_allock(as, LJ_KEYINDEX, allow), RID_BASE, ofs+4); } else if (irt_isnum(ir->t)) { Reg src = ra_alloc1(as, ref, RSET_FPR); emit_lso(as, A64I_STRd, (src & 31), RID_BASE, ofs); } else { asm_tvstore64(as, RID_BASE, ofs, ref); } checkmclim(as); } lj_assertA(map + nent == flinks, "inconsistent frames in snapshot"); } /* -- GC handling --------------------------------------------------------- */ /* Marker to prevent patching the GC check exit. */ #define ARM64_NOPATCH_GC_CHECK \ (A64I_ORRx|A64F_D(RID_ZERO)|A64F_M(RID_ZERO)|A64F_N(RID_ZERO)) /* 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 tmp2; ra_evictset(as, RSET_SCRATCH); l_end = emit_label(as); /* Exit trace if in GCSatomic or GCSfinalize. Avoids syncing GC objects. */ asm_guardcnb(as, A64I_CBNZ, RID_RET); /* Assumes asm_snap_prep() is done. */ *--as->mcp = ARM64_NOPATCH_GC_CHECK; args[0] = ASMREF_TMP1; /* global_State *g */ args[1] = ASMREF_TMP2; /* MSize steps */ asm_gencall(as, ci, args); emit_dm(as, A64I_MOVx, ra_releasetmp(as, ASMREF_TMP1), RID_GL); tmp2 = ra_releasetmp(as, ASMREF_TMP2); emit_loadi(as, tmp2, as->gcsteps); /* Jump around GC step if GC total < GC threshold. */ emit_cond_branch(as, CC_LS, l_end); emit_nm(as, A64I_CMPx, RID_TMP, tmp2); emit_getgl(as, tmp2, 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? */ uint32_t mask = (p[-2] & 0x7e000000) == 0x36000000 ? 0x3fffu : 0x7ffffu; ptrdiff_t delta = target - (p - 2); /* asm_guard* already inverted the bcc/tnb/cnb and patched the final b. */ p[-2] |= ((uint32_t)delta & mask) << 5; } else { ptrdiff_t delta = target - (p - 1); p[-1] = A64I_B | A64F_S26(delta); } } /* Fixup the tail of the loop. */ static void asm_loop_tail_fixup(ASMState *as) { UNUSED(as); /* Nothing to do. */ } /* -- 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_movrr(as, ir, r, RID_BASE); } } /* Coalesce BASE register for a side trace. */ static Reg asm_head_side_base(ASMState *as, IRIns *irp) { 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) { return r; /* Same BASE register already coalesced. */ } else if (ra_hasreg(irp->r) && rset_test(as->freeset, irp->r)) { /* Move from coalesced parent reg. */ emit_movrr(as, ir, r, irp->r); return irp->r; } else { emit_getgl(as, r, jit_base); /* Otherwise reload BASE. */ } } return RID_NONE; } /* -- Tail of trace ------------------------------------------------------- */ /* Fixup the tail code. */ static void asm_tail_fixup(ASMState *as, TraceNo lnk) { MCode *p = as->mctop; MCode *target; /* Undo the sp adjustment in BC_JLOOP when exiting to the interpreter. */ int32_t spadj = as->T->spadjust + (lnk ? 0 : sps_scale(SPS_FIXED)); if (spadj == 0) { *--p = A64I_LE(A64I_NOP); as->mctop = p; } else { /* Patch stack adjustment. */ uint32_t k = emit_isk12(spadj); lj_assertA(k, "stack adjustment %d does not fit in K12", spadj); p[-2] = (A64I_ADDx^k) | A64F_D(RID_SP) | A64F_N(RID_SP); } /* Patch exit branch. */ target = lnk ? traceref(as->J, lnk)->mcode : (MCode *)lj_vm_exit_interp; p[-1] = A64I_B | A64F_S26((target-p)+1); } /* 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. */ } /* -- Trace setup --------------------------------------------------------- */ /* Ensure there are enough stack slots for call arguments. */ static Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci) { #if LJ_HASFFI uint32_t i, nargs = CCI_XNARGS(ci); if (nargs > (REGARG_NUMGPR < REGARG_NUMFPR ? REGARG_NUMGPR : REGARG_NUMFPR) || (LJ_TARGET_OSX && (ci->flags & CCI_VARARG))) { IRRef args[CCI_NARGS_MAX*2]; int ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR; int spofs = 0, spalign = LJ_TARGET_OSX ? 0 : 7, nslots; asm_collectargs(as, ir, ci, args); #if LJ_ABI_WIN if ((ci->flags & CCI_VARARG)) nfpr = 0; #endif for (i = 0; i < nargs; i++) { int al = spalign; if (!args[i]) { #if LJ_TARGET_OSX /* Marker for start of varaargs. */ nfpr = 0; ngpr = 0; spalign = 7; #endif } else if (irt_isfp(IR(args[i])->t)) { if (nfpr > 0) { nfpr--; continue; } #if LJ_ABI_WIN if ((ci->flags & CCI_VARARG) && ngpr > 0) { ngpr--; continue; } #elif LJ_TARGET_OSX al |= irt_isnum(IR(args[i])->t) ? 7 : 3; #endif } else { if (ngpr > 0) { ngpr--; continue; } #if LJ_TARGET_OSX al |= irt_size(IR(args[i])->t) - 1; #endif } spofs = (spofs + 2*al+1) & ~al; /* Align and bump stack pointer. */ } nslots = (spofs + 3) >> 2; if (nslots > as->evenspill) /* Leave room for args in stack slots. */ as->evenspill = nslots; } #endif return REGSP_HINT(irt_isfp(ir->t) ? RID_FPRET : 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)); } #if LJ_BE /* ARM64 instructions are always little-endian. Swap for ARM64BE. */ static void asm_mcode_fixup(MCode *mcode, MSize size) { MCode *pe = (MCode *)((char *)mcode + size); while (mcode < pe) { MCode ins = *mcode; *mcode++ = lj_bswap(ins); } } #define LJ_TARGET_MCODE_FIXUP 1 #endif /* -- 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; MCode *mcarea = lj_mcode_patch(J, p, 0); MCode *px = exitstub_trace_addr(T, exitno); int patchlong = 1; /* Note: this assumes a trace exit is only ever patched once. */ for (; p < pe; p++) { /* Look for exitstub branch, replace with branch to target. */ ptrdiff_t delta = target - p; MCode ins = A64I_LE(*p); if ((ins & 0xff000000u) == 0x54000000u && ((ins ^ ((px-p)<<5)) & 0x00ffffe0u) == 0) { /* Patch bcc, if within range. */ if (A64F_S_OK(delta, 19)) { *p = A64I_LE((ins & 0xff00001fu) | A64F_S19(delta)); if (!cstart) cstart = p; } } else if ((ins & 0xfc000000u) == 0x14000000u && ((ins ^ (px-p)) & 0x03ffffffu) == 0) { /* Patch b. */ lj_assertJ(A64F_S_OK(delta, 26), "branch target out of range"); *p = A64I_LE((ins & 0xfc000000u) | A64F_S26(delta)); if (!cstart) cstart = p; } else if ((ins & 0x7e000000u) == 0x34000000u && ((ins ^ ((px-p)<<5)) & 0x00ffffe0u) == 0) { /* Patch cbz/cbnz, if within range. */ if (p[-1] == ARM64_NOPATCH_GC_CHECK) { patchlong = 0; } else if (A64F_S_OK(delta, 19)) { *p = A64I_LE((ins & 0xff00001fu) | A64F_S19(delta)); if (!cstart) cstart = p; } } else if ((ins & 0x7e000000u) == 0x36000000u && ((ins ^ ((px-p)<<5)) & 0x0007ffe0u) == 0) { /* Patch tbz/tbnz, if within range. */ if (A64F_S_OK(delta, 14)) { *p = A64I_LE((ins & 0xfff8001fu) | A64F_S14(delta)); if (!cstart) cstart = p; } } } /* Always patch long-range branch in exit stub itself. Except, if we can't. */ if (patchlong) { ptrdiff_t delta = target - px; lj_assertJ(A64F_S_OK(delta, 26), "branch target out of range"); *px = A64I_B | A64F_S26(delta); if (!cstart) cstart = px; } if (cstart) lj_mcode_sync(cstart, px+1); lj_mcode_patch(J, mcarea, 1); } subprojects/luajit/src/lj_target_mips.h0000644000175000017500000002514414741067622017661 0ustar aniolaniol/* ** Definitions for MIPS CPUs. ** Copyright (C) 2005-2023 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) #if LJ_SOFTFP #define FPRDEF(_) #else #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) #endif #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 #if LJ_SOFTFP RID_FPRET = RID_R2, #else RID_FPRET = RID_F0, #endif 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_MAX_GPR, #if LJ_SOFTFP RID_MAX_FPR = RID_MIN_FPR, #else RID_MAX_FPR = RID_F31+1, #endif 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) #if LJ_SOFTFP #define RSET_FPR 0 #else #if LJ_32 #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)) #else #define RSET_FPR RSET_RANGE(RID_MIN_FPR, RID_MAX_FPR) #endif #endif #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)) #if LJ_SOFTFP #define RSET_SCRATCH_FPR 0 #else #if LJ_32 #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)) #else #define RSET_SCRATCH_FPR RSET_RANGE(RID_F0, RID_F24) #endif #endif #define RSET_SCRATCH (RSET_SCRATCH_GPR|RSET_SCRATCH_FPR) #define REGARG_FIRSTGPR RID_R4 #if LJ_32 #define REGARG_LASTGPR RID_R7 #define REGARG_NUMGPR 4 #else #define REGARG_LASTGPR RID_R11 #define REGARG_NUMGPR 8 #endif #if LJ_ABI_SOFTFP #define REGARG_FIRSTFPR 0 #define REGARG_LASTFPR 0 #define REGARG_NUMFPR 0 #else #define REGARG_FIRSTFPR RID_F12 #if LJ_32 #define REGARG_LASTFPR RID_F14 #define REGARG_NUMFPR 2 #else #define REGARG_LASTFPR RID_F19 #define REGARG_NUMFPR 8 #endif #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. */ #if LJ_32 #define SPS_FIXED 5 #else #define SPS_FIXED 4 #endif #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 { #if !LJ_SOFTFP lua_Number fpr[RID_NUM_FPR]; /* Floating-point registers. */ #endif intptr_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) #define MIPSF_L(n) ((n) << 6) typedef enum MIPSIns { MIPSI_D = 0x38, MIPSI_DV = 0x10, MIPSI_D32 = 0x3c, /* Integer instructions. */ MIPSI_MOVE = 0x00000025, MIPSI_NOP = 0x00000000, MIPSI_LI = 0x24000000, MIPSI_LU = 0x34000000, MIPSI_LUI = 0x3c000000, MIPSI_AND = 0x00000024, MIPSI_ANDI = 0x30000000, MIPSI_OR = 0x00000025, MIPSI_ORI = 0x34000000, MIPSI_XOR = 0x00000026, MIPSI_XORI = 0x38000000, MIPSI_NOR = 0x00000027, MIPSI_SLT = 0x0000002a, MIPSI_SLTU = 0x0000002b, MIPSI_SLTI = 0x28000000, MIPSI_SLTIU = 0x2c000000, MIPSI_ADDU = 0x00000021, MIPSI_ADDIU = 0x24000000, MIPSI_SUB = 0x00000022, MIPSI_SUBU = 0x00000023, #if !LJ_TARGET_MIPSR6 MIPSI_MUL = 0x70000002, MIPSI_DIV = 0x0000001a, MIPSI_DIVU = 0x0000001b, MIPSI_MOVZ = 0x0000000a, MIPSI_MOVN = 0x0000000b, MIPSI_MFHI = 0x00000010, MIPSI_MFLO = 0x00000012, MIPSI_MULT = 0x00000018, #else MIPSI_MUL = 0x00000098, MIPSI_MUH = 0x000000d8, MIPSI_DIV = 0x0000009a, MIPSI_DIVU = 0x0000009b, MIPSI_SELEQZ = 0x00000035, MIPSI_SELNEZ = 0x00000037, #endif MIPSI_SLL = 0x00000000, MIPSI_SRL = 0x00000002, MIPSI_SRA = 0x00000003, MIPSI_ROTR = 0x00200002, /* MIPSXXR2 */ MIPSI_DROTR = 0x0020003a, MIPSI_DROTR32 = 0x0020003e, MIPSI_SLLV = 0x00000004, MIPSI_SRLV = 0x00000006, MIPSI_SRAV = 0x00000007, MIPSI_ROTRV = 0x00000046, /* MIPSXXR2 */ MIPSI_DROTRV = 0x00000056, MIPSI_INS = 0x7c000004, /* MIPSXXR2 */ MIPSI_SEB = 0x7c000420, /* MIPSXXR2 */ MIPSI_SEH = 0x7c000620, /* MIPSXXR2 */ MIPSI_WSBH = 0x7c0000a0, /* MIPSXXR2 */ MIPSI_DSBH = 0x7c0000a4, MIPSI_B = 0x10000000, MIPSI_J = 0x08000000, MIPSI_JAL = 0x0c000000, #if !LJ_TARGET_MIPSR6 MIPSI_JALX = 0x74000000, MIPSI_JR = 0x00000008, #else MIPSI_JR = 0x00000009, MIPSI_BALC = 0xe8000000, #endif 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_LD = 0xdc000000, MIPSI_SW = 0xac000000, MIPSI_SD = 0xfc000000, 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, /* MIPS64 instructions. */ MIPSI_DADD = 0x0000002c, MIPSI_DADDU = 0x0000002d, MIPSI_DADDIU = 0x64000000, MIPSI_DSUB = 0x0000002e, MIPSI_DSUBU = 0x0000002f, #if !LJ_TARGET_MIPSR6 MIPSI_DDIV = 0x0000001e, MIPSI_DDIVU = 0x0000001f, MIPSI_DMULT = 0x0000001c, MIPSI_DMULTU = 0x0000001d, #else MIPSI_DDIV = 0x0000009e, MIPSI_DMOD = 0x000000de, MIPSI_DDIVU = 0x0000009f, MIPSI_DMODU = 0x000000df, MIPSI_DMUL = 0x0000009c, MIPSI_DMUH = 0x000000dc, #endif MIPSI_DSLL = 0x00000038, MIPSI_DSRL = 0x0000003a, MIPSI_DSLLV = 0x00000014, MIPSI_DSRLV = 0x00000016, MIPSI_DSRA = 0x0000003b, MIPSI_DSRAV = 0x00000017, MIPSI_DSRA32 = 0x0000003f, MIPSI_DSLL32 = 0x0000003c, MIPSI_DSRL32 = 0x0000003e, MIPSI_DSHD = 0x7c000164, MIPSI_AADDU = LJ_32 ? MIPSI_ADDU : MIPSI_DADDU, MIPSI_AADDIU = LJ_32 ? MIPSI_ADDIU : MIPSI_DADDIU, MIPSI_ASUBU = LJ_32 ? MIPSI_SUBU : MIPSI_DSUBU, MIPSI_AL = LJ_32 ? MIPSI_LW : MIPSI_LD, MIPSI_AS = LJ_32 ? MIPSI_SW : MIPSI_SD, #if LJ_TARGET_MIPSR6 MIPSI_LSA = 0x00000005, MIPSI_DLSA = 0x00000015, MIPSI_ALSA = LJ_32 ? MIPSI_LSA : MIPSI_DLSA, #endif /* Extract/insert instructions. */ MIPSI_DEXTM = 0x7c000001, MIPSI_DEXTU = 0x7c000002, MIPSI_DEXT = 0x7c000003, MIPSI_DINSM = 0x7c000005, MIPSI_DINSU = 0x7c000006, MIPSI_DINS = 0x7c000007, MIPSI_FLOOR_D = 0x4620000b, /* FP instructions. */ MIPSI_MOV_S = 0x46000006, MIPSI_MOV_D = 0x46200006, #if !LJ_TARGET_MIPSR6 MIPSI_MOVT_D = 0x46210011, MIPSI_MOVF_D = 0x46200011, #else MIPSI_MIN_D = 0x4620001C, MIPSI_MAX_D = 0x4620001E, MIPSI_SEL_D = 0x46200010, #endif 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_CVT_S_L = 0x46a00020, MIPSI_CVT_D_L = 0x46a00021, MIPSI_TRUNC_W_S = 0x4600000d, MIPSI_TRUNC_W_D = 0x4620000d, MIPSI_TRUNC_L_S = 0x46000009, MIPSI_TRUNC_L_D = 0x46200009, MIPSI_FLOOR_W_S = 0x4600000f, MIPSI_FLOOR_W_D = 0x4620000f, MIPSI_MFC1 = 0x44000000, MIPSI_MTC1 = 0x44800000, MIPSI_DMTC1 = 0x44a00000, MIPSI_DMFC1 = 0x44200000, #if !LJ_TARGET_MIPSR6 MIPSI_BC1F = 0x45000000, MIPSI_BC1T = 0x45010000, MIPSI_C_EQ_D = 0x46200032, MIPSI_C_OLT_S = 0x46000034, MIPSI_C_OLT_D = 0x46200034, MIPSI_C_ULT_D = 0x46200035, MIPSI_C_OLE_D = 0x46200036, MIPSI_C_ULE_D = 0x46200037, #else MIPSI_BC1EQZ = 0x45200000, MIPSI_BC1NEZ = 0x45a00000, MIPSI_CMP_EQ_D = 0x46a00002, MIPSI_CMP_LT_S = 0x46800004, MIPSI_CMP_LT_D = 0x46a00004, #endif } MIPSIns; #endif subprojects/luajit/src/lj_meta.c0000644000175000017500000003601314741067622016261 0ustar aniolaniol/* ** Metamethod handling. ** Copyright (C) 2005-2023 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_buf.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" #include "lj_strfmt.h" #include "lj_lib.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); lj_assertX(mm <= MM_FAST, "bad metamethod %d", mm); 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-LJ_FR2, tv); /* Replace frame with new object. */ if (LJ_FR2) (top++)->u64 = LJ_CONT_TAILCALL; else top->u32.lo = LJ_CONT_TAILCALL; setframe_pc(top++, pc); setframe_gc(top, obj2gco(L), LJ_TTHREAD); /* Dummy frame object. */ if (LJ_FR2) top++; setframe_ftsz(top, ((char *)(top+1) - (char *)base) + FRAME_CONT); L->base = L->top = top+1; /* ** 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 or FR2. */ if (LJ_FR2) setnilV(top++); copyTV(L, top++, mo); /* Store metamethod and two arguments. */ if (LJ_FR2) setnilV(top++); copyTV(L, top, a); copyTV(L, top+1, b); return top; /* 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); } } /* 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 { if (!(tvisstr(top) || tvisnumber(top) || tvisbuf(top)) || !(tvisstr(top-1) || tvisnumber(top-1) || tvisbuf(top-1))) { 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*LJ_FR2+2, top); /* Carefully ordered stack copies! */ copyTV(L, top+2*LJ_FR2+1, top-1); copyTV(L, top+LJ_FR2, mo); setcont(top-1, lj_cont_cat); if (LJ_FR2) { setnilV(top); setnilV(top+2); top += 2; } return top+1; /* Trigger metamethod call. */ } 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 ............] */ TValue *e, *o = top; uint64_t tlen = tvisstr(o) ? strV(o)->len : tvisbuf(o) ? sbufxlen(bufV(o)) : STRFMT_MAXBUF_NUM; SBuf *sb; do { o--; tlen += tvisstr(o) ? strV(o)->len : tvisbuf(o) ? sbufxlen(bufV(o)) : STRFMT_MAXBUF_NUM; } while (--left > 0 && (tvisstr(o-1) || tvisnumber(o-1))); if (tlen >= LJ_MAX_STR) lj_err_msg(L, LJ_ERR_STROV); sb = lj_buf_tmp_(L); lj_buf_more(sb, (MSize)tlen); for (e = top, top = o; o <= e; o++) { if (tvisstr(o)) { GCstr *s = strV(o); MSize len = s->len; lj_buf_putmem(sb, strdata(s), len); } else if (tvisbuf(o)) { SBufExt *sbx = bufV(o); lj_buf_putmem(sb, sbx->r, sbufxlen(sbx)); } else if (tvisint(o)) { lj_strfmt_putint(sb, intV(o)); } else { lj_strfmt_putfnum(sb, STRFMT_G14, numV(o)); } } setstrV(L, top, lj_buf_str(L, sb)); } } 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); if (LJ_FR2) setnilV(top++); copyTV(L, top++, mo); if (LJ_FR2) setnilV(top++); it = ~(uint32_t)o1->gch.gct; setgcV(L, top, o1, it); setgcV(L, top+1, o2, it); return top; /* 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 { lj_assertL(op == BC_ISEQP, "bad bytecode op %d", op); setpriV(&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 ISTYPE and ISNUM. Implicit coercion or error. */ void lj_meta_istype(lua_State *L, BCReg ra, BCReg tp) { L->top = curr_topL(L); ra++; tp--; lj_assertL(LJ_DUALNUM || tp != ~LJ_TNUMX, "bad type for ISTYPE"); if (LJ_DUALNUM && tp == ~LJ_TNUMX) lj_lib_checkint(L, ra); else if (tp == ~LJ_TNUMX+1) lj_lib_checknum(L, ra); else if (tp == ~LJ_TSTR) lj_lib_checkstr(L, ra); else lj_err_argtype(L, ra, lj_obj_itypename[tp]); } /* 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+2*LJ_FR2; p--) copyTV(L, p, p-1); if (LJ_FR2) copyTV(L, func+2, func); 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)); } } } subprojects/luajit/src/lj_prng.c0000644000175000017500000001527314741067622016306 0ustar aniolaniol/* ** Pseudo-random number generation. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #define lj_prng_c #define LUA_CORE /* To get the syscall prototype. */ #if defined(__linux__) && !defined(_GNU_SOURCE) #define _GNU_SOURCE #endif #include "lj_def.h" #include "lj_arch.h" #include "lj_prng.h" /* -- PRNG step function -------------------------------------------------- */ /* 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. ** ** Important note: This PRNG is NOT suitable for cryptographic use! ** ** But it works fine for math.random(), which has an API that's not ** suitable for cryptography, anyway. ** ** When used as a securely seeded global PRNG, it substantially raises ** the difficulty for various attacks on the VM. */ /* Update generator i and compute a running xor of all states. */ #define TW223_GEN(rs, z, r, i, k, q, s) \ z = rs->u[i]; \ z = (((z<> (k-s)) ^ ((z&((uint64_t)(int64_t)-1 << (64-k)))<u[i] = z; #define TW223_STEP(rs, z, r) \ TW223_GEN(rs, z, r, 0, 63, 31, 18) \ TW223_GEN(rs, z, r, 1, 58, 19, 28) \ TW223_GEN(rs, z, r, 2, 55, 24, 7) \ TW223_GEN(rs, z, r, 3, 47, 21, 8) /* PRNG step function with uint64_t result. */ LJ_NOINLINE uint64_t LJ_FASTCALL lj_prng_u64(PRNGState *rs) { uint64_t z, r = 0; TW223_STEP(rs, z, r) return r; } /* PRNG step function with double in uint64_t result. */ LJ_NOINLINE uint64_t LJ_FASTCALL lj_prng_u64d(PRNGState *rs) { uint64_t z, r = 0; TW223_STEP(rs, z, r) /* Returns a double bit pattern in the range 1.0 <= d < 2.0. */ return (r & U64x(000fffff,ffffffff)) | U64x(3ff00000,00000000); } /* Condition seed: ensure k[i] MSB of u[i] are non-zero. */ static LJ_AINLINE void lj_prng_condition(PRNGState *rs) { if (rs->u[0] < (1u << 1)) rs->u[0] += (1u << 1); if (rs->u[1] < (1u << 6)) rs->u[1] += (1u << 6); if (rs->u[2] < (1u << 9)) rs->u[2] += (1u << 9); if (rs->u[3] < (1u << 17)) rs->u[3] += (1u << 17); } /* -- PRNG seeding from OS ------------------------------------------------ */ #if LUAJIT_SECURITY_PRNG == 0 /* Nothing to define. */ #elif LJ_TARGET_XBOX360 extern int XNetRandom(void *buf, unsigned int len); #elif LJ_TARGET_PS3 extern int sys_get_random_number(void *buf, uint64_t len); #elif LJ_TARGET_PS4 || LJ_TARGET_PS5 || LJ_TARGET_PSVITA extern int sceRandomGetRandomNumber(void *buf, size_t len); #elif LJ_TARGET_NX #include #elif LJ_TARGET_WINDOWS || LJ_TARGET_XBOXONE #define WIN32_LEAN_AND_MEAN #include #if LJ_TARGET_UWP || LJ_TARGET_XBOXONE /* Must use BCryptGenRandom. */ #include #pragma comment(lib, "bcrypt.lib") #else /* If you wonder about this mess, then search online for RtlGenRandom. */ typedef BOOLEAN (WINAPI *PRGR)(void *buf, ULONG len); static PRGR libfunc_rgr; #endif #elif LJ_TARGET_POSIX #if LJ_TARGET_LINUX /* Avoid a dependency on glibc 2.25+ and use the getrandom syscall instead. */ #include #else #if LJ_TARGET_OSX && !LJ_TARGET_IOS /* ** In their infinite wisdom Apple decided to disallow getentropy() in the ** iOS App Store. Even though the call is common to all BSD-ish OS, it's ** recommended by Apple in their own security-related docs, and, to top ** off the foolery, /dev/urandom is handled by the same kernel code, ** yet accessing it is actually permitted (but less efficient). */ #include #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 #define LJ_TARGET_HAS_GETENTROPY 1 #endif #elif (LJ_TARGET_BSD && !defined(__NetBSD__)) || LJ_TARGET_SOLARIS || LJ_TARGET_CYGWIN || LJ_TARGET_QNX #define LJ_TARGET_HAS_GETENTROPY 1 #endif #if LJ_TARGET_HAS_GETENTROPY extern int getentropy(void *buf, size_t len) #ifdef __ELF__ __attribute__((weak)) #endif ; #endif #endif /* For the /dev/urandom fallback. */ #include #include #endif #if LUAJIT_SECURITY_PRNG == 0 /* If you really don't care about security, then define ** LUAJIT_SECURITY_PRNG=0. This yields a predictable seed ** and provides NO SECURITY against various attacks on the VM. ** ** BTW: This is NOT the way to get predictable table iteration, ** predictable trace generation, predictable bytecode generation, etc. */ int LJ_FASTCALL lj_prng_seed_secure(PRNGState *rs) { lj_prng_seed_fixed(rs); /* The fixed seed is already conditioned. */ return 1; } #else /* Securely seed PRNG from system entropy. Returns 0 on failure. */ int LJ_FASTCALL lj_prng_seed_secure(PRNGState *rs) { #if LJ_TARGET_XBOX360 if (XNetRandom(rs->u, (unsigned int)sizeof(rs->u)) == 0) goto ok; #elif LJ_TARGET_PS3 if (sys_get_random_number(rs->u, sizeof(rs->u)) == 0) goto ok; #elif LJ_TARGET_PS4 || LJ_TARGET_PS5 || LJ_TARGET_PSVITA if (sceRandomGetRandomNumber(rs->u, sizeof(rs->u)) == 0) goto ok; #elif LJ_TARGET_NX if (getentropy(rs->u, sizeof(rs->u)) == 0) goto ok; #elif LJ_TARGET_UWP || LJ_TARGET_XBOXONE if (BCryptGenRandom(NULL, (PUCHAR)(rs->u), (ULONG)sizeof(rs->u), BCRYPT_USE_SYSTEM_PREFERRED_RNG) >= 0) goto ok; #elif LJ_TARGET_WINDOWS /* Keep the library loaded in case multiple VMs are started. */ if (!libfunc_rgr) { HMODULE lib = LJ_WIN_LOADLIBA("advapi32.dll"); if (!lib) return 0; libfunc_rgr = (PRGR)GetProcAddress(lib, "SystemFunction036"); if (!libfunc_rgr) return 0; } if (libfunc_rgr(rs->u, (ULONG)sizeof(rs->u))) goto ok; #elif LJ_TARGET_POSIX #if LJ_TARGET_LINUX && defined(SYS_getrandom) if (syscall(SYS_getrandom, rs->u, sizeof(rs->u), 0) == (long)sizeof(rs->u)) goto ok; #elif LJ_TARGET_HAS_GETENTROPY #ifdef __ELF__ if (&getentropy && getentropy(rs->u, sizeof(rs->u)) == 0) goto ok; #else if (getentropy(rs->u, sizeof(rs->u)) == 0) goto ok; #endif #endif /* Fallback to /dev/urandom. This may fail if the device is not ** existent or accessible in a chroot or container, or if the process ** or the OS ran out of file descriptors. */ { int fd = open("/dev/urandom", O_RDONLY|O_CLOEXEC); if (fd != -1) { ssize_t n = read(fd, rs->u, sizeof(rs->u)); (void)close(fd); if (n == (ssize_t)sizeof(rs->u)) goto ok; } } #else /* Add an elif above for your OS with a secure PRNG seed. ** Note that fiddling around with rand(), getpid(), time() or coercing ** ASLR to yield a few bits of randomness is not helpful. ** If you don't want any security, then don't pretend you have any ** and simply define LUAJIT_SECURITY_PRNG=0 for the build. */ #error "Missing secure PRNG seed for this OS" #endif return 0; /* Fail. */ ok: lj_prng_condition(rs); (void)lj_prng_u64(rs); return 1; /* Success. */ } #endif subprojects/luajit/src/lj_vmevent.h0000644000175000017500000000310614741067622017021 0ustar aniolaniol/* ** VM event handling. ** Copyright (C) 2005-2023 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, 0x12d91467), VMEVENT_DEF(RECORD, 0x1284bf4f), VMEVENT_DEF(TEXIT, 0x129df2b0), VMEVENT_DEF(ERRFIN, 0x12d93888), 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 subprojects/luajit/src/vm_mips.dasc0000644000175000017500000044130714741067622017016 0ustar aniolaniol|// Low-level VM code for MIPS CPUs. |// Bytecode interpreter, fast functions and helper functions. |// Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h |// |// MIPS soft-float support contributed by Djordje Kovacevic and |// Stefan Pejic from RT-RK.com, sponsored by Cisco Systems, Inc. | |.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 | |.macro .FPU, a, b |.if FPU | a, b |.endif |.endmacro | |// 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. | |.define JGL, r30 // On-trace: global_State + 32768. | |// Constants for type-comparisons, stores and conversions. C callee-save. |.define TISNUM, r22 |.define TISNIL, r30 |.if FPU |.define TOBIT, f30 // 2^52 + 2^51. |.endif | |// 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 | |// MIPS o32 calling convention. |.define CFUNCADDR, r25 |.define CARG1, r4 |.define CARG2, r5 |.define CARG3, r6 |.define CARG4, r7 | |.define CRET1, r2 |.define CRET2, r3 | |.if ENDIAN_LE |.define SFRETLO, CRET1 |.define SFRETHI, CRET2 |.define SFARG1LO, CARG1 |.define SFARG1HI, CARG2 |.define SFARG2LO, CARG3 |.define SFARG2HI, CARG4 |.else |.define SFRETLO, CRET2 |.define SFRETHI, CRET1 |.define SFARG1LO, CARG2 |.define SFARG1HI, CARG1 |.define SFARG2LO, CARG4 |.define SFARG2HI, CARG3 |.endif | |.if FPU |.define FARG1, f12 |.define FARG2, f14 | |.define FRET1, f0 |.define FRET2, f2 |.endif | |// Stack layout while in interpreter. Must match with lj_frame.h. |.if FPU // MIPS32 hard-float. | |.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. | |.else // MIPS32 soft-float | |.define CFRAME_SPACE, 64 // Delta for sp. | |.define SAVE_ERRF, 76(sp) // 32 bit C frame info. |.define SAVE_NRES, 72(sp) |.define SAVE_CFRAME, 68(sp) |.define SAVE_L, 64(sp) |//----- 8 byte aligned, ^^^^ 16 byte register save area, owned by interpreter. |.define SAVE_GPR_, 24 // .. 24+10*4: 32 bit GPR saves. | |.endif | |.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) | .FPU sdc1 f30, SAVE_FPR_+5*8(sp) | sw r23, SAVE_GPR_+7*4(sp) | sw r22, SAVE_GPR_+6*4(sp) | .FPU sdc1 f28, SAVE_FPR_+4*8(sp) | sw r21, SAVE_GPR_+5*4(sp) | sw r20, SAVE_GPR_+4*4(sp) | .FPU sdc1 f26, SAVE_FPR_+3*8(sp) | sw r19, SAVE_GPR_+3*4(sp) | sw r18, SAVE_GPR_+2*4(sp) | .FPU sdc1 f24, SAVE_FPR_+2*8(sp) | sw r17, SAVE_GPR_+1*4(sp) | sw r16, SAVE_GPR_+0*4(sp) | .FPU sdc1 f22, SAVE_FPR_+1*8(sp) | .FPU 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) | .FPU ldc1 f30, SAVE_FPR_+5*8(sp) | lw r23, SAVE_GPR_+7*4(sp) | lw r22, SAVE_GPR_+6*4(sp) | .FPU ldc1 f28, SAVE_FPR_+4*8(sp) | lw r21, SAVE_GPR_+5*4(sp) | lw r20, SAVE_GPR_+4*4(sp) | .FPU ldc1 f26, SAVE_FPR_+3*8(sp) | lw r19, SAVE_GPR_+3*4(sp) | lw r18, SAVE_GPR_+2*4(sp) | .FPU ldc1 f24, SAVE_FPR_+2*8(sp) | lw r17, SAVE_GPR_+1*4(sp) | lw r16, SAVE_GPR_+0*4(sp) | .FPU ldc1 f22, SAVE_FPR_+1*8(sp) | .FPU 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 |.type SBUF, SBuf | |//----------------------------------------------------------------------- | |// Trap for not-yet-implemented parts. |.macro NYI; .long 0xec1cf0f0; .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. |.if ENDIAN_LE |.define FRAME_PC, -4 |.define FRAME_FUNC, -8 |.define HI, 4 |.define LO, 0 |.define OFS_RD, 2 |.define OFS_RA, 1 |.define OFS_OP, 0 |.else |.define FRAME_PC, -8 |.define FRAME_FUNC, -4 |.define HI, 0 |.define LO, 4 |.define OFS_RD, 0 |.define OFS_RA, 2 |.define OFS_OP, 3 |.endif | |// 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 | lw SFRETHI, HI(RA) | lw SFRETLO, LO(RA) | addiu RA, RA, 8 | sw SFRETHI, HI(BASE) | sw SFRETLO, LO(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 | .FPU lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). | li TISNUM, LJ_TISNUM // Setup type comparison constants. | li TISNIL, LJ_TNIL | lw BASE, L->base | lw DISPATCH, L->glref // Setup pointer to dispatch table. | .FPU mtc1 TMP3, TOBIT | li TMP1, LJ_TFALSE | li_vmstate INTERP | lw PC, FRAME_PC(BASE) // Fetch PC of previous frame. | .FPU 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. | |->vm_unwind_stub: // Jump to exit stub from unwinder. | jr CARG1 |. move ra, CARG2 | |//----------------------------------------------------------------------- |//-- 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 CARG1, SAVE_PC // Any value outside of bytecode is ok. | sw r0, SAVE_CFRAME | beqz TMP1, >3 |. sw TMP0, L->cframe | | // Resume after yield (like a return). | sw L, DISPATCH_GL(cur_L)(DISPATCH) | move RA, BASE | lw BASE, L->base | li TISNUM, LJ_TISNUM // Setup type comparison constants. | lw TMP1, L->top | lw PC, FRAME_PC(BASE) | .FPU lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). | subu RD, TMP1, BASE | .FPU mtc1 TMP3, TOBIT | sb r0, L->status | .FPU 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 | move L, CARG1 | sw CARG3, SAVE_NRES | lw DISPATCH, L->glref // Setup pointer to dispatch table. | sw CARG1, SAVE_L | move BASE, CARG2 | addiu DISPATCH, DISPATCH, GG_G2DISP | sw CARG1, SAVE_PC // Any value outside of bytecode is ok. | sw TMP1, SAVE_CFRAME | sw sp, L->cframe // Add our C frame to cframe chain. | |3: // Entry point for vm_cpcall/vm_resume (BASE = base, PC = ftype). | sw L, DISPATCH_GL(cur_L)(DISPATCH) | lw TMP2, L->base // TMP2 = old base (used in vmeta_call). | li TISNUM, LJ_TISNUM // Setup type comparison constants. | .FPU lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). | lw TMP1, L->top | .FPU mtc1 TMP3, TOBIT | addu PC, PC, BASE | subu NARGS8:RC, TMP1, BASE | subu PC, PC, TMP2 // PC = frame delta + frame type | .FPU 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 | lw DISPATCH, L->glref // Setup pointer to dispatch table. | sw CARG1, SAVE_PC // Any value outside of bytecode is ok. | subu TMP0, TMP0, TMP1 // Compute -savestack(L, L->top). | lw TMP1, L->cframe | addiu DISPATCH, DISPATCH, GG_G2DISP | sw TMP0, SAVE_NRES // Neg. delta means cframe w/o frame. | sw r0, SAVE_ERRF // No error function. | sw TMP1, SAVE_CFRAME | sw sp, L->cframe // Add our C frame to cframe chain. | sw L, DISPATCH_GL(cur_L)(DISPATCH) | jalr CARG4 // (lua_State *L, lua_CFunction func, void *ud) |. move CFUNCADDR, CARG4 | move BASE, CRET1 | bnez CRET1, <3 // Else continue with the call. |. li PC, FRAME_CP | 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 |.if FFI | bnez AT, >1 |.endif |. sw TISNIL, -8+HI(TMP2) // Ensure one valid arg. | lw TMP1, LFUNC:TMP1->pc | // 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 | lw SFRETHI, HI(RA) | lw SFRETLO, LO(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 | sw SFRETHI, HI(CARG2) | bne TMP1, CARG2, ->BC_CAT_Z |. sw SFRETLO, LO(CARG2) | addu RA, BASE, RA | sw SFRETHI, HI(RA) | b ->cont_nop |. sw SFRETLO, LO(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 | addiu CARG3, DISPATCH, DISPATCH_GL(tmptv) | sw TMP0, LO(CARG3) | sw TISNUM, HI(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 | lw SFARG1HI, HI(CRET1) | lw SFARG2HI, LO(CRET1) | ins_next1 | sw SFARG1HI, HI(RA) | sw SFARG2HI, LO(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_tgetr: | load_got lj_tab_getinth | call_intern lj_tab_getinth // (GCtab *t, int32_t key) |. nop | // Returns cTValue * or NULL. | beqz CRET1, ->BC_TGETR_Z |. move SFARG2HI, TISNIL | lw SFARG2HI, HI(CRET1) | b ->BC_TGETR_Z |. lw SFARG2LO, LO(CRET1) | |//----------------------------------------------------------------------- | |->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 | addiu CARG3, DISPATCH, DISPATCH_GL(tmptv) | sw TMP0, LO(CARG3) | sw TISNUM, HI(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). | lw SFARG1HI, HI(RA) | beqz CRET1, >3 |. lw SFARG1LO, LO(RA) | // NOBARRIER: lj_meta_tset ensures the table is not black. | ins_next1 | sw SFARG1HI, HI(CRET1) | sw SFARG1LO, LO(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. | sw SFARG1HI, 16+HI(BASE) // Copy value to third argument. | sw SFARG1LO, 16+LO(BASE) | b ->vm_call_dispatch_f |. li NARGS8:RC, 24 // 3 args for func(t, k, v) | |->vmeta_tsetr: | load_got lj_tab_setinth | sw BASE, L->base | sw PC, SAVE_PC | call_intern lj_tab_setinth // (lua_State *L, GCtab *t, int32_t key) |. move CARG1, L | // Returns TValue *. | b ->BC_TSETR_Z |. nop | |//-- Comparison metamethods --------------------------------------------- | |->vmeta_comp: | // RA/RD point to o1/o2. | move CARG2, RA | move CARG3, RD | 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) | lw SFRETHI, HI(RA) | lw SFRETLO, LO(RA) | sll TMP1, TMP1, 3 | addu TMP1, BASE, TMP1 | sw SFRETHI, HI(TMP1) | b ->cont_nop |. sw SFRETLO, LO(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: | // SFARG1LO/SFARG2LO point to o1/o2. TMP0 is set to 0/1. | load_got lj_meta_equal | move CARG2, SFARG1LO | move CARG3, SFARG2LO | move CARG4, TMP0 | 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 | |->vmeta_istype: | load_got lj_meta_istype | addiu PC, PC, -4 | sw BASE, L->base | srl CARG2, RA, 3 | srl CARG3, RD, 3 | sw PC, SAVE_PC | call_intern lj_meta_istype // (lua_State *L, BCReg ra, BCReg tp) |. move CARG1, L | b ->cont_nop |. nop | |//-- Arithmetic metamethods --------------------------------------------- | |->vmeta_unm: | move RC, RB | |->vmeta_arith: | load_got lj_meta_arith | decode_OP1 TMP0, INS | sw BASE, L->base | move CARG2, RA | sw PC, SAVE_PC | move CARG3, RB | move CARG4, RC | 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: | lw SFARG1HI, HI(BASE) | beqz NARGS8:RC, ->fff_fallback |. lw SFARG1LO, LO(BASE) |.endmacro | |.macro .ffunc_2, name |->ff_ .. name: | sltiu AT, NARGS8:RC, 16 | lw SFARG1HI, HI(BASE) | bnez AT, ->fff_fallback |. lw SFARG2HI, 8+HI(BASE) | lw SFARG1LO, LO(BASE) | lw SFARG2LO, 8+LO(BASE) |.endmacro | |.macro .ffunc_n, name // Caveat: has delay slot! |->ff_ .. name: | lw SFARG1HI, HI(BASE) |.if FPU | ldc1 FARG1, 0(BASE) |.else | lw SFARG1LO, LO(BASE) |.endif | beqz NARGS8:RC, ->fff_fallback |. sltiu AT, SFARG1HI, LJ_TISNUM | beqz AT, ->fff_fallback |.endmacro | |.macro .ffunc_nn, name // Caveat: has delay slot! |->ff_ .. name: | sltiu AT, NARGS8:RC, 16 | lw SFARG1HI, HI(BASE) | bnez AT, ->fff_fallback |. lw SFARG2HI, 8+HI(BASE) | sltiu TMP0, SFARG1HI, LJ_TISNUM |.if FPU | ldc1 FARG1, 0(BASE) |.else | lw SFARG1LO, LO(BASE) |.endif | sltiu TMP1, SFARG2HI, LJ_TISNUM |.if FPU | ldc1 FARG2, 8(BASE) |.else | lw SFARG2LO, 8+LO(BASE) |.endif | 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, SFARG1HI, 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 SFARG1HI, HI(RA) | addiu TMP1, BASE, 8 | beq BASE, TMP2, ->fff_res // Done if exactly 1 argument. |. sw SFARG1LO, LO(RA) |1: | lw SFRETHI, HI(TMP1) | lw SFRETLO, LO(TMP1) | sw SFRETHI, -8+HI(TMP1) | sw SFRETLO, -8+LO(TMP1) | bne TMP1, TMP2, <1 |. addiu TMP1, TMP1, 8 | b ->fff_res |. nop | |.ffunc type | lw SFARG1HI, HI(BASE) | beqz NARGS8:RC, ->fff_fallback |. sltiu TMP0, SFARG1HI, LJ_TISNUM | movn SFARG1HI, TISNUM, TMP0 | not TMP1, SFARG1HI | sll TMP1, TMP1, 3 | addu TMP1, CFUNC:RB, TMP1 | lw SFARG1HI, CFUNC:TMP1->upvalue[0].u32.hi | b ->fff_restv |. lw SFARG1LO, CFUNC:TMP1->upvalue[0].u32.lo | |//-- Base library: getters and setters --------------------------------- | |.ffunc_1 getmetatable | li AT, LJ_TTAB | bne SFARG1HI, AT, >6 |. li AT, LJ_TUDATA |1: // Field metatable must be at same offset for GCtab and GCudata! | lw TAB:SFARG1LO, TAB:SFARG1LO->metatable |2: | lw STR:RC, DISPATCH_GL(gcroot[GCROOT_MMNAME+MM_metatable])(DISPATCH) | beqz TAB:SFARG1LO, ->fff_restv |. li SFARG1HI, LJ_TNIL | lw TMP0, TAB:SFARG1LO->hmask | li SFARG1HI, LJ_TTAB // Use metatable as default result. | lw TMP1, STR:RC->sid | lw NODE:TMP2, TAB:SFARG1LO->node | and TMP1, TMP1, TMP0 // idx = str->sid & 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 CARG3, 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 CARG3, TISNIL, ->fff_restv // Ditto for nil value. |. nop | move SFARG1HI, CARG3 // Return value of mt.__metatable. | b ->fff_restv |. move SFARG1LO, TMP1 | |6: | beq SFARG1HI, AT, <1 |. sltu AT, TISNUM, SFARG1HI | movz SFARG1HI, TISNUM, AT | not TMP1, SFARG1HI | sll TMP1, TMP1, 2 | addu TMP1, DISPATCH, TMP1 | b <2 |. lw TAB:SFARG1LO, 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 SFARG1HI, AT, ->fff_fallback |. addiu SFARG2HI, SFARG2HI, -LJ_TTAB | lw TAB:TMP1, TAB:SFARG1LO->metatable | lbu TMP3, TAB:SFARG1LO->marked | or AT, SFARG2HI, TAB:TMP1 | bnez AT, ->fff_fallback |. andi AT, TMP3, LJ_GC_BLACK // isblack(table) | beqz AT, ->fff_restv |. sw TAB:SFARG2LO, TAB:SFARG1LO->metatable | barrierback TAB:SFARG1LO, 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 *. | lw SFARG1HI, HI(CRET1) | b ->fff_restv |. lw SFARG1LO, LO(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 // Exactly one number argument. | sltu TMP0, TISNUM, CARG1 | or AT, AT, TMP0 | bnez AT, ->fff_fallback |. lw SFARG1HI, HI(BASE) | b ->fff_restv |. lw SFARG1LO, LO(BASE) | |.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 SFARG1HI, AT, ->fff_restv // String key? | // Handle numbers inline, unless a number base metatable is present. |. lw TMP1, DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM])(DISPATCH) | sltu TMP0, TISNUM, SFARG1HI | or TMP0, TMP0, TMP1 | bnez 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_strfmt_number | move CARG1, L | call_intern lj_strfmt_number // (lua_State *L, cTValue *o) |. move CARG2, BASE | // Returns GCstr *. | li SFARG1HI, LJ_TSTR | b ->fff_restv |. move SFARG1LO, CRET1 | |//-- Base library: iterators ------------------------------------------- | |.ffunc next | lw CARG2, HI(BASE) | lw TAB:CARG1, 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 CARG2, AT, ->fff_fallback |. lw PC, FRAME_PC(BASE) | load_got lj_tab_next | addiu CARG2, BASE, 8 | call_intern lj_tab_next // (GCtab *t, cTValue *key, TValue *o) |. addiu CARG3, BASE, -8 | // Returns 1=found, 0=end, -1=error. | addiu RA, BASE, -8 | bgtz CRET1, ->fff_res // Found key/value. |. li RD, (2+1)*8 | beqz CRET1, ->fff_restv // End of traversal: return nil. |. li SFARG1HI, LJ_TNIL | lw CFUNC:RB, FRAME_FUNC(BASE) | b ->fff_fallback // Invalid key. |. li RC, 2*8 | |.ffunc_1 pairs | li AT, LJ_TTAB | bne SFARG1HI, AT, ->fff_fallback |. lw PC, FRAME_PC(BASE) #if LJ_52 | lw TAB:TMP2, TAB:SFARG1LO->metatable | lw TMP0, CFUNC:RB->upvalue[0].u32.hi | lw TMP1, CFUNC:RB->upvalue[0].u32.lo | bnez TAB:TMP2, ->fff_fallback #else | lw TMP0, CFUNC:RB->upvalue[0].u32.hi | lw TMP1, CFUNC:RB->upvalue[0].u32.lo #endif |. addiu RA, BASE, -8 | sw TISNIL, 8+HI(BASE) | sw TMP0, HI(RA) | sw TMP1, LO(RA) | b ->fff_res |. li RD, (3+1)*8 | |.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 |. addiu CARG3, CARG3, -LJ_TTAB | xor CARG4, CARG4, TISNUM | and AT, CARG3, CARG4 | bnez AT, ->fff_fallback |. lw PC, FRAME_PC(BASE) | lw TMP2, 8+LO(BASE) | lw TMP0, TAB:CARG1->asize | lw TMP1, TAB:CARG1->array | addiu TMP2, TMP2, 1 | sw TISNUM, -8+HI(BASE) | sltu AT, TMP2, TMP0 | sw TMP2, -8+LO(BASE) | beqz AT, >2 // Not in array part? |. addiu RA, BASE, -8 | sll TMP3, TMP2, 3 | addu TMP3, TMP1, TMP3 | lw TMP1, HI(TMP3) | lw TMP2, LO(TMP3) |1: | beq TMP1, TISNIL, ->fff_res // End of iteration, return 0 results. |. li RD, (0+1)*8 | sw TMP1, 8+HI(RA) | sw TMP2, 8+LO(RA) | b ->fff_res |. li RD, (2+1)*8 | |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 TMP1, HI(CRET1) | b <1 |. lw TMP2, LO(CRET1) | |.ffunc_1 ipairs | li AT, LJ_TTAB | bne SFARG1HI, AT, ->fff_fallback |. lw PC, FRAME_PC(BASE) #if LJ_52 | lw TAB:TMP2, TAB:SFARG1LO->metatable | lw TMP0, CFUNC:RB->upvalue[0].u32.hi | lw TMP1, CFUNC:RB->upvalue[0].u32.lo | bnez TAB:TMP2, ->fff_fallback #else | lw TMP0, CFUNC:RB->upvalue[0].u32.hi | lw TMP1, CFUNC:RB->upvalue[0].u32.lo #endif |. addiu RA, BASE, -8 | sw TISNUM, 8+HI(BASE) | sw r0, 8+LO(BASE) | sw TMP0, HI(RA) | sw TMP1, LO(RA) | b ->fff_res |. li RD, (3+1)*8 | |//-- Base library: catch errors ---------------------------------------- | |.ffunc pcall | lw TMP1, L->maxstack | addu TMP2, BASE, NARGS8:RC | lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH) | beqz NARGS8:RC, ->fff_fallback |. sltu AT, TMP1, TMP2 | bnez AT, ->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 | lw TMP1, L->maxstack | addu TMP2, BASE, NARGS8:RC | sltiu AT, NARGS8:RC, 16 | lw CARG4, 8+HI(BASE) | sltu TMP1, TMP1, TMP2 | or AT, AT, TMP1 | bnez AT, ->fff_fallback |. lw CARG3, 8+LO(BASE) | lw CARG1, LO(BASE) | lw CARG2, HI(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 | sw CARG3, LO(TMP2) // Swap function and traceback. | sw CARG4, HI(TMP2) | andi TMP3, TMP3, 1 | sw CARG1, 8+LO(TMP2) | sw CARG2, 8+HI(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 coroutine_resume | lw CARG3, HI(BASE) | beqz NARGS8:RC, ->fff_fallback |. lw CARG1, LO(BASE) | 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. | lw SFRETHI, HI(BASE) | lw SFRETLO, LO(BASE) | sltu AT, BASE, TMP1 | beqz AT, >3 |. addiu BASE, BASE, 8 | sw SFRETHI, HI(CARG3) | sw SFRETLO, LO(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 | sw L, DISPATCH_GL(cur_L)(DISPATCH) | 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. | lw SFRETHI, HI(TMP2) | lw SFRETLO, LO(TMP2) | addiu TMP2, TMP2, 8 | sltu AT, TMP2, TMP3 | sw SFRETHI, HI(TMP1) | sw SFRETLO, LO(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 | lw SFRETHI, HI(TMP3) | lw SFRETLO, LO(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 | sw SFRETHI, HI(BASE) // Copy error message. | sw SFRETLO, LO(BASE) | 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_1 math_abs | bne SFARG1HI, TISNUM, >1 |. sra TMP0, SFARG1LO, 31 | xor TMP1, SFARG1LO, TMP0 | subu SFARG1LO, TMP1, TMP0 | bgez SFARG1LO, ->fff_restv |. nop | lui SFARG1HI, 0x41e0 // 2^31 as a double. | b ->fff_restv |. li SFARG1LO, 0 |1: | sltiu AT, SFARG1HI, LJ_TISNUM | beqz AT, ->fff_fallback |. sll SFARG1HI, SFARG1HI, 1 | srl SFARG1HI, SFARG1HI, 1 |// fallthrough | |->fff_restv: | // SFARG1LO/SFARG1HI = TValue result. | lw PC, FRAME_PC(BASE) | sw SFARG1HI, -8+HI(BASE) | addiu RA, BASE, -8 | sw SFARG1LO, -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 | .ffunc math_ .. func | lw SFARG1HI, HI(BASE) | beqz NARGS8:RC, ->fff_fallback |. load_got func | sltiu AT, SFARG1HI, LJ_TISNUM | beqz AT, ->fff_fallback |.if FPU |. ldc1 FARG1, 0(BASE) |.else |. lw SFARG1LO, LO(BASE) |.endif | call_extern |. nop | b ->fff_resn |. nop |.endmacro | |.macro math_extern2, func | .ffunc_nn math_ .. func |. load_got func | call_extern |. nop | b ->fff_resn |. nop |.endmacro | |// TODO: Return integer type if result is integer (own sf implementation). |.macro math_round, func |->ff_math_ .. func: | lw SFARG1HI, HI(BASE) | beqz NARGS8:RC, ->fff_fallback |. lw SFARG1LO, LO(BASE) | beq SFARG1HI, TISNUM, ->fff_restv |. sltu AT, SFARG1HI, TISNUM | beqz AT, ->fff_fallback |.if FPU |. ldc1 FARG1, 0(BASE) | bal ->vm_ .. func |.else |. load_got func | call_extern |.endif |. nop | b ->fff_resn |. nop |.endmacro | | math_round floor | math_round ceil | |.ffunc math_log | li AT, 8 | bne NARGS8:RC, AT, ->fff_fallback // Exactly 1 argument. |. lw SFARG1HI, HI(BASE) | sltiu AT, SFARG1HI, LJ_TISNUM | beqz AT, ->fff_fallback |. load_got log |.if FPU | call_extern |. ldc1 FARG1, 0(BASE) |.else | call_extern |. lw SFARG1LO, LO(BASE) |.endif | 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 | |.if FPU |.ffunc_n math_sqrt |. sqrt.d FRET1, FARG1 |// fallthrough to ->fff_resn |.else | math_extern sqrt |.endif | |->fff_resn: | lw PC, FRAME_PC(BASE) | addiu RA, BASE, -8 |.if FPU | b ->fff_res1 |. sdc1 FRET1, -8(BASE) |.else | sw SFRETHI, -8+HI(BASE) | b ->fff_res1 |. sw SFRETLO, -8+LO(BASE) |.endif | | |.ffunc math_ldexp | sltiu AT, NARGS8:RC, 16 | lw SFARG1HI, HI(BASE) | bnez AT, ->fff_fallback |. lw CARG4, 8+HI(BASE) | bne CARG4, TISNUM, ->fff_fallback | load_got ldexp |. sltu AT, SFARG1HI, TISNUM | beqz AT, ->fff_fallback |.if FPU |. ldc1 FARG1, 0(BASE) |.else |. lw SFARG1LO, LO(BASE) |.endif | call_extern |. lw CARG3, 8+LO(BASE) | 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 |.if FPU | mtc1 TMP1, FARG2 | sdc1 FRET1, 0(RA) | cvt.d.w FARG2, FARG2 | sdc1 FARG2, 8(RA) |.else | sw SFRETLO, LO(RA) | sw SFRETHI, HI(RA) | sw TMP1, 8+LO(RA) | sw TISNUM, 8+HI(RA) |.endif | 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 |.if FPU | sdc1 FRET1, 0(BASE) |.else | sw SFRETLO, LO(BASE) | sw SFRETHI, HI(BASE) |.endif | b ->fff_res |. li RD, (2+1)*8 | |.macro math_minmax, name, intins, ismax | .ffunc_1 name | addu TMP3, BASE, NARGS8:RC | bne SFARG1HI, TISNUM, >5 |. addiu TMP2, BASE, 8 |1: // Handle integers. |. lw SFARG2HI, HI(TMP2) | beq TMP2, TMP3, ->fff_restv |. lw SFARG2LO, LO(TMP2) | bne SFARG2HI, TISNUM, >3 |. slt AT, SFARG1LO, SFARG2LO | intins SFARG1LO, SFARG2LO, AT | b <1 |. addiu TMP2, TMP2, 8 | |3: // Convert intermediate result to number and continue with number loop. | sltiu AT, SFARG2HI, LJ_TISNUM | beqz AT, ->fff_fallback |.if FPU |. mtc1 SFARG1LO, FRET1 | cvt.d.w FRET1, FRET1 | b >7 |. ldc1 FARG1, 0(TMP2) |.else |. nop | bal ->vm_sfi2d_1 |. nop | b >7 |. nop |.endif | |5: |. sltiu AT, SFARG1HI, LJ_TISNUM | beqz AT, ->fff_fallback |.if FPU |. ldc1 FRET1, 0(BASE) |.endif | |6: // Handle numbers. |. lw SFARG2HI, HI(TMP2) |.if FPU | beq TMP2, TMP3, ->fff_resn |.else | beq TMP2, TMP3, ->fff_restv |.endif |. sltiu AT, SFARG2HI, LJ_TISNUM | beqz AT, >8 |.if FPU |. ldc1 FARG1, 0(TMP2) |.else |. lw SFARG2LO, LO(TMP2) |.endif |7: |.if FPU |.if ismax | c.olt.d FARG1, FRET1 |.else | c.olt.d FRET1, FARG1 |.endif | movf.d FRET1, FARG1 |.else |.if ismax | bal ->vm_sfcmpogt |.else | bal ->vm_sfcmpolt |.endif |. nop | movz SFARG1LO, SFARG2LO, CRET1 | movz SFARG1HI, SFARG2HI, CRET1 |.endif | b <6 |. addiu TMP2, TMP2, 8 | |8: // Convert integer to number and continue with number loop. | bne SFARG2HI, TISNUM, ->fff_fallback |.if FPU |. lwc1 FARG1, LO(TMP2) | b <7 |. cvt.d.w FARG1, FARG1 |.else |. nop | bal ->vm_sfi2d_2 |. nop | b <7 |. nop |.endif | |.endmacro | | math_minmax math_min, movz, 0 | math_minmax math_max, movn, 1 | |//-- String library ----------------------------------------------------- | |.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 | addiu RA, BASE, -8 | lw PC, FRAME_PC(BASE) | sltu RD, r0, TMP0 | lbu TMP1, STR:CARG1[1] // Access is always ok (NUL at end). | addiu RD, RD, 1 | sll RD, RD, 3 // RD = ((str->len != 0)+1)*8 | sw TISNUM, HI(RA) | b ->fff_res |. sw TMP1, LO(RA) | |.ffunc string_char // Only handle the 1-arg case here. | ffgccheck |. nop | lw CARG3, HI(BASE) | lw CARG1, LO(BASE) | li TMP1, 255 | xori AT, NARGS8:RC, 8 // Exactly 1 argument. | xor TMP0, CARG3, TISNUM // Integer. | sltu TMP1, TMP1, CARG1 // !(255 < n). | or AT, AT, TMP0 | or AT, AT, TMP1 | bnez AT, ->fff_fallback |. li CARG3, 1 | addiu CARG2, sp, ARG5_OFS | sb CARG1, 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 |->fff_resstr: | move SFARG1LO, CRET1 | b ->fff_restv |. li SFARG1HI, LJ_TSTR | |.ffunc string_sub | ffgccheck |. nop | addiu AT, NARGS8:RC, -16 | lw CARG3, 16+HI(BASE) | lw TMP0, HI(BASE) | lw STR:CARG1, LO(BASE) | bltz AT, ->fff_fallback |. lw CARG2, 8+HI(BASE) | beqz AT, >1 |. li CARG4, -1 | bne CARG3, TISNUM, ->fff_fallback |. lw CARG4, 16+LO(BASE) |1: | bne CARG2, TISNUM, ->fff_fallback |. li AT, LJ_TSTR | bne TMP0, AT, ->fff_fallback |. lw CARG3, 8+LO(BASE) | lw CARG2, STR:CARG1->len | // 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:SFARG1LO, DISPATCH, DISPATCH_GL(strempty) | b ->fff_restv |. li SFARG1HI, LJ_TSTR | |.macro ffstring_op, name | .ffunc string_ .. name | ffgccheck |. nop | lw CARG3, HI(BASE) | lw STR:CARG2, LO(BASE) | beqz NARGS8:RC, ->fff_fallback |. li AT, LJ_TSTR | bne CARG3, AT, ->fff_fallback |. addiu SBUF:CARG1, DISPATCH, DISPATCH_GL(tmpbuf) | load_got lj_buf_putstr_ .. name | lw TMP0, SBUF:CARG1->b | sw L, SBUF:CARG1->L | sw BASE, L->base | sw TMP0, SBUF:CARG1->w | call_intern extern lj_buf_putstr_ .. name |. sw PC, SAVE_PC | load_got lj_buf_tostr | call_intern lj_buf_tostr |. move SBUF:CARG1, SBUF:CRET1 | b ->fff_resstr |. lw BASE, L->base |.endmacro | |ffstring_op reverse |ffstring_op lower |ffstring_op upper | |//-- Bit library -------------------------------------------------------- | |->vm_tobit_fb: | beqz TMP1, ->fff_fallback |.if FPU |. ldc1 FARG1, 0(BASE) | add.d FARG1, FARG1, TOBIT | jr ra |. mfc1 CRET1, FARG1 |.else |// FP number to bit conversion for soft-float. |->vm_tobit: | sll TMP0, SFARG1HI, 1 | lui AT, 0x0020 | addu TMP0, TMP0, AT | slt AT, TMP0, r0 | movz SFARG1LO, r0, AT | beqz AT, >2 |. li TMP1, 0x3e0 | not TMP1, TMP1 | sra TMP0, TMP0, 21 | subu TMP0, TMP1, TMP0 | slt AT, TMP0, r0 | bnez AT, >1 |. sll TMP1, SFARG1HI, 11 | lui AT, 0x8000 | or TMP1, TMP1, AT | srl AT, SFARG1LO, 21 | or TMP1, TMP1, AT | slt AT, SFARG1HI, r0 | beqz AT, >2 |. srlv SFARG1LO, TMP1, TMP0 | subu SFARG1LO, r0, SFARG1LO |2: | jr ra |. move CRET1, SFARG1LO |1: | addiu TMP0, TMP0, 21 | srlv TMP1, SFARG1LO, TMP0 | li AT, 20 | subu TMP0, AT, TMP0 | sll SFARG1LO, SFARG1HI, 12 | sllv AT, SFARG1LO, TMP0 | or SFARG1LO, TMP1, AT | slt AT, SFARG1HI, r0 | beqz AT, <2 |. nop | jr ra |. subu CRET1, r0, SFARG1LO |.endif | |.macro .ffunc_bit, name | .ffunc_1 bit_..name | beq SFARG1HI, TISNUM, >6 |. move CRET1, SFARG1LO | bal ->vm_tobit_fb |. sltu TMP1, SFARG1HI, TISNUM |6: |.endmacro | |.macro .ffunc_bit_op, name, ins | .ffunc_bit name | addiu TMP2, BASE, 8 | addu TMP3, BASE, NARGS8:RC |1: | lw SFARG1HI, HI(TMP2) | beq TMP2, TMP3, ->fff_resi |. lw SFARG1LO, LO(TMP2) |.if FPU | bne SFARG1HI, TISNUM, >2 |. addiu TMP2, TMP2, 8 | b <1 |. ins CRET1, CRET1, SFARG1LO |2: | ldc1 FARG1, -8(TMP2) | sltu TMP1, SFARG1HI, TISNUM | beqz TMP1, ->fff_fallback |. add.d FARG1, FARG1, TOBIT | mfc1 SFARG1LO, FARG1 | b <1 |. ins CRET1, CRET1, SFARG1LO |.else | beq SFARG1HI, TISNUM, >2 |. move CRET2, CRET1 | bal ->vm_tobit_fb |. sltu TMP1, SFARG1HI, TISNUM | move SFARG1LO, CRET2 |2: | ins CRET1, CRET1, SFARG1LO | b <1 |. addiu TMP2, TMP2, 8 |.endif |.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_2 bit_..name | beq SFARG1HI, TISNUM, >1 |. nop | bal ->vm_tobit_fb |. sltu TMP1, SFARG1HI, TISNUM | move SFARG1LO, CRET1 |1: | bne SFARG2HI, TISNUM, ->fff_fallback |. nop |.if shmod == 1 | li AT, 32 | subu TMP0, AT, SFARG2LO | sllv SFARG2LO, SFARG1LO, SFARG2LO | srlv SFARG1LO, SFARG1LO, TMP0 |.elif shmod == 2 | li AT, 32 | subu TMP0, AT, SFARG2LO | srlv SFARG2LO, SFARG1LO, SFARG2LO | sllv SFARG1LO, SFARG1LO, TMP0 |.endif | b ->fff_resi |. ins CRET1, SFARG1LO, SFARG2LO |.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: | lw PC, FRAME_PC(BASE) | addiu RA, BASE, -8 | sw TISNUM, -8+HI(BASE) | b ->fff_res1 |. sw CRET1, -8+LO(BASE) | |//----------------------------------------------------------------------- | |->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) | |->cont_stitch: // Trace stitching. |.if JIT | // RA = resultptr, RB = meta base | lw INS, -4(PC) | lw TMP2, -24+LO(RB) // Save previous trace. | decode_RA8a RC, INS | addiu AT, MULTRES, -8 | decode_RA8b RC | beqz AT, >2 |. addu RC, BASE, RC // Call base. |1: // Move results down. | lw SFRETHI, HI(RA) | lw SFRETLO, LO(RA) | addiu AT, AT, -8 | addiu RA, RA, 8 | sw SFRETHI, HI(RC) | sw SFRETLO, LO(RC) | bnez AT, <1 |. addiu RC, RC, 8 |2: | decode_RA8a RA, INS | decode_RB8a RB, INS | decode_RA8b RA | decode_RB8b RB | addu RA, RA, RB | addu RA, BASE, RA |3: | sltu AT, RC, RA | bnez AT, >9 // More results wanted? |. nop | | lhu TMP3, TRACE:TMP2->traceno | lhu RD, TRACE:TMP2->link | beq RD, TMP3, ->cont_nop // Blacklisted. |. load_got lj_dispatch_stitch | bnez RD, =>BC_JLOOP // Jump to stitched trace. |. sll RD, RD, 3 | | // Stitch a new trace to the previous trace. | sw TMP3, DISPATCH_J(exitno)(DISPATCH) | sw L, DISPATCH_J(L)(DISPATCH) | sw BASE, L->base | addiu CARG1, DISPATCH, GG_DISP2J | call_intern lj_dispatch_stitch // (jit_State *J, const BCIns *pc) |. move CARG2, PC | b ->cont_nop |. lw BASE, L->base | |9: | sw TISNIL, HI(RC) | b <3 |. addiu RC, RC, 8 |.endif | |->vm_profhook: // Dispatch target for profiler hook. #if LJ_HASPROFILE | load_got lj_dispatch_profile | sw MULTRES, SAVE_MULTRES | move CARG2, PC | sw BASE, L->base | call_intern lj_dispatch_profile // (lua_State *L, const BCIns *pc) |. move CARG1, L | // HOOK_PROFILE is off again, so re-dispatch to dynamic instruction. | addiu PC, PC, -4 | b ->cont_nop |. lw BASE, L->base #endif | |//----------------------------------------------------------------------- |//-- Trace exit handler ------------------------------------------------- |//----------------------------------------------------------------------- | |.macro savex_, a, b |.if FPU | 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) |.else | sw r..a, 16+a*4(sp) | sw r..b, 16+b*4(sp) |.endif |.endmacro | |->vm_exit_handler: |.if JIT |.if FPU | addiu sp, sp, -(16+32*8+32*4) |.else | addiu sp, sp, -(16+32*4) |.endif | 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 |.if FPU | sdc1 f28, 16+28*8(sp) | sdc1 f30, 16+30*8(sp) | sw r28, 16+32*8+28*4(sp) | sw r30, 16+32*8+30*4(sp) | sw r0, 16+32*8+31*4(sp) // Clear RID_TMP. | addiu TMP2, sp, 16+32*8+32*4 // Recompute original value of sp. | sw TMP2, 16+32*8+29*4(sp) // Store sp in RID_SP |.else | sw r28, 16+28*4(sp) | sw r30, 16+30*4(sp) | sw r0, 16+31*4(sp) // Clear RID_TMP. | addiu TMP2, sp, 16+32*4 // Recompute original value of sp. | sw TMP2, 16+29*4(sp) // Store sp in RID_SP |.endif | li_vmstate EXIT | addiu DISPATCH, JGL, -GG_DISP2G-32768 | lw TMP1, 0(TMP2) // Load exit number. | st_vmstate | lw L, DISPATCH_GL(cur_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 BASE, L->base | sw TMP1, DISPATCH_J(exitno)(DISPATCH) // Store exit number. | addiu CARG1, DISPATCH, GG_DISP2J | sw r0, DISPATCH_GL(jit_base)(DISPATCH) | 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 | sw BASE, L->base |1: | sltiu TMP0, CRET1, -LUA_ERRERR // Check for error from exit. | beqz TMP0, >9 |. lw LFUNC:RB, FRAME_FUNC(BASE) | .FPU lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). | sll MULTRES, CRET1, 3 | li TISNIL, LJ_TNIL | li TISNUM, LJ_TISNUM // Setup type comparison constants. | sw MULTRES, SAVE_MULTRES | .FPU mtc1 TMP3, TOBIT | lw TMP1, LFUNC:RB->pc | sw r0, DISPATCH_GL(jit_base)(DISPATCH) | lw KBASE, PC2PROTO(k)(TMP1) | .FPU cvt.d.s TOBIT, TOBIT | // Modified copy of ins_next which handles function header dispatch, too. | lw INS, 0(PC) | addiu CRET1, CRET1, 17 // Static dispatch? | // Assumes TISNIL == ~LJ_VMST_INTERP == -1 | sw TISNIL, DISPATCH_GL(vmstate)(DISPATCH) | decode_RD8a RD, INS | beqz CRET1, >5 |. addiu PC, PC, 4 | decode_OP4a TMP1, INS | decode_OP4b TMP1 | addu TMP0, DISPATCH, TMP1 | sltiu TMP2, TMP1, BC_FUNCF*4 | lw AT, 0(TMP0) | decode_RA8a RA, INS | beqz TMP2, >2 |. decode_RA8b RA | jr AT |. decode_RD8b RD |2: | sltiu TMP2, TMP1, (BC_FUNCC+2)*4 // Fast function? | bnez TMP2, >3 |. lw TMP1, FRAME_PC(BASE) | // Check frame below fast function. | andi TMP0, TMP1, FRAME_TYPE | bnez TMP0, >3 // Trace stitching continuation? |. nop | // Otherwise set KBASE for Lua function below fast function. | lw TMP2, -4(TMP1) | decode_RA8a TMP0, TMP2 | decode_RA8b TMP0 | subu TMP1, BASE, TMP0 | lw LFUNC:TMP2, -8+FRAME_FUNC(TMP1) | lw TMP1, LFUNC:TMP2->pc | lw KBASE, PC2PROTO(k)(TMP1) |3: | addiu RC, MULTRES, -8 | jr AT |. addu RA, RA, BASE | |5: // Dispatch to static entry of original ins replaced by BC_JLOOP. | lw TMP0, DISPATCH_J(trace)(DISPATCH) | decode_RD4b RD | addu TMP0, TMP0, RD | lw TRACE:TMP2, 0(TMP0) | lw INS, TRACE:TMP2->startins | 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 | |9: // Rethrow error from the right C frame. | load_got lj_err_trace | sub CARG2, r0, CRET1 | call_intern lj_err_trace // (lua_State *L, int errcode) |. move CARG1, L |.endif | |//----------------------------------------------------------------------- |//-- Math helper functions ---------------------------------------------- |//----------------------------------------------------------------------- | |// Hard-float round to integer. |// Modifies AT, TMP0, FRET1, FRET2, f4. Keeps all others incl. FARG1. |.macro vm_round_hf, 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 | |.macro vm_round, func |.if FPU | vm_round_hf, func |.endif |.endmacro | |->vm_floor: | vm_round floor |->vm_ceil: | vm_round ceil |->vm_trunc: |.if JIT | vm_round trunc |.endif | |// Soft-float integer to number conversion. |.macro sfi2d, AHI, ALO |.if not FPU | beqz ALO, >9 // Handle zero first. |. sra TMP0, ALO, 31 | xor TMP1, ALO, TMP0 | subu TMP1, TMP1, TMP0 // Absolute value in TMP1. | clz AHI, TMP1 | andi TMP0, TMP0, 0x800 // Mask sign bit. | li AT, 0x3ff+31-1 | sllv TMP1, TMP1, AHI // Align mantissa left with leading 1. | subu AHI, AT, AHI // Exponent - 1 in AHI. | sll ALO, TMP1, 21 | or AHI, AHI, TMP0 // Sign | Exponent. | srl TMP1, TMP1, 11 | sll AHI, AHI, 20 // Align left. | jr ra |. addu AHI, AHI, TMP1 // Add mantissa, increment exponent. |9: | jr ra |. li AHI, 0 |.endif |.endmacro | |// Input SFARG1LO. Output: SFARG1*. Temporaries: AT, TMP0, TMP1. |->vm_sfi2d_1: | sfi2d SFARG1HI, SFARG1LO | |// Input SFARG2LO. Output: SFARG2*. Temporaries: AT, TMP0, TMP1. |->vm_sfi2d_2: | sfi2d SFARG2HI, SFARG2LO | |// Soft-float comparison. Equivalent to c.eq.d. |// Input: SFARG*. Output: CRET1. Temporaries: AT, TMP0, TMP1. |->vm_sfcmpeq: |.if not FPU | sll AT, SFARG1HI, 1 | sll TMP0, SFARG2HI, 1 | or CRET1, SFARG1LO, SFARG2LO | or TMP1, AT, TMP0 | or TMP1, TMP1, CRET1 | beqz TMP1, >8 // Both args +-0: return 1. |. sltu CRET1, r0, SFARG1LO | lui TMP1, 0xffe0 | addu AT, AT, CRET1 | sltu CRET1, r0, SFARG2LO | sltu AT, TMP1, AT | addu TMP0, TMP0, CRET1 | sltu TMP0, TMP1, TMP0 | or TMP1, AT, TMP0 | bnez TMP1, >9 // Either arg is NaN: return 0; |. xor TMP0, SFARG1HI, SFARG2HI | xor TMP1, SFARG1LO, SFARG2LO | or AT, TMP0, TMP1 | jr ra |. sltiu CRET1, AT, 1 // Same values: return 1. |8: | jr ra |. li CRET1, 1 |9: | jr ra |. li CRET1, 0 |.endif | |// Soft-float comparison. Equivalent to c.ult.d and c.olt.d. |// Input: SFARG*. Output: CRET1. Temporaries: AT, TMP0, TMP1, CRET2. |->vm_sfcmpult: |.if not FPU | b >1 |. li CRET2, 1 |.endif | |->vm_sfcmpolt: |.if not FPU | li CRET2, 0 |1: | sll AT, SFARG1HI, 1 | sll TMP0, SFARG2HI, 1 | or CRET1, SFARG1LO, SFARG2LO | or TMP1, AT, TMP0 | or TMP1, TMP1, CRET1 | beqz TMP1, >8 // Both args +-0: return 0. |. sltu CRET1, r0, SFARG1LO | lui TMP1, 0xffe0 | addu AT, AT, CRET1 | sltu CRET1, r0, SFARG2LO | sltu AT, TMP1, AT | addu TMP0, TMP0, CRET1 | sltu TMP0, TMP1, TMP0 | or TMP1, AT, TMP0 | bnez TMP1, >9 // Either arg is NaN: return 0 or 1; |. and AT, SFARG1HI, SFARG2HI | bltz AT, >5 // Both args negative? |. nop | beq SFARG1HI, SFARG2HI, >8 |. sltu CRET1, SFARG1LO, SFARG2LO | jr ra |. slt CRET1, SFARG1HI, SFARG2HI |5: // Swap conditions if both operands are negative. | beq SFARG1HI, SFARG2HI, >8 |. sltu CRET1, SFARG2LO, SFARG1LO | jr ra |. slt CRET1, SFARG2HI, SFARG1HI |8: | jr ra |. nop |9: | jr ra |. move CRET1, CRET2 |.endif | |->vm_sfcmpogt: |.if not FPU | sll AT, SFARG2HI, 1 | sll TMP0, SFARG1HI, 1 | or CRET1, SFARG2LO, SFARG1LO | or TMP1, AT, TMP0 | or TMP1, TMP1, CRET1 | beqz TMP1, >8 // Both args +-0: return 0. |. sltu CRET1, r0, SFARG2LO | lui TMP1, 0xffe0 | addu AT, AT, CRET1 | sltu CRET1, r0, SFARG1LO | sltu AT, TMP1, AT | addu TMP0, TMP0, CRET1 | sltu TMP0, TMP1, TMP0 | or TMP1, AT, TMP0 | bnez TMP1, >9 // Either arg is NaN: return 0 or 1; |. and AT, SFARG2HI, SFARG1HI | bltz AT, >5 // Both args negative? |. nop | beq SFARG2HI, SFARG1HI, >8 |. sltu CRET1, SFARG2LO, SFARG1LO | jr ra |. slt CRET1, SFARG2HI, SFARG1HI |5: // Swap conditions if both operands are negative. | beq SFARG2HI, SFARG1HI, >8 |. sltu CRET1, SFARG1LO, SFARG2LO | jr ra |. slt CRET1, SFARG1HI, SFARG2HI |8: | jr ra |. nop |9: | jr ra |. li CRET1, 0 |.endif | |// Soft-float comparison. Equivalent to c.ole.d a, b or c.ole.d b, a. |// Input: SFARG*, TMP3. Output: CRET1. Temporaries: AT, TMP0, TMP1. |->vm_sfcmpolex: |.if not FPU | sll AT, SFARG1HI, 1 | sll TMP0, SFARG2HI, 1 | or CRET1, SFARG1LO, SFARG2LO | or TMP1, AT, TMP0 | or TMP1, TMP1, CRET1 | beqz TMP1, >8 // Both args +-0: return 1. |. sltu CRET1, r0, SFARG1LO | lui TMP1, 0xffe0 | addu AT, AT, CRET1 | sltu CRET1, r0, SFARG2LO | sltu AT, TMP1, AT | addu TMP0, TMP0, CRET1 | sltu TMP0, TMP1, TMP0 | or TMP1, AT, TMP0 | bnez TMP1, >9 // Either arg is NaN: return 0; |. and AT, SFARG1HI, SFARG2HI | xor AT, AT, TMP3 | bltz AT, >5 // Both args negative? |. nop | beq SFARG1HI, SFARG2HI, >6 |. sltu CRET1, SFARG2LO, SFARG1LO | jr ra |. slt CRET1, SFARG2HI, SFARG1HI |5: // Swap conditions if both operands are negative. | beq SFARG1HI, SFARG2HI, >6 |. sltu CRET1, SFARG1LO, SFARG2LO | slt CRET1, SFARG1HI, SFARG2HI |6: | jr ra |. nop |8: | jr ra |. li CRET1, 1 |9: | jr ra |. li CRET1, 0 |.endif | |.macro sfmin_max, name, fpcall |->vm_sf .. name: |.if JIT and not FPU | move TMP2, ra | bal ->fpcall |. nop | move TMP0, CRET1 | move SFRETHI, SFARG1HI | move SFRETLO, SFARG1LO | move ra, TMP2 | movz SFRETHI, SFARG2HI, TMP0 | jr ra |. movz SFRETLO, SFARG2LO, TMP0 |.endif |.endmacro | | sfmin_max min, vm_sfcmpolt | sfmin_max max, vm_sfcmpogt | |//----------------------------------------------------------------------- |//-- Miscellaneous functions -------------------------------------------- |//----------------------------------------------------------------------- | |.define NEXT_TAB, TAB:CARG1 |.define NEXT_IDX, CARG2 |.define NEXT_ASIZE, CARG3 |.define NEXT_NIL, CARG4 |.define NEXT_TMP0, r12 |.define NEXT_TMP1, r13 |.define NEXT_TMP2, r14 |.define NEXT_RES_VK, CRET1 |.define NEXT_RES_IDX, CRET2 |.define NEXT_RES_PTR, sp |.define NEXT_RES_VAL_I, 0(sp) |.define NEXT_RES_VAL_IT, 4(sp) |.define NEXT_RES_KEY_I, 8(sp) |.define NEXT_RES_KEY_IT, 12(sp) | |// TValue *lj_vm_next(GCtab *t, uint32_t idx) |// Next idx returned in CRET2. |->vm_next: |.if JIT and ENDIAN_LE | lw NEXT_ASIZE, NEXT_TAB->asize | lw NEXT_TMP0, NEXT_TAB->array | li NEXT_NIL, LJ_TNIL |1: // Traverse array part. | sltu AT, NEXT_IDX, NEXT_ASIZE | sll NEXT_TMP1, NEXT_IDX, 3 | beqz AT, >5 |. addu NEXT_TMP1, NEXT_TMP0, NEXT_TMP1 | lw NEXT_TMP2, 4(NEXT_TMP1) | sw NEXT_IDX, NEXT_RES_KEY_I | beq NEXT_TMP2, NEXT_NIL, <1 |. addiu NEXT_IDX, NEXT_IDX, 1 | lw NEXT_TMP0, 0(NEXT_TMP1) | li AT, LJ_TISNUM | sw NEXT_TMP2, NEXT_RES_VAL_IT | sw AT, NEXT_RES_KEY_IT | sw NEXT_TMP0, NEXT_RES_VAL_I | move NEXT_RES_VK, NEXT_RES_PTR | jr ra |. move NEXT_RES_IDX, NEXT_IDX | |5: // Traverse hash part. | subu NEXT_RES_IDX, NEXT_IDX, NEXT_ASIZE | lw NODE:NEXT_RES_VK, NEXT_TAB->node | sll NEXT_TMP2, NEXT_RES_IDX, 5 | lw NEXT_TMP0, NEXT_TAB->hmask | sll AT, NEXT_RES_IDX, 3 | subu AT, NEXT_TMP2, AT | addu NODE:NEXT_RES_VK, NODE:NEXT_RES_VK, AT |6: | sltu AT, NEXT_TMP0, NEXT_RES_IDX | bnez AT, >8 |. nop | lw NEXT_TMP2, NODE:NEXT_RES_VK->val.it | bne NEXT_TMP2, NEXT_NIL, >9 |. addiu NEXT_RES_IDX, NEXT_RES_IDX, 1 | // Skip holes in hash part. | b <6 |. addiu NODE:NEXT_RES_VK, NODE:NEXT_RES_VK, sizeof(Node) | |8: // End of iteration. Set the key to nil (not the value). | sw NEXT_NIL, NEXT_RES_KEY_IT | move NEXT_RES_VK, NEXT_RES_PTR |9: | jr ra |. addu NEXT_RES_IDX, NEXT_RES_IDX, NEXT_ASIZE |.endif | |//----------------------------------------------------------------------- |//-- 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] | .FPU sdc1 FARG1, CTSTATE->cb.fpr[0] | sw CARG3, CTSTATE->cb.gpr[2] | sw CARG4, CTSTATE->cb.gpr[3] | .FPU 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 | li TISNUM, LJ_TISNUM // Setup type comparison constants. | move L, CRET1 | .FPU lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). | lw LFUNC:RB, FRAME_FUNC(BASE) | .FPU mtc1 TMP3, TOBIT | li_vmstate INTERP | li TISNIL, LJ_TNIL | subu RC, RC, BASE | st_vmstate | .FPU 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 | .FPU ldc1 FRET1, CTSTATE->cb.fpr[0] | lw CRET1, CTSTATE->cb.gpr[0] | .FPU ldc1 FRET2, CTSTATE->cb.fpr[1] | b ->vm_leave_unw |. lw CRET2, CTSTATE->cb.gpr[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) | 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] | .FPU ldc1 FARG1, CCSTATE->fpr[0] | .FPU 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] |.if FPU | sdc1 FRET1, CCSTATE:TMP1->fpr[0] | sdc1 FRET2, CCSTATE:TMP1->fpr[1] |.else | sw CARG1, CCSTATE:TMP1->gpr[2] // Soft-float: complex double .im part. | sw CARG2, CCSTATE:TMP1->gpr[3] |.endif | 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 |.macro bc_comp, FRA, FRD, RAHI, RALO, RDHI, RDLO, movop, fmovop, fcomp, sfcomp | addu RA, BASE, RA | addu RD, BASE, RD | lw RAHI, HI(RA) | lw RDHI, HI(RD) | lhu TMP2, OFS_RD(PC) | addiu PC, PC, 4 | bne RAHI, TISNUM, >2 |. lw RALO, LO(RA) | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) | lw RDLO, LO(RD) | bne RDHI, TISNUM, >5 |. decode_RD4b TMP2 | slt AT, SFARG1LO, SFARG2LO | addu TMP2, TMP2, TMP3 | movop TMP2, r0, AT |1: | addu PC, PC, TMP2 | ins_next | |2: // RA is not an integer. | sltiu AT, RAHI, LJ_TISNUM | beqz AT, ->vmeta_comp |. lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) | sltiu AT, RDHI, LJ_TISNUM |.if FPU | ldc1 FRA, 0(RA) | ldc1 FRD, 0(RD) |.else | lw RDLO, LO(RD) |.endif | beqz AT, >4 |. decode_RD4b TMP2 |3: // RA and RD are both numbers. |.if FPU | fcomp f20, f22 | addu TMP2, TMP2, TMP3 | b <1 |. fmovop TMP2, r0 |.else | bal sfcomp |. addu TMP2, TMP2, TMP3 | b <1 |. movop TMP2, r0, CRET1 |.endif | |4: // RA is a number, RD is not a number. | bne RDHI, TISNUM, ->vmeta_comp | // RA is a number, RD is an integer. Convert RD to a number. |.if FPU |. lwc1 FRD, LO(RD) | b <3 |. cvt.d.w FRD, FRD |.else |. nop |.if "RDHI" == "SFARG1HI" | bal ->vm_sfi2d_1 |.else | bal ->vm_sfi2d_2 |.endif |. nop | b <3 |. nop |.endif | |5: // RA is an integer, RD is not an integer | sltiu AT, RDHI, LJ_TISNUM | beqz AT, ->vmeta_comp | // RA is an integer, RD is a number. Convert RA to a number. |.if FPU |. mtc1 RALO, FRA | ldc1 FRD, 0(RD) | b <3 | cvt.d.w FRA, FRA |.else |. nop |.if "RAHI" == "SFARG1HI" | bal ->vm_sfi2d_1 |.else | bal ->vm_sfi2d_2 |.endif |. nop | b <3 |. nop |.endif |.endmacro | if (op == BC_ISLT) { | bc_comp f20, f22, SFARG1HI, SFARG1LO, SFARG2HI, SFARG2LO, movz, movf, c.olt.d, ->vm_sfcmpolt } else if (op == BC_ISGE) { | bc_comp f20, f22, SFARG1HI, SFARG1LO, SFARG2HI, SFARG2LO, movn, movt, c.olt.d, ->vm_sfcmpolt } else if (op == BC_ISLE) { | bc_comp f22, f20, SFARG2HI, SFARG2LO, SFARG1HI, SFARG1LO, movn, movt, c.ult.d, ->vm_sfcmpult } else { | bc_comp f22, f20, SFARG2HI, SFARG2LO, SFARG1HI, SFARG1LO, movz, movf, c.ult.d, ->vm_sfcmpult } 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 | addu RD, BASE, RD | lw SFARG1HI, HI(RA) | lhu TMP2, -4+OFS_RD(PC) | lw SFARG2HI, HI(RD) | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) | sltu AT, TISNUM, SFARG1HI | sltu TMP0, TISNUM, SFARG2HI | or AT, AT, TMP0 if (vk) { | beqz AT, ->BC_ISEQN_Z } else { | beqz AT, ->BC_ISNEN_Z } |. decode_RD4b TMP2 | // Either or both types are not numbers. | lw SFARG1LO, LO(RA) | lw SFARG2LO, LO(RD) | addu TMP2, TMP2, TMP3 |.if FFI | li TMP3, LJ_TCDATA | beq SFARG1HI, TMP3, ->vmeta_equal_cd |.endif |. sltiu AT, SFARG1HI, LJ_TISPRI // Not a primitive? |.if FFI | beq SFARG2HI, TMP3, ->vmeta_equal_cd |.endif |. xor TMP3, SFARG1LO, SFARG2LO // Same tv? | xor SFARG2HI, SFARG2HI, SFARG1HI // Same type? | sltiu TMP0, SFARG1HI, LJ_TISTABUD+1 // Table or userdata? | movz TMP3, r0, AT // Ignore tv if primitive. | movn TMP0, r0, SFARG2HI // Tab/ud and same type? | or AT, SFARG2HI, TMP3 // Same type && (pri||same tv). | movz TMP0, r0, AT | beqz TMP0, >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:SFARG1LO->metatable | beqz TAB:TMP1, >1 // No metatable? |. nop | lbu TMP1, TAB:TMP1->nomm | andi TMP1, TMP1, 1<1 // Or 'no __eq' flag set? |. nop | b ->vmeta_equal // Handle __eq metamethod. |. li TMP0, 1-vk // ne = 0 or 1. |1: | addu PC, PC, TMP2 | ins_next 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 | addu RD, KBASE, RD | lw SFARG1HI, HI(RA) | lw SFARG2HI, HI(RD) | lhu TMP2, OFS_RD(PC) | addiu PC, PC, 4 | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) | decode_RD4b TMP2 if (vk) { |->BC_ISEQN_Z: } else { |->BC_ISNEN_Z: } | bne SFARG1HI, TISNUM, >3 |. lw SFARG1LO, LO(RA) | lw SFARG2LO, LO(RD) | addu TMP2, TMP2, TMP3 | bne SFARG2HI, TISNUM, >6 |. xor AT, SFARG1LO, SFARG2LO if (vk) { | movn TMP2, r0, AT |1: | addu PC, PC, TMP2 |2: } else { | movz TMP2, r0, AT |1: |2: | addu PC, PC, TMP2 } | ins_next | |3: // RA is not an integer. | sltiu AT, SFARG1HI, LJ_TISNUM |.if FFI | beqz AT, >8 |.else | beqz AT, <2 |.endif |. addu TMP2, TMP2, TMP3 | sltiu AT, SFARG2HI, LJ_TISNUM |.if FPU | ldc1 f20, 0(RA) | ldc1 f22, 0(RD) |.endif | beqz AT, >5 |. lw SFARG2LO, LO(RD) |4: // RA and RD are both numbers. |.if FPU | c.eq.d f20, f22 | b <1 if (vk) { |. movf TMP2, r0 } else { |. movt TMP2, r0 } |.else | bal ->vm_sfcmpeq |. nop | b <1 if (vk) { |. movz TMP2, r0, CRET1 } else { |. movn TMP2, r0, CRET1 } |.endif | |5: // RA is a number, RD is not a number. |.if FFI | bne SFARG2HI, TISNUM, >9 |.else | bne SFARG2HI, TISNUM, <2 |.endif | // RA is a number, RD is an integer. Convert RD to a number. |.if FPU |. lwc1 f22, LO(RD) | b <4 |. cvt.d.w f22, f22 |.else |. nop | bal ->vm_sfi2d_2 |. nop | b <4 |. nop |.endif | |6: // RA is an integer, RD is not an integer | sltiu AT, SFARG2HI, LJ_TISNUM |.if FFI | beqz AT, >9 |.else | beqz AT, <2 |.endif | // RA is an integer, RD is a number. Convert RA to a number. |.if FPU |. mtc1 SFARG1LO, f20 | ldc1 f22, 0(RD) | b <4 | cvt.d.w f20, f20 |.else |. nop | bal ->vm_sfi2d_1 |. nop | b <4 |. nop |.endif | |.if FFI |8: | li AT, LJ_TCDATA | bne SFARG1HI, AT, <2 |. nop | b ->vmeta_equal_cd |. nop |9: | li AT, LJ_TCDATA | bne SFARG2HI, AT, <2 |. nop | b ->vmeta_equal_cd |. 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 | lw SFRETHI, HI(RD) | lw SFRETLO, LO(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 | sw SFRETHI, HI(RA) | sw SFRETLO, LO(RA) | addu PC, PC, TMP2 |1: } | ins_next break; case BC_ISTYPE: | // RA = src*8, RD = -type*8 | addu TMP2, BASE, RA | srl TMP1, RD, 3 | lw TMP0, HI(TMP2) | ins_next1 | addu AT, TMP0, TMP1 | bnez AT, ->vmeta_istype |. ins_next2 break; case BC_ISNUM: | // RA = src*8, RD = -(TISNUM-1)*8 | addu TMP2, BASE, RA | lw TMP0, HI(TMP2) | ins_next1 | sltiu AT, TMP0, LJ_TISNUM | beqz AT, ->vmeta_istype |. ins_next2 break; /* -- Unary ops --------------------------------------------------------- */ case BC_MOV: | // RA = dst*8, RD = src*8 | addu RD, BASE, RD | addu RA, BASE, RA | lw SFRETHI, HI(RD) | lw SFRETLO, LO(RD) | ins_next1 | sw SFRETHI, HI(RA) | sw SFRETLO, LO(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 RB, BASE, RD | lw SFARG1HI, HI(RB) | addu RA, BASE, RA | bne SFARG1HI, TISNUM, >2 |. lw SFARG1LO, LO(RB) | lui TMP1, 0x8000 | beq SFARG1LO, TMP1, ->vmeta_unm // Meta handler deals with -2^31. |. negu SFARG1LO, SFARG1LO |1: | ins_next1 | sw SFARG1HI, HI(RA) | sw SFARG1LO, LO(RA) | ins_next2 |2: | sltiu AT, SFARG1HI, LJ_TISNUM | beqz AT, ->vmeta_unm |. lui TMP1, 0x8000 | b <1 |. xor SFARG1HI, SFARG1HI, TMP1 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: | ins_next1 | sw TISNUM, HI(RA) | sw CRET1, LO(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 fpmod, a, b, c | 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 sfpmod | addiu sp, sp, -16 | | load_got __divdf3 | sw SFARG1HI, HI(sp) | sw SFARG1LO, LO(sp) | sw SFARG2HI, 8+HI(sp) | call_extern |. sw SFARG2LO, 8+LO(sp) | | load_got floor | move SFARG1HI, SFRETHI | call_extern |. move SFARG1LO, SFRETLO | | load_got __muldf3 | move SFARG1HI, SFRETHI | move SFARG1LO, SFRETLO | lw SFARG2HI, 8+HI(sp) | call_extern |. lw SFARG2LO, 8+LO(sp) | | load_got __subdf3 | lw SFARG1HI, HI(sp) | lw SFARG1LO, LO(sp) | move SFARG2HI, SFRETHI | call_extern |. move SFARG2LO, SFRETLO | | addiu sp, sp, 16 |.endmacro |.macro ins_arithpre, label ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | // RA = dst*8, RB = src1*8, RC = src2*8 | num_const*8 ||switch (vk) { ||case 0: | decode_RB8a RB, INS | decode_RB8b RB | decode_RDtoRC8 RC, RD | // RA = dst*8, RB = src1*8, RC = num_const*8 | addu RB, BASE, RB |.if "label" ~= "none" | b label |.endif |. addu RC, KBASE, RC || break; ||case 1: | decode_RB8a RC, INS | decode_RB8b RC | decode_RDtoRC8 RB, RD | // RA = dst*8, RB = num_const*8, RC = src1*8 | addu RC, BASE, RC |.if "label" ~= "none" | b label |.endif |. addu RB, KBASE, RB || break; ||default: | decode_RB8a RB, INS | decode_RB8b RB | decode_RDtoRC8 RC, RD | // RA = dst*8, RB = src1*8, RC = src2*8 | addu RB, BASE, RB |.if "label" ~= "none" | b label |.endif |. addu RC, BASE, RC || break; ||} |.endmacro | |.macro ins_arith, intins, fpins, fpcall, label | ins_arithpre none | |.if "label" ~= "none" |label: |.endif | | lw SFARG1HI, HI(RB) | lw SFARG2HI, HI(RC) | |.if "intins" ~= "div" | | // Check for two integers. | lw SFARG1LO, LO(RB) | bne SFARG1HI, TISNUM, >5 |. lw SFARG2LO, LO(RC) | bne SFARG2HI, TISNUM, >5 | |.if "intins" == "addu" |. intins CRET1, SFARG1LO, SFARG2LO | xor TMP1, CRET1, SFARG1LO // ((y^a) & (y^b)) < 0: overflow. | xor TMP2, CRET1, SFARG2LO | and TMP1, TMP1, TMP2 | bltz TMP1, ->vmeta_arith |. addu RA, BASE, RA |.elif "intins" == "subu" |. intins CRET1, SFARG1LO, SFARG2LO | xor TMP1, CRET1, SFARG1LO // ((y^a) & (a^b)) < 0: overflow. | xor TMP2, SFARG1LO, SFARG2LO | and TMP1, TMP1, TMP2 | bltz TMP1, ->vmeta_arith |. addu RA, BASE, RA |.elif "intins" == "mult" |. intins SFARG1LO, SFARG2LO | mflo CRET1 | mfhi TMP2 | sra TMP1, CRET1, 31 | bne TMP1, TMP2, ->vmeta_arith |. addu RA, BASE, RA |.else |. load_got lj_vm_modi | beqz SFARG2LO, ->vmeta_arith |. addu RA, BASE, RA |.if ENDIAN_BE | move CARG1, SFARG1LO |.endif | call_extern |. move CARG2, SFARG2LO |.endif | | ins_next1 | sw TISNUM, HI(RA) | sw CRET1, LO(RA) |3: | ins_next2 | |.elif not FPU | | lw SFARG1LO, LO(RB) | lw SFARG2LO, LO(RC) | |.endif | |5: // Check for two numbers. | .FPU ldc1 f20, 0(RB) | sltiu AT, SFARG1HI, LJ_TISNUM | sltiu TMP0, SFARG2HI, LJ_TISNUM | .FPU ldc1 f22, 0(RC) | and AT, AT, TMP0 | beqz AT, ->vmeta_arith |. addu RA, BASE, RA | |.if FPU | fpins FRET1, f20, f22 |.elif "fpcall" == "sfpmod" | sfpmod |.else | load_got fpcall | call_extern |. nop |.endif | | ins_next1 |.if not FPU | sw SFRETHI, HI(RA) |.endif |.if "intins" ~= "div" | b <3 |.endif |.if FPU |. sdc1 FRET1, 0(RA) |.else |. sw SFRETLO, LO(RA) |.endif |.if "intins" == "div" | ins_next2 |.endif | |.endmacro case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: | ins_arith addu, add.d, __adddf3, none break; case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: | ins_arith subu, sub.d, __subdf3, none break; case BC_MULVN: case BC_MULNV: case BC_MULVV: | ins_arith mult, mul.d, __muldf3, none break; case BC_DIVVN: | ins_arith div, div.d, __divdf3, ->BC_DIVVN_Z break; case BC_DIVNV: case BC_DIVVV: | ins_arithpre ->BC_DIVVN_Z break; case BC_MODVN: | ins_arith modi, fpmod, sfpmod, ->BC_MODVN_Z break; case BC_MODNV: case BC_MODVV: | ins_arithpre ->BC_MODVN_Z break; case BC_POW: | ins_arithpre none | lw SFARG1HI, HI(RB) | lw SFARG2HI, HI(RC) | sltiu AT, SFARG1HI, LJ_TISNUM | sltiu TMP0, SFARG2HI, LJ_TISNUM | and AT, AT, TMP0 | load_got pow | beqz AT, ->vmeta_arith |. addu RA, BASE, RA |.if FPU | ldc1 FARG1, 0(RB) | ldc1 FARG2, 0(RC) |.else | lw SFARG1LO, LO(RB) | lw SFARG2LO, LO(RC) |.endif | call_extern |. nop | ins_next1 |.if FPU | sdc1 FRET1, 0(RA) |.else | sw SFRETHI, HI(RA) | sw SFRETLO, LO(RA) |.endif | 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 | lw SFRETHI, HI(RB) | lw SFRETLO, LO(RB) | addu RA, BASE, RA | ins_next1 | sw SFRETHI, HI(RA) | sw SFRETLO, LO(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 | addu RA, BASE, RA | ins_next1 | sw TISNUM, HI(RA) | sw RD, LO(RA) | ins_next2 break; case BC_KNUM: | // RA = dst*8, RD = num_const*8 | addu RD, KBASE, RD | addu RA, BASE, RA | lw SFRETHI, HI(RD) | lw SFRETLO, LO(RD) | ins_next1 | sw SFRETHI, HI(RA) | sw SFRETLO, LO(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 | lw SFRETHI, HI(TMP1) | lw SFRETLO, LO(TMP1) | addu RA, BASE, RA | sw SFRETHI, HI(RA) | sw SFRETLO, LO(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 | lw UPVAL:RB, LFUNC:RA->uvptr | lw SFRETHI, HI(RD) | lw SFRETLO, LO(RD) | lbu TMP3, UPVAL:RB->marked | lw CARG2, UPVAL:RB->v | andi TMP3, TMP3, LJ_GC_BLACK // isblack(uv) | lbu TMP0, UPVAL:RB->closed | sw SFRETHI, HI(CARG2) | sw SFRETLO, LO(CARG2) | li AT, LJ_GC_BLACK|1 | or TMP3, TMP3, TMP0 | beq TMP3, AT, >2 // Upvalue is closed and black? |. addiu TMP2, SFRETHI, -(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) |. nop | lbu TMP3, GCOBJ:SFRETLO->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 | lw UPVAL:RB, LFUNC:RA->uvptr | lw SFRETHI, HI(RD) | lw SFRETLO, LO(RD) | lw TMP1, UPVAL:RB->v | ins_next1 | sw SFRETHI, HI(TMP1) | sw SFRETLO, LO(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 LFUNC:CRET1, LO(RA) | sw TMP0, HI(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 | bne TMP1, AT, ->vmeta_tgetv |. addu RA, BASE, RA | bne TMP2, TISNUM, >5 |. lw RC, LO(CARG3) | lw TMP0, TAB:RB->asize | lw TMP1, TAB:RB->array | sltu AT, RC, TMP0 | sll TMP2, RC, 3 | beqz AT, ->vmeta_tgetv // Integer key and in array part? |. addu TMP2, TMP1, TMP2 | lw SFRETHI, HI(TMP2) | beq SFRETHI, TISNIL, >2 |. lw SFRETLO, LO(TMP2) |1: | ins_next1 | sw SFRETHI, HI(RA) | sw SFRETLO, LO(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: | li AT, LJ_TSTR | bne TMP2, AT, ->vmeta_tgetv |. nop | 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->sid | lw NODE:TMP2, TAB:RB->node | and TMP1, TMP1, TMP0 // idx = str->sid & 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 SFRETHI, 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 SFRETHI, TISNIL, >5 // Key found, but nil value? |. lw SFRETLO, offsetof(Node, val)+LO(NODE:TMP2) |3: | ins_next1 | sw SFRETHI, HI(RA) | sw SFRETLO, 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 SFRETHI, 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 SFRETHI, HI(RC) | beq SFRETHI, TISNIL, >5 |. lw SFRETLO, LO(RC) |1: | ins_next1 | sw SFRETHI, HI(RA) | sw SFRETLO, LO(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 and CARG2! |. nop break; case BC_TGETR: | // RA = dst*8, RB = table*8, RC = key*8 | decode_RB8a RB, INS | decode_RB8b RB | decode_RDtoRC8 RC, RD | addu RB, BASE, RB | addu RC, BASE, RC | lw TAB:CARG1, LO(RB) | lw CARG2, LO(RC) | addu RA, BASE, RA | lw TMP0, TAB:CARG1->asize | lw TMP1, TAB:CARG1->array | sltu AT, CARG2, TMP0 | sll TMP2, CARG2, 3 | beqz AT, ->vmeta_tgetr // In array part? |. addu CRET1, TMP1, TMP2 | lw SFARG2HI, HI(CRET1) | lw SFARG2LO, LO(CRET1) |->BC_TGETR_Z: | ins_next1 | sw SFARG2HI, HI(RA) | sw SFARG2LO, LO(RA) | ins_next2 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 | bne TMP1, AT, ->vmeta_tsetv |. addu RA, BASE, RA | bne TMP2, TISNUM, >5 |. lw RC, LO(CARG3) | lw TMP0, TAB:RB->asize | lw TMP1, TAB:RB->array | sltu AT, RC, TMP0 | sll TMP2, RC, 3 | beqz AT, ->vmeta_tsetv // Integer key and in array part? |. addu TMP1, TMP1, TMP2 | lw TMP0, HI(TMP1) | lbu TMP3, TAB:RB->marked | lw SFRETHI, HI(RA) | beq TMP0, TISNIL, >3 |. lw SFRETLO, LO(RA) |1: | andi AT, TMP3, LJ_GC_BLACK // isblack(table) | sw SFRETHI, HI(TMP1) | bnez AT, >7 |. sw SFRETLO, LO(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: | li AT, LJ_TSTR | bne TMP2, AT, ->vmeta_tsetv |. nop | 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->sid | lw NODE:TMP2, TAB:RB->node | sb r0, TAB:RB->nomm // Clear metamethod cache. | and TMP1, TMP1, TMP0 // idx = str->sid & 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) |.if FPU | ldc1 f20, 0(RA) |.else | lw SFRETHI, HI(RA) | lw SFRETLO, LO(RA) |.endif |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) |.if FPU | bnez AT, >7 |. sdc1 f20, NODE:TMP2->val |.else | sw SFRETHI, NODE:TMP2->val.u32.hi | bnez AT, >7 |. sw SFRETLO, NODE:TMP2->val.u32.lo |.endif |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 |.if FPU | b <3 // No 2nd write barrier needed. |. sdc1 f20, 0(CRET1) |.else | lw SFARG1HI, HI(RA) | lw SFARG1LO, LO(RA) | sw SFARG1HI, HI(CRET1) | b <3 // No 2nd write barrier needed. |. sw SFARG1LO, LO(CRET1) |.endif | |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 |1: |. lw SFRETHI, HI(RA) | lw SFRETLO, LO(RA) | andi AT, TMP3, LJ_GC_BLACK // isblack(table) | sw SFRETHI, HI(RC) | bnez AT, >7 |. sw SFRETLO, LO(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 and CARG2! |. nop | |7: // Possible table write barrier for the value. Skip valiswhite check. | barrierback TAB:RB, TMP3, TMP0, <2 break; case BC_TSETR: | // RA = dst*8, RB = table*8, RC = key*8 | decode_RB8a RB, INS | decode_RB8b RB | decode_RDtoRC8 RC, RD | addu CARG1, BASE, RB | addu CARG3, BASE, RC | lw TAB:CARG2, LO(CARG1) | lw CARG3, LO(CARG3) | lbu TMP3, TAB:CARG2->marked | lw TMP0, TAB:CARG2->asize | lw TMP1, TAB:CARG2->array | andi AT, TMP3, LJ_GC_BLACK // isblack(table) | bnez AT, >7 |. addu RA, BASE, RA |2: | sltu AT, CARG3, TMP0 | sll TMP2, CARG3, 3 | beqz AT, ->vmeta_tsetr // In array part? |. addu CRET1, TMP1, TMP2 |->BC_TSETR_Z: | lw SFARG1HI, HI(RA) | lw SFARG1LO, LO(RA) | ins_next1 | sw SFARG1HI, HI(CRET1) | sw SFARG1LO, LO(CRET1) | ins_next2 | |7: // Possible table write barrier for the value. Skip valiswhite check. | barrierback TAB:CARG2, TMP3, CRET1, <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. | lw SFRETHI, HI(RA) | lw SFRETLO, LO(RA) | addiu RA, RA, 8 | sltu AT, RA, TMP2 | sw SFRETHI, HI(TMP1) | sw SFRETLO, LO(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: | lw SFRETHI, HI(RA) | lw SFRETLO, LO(RA) | addiu RA, RA, 8 | addiu TMP3, TMP3, -8 | sw SFRETHI, HI(TMP2) | sw SFRETLO, LO(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) | lw SFARG1HI, -16+HI(BASE) | lw SFARG1LO, -16+LO(BASE) | lw SFARG2HI, -8+HI(BASE) | lw SFARG2LO, -8+LO(BASE) | sw TMP1, HI(BASE) // Copy callable. | sw LFUNC:RB, LO(BASE) | sw SFARG1HI, 8+HI(BASE) // Copy state. | sw SFARG1LO, 8+LO(BASE) | sw SFARG2HI, 16+HI(BASE) // Copy control var. | sw SFARG2LO, 16+LO(BASE) | addiu BASE, BASE, 8 | bne TMP1, AT, ->vmeta_call |. li NARGS8:RC, 16 // Iterators get 2 arguments. | ins_call break; case BC_ITERN: |.if JIT and ENDIAN_LE | hotloop |.endif |->vm_IITERN: | // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 (2+1)*8) | 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 SFARG1HI, HI(TMP3) | lw SFARG1LO, LO(TMP3) | lhu RD, -4+OFS_RD(PC) | sw TISNUM, HI(RA) | sw RC, LO(RA) | beq SFARG1HI, TISNIL, <1 // Skip holes in array part. |. addiu RC, RC, 1 | sw SFARG1HI, 8+HI(RA) | sw SFARG1LO, 8+LO(RA) | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) | decode_RD4b RD | addu RD, RD, TMP3 | sw RC, -8+LO(RA) // Update control var. | addu PC, PC, RD |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 SFARG1HI, NODE:TMP3->val.u32.hi | lw SFARG1LO, NODE:TMP3->val.u32.lo | lhu RD, -4+OFS_RD(PC) | beq SFARG1HI, TISNIL, <6 // Skip holes in hash part. |. addiu RC, RC, 1 | lw SFARG2HI, NODE:TMP3->key.u32.hi | lw SFARG2LO, NODE:TMP3->key.u32.lo | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) | sw SFARG1HI, 8+HI(RA) | sw SFARG1LO, 8+LO(RA) | addu RC, RC, TMP0 | decode_RD4b RD | addu RD, RD, TMP3 | sw SFARG2HI, HI(RA) | sw SFARG2LO, LO(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, (LJ_KEYINDEX >> 16) | addu PC, TMP0, TMP2 | ori TMP1, TMP1, (LJ_KEYINDEX & 0xffff) | 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 |.if JIT | lb TMP0, OFS_OP(PC) | li AT, BC_ITERN | bne TMP0, AT, >6 |. lhu TMP2, OFS_RD(PC) |.endif | b <1 |. sb TMP1, OFS_OP(PC) |.if JIT |6: // Unpatch JLOOP. | lw TMP0, DISPATCH_J(trace)(DISPATCH) | sll TMP2, TMP2, 2 | addu TMP0, TMP0, TMP2 | lw TRACE:TMP2, 0(TMP0) | lw TMP0, TRACE:TMP2->startins | li AT, -256 | and TMP0, TMP0, AT | or TMP0, TMP0, TMP1 | b <1 |. sw TMP0, 0(PC) |.endif 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: | lw SFRETHI, HI(RC) | lw SFRETLO, LO(RC) | addiu RC, RC, 8 | sw SFRETHI, HI(RA) | sw SFRETLO, LO(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: | lw SFRETHI, HI(RA) | lw SFRETLO, LO(RA) | addiu RA, RA, 8 | addiu RC, RC, -8 | sw SFRETHI, HI(TMP2) | sw SFRETLO, LO(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) { | lw SFRETHI, HI(RA) | lw SFRETLO, LO(RA) } | decode_RB8a RB, INS | decode_RA8a RA, INS | decode_RB8b RB | decode_RA8b RA if (op == BC_RET1) { | sw SFRETHI, HI(TMP2) | sw SFRETLO, LO(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 | lw SFARG1HI, FORL_IDX*8+HI(RA) | lw SFARG1LO, FORL_IDX*8+LO(RA) if (op != BC_JFORL) { | srl RD, RD, 1 | lui TMP2, (-(BCBIAS_J*4 >> 16) & 65535) | addu TMP2, RD, TMP2 } if (!vk) { | lw SFARG2HI, FORL_STOP*8+HI(RA) | lw SFARG2LO, FORL_STOP*8+LO(RA) | bne SFARG1HI, TISNUM, >5 |. lw SFRETHI, FORL_STEP*8+HI(RA) | xor AT, SFARG2HI, TISNUM | lw SFRETLO, FORL_STEP*8+LO(RA) | xor TMP0, SFRETHI, TISNUM | or AT, AT, TMP0 | bnez AT, ->vmeta_for |. slt AT, SFRETLO, r0 | slt CRET1, SFARG2LO, SFARG1LO | slt TMP1, SFARG1LO, SFARG2LO | movn CRET1, TMP1, AT } else { | bne SFARG1HI, TISNUM, >5 |. lw SFARG2LO, FORL_STEP*8+LO(RA) | lw SFRETLO, FORL_STOP*8+LO(RA) | move TMP3, SFARG1LO | addu SFARG1LO, SFARG1LO, SFARG2LO | xor TMP0, SFARG1LO, TMP3 | xor TMP1, SFARG1LO, SFARG2LO | and TMP0, TMP0, TMP1 | slt TMP1, SFARG1LO, SFRETLO | slt CRET1, SFRETLO, SFARG1LO | slt AT, SFARG2LO, r0 | slt TMP0, TMP0, r0 // ((y^a) & (y^b)) < 0: overflow. | movn CRET1, TMP1, AT | or CRET1, CRET1, TMP0 } |1: if (op == BC_FORI) { | movz TMP2, r0, CRET1 | addu PC, PC, TMP2 } else if (op == BC_JFORI) { | addu PC, PC, TMP2 | lhu RD, -4+OFS_RD(PC) } else if (op == BC_IFORL) { | movn TMP2, r0, CRET1 | addu PC, PC, TMP2 } if (vk) { | sw SFARG1HI, FORL_IDX*8+HI(RA) | sw SFARG1LO, FORL_IDX*8+LO(RA) } | ins_next1 | sw SFARG1HI, FORL_EXT*8+HI(RA) | sw SFARG1LO, FORL_EXT*8+LO(RA) |2: if (op == BC_JFORI) { | beqz CRET1, =>BC_JLOOP |. decode_RD8b RD } else if (op == BC_JFORL) { | beqz CRET1, =>BC_JLOOP } | ins_next2 | |5: // FP loop. |.if FPU if (!vk) { | ldc1 f0, FORL_IDX*8(RA) | ldc1 f2, FORL_STOP*8(RA) | sltiu TMP0, SFARG1HI, LJ_TISNUM | sltiu TMP1, SFARG2HI, LJ_TISNUM | sltiu AT, SFRETHI, LJ_TISNUM | and TMP0, TMP0, TMP1 | and AT, AT, TMP0 | beqz AT, ->vmeta_for |. slt TMP3, SFRETHI, r0 | c.ole.d 0, f0, f2 | c.ole.d 1, f2, f0 | li CRET1, 1 | movt CRET1, r0, 0 | movt AT, r0, 1 | b <1 |. movn CRET1, AT, TMP3 } else { | ldc1 f0, FORL_IDX*8(RA) | ldc1 f4, FORL_STEP*8(RA) | ldc1 f2, FORL_STOP*8(RA) | lw SFARG2HI, FORL_STEP*8+HI(RA) | add.d f0, f0, f4 | c.ole.d 0, f0, f2 | c.ole.d 1, f2, f0 | slt TMP3, SFARG2HI, r0 | li CRET1, 1 | li AT, 1 | movt CRET1, r0, 0 | movt AT, r0, 1 | movn CRET1, AT, TMP3 if (op == BC_IFORL) { | movn TMP2, r0, CRET1 | addu PC, PC, TMP2 } | sdc1 f0, FORL_IDX*8(RA) | ins_next1 | b <2 |. sdc1 f0, FORL_EXT*8(RA) } |.else if (!vk) { | sltiu TMP0, SFARG1HI, LJ_TISNUM | sltiu TMP1, SFARG2HI, LJ_TISNUM | sltiu AT, SFRETHI, LJ_TISNUM | and TMP0, TMP0, TMP1 | and AT, AT, TMP0 | beqz AT, ->vmeta_for |. nop | bal ->vm_sfcmpolex |. move TMP3, SFRETHI | b <1 |. nop } else { | lw SFARG2HI, FORL_STEP*8+HI(RA) | load_got __adddf3 | call_extern |. sw TMP2, ARG5 | lw SFARG2HI, FORL_STOP*8+HI(RA) | lw SFARG2LO, FORL_STOP*8+LO(RA) | move SFARG1HI, SFRETHI | move SFARG1LO, SFRETLO | bal ->vm_sfcmpolex |. lw TMP3, FORL_STEP*8+HI(RA) if ( op == BC_JFORL ) { | lhu RD, -4+OFS_RD(PC) | lw TMP2, ARG5 | b <1 |. decode_RD8b RD } else { | b <1 |. lw TMP2, ARG5 } } |.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, 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) | lw TMP2, TRACE:TMP2->mcode | sw L, DISPATCH_GL(tmpbuf.L)(DISPATCH) | 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 | sw L, DISPATCH_GL(cur_L)(DISPATCH) | 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); #if !LJ_SOFTFP for (i = 30; i >= 20; i -= 2) fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+32+i, 42-i); #endif 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); #if !LJ_SOFTFP for (i = 30; i >= 20; i -= 2) fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+32+i, 42-i); #endif 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; } } subprojects/luajit/src/lj_emit_arm64.h0000644000175000017500000003467014741067622017316 0ustar aniolaniol/* ** ARM64 instruction emitter. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h ** ** Contributed by Djordje Kovacevic and Stefan Pejic from RT-RK.com. ** Sponsored by Cisco Systems, Inc. */ /* -- Constant encoding --------------------------------------------------- */ static uint64_t get_k64val(ASMState *as, IRRef ref) { IRIns *ir = IR(ref); if (ir->o == IR_KINT64) { return ir_kint64(ir)->u64; } else if (ir->o == IR_KGC) { return (uint64_t)ir_kgc(ir); } else if (ir->o == IR_KPTR || ir->o == IR_KKPTR) { return (uint64_t)ir_kptr(ir); } else { lj_assertA(ir->o == IR_KINT || ir->o == IR_KNULL, "bad 64 bit const IR op %d", ir->o); return (uint32_t)ir->i; /* Zero-extended. */ } } /* Encode constant in K12 format for data processing instructions. */ static uint32_t emit_isk12(int64_t n) { uint64_t k = n < 0 ? ~(uint64_t)n+1u : (uint64_t)n; uint32_t m = n < 0 ? 0x40000000 : 0; if (k < 0x1000) { return (uint32_t)(A64I_K12|m|A64F_U12(k)); } else if ((k & 0xfff000) == k) { return (uint32_t)(A64I_K12|m|0x400000|A64F_U12(k>>12)); } return 0; } #define emit_clz64(n) (lj_fls64(n)^63) #define emit_ctz64(n) lj_ffs64(n) /* Encode constant in K13 format for logical data processing instructions. */ static uint32_t emit_isk13(uint64_t n, int is64) { /* Thanks to: https://dougallj.wordpress.com/2021/10/30/ */ int rot, ones, size, immr, imms; if (!is64) n = ((uint64_t)n << 32) | (uint32_t)n; if ((n+1u) <= 1u) return 0; /* Neither all-zero nor all-ones are allowed. */ rot = (n & (n+1u)) ? emit_ctz64(n & (n+1u)) : 64; n = lj_ror(n, rot & 63); ones = emit_ctz64(~n); size = emit_clz64(n) + ones; if (lj_ror(n, size & 63) != n) return 0; /* Non-repeating? */ immr = -rot & (size - 1); imms = (-(size << 1) | (ones - 1)) & 63; return A64I_K13 | A64F_IMMR(immr | (size & 64)) | A64F_IMMS(imms); } static uint32_t emit_isfpk64(uint64_t n) { uint64_t etop9 = ((n >> 54) & 0x1ff); if ((n << 16) == 0 && (etop9 == 0x100 || etop9 == 0x0ff)) { return (uint32_t)(((n >> 48) & 0x7f) | ((n >> 56) & 0x80)); } return ~0u; } static uint32_t emit_isfpmovi(uint64_t n) { /* Is every byte either 0x00 or 0xff? */ if ((n & U64x(01010101,01010101)) * 0xff != n) return 0; /* Form 8-bit value by taking one bit from each byte. */ n &= U64x(80402010,08040201); n = (n * U64x(01010101,01010101)) >> 56; /* Split into the format expected by movi. */ return ((n & 0xe0) << 6) | 0x700 | (n & 0x1f); } /* -- Emit basic instructions --------------------------------------------- */ static void emit_dnma(ASMState *as, A64Ins ai, Reg rd, Reg rn, Reg rm, Reg ra) { *--as->mcp = ai | A64F_D(rd) | A64F_N(rn) | A64F_M(rm) | A64F_A(ra); } static void emit_dnm(ASMState *as, A64Ins ai, Reg rd, Reg rn, Reg rm) { *--as->mcp = ai | A64F_D(rd) | A64F_N(rn) | A64F_M(rm); } static void emit_dm(ASMState *as, A64Ins ai, Reg rd, Reg rm) { *--as->mcp = ai | A64F_D(rd) | A64F_M(rm); } static void emit_dn(ASMState *as, A64Ins ai, Reg rd, Reg rn) { *--as->mcp = ai | A64F_D(rd) | A64F_N(rn); } static void emit_nm(ASMState *as, A64Ins ai, Reg rn, Reg rm) { *--as->mcp = ai | A64F_N(rn) | A64F_M(rm); } static void emit_d(ASMState *as, A64Ins ai, Reg rd) { *--as->mcp = ai | A64F_D(rd); } static void emit_dl(ASMState *as, A64Ins ai, Reg rd, uint32_t l) { *--as->mcp = ai | A64F_D(rd) | A64F_S19(l >> 2); } static void emit_n(ASMState *as, A64Ins ai, Reg rn) { *--as->mcp = ai | A64F_N(rn); } static int emit_checkofs(A64Ins ai, int64_t ofs) { int scale = (ai >> 30) & 3; if (ofs < 0 || (ofs & ((1<= -256 && ofs <= 255) ? -1 : 0; } else { return (ofs < (4096<= 0) { return ai | A64F_U12(ofs>>sc); /* Subsequent lj_ror checks ofs. */ } else if (ofs >= -256) { return (ai^A64I_LS_U) | A64F_S9(ofs & 0x1ff); } else { return A64F_D(31); /* Will mismatch prev. */ } } static void emit_lso(ASMState *as, A64Ins ai, Reg rd, Reg rn, int64_t ofs64) { int ot = emit_checkofs(ai, ofs64), sc = (ai >> 30) & 3, ofs = (int)ofs64; lj_assertA(ot, "load/store offset %d out of range", ofs); /* Combine LDR/STR pairs to LDP/STP. */ if ((sc == 2 || sc == 3) && (!(ai & 0x400000) || rd != rn) && as->mcp != as->mcloop) { uint32_t prev = *as->mcp & ~A64F_D(31); int ofsm = ofs - (1<mcp & 31)); } else if (prev == emit_lso_pair_candidate(ai | A64F_N(rn), ofsp, sc)) { aip = (A64F_D(rd) | A64F_A(*as->mcp & 31)); ofsm = ofs; } else { goto nopair; } if (lj_ror((unsigned int)ofsm + (64u<mcp = aip | A64F_N(rn) | (((ofsm >> sc) & 0x7f) << 15) | (ai ^ ((ai == A64I_LDRx || ai == A64I_STRx) ? 0x50000000 : 0x90000000)); return; } } nopair: if (ot == 1) *--as->mcp = ai | A64F_D(rd) | A64F_N(rn) | A64F_U12(ofs >> sc); else *--as->mcp = (ai^A64I_LS_U) | A64F_D(rd) | A64F_N(rn) | A64F_S9(ofs & 0x1ff); } /* -- 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 other consts. */ static int emit_kdelta(ASMState *as, Reg rd, uint64_t k, int is64) { RegSet work = (~as->freeset & RSET_GPR) | RID2RSET(RID_GL); while (work) { Reg r = rset_picktop(work); IRRef ref = regcost_ref(as->cost[r]); lj_assertA(r != rd, "dest reg %d not free", rd); if (ref < REF_TRUE) { uint64_t kx = ra_iskref(ref) ? (uint64_t)ra_krefk(as, ref) : get_k64val(as, ref); int64_t delta = (int64_t)(k - kx); if (!is64) delta = (int64_t)(int32_t)delta; /* Sign-extend. */ if (delta == 0) { emit_dm(as, is64|A64I_MOVw, rd, r); return 1; } else { uint32_t k12 = emit_isk12(delta < 0 ? (int64_t)(~(uint64_t)delta+1u) : delta); if (k12) { emit_dn(as, (delta < 0 ? A64I_SUBw : A64I_ADDw)^is64^k12, rd, r); return 1; } /* Do other ops or multi-step deltas pay off? Probably not. ** E.g. XOR rarely helps with pointer consts. */ } } rset_clear(work, r); } return 0; /* Failed. */ } #define glofs(as, k) \ ((intptr_t)((uintptr_t)(k) - (uintptr_t)&J2GG(as->J)->g)) #define mcpofs(as, k) \ ((intptr_t)((uintptr_t)(k) - (uintptr_t)(as->mcp - 1))) #define checkmcpofs(as, k) \ (A64F_S_OK(mcpofs(as, k)>>2, 19)) /* Try to form a const as ADR or ADRP or ADRP + ADD. */ static int emit_kadrp(ASMState *as, Reg rd, uint64_t k) { A64Ins ai = A64I_ADR; int64_t ofs = mcpofs(as, k); if (!A64F_S_OK((uint64_t)ofs, 21)) { uint64_t kpage = k & ~0xfffull; MCode *adrp = as->mcp - 1 - (k != kpage); ofs = (int64_t)(kpage - ((uint64_t)adrp & ~0xfffull)) >> 12; if (!A64F_S_OK(ofs, 21)) return 0; /* Failed. */ if (k != kpage) emit_dn(as, (A64I_ADDx^A64I_K12)|A64F_U12(k - kpage), rd, rd); ai = A64I_ADRP; } emit_dl(as, ai|(((uint32_t)ofs&3)<<29), rd, ofs); return 1; } static void emit_loadk(ASMState *as, Reg rd, uint64_t u64) { int zeros = 0, ones = 0, neg, lshift = 0; int is64 = (u64 >> 32) ? A64I_X : 0, i = is64 ? 4 : 2; /* Count non-homogeneous 16 bit fragments. */ while (--i >= 0) { uint32_t frag = (u64 >> i*16) & 0xffff; zeros += (frag != 0); ones += (frag != 0xffff); } neg = ones < zeros; /* Use MOVN if it pays off. */ if ((neg ? ones : zeros) > 1) { /* Need 2+ ins. Try 1 ins encodings. */ uint32_t k13 = emit_isk13(u64, is64); if (k13) { emit_dn(as, (is64|A64I_ORRw)^k13, rd, RID_ZERO); return; } if (emit_kdelta(as, rd, u64, is64)) { return; } if (emit_kadrp(as, rd, u64)) { /* Either 1 or 2 ins. */ return; } } if (neg) { u64 = ~u64; if (!is64) u64 = (uint32_t)u64; } if (u64) { /* Find first/last fragment to be filled. */ int shift = (63-emit_clz64(u64)) & ~15; lshift = emit_ctz64(u64) & ~15; for (; shift > lshift; shift -= 16) { uint32_t frag = (u64 >> shift) & 0xffff; if (frag == 0) continue; /* Will be correctly filled by MOVN/MOVZ. */ if (neg) frag ^= 0xffff; /* MOVK requires the original value. */ emit_d(as, is64 | A64I_MOVKw | A64F_U16(frag) | A64F_LSL16(shift), rd); } } /* But MOVN needs an inverted value. */ emit_d(as, is64 | (neg ? A64I_MOVNw : A64I_MOVZw) | A64F_U16((u64 >> lshift) & 0xffff) | A64F_LSL16(lshift), rd); } /* Load a 32 bit constant into a GPR. */ #define emit_loadi(as, rd, i) emit_loadk(as, rd, (uint32_t)i) /* Load a 64 bit constant into a GPR. */ #define emit_loadu64(as, rd, i) emit_loadk(as, rd, i) static Reg ra_allock(ASMState *as, intptr_t k, RegSet allow); /* Get/set from constant pointer. */ static void emit_lsptr(ASMState *as, A64Ins ai, Reg r, void *p) { Reg base = RID_GL; int64_t ofs = glofs(as, p); if (emit_checkofs(ai, ofs)) { /* GL + offset, might subsequently fuse to LDP/STP. */ } else if (ai == A64I_LDRx && checkmcpofs(as, p)) { /* IP + offset is cheaper than allock, but address must be in range. */ emit_dl(as, A64I_LDRLx, r, mcpofs(as, p)); return; } else { /* Split up into base reg + offset. */ int64_t i64 = i64ptr(p); base = ra_allock(as, (i64 & ~0x7fffull), rset_exclude(RSET_GPR, r)); ofs = i64 & 0x7fffull; } emit_lso(as, ai, r, base, ofs); } /* Load 64 bit IR constant into register. */ static void emit_loadk64(ASMState *as, Reg r, IRIns *ir) { const uint64_t *k = &ir_k64(ir)->u64; int64_t ofs; if (r >= RID_MAX_GPR) { uint32_t fpk = emit_isfpk64(*k); if (fpk != ~0u) { emit_d(as, A64I_FMOV_DI | A64F_FP8(fpk), (r & 31)); return; } else if ((fpk = emit_isfpmovi(*k))) { emit_d(as, A64I_MOVI_DI | (fpk << 5), (r & 31)); return; } } ofs = glofs(as, k); if (emit_checkofs(A64I_LDRx, ofs)) { emit_lso(as, r >= RID_MAX_GPR ? A64I_LDRd : A64I_LDRx, (r & 31), RID_GL, ofs); } else if (checkmcpofs(as, k)) { emit_dl(as, r >= RID_MAX_GPR ? A64I_LDRLd : A64I_LDRLx, (r & 31), mcpofs(as, k)); } else { if (r >= RID_MAX_GPR) { emit_dn(as, A64I_FMOV_D_R, (r & 31), RID_TMP); r = RID_TMP; } emit_loadu64(as, r, *k); } } /* Get/set global_State fields. */ #define emit_getgl(as, r, field) \ emit_lsptr(as, A64I_LDRx, (r), (void *)&J2G(as->J)->field) #define emit_setgl(as, r, field) \ emit_lsptr(as, A64I_STRx, (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_cond_branch(ASMState *as, A64CC cond, MCode *target) { MCode *p = --as->mcp; ptrdiff_t delta = target - p; lj_assertA(A64F_S_OK(delta, 19), "branch target out of range"); *p = A64I_BCC | A64F_S19(delta) | cond; } static void emit_branch(ASMState *as, A64Ins ai, MCode *target) { MCode *p = --as->mcp; ptrdiff_t delta = target - p; lj_assertA(A64F_S_OK(delta, 26), "branch target out of range"); *p = ai | A64F_S26(delta); } static void emit_tnb(ASMState *as, A64Ins ai, Reg r, uint32_t bit, MCode *target) { MCode *p = --as->mcp; ptrdiff_t delta = target - p; lj_assertA(bit < 63, "bit number out of range"); lj_assertA(A64F_S_OK(delta, 14), "branch target out of range"); if (bit > 31) ai |= A64I_X; *p = ai | A64F_BIT(bit & 31) | A64F_S14(delta) | r; } static void emit_cnb(ASMState *as, A64Ins ai, Reg r, MCode *target) { MCode *p = --as->mcp; ptrdiff_t delta = target - p; lj_assertA(A64F_S_OK(delta, 19), "branch target out of range"); *p = ai | A64F_S19(delta) | r; } #define emit_jmp(as, target) emit_branch(as, A64I_B, (target)) static void emit_call(ASMState *as, ASMFunction target) { MCode *p = --as->mcp; #if LJ_ABI_PAUTH char *targetp = ptrauth_auth_data((char *)target, ptrauth_key_function_pointer, 0); #else char *targetp = (char *)target; #endif ptrdiff_t delta = targetp - (char *)p; if (A64F_S_OK(delta>>2, 26)) { *p = A64I_BL | A64F_S26(delta>>2); } else { /* Target out of range: need indirect call. But don't use R0-R7. */ Reg r = ra_allock(as, i64ptr(target), RSET_RANGE(RID_X8, RID_MAX_GPR)-RSET_FIXED); *p = A64I_BLR_AUTH | A64F_N(r); } } /* -- Emit generic operations --------------------------------------------- */ /* Generic move between two regs. */ static void emit_movrr(ASMState *as, IRIns *ir, Reg dst, Reg src) { if (dst >= RID_MAX_GPR) { emit_dn(as, irt_isnum(ir->t) ? A64I_FMOV_D : A64I_FMOV_S, (dst & 31), (src & 31)); return; } if (as->mcp != as->mcloop) { /* Swap early registers for loads/stores. */ MCode ins = *as->mcp, swp = (src^dst); if ((ins & 0xbf800000) == 0xb9000000) { if (!((ins ^ (dst << 5)) & 0x000003e0)) *as->mcp = ins ^ (swp << 5); /* Swap N in load/store. */ if (!(ins & 0x00400000) && !((ins ^ dst) & 0x0000001f)) *as->mcp = ins ^ swp; /* Swap D in store. */ } } emit_dm(as, A64I_MOVx, dst, src); } /* Generic load of register with base and (small) offset address. */ static void emit_loadofs(ASMState *as, IRIns *ir, Reg r, Reg base, int32_t ofs) { if (r >= RID_MAX_GPR) emit_lso(as, irt_isnum(ir->t) ? A64I_LDRd : A64I_LDRs, (r & 31), base, ofs); else emit_lso(as, irt_is64(ir->t) ? A64I_LDRx : A64I_LDRw, r, base, ofs); } /* Generic store of register with base and (small) offset address. */ static void emit_storeofs(ASMState *as, IRIns *ir, Reg r, Reg base, int32_t ofs) { if (r >= RID_MAX_GPR) emit_lso(as, irt_isnum(ir->t) ? A64I_STRd : A64I_STRs, (r & 31), base, ofs); else emit_lso(as, irt_is64(ir->t) ? A64I_STRx : A64I_STRw, r, base, ofs); } /* Emit an arithmetic operation with a constant operand. */ static void emit_opk(ASMState *as, A64Ins ai, Reg dest, Reg src, int32_t i, RegSet allow) { uint32_t k = emit_isk12(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, ofs < 0 ? A64I_SUBx : A64I_ADDx, r, r, ofs < 0 ? (int32_t)(~(uint32_t)ofs+1u) : ofs, rset_exclude(RSET_GPR, r)); } #define emit_spsub(as, ofs) emit_addptr(as, RID_SP, -(ofs)) subprojects/luajit/src/lj_trace.c0000644000175000017500000007203314741067622016433 0ustar aniolaniol/* ** Trace management. ** Copyright (C) 2005-2023 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" #include "lj_prng.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)"; lj_assertX(startpc >= proto_bc(pt) && startpc < proto_bc(pt) + pt->sizebc, "trace PC out of range"); 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 T. */ GCtrace * LJ_FASTCALL lj_trace_alloc(lua_State *L, GCtrace *T) { size_t sztr = ((sizeof(GCtrace)+7)&~7); size_t szins = (T->nins-T->nk)*sizeof(IRIns); size_t sz = sztr + szins + T->nsnap*sizeof(SnapShot) + T->nsnapmap*sizeof(SnapEntry); GCtrace *T2 = lj_mem_newt(L, (MSize)sz, GCtrace); char *p = (char *)T2 + sztr; T2->gct = ~LJ_TTRACE; T2->marked = 0; T2->traceno = 0; T2->ir = (IRIns *)p - T->nk; T2->nins = T->nins; T2->nk = T->nk; T2->nsnap = T->nsnap; T2->nsnapmap = T->nsnapmap; memcpy(p, T->ir + T->nk, szins); return T2; } /* 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; /* The IR has already been copied above. */ #if LJ_ABI_PAUTH T->mcauth = lj_ptr_sign((ASMFunction)T->mcode, T); #endif p += szins; TRACE_APPENDVEC(snap, nsnap, SnapShot) TRACE_APPENDVEC(snapmap, nsnapmap, SnapEntry) J->cur.traceno = 0; J->curfinal = NULL; 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: lj_assertJ(traceref(J, bc_d(*pc)) == T, "JFORL references other trace"); *pc = T->startins; pc += bc_j(T->startins); lj_assertJ(bc_op(*pc) == BC_JFORI, "FORL does not point to JFORI"); setbc_op(pc, BC_FORI); break; case BC_JITERL: case BC_JLOOP: lj_assertJ(op == BC_ITERL || op == BC_ITERN || op == BC_LOOP || bc_isret(op), "bad original bytecode %d", op); *pc = T->startins; break; case BC_JMP: lj_assertJ(op == BC_ITERL, "bad original bytecode %d", op); pc += bc_j(*pc)+2; if (bc_op(*pc) == BC_JITERL) { lj_assertJ(traceref(J, bc_d(*pc)) == T, "JITERL references other trace"); *pc = T->startins; } break; case BC_JFUNCF: lj_assertJ(op == BC_FUNCF, "bad original bytecode %d", op); *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; lj_assertJ(T->root == 0, "not a root trace"); lj_assertJ(pt != NULL, "trace has no prototype"); /* 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 = T->link = 0; /* Blacklist the link for cont_stitch. */ 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 aligned 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); /* Initialize 32/64 bit constants. */ #if LJ_TARGET_X86ORX64 J->k64[LJ_K64_TOBIT].u64 = U64x(43380000,00000000); #if LJ_32 J->k64[LJ_K64_M2P64_31].u64 = U64x(c1e00000,00000000); #endif J->k64[LJ_K64_2P64].u64 = U64x(43f00000,00000000); J->k32[LJ_K32_M2P64_31] = LJ_64 ? 0xdf800000 : 0xcf000000; #endif #if LJ_TARGET_X86ORX64 || LJ_TARGET_MIPS64 J->k64[LJ_K64_M2P64].u64 = U64x(c3f00000,00000000); #endif #if LJ_TARGET_PPC J->k32[LJ_K32_2P52_2P31] = 0x59800004; J->k32[LJ_K32_2P52] = 0x59800000; #endif #if LJ_TARGET_PPC || LJ_TARGET_MIPS J->k32[LJ_K32_2P31] = 0x4f000000; #endif #if LJ_TARGET_MIPS J->k64[LJ_K64_2P31].u64 = U64x(41e00000,00000000); #if LJ_64 J->k64[LJ_K64_2P63].u64 = U64x(43e00000,00000000); J->k32[LJ_K32_2P63] = 0x5f000000; J->k32[LJ_K32_M2P64] = 0xdf800000; #endif #endif } /* 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++) lj_assertG(i == (ptrdiff_t)J->cur.traceno || traceref(J, i) == NULL, "trace still allocated"); } #endif lj_mcode_free(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) { if (bc_op(*pc) == BC_ITERN) { setbc_op(pc, BC_ITERC); setbc_op(pc+1+bc_j(pc[1]), BC_JMP); } else { 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_u64(&J2G(J)->prng) & ((1u< 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 && J->exitno == 0 && bc_op(*J->pc) != BC_ITERN) { /* Lazy bytecode patching to disable hotcount events. */ lj_assertJ(bc_op(*J->pc) == BC_FORL || bc_op(*J->pc) == BC_ITERL || bc_op(*J->pc) == BC_LOOP || bc_op(*J->pc) == BC_FUNCF, "bad hot bytecode %d", bc_op(*J->pc)); 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; } /* Ensuring forward progress for BC_ITERN can trigger hotcount again. */ if (!J->parent && bc_op(*J->pc) == BC_JLOOP) { /* Already compiled. */ 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? */ lj_assertJ((J2G(J)->hookmask & HOOK_GC) == 0, "recorder called from GC hook"); 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); J->retryrec = 0; J->ktrace = 0; 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); } else { BCOp op = bc_op(*J->pc); if (op == BC_CALLM || op == BC_CALL || op == BC_ITERC) { setintV(L->top++, J->exitno); /* Parent of stitched trace. */ setintV(L->top++, -1); } } ); 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 = J->curfinal; 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_ITERN: 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. */ lj_assertJ(J->parent != 0 && J->cur.root != 0, "not a side trace"); lj_asm_patchexit(J, traceref(J, J->parent), J->exitno, J->cur.mcode); /* Avoid compiling a side trace twice (stack resizing uses parent exit). */ { SnapShot *snap = &traceref(J, J->parent)->snap[J->exitno]; snap->count = SNAPCOUNT_DONE; if (J->cur.topslot > snap->topslot) snap->topslot = J->cur.topslot; } /* 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; case BC_CALLM: case BC_CALL: case BC_ITERC: /* Trace stitching: patch link of previous trace. */ traceref(J, J->exitno)->link = traceno; break; default: lj_assertJ(0, "bad stop bytecode %d", op); 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); setfuncV(L, L->top++, J->fn); ); } /* Start a new root trace for down-recursion. */ static int trace_downrec(jit_State *J) { /* Restart recording at the return instruction. */ lj_assertJ(J->pt != NULL, "no active prototype"); lj_assertJ(bc_isret(bc_op(*J->pc)), "not at a return bytecode"); 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 (J->curfinal) { lj_trace_free(J2G(J), J->curfinal); J->curfinal = NULL; } 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))) { if (J->exitno == 0) { BCIns *startpc = mref(J->cur.startpc, BCIns); if (e == LJ_TRERR_RETRY) hotcount_set(J2GG(J), startpc+1, 1); /* Immediate retry. */ else penalty_pc(J, &gcref(J->cur.startpt)->pt, startpc, e); } else { traceref(J, J->exitno)->link = J->exitno; /* Self-link is blacklisted. */ } } /* 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, cTValue *bot = tvref(L->stack)+LJ_FR2; cTValue *frame; const BCIns *pc; BCPos pos = 0; setstrV(L, L->top++, lj_str_newlit(L, "abort")); setintV(L->top++, traceno); /* Find original Lua function call to generate a better error message. */ for (frame = J->L->base-1, pc = J->pc; ; frame = frame_prev(frame)) { if (isluafunc(frame_func(frame))) { pos = proto_bcpos(funcproto(frame_func(frame)), pc); break; } else if (frame_prev(frame) <= bot) { break; } else if (frame_iscont(frame)) { pc = frame_contpc(frame) - 1; } else { pc = frame_pc(frame) - 1; } } setfuncV(L, L->top++, frame_func(frame)); setintV(L->top++, pos); 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)); if (J->state != LJ_TRACE_RECORD_1ST) break; /* fallthrough */ case LJ_TRACE_RECORD_1ST: J->state = LJ_TRACE_RECORD; /* fallthrough */ case LJ_TRACE_RECORD: trace_pendpatch(J, 0); setvmstate(J2G(J), RECORD); lj_vmevent_send_(L, RECORD, /* Save/restore state for trace recorder. */ TValue savetv = J2G(J)->tmptv; TValue savetv2 = J2G(J)->tmptv2; TraceNo parent = J->parent; ExitNo exitno = J->exitno; 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; J->parent = parent; J->exitno = exitno; ); 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)) && isluafunc(curr_func(J->L)) && snap->count != SNAPCOUNT_DONE && ++snap->count >= J->param[JIT_P_hotexit]) { lj_assertJ(J->state == LJ_TRACE_IDLE, "hot side exit while recording"); /* J->parent is non-zero for a side trace. */ J->state = LJ_TRACE_START; lj_trace_ins(J, pc); } } /* Stitch a new trace to the previous trace. */ void LJ_FASTCALL lj_trace_stitch(jit_State *J, const BCIns *pc) { /* 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; /* Have to treat it like a root trace. */ /* J->exitno is set to the invoking 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; /* Always catch error here and don't call error function. */ cframe_errfunc(L->cframe) = 0; cframe_nres(L->cframe) = -2*LUAI_MAXSTACK*(int)sizeof(TValue); 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 #if defined(EXITSTATE_PCREG) || (LJ_UNWIND_JIT && !EXITTRACE_VMSTATE) /* 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; } lj_assertJ(0, "bad exit pc"); 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, exitcode = J->exitcode; TValue exiterr; const BCIns *pc, *retpc; void *cf; GCtrace *T; setnilV(&exiterr); if (exitcode) { /* Trace unwound with error code. */ J->exitcode = 0; copyTV(L, &exiterr, L->top-1); } #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. */ lj_assertJ(T->root != 0, "stack check in root trace"); J->exitno = T->ir[REF_BASE].op2; J->parent = T->ir[REF_BASE].op1; T = traceref(J, J->parent); } #endif lj_assertJ(T != NULL && J->exitno < T->nsnap, "bad trace or exit number"); exd.J = J; exd.exptr = exptr; errcode = lj_vm_cpcall(L, NULL, &exd, trace_exit_cp); if (errcode) return -errcode; /* Return negated error code. */ if (exitcode) copyTV(L, L->top++, &exiterr); /* Anchor the error object. */ if (!(LJ_HASPROFILE && (G(L)->hookmask & HOOK_PROFILE))) 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 (exitcode) { return -exitcode; } else if (LJ_HASPROFILE && (G(L)->hookmask & HOOK_PROFILE)) { /* Just exit to interpreter. */ } else 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 if ((J->flags & JIT_F_ON)) { trace_hotside(J, pc); } /* Return MULTRES or 0 or -17. */ 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) - LJ_FR2); 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)); case BC_JLOOP: retpc = &traceref(J, bc_d(*pc))->startins; if (bc_isret(bc_op(*retpc)) || bc_op(*retpc) == BC_ITERN) { /* Dispatch to original ins to ensure forward progress. */ if (J->state != LJ_TRACE_RECORD) return -17; /* Unpatch bytecode when recording. */ J->patchins = *pc; J->patchpc = (BCIns *)pc; *J->patchpc = *retpc; J->bcskip = 1; } return 0; default: if (bc_op(*pc) >= BC_FUNCF) return (int)((BCReg)(L->top - L->base) + 1); return 0; } } #if LJ_UNWIND_JIT /* Given an mcode address determine trace exit address for unwinding. */ uintptr_t LJ_FASTCALL lj_trace_unwind(jit_State *J, uintptr_t addr, ExitNo *ep) { #if EXITTRACE_VMSTATE TraceNo traceno = J2G(J)->vmstate; #else TraceNo traceno = trace_exit_find(J, (MCode *)addr); #endif GCtrace *T = traceref(J, traceno); if (T #if EXITTRACE_VMSTATE && addr >= (uintptr_t)T->mcode && addr < (uintptr_t)T->mcode + T->szmcode #endif ) { SnapShot *snap = T->snap; SnapNo lo = 0, exitno = T->nsnap; uintptr_t ofs = (uintptr_t)((MCode *)addr - T->mcode); /* MCode units! */ /* Rightmost binary search for mcode offset to determine exit number. */ do { SnapNo mid = (lo+exitno) >> 1; if (ofs < snap[mid].mcofs) exitno = mid; else lo = mid + 1; } while (lo < exitno); exitno--; *ep = exitno; #ifdef EXITSTUBS_PER_GROUP return (uintptr_t)exitstub_addr(J, exitno); #else return (uintptr_t)exitstub_trace_addr(T, exitno); #endif } /* Cannot correlate addr with trace/exit. This will be fatal. */ lj_assertJ(0, "bad exit pc"); return 0; } #endif #endif subprojects/luajit/src/lauxlib.h0000644000175000017500000001361414741067622016315 0ustar aniolaniol/* ** $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" /* 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[]); /* pre-defined references */ #define LUA_NOREF (-2) #define LUA_REFNIL (-1) 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); LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup); LUALIB_API void (luaL_pushmodule) (lua_State *L, const char *modname, int sizehint); LUALIB_API void *(luaL_testudata) (lua_State *L, int ud, const char *tname); LUALIB_API void (luaL_setmetatable) (lua_State *L, const char *tname); /* ** =============================================================== ** 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))) /* From Lua 5.2. */ #define luaL_newlibtable(L, l) \ lua_createtable(L, 0, sizeof(l)/sizeof((l)[0]) - 1) #define luaL_newlib(L, l) (luaL_newlibtable(L, l), luaL_setfuncs(L, l, 0)) /* ** {====================================================== ** 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); /* }====================================================== */ #endif subprojects/luajit/src/lj_crecord.c0000644000175000017500000017642414741067622016767 0ustar aniolaniol/* ** Trace recorder for C data operations. ** Copyright (C) 2005-2023 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_tab.h" #include "lj_frame.h" #include "lj_ctype.h" #include "lj_cdata.h" #include "lj_cparse.h" #include "lj_cconv.h" #include "lj_carith.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" #include "lj_strfmt.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)) #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; lj_assertJ(tref_iscdata(tr) && cd->ctypeid == CTID_CTYPEID, "expected CTypeID cdata"); 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_cts(J->L); 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_SOFTFP32 && 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)); lj_assertJ(ctype_isarray(ct->info) || ctype_isstruct(ct->info), "copy of non-aggregate"); 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]; lj_assertJ((len & (step-1)) == 0, "copy of fractional size"); } 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_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_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 || ud->udtype == UDTYPE_BUFFER) { TRef tr = emitir(IRT(IR_FLOAD, IRT_U8), sp, IRFL_UDATA_UDTYPE); emitir(IRTGI(IR_EQ), tr, lj_ir_kint(J, ud->udtype)); sp = emitir(IRT(IR_FLOAD, IRT_PTR), sp, ud->udtype == UDTYPE_IO_FILE ? IRFL_UDATA_FILE : IRFL_SBUF_R); } 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)) { lj_assertJ(ctype_child(cts, cct)->size == 4, "only 32 bit const supported"); /* NYI */ 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 if (tref_islightud(sp)) { #if LJ_64 lj_trace_err(J, LJ_TRERR_NYICONV); #endif } else { /* NYI: tref_istab(sp). */ IRType t; sid = argv2cdata(J, sp, sval)->ctypeid; s = ctype_raw(cts, sid); svisnz = cdataptr(cdataV(sval)); if (ctype_isfunc(s->info)) { sid = lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|sid), CTSIZE_PTR); s = ctype_get(cts, sid); t = IRT_PTR; } else { 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; } /* Tailcall to function. */ static void crec_tailcall(jit_State *J, RecordFFData *rd, cTValue *tv) { TRef kfunc = lj_ir_kfunc(J, funcV(tv)); #if LJ_FR2 J->base[-2] = kfunc; J->base[-1] = TREF_FRAME; #else J->base[-1] = kfunc | TREF_FRAME; #endif rd->nres = -1; /* Pending tailcall. */ } /* 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)) { crec_tailcall(J, rd, tv); } 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); } } /* Record bitfield load/store. */ static void crec_index_bf(jit_State *J, RecordFFData *rd, TRef ptr, CTInfo info) { IRType t = IRT_I8 + 2*lj_fls(ctype_bitcsz(info)) + ((info&CTF_UNSIGNED)?1:0); TRef tr = emitir(IRT(IR_XLOAD, t), ptr, 0); CTSize pos = ctype_bitpos(info), bsz = ctype_bitbsz(info), shift = 32 - bsz; lj_assertJ(t <= IRT_U32, "only 32 bit bitfields supported"); /* NYI */ if (rd->data == 0) { /* __index metamethod. */ if ((info & CTF_BOOL)) { tr = emitir(IRTI(IR_BAND), tr, lj_ir_kint(J, (int32_t)((1u << pos)))); /* 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; tr = TREF_TRUE; } else if (!(info & CTF_UNSIGNED)) { tr = emitir(IRTI(IR_BSHL), tr, lj_ir_kint(J, shift - pos)); tr = emitir(IRTI(IR_BSAR), tr, lj_ir_kint(J, shift)); } else { lj_assertJ(bsz < 32, "unexpected full bitfield index"); tr = emitir(IRTI(IR_BSHR), tr, lj_ir_kint(J, pos)); tr = emitir(IRTI(IR_BAND), tr, lj_ir_kint(J, (int32_t)((1u << bsz)-1))); /* We can omit the U32 to NUM conversion, since bsz < 32. */ } J->base[0] = tr; } else { /* __newindex metamethod. */ CTState *cts = ctype_ctsG(J2G(J)); CType *ct = ctype_get(cts, (info & CTF_BOOL) ? CTID_BOOL : (info & CTF_UNSIGNED) ? CTID_UINT32 : CTID_INT32); int32_t mask = (int32_t)(((1u << bsz)-1) << pos); TRef sp = crec_ct_tv(J, ct, 0, J->base[2], &rd->argv[2]); sp = emitir(IRTI(IR_BSHL), sp, lj_ir_kint(J, pos)); /* Use of the target type avoids forwarding conversions. */ sp = emitir(IRT(IR_BAND, t), sp, lj_ir_kint(J, mask)); tr = emitir(IRT(IR_BAND, t), tr, lj_ir_kint(J, (int32_t)~mask)); tr = emitir(IRT(IR_BOR, t), tr, sp); emitir(IRT(IR_XSTORE, t), ptr, tr); rd->nres = 0; J->needsnap = 1; } } 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) { ofs += (ptrdiff_t)fofs; /* 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)) { if (ofs) ptr = emitir(IRT(IR_ADD, IRT_PTR), ptr, lj_ir_kintp(J, ofs)); crec_index_bf(J, rd, ptr, fct->info); return; } else { lj_assertJ(ctype_isfield(fct->info), "field expected"); sid = ctype_cid(fct->info); } } } 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, TRef trfin, cTValue *fin) { if (tvisgcv(fin)) { if (!trfin) trfin = lj_ir_kptr(J, gcval(fin)); } else if (tvisnil(fin)) { trfin = lj_ir_kptr(J, NULL); } else { lj_trace_err(J, LJ_TRERR_BADTYPE); } lj_ir_call(J, IRCALL_lj_cdata_setfin, trcd, trfin, lj_ir_kint(J, (int32_t)itype(fin))); 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 trcd, trid = lj_ir_kint(J, id); cTValue *fin; /* 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); return; } else { TRef trsz = TREF_NIL; if ((info & CTF_VLA)) { /* Calculate VLA/VLS size at runtime. */ CTSize sz0, sz1; if (!J->base[1] || J->base[2]) lj_trace_err(J, LJ_TRERR_NYICONV); /* NYI: init VLA/VLS. */ trsz = crec_ct_tv(J, ctype_get(cts, CTID_INT32), 0, J->base[1], &rd->argv[1]); sz0 = lj_ctype_vlsize(cts, d, 0); sz1 = lj_ctype_vlsize(cts, d, 1); trsz = emitir(IRTGI(IR_MULOV), trsz, lj_ir_kint(J, (int32_t)(sz1-sz0))); trsz = emitir(IRTGI(IR_ADDOV), trsz, lj_ir_kint(J, (int32_t)sz0)); J->base[1] = 0; /* Simplify logic below. */ } else if (ctype_align(info) > CT_MEMALIGN) { trsz = lj_ir_kint(J, sz); } trcd = emitir(IRTG(IR_CNEW, IRT_CDATA), trid, trsz); if (sz > 128 || (info & CTF_VLA)) { TRef dp; CTSize align; special: /* Only handle bulk zero-fill for large/VLA/VLS types. */ if (J->base[1]) lj_trace_err(J, LJ_TRERR_NYICONV); /* NYI: init large/VLA/VLS types. */ dp = emitir(IRT(IR_ADD, IRT_PTR), trcd, lj_ir_kintp(J, sizeof(GCcdata))); if (trsz == TREF_NIL) trsz = lj_ir_kint(J, sz); align = ctype_align(info); if (align < CT_MEMALIGN) align = CT_MEMALIGN; crec_fill(J, dp, trsz, lj_ir_kint(J, 0), (1u << align)); } else 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)) || esize * CREC_FILL_MAXUNROLL < sz) goto special; 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; MSize i = 1; if (!J->base[1]) { /* Handle zero-fill of struct-of-NYI. */ fid = d->sib; while (fid) { CType *df = ctype_get(cts, fid); fid = df->sib; if (ctype_isfield(df->info)) { CType *dc; 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))) goto special; } else if (!ctype_isconstval(df->info)) { goto special; } } } fid = d->sib; 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); if ((d->info & CTF_UNION)) { if (d->size != dc->size) /* NYI: partial init of union. */ lj_trace_err(J, LJ_TRERR_NYICONV); break; } } 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); } } } J->base[0] = trcd; /* Handle __gc metamethod. */ fin = lj_ctype_meta(cts, id, MM_gc); if (fin) crec_finalizer(J, trcd, 0, 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; #elif LJ_TARGET_ARM64 && LJ_TARGET_OSX int ngpr = CCALL_NARG_GPR; #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; lj_assertJ(ctype_isfield(ctf->info), "field expected"); did = ctype_cid(ctf->info); } else { if (!(ct->info & CTF_VARARG)) lj_trace_err(J, LJ_TRERR_NYICALL); /* Too many arguments. */ #if LJ_TARGET_ARM64 && LJ_TARGET_OSX if (ngpr >= 0) { ngpr = -1; args[n++] = TREF_NIL; /* Marker for start of varargs. */ if (n >= CCI_NARGS_MAX) lj_trace_err(J, LJ_TRERR_NYICALL); } #endif 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 LJ_TARGET_ARM64 && LJ_TARGET_OSX if (!ngpr) { /* Fixed args passed on the stack use their unpromoted size. */ if (d->size != lj_ir_type_size[tref_type(tr)]) { lj_assertJ(d->size == 1 || d->size==2, "unexpected size %d", d->size); tr = emitconv(tr, d->size==1 ? IRT_U8 : IRT_U16, tref_type(tr), 0); } } else #endif 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_SOFTFP32 && 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 #elif LJ_TARGET_ARM64 && LJ_TARGET_OSX if (!ctype_isfp(d->info) && ngpr) { ngpr--; } #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-LJ_FR2]; 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+LJ_FR2+bc_a(J->pc[-1]); L->top = base; L->base = base - delta; J->base[-1-LJ_FR2] = TREF_FALSE; J->base -= delta; J->baseslot -= (BCReg)delta; J->maxslot = (BCReg)delta-LJ_FR2; 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-LJ_FR2] = 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. */ tv.u64 = ((uintptr_t)cdata_getptr(cdataptr(cd), (LJ_64 && tp == IRT_P64) ? 8 : 4) >> 2) | U64x(800000000, 00000000); 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)) { crec_tailcall(J, rd, tv); 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_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_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_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)) { crec_tailcall(J, rd, tv); 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_cts(J->L); MMS mm = (MMS)rd->data; 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)) { CTypeID id0 = i ? ctype_typeid(cts, s[0]) : 0; 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)); if (i) { s[0] = ctype_get(cts, id0); /* cts->tab may have been reallocated. */ } 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)) { if (!(mm == MM_len || mm == MM_eq || mm == MM_lt || mm == MM_le)) lj_trace_err(J, LJ_TRERR_BADTYPE); 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. */ lj_trace_err(J, LJ_TRERR_BADTYPE); } } else if (ctype_isptr(ct->info)) { tr = emitir(IRT(IR_ADD, IRT_PTR), tr, lj_ir_kintp(J, sizeof(GCstr))); } else { lj_trace_err(J, LJ_TRERR_BADTYPE); } } else if (!tref_isnum(tr)) { tr = 0; ct = ctype_get(cts, CTID_P_VOID); } ok: s[i] = ct; sp[i] = tr; } { TRef tr; if ((mm == MM_len || mm == MM_concat || (!(tr = crec_arith_int64(J, sp, s, mm)) && !(tr = crec_arith_ptr(J, sp, s, mm)))) && !(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) { J2G(J)->tmptv.u64 = (uint64_t)(uintptr_t)pc; 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]); if (!J->base[1]) lj_trace_err(J, LJ_TRERR_BADTYPE); crec_finalizer(J, J->base[0], J->base[1], &rd->argv[1]); } /* -- 64 bit bit.* library functions -------------------------------------- */ /* Determine bit operation type from argument type. */ static CTypeID crec_bit64_type(CTState *cts, cTValue *tv) { if (tviscdata(tv)) { CType *ct = lj_ctype_rawref(cts, cdataV(tv)->ctypeid); if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct); if ((ct->info & (CTMASK_NUM|CTF_BOOL|CTF_FP|CTF_UNSIGNED)) == CTINFO(CT_NUM, CTF_UNSIGNED) && ct->size == 8) return CTID_UINT64; /* Use uint64_t, since it has the highest rank. */ return CTID_INT64; /* Otherwise use int64_t. */ } return 0; /* Use regular 32 bit ops. */ } static TRef crec_bit64_arg(jit_State *J, CType *d, TRef sp, TValue *sval) { if (LJ_UNLIKELY(tref_isstr(sp))) { if (lj_strscan_num(strV(sval), sval)) { sp = emitir(IRTG(IR_STRTO, IRT_NUM), sp, 0); } /* else: interpreter will throw. */ } return crec_ct_tv(J, d, 0, sp, sval); } void LJ_FASTCALL recff_bit64_tobit(jit_State *J, RecordFFData *rd) { CTState *cts = ctype_ctsG(J2G(J)); TRef tr = crec_bit64_arg(J, ctype_get(cts, CTID_INT64), J->base[0], &rd->argv[0]); if (!tref_isinteger(tr)) tr = emitconv(tr, IRT_INT, tref_type(tr), 0); J->base[0] = tr; } int LJ_FASTCALL recff_bit64_unary(jit_State *J, RecordFFData *rd) { CTState *cts = ctype_ctsG(J2G(J)); CTypeID id = crec_bit64_type(cts, &rd->argv[0]); if (id) { TRef tr = crec_bit64_arg(J, ctype_get(cts, id), J->base[0], &rd->argv[0]); tr = emitir(IRT(rd->data, id-CTID_INT64+IRT_I64), tr, 0); J->base[0] = emitir(IRTG(IR_CNEWI, IRT_CDATA), lj_ir_kint(J, id), tr); return 1; } return 0; } int LJ_FASTCALL recff_bit64_nary(jit_State *J, RecordFFData *rd) { CTState *cts = ctype_ctsG(J2G(J)); CTypeID id = 0; MSize i; for (i = 0; J->base[i] != 0; i++) { CTypeID aid = crec_bit64_type(cts, &rd->argv[i]); if (id < aid) id = aid; /* Determine highest type rank of all arguments. */ } if (id) { CType *ct = ctype_get(cts, id); uint32_t ot = IRT(rd->data, id-CTID_INT64+IRT_I64); TRef tr = crec_bit64_arg(J, ct, J->base[0], &rd->argv[0]); for (i = 1; J->base[i] != 0; i++) { TRef tr2 = crec_bit64_arg(J, ct, J->base[i], &rd->argv[i]); tr = emitir(ot, tr, tr2); } J->base[0] = emitir(IRTG(IR_CNEWI, IRT_CDATA), lj_ir_kint(J, id), tr); return 1; } return 0; } int LJ_FASTCALL recff_bit64_shift(jit_State *J, RecordFFData *rd) { CTState *cts = ctype_ctsG(J2G(J)); CTypeID id; TRef tsh = 0; if (J->base[0] && tref_iscdata(J->base[1])) { tsh = crec_bit64_arg(J, ctype_get(cts, CTID_INT64), J->base[1], &rd->argv[1]); if (!tref_isinteger(tsh)) tsh = emitconv(tsh, IRT_INT, tref_type(tsh), 0); J->base[1] = tsh; } id = crec_bit64_type(cts, &rd->argv[0]); if (id) { TRef tr = crec_bit64_arg(J, ctype_get(cts, id), J->base[0], &rd->argv[0]); uint32_t op = rd->data; if (!tsh) tsh = lj_opt_narrow_tobit(J, J->base[1]); if (!(op < IR_BROL ? LJ_TARGET_MASKSHIFT : LJ_TARGET_MASKROT) && !tref_isk(tsh)) tsh = emitir(IRTI(IR_BAND), tsh, lj_ir_kint(J, 63)); #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 tr = emitir(IRT(op, id-CTID_INT64+IRT_I64), tr, tsh); J->base[0] = emitir(IRTG(IR_CNEWI, IRT_CDATA), lj_ir_kint(J, id), tr); return 1; } return 0; } TRef recff_bit64_tohex(jit_State *J, RecordFFData *rd, TRef hdr) { CTState *cts = ctype_ctsG(J2G(J)); CTypeID id = crec_bit64_type(cts, &rd->argv[0]); TRef tr, trsf = J->base[1]; SFormat sf = (STRFMT_UINT|STRFMT_T_HEX); int32_t n; if (trsf) { CTypeID id2 = 0; n = (int32_t)lj_carith_check64(J->L, 2, &id2); if (id2) trsf = crec_bit64_arg(J, ctype_get(cts, CTID_INT32), trsf, &rd->argv[1]); else trsf = lj_opt_narrow_tobit(J, trsf); emitir(IRTGI(IR_EQ), trsf, lj_ir_kint(J, n)); /* Specialize to n. */ } else { n = id ? 16 : 8; } if (n < 0) { n = (int32_t)(~n+1u); sf |= STRFMT_F_UPPER; } if ((uint32_t)n > 254) n = 254; sf |= ((SFormat)((n+1)&255) << STRFMT_SH_PREC); if (id) { tr = crec_bit64_arg(J, ctype_get(cts, id), J->base[0], &rd->argv[0]); if (n < 16) tr = emitir(IRT(IR_BAND, IRT_U64), tr, lj_ir_kint64(J, ((uint64_t)1 << 4*n)-1)); } else { tr = lj_opt_narrow_tobit(J, J->base[0]); if (n < 8) tr = emitir(IRTI(IR_BAND), tr, lj_ir_kint(J, (int32_t)((1u << 4*n)-1))); tr = emitconv(tr, IRT_U64, IRT_INT, 0); /* No sign-extension. */ lj_needsplit(J); } return lj_ir_call(J, IRCALL_lj_strfmt_putfxint, hdr, lj_ir_kint(J, sf), tr); } /* -- 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 { /* Specialize to the ctype that couldn't be converted. */ argv2cdata(J, J->base[0], &rd->argv[0]); J->base[0] = TREF_NIL; } } TRef lj_crecord_loadiu64(jit_State *J, TRef tr, cTValue *o) { CTypeID id = argv2cdata(J, tr, o)->ctypeid; if (!(id == CTID_INT64 || id == CTID_UINT64)) lj_trace_err(J, LJ_TRERR_BADTYPE); lj_needsplit(J); return emitir(IRT(IR_FLOAD, id == CTID_INT64 ? IRT_I64 : IRT_U64), tr, IRFL_CDATA_INT64); } #if LJ_HASBUFFER TRef lj_crecord_topcvoid(jit_State *J, TRef tr, cTValue *o) { CTState *cts = ctype_ctsG(J2G(J)); if (!tref_iscdata(tr)) lj_trace_err(J, LJ_TRERR_BADTYPE); return crec_ct_tv(J, ctype_get(cts, CTID_P_CVOID), 0, tr, o); } TRef lj_crecord_topuint8(jit_State *J, TRef tr) { return emitir(IRTG(IR_CNEWI, IRT_CDATA), lj_ir_kint(J, CTID_P_UINT8), tr); } #endif #undef IR #undef emitir #undef emitconv #endif subprojects/luajit/src/lj_gdbjit.c0000644000175000017500000005320614741067622016601 0ustar aniolaniol/* ** Client for the GDB JIT API. ** Copyright (C) 2005-2023 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_buf.h" #include "lj_strfmt.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_ARM64 DW_REG_SP = 31, DW_REG_RA = 30, #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 LJ_TARGET_SOLARIS .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_ARM64 .machine = 183, #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 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) (p = (uint8_t *)lj_strfmt_wuleb128((char *)p, (x))) #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(LJ_GC64 ? 10 : 9); DB(DW_CFA_offset|DW_REG_12); DUV(LJ_GC64 ? 11 : 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_ARM64 { int i; DB(DW_CFA_offset|31); DUV(2); for (i = 28; i >= 19; i--) { DB(DW_CFA_offset|i); DUV(3+(28-i)); } for (i = 15; i >= 8; i--) { DB(DW_CFA_offset|32|i); DUV(28-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); 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); lj_assertX(ctx->objsize < sizeof(GDBJITobj), "GDBJITobj overflow"); } #undef SECTALIGN /* -- Interface to GDB JIT API -------------------------------------------- */ static int gdbjit_lock; static void gdbjit_lock_acquire() { while (__sync_lock_test_and_set(&gdbjit_lock, 1)) { /* Just spin; futexes or pthreads aren't worth the portability cost. */ } } static void gdbjit_lock_release() { __sync_lock_release(&gdbjit_lock); } /* 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; gdbjit_lock_acquire(); 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(); gdbjit_lock_release(); } /* 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; lj_assertJ(startpc >= proto_bc(pt) && startpc < proto_bc(pt) + pt->sizebc, "start PC out of range"); 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) { gdbjit_lock_acquire(); 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(); gdbjit_lock_release(); lj_mem_free(J2G(J), eo, eo->sz); } } #endif #endif subprojects/luajit/src/lj_str.c0000644000175000017500000002503114741067622016141 0ustar aniolaniol/* ** String handling. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #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_char.h" #include "lj_prng.h" /* -- String helpers ------------------------------------------------------ */ /* 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); } /* Find fixed string p inside string s. */ const char *lj_str_find(const char *s, const char *p, MSize slen, MSize plen) { if (plen <= slen) { if (plen == 0) { return s; } else { int c = *(const uint8_t *)p++; plen--; slen -= plen; while (slen) { const char *q = (const char *)memchr(s, c, slen); if (!q) break; if (memcmp(q+1, p, plen) == 0) return q; q++; slen -= (MSize)(q-s); s = q; } } } return NULL; } /* Check whether a string has a pattern matching character. */ int lj_str_haspattern(GCstr *s) { const char *p = strdata(s), *q = p + s->len; while (p < q) { int c = *(const uint8_t *)p++; if (lj_char_ispunct(c) && strchr("^$*+?.([%-", c)) return 1; /* Found a pattern matching char. */ } return 0; /* No pattern matching chars found. */ } /* -- String hashing ------------------------------------------------------ */ /* Keyed sparse ARX string hash. Constant time. */ static StrHash hash_sparse(uint64_t seed, const char *str, MSize len) { /* Constants taken from lookup3 hash by Bob Jenkins. */ StrHash a, b, h = len ^ (StrHash)seed; 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 { 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); } a ^= h; a -= lj_rol(h, 11); b ^= a; b -= lj_rol(a, 25); h ^= b; h -= lj_rol(b, 16); return h; } #if LUAJIT_SECURITY_STRHASH /* Keyed dense ARX string hash. Linear time. */ static LJ_NOINLINE StrHash hash_dense(uint64_t seed, StrHash h, const char *str, MSize len) { StrHash b = lj_bswap(lj_rol(h ^ (StrHash)(seed >> 32), 4)); if (len > 12) { StrHash a = (StrHash)seed; const char *pe = str+len-12, *p = pe, *q = str; do { a += lj_getu32(p); b += lj_getu32(p+4); h += lj_getu32(p+8); p = q; q += 12; h ^= b; h -= lj_rol(b, 14); a ^= h; a -= lj_rol(h, 11); b ^= a; b -= lj_rol(a, 25); } while (p < pe); h ^= b; h -= lj_rol(b, 16); a ^= h; a -= lj_rol(h, 4); b ^= a; b -= lj_rol(a, 14); } return b; } #endif /* -- String interning ---------------------------------------------------- */ #define LJ_STR_MAXCOLL 32 /* Resize the string interning hash table (grow and shrink). */ void lj_str_resize(lua_State *L, MSize newmask) { global_State *g = G(L); GCRef *newtab, *oldtab = g->str.tab; MSize i; /* No resizing during GC traversal or if already too big. */ if (g->gc.state == GCSsweepstring || newmask >= LJ_MAX_STRTAB-1) return; newtab = lj_mem_newvec(L, newmask+1, GCRef); memset(newtab, 0, (newmask+1)*sizeof(GCRef)); #if LUAJIT_SECURITY_STRHASH /* Check which chains need secondary hashes. */ if (g->str.second) { int newsecond = 0; /* Compute primary chain lengths. */ for (i = g->str.mask; i != ~(MSize)0; i--) { GCobj *o = (GCobj *)(gcrefu(oldtab[i]) & ~(uintptr_t)1); while (o) { GCstr *s = gco2str(o); MSize hash = s->hashalg ? hash_sparse(g->str.seed, strdata(s), s->len) : s->hash; hash &= newmask; setgcrefp(newtab[hash], gcrefu(newtab[hash]) + 1); o = gcnext(o); } } /* Mark secondary chains. */ for (i = newmask; i != ~(MSize)0; i--) { int secondary = gcrefu(newtab[i]) > LJ_STR_MAXCOLL; newsecond |= secondary; setgcrefp(newtab[i], secondary); } g->str.second = newsecond; } #endif /* Reinsert all strings from the old table into the new table. */ for (i = g->str.mask; i != ~(MSize)0; i--) { GCobj *o = (GCobj *)(gcrefu(oldtab[i]) & ~(uintptr_t)1); while (o) { GCobj *next = gcnext(o); GCstr *s = gco2str(o); MSize hash = s->hash; #if LUAJIT_SECURITY_STRHASH uintptr_t u; if (LJ_LIKELY(!s->hashalg)) { /* String hashed with primary hash. */ hash &= newmask; u = gcrefu(newtab[hash]); if (LJ_UNLIKELY(u & 1)) { /* Switch string to secondary hash. */ s->hash = hash = hash_dense(g->str.seed, s->hash, strdata(s), s->len); s->hashalg = 1; hash &= newmask; u = gcrefu(newtab[hash]); } } else { /* String hashed with secondary hash. */ MSize shash = hash_sparse(g->str.seed, strdata(s), s->len); u = gcrefu(newtab[shash & newmask]); if (u & 1) { hash &= newmask; u = gcrefu(newtab[hash]); } else { /* Revert string back to primary hash. */ s->hash = shash; s->hashalg = 0; hash = (shash & newmask); } } /* NOBARRIER: The string table is a GC root. */ setgcrefp(o->gch.nextgc, (u & ~(uintptr_t)1)); setgcrefp(newtab[hash], ((uintptr_t)o | (u & 1))); #else hash &= newmask; /* NOBARRIER: The string table is a GC root. */ setgcrefr(o->gch.nextgc, newtab[hash]); setgcref(newtab[hash], o); #endif o = next; } } /* Free old table and replace with new table. */ lj_str_freetab(g); g->str.tab = newtab; g->str.mask = newmask; } #if LUAJIT_SECURITY_STRHASH /* Rehash and rechain all strings in a chain. */ static LJ_NOINLINE GCstr *lj_str_rehash_chain(lua_State *L, StrHash hashc, const char *str, MSize len) { global_State *g = G(L); int ow = g->gc.state == GCSsweepstring ? otherwhite(g) : 0; /* Sweeping? */ GCRef *strtab = g->str.tab; MSize strmask = g->str.mask; GCobj *o = gcref(strtab[hashc & strmask]); setgcrefp(strtab[hashc & strmask], (void *)((uintptr_t)1)); g->str.second = 1; while (o) { uintptr_t u; GCobj *next = gcnext(o); GCstr *s = gco2str(o); StrHash hash; if (ow) { /* Must sweep while rechaining. */ if (((o->gch.marked ^ LJ_GC_WHITES) & ow)) { /* String alive? */ lj_assertG(!isdead(g, o) || (o->gch.marked & LJ_GC_FIXED), "sweep of undead string"); makewhite(g, o); } else { /* Free dead string. */ lj_assertG(isdead(g, o) || ow == LJ_GC_SFIXED, "sweep of unlive string"); lj_str_free(g, s); o = next; continue; } } hash = s->hash; if (!s->hashalg) { /* Rehash with secondary hash. */ hash = hash_dense(g->str.seed, hash, strdata(s), s->len); s->hash = hash; s->hashalg = 1; } /* Rechain. */ hash &= strmask; u = gcrefu(strtab[hash]); setgcrefp(o->gch.nextgc, (u & ~(uintptr_t)1)); setgcrefp(strtab[hash], ((uintptr_t)o | (u & 1))); o = next; } /* Try to insert the pending string again. */ return lj_str_new(L, str, len); } #endif /* Reseed String ID from PRNG after random interval < 2^bits. */ #if LUAJIT_SECURITY_STRID == 1 #define STRID_RESEED_INTERVAL 8 #elif LUAJIT_SECURITY_STRID == 2 #define STRID_RESEED_INTERVAL 4 #elif LUAJIT_SECURITY_STRID >= 3 #define STRID_RESEED_INTERVAL 0 #endif /* Allocate a new string and add to string interning table. */ static GCstr *lj_str_alloc(lua_State *L, const char *str, MSize len, StrHash hash, int hashalg) { GCstr *s = lj_mem_newt(L, lj_str_size(len), GCstr); global_State *g = G(L); uintptr_t u; newwhite(g, s); s->gct = ~LJ_TSTR; s->len = len; s->hash = hash; #ifndef STRID_RESEED_INTERVAL s->sid = g->str.id++; #elif STRID_RESEED_INTERVAL if (!g->str.idreseed--) { uint64_t r = lj_prng_u64(&g->prng); g->str.id = (StrID)r; g->str.idreseed = (uint8_t)(r >> (64 - STRID_RESEED_INTERVAL)); } s->sid = g->str.id++; #else s->sid = (StrID)lj_prng_u64(&g->prng); #endif s->reserved = 0; s->hashalg = (uint8_t)hashalg; /* Clear last 4 bytes of allocated memory. Implies zero-termination, too. */ *(uint32_t *)(strdatawr(s)+(len & ~(MSize)3)) = 0; memcpy(strdatawr(s), str, len); /* Add to string hash table. */ hash &= g->str.mask; u = gcrefu(g->str.tab[hash]); setgcrefp(s->nextgc, (u & ~(uintptr_t)1)); /* NOBARRIER: The string table is a GC root. */ setgcrefp(g->str.tab[hash], ((uintptr_t)s | (u & 1))); if (g->str.num++ > g->str.mask) /* Allow a 100% load factor. */ lj_str_resize(L, (g->str.mask<<1)+1); /* Grow string table. */ return s; /* Return newly interned string. */ } /* Intern a string and return string object. */ GCstr *lj_str_new(lua_State *L, const char *str, size_t lenx) { global_State *g = G(L); if (lenx-1 < LJ_MAX_STR-1) { MSize len = (MSize)lenx; StrHash hash = hash_sparse(g->str.seed, str, len); MSize coll = 0; int hashalg = 0; /* Check if the string has already been interned. */ GCobj *o = gcref(g->str.tab[hash & g->str.mask]); #if LUAJIT_SECURITY_STRHASH if (LJ_UNLIKELY((uintptr_t)o & 1)) { /* Secondary hash for this chain? */ hashalg = 1; hash = hash_dense(g->str.seed, hash, str, len); o = (GCobj *)(gcrefu(g->str.tab[hash & g->str.mask]) & ~(uintptr_t)1); } #endif while (o != NULL) { GCstr *sx = gco2str(o); if (sx->hash == hash && sx->len == len) { if (memcmp(str, strdata(sx), len) == 0) { if (isdead(g, o)) flipwhite(o); /* Resurrect if dead. */ return sx; /* Return existing string. */ } coll++; } coll++; o = gcnext(o); } #if LUAJIT_SECURITY_STRHASH /* Rehash chain if there are too many collisions. */ if (LJ_UNLIKELY(coll > LJ_STR_MAXCOLL) && !hashalg) { return lj_str_rehash_chain(L, hash, str, len); } #endif /* Otherwise allocate a new string. */ return lj_str_alloc(L, str, len, hash, hashalg); } else { if (lenx) lj_err_msg(L, LJ_ERR_STROV); return &g->strempty; } } void LJ_FASTCALL lj_str_free(global_State *g, GCstr *s) { g->str.num--; lj_mem_free(g, s, lj_str_size(s->len)); } void LJ_FASTCALL lj_str_init(lua_State *L) { global_State *g = G(L); g->str.seed = lj_prng_u64(&g->prng); lj_str_resize(L, LJ_MIN_STRTAB-1); } subprojects/luajit/src/lib_init.c0000644000175000017500000000251314741067622016435 0ustar aniolaniol/* ** Library initialization. ** Copyright (C) 2005-2023 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); } subprojects/luajit/src/lj_meta.h0000644000175000017500000000275714741067622016276 0ustar aniolaniol/* ** Metamethod handling. ** Copyright (C) 2005-2023 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_istype(lua_State *L, BCReg ra, BCReg tp); 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 subprojects/luajit/src/lj_bcdump.h0000644000175000017500000000401314741067622016605 0ustar aniolaniol/* ** Bytecode dump definitions. ** Copyright (C) 2005-2023 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 2 /* Compatibility flags. */ #define BCDUMP_F_BE 0x01 #define BCDUMP_F_STRIP 0x02 #define BCDUMP_F_FFI 0x04 #define BCDUMP_F_FR2 0x08 #define BCDUMP_F_KNOWN (BCDUMP_F_FR2*2-1) #define BCDUMP_F_DETERMINISTIC 0x80000000 /* 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, uint32_t flags); LJ_FUNC GCproto *lj_bcread_proto(LexState *ls); LJ_FUNC GCproto *lj_bcread(LexState *ls); #endif subprojects/luajit/src/lj_err.h0000644000175000017500000000410714741067622016127 0ustar aniolaniol/* ** Error handling. ** Copyright (C) 2005-2023 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_FASTCALL lj_err_stkov(lua_State *L); LJ_FUNC_NORET void LJ_FASTCALL lj_err_run(lua_State *L); #if LJ_HASJIT LJ_FUNCA_NORET void LJ_FASTCALL lj_err_trace(lua_State *L, int errcode); #endif 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); #if LJ_UNWIND_JIT && !LJ_ABI_WIN LJ_FUNC uint8_t *lj_err_register_mcode(void *base, size_t sz, uint8_t *info); LJ_FUNC void lj_err_deregister_mcode(void *base, size_t sz, uint8_t *info); #else #define lj_err_register_mcode(base, sz, info) (info) #define lj_err_deregister_mcode(base, sz, info) UNUSED(base) #endif #if LJ_UNWIND_EXT && !LJ_ABI_WIN && defined(LUA_USE_ASSERT) LJ_FUNC void lj_err_verify(void); #else #define lj_err_verify() ((void)0) #endif #endif subprojects/luajit/src/lj_err.c0000644000175000017500000010527314741067622016130 0ustar aniolaniol/* ** Error handling. ** Copyright (C) 2005-2023 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" #include "lj_strfmt.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. C modules used by Lua code can ** throw errors, so these need to have unwind tables, too. Transitively ** this applies to all system libraries used by C modules -- at least ** when they have callbacks which may throw an error. ** ** - INT is faster when actually throwing errors, but this happens rarely. ** Setting up error handlers is zero-cost in any case. ** ** - INT needs to save *all* callee-saved registers when entering the ** interpreter. EXT only needs to save those actually used inside the ** interpreter. JIT-compiled code may need to save some more. ** ** - 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 can handle errors from internal helper functions that are called ** from JIT-compiled code (except for Windows/x86 and 32 bit ARM). ** INT has no choice but to call the panic handler, if this happens. ** Note: this is mainly relevant for out-of-memory errors. ** ** EXT is the default on all systems where the toolchain produces unwind ** tables by default (*). This is hard-coded and/or detected in src/Makefile. ** You can thwart the detection with: TARGET_XCFLAGS=-DLUAJIT_UNWIND_INTERNAL ** ** INT is the default on all other systems. ** ** EXT can be manually enabled for toolchains that are able to produce ** conforming unwind tables: ** "TARGET_XCFLAGS=-funwind-tables -DLUAJIT_UNWIND_EXTERNAL" ** As explained above, *all* C code used directly or indirectly by LuaJIT ** must be compiled with -funwind-tables (or -fexceptions). C++ code must ** *not* be compiled with -fno-exceptions. ** ** If you're unsure whether error handling inside the VM works correctly, ** try running this and check whether it prints "OK": ** ** luajit -e "print(select(2, load('OK')):match('OK'))" ** ** (*) Originally, toolchains only generated unwind tables for C++ code. For ** interoperability reasons, this can be manually enabled for plain C code, ** too (with -funwind-tables). With the introduction of the x64 architecture, ** the corresponding POSIX and Windows ABIs mandated unwind tables for all ** code. Over the following years most desktop and server platforms have ** enabled unwind tables by default on all architectures. OTOH mobile and ** embedded platforms do not consistently mandate unwind tables. */ /* -- 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->base = frame+1; L->cframe = cframe_prev(cf); unwindstack(L, top); } return cf; } } if (frame <= tvref(L->stack)+LJ_FR2) break; switch (frame_typep(frame)) { case FRAME_LUA: /* Lua frame. */ case FRAME_LUAP: frame = frame_prevl(frame); break; case FRAME_C: /* C frame. */ unwind_c: #if LJ_UNWIND_EXT if (errcode) { L->base = frame_prevd(frame) + 1; L->cframe = cframe_prev(cf); unwindstack(L, frame - LJ_FR2); } 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->base = frame_prevd(frame) + 1; L->cframe = cframe_prev(cf); unwindstack(L, frame - LJ_FR2); } return cf; case FRAME_CONT: /* Continuation frame. */ if (frame_iscont_fficb(frame)) goto unwind_c; /* fallthrough */ 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) { global_State *g; if (errcode == LUA_YIELD) { frame = frame_prevd(frame); break; } g = G(L); setgcref(g->cur_L, obj2gco(L)); if (frame_typep(frame) == FRAME_PCALL) hook_leave(g); L->base = frame_prevd(frame) + 1; L->cframe = cf; unwindstack(L, L->base); } return (void *)((intptr_t)cf | CFRAME_UNWIND_FF); } } /* No C frame. */ if (errcode) { L->base = tvref(L->stack)+1+LJ_FR2; L->cframe = NULL; 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 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. :-( */ #define WIN32_LEAN_AND_MEAN #include #if LJ_TARGET_X86 typedef void *UndocumentedDispatcherContext; /* Unused on x86. */ #else /* 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; #endif /* Another wild guess. */ extern void __DestructExceptionObject(EXCEPTION_RECORD *rec, int nothrow); #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)) /* Windows exception handler for interpreter frame. */ LJ_FUNCA int lj_err_unwind_win(EXCEPTION_RECORD *rec, void *f, CONTEXT *ctx, UndocumentedDispatcherContext *dispatch) { #if LJ_TARGET_X86 void *cf = (char *)f - CFRAME_OFS_SEH; #elif LJ_TARGET_ARM64 void *cf = (char *)f - CFRAME_SIZE; #else void *cf = f; #endif 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 */ if (rec->ExceptionCode == STATUS_LONGJUMP && rec->ExceptionRecord && LJ_EXCODE_CHECK(rec->ExceptionRecord->ExceptionCode)) { errcode = LJ_EXCODE_ERRCODE(rec->ExceptionRecord->ExceptionCode); if ((rec->ExceptionFlags & 0x20)) { /* EH_TARGET_UNWIND */ /* Unwinding is about to finish; revert the ExceptionCode so that ** RtlRestoreContext does not try to restore from a _JUMP_BUFFER. */ rec->ExceptionCode = 0; } } /* 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 !LJ_TARGET_X86 EXCEPTION_RECORD rec2; #endif if (rec->ExceptionCode == LJ_MSVC_EXCODE || rec->ExceptionCode == LJ_GCC_EXCODE) { #if !LJ_TARGET_CYGWIN __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 1; /* ExceptionContinueSearch */ } #if LJ_TARGET_X86 UNUSED(ctx); UNUSED(dispatch); /* Call all handlers for all lower C frames (including ourselves) again ** with EH_UNWINDING set. Then call the specified function, passing cf ** and errcode. */ lj_vm_rtlunwind(cf, (void *)rec, (cframe_unwind_ff(cf2) && errcode != LUA_YIELD) ? (void *)lj_vm_unwind_ff : (void *)lj_vm_unwind_c, errcode); /* lj_vm_rtlunwind does not return. */ #else if (LJ_EXCODE_CHECK(rec->ExceptionCode)) { /* For unwind purposes, wrap the EXCEPTION_RECORD in something that ** looks like a longjmp, so that MSVC will execute C++ destructors in ** the frames we unwind over. ExceptionInformation[0] should really ** contain a _JUMP_BUFFER*, but hopefully nobody is looking too closely ** at this point. */ rec2.ExceptionCode = STATUS_LONGJUMP; rec2.ExceptionRecord = rec; rec2.ExceptionAddress = 0; rec2.NumberParameters = 1; rec2.ExceptionInformation[0] = (ULONG_PTR)ctx; rec = &rec2; } /* Unwind the stack and call all handlers for all lower C frames ** (including ourselves) again with EH_UNWINDING set. Then set ** stack pointer = f, result = errcode and jump to the specified target. */ RtlUnwindEx(f, (void *)((cframe_unwind_ff(cf2) && errcode != LUA_YIELD) ? lj_vm_unwind_ff_eh : lj_vm_unwind_c_eh), rec, (void *)(uintptr_t)errcode, dispatch->ContextRecord, dispatch->HistoryTable); /* RtlUnwindEx should never return. */ #endif } } return 1; /* ExceptionContinueSearch */ } #if LJ_UNWIND_JIT #if LJ_TARGET_X64 #define CONTEXT_REG_PC Rip #elif LJ_TARGET_ARM64 #define CONTEXT_REG_PC Pc #else #error "NYI: Windows arch-specific unwinder for JIT-compiled code" #endif /* Windows unwinder for JIT-compiled code. */ static void err_unwind_win_jit(global_State *g, int errcode) { CONTEXT ctx; UNWIND_HISTORY_TABLE hist; memset(&hist, 0, sizeof(hist)); RtlCaptureContext(&ctx); while (1) { DWORD64 frame, base, addr = ctx.CONTEXT_REG_PC; void *hdata; PRUNTIME_FUNCTION func = RtlLookupFunctionEntry(addr, &base, &hist); if (!func) { /* Found frame without .pdata: must be JIT-compiled code. */ ExitNo exitno; uintptr_t stub = lj_trace_unwind(G2J(g), (uintptr_t)(addr - sizeof(MCode)), &exitno); if (stub) { /* Jump to side exit to unwind the trace. */ ctx.CONTEXT_REG_PC = stub; G2J(g)->exitcode = errcode; RtlRestoreContext(&ctx, NULL); /* Does not return. */ } break; } RtlVirtualUnwind(UNW_FLAG_NHANDLER, base, addr, func, &ctx, &hdata, &frame, NULL); if (!addr) break; } /* Unwinding failed, if we end up here. */ } #endif /* Raise Windows exception. */ static void err_raise_ext(global_State *g, int errcode) { #if LJ_UNWIND_JIT if (tvref(g->jit_base)) { err_unwind_win_jit(g, errcode); return; /* Unwinding failed. */ } #elif LJ_HASJIT /* Cannot catch on-trace errors for Windows/x86 SEH. Unwind to interpreter. */ setmref(g->jit_base, NULL); #endif UNUSED(g); RaiseException(LJ_EXCODE_MAKE(errcode), 1 /* EH_NONCONTINUABLE */, 0, NULL); } #elif !LJ_NO_UNWIND && (defined(__GNUC__) || defined(__clang__)) /* ** 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_Context _Unwind_Context; #define _URC_OK 0 #define _URC_FATAL_PHASE2_ERROR 2 #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 #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)) #if !LJ_TARGET_ARM typedef struct _Unwind_Exception { uint64_t exclass; void (*excleanup)(int, struct _Unwind_Exception *); uintptr_t p1, p2; } __attribute__((__aligned__)) _Unwind_Exception; #define UNWIND_EXCEPTION_TYPE _Unwind_Exception extern uintptr_t _Unwind_GetCFA(_Unwind_Context *); extern void _Unwind_SetGR(_Unwind_Context *, int, uintptr_t); extern uintptr_t _Unwind_GetIP(_Unwind_Context *); 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 /* 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; 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) { ASMFunction ip; _Unwind_SetGR(ctx, LJ_TARGET_EHRETREG, errcode); ip = cframe_unwind_ff(cf) ? lj_vm_unwind_ff_eh : lj_vm_unwind_c_eh; _Unwind_SetIP(ctx, (uintptr_t)lj_ptr_strip(ip)); 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); #if LJ_TARGET_X64 #error "Broken build system -- only use the provided Makefiles!" #endif #endif } return _URC_CONTINUE_UNWIND; } #if LJ_UNWIND_EXT && defined(LUA_USE_ASSERT) struct dwarf_eh_bases { void *tbase, *dbase, *func; }; extern const void *_Unwind_Find_FDE(void *pc, struct dwarf_eh_bases *bases); /* Verify that external error handling actually has a chance to work. */ void lj_err_verify(void) { #if !LJ_TARGET_OSX /* Check disabled on MacOS due to brilliant software engineering at Apple. */ struct dwarf_eh_bases ehb; lj_assertX(_Unwind_Find_FDE((void *)lj_err_throw, &ehb), "broken build: external frame unwinding enabled, but missing -funwind-tables"); #endif /* Check disabled, because of broken Fedora/ARM64. See #722. lj_assertX(_Unwind_Find_FDE((void *)_Unwind_RaiseException, &ehb), "broken build: external frame unwinding enabled, but system libraries have no unwind tables"); */ } #endif #if LJ_UNWIND_JIT /* DWARF2 personality handler for JIT-compiled code. */ static int err_unwind_jit(int version, int actions, uint64_t uexclass, _Unwind_Exception *uex, _Unwind_Context *ctx) { /* NYI: FFI C++ exception interoperability. */ if (version != 1 || !LJ_UEXCLASS_CHECK(uexclass)) return _URC_FATAL_PHASE1_ERROR; if ((actions & _UA_SEARCH_PHASE)) { return _URC_HANDLER_FOUND; } if ((actions & _UA_CLEANUP_PHASE)) { global_State *g = *(global_State **)(uex+1); ExitNo exitno; uintptr_t addr = _Unwind_GetIP(ctx); /* Return address _after_ call. */ uintptr_t stub = lj_trace_unwind(G2J(g), addr - sizeof(MCode), &exitno); lj_assertG(tvref(g->jit_base), "unexpected throw across mcode frame"); if (stub) { /* Jump to side exit to unwind the trace. */ G2J(g)->exitcode = LJ_UEXCLASS_ERRCODE(uexclass); #ifdef LJ_TARGET_MIPS _Unwind_SetGR(ctx, 4, stub); _Unwind_SetGR(ctx, 5, exitno); _Unwind_SetIP(ctx, (uintptr_t)(void *)lj_vm_unwind_stub); #else _Unwind_SetIP(ctx, stub); #endif return _URC_INSTALL_CONTEXT; } return _URC_FATAL_PHASE2_ERROR; } return _URC_FATAL_PHASE1_ERROR; } /* DWARF2 template frame info for JIT-compiled code. ** ** After copying the template to the start of the mcode segment, ** the frame handler function and the code size is patched. ** The frame handler always installs a new context to jump to the exit, ** so don't bother to add any unwind opcodes. */ static const uint8_t err_frame_jit_template[] = { #if LJ_BE 0,0,0, #endif LJ_64 ? 0x1c : 0x14, /* CIE length. */ #if LJ_LE 0,0,0, #endif 0,0,0,0, 1, 'z','P','R',0, /* CIE mark, CIE version, augmentation. */ 1, LJ_64 ? 0x78 : 0x7c, LJ_TARGET_EHRAREG, /* Code/data align, RA. */ #if LJ_64 10, 0, 0,0,0,0,0,0,0,0, 0x1b, /* Aug. data ABS handler, PCREL|SDATA4 code. */ 0,0,0,0,0, /* Alignment. */ #else 6, 0, 0,0,0,0, 0x1b, /* Aug. data ABS handler, PCREL|SDATA4 code. */ 0, /* Alignment. */ #endif #if LJ_BE 0,0,0, #endif LJ_64 ? 0x14 : 0x10, /* FDE length. */ 0,0,0, LJ_64 ? 0x24 : 0x1c, /* CIE offset. */ 0,0,0, LJ_64 ? 0x14 : 0x10, /* Code offset. After Final FDE. */ #if LJ_LE 0,0,0, #endif 0,0,0,0, 0, 0,0,0, /* Code size, augmentation length, alignment. */ #if LJ_64 0,0,0,0, /* Alignment. */ #endif 0,0,0,0 /* Final FDE. */ }; #define ERR_FRAME_JIT_OFS_HANDLER 0x12 #define ERR_FRAME_JIT_OFS_FDE (LJ_64 ? 0x20 : 0x18) #define ERR_FRAME_JIT_OFS_CODE_SIZE (LJ_64 ? 0x2c : 0x24) #if LJ_TARGET_OSX #define ERR_FRAME_JIT_OFS_REGISTER ERR_FRAME_JIT_OFS_FDE #else #define ERR_FRAME_JIT_OFS_REGISTER 0 #endif extern void __register_frame(const void *); extern void __deregister_frame(const void *); uint8_t *lj_err_register_mcode(void *base, size_t sz, uint8_t *info) { ASMFunction handler = (ASMFunction)err_unwind_jit; memcpy(info, err_frame_jit_template, sizeof(err_frame_jit_template)); #if LJ_ABI_PAUTH #if LJ_TARGET_ARM64 handler = ptrauth_auth_and_resign(handler, ptrauth_key_function_pointer, 0, ptrauth_key_process_independent_code, info + ERR_FRAME_JIT_OFS_HANDLER); #else #error "missing pointer authentication support for this architecture" #endif #endif memcpy(info + ERR_FRAME_JIT_OFS_HANDLER, &handler, sizeof(handler)); *(uint32_t *)(info + ERR_FRAME_JIT_OFS_CODE_SIZE) = (uint32_t)(sz - sizeof(err_frame_jit_template) - (info - (uint8_t *)base)); __register_frame(info + ERR_FRAME_JIT_OFS_REGISTER); #ifdef LUA_USE_ASSERT { struct dwarf_eh_bases ehb; lj_assertX(_Unwind_Find_FDE(info + sizeof(err_frame_jit_template)+1, &ehb), "bad JIT unwind table registration"); } #endif return info + sizeof(err_frame_jit_template); } void lj_err_deregister_mcode(void *base, size_t sz, uint8_t *info) { UNUSED(base); UNUSED(sz); __deregister_frame(info + ERR_FRAME_JIT_OFS_REGISTER); } #endif #else /* LJ_TARGET_ARM */ #define _US_VIRTUAL_UNWIND_FRAME 0 #define _US_UNWIND_FRAME_STARTING 1 #define _US_ACTION_MASK 3 #define _US_FORCE_UNWIND 8 typedef struct _Unwind_Control_Block _Unwind_Control_Block; #define UNWIND_EXCEPTION_TYPE _Unwind_Control_Block struct _Unwind_Control_Block { uint64_t exclass; uint32_t misc[20]; }; extern int _Unwind_RaiseException(_Unwind_Control_Block *); extern int __gnu_unwind_frame(_Unwind_Control_Block *, _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); } extern void lj_vm_unwind_ext(void); /* ARM unwinder personality handler referenced from interpreter .ARM.extab. */ LJ_FUNCA int lj_err_unwind_arm(int state, _Unwind_Control_Block *ucb, _Unwind_Context *ctx) { void *cf = (void *)_Unwind_GetGR(ctx, 13); lua_State *L = cframe_L(cf); int errcode; switch ((state & _US_ACTION_MASK)) { case _US_VIRTUAL_UNWIND_FRAME: if ((state & _US_FORCE_UNWIND)) break; return _URC_HANDLER_FOUND; case _US_UNWIND_FRAME_STARTING: if (LJ_UEXCLASS_CHECK(ucb->exclass)) { errcode = LJ_UEXCLASS_ERRCODE(ucb->exclass); } else { errcode = LUA_ERRRUN; setstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRCPP)); } cf = err_unwind(L, cf, errcode); if ((state & _US_FORCE_UNWIND) || cf == NULL) break; _Unwind_SetGR(ctx, 15, (uint32_t)lj_vm_unwind_ext); _Unwind_SetGR(ctx, 0, (uint32_t)ucb); _Unwind_SetGR(ctx, 1, (uint32_t)errcode); _Unwind_SetGR(ctx, 2, cframe_unwind_ff(cf) ? (uint32_t)lj_vm_unwind_ff_eh : (uint32_t)lj_vm_unwind_c_eh); return _URC_INSTALL_CONTEXT; default: return _URC_FAILURE; } if (__gnu_unwind_frame(ucb, ctx) != _URC_OK) return _URC_FAILURE; #ifdef LUA_USE_ASSERT /* We should never get here unless this is a forced unwind aka backtrace. */ if (_Unwind_GetGR(ctx, 0) == 0xff33aa77) { _Unwind_SetGR(ctx, 0, 0xff33aa88); } #endif return _URC_CONTINUE_UNWIND; } #if LJ_UNWIND_EXT && defined(LUA_USE_ASSERT) typedef int (*_Unwind_Trace_Fn)(_Unwind_Context *, void *); extern int _Unwind_Backtrace(_Unwind_Trace_Fn, void *); static int err_verify_bt(_Unwind_Context *ctx, int *got) { if (_Unwind_GetGR(ctx, 0) == 0xff33aa88) { *got = 2; } else if (*got == 0) { *got = 1; _Unwind_SetGR(ctx, 0, 0xff33aa77); } return _URC_OK; } /* Verify that external error handling actually has a chance to work. */ void lj_err_verify(void) { int got = 0; _Unwind_Backtrace((_Unwind_Trace_Fn)err_verify_bt, &got); lj_assertX(got == 2, "broken build: external frame unwinding enabled, but missing -funwind-tables"); } #endif /* ** Note: LJ_UNWIND_JIT is not implemented for 32 bit ARM. ** ** The quirky ARM unwind API doesn't have __register_frame(). ** A potential workaround might involve _Unwind_Backtrace. ** But most 32 bit ARM targets don't qualify for LJ_UNWIND_EXT, anyway, ** since they are built without unwind tables by default. */ #endif /* LJ_TARGET_ARM */ #if LJ_UNWIND_EXT static __thread struct { UNWIND_EXCEPTION_TYPE ex; global_State *g; } static_uex; /* Raise external exception. */ static void err_raise_ext(global_State *g, int errcode) { memset(&static_uex, 0, sizeof(static_uex)); static_uex.ex.exclass = LJ_UEXCLASS_MAKE(errcode); static_uex.g = g; _Unwind_RaiseException(&static_uex.ex); } #endif #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); L->status = LUA_OK; #if LJ_UNWIND_EXT err_raise_ext(g, 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 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 #if LJ_HASJIT setmref(g->jit_base, NULL); #endif { 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); if (LJ_HASJIT) { TValue *base = tvref(G(L)->jit_base); if (base) L->base = base; } if (curr_funcisL(L)) { L->top = curr_topL(L); if (LJ_UNLIKELY(L->top > tvref(L->maxstack))) { /* The current Lua frame violates the stack. Replace it with a dummy. */ L->top = L->base; setframe_gc(L->base - 1 - LJ_FR2, obj2gco(L), LJ_TTHREAD); } } 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)+LJ_FR2; 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 (frame_iscont_fficb(frame)) cf = cframe_prev(cf); frame = frame_prevd(frame); break; case FRAME_CP: if (cframe_canyield(cf)) return 0; if (cframe_errfunc(cf) >= 0) return cframe_errfunc(cf); cf = cframe_prev(cf); frame = frame_prevd(frame); break; case FRAME_PCALL: case FRAME_PCALLH: if (frame_func(frame_prevd(frame))->c.ffid == FF_xpcall) return savestack(L, frame_prevd(frame)+1); /* xpcall's errorfunc. */ return 0; default: lj_assertL(0, "bad frame type"); return 0; } } return 0; } /* Runtime error. */ LJ_NOINLINE void LJ_FASTCALL lj_err_run(lua_State *L) { ptrdiff_t ef = (LJ_HASJIT && tvref(G(L)->jit_base)) ? 0 : finderrfunc(L); if (ef) { TValue *errfunc, *top; lj_state_checkstack(L, LUA_MINSTACK * 2); /* Might raise new error. */ lj_trace_abort(G(L)); errfunc = restorestack(L, ef); top = L->top; 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+LJ_FR2, top-1); copyTV(L, top-1, errfunc); if (LJ_FR2) setnilV(top++); L->top = top+1; lj_vm_call(L, top, 1+1); /* Stack: |errfunc|msg| -> |msg| */ } lj_err_throw(L, LUA_ERRRUN); } /* Stack overflow error. */ void LJ_FASTCALL lj_err_stkov(lua_State *L) { lj_debug_addloc(L, err2msg(LJ_ERR_STKOV), L->base-1, NULL); lj_err_run(L); } #if LJ_HASJIT /* Rethrow error after doing a trace exit. */ LJ_NOINLINE void LJ_FASTCALL lj_err_trace(lua_State *L, int errcode) { if (errcode == LUA_ERRRUN) lj_err_run(L); else lj_err_throw(L, errcode); } #endif /* 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 (LJ_HASJIT) { TValue *base = tvref(G(L)->jit_base); if (base) L->base = base; } if (curr_funcisL(L)) L->top = curr_topL(L); msg = lj_strfmt_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, line); msg = lj_strfmt_pushvf(L, err2msg(em), argp); msg = lj_strfmt_pushf(L, "%s:%d: %s", buff, line, msg); if (tok) lj_strfmt_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_gc(o, obj2gco(L), LJ_TTHREAD); if (LJ_FR2) o++; setframe_pc(o, pc); 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 = NULL, *pframe = NULL; if (!(LJ_HASJIT && tvref(G(L)->jit_base))) { frame = L->base-1; if (frame_islua(frame)) { pframe = frame_prevl(frame); } else if (frame_iscont(frame)) { if (frame_iscont_fficb(frame)) { pframe = frame; frame = NULL; } else { 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_strfmt_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_strfmt_pushf(L, err2msg(LJ_ERR_BADSELF), fname, msg); else msg = lj_strfmt_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_strfmt_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_strfmt_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_strfmt_pushvf(L, fmt, argp); va_end(argp); lj_err_callermsg(L, msg); return 0; /* unreachable */ } subprojects/luajit/src/lj_tab.c0000644000175000017500000004624414741067622016110 0ustar aniolaniol/* ** Table handling. ** Copyright (C) 2005-2023 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 an arbitrary key and return its anchor position in the hash table. */ static Node *hashkey(const GCtab *t, cTValue *key) { lj_assertX(!tvisint(key), "attempt to hash integer"); 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; lj_assertL(hbits != 0, "zero hash size"); if (hbits > LJ_MAX_HBITS) lj_err_msg(L, LJ_ERR_TABOV); hsize = 1u << hbits; node = lj_mem_newvec(L, hsize, Node); setmref(t->node, node); setfreetop(t, node, &node[hsize]); 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); lj_assertX(t->hmask != 0, "empty hash part"); 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) { Node *nilnode; lj_assertL((sizeof(GCtab) & 7) == 0, "bad GCtab size"); 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; nilnode = &G(L)->nilnode; setmref(t->node, nilnode); #if LJ_GC64 setmref(t->freetop, nilnode); #endif } else { /* Otherwise separately allocate the array part. */ Node *nilnode; 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; nilnode = &G(L)->nilnode; setmref(t->node, nilnode); #if LJ_GC64 setmref(t->freetop, nilnode); #endif 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; } /* The API of this function conforms to lua_createtable(). */ GCtab *lj_tab_new_ah(lua_State *L, int32_t a, int32_t h) { return lj_tab_new(L, (uint32_t)(a > 0 ? a+1 : 0), hsize2hbits(h)); } #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); lj_assertL(kt->asize == t->asize && kt->hmask == t->hmask, "mismatched size of table and template"); 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; setfreetop(t, node, (Node *)((char *)getfreetop(kt, knode) + 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; } /* Clear a table. */ void LJ_FASTCALL lj_tab_clear(GCtab *t) { clearapart(t); if (t->hmask > 0) { Node *node = noderef(t->node); setfreetop(t, node, &node[t->hmask+1]); clearhpart(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. */ void lj_tab_resize(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); #if LJ_GC64 setmref(t->freetop, &g->nilnode); #endif 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) { lj_assertX(!tvisint(key), "bad integer 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, const 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 = getfreetop(t, nodebase); lj_assertL(freenode >= nodebase && freenode <= nodebase+t->hmask+1, "bad freenode"); 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)); setfreetop(t, nodebase, freenode); lj_assertL(freenode != &G(L)->nilnode, "store to fallback hash"); 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 (!tvisnil(&nn->val) && hashkey(t, &nn->key) == n) { freenode->next = nn->next; nn->next = n->next; setmref(n->next, nn); /* ** Rechaining a resurrected string key creates a new dilemma: ** Another string key may have originally been resurrected via ** _any_ of the previous nodes as a chain anchor. Including ** a node that had to be moved, which makes them unreachable. ** It's not feasible to check for all previous nodes, so rechain ** any string key that's currently in a non-main positions. */ while ((nn = nextnode(freenode))) { if (!tvisnil(&nn->val)) { Node *mn = hashkey(t, &nn->key); if (mn != freenode && mn != nn) { freenode->next = nn->next; nn->next = mn->next; setmref(mn->next, nn); } else { freenode = nn; } } else { freenode = nn; } } break; } 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); lj_assertL(tvisnil(&n->val), "new hash slot is not empty"); 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, const 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 ----------------------------------------------------- */ /* Table traversal indexes: ** ** Array key index: [0 .. t->asize-1] ** Hash key index: [t->asize .. t->asize+t->hmask] ** Invalid key: ~0 */ /* Get the successor traversal index of a key. */ uint32_t LJ_FASTCALL lj_tab_keyindex(GCtab *t, cTValue *key) { TValue tmp; if (tvisint(key)) { int32_t k = intV(key); if ((uint32_t)k < t->asize) return (uint32_t)k + 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 + 1; } if (!tvisnil(key)) { Node *n = hashkey(t, key); do { if (lj_obj_equal(&n->key, key)) return t->asize + (uint32_t)((n+1) - noderef(t->node)); } while ((n = nextnode(n))); if (key->u32.hi == LJ_KEYINDEX) /* Despecialized ITERN while running. */ return key->u32.lo; return ~0u; /* Invalid key to next. */ } return 0; /* A nil key starts the traversal. */ } /* Get the next key/value pair of a table traversal. */ int lj_tab_next(GCtab *t, cTValue *key, TValue *o) { uint32_t idx = lj_tab_keyindex(t, key); /* Find successor index of key. */ /* First traverse the array part. */ for (; idx < t->asize; idx++) { cTValue *a = arrayslot(t, idx); if (LJ_LIKELY(!tvisnil(a))) { setintV(o, idx); o[1] = *a; return 1; } } idx -= t->asize; /* Then traverse the hash part. */ for (; idx <= t->hmask; idx++) { Node *n = &noderef(t->node)[idx]; if (!tvisnil(&n->val)) { o[0] = n->key; o[1] = n->val; return 1; } } return (int32_t)idx < 0 ? -1 : 0; /* Invalid key or end of traversal. */ } /* -- Table length calculation -------------------------------------------- */ /* Compute table length. Slow path with mixed array/hash lookups. */ LJ_NOINLINE static MSize tab_len_slow(GCtab *t, size_t hi) { cTValue *tv; size_t lo = hi; hi++; /* Widening search for an upper bound. */ while ((tv = lj_tab_getint(t, (int32_t)hi)) && !tvisnil(tv)) { lo = hi; hi += hi; if (hi > (size_t)(0x7fffffff - 2)) { /* Punt and do a linear search. */ lo = 1; while ((tv = lj_tab_getint(t, (int32_t)lo)) && !tvisnil(tv)) lo++; return (MSize)(lo - 1); } } /* Binary search to find a non-nil to nil transition. */ while (hi - lo > 1) { size_t mid = (lo+hi) >> 1; cTValue *tvb = lj_tab_getint(t, (int32_t)mid); if (tvb && !tvisnil(tvb)) lo = mid; else hi = mid; } return (MSize)lo; } /* Compute table length. Fast path. */ MSize LJ_FASTCALL lj_tab_len(GCtab *t) { size_t hi = (size_t)t->asize; if (hi) hi--; /* In a growing array the last array element is very likely nil. */ if (hi > 0 && LJ_LIKELY(tvisnil(arrayslot(t, hi)))) { /* Binary search to find a non-nil to nil transition in the array. */ size_t lo = 0; while (hi - lo > 1) { size_t mid = (lo+hi) >> 1; if (tvisnil(arrayslot(t, mid))) hi = mid; else lo = mid; } return (MSize)lo; } /* Without a hash part, there's an implicit nil after the last element. */ return t->hmask ? tab_len_slow(t, hi) : (MSize)hi; } #if LJ_HASJIT /* Verify hinted table length or compute it. */ MSize LJ_FASTCALL lj_tab_len_hint(GCtab *t, size_t hint) { size_t asize = (size_t)t->asize; cTValue *tv = arrayslot(t, hint); if (LJ_LIKELY(hint+1 < asize)) { if (LJ_LIKELY(!tvisnil(tv) && tvisnil(tv+1))) return (MSize)hint; } else if (hint+1 <= asize && LJ_LIKELY(t->hmask == 0) && !tvisnil(tv)) { return (MSize)hint; } return lj_tab_len(t); } #endif subprojects/luajit/src/xedkbuild.bat0000644000175000017500000000633214741067622017146 0ustar aniolaniol@rem Script to build LuaJIT with the Xbox 360 SDK. @rem Donated to the public domain. @rem @rem Open a "Visual Studio .NET Command Prompt" (32 bit host compiler) @rem Then cd to this directory and run this script. @if not defined INCLUDE goto :FAIL @if not defined XEDK goto :FAIL @setlocal @rem ---- Host compiler ---- @set LJCOMPILE=cl /nologo /c /MD /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE @set LJLINK=link /nologo @set LJMT=mt /nologo @set DASMDIR=..\dynasm @set DASM=%DASMDIR%\dynasm.lua @set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c lib_buffer.c %LJCOMPILE% host\minilua.c @if errorlevel 1 goto :BAD %LJLINK% /out:minilua.exe minilua.obj @if errorlevel 1 goto :BAD if exist minilua.exe.manifest^ %LJMT% -manifest minilua.exe.manifest -outputresource:minilua.exe @rem Error out for 64 bit host compiler @minilua @if errorlevel 8 goto :FAIL @set DASMFLAGS=-D GPR64 -D FRAME32 -D PPE -D SQRT -D DUALNUM minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_ppc.dasc @if errorlevel 1 goto :BAD if exist ..\.git ( git show -s --format=%%ct >luajit_relver.txt ) else ( type ..\.relver >luajit_relver.txt ) minilua host\genversion.lua %LJCOMPILE% /I "." /I %DASMDIR% /D_XBOX_VER=200 /DLUAJIT_TARGET=LUAJIT_ARCH_PPC host\buildvm*.c @if errorlevel 1 goto :BAD %LJLINK% /out:buildvm.exe buildvm*.obj @if errorlevel 1 goto :BAD if exist buildvm.exe.manifest^ %LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe buildvm -m peobj -o lj_vm.obj @if errorlevel 1 goto :BAD buildvm -m bcdef -o lj_bcdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m ffdef -o lj_ffdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m libdef -o lj_libdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m recdef -o lj_recdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m vmdef -o jit\vmdef.lua %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m folddef -o lj_folddef.h lj_opt_fold.c @if errorlevel 1 goto :BAD @rem ---- Cross compiler ---- @set LJCOMPILE="%XEDK%\bin\win32\cl" /nologo /c /MT /O2 /W3 /GF /Gm- /GR- /GS- /Gy /openmp- /D_CRT_SECURE_NO_DEPRECATE /DNDEBUG /D_XBOX /D_LIB /DLUAJIT_USE_SYSMALLOC @set LJLIB="%XEDK%\bin\win32\lib" /nologo @set "INCLUDE=%XEDK%\include\xbox" @if "%1" neq "debug" goto :NODEBUG @shift @set "LJCOMPILE=%LJCOMPILE% /Zi" :NODEBUG @if "%1"=="amalg" goto :AMALG %LJCOMPILE% /DLUA_BUILD_AS_DLL lj_*.c lib_*.c @if errorlevel 1 goto :BAD %LJLIB% /OUT:luajit20.lib lj_*.obj lib_*.obj @if errorlevel 1 goto :BAD @goto :NOAMALG :AMALG %LJCOMPILE% /DLUA_BUILD_AS_DLL ljamalg.c @if errorlevel 1 goto :BAD %LJLIB% /OUT:luajit20.lib ljamalg.obj lj_vm.obj @if errorlevel 1 goto :BAD :NOAMALG @del *.obj *.manifest minilua.exe buildvm.exe @echo. @echo === Successfully built LuaJIT for Xbox 360 === @goto :END :BAD @echo. @echo ******************************************************* @echo *** Build FAILED -- Please check the error messages *** @echo ******************************************************* @goto :END :FAIL @echo To run this script you must open a "Visual Studio .NET Command Prompt" @echo (32 bit host compiler). The Xbox 360 SDK must be installed, too. :END subprojects/luajit/src/lj_clib.h0000644000175000017500000000136214741067622016250 0ustar aniolaniol/* ** FFI C library loader. ** Copyright (C) 2005-2023 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 subprojects/luajit/src/lib_package.c0000644000175000017500000004346014741067622017073 0ustar aniolaniol/* ** Package library. ** Copyright (C) 2005-2023 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) && !defined(NO_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 #if LJ_TARGET_UWP void *LJ_WIN_LOADLIBA(const char *path) { DWORD err = GetLastError(); wchar_t wpath[256]; HANDLE lib = NULL; if (MultiByteToWideChar(CP_ACP, 0, path, -1, wpath, 256) > 0) { lib = LoadPackagedLibrary(wpath, 0); } SetLastError(err); return lib; } #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(); #if LJ_TARGET_XBOXONE wchar_t wbuffer[128]; char buffer[128*2]; if (FormatMessageW(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, wbuffer, sizeof(wbuffer)/sizeof(wchar_t), NULL) && WideCharToMultiByte(CP_ACP, 0, wbuffer, 128, buffer, 128*2, NULL, NULL)) #else char buffer[128]; if (FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, buffer, sizeof(buffer), NULL)) #endif 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 = LJ_WIN_LOADLIBA(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; } #if LJ_TARGET_UWP EXTERN_C IMAGE_DOS_HEADER __ImageBase; #endif static const char *ll_bcsym(void *lib, const char *sym) { if (lib) { return (const char *)GetProcAddress((HINSTANCE)lib, sym); } else { #if LJ_TARGET_UWP return (const char *)GetProcAddress((HINSTANCE)&__ImageBase, 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; #endif } } #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_setmetatable(L, "_LOADLIB"); 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; if (strlen(path) >= 4096) { lua_pushliteral(L, "path too long"); return PACKAGE_ERR_LIB; } 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; } /* ------------------------------------------------------------------------ */ #define KEY_SENTINEL (U64x(80000000,00000000)|'s') 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 ((L->top-1)->u64 == KEY_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); } (L->top++)->u64 = KEY_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 ((L->top-1)->u64 == KEY_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 lastarg = (int)(L->top - L->base); luaL_pushmodule(L, modname, 1); lua_getfield(L, -1, "_NAME"); if (!lua_isnil(L, -1)) { /* Module already initialized? */ lua_pop(L, 1); } else { lua_pop(L, 1); modinit(L, modname); } lua_pushvalue(L, -1); setfenv(L); dooptions(L, lastarg); return LJ_52; } 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_copy(L, -1, 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); } #if LJ_52 lua_pushvalue(L, -1); lua_setfield(L, -3, "searchers"); #endif 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; } subprojects/luajit/src/lj_tab.h0000644000175000017500000000634114741067622016107 0ustar aniolaniol/* ** Table handling. ** Copyright (C) 2005-2023 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; } /* 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 IDs are generated when a string is interned. */ #define hashstr(t, s) hashmask(t, (s)->sid) #define hashlohi(t, lo, hi) hashmask((t), hashrot((lo), (hi))) #define hashnum(t, o) hashlohi((t), (o)->u32.lo, ((o)->u32.hi << 1)) #if LJ_GC64 #define hashgcref(t, r) \ hashlohi((t), (uint32_t)gcrefu(r), (uint32_t)(gcrefu(r) >> 32)) #else #define hashgcref(t, r) hashlohi((t), gcrefu(r), gcrefu(r) + HASH_BIAS) #endif #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); LJ_FUNC GCtab *lj_tab_new_ah(lua_State *L, int32_t a, int32_t h); #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_clear(GCtab *t); LJ_FUNC void LJ_FASTCALL lj_tab_free(global_State *g, GCtab *t); LJ_FUNC void lj_tab_resize(lua_State *L, GCtab *t, uint32_t asize, uint32_t hbits); 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, const 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_FUNCA TValue *lj_tab_setinth(lua_State *L, GCtab *t, int32_t key); LJ_FUNC TValue *lj_tab_setstr(lua_State *L, GCtab *t, const 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_FUNC uint32_t LJ_FASTCALL lj_tab_keyindex(GCtab *t, cTValue *key); LJ_FUNCA int lj_tab_next(GCtab *t, cTValue *key, TValue *o); LJ_FUNCA MSize LJ_FASTCALL lj_tab_len(GCtab *t); #if LJ_HASJIT LJ_FUNC MSize LJ_FASTCALL lj_tab_len_hint(GCtab *t, size_t hint); #endif #endif subprojects/luajit/src/lj_alloc.c0000644000175000017500000012232714741067622016431 0ustar aniolaniol/* ** 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 ** https://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: https://www.malloc.de/ ** - nedmalloc: https://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" #include "lj_prng.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) /* Determine system-specific block allocation method. */ #if LJ_TARGET_WINDOWS #define WIN32_LEAN_AND_MEAN #include #define LJ_ALLOC_VIRTUALALLOC 1 #if LJ_64 && !LJ_GC64 #define LJ_ALLOC_NTAVM 1 #endif #else #include /* If this include fails, then rebuild with: -DLUAJIT_USE_SYSMALLOC */ #include #define LJ_ALLOC_MMAP 1 #if LJ_64 #define LJ_ALLOC_MMAP_PROBE 1 #if LJ_GC64 #define LJ_ALLOC_MBITS 47 /* 128 TB in LJ_GC64 mode. */ #elif LJ_TARGET_X64 && LJ_HASJIT /* Due to limitations in the x64 compiler backend. */ #define LJ_ALLOC_MBITS 31 /* 2 GB on x64 with !LJ_GC64. */ #else #define LJ_ALLOC_MBITS 32 /* 4 GB on other archs with !LJ_GC64. */ #endif #endif #if LJ_64 && !LJ_GC64 && defined(MAP_32BIT) #define LJ_ALLOC_MMAP32 1 #endif #if LJ_TARGET_LINUX #define LJ_ALLOC_MREMAP 1 #endif #endif #if LJ_ALLOC_VIRTUALALLOC #if LJ_ALLOC_NTAVM /* Undocumented, but hey, that's what we all love so much about Windows. */ typedef long (*PNTAVM)(HANDLE handle, void **addr, ULONG_PTR 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"); } #define INIT_MMAP() init_mmap() /* Win64 32 bit MMAP via NtAllocateVirtualMemory. */ static void *mmap_plain(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 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 /* Win32 MMAP via VirtualAlloc */ static void *mmap_plain(size_t size) { DWORD olderr = GetLastError(); void *ptr = LJ_WIN_VALLOC(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 void *direct_mmap(size_t size) { DWORD olderr = GetLastError(); void *ptr = LJ_WIN_VALLOC(0, size, MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN, PAGE_READWRITE); SetLastError(olderr); return ptr ? ptr : MFAIL; } #endif #define CALL_MMAP(prng, size) mmap_plain(size) #define DIRECT_MMAP(prng, size) direct_mmap(size) /* This function supports releasing coalesed segments */ static 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; } #elif LJ_ALLOC_MMAP #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_ALLOC_MMAP_PROBE #ifdef MAP_TRYFIXED #define MMAP_FLAGS_PROBE (MMAP_FLAGS|MAP_TRYFIXED) #else #define MMAP_FLAGS_PROBE MMAP_FLAGS #endif #define LJ_ALLOC_MMAP_PROBE_MAX 30 #define LJ_ALLOC_MMAP_PROBE_LINEAR 5 #define LJ_ALLOC_MMAP_PROBE_LOWER ((uintptr_t)0x4000) static void *mmap_probe(PRNGState *rs, size_t size) { /* Hint for next allocation. Doesn't need to be thread-safe. */ static uintptr_t hint_addr = 0; int olderr = errno; int retry; for (retry = 0; retry < LJ_ALLOC_MMAP_PROBE_MAX; retry++) { void *p = mmap((void *)hint_addr, size, MMAP_PROT, MMAP_FLAGS_PROBE, -1, 0); uintptr_t addr = (uintptr_t)p; if ((addr >> LJ_ALLOC_MBITS) == 0 && addr >= LJ_ALLOC_MMAP_PROBE_LOWER && ((addr + size) >> LJ_ALLOC_MBITS) == 0) { /* We got a suitable address. Bump the hint address. */ hint_addr = addr + size; errno = olderr; return p; } if (p != MFAIL) { munmap(p, size); } else if (errno == ENOMEM) { return MFAIL; } if (hint_addr) { /* First, try linear probing. */ if (retry < LJ_ALLOC_MMAP_PROBE_LINEAR) { hint_addr += 0x1000000; if (((hint_addr + size) >> LJ_ALLOC_MBITS) != 0) hint_addr = 0; continue; } else if (retry == LJ_ALLOC_MMAP_PROBE_LINEAR) { /* Next, try a no-hint probe to get back an ASLR address. */ hint_addr = 0; continue; } } /* Finally, try pseudo-random probing. */ do { hint_addr = lj_prng_u64(rs) & (((uintptr_t)1< static void init_mmap(void) { struct rlimit rlim; rlim.rlim_cur = rlim.rlim_max = 0x10000; setrlimit(RLIMIT_DATA, &rlim); /* Ignore result. May fail later. */ } #define INIT_MMAP() init_mmap() #endif static int CALL_MUNMAP(void *ptr, size_t size) { int olderr = errno; int ret = munmap(ptr, size); errno = olderr; return ret; } #if LJ_ALLOC_MREMAP /* Need to define _GNU_SOURCE to get the mremap prototype. */ static 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 && (!LJ_GC64 || LJ_TARGET_ARM64) #define CALL_MREMAP_MV CALL_MREMAP_NOMOVE #else #define CALL_MREMAP_MV CALL_MREMAP_MAYMOVE #endif #endif #endif #ifndef INIT_MMAP #define INIT_MMAP() ((void)0) #endif #ifndef DIRECT_MMAP #define DIRECT_MMAP(prng, s) CALL_MMAP(prng, s) #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; PRNGState *prng; }; 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(TWO_SIZE_T_SIZES)+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(mstate m, 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(m->prng, 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); } } UNUSED(m); 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(m, 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(m->prng, 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 == (char *)mem2chunk(sp)) { 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(PRNGState *rs) { size_t tsize = DEFAULT_GRANULARITY; char *tbase; INIT_MMAP(); UNUSED(rs); tbase = (char *)(CALL_MMAP(rs, 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_setprng(void *msp, PRNGState *rs) { mstate ms = (mstate)msp; ms->prng = rs; } 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 subprojects/luajit/src/lj_ccallback.h0000644000175000017500000000116714741067622017241 0ustar aniolaniol/* ** FFI C callback handling. ** Copyright (C) 2005-2023 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 subprojects/luajit/src/lib_ffi.c0000644000175000017500000005347014741067622016246 0ustar aniolaniol/* ** FFI library. ** Copyright (C) 2005-2023 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_strfmt.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-LJ_FR2; } 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_strfmt_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); cd = lj_cdata_newx(cts, id, sz, 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 = tabref(G(L)->gcroot[GCROOT_FFI_FIN]); 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; } /* Internal and unsupported API. */ LJLIB_CF(ffi_typeinfo) { CTState *cts = ctype_cts(L); CTypeID id = (CTypeID)ffi_checkint(L, 1); if (id > 0 && id < cts->top) { CType *ct = ctype_get(cts, id); GCtab *t; lua_createtable(L, 0, 4); /* Increment hash size if fields are added. */ t = tabV(L->top-1); setintV(lj_tab_setstr(L, t, lj_str_newlit(L, "info")), (int32_t)ct->info); if (ct->size != CTSIZE_INVALID) setintV(lj_tab_setstr(L, t, lj_str_newlit(L, "size")), (int32_t)ct->size); if (ct->sib) setintV(lj_tab_setstr(L, t, lj_str_newlit(L, "sib")), (int32_t)ct->sib); if (gcref(ct->name)) { GCstr *s = gco2str(gcref(ct->name)); if (isdead(G(L), obj2gco(s))) flipwhite(obj2gco(s)); setstrV(L, lj_tab_setstr(L, t, lj_str_newlit(L, "name")), s); } lj_gc_check(L); return 1; } return 0; } 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_raw(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; } /* Test ABI string. */ LJLIB_CF(ffi_abi) LJLIB_REC(.) { GCstr *s = lj_lib_checkstr(L, 1); int b = lj_cparse_case(s, #if LJ_64 "\00564bit" #else "\00532bit" #endif #if LJ_ARCH_HASFPU "\003fpu" #endif #if LJ_ABI_SOFTFP "\006softfp" #else "\006hardfp" #endif #if LJ_ABI_EABI "\004eabi" #endif #if LJ_ABI_WIN "\003win" #endif #if LJ_ABI_PAUTH "\005pauth" #endif #if LJ_TARGET_UWP "\003uwp" #endif #if LJ_LE "\002le" #else "\002be" #endif #if LJ_GC64 "\004gc64" #endif ) >= 0; setboolV(L->top-1, b); setboolV(&G(L)->tmptv2, b); /* Remember for trace recorder. */ return 1; } LJLIB_PUSH(top-7) 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_raw(cts, id); 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)ctype_typeid(cts, ct)); 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_CF(ffi_gc) LJLIB_REC(.) { GCcdata *cd = ffi_checkcdata(L, 1); TValue *fin = lj_lib_checkany(L, 2); CTState *cts = ctype_cts(L); 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); lj_cdata_setfin(L, cd, gcval(fin), itype(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" /* ------------------------------------------------------------------------ */ /* Register FFI module as loaded. */ static void ffi_register_module(lua_State *L) { cTValue *tmp = lj_tab_getstr(tabV(registry(L)), lj_str_newlit(L, "_LOADED")); if (tmp && tvistab(tmp)) { GCtab *t = tabV(tmp); copyTV(L, lj_tab_setstr(L, t, lj_str_newlit(L, LUA_FFILIBNAME)), L->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))); 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 subprojects/luajit/src/ps5build.bat0000644000175000017500000000772714741067622016733 0ustar aniolaniol@rem Script to build LuaJIT with the PS5 SDK. @rem Donated to the public domain. @rem @rem Open a "Visual Studio .NET Command Prompt" (64 bit host compiler) @rem or "VS20xx x64 Native Tools Command Prompt". @rem @rem Then cd to this directory and run this script. @rem @rem Recommended invocation: @rem @rem ps5build release build, amalgamated, 64-bit GC @rem ps5build debug debug build, amalgamated, 64-bit GC @rem @rem Additional command-line options (not generally recommended): @rem @rem gc32 (before debug) 32-bit GC @rem noamalg (after debug) non-amalgamated build @if not defined INCLUDE goto :FAIL @if not defined SCE_PROSPERO_SDK_DIR goto :FAIL @setlocal @rem ---- Host compiler ---- @set LJCOMPILE=cl /nologo /c /MD /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE @set LJLINK=link /nologo @set LJMT=mt /nologo @set DASMDIR=..\dynasm @set DASM=%DASMDIR%\dynasm.lua @set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c lib_buffer.c @set GC64= @set DASC=vm_x64.dasc @if "%1" neq "gc32" goto :NOGC32 @shift @set GC64=-DLUAJIT_DISABLE_GC64 @set DASC=vm_x86.dasc :NOGC32 %LJCOMPILE% host\minilua.c @if errorlevel 1 goto :BAD %LJLINK% /out:minilua.exe minilua.obj @if errorlevel 1 goto :BAD if exist minilua.exe.manifest^ %LJMT% -manifest minilua.exe.manifest -outputresource:minilua.exe @rem Check for 64 bit host compiler. @minilua @if not errorlevel 8 goto :FAIL @set DASMFLAGS=-D P64 -D NO_UNWIND minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h %DASC% @if errorlevel 1 goto :BAD if exist ..\.git ( git show -s --format=%%ct >luajit_relver.txt ) else ( type ..\.relver >luajit_relver.txt ) minilua host\genversion.lua %LJCOMPILE% /I "." /I %DASMDIR% %GC64% -DLUAJIT_TARGET=LUAJIT_ARCH_X64 -DLUAJIT_OS=LUAJIT_OS_OTHER -DLUAJIT_DISABLE_JIT -DLUAJIT_DISABLE_FFI -DLUAJIT_NO_UNWIND host\buildvm*.c @if errorlevel 1 goto :BAD %LJLINK% /out:buildvm.exe buildvm*.obj @if errorlevel 1 goto :BAD if exist buildvm.exe.manifest^ %LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe buildvm -m elfasm -o lj_vm.s @if errorlevel 1 goto :BAD buildvm -m bcdef -o lj_bcdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m ffdef -o lj_ffdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m libdef -o lj_libdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m recdef -o lj_recdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m vmdef -o jit\vmdef.lua %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m folddef -o lj_folddef.h lj_opt_fold.c @if errorlevel 1 goto :BAD @rem ---- Cross compiler ---- @set LJCOMPILE="%SCE_PROSPERO_SDK_DIR%\host_tools\bin\prospero-clang" -c -Wall -DLUAJIT_DISABLE_FFI -DLUAJIT_USE_SYSMALLOC %GC64% @set LJLIB="%SCE_PROSPERO_SDK_DIR%\host_tools\bin\prospero-llvm-ar" rcus @set INCLUDE="" "%SCE_PROSPERO_SDK_DIR%\host_tools\bin\prospero-clang" -c -o lj_vm.o lj_vm.s @if "%1" neq "debug" goto :NODEBUG @shift @set LJCOMPILE=%LJCOMPILE% -g -O0 @set TARGETLIB=libluajitD_ps5.a goto :BUILD :NODEBUG @set LJCOMPILE=%LJCOMPILE% -O2 @set TARGETLIB=libluajit_ps5.a :BUILD del %TARGETLIB% @if "%1" neq "noamalg" goto :AMALG for %%f in (lj_*.c lib_*.c) do ( %LJCOMPILE% %%f @if errorlevel 1 goto :BAD ) %LJLIB% %TARGETLIB% lj_*.o lib_*.o @if errorlevel 1 goto :BAD @goto :NOAMALG :AMALG %LJCOMPILE% ljamalg.c @if errorlevel 1 goto :BAD %LJLIB% %TARGETLIB% ljamalg.o lj_vm.o @if errorlevel 1 goto :BAD :NOAMALG @del *.o *.obj *.manifest minilua.exe buildvm.exe @echo. @echo === Successfully built LuaJIT for PS5 === @goto :END :BAD @echo. @echo ******************************************************* @echo *** Build FAILED -- Please check the error messages *** @echo ******************************************************* @goto :END :FAIL @echo To run this script you must open a "Visual Studio .NET Command Prompt" @echo (64 bit host compiler). The PS5 Prospero SDK must be installed, too. :END subprojects/luajit/src/Makefile0000644000175000017500000005737214741067622016155 0ustar aniolaniol############################################################################## # 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-2023 Mike Pall. See Copyright Notice in luajit.h ############################################################################## MAJVER= 2 MINVER= 1 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/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 -msse -msse2 -mfpmath=sse CCOPT_x64= CCOPT_arm= CCOPT_arm64= CCOPT_ppc= 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 # # Disable LJ_GC64 mode for x64. #XCFLAGS+= -DLUAJIT_DISABLE_GC64 # ############################################################################## ############################################################################## ############################ 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 without GC64, 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. #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 else HOST_SYS:= $(shell uname -s) ifneq (,$(findstring MINGW,$(HOST_SYS))) HOST_SYS= Windows HOST_MSYS= mingw endif ifneq (,$(findstring MSYS,$(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- ASOPTIONS= $(CCOPT) $(CCWARN) $(XCFLAGS) $(CFLAGS) CCOPTIONS= $(CCDEBUG) $(ASOPTIONS) 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 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_DLLDOTANAME= libluajit-$(ABIVER).dll.a 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_ASFLAGS= $(ASOPTIONS) $(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_ARM64 ,$(TARGET_TESTARCH))) ifneq (,$(findstring __AARCH64EB__ ,$(TARGET_TESTARCH))) TARGET_ARCH= -D__AARCH64EB__=1 endif TARGET_LJARCH= arm64 else ifneq (,$(findstring LJ_TARGET_PPC ,$(TARGET_TESTARCH))) ifneq (,$(findstring LJ_LE 1,$(TARGET_TESTARCH))) TARGET_ARCH= -DLJ_ARCH_ENDIAN=LUAJIT_LE else TARGET_ARCH= -DLJ_ARCH_ENDIAN=LUAJIT_BE endif TARGET_LJARCH= ppc else ifneq (,$(findstring LJ_TARGET_MIPS ,$(TARGET_TESTARCH))) ifneq (,$(findstring MIPSEL ,$(TARGET_TESTARCH))) TARGET_ARCH= -D__MIPSEL__=1 endif ifneq (,$(findstring LJ_TARGET_MIPS64 ,$(TARGET_TESTARCH))) TARGET_LJARCH= mips64 else TARGET_LJARCH= mips endif 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 TARGET_XLIBS+= -lpthread 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 ifneq (,$(INSTALL_LJLIBD)) TARGET_XCFLAGS+= -DLUA_LJDIR=\"$(INSTALL_LJLIBD)\" endif ############################################################################## # Target system detection. ############################################################################## TARGET_SYS?= $(HOST_SYS) ifeq (Windows,$(TARGET_SYS)) TARGET_STRIP+= --strip-unneeded TARGET_XSHLDFLAGS= -shared -Wl,--out-implib,$(TARGET_DLLDOTANAME) TARGET_DYNXLDOPTS= else TARGET_AR+= 2>/dev/null 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)) $(error missing: export MACOSX_DEPLOYMENT_TARGET=XX.YY) endif TARGET_STRIP+= -x TARGET_XCFLAGS+= -DLUAJIT_UNWIND_EXTERNAL TARGET_XSHLDFLAGS= -dynamiclib -undefined dynamic_lookup -fPIC TARGET_DYNXLDOPTS= TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).255 else ifeq (iOS,$(TARGET_SYS)) TARGET_STRIP+= -x TARGET_XSHLDFLAGS= -dynamiclib -undefined dynamic_lookup -fPIC TARGET_DYNXLDOPTS= TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).255 ifeq (arm64,$(TARGET_LJARCH)) TARGET_XCFLAGS+= -fno-omit-frame-pointer endif else ifeq (,$(findstring LJ_NO_UNWIND 1,$(TARGET_TESTARCH))) # Find out whether the target toolchain always generates unwind tables. TARGET_TESTUNWIND=$(shell exec 2>/dev/null; echo 'extern void b(void);int a(void){b();return 0;}' | $(TARGET_CC) -c -x c - -o tmpunwind.o && { grep -qa -e eh_frame -e __unwind_info tmpunwind.o || grep -qU -e eh_frame -e __unwind_info tmpunwind.o; } && echo E; rm -f tmpunwind.o) ifneq (,$(findstring E,$(TARGET_TESTUNWIND))) TARGET_XCFLAGS+= -DLUAJIT_UNWIND_EXTERNAL endif endif 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 -DTARGET_OS_IPHONE=1 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) MINILUA_DEP= ifeq (,$(HOST_LUA)) HOST_LUA= $(MINILUA_X) MINILUA_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_LE 1,$(TARGET_TESTARCH))) DASM_AFLAGS+= -D ENDIAN_LE else DASM_AFLAGS+= -D ENDIAN_BE endif 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 ifneq (,$(findstring LJ_ABI_PAUTH 1,$(TARGET_TESTARCH))) DASM_AFLAGS+= -D PAUTH TARGET_ARCH+= -DLJ_ABI_PAUTH=1 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 (x64,$(TARGET_LJARCH)) ifeq (,$(findstring LJ_FR2 1,$(TARGET_TESTARCH))) DASM_ARCH= x86 endif else ifeq (arm,$(TARGET_LJARCH)) ifeq (iOS,$(TARGET_SYS)) DASM_AFLAGS+= -D IOS endif else ifneq (,$(findstring LJ_TARGET_MIPSR6 ,$(TARGET_TESTARCH))) DASM_AFLAGS+= -D MIPSR6 endif 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_PPC32ON64 1,$(TARGET_TESTARCH))) DASM_AFLAGS+= -D GPR64 endif ifeq (PS3,$(TARGET_SYS)) DASM_AFLAGS+= -D PPE -D TOC endif endif endif endif DASM_FLAGS= $(DASM_XFLAGS) $(DASM_AFLAGS) DASM_DASC= vm_$(DASM_ARCH).dasc GIT= git ifeq (Windows,$(HOST_SYS)$(HOST_MSYS)) GIT_RELVER= if exist ..\.git ( $(GIT) show -s --format=%%ct >luajit_relver.txt ) else ( type ..\.relver >luajit_relver.txt ) else GIT_RELVER= [ -e ../.git ] && $(GIT) show -s --format=%ct >luajit_relver.txt 2>/dev/null || cat ../.relver >luajit_relver.txt 2>/dev/null || : endif GIT_DEP= $(wildcard ../.git/HEAD ../.git/refs/heads/*) 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 \ lib_buffer.o LJLIB_C= $(LJLIB_O:.o=.c) LJCORE_O= lj_assert.o lj_gc.o lj_err.o lj_char.o lj_bc.o lj_obj.o lj_buf.o \ lj_str.o lj_tab.o lj_func.o lj_udata.o lj_meta.o lj_debug.o \ lj_prng.o lj_state.o lj_dispatch.o lj_vmevent.o lj_vmmath.o \ lj_strscan.o lj_strfmt.o lj_strfmt_num.o lj_serialize.o \ lj_api.o lj_profile.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 luajit.h ALL_GEN= $(LJVM_S) $(ALL_HDRGEN) luajit_relver.txt $(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)) HOST_RM= del 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: $(MAKE) all "LJCORE_O=ljamalg.o" clean: $(HOST_RM) $(ALL_RM) libbc: ./$(LUAJIT_T) host/genlibbc.lua -o host/buildvm_libbc.h $(LJLIB_C) $(MAKE) all 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 libbc depend ############################################################################## # Rules for generated files. ############################################################################## $(MINILUA_T): $(MINILUA_O) $(E) "HOSTLINK $@" $(Q)$(HOST_CC) $(HOST_ALDFLAGS) -o $@ $(MINILUA_O) $(MINILUA_LIBS) $(HOST_ALIBS) luajit.h: $(MINILUA_DEP) $(GIT_DEP) luajit_rolling.h $(E) "VERSION $@" $(Q)$(GIT_RELVER) $(Q)$(HOST_LUA) host/genversion.lua host/buildvm_arch.h: $(DASM_DASC) $(MINILUA_DEP) lj_arch.h lua.h luaconf.h $(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_ASFLAGS) -c -o $(@:.o=_dyn.o) $< $(Q)$(TARGET_CC) $(TARGET_ASFLAGS) -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" ############################################################################## subprojects/luajit/src/lj_cparse.h0000644000175000017500000000430714741067622016616 0ustar aniolaniol/* ** C declaration parser. ** Copyright (C) 2005-2023 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); LJ_FUNC int lj_cparse_case(GCstr *str, const char *match); #endif #endif subprojects/luajit/src/lj_char.h0000644000175000017500000000263514741067622016260 0ustar aniolaniol/* ** 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 subprojects/luajit/src/lj_parse.h0000644000175000017500000000064114741067622016450 0ustar aniolaniol/* ** Lua parser (source code -> bytecode). ** Copyright (C) 2005-2023 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 subprojects/luajit/src/lib_table.c0000644000175000017500000001736214741067622016571 0ustar aniolaniol/* ** Table library. ** Copyright (C) 2005-2023 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_table_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_buf.h" #include "lj_tab.h" #include "lj_ff.h" #include "lj_lib.h" /* ------------------------------------------------------------------------ */ #define LJLIB_MODULE_table LJLIB_LUA(table_foreachi) /* function(t, f) CHECK_tab(t) CHECK_func(f) for i=1,#t do local r = f(i, t[i]) if r ~= nil then return r end end end */ LJLIB_LUA(table_foreach) /* function(t, f) CHECK_tab(t) CHECK_func(f) for k, v in PAIRS(t) do local r = f(k, v) if r ~= nil then return r end end end */ LJLIB_LUA(table_getn) /* function(t) CHECK_tab(t) return #t end */ 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_LUA(table_remove) /* function(t, pos) CHECK_tab(t) local len = #t if pos == nil then if len ~= 0 then local old = t[len] t[len] = nil return old end else CHECK_int(pos) if pos >= 1 and pos <= len then local old = t[pos] for i=pos+1,len do t[i-1] = t[i] end t[len] = nil return old end end end */ LJLIB_LUA(table_move) /* function(a1, f, e, t, a2) CHECK_tab(a1) CHECK_int(f) CHECK_int(e) CHECK_int(t) if a2 == nil then a2 = a1 end CHECK_tab(a2) if e >= f then local d = t - f if t > e or t <= f or a2 ~= a1 then for i=f,e do a2[i+d] = a1[i] end else for i=e,f,-1 do a2[i+d] = a1[i] end end end return a2 end */ LJLIB_CF(table_concat) LJLIB_REC(.) { GCtab *t = lj_lib_checktab(L, 1); GCstr *sep = lj_lib_optstr(L, 2); 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); SBuf *sb = lj_buf_tmp_(L); SBuf *sbx = lj_buf_puttab(sb, t, sep, i, e); if (LJ_UNLIKELY(!sbx)) { /* Error: bad element type. */ int32_t idx = (int32_t)(intptr_t)sb->w; cTValue *o = lj_tab_getint(t, idx); lj_err_callerv(L, LJ_ERR_TABCAT, lj_obj_itypename[o ? itypemap(o) : ~LJ_TNIL], idx); } setstrV(L, L->top-1, lj_buf_str(L, sbx)); lj_gc_check(L); 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 LJLIB_NOREG LJLIB_CF(table_new) LJLIB_REC(.) { int32_t a = lj_lib_checkint(L, 1); int32_t h = lj_lib_checkint(L, 2); lua_createtable(L, a, h); return 1; } LJLIB_NOREG LJLIB_CF(table_clear) LJLIB_REC(.) { lj_tab_clear(lj_lib_checktab(L, 1)); return 0; } static int luaopen_table_new(lua_State *L) { return lj_lib_postreg(L, lj_cf_table_new, FF_table_new, "new"); } static int luaopen_table_clear(lua_State *L) { return lj_lib_postreg(L, lj_cf_table_clear, FF_table_clear, "clear"); } /* ------------------------------------------------------------------------ */ #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 lj_lib_prereg(L, LUA_TABLIBNAME ".new", luaopen_table_new, tabV(L->top-1)); lj_lib_prereg(L, LUA_TABLIBNAME ".clear", luaopen_table_clear, tabV(L->top-1)); return 1; } subprojects/luajit/src/lj_asm.c0000644000175000017500000023376214741067622016125 0ustar aniolaniol/* ** IR assembler (SSA IR -> machine code). ** Copyright (C) 2005-2023 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_buf.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_trace.h" #include "lj_snap.h" #include "lj_asm.h" #include "lj_dispatch.h" #include "lj_vm.h" #include "lj_target.h" #include "lj_prng.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. */ int snapalloc; /* Current snapshot needs allocation. */ BloomFilter snapfilt1, snapfilt2; /* Filled with snapshot refs. */ 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 *mctoporig; /* Original 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 LUAJIT_RANDOM_RA /* Randomize register allocation. OK for fuzz testing, not for production. */ uint64_t prngbits; PRNGState prngstate; #endif #ifdef RID_NUM_KREF intptr_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; #ifdef LUA_USE_ASSERT #define lj_assertA(c, ...) lj_assertG_(J2G(as->J), (c), __VA_ARGS__) #else #define lj_assertA(c, ...) ((void)as) #endif #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); lj_assertA(0, "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); } #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, intptr_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 }; #ifdef LUAJIT_RANDOM_RA /* Return a fixed number of random bits from the local PRNG state. */ static uint32_t ra_random_bits(ASMState *as, uint32_t nbits) { uint64_t b = as->prngbits; uint32_t res = (1u << nbits) - 1u; if (b <= res) b = lj_prng_u64(&as->prngstate) | (1ull << 63); res &= (uint32_t)b; as->prngbits = b >> nbits; return res; } /* Pick a random register from a register set. */ static Reg rset_pickrandom(ASMState *as, RegSet rs) { Reg r = rset_pickbot_(rs); rs >>= r; if (rs > 1) { /* More than one bit set? */ while (1) { /* We need to sample max. the GPR or FPR half of the set. */ uint32_t d = ra_random_bits(as, RSET_BITS-1); if ((rs >> d) & 1) { r += d; break; } } } return r; } #define rset_picktop(rs) rset_pickrandom(as, rs) #define rset_pickbot(rs) rset_pickrandom(as, rs) #else #define rset_picktop(rs) rset_picktop_(rs) #define rset_pickbot(rs) rset_pickbot_(rs) #endif /* -- 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_ARM64 #include "lj_emit_arm64.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 /* Generic load/store of register from/to stack slot. */ #define emit_spload(as, ir, r, ofs) \ emit_loadofs(as, ir, (r), RID_SP, (ofs)) #define emit_spstore(as, ir, r, ofs) \ emit_storeofs(as, ir, (r), RID_SP, (ofs)) /* -- 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++ = '?'; lj_assertA(0, "bad register %d for debug format \"%s\"", r, fmt); } } 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 { lj_assertA(0, "bad debug format code"); } 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); lj_assertA(!rset_test(as->freeset, r), "rematk of free reg %d", r); ra_free(as, r); ra_modified(as, r); #if LJ_64 emit_loadu64(as, r, ra_krefk(as, ref)); #else emit_loadi(as, r, ra_krefk(as, ref)); #endif return r; } ir = IR(ref); r = ir->r; lj_assertA(ra_hasreg(r), "rematk of K%03d has no reg", REF_BIAS - ref); lj_assertA(!ra_hasspill(ir->s), "rematk of K%03d has spill slot [%x]", REF_BIAS - ref, 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_SOFTFP32 if (ir->o == IR_KNUM) { emit_loadk64(as, r, 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) { /* REF_NIL stores ASMREF_L register. */ lj_assertA(irt_isnil(ir->t), "rematk of bad ASMREF_L"); emit_getgl(as, r, cur_L); #if LJ_64 } else if (ir->o == IR_KINT64) { emit_loadu64(as, r, ir_kint64(ir)->u64); #if LJ_GC64 } else if (ir->o == IR_KGC) { emit_loadu64(as, r, (uintptr_t)ir_kgc(ir)); } else if (ir->o == IR_KPTR || ir->o == IR_KKPTR) { emit_loadu64(as, r, (uintptr_t)ir_kptr(ir)); #endif #endif } else { lj_assertA(ir->o == IR_KINT || ir->o == IR_KGC || ir->o == IR_KPTR || ir->o == IR_KKPTR || ir->o == IR_KNULL, "rematk of bad IR op %d", ir->o); 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; lj_assertA(ir >= as->ir + REF_TRUE, "spill of K%03d", REF_BIAS - (int)(ir - as->ir)); 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; lj_assertA(ra_hasreg(r), "release of TMP%d has no reg", ref-ASMREF_TMP1+1); lj_assertA(!ra_hasspill(ir->s), "release of TMP%d has spill slot [%x]", ref-ASMREF_TMP1+1, 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; lj_assertA(ra_hasreg(r), "restore of IR %04d has no reg", ref - REF_BIAS); 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; lj_assertA(allow != RSET_EMPTY, "evict from empty set"); if (RID_NUM_FPR == 0 || allow < RID2RSET(RID_MAX_GPR)) { GPRDEF(MINCOST) } else { FPRDEF(MINCOST) } ref = regcost_ref(cost); lj_assertA(ra_iskref(ref) || (ref >= as->T->nk && ref < as->T->nins), "evict of out-of-range IR %04d", ref - REF_BIAS); /* 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, intptr_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 LJ_64 if (ref < ASMREF_L) { if (ra_iskref(ref)) { if (k == ra_krefk(as, ref)) return r; } else { IRIns *ir = IR(ref); if ((ir->o == IR_KINT64 && k == (int64_t)ir_kint64(ir)->u64) || #if LJ_GC64 #if LJ_TARGET_ARM64 (ir->o == IR_KINT && (uint64_t)k == (uint32_t)ir->i) || #else (ir->o == IR_KINT && k == ir->i) || #endif (ir->o == IR_KGC && k == (intptr_t)ir_kgc(ir)) || ((ir->o == IR_KPTR || ir->o == IR_KKPTR) && k == (intptr_t)ir_kptr(ir)) #else (ir->o != IR_KINT64 && k == ir->i) #endif ) return r; } } #else if (ref < ASMREF_L && k == (ra_iskref(ref) ? ra_krefk(as, ref) : IR(ref)->i)) return r; #endif 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, intptr_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; lj_assertA(ra_noreg(ir->r), "IR %04d already has reg %d", ref - REF_BIAS, 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; } /* Add a register rename to the IR. */ static void ra_addrename(ASMState *as, Reg down, IRRef ref, SnapNo snapno) { IRRef ren; lj_ir_set(as->J, IRT(IR_RENAME, IRT_NIL), ref, snapno); ren = tref_ref(lj_ir_emit(as->J)); as->J->cur.ir[ren].r = (uint8_t)down; as->J->cur.ir[ren].s = SPS_NONE; } /* Rename register allocation and emit move. */ static void ra_rename(ASMState *as, Reg down, Reg up) { IRRef ref = regcost_ref(as->cost[up] = as->cost[down]); IRIns *ir = IR(ref); ir->r = (uint8_t)up; as->cost[down] = 0; lj_assertA((down < RID_MAX_GPR) == (up < RID_MAX_GPR), "rename between GPR/FPR %d and %d", down, up); lj_assertA(!rset_test(as->freeset, down), "rename from free reg %d", down); lj_assertA(rset_test(as->freeset, up), "rename to non-free reg %d", 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. */ /* ** The rename is effective at the subsequent (already emitted) exit ** branch. This is for the current snapshot (as->snapno). Except if we ** haven't yet allocated any refs for the snapshot (as->snapalloc == 1), ** then it belongs to the next snapshot. ** See also the discussion at asm_snap_checkrename(). */ ra_addrename(as, down, ref, as->snapno + as->snapalloc); } } /* 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) { lj_assertA(rset_test(as->freeset, r), "dest reg %d is not free", 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) { /* FP remat needs a load except for +0. Still better than eviction. */ if (tvispzero(ir_knum(ir)) || !(as->freeset & RSET_FPR)) { emit_loadk64(as, dest, ir); return; } #if LJ_64 } else if (ir->o == IR_KINT64) { emit_loadk64(as, dest, ir); return; #if LJ_GC64 } else if (ir->o == IR_KGC || ir->o == IR_KPTR || ir->o == IR_KKPTR) { emit_loadk64(as, dest, ir); return; #endif #endif } else if (ir->o != IR_KPRI) { lj_assertA(ir->o == IR_KINT || ir->o == IR_KGC || ir->o == IR_KPTR || ir->o == IR_KKPTR || ir->o == IR_KNULL, "K%03d has bad IR op %d", REF_BIAS - lref, ir->o); 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 /* 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; IRIns *irx = (LJ_64 && !irt_is64(ir->t)) ? ir+1 : ir; /* 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_X86ORX64 *--as->mcp = XI_XCHGa + RID_RETHI; if (LJ_64 && irt_is64(irx->t)) *--as->mcp = 0x48; #else emit_movrr(as, irx, RID_RETHI, RID_TMP); emit_movrr(as, irx, RID_RETLO, RID_RETHI); emit_movrr(as, irx, RID_TMP, RID_RETLO); #endif } else { emit_movrr(as, irx, RID_RETHI, RID_RETLO); if (desthi != RID_RETHI) emit_movrr(as, irx, desthi, RID_RETHI); } } else if (desthi == RID_RETLO) { emit_movrr(as, irx, RID_RETLO, RID_RETHI); if (destlo != RID_RETLO) emit_movrr(as, irx, destlo, RID_RETLO); } else { if (desthi != RID_RETHI) emit_movrr(as, irx, desthi, RID_RETHI); if (destlo != RID_RETLO) emit_movrr(as, irx, 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); } /* -- 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)) { bloomset(as->snapfilt1, ref); bloomset(as->snapfilt2, hashrot(ref, ref + HASH_BIAS)); if (ra_used(ir)) return; if (ir->r == RID_SINK || ir->r == RID_SUNK) { 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; lj_assertA(ir->o == IR_TNEW || ir->o == IR_TDUP || ir->o == IR_CNEW, "sink of IR %04d has bad op %d", ref - REF_BIAS, ir->o); for (irs = IR(as->snapref-1); irs > ir; irs--) if (irs->r == RID_SINK && asm_sunk_store(as, ir, irs)) { lj_assertA(irs->o == IR_ASTORE || irs->o == IR_HSTORE || irs->o == IR_FSTORE || irs->o == IR_XSTORE, "sunk store IR %04d has bad op %d", (int)(irs - as->ir) - REF_BIAS, irs->o); 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, int snapno) { SnapShot *snap = &as->T->snap[snapno]; SnapEntry *map = &as->T->snapmap[snap->mapofs]; MSize n, nent = snap->nent; as->snapfilt1 = as->snapfilt2 = 0; 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)) { lj_assertA(irt_type(IR(ref+1)->t) == IRT_SOFTFP, "snap %d[%d] points to bad SOFTFP IR %04d", snapno, n, ref - REF_BIAS); 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) { if (bloomtest(as->snapfilt1, ren) && bloomtest(as->snapfilt2, hashrot(ren, ren + HASH_BIAS))) { IRIns *ir = IR(ren); ra_spill(as, ir); /* Register renamed, so force a spill slot. */ RA_DBGX((as, "snaprensp $f $s", ren, ir->s)); return 1; /* Found. */ } return 0; /* Not found. */ } /* Prepare snapshot for next guard or throwing instruction. */ static void asm_snap_prep(ASMState *as) { if (as->snapalloc) { /* Alloc on first invocation for each snapshot. */ as->snapalloc = 0; asm_snap_alloc(as, as->snapno); as->snaprename = as->T->nins; } else { /* Check any renames above the highwater mark. */ for (; as->snaprename < as->T->nins; as->snaprename++) { IRIns *ir = &as->T->ir[as->snaprename]; if (asm_snap_checkrename(as, ir->op1)) ir->op2 = REF_BIAS-1; /* Kill rename. */ } } } /* Move to previous snapshot when we cross the current snapshot ref. */ static void asm_snap_prev(ASMState *as) { if (as->curins < as->snapref) { uintptr_t ofs = (uintptr_t)(as->mctoporig - as->mcp); if (ofs >= 0x10000) lj_trace_err(as->J, LJ_TRERR_MCODEOV); do { if (as->snapno == 0) return; as->snapno--; as->snapref = as->T->snap[as->snapno].ref; as->T->snap[as->snapno].mcofs = (uint16_t)ofs; /* Remember mcode ofs. */ } while (as->curins < as->snapref); /* May have no ins inbetween. */ as->snapalloc = 1; } } /* Fixup snapshot mcode offsetst. */ static void asm_snap_fixup_mcofs(ASMState *as) { uint32_t sz = (uint32_t)(as->mctoporig - as->mcp); SnapShot *snap = as->T->snap; SnapNo i; for (i = as->T->nsnap-1; i > 0; i--) { /* Compute offset from mcode start and store in correct snapshot. */ snap[i].mcofs = (uint16_t)(sz - snap[i-1].mcofs); } snap[0].mcofs = 0; } /* -- Miscellaneous helpers ----------------------------------------------- */ /* 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(ASMState *as, IRIns *ir) { uint32_t lo, hi; UNUSED(as); if (irt_isstr(ir->t)) { return ir_kstr(ir)->sid; } 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)) { lj_assertA(!irt_isnil(ir->t), "hash of nil key"); return irt_type(ir->t)-IRT_FALSE; } else { lj_assertA(irt_isgcv(ir->t), "hash of bad IR type %d", irt_type(ir->t)); lo = u32ptr(ir_kgc(ir)); #if LJ_GC64 hi = (uint32_t)(u64ptr(ir_kgc(ir)) >> 32) | (irt_toitype(ir->t) << 15); #else hi = lo + HASH_BIAS; #endif } 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]; asm_snap_prep(as); 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]; asm_snap_prep(as); 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]; asm_snap_prep(as); 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. */ } /* -- Buffer operations --------------------------------------------------- */ static void asm_tvptr(ASMState *as, Reg dest, IRRef ref, MSize mode); #if LJ_HASBUFFER static void asm_bufhdr_write(ASMState *as, Reg sb); #endif static void asm_bufhdr(ASMState *as, IRIns *ir) { Reg sb = ra_dest(as, ir, RSET_GPR); switch (ir->op2) { case IRBUFHDR_RESET: { Reg tmp = ra_scratch(as, rset_exclude(RSET_GPR, sb)); IRIns irbp; irbp.ot = IRT(0, IRT_PTR); /* Buffer data pointer type. */ emit_storeofs(as, &irbp, tmp, sb, offsetof(SBuf, w)); emit_loadofs(as, &irbp, tmp, sb, offsetof(SBuf, b)); break; } case IRBUFHDR_APPEND: { /* Rematerialize const buffer pointer instead of likely spill. */ IRIns *irp = IR(ir->op1); if (!(ra_hasreg(irp->r) || irp == ir-1 || (irp == ir-2 && !ra_used(ir-1)))) { while (!(irp->o == IR_BUFHDR && irp->op2 == IRBUFHDR_RESET)) irp = IR(irp->op1); if (irref_isk(irp->op1)) { ra_weak(as, ra_allocref(as, ir->op1, RSET_GPR)); ir = irp; } } break; } #if LJ_HASBUFFER case IRBUFHDR_WRITE: asm_bufhdr_write(as, sb); break; #endif default: lj_assertA(0, "bad BUFHDR op2 %d", ir->op2); break; } #if LJ_TARGET_X86ORX64 ra_left(as, sb, ir->op1); #else ra_leftov(as, sb, ir->op1); #endif } static void asm_bufput(ASMState *as, IRIns *ir) { const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_buf_putstr]; IRRef args[3]; IRIns *irs; int kchar = -129; args[0] = ir->op1; /* SBuf * */ args[1] = ir->op2; /* GCstr * */ irs = IR(ir->op2); lj_assertA(irt_isstr(irs->t), "BUFPUT of non-string IR %04d", ir->op2 - REF_BIAS); if (irs->o == IR_KGC) { GCstr *s = ir_kstr(irs); if (s->len == 1) { /* Optimize put of single-char string constant. */ kchar = (int8_t)strdata(s)[0]; /* Signed! */ args[1] = ASMREF_TMP1; /* int, truncated to char */ ci = &lj_ir_callinfo[IRCALL_lj_buf_putchar]; } } else if (mayfuse(as, ir->op2) && ra_noreg(irs->r)) { if (irs->o == IR_TOSTR) { /* Fuse number to string conversions. */ if (irs->op2 == IRTOSTR_NUM) { args[1] = ASMREF_TMP1; /* TValue * */ ci = &lj_ir_callinfo[IRCALL_lj_strfmt_putnum]; } else { lj_assertA(irt_isinteger(IR(irs->op1)->t), "TOSTR of non-numeric IR %04d", irs->op1); args[1] = irs->op1; /* int */ if (irs->op2 == IRTOSTR_INT) ci = &lj_ir_callinfo[IRCALL_lj_strfmt_putint]; else ci = &lj_ir_callinfo[IRCALL_lj_buf_putchar]; } } else if (irs->o == IR_SNEW) { /* Fuse string allocation. */ args[1] = irs->op1; /* const void * */ args[2] = irs->op2; /* MSize */ ci = &lj_ir_callinfo[IRCALL_lj_buf_putmem]; } } asm_setupresult(as, ir, ci); /* SBuf * */ asm_gencall(as, ci, args); if (args[1] == ASMREF_TMP1) { Reg tmp = ra_releasetmp(as, ASMREF_TMP1); if (kchar == -129) asm_tvptr(as, tmp, irs->op1, IRTMPREF_IN1); else ra_allockreg(as, kchar, tmp); } } static void asm_bufstr(ASMState *as, IRIns *ir) { const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_buf_tostr]; IRRef args[1]; args[0] = ir->op1; /* SBuf *sb */ as->gcsteps++; asm_setupresult(as, ir, ci); /* GCstr * */ asm_gencall(as, ci, args); } /* -- Type conversions ---------------------------------------------------- */ static void asm_tostr(ASMState *as, IRIns *ir) { const CCallInfo *ci; IRRef args[2]; asm_snap_prep(as); args[0] = ASMREF_L; as->gcsteps++; if (ir->op2 == IRTOSTR_NUM) { args[1] = ASMREF_TMP1; /* cTValue * */ ci = &lj_ir_callinfo[IRCALL_lj_strfmt_num]; } else { args[1] = ir->op1; /* int32_t k */ if (ir->op2 == IRTOSTR_INT) ci = &lj_ir_callinfo[IRCALL_lj_strfmt_int]; else ci = &lj_ir_callinfo[IRCALL_lj_strfmt_char]; } asm_setupresult(as, ir, ci); /* GCstr * */ asm_gencall(as, ci, args); if (ir->op2 == IRTOSTR_NUM) asm_tvptr(as, ra_releasetmp(as, ASMREF_TMP1), ir->op1, IRTMPREF_IN1); } #if LJ_32 && LJ_HASFFI && !LJ_SOFTFP && !LJ_TARGET_X86 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; IRRef args[2]; lj_assertA((ir-1)->o == IR_CONV && ir->o == IR_HIOP, "not a CONV/HIOP pair at IR %04d", (int)(ir - as->ir) - REF_BIAS); args[LJ_BE] = (ir-1)->op1; args[LJ_LE] = 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); } { #if LJ_TARGET_ARM && !LJ_ABI_SOFTFP CCallInfo cim = lj_ir_callinfo[id], *ci = &cim; cim.flags |= CCI_VARARG; /* These calls don't use the hard-float ABI! */ #else const CCallInfo *ci = &lj_ir_callinfo[id]; #endif asm_setupresult(as, ir, ci); asm_gencall(as, ci, args); } } #endif /* -- Memory references --------------------------------------------------- */ 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; asm_snap_prep(as); 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, IRTMPREF_IN1); } static void asm_tmpref(ASMState *as, IRIns *ir) { Reg r = ra_dest(as, ir, RSET_GPR); asm_tvptr(as, r, ir->op1, ir->op2); } static void asm_lref(ASMState *as, IRIns *ir) { Reg r = ra_dest(as, ir, RSET_GPR); #if LJ_TARGET_X86ORX64 ra_left(as, r, ASMREF_L); #else ra_leftov(as, r, ASMREF_L); #endif } /* -- Calls --------------------------------------------------------------- */ /* Collect arguments from CALL* and CARG instructions. */ static void asm_collectargs(ASMState *as, IRIns *ir, const CCallInfo *ci, IRRef *args) { uint32_t n = CCI_XNARGS(ci); /* Account for split args. */ lj_assertA(n <= CCI_NARGS_MAX*2, "too many args %d to collect", n); if ((ci->flags & CCI_L)) { *args++ = ASMREF_L; n--; } while (n-- > 1) { ir = IR(ir->op1); lj_assertA(ir->o == IR_CARG, "malformed CALL arg tree"); args[n] = ir->op2 == REF_NIL ? 0 : ir->op2; } args[0] = ir->op1 == REF_NIL ? 0 : ir->op1; lj_assertA(IR(ir->op1)->o != IR_CARG, "malformed CALL arg tree"); } /* 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)); } 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_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); } /* -- 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)) { ra_addrename(as, r, lref, as->loopsnapno); } } 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_ARM64 #include "lj_asm_arm64.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 /* -- Common instruction helpers ------------------------------------------ */ #if !LJ_SOFTFP32 #if !LJ_TARGET_X86ORX64 #define asm_ldexp(as, ir) asm_callid(as, ir, IRCALL_ldexp) #endif static void asm_pow(ASMState *as, IRIns *ir) { #if LJ_64 && LJ_HASFFI if (!irt_isnum(ir->t)) asm_callid(as, ir, irt_isi64(ir->t) ? IRCALL_lj_carith_powi64 : IRCALL_lj_carith_powu64); else #endif asm_callid(as, ir, IRCALL_pow); } static void asm_div(ASMState *as, IRIns *ir) { #if LJ_64 && LJ_HASFFI if (!irt_isnum(ir->t)) asm_callid(as, ir, irt_isi64(ir->t) ? IRCALL_lj_carith_divi64 : IRCALL_lj_carith_divu64); else #endif asm_fpdiv(as, ir); } #endif static void asm_mod(ASMState *as, IRIns *ir) { #if LJ_64 && LJ_HASFFI if (!irt_isint(ir->t)) asm_callid(as, ir, irt_isi64(ir->t) ? IRCALL_lj_carith_modi64 : IRCALL_lj_carith_modu64); else #endif asm_callid(as, ir, IRCALL_lj_vm_modi); } static void asm_fuseequal(ASMState *as, IRIns *ir) { /* Fuse HREF + EQ/NE. */ if ((ir-1)->o == IR_HREF && ir->op1 == as->curins-1) { as->curins--; asm_href(as, ir-1, (IROp)ir->o); } else { asm_equal(as, ir); } } static void asm_alen(ASMState *as, IRIns *ir) { asm_callid(as, ir, ir->op2 == REF_NIL ? IRCALL_lj_tab_len : IRCALL_lj_tab_len_hint); } /* -- 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: lj_assertA(!ra_used(ir), "IR %04d not unused", (int)(ir - as->ir) - REF_BIAS); 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; case IR_PROF: asm_prof(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_ABC: asm_comp(as, ir); break; case IR_EQ: case IR_NE: asm_fuseequal(as, ir); break; case IR_RETF: asm_retf(as, ir); break; /* Bit ops. */ case IR_BNOT: asm_bnot(as, ir); break; case IR_BSWAP: asm_bswap(as, ir); break; case IR_BAND: asm_band(as, ir); break; case IR_BOR: asm_bor(as, ir); break; case IR_BXOR: asm_bxor(as, ir); break; case IR_BSHL: asm_bshl(as, ir); break; case IR_BSHR: asm_bshr(as, ir); break; case IR_BSAR: asm_bsar(as, ir); break; case IR_BROL: asm_brol(as, ir); break; case IR_BROR: asm_bror(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_MOD: asm_mod(as, ir); break; case IR_NEG: asm_neg(as, ir); break; #if LJ_SOFTFP32 case IR_DIV: case IR_POW: case IR_ABS: case IR_LDEXP: case IR_FPMATH: case IR_TOBIT: /* Unused for LJ_SOFTFP32. */ lj_assertA(0, "IR %04d with unused op %d", (int)(ir - as->ir) - REF_BIAS, ir->o); break; #else case IR_DIV: asm_div(as, ir); break; case IR_POW: asm_pow(as, ir); break; case IR_ABS: asm_abs(as, ir); break; case IR_LDEXP: asm_ldexp(as, ir); break; case IR_FPMATH: asm_fpmath(as, ir); break; case IR_TOBIT: asm_tobit(as, ir); break; #endif case IR_MIN: asm_min(as, ir); break; case IR_MAX: asm_max(as, ir); break; /* Overflow-checking arithmetic ops. */ case IR_ADDOV: asm_addov(as, ir); break; case IR_SUBOV: asm_subov(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, 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_TMPREF: asm_tmpref(as, ir); break; case IR_STRREF: asm_strref(as, ir); break; case IR_LREF: asm_lref(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_ALEN: asm_alen(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); 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: #if LJ_HASFFI asm_cnew(as, ir); #else lj_assertA(0, "IR %04d with unused op %d", (int)(ir - as->ir) - REF_BIAS, ir->o); #endif break; /* Buffer operations. */ case IR_BUFHDR: asm_bufhdr(as, ir); break; case IR_BUFPUT: asm_bufput(as, ir); break; case IR_BUFSTR: asm_bufstr(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_CALLA: as->gcsteps++; /* fallthrough */ 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; } } /* -- 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. */ RegSet pallow = RSET_GPR; /* Registers needed by the parent stack check. */ Reg pbase; 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. */ asm_snap_alloc(as, 0); } pbase = asm_head_side_base(as, irp); if (pbase != RID_NONE) { rset_clear(allow, pbase); rset_clear(pallow, pbase); } /* Scan all parent SLOADs and collect register dependencies. */ for (i = as->stopins; i > REF_BASE; i--) { IRIns *ir = IR(i); RegSP rs; lj_assertA((ir->o == IR_SLOAD && (ir->op2 & IRSLOAD_PARENT)) || (LJ_SOFTFP && ir->o == IR_HIOP) || ir->o == IR_PVAL, "IR %04d has bad parent op %d", (int)(ir - as->ir) - REF_BIAS, ir->o); 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. */ } if (!ra_hasspill(regsp_spill(rs))) rset_clear(pallow, regsp_reg(rs)); } /* 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, pallow, 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) - LJ_FR2; } } 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; } #if LJ_GC64 emit_loadu64(as, RID_LPC, u64ptr(pc)); #else ra_allockreg(as, i32ptr(J2GG(as->J)->dispatch), RID_DISPATCH); ra_allockreg(as, i32ptr(pc), RID_LPC); #endif mres = (int32_t)(snap->nslots - baseslot - LJ_FR2); switch (bc_op(*pc)) { case BC_CALLM: case BC_CALLMT: mres -= (int32_t)(1 + LJ_FR2 + 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); if (as->J->ktrace) { /* Patch ktrace slot with the final GCtrace pointer. */ setgcref(IR(as->J->ktrace)[LJ_GC64].gcr, obj2gco(as->J->curfinal)); IR(as->J->ktrace)->o = IR_KGC; } /* 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); #if LJ_TARGET_ARM64 ra_setkref(as, RID_GL, (intptr_t)J2G(as->J)); #endif /* Clear reg/sp for constants. */ for (ir = IR(T->nk), lastir = IR(REF_BASE); ir < lastir; ir++) { ir->prev = REGSP_INIT; if (irt_is64(ir->t) && ir->o != IR_KNULL) { #if LJ_GC64 /* The false-positive of irt_is64() for ASMREF_L (REF_NIL) is OK here. */ ir->i = 0; /* Will become non-zero only for RIP-relative addresses. */ #else /* Make life easier for backends by putting address of constant in i. */ ir->i = (int32_t)(intptr_t)(ir+1); #endif ir++; } } /* REF_BASE is used for implicit references to the BASE register. */ lastir->prev = REGSP_HINT(RID_BASE); as->snaprename = nins; as->snapref = nins; as->snapno = T->nsnap; as->snapalloc = 0; 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->J, 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; case IR_TMPREF: if ((ir->op2 & IRTMPREF_OUT2) && as->evenspill < 4) as->evenspill = 4; /* TMPREF OUT2 needs two TValues on the stack. */ break; #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_CALLL: /* lj_vm_next needs two TValues on the stack. */ #if LJ_TARGET_X64 && LJ_ABI_WIN if (ir->op2 == IRCALL_lj_vm_next && as->evenspill < SPS_FIRST + 4) as->evenspill = SPS_FIRST + 4; #else if (SPS_FIRST < 4 && ir->op2 == IRCALL_lj_vm_next && as->evenspill < 4) as->evenspill = 4; #endif /* fallthrough */ case IR_CALLN: case IR_CALLA: 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; } 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 && LJ_32 && LJ_HASFFI case IR_CONV: if (irt_isfp((ir-1)->t)) { ir->prev = REGSP_HINT(RID_FPRET); continue; } #endif /* fallthrough */ case IR_CALLN: case IR_CALLL: case IR_CALLS: 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; #if LJ_SOFTFP case IR_MIN: case IR_MAX: if ((ir+1)->o != IR_HIOP) break; #endif /* fallthrough */ /* C calls evict all scratch regs and return results in RID_RET. */ case IR_SNEW: case IR_XSNEW: case IR_NEWREF: case IR_BUFPUT: if (REGARG_NUMGPR < 3 && as->evenspill < 3) as->evenspill = 3; /* lj_str_new and lj_tab_newkey need 3 args. */ #if LJ_TARGET_X86 && LJ_HASFFI if (0) { case IR_CNEW: if (ir->op2 != REF_NIL && as->evenspill < 4) as->evenspill = 4; /* lj_cdata_newv needs 4 args. */ } /* fallthrough */ #else /* fallthrough */ case IR_CNEW: #endif /* fallthrough */ case IR_TNEW: case IR_TDUP: case IR_CNEWI: case IR_TOSTR: case IR_BUFSTR: 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_SOFTFP #if !LJ_TARGET_X86ORX64 case IR_LDEXP: #endif #endif /* fallthrough */ case IR_POW: if (!LJ_SOFTFP && irt_isnum(ir->t)) { if (inloop) as->modset |= RSET_SCRATCH; #if LJ_TARGET_X86 if (irt_isnum(IR(ir->op2)->t)) { if (as->evenspill < 4) /* Leave room to call pow(). */ as->evenspill = 4; } break; #else ir->prev = REGSP_HINT(RID_FPRET); continue; #endif } /* fallthrough */ /* for integer POW */ case IR_DIV: case IR_MOD: if ((LJ_64 && LJ_SOFTFP) || !irt_isnum(ir->t)) { ir->prev = REGSP_HINT(RID_RET); if (inloop) as->modset |= (RSET_SCRATCH & RSET_GPR); continue; } break; #if LJ_64 && LJ_SOFTFP case IR_ADD: case IR_SUB: case IR_MUL: if (irt_isnum(ir->t)) { ir->prev = REGSP_HINT(RID_RET); if (inloop) as->modset |= (RSET_SCRATCH & RSET_GPR); continue; } break; #endif case IR_FPMATH: #if LJ_TARGET_X86ORX64 if (ir->op2 <= IRFPM_TRUNC) { if (!(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; } #endif if (inloop) as->modset |= RSET_SCRATCH; #if LJ_TARGET_X86 break; #else ir->prev = REGSP_HINT(RID_FPRET); 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: if ((as->flags & JIT_F_BMI2)) /* Except if BMI2 is available. */ break; /* fallthrough */ 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_; /* Remove nops/renames left over from ASM restart due to LJ_TRERR_MCODELM. */ { IRRef nins = T->nins; IRIns *ir = &T->ir[nins-1]; if (ir->o == IR_NOP || ir->o == IR_RENAME) { do { ir--; nins--; } while (ir->o == IR_NOP || ir->o == IR_RENAME); T->nins = nins; } } /* Ensure an initialized instruction beyond the last one for HIOP checks. */ /* This also allows one RENAME to be added without reallocating curfinal. */ as->orignins = lj_ir_nextins(J); lj_ir_nop(&J->cur.ir[as->orignins]); /* Setup initial state. Copy some fields to reduce indirections. */ as->J = J; as->T = T; J->curfinal = lj_trace_alloc(J->L, T); /* This copies the IR, too. */ as->flags = J->flags; as->loopref = J->loopref; as->realign = NULL; as->loopinv = 0; as->parent = J->parent ? traceref(J, J->parent) : NULL; #ifdef LUAJIT_RANDOM_RA (void)lj_prng_u64(&J2G(J)->prng); /* Ensure PRNG step between traces. */ #endif /* Reserve MCode memory. */ as->mctop = as->mctoporig = lj_mcode_reserve(J, &as->mcbot); as->mcp = as->mctop; as->mclim = as->mcbot + MCLIM_REDZONE; asm_setup_target(as); /* ** This is a loop, because the MCode may have to be (re-)assembled ** multiple times: ** ** 1. as->realign is set (and the assembly aborted), if the arch-specific ** backend wants the MCode to be aligned differently. ** ** This is currently only the case on x86/x64, where small loops get ** an aligned loop body plus a short branch. Not much effort is wasted, ** because the abort happens very quickly and only once. ** ** 2. The IR is immovable, since the MCode embeds pointers to various ** constants inside the IR. But RENAMEs may need to be added to the IR ** during assembly, which might grow and reallocate the IR. We check ** at the end if the IR (in J->cur.ir) has actually grown, resize the ** copy (in J->curfinal.ir) and try again. ** ** 95% of all traces have zero RENAMEs, 3% have one RENAME, 1.5% have ** 2 RENAMEs and only 0.5% have more than that. That's why we opt to ** always have one spare slot in the IR (see above), which means we ** have to redo the assembly for only ~2% of all traces. ** ** Very, very rarely, this needs to be done repeatedly, since the ** location of constants inside the IR (actually, reachability from ** a global pointer) may affect register allocation and thus the ** number of RENAMEs. */ for (;;) { as->mcp = as->mctop; #ifdef LUA_USE_ASSERT as->mcp_prev = as->mcp; #endif as->ir = J->curfinal->ir; /* Use the copied IR. */ as->curins = J->cur.nins = as->orignins; #ifdef LUAJIT_RANDOM_RA as->prngstate = J2G(J)->prng; /* Must (re)start from identical state. */ as->prngbits = 0; #endif 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); /* 64 bit types handled by SPLIT for 32 bit archs. */ lj_assertA(!(LJ_32 && irt_isint64(ir->t)), "IR %04d has unsplit 64 bit type", (int)(ir - as->ir) - REF_BIAS); asm_snap_prev(as); 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); } if (as->realign && J->curfinal->nins >= T->nins) continue; /* Retry in case only 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); as->curins = as->stopins; } ra_evictk(as); if (as->parent) asm_head_side(as); else asm_head_root(as); asm_phi_fixup(as); if (J->curfinal->nins >= T->nins) { /* IR didn't grow? */ lj_assertA(J->curfinal->nk == T->nk, "unexpected IR constant growth"); memcpy(J->curfinal->ir + as->orignins, T->ir + as->orignins, (T->nins - as->orignins) * sizeof(IRIns)); /* Copy RENAMEs. */ T->nins = J->curfinal->nins; /* Fill mcofs of any unprocessed snapshots. */ as->curins = REF_FIRST; asm_snap_prev(as); break; /* Done. */ } /* Otherwise try again with a bigger IR. */ lj_trace_free(J2G(J), J->curfinal); J->curfinal = NULL; /* In case lj_trace_alloc() OOMs. */ J->curfinal = lj_trace_alloc(J->L, T); as->realign = NULL; } 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_loop_tail_fixup(as); else asm_tail_fixup(as, T->link); /* Note: this may change as->mctop! */ T->szmcode = (MSize)((char *)as->mctop - (char *)as->mcp); asm_snap_fixup_mcofs(as); #if LJ_TARGET_MCODE_FIXUP asm_mcode_fixup(T->mcode, T->szmcode); #endif lj_mcode_sync(T->mcode, as->mctoporig); } #undef IR #endif subprojects/luajit/src/psvitabuild.bat0000644000175000017500000000627714741067622017531 0ustar aniolaniol@rem Script to build LuaJIT with the PS Vita SDK. @rem Donated to the public domain. @rem @rem Open a "Visual Studio .NET Command Prompt" (32 bit host compiler) @rem Then cd to this directory and run this script. @if not defined INCLUDE goto :FAIL @if not defined SCE_PSP2_SDK_DIR goto :FAIL @setlocal @rem ---- Host compiler ---- @set LJCOMPILE=cl /nologo /c /MD /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE @set LJLINK=link /nologo @set LJMT=mt /nologo @set DASMDIR=..\dynasm @set DASM=%DASMDIR%\dynasm.lua @set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c lib_buffer.c %LJCOMPILE% host\minilua.c @if errorlevel 1 goto :BAD %LJLINK% /out:minilua.exe minilua.obj @if errorlevel 1 goto :BAD if exist minilua.exe.manifest^ %LJMT% -manifest minilua.exe.manifest -outputresource:minilua.exe @rem Check for 32 bit host compiler. @minilua @if errorlevel 8 goto :FAIL @set DASMFLAGS=-D FPU -D HFABI minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_arm.dasc @if errorlevel 1 goto :BAD if exist ..\.git ( git show -s --format=%%ct >luajit_relver.txt ) else ( type ..\.relver >luajit_relver.txt ) minilua host\genversion.lua %LJCOMPILE% /I "." /I %DASMDIR% -DLUAJIT_TARGET=LUAJIT_ARCH_ARM -DLUAJIT_OS=LUAJIT_OS_OTHER -DLUAJIT_DISABLE_JIT -DLUAJIT_DISABLE_FFI -DLJ_TARGET_PSVITA=1 host\buildvm*.c @if errorlevel 1 goto :BAD %LJLINK% /out:buildvm.exe buildvm*.obj @if errorlevel 1 goto :BAD if exist buildvm.exe.manifest^ %LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe buildvm -m elfasm -o lj_vm.s @if errorlevel 1 goto :BAD buildvm -m bcdef -o lj_bcdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m ffdef -o lj_ffdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m libdef -o lj_libdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m recdef -o lj_recdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m vmdef -o jit\vmdef.lua %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m folddef -o lj_folddef.h lj_opt_fold.c @if errorlevel 1 goto :BAD @rem ---- Cross compiler ---- @set LJCOMPILE="%SCE_PSP2_SDK_DIR%\host_tools\build\bin\psp2snc" -c -w -DLUAJIT_DISABLE_FFI -DLUAJIT_USE_SYSMALLOC @set LJLIB="%SCE_PSP2_SDK_DIR%\host_tools\build\bin\psp2ld32" -r --output= @set INCLUDE="" "%SCE_PSP2_SDK_DIR%\host_tools\build\bin\psp2as" -o lj_vm.o lj_vm.s @if "%1" neq "debug" goto :NODEBUG @shift @set LJCOMPILE=%LJCOMPILE% -g -O0 @set TARGETLIB=libluajitD.a goto :BUILD :NODEBUG @set LJCOMPILE=%LJCOMPILE% -O2 @set TARGETLIB=libluajit.a :BUILD del %TARGETLIB% %LJCOMPILE% ljamalg.c @if errorlevel 1 goto :BAD %LJLIB%%TARGETLIB% ljamalg.o lj_vm.o @if errorlevel 1 goto :BAD @del *.o *.obj *.manifest minilua.exe buildvm.exe @echo. @echo === Successfully built LuaJIT for PS Vita === @goto :END :BAD @echo. @echo ******************************************************* @echo *** Build FAILED -- Please check the error messages *** @echo ******************************************************* @goto :END :FAIL @echo To run this script you must open a "Visual Studio .NET Command Prompt" @echo (32 bit host compiler). The PS Vita SDK must be installed, too. :END subprojects/luajit/src/lj_dispatch.h0000644000175000017500000001247114741067622017141 0ustar aniolaniol/* ** Instruction dispatch handling. ** Copyright (C) 2005-2023 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. */ #ifndef _LJ_VM_H LJ_ASMF int32_t LJ_FASTCALL lj_vm_modi(int32_t a, int32_t b); #endif #if LJ_SOFTFP #ifndef _LJ_IRCALL_H extern double __adddf3(double a, double b); extern double __subdf3(double a, double b); extern double __muldf3(double a, double b); extern double __divdf3(double a, double b); #endif #define SFGOTDEF(_) _(sqrt) _(__adddf3) _(__subdf3) _(__muldf3) _(__divdf3) #else #define SFGOTDEF(_) #endif #if LJ_HASJIT #define JITGOTDEF(_) _(lj_err_trace) _(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_vm_modi) \ _(lj_dispatch_call) _(lj_dispatch_ins) _(lj_dispatch_stitch) \ _(lj_dispatch_profile) _(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_istype) _(lj_meta_len) _(lj_meta_tget) \ _(lj_meta_tset) _(lj_state_growstack) _(lj_strfmt_number) \ _(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) \ _(lj_tab_setinth) _(lj_buf_putstr_reverse) _(lj_buf_putstr_lower) \ _(lj_buf_putstr_upper) _(lj_buf_tostr) \ JITGOTDEF(_) FFIGOTDEF(_) SFGOTDEF(_) 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 57 #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_ARM && !LJ_TARGET_NX /* Make g reachable via K12 encoded DISPATCH-relative addressing. */ uint8_t align1[(16-sizeof(global_State))&15]; #endif #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. */ #if LJ_TARGET_ARM && !LJ_TARGET_NX /* Ditto for J. */ uint8_t align2[(16-sizeof(jit_State)-sizeof(HotCount)*HOTCOUNT_SIZE)&15]; #endif #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_G2J (GG_OFS(J) - GG_OFS(g)) #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); #if LJ_HASJIT LJ_FUNCA void LJ_FASTCALL lj_dispatch_stitch(jit_State *J, const BCIns *pc); #endif #if LJ_HASPROFILE LJ_FUNCA void LJ_FASTCALL lj_dispatch_profile(lua_State *L, const BCIns *pc); #endif #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 subprojects/luajit/src/lj_udata.c0000644000175000017500000000333514741067622016432 0ustar aniolaniol/* ** Userdata handling. ** Copyright (C) 2005-2023 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_err.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)); } #if LJ_64 void *lj_lightud_intern(lua_State *L, void *p) { global_State *g = G(L); uint64_t u = (uint64_t)p; uint32_t up = lightudup(u); uint32_t *segmap = mref(g->gc.lightudseg, uint32_t); MSize segnum = g->gc.lightudnum; if (segmap) { MSize seg; for (seg = 0; seg <= segnum; seg++) if (segmap[seg] == up) /* Fast path. */ return (void *)(((uint64_t)seg << LJ_LIGHTUD_BITS_LO) | lightudlo(u)); segnum++; /* Leave last segment unused to avoid clash with ITERN key. */ if (segnum >= (1 << LJ_LIGHTUD_BITS_SEG)-1) lj_err_msg(L, LJ_ERR_BADLU); } if (!((segnum-1) & segnum) && segnum != 1) { lj_mem_reallocvec(L, segmap, segnum, segnum ? 2*segnum : 2u, uint32_t); setmref(g->gc.lightudseg, segmap); } g->gc.lightudnum = segnum; segmap[segnum] = up; return (void *)(((uint64_t)segnum << LJ_LIGHTUD_BITS_LO) | lightudlo(u)); } #endif subprojects/luajit/src/lj_debug.h0000644000175000017500000000362714741067622016433 0ustar aniolaniol/* ** Debugging and introspection. ** Copyright (C) 2005-2023 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, GCobj **op); 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, cTValue *frame, const char **name); LJ_FUNC void lj_debug_shortname(char *out, GCstr *str, BCLine line); 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); #if LJ_HASPROFILE LJ_FUNC void lj_debug_dumpstack(lua_State *L, SBuf *sb, const char *fmt, int depth); #endif /* 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 subprojects/luajit/src/lj_def.h0000644000175000017500000002753214741067622016104 0ustar aniolaniol/* ** LuaJIT common internal definitions. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #ifndef _LJ_DEF_H #define _LJ_DEF_H #include "lua.h" #if defined(_MSC_VER) && (_MSC_VER < 1700) /* Old 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_MEM32 0x7fffff00 /* Max. 32 bit memory allocation. */ #define LJ_MAX_MEM64 ((uint64_t)1<<47) /* Max. 64 bit memory allocation. */ /* Max. total memory allocation. */ #define LJ_MAX_MEM (LJ_GC64 ? LJ_MAX_MEM64 : LJ_MAX_MEM32) #define LJ_MAX_ALLOC LJ_MAX_MEM /* Max. individual allocation length. */ #define LJ_MAX_STR LJ_MAX_MEM32 /* Max. string length. */ #define LJ_MAX_BUF LJ_MAX_MEM32 /* Max. buffer length. */ #define LJ_MAX_UDATA LJ_MAX_MEM32 /* 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_MEM32 /* 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+3*LJ_FR2) /* 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. */ /* 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 i64ptr(p) ((int64_t)(intptr_t)(void *)(p)) #define u64ptr(p) ((uint64_t)(intptr_t)(void *)(p)) #define igcptr(p) (LJ_GC64 ? i64ptr(p) : i32ptr(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 checkptr31(x) (((uint64_t)(uintptr_t)(x) >> 31) == 0) #define checkptr32(x) ((uintptr_t)(x) == (uint32_t)(uintptr_t)(x)) #define checkptr47(x) (((uint64_t)(uintptr_t)(x) >> 47) == 0) #define checkptrGC(x) (LJ_GC64 ? checkptr47((x)) : LJ_64 ? checkptr31((x)) :1) /* 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(__clang__) || 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)) #define lj_fls(x) ((uint32_t)(__builtin_clz(x)^31)) #define lj_ffs64(x) ((uint32_t)__builtin_ctzll(x)) #define lj_fls64(x) ((uint32_t)(__builtin_clzll(x)^63)) #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) || __clang__ 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(unsigned long *, unsigned long); unsigned char _BitScanReverse(unsigned long *, unsigned long); #pragma intrinsic(_BitScanForward) #pragma intrinsic(_BitScanReverse) static LJ_AINLINE uint32_t lj_ffs(uint32_t x) { unsigned long r; _BitScanForward(&r, x); return (uint32_t)r; } static LJ_AINLINE uint32_t lj_fls(uint32_t x) { unsigned long r; _BitScanReverse(&r, x); return (uint32_t)r; } #if defined(_M_X64) || defined(_M_ARM64) unsigned char _BitScanForward64(unsigned long *, uint64_t); unsigned char _BitScanReverse64(unsigned long *, uint64_t); #pragma intrinsic(_BitScanForward64) #pragma intrinsic(_BitScanReverse64) static LJ_AINLINE uint32_t lj_ffs64(uint64_t x) { unsigned long r; _BitScanForward64(&r, x); return (uint32_t)r; } static LJ_AINLINE uint32_t lj_fls64(uint64_t x) { unsigned long r; _BitScanReverse64(&r, x); return (uint32_t)r; } #endif #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 /* Internal assertions. */ #if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK) #define lj_assert_check(g, c, ...) \ ((c) ? (void)0 : \ (lj_assert_fail((g), __FILE__, __LINE__, __func__, __VA_ARGS__), 0)) #define lj_checkapi(c, ...) lj_assert_check(G(L), (c), __VA_ARGS__) #else #define lj_checkapi(c, ...) ((void)L) #endif #ifdef LUA_USE_ASSERT #define lj_assertG_(g, c, ...) lj_assert_check((g), (c), __VA_ARGS__) #define lj_assertG(c, ...) lj_assert_check(g, (c), __VA_ARGS__) #define lj_assertL(c, ...) lj_assert_check(G(L), (c), __VA_ARGS__) #define lj_assertX(c, ...) lj_assert_check(NULL, (c), __VA_ARGS__) #define check_exp(c, e) (lj_assertX((c), #c), (e)) #else #define lj_assertG_(g, c, ...) ((void)0) #define lj_assertG(c, ...) ((void)g) #define lj_assertL(c, ...) ((void)L) #define lj_assertX(c, ...) ((void)0) #define check_exp(c, e) (e) #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 /* PRNG state. Need this here, details in lj_prng.h. */ typedef struct PRNGState { uint64_t u[4]; } PRNGState; #endif subprojects/luajit/src/lj_jit.h0000644000175000017500000004267114741067622016135 0ustar aniolaniol/* ** Common definitions for the JIT compiler. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #ifndef _LJ_JIT_H #define _LJ_JIT_H #include "lj_obj.h" #if LJ_HASJIT #include "lj_ir.h" /* -- JIT engine flags ---------------------------------------------------- */ /* General JIT engine flags. 4 bits. */ #define JIT_F_ON 0x00000001 /* CPU-specific JIT engine flags. 12 bits. Flags and strings must match. */ #define JIT_F_CPU 0x00000010 #if LJ_TARGET_X86ORX64 #define JIT_F_SSE3 (JIT_F_CPU << 0) #define JIT_F_SSE4_1 (JIT_F_CPU << 1) #define JIT_F_BMI2 (JIT_F_CPU << 2) #define JIT_F_CPUSTRING "\4SSE3\6SSE4.1\4BMI2" #elif LJ_TARGET_ARM #define JIT_F_ARMV6_ (JIT_F_CPU << 0) #define JIT_F_ARMV6T2_ (JIT_F_CPU << 1) #define JIT_F_ARMV7 (JIT_F_CPU << 2) #define JIT_F_ARMV8 (JIT_F_CPU << 3) #define JIT_F_VFPV2 (JIT_F_CPU << 4) #define JIT_F_VFPV3 (JIT_F_CPU << 5) #define JIT_F_ARMV6 (JIT_F_ARMV6_|JIT_F_ARMV6T2_|JIT_F_ARMV7|JIT_F_ARMV8) #define JIT_F_ARMV6T2 (JIT_F_ARMV6T2_|JIT_F_ARMV7|JIT_F_ARMV8) #define JIT_F_VFP (JIT_F_VFPV2|JIT_F_VFPV3) #define JIT_F_CPUSTRING "\5ARMv6\7ARMv6T2\5ARMv7\5ARMv8\5VFPv2\5VFPv3" #elif LJ_TARGET_PPC #define JIT_F_SQRT (JIT_F_CPU << 0) #define JIT_F_ROUND (JIT_F_CPU << 1) #define JIT_F_CPUSTRING "\4SQRT\5ROUND" #elif LJ_TARGET_MIPS #define JIT_F_MIPSXXR2 (JIT_F_CPU << 0) #if LJ_TARGET_MIPS32 #if LJ_TARGET_MIPSR6 #define JIT_F_CPUSTRING "\010MIPS32R6" #else #define JIT_F_CPUSTRING "\010MIPS32R2" #endif #else #if LJ_TARGET_MIPSR6 #define JIT_F_CPUSTRING "\010MIPS64R6" #else #define JIT_F_CPUSTRING "\010MIPS64R2" #endif #endif #else #define JIT_F_CPUSTRING "" #endif /* Optimization flags. 12 bits. */ #define JIT_F_OPT 0x00010000 #define JIT_F_OPT_MASK 0x0fff0000 #define JIT_F_OPT_FOLD (JIT_F_OPT << 0) #define JIT_F_OPT_CSE (JIT_F_OPT << 1) #define JIT_F_OPT_DCE (JIT_F_OPT << 2) #define JIT_F_OPT_FWD (JIT_F_OPT << 3) #define JIT_F_OPT_DSE (JIT_F_OPT << 4) #define JIT_F_OPT_NARROW (JIT_F_OPT << 5) #define JIT_F_OPT_LOOP (JIT_F_OPT << 6) #define JIT_F_OPT_ABC (JIT_F_OPT << 7) #define JIT_F_OPT_SINK (JIT_F_OPT << 8) #define JIT_F_OPT_FUSE (JIT_F_OPT << 9) #define JIT_F_OPT_FMA (JIT_F_OPT << 10) /* Optimizations names for -O. Must match the order above. */ #define JIT_F_OPTSTRING \ "\4fold\3cse\3dce\3fwd\3dse\6narrow\4loop\3abc\4sink\4fuse\3fma" /* 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 /* Note: FMA is not set by default. */ /* -- JIT engine parameters ----------------------------------------------- */ #if LJ_TARGET_WINDOWS || LJ_64 /* See: https://devblogs.microsoft.com/oldnewthing/20031008-00/?p=42223 */ #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. */ \ _(\011, minstitch, 0) /* Min. # of IR ins for a stitched 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) /* -- JIT engine data structures ------------------------------------------ */ /* Trace compiler state. */ typedef enum { LJ_TRACE_IDLE, /* Trace compiler idle. */ LJ_TRACE_ACTIVE = 0x10, LJ_TRACE_RECORD, /* Bytecode recording active. */ LJ_TRACE_RECORD_1ST, /* Record 1st instruction, too. */ 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 /* Linked list of MCode areas. */ typedef struct MCLink { MCode *next; /* Next area. */ size_t size; /* Size of current area. */ } MCLink; /* Stack snapshot header. */ typedef struct SnapShot { uint32_t mapofs; /* Offset into snapshot map. */ IRRef1 ref; /* First IR ref for this snapshot. */ uint16_t mcofs; /* Offset into machine code in MCode units. */ 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. */ #define SNAP_KEYINDEX 0x100000 /* Traversal key index. */ LJ_STATIC_ASSERT(SNAP_FRAME == TREF_FRAME); LJ_STATIC_ASSERT(SNAP_CONT == TREF_CONT); LJ_STATIC_ASSERT(SNAP_KEYINDEX == TREF_KEYINDEX); #define SNAP(slot, flags, ref) (((SnapEntry)(slot) << 24) + (flags) + (ref)) #define SNAP_TR(slot, tr) \ (((SnapEntry)(slot) << 24) + \ ((tr) & (TREF_KEYINDEX|TREF_CONT|TREF_FRAME|TREF_REFMASK))) #if !LJ_FR2 #define SNAP_MKPC(pc) ((SnapEntry)u32ptr(pc)) #endif #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_setref(sn, ref) (((sn) & (0xffff0000&~SNAP_NORESTORE)) | (ref)) static LJ_AINLINE const BCIns *snap_pc(SnapEntry *sn) { #if LJ_FR2 uint64_t pcbase; memcpy(&pcbase, sn, sizeof(uint64_t)); return (const BCIns *)(pcbase >> 8); #else return (const BCIns *)(uintptr_t)*sn; #endif } /* 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. */ LJ_TRLINK_STITCH /* Trace stitching. */ } TraceLink; /* Trace object. */ typedef struct GCtrace { GCHeader; uint16_t nsnap; /* Number of snapshots. */ IRRef nins; /* Next IR instruction. Biased with REF_BIAS. */ #if LJ_GC64 uint32_t unused_gc64; #endif GCRef gclist; IRIns *ir; /* IR instructions/constants. Biased with REF_BIAS. */ IRRef nk; /* Lowest IR constant. Biased with REF_BIAS. */ uint32_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. */ #if LJ_ABI_PAUTH ASMFunction mcauth; /* Start of machine code, with ptr auth applied. */ #endif 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 topslot; /* Top stack slot already checked to be allocated. */ uint8_t linktype; /* Type of link. */ 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; /* Reverse bytecode map (IRRef -> PC). Only for selected instructions. */ typedef struct RBCHashEntry { MRef pc; /* Bytecode PC. */ GCRef pt; /* Prototype. */ IRRef ref; /* IR reference. */ } RBCHashEntry; /* Number of slots in the reverse bytecode hash table. Must be a power of 2. */ #define RBCHASH_SLOTS 8 /* 128 bit SIMD constants. */ enum { LJ_KSIMD_ABS, LJ_KSIMD_NEG, LJ_KSIMD__MAX }; enum { #if LJ_TARGET_X86ORX64 LJ_K64_TOBIT, /* 2^52 + 2^51 */ LJ_K64_2P64, /* 2^64 */ LJ_K64_M2P64, /* -2^64 */ #if LJ_32 LJ_K64_M2P64_31, /* -2^64 or -2^31 */ #else LJ_K64_M2P64_31 = LJ_K64_M2P64, #endif #endif #if LJ_TARGET_MIPS LJ_K64_2P31, /* 2^31 */ #if LJ_64 LJ_K64_2P63, /* 2^63 */ LJ_K64_M2P64, /* -2^64 */ #endif #endif LJ_K64__MAX, }; #define LJ_K64__USED (LJ_TARGET_X86ORX64 || LJ_TARGET_MIPS) enum { #if LJ_TARGET_X86ORX64 LJ_K32_M2P64_31, /* -2^64 or -2^31 */ #endif #if LJ_TARGET_PPC LJ_K32_2P52_2P31, /* 2^52 + 2^31 */ LJ_K32_2P52, /* 2^52 */ #endif #if LJ_TARGET_PPC || LJ_TARGET_MIPS LJ_K32_2P31, /* 2^31 */ #endif #if LJ_TARGET_MIPS64 LJ_K32_2P63, /* 2^63 */ LJ_K32_M2P64, /* -2^64 */ #endif LJ_K32__MAX }; #define LJ_K32__USED (LJ_TARGET_X86ORX64 || LJ_TARGET_PPC || LJ_TARGET_MIPS) /* 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_SOFTFP32 || (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[2]; /* Instruction referenced by left operand. */ IRIns right[2]; /* Instruction referenced by right operand. */ } FoldState; /* JIT compiler state. */ typedef struct jit_State { GCtrace cur; /* Current trace. */ GCtrace *curfinal; /* Final address of current trace (set during asm). */ 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). */ #if LJ_K32__USED uint32_t k32[LJ_K32__MAX]; /* Common 4 byte constants used by backends. */ #endif TValue ksimd[LJ_KSIMD__MAX*2+1]; /* 16 byte aligned SIMD constants. */ #if LJ_K64__USED TValue k64[LJ_K64__MAX]; /* Common 8 byte constants. */ #endif IRIns *irbuf; /* Temp. IR instruction buffer. Biased with REF_BIAS. */ IRRef irtoplim; /* Upper limit of instruction buffer (biased). */ IRRef irbotlim; /* Lower limit of instruction 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_SOFTFP32 || (LJ_32 && LJ_HASFFI) uint8_t needsplit; /* Need SPLIT pass. */ #endif uint8_t retryrec; /* Retry recording. */ GCRef *trace; /* Array of traces. */ TraceNo freetrace; /* Start of scan for next free trace. */ MSize sizetrace; /* Size of trace array. */ IRRef1 ktrace; /* Reference to KGC with GCtrace. */ 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. */ #ifdef LUAJIT_ENABLE_TABLE_BUMP RBCHashEntry rbchash[RBCHASH_SLOTS]; /* Reverse bytecode map. */ #endif 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. */ int exitcode; /* Exit code from unwound 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_HASPROFILE GCproto *prev_pt; /* Previous prototype. */ BCLine prev_line; /* Previous line. */ int prof_mode; /* Profiling mode: 0, 'f', 'l'. */ #endif } jit_State; #ifdef LUA_USE_ASSERT #define lj_assertJ(c, ...) lj_assertG_(J2G(J), (c), __VA_ARGS__) #else #define lj_assertJ(c, ...) ((void)J) #endif #endif #endif subprojects/luajit/src/lj_emit_arm.h0000644000175000017500000002573214741067622017143 0ustar aniolaniol/* ** ARM instruction emitter. ** Copyright (C) 2005-2023 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) { lj_assertA(ofs >= -255 && ofs <= 255, "load/store offset %d out of range", ofs); 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) { lj_assertA(ofs >= -4095 && ofs <= 4095, "load/store offset %d out of range", ofs); /* 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) { lj_assertA(ofs >= -1020 && ofs <= 1020 && (ofs&3) == 0, "load/store offset %d out of range", ofs); 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]); lj_assertA(r != d, "dest reg not free"); 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 rd, int32_t i) { RegSet work = ~as->freeset & RSET_GPR; while (work) { Reg r = rset_picktop(work); IRRef ref = regcost_ref(as->cost[r]); lj_assertA(r != rd, "dest reg %d not free", rd); 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 = (int32_t)(~(uint32_t)delta+1u); 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, rd, rd); emit_dn(as, ARMI_ADD^k^inv, rd, 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 rd, int32_t i) { uint32_t k = emit_isk12(ARMI_MOV, i); lj_assertA(rset_test(as->freeset, rd) || rd == RID_TMP, "dest reg %d not free", rd); if (k) { /* Standard K12 constant. */ emit_d(as, ARMI_MOV^k, rd); } 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), rd); } else if (emit_kdelta1(as, rd, 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), rd); emit_d(as, ARMI_MOVW|(i & 0x0fff)|((i & 0xf000)<<4), rd); } else if (emit_kdelta2(as, rd, 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), rd); break; } emit_dn(as, ARMI_ORR ^ emit_isk12(0, m), rd, rd); } } } #define emit_loada(as, rd, addr) emit_loadi(as, (rd), i32ptr((addr))) static Reg ra_allock(ASMState *as, intptr_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_loadk64(ASMState *as, Reg r, IRIns *ir) { cTValue *tv = ir_knum(ir); 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; lj_assertA(((delta + 0x00800000) >> 24) == 0, "branch target out of range"); *--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 lj_assertA(!irt_isnum(ir->t), "unexpected FP op"); 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 with base and (small) offset address. */ static void emit_loadofs(ASMState *as, IRIns *ir, Reg r, Reg base, int32_t ofs) { #if LJ_SOFTFP lj_assertA(!irt_isnum(ir->t), "unexpected FP op"); UNUSED(ir); #else if (r >= RID_MAX_GPR) emit_vlso(as, irt_isnum(ir->t) ? ARMI_VLDR_D : ARMI_VLDR_S, r, base, ofs); else #endif emit_lso(as, ARMI_LDR, r, base, ofs); } /* Generic store of register with base and (small) offset address. */ static void emit_storeofs(ASMState *as, IRIns *ir, Reg r, Reg base, int32_t ofs) { #if LJ_SOFTFP lj_assertA(!irt_isnum(ir->t), "unexpected FP op"); UNUSED(ir); #else if (r >= RID_MAX_GPR) emit_vlso(as, irt_isnum(ir->t) ? ARMI_VSTR_D : ARMI_VSTR_S, r, base, ofs); else #endif emit_lso(as, ARMI_STR, r, base, 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)) subprojects/luajit/src/lj_api.c0000644000175000017500000007714014741067622016112 0ustar aniolaniol/* ** Public Lua/C API. ** Copyright (C) 2005-2023 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" #include "lj_strfmt.h" /* -- Common helper functions --------------------------------------------- */ #define lj_checkapi_slot(idx) \ lj_checkapi((idx) <= (L->top - L->base), "stack slot %d out of range", (idx)) 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) { lj_checkapi(idx != 0 && -idx <= L->top - L->base, "bad stack slot %d", idx); 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); lj_checkapi(fn->c.gct == ~LJ_TFUNC && !isluafunc(fn), "calling frame is not a C function"); 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 LJ_AINLINE TValue *index2adr_check(lua_State *L, int idx) { TValue *o = index2adr(L, idx); lj_checkapi(o != niltv(L), "invalid stack slot %d", idx); return o; } static TValue *index2adr_stack(lua_State *L, int idx) { if (idx > 0) { TValue *o = L->base + (idx - 1); if (o < L->top) { return o; } else { lj_checkapi(0, "invalid stack slot %d", idx); return niltv(L); } return o < L->top ? o : niltv(L); } else { lj_checkapi(idx != 0 && -idx <= L->top - L->base, "invalid stack slot %d", idx); 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) { int avail = (int)(mref(L->maxstack, TValue) - L->top); if (size > avail && lj_state_cpgrowstack(L, (MSize)(size - avail)) != LUA_OK) { L->top--; return 0; /* Out of memory. */ } } 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 *L, lua_State *to, int n) { TValue *f, *t; if (L == to) return; lj_checkapi_slot(n); lj_checkapi(G(L) == G(to), "move across global states"); lj_state_checkstack(to, (MSize)n); f = L->top; t = to->top = to->top + n; while (--n >= 0) copyTV(to, --t, --f); L->top = f; } LUA_API const lua_Number *lua_version(lua_State *L) { static const lua_Number version = LUA_VERSION_NUM; UNUSED(L); return &version; } /* -- 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) { lj_checkapi(idx <= tvref(L->maxstack) - L->base, "bad stack slot %d", idx); 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 { lj_checkapi(-(idx+1) <= (L->top - L->base), "bad stack slot %d", idx); L->top += idx+1; /* Shrinks top (idx < 0). */ } } LUA_API void lua_remove(lua_State *L, int idx) { TValue *p = index2adr_stack(L, idx); while (++p < L->top) copyTV(L, p-1, p); L->top--; } LUA_API void lua_insert(lua_State *L, int idx) { TValue *q, *p = index2adr_stack(L, idx); for (q = L->top; q > p; q--) copyTV(L, q, q-1); copyTV(L, p, L->top); } static void copy_slot(lua_State *L, TValue *f, int idx) { if (idx == LUA_GLOBALSINDEX) { lj_checkapi(tvistab(f), "stack slot %d is not a table", idx); /* NOBARRIER: A thread (i.e. L) is never black. */ setgcref(L->env, obj2gco(tabV(f))); } else if (idx == LUA_ENVIRONINDEX) { GCfunc *fn = curr_func(L); if (fn->c.gct != ~LJ_TFUNC) lj_err_msg(L, LJ_ERR_NOENV); lj_checkapi(tvistab(f), "stack slot %d is not a table", idx); setgcref(fn->c.env, obj2gco(tabV(f))); lj_gc_barrier(L, fn, f); } else { TValue *o = index2adr_check(L, idx); copyTV(L, o, f); if (idx < LUA_GLOBALSINDEX) /* Need a barrier for upvalues. */ lj_gc_barrier(L, curr_func(L), f); } } LUA_API void lua_replace(lua_State *L, int idx) { lj_checkapi_slot(1); copy_slot(L, L->top - 1, idx); L->top--; } LUA_API void lua_copy(lua_State *L, int fromidx, int toidx) { copy_slot(L, index2adr(L, fromidx), toidx); } 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 && !LJ_GC64 } 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 lj_assertL(tt != LUA_TNIL || tvisnil(o), "bad tag conversion"); 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 && !LJ_GC64 } 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+LJ_FR2; return tvistruecond(L->top+1+LJ_FR2); } } } 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+LJ_FR2; return tvistruecond(L->top+1+LJ_FR2); } } } 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; } LUA_API lua_Number lua_tonumberx(lua_State *L, int idx, int *ok) { cTValue *o = index2adr(L, idx); TValue tmp; if (LJ_LIKELY(tvisnumber(o))) { if (ok) *ok = 1; return numberVnum(o); } else if (tvisstr(o) && lj_strscan_num(strV(o), &tmp)) { if (ok) *ok = 1; return numV(&tmp); } else { if (ok) *ok = 0; 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 intV(&tmp); n = numV(&tmp); } #if LJ_64 return (lua_Integer)n; #else return lj_num2int(n); #endif } LUA_API lua_Integer lua_tointegerx(lua_State *L, int idx, int *ok) { cTValue *o = index2adr(L, idx); TValue tmp; lua_Number n; if (LJ_LIKELY(tvisint(o))) { if (ok) *ok = 1; return intV(o); } else if (LJ_LIKELY(tvisnum(o))) { n = numV(o); } else { if (!(tvisstr(o) && lj_strscan_number(strV(o), &tmp))) { if (ok) *ok = 0; return 0; } if (tvisint(&tmp)) { if (ok) *ok = 1; return intV(&tmp); } n = numV(&tmp); } if (ok) *ok = 1; #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_strfmt_number(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_strfmt_number(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_strfmt_number(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_strfmt_number(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(G(L), 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) { return lj_obj_ptr(G(L), index2adr(L, idx)); } /* -- 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_strfmt_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_strfmt_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); lj_checkapi_slot(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); lj_assertL(iswhite(obj2gco(fn)), "new GC object is not white"); 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) { #if LJ_64 p = lj_lightud_intern(L, p); #endif setrawlightudV(L->top, p); incr_top(L); } LUA_API void lua_createtable(lua_State *L, int narray, int nrec) { lj_gc_check(L); settabV(L, L->top, lj_tab_new_ah(L, narray, nrec)); 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) { lj_checkapi_slot(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 - 2*LJ_FR2)); L->top = top+2; lj_vm_call(L, top, 1+1); L->top -= 1+LJ_FR2; copyTV(L, L->top-1, L->top+LJ_FR2); } 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 *t = index2adr_check(L, idx); cTValue *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+LJ_FR2; v = L->top+1+LJ_FR2; } copyTV(L, L->top-1, v); } LUA_API void lua_getfield(lua_State *L, int idx, const char *k) { cTValue *v, *t = index2adr_check(L, idx); TValue key; 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+LJ_FR2; v = L->top+1+LJ_FR2; } copyTV(L, L->top, v); incr_top(L); } LUA_API void lua_rawget(lua_State *L, int idx) { cTValue *t = index2adr(L, idx); lj_checkapi(tvistab(t), "stack slot %d is not a table", idx); 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); lj_checkapi(tvistab(t), "stack slot %d is not a table", idx); 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_check(L, idx); 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; lj_checkapi(tvistab(t), "stack slot %d is not a table", idx); more = lj_tab_next(tabV(t), L->top-1, L->top-1); if (more > 0) { incr_top(L); /* Return new key and value slot. */ } else if (!more) { /* End of traversal. */ L->top--; /* Remove key slot. */ } else { lj_err_msg(L, LJ_ERR_NEXTIDX); } return more; } LUA_API const char *lua_getupvalue(lua_State *L, int idx, int n) { TValue *val; GCobj *o; const char *name = lj_debug_uvnamev(index2adr(L, idx), (uint32_t)(n-1), &val, &o); 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--; lj_checkapi((uint32_t)n < fn->l.nupvalues, "bad upvalue %d", n); 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--; lj_checkapi(isluafunc(fn1), "stack slot %d is not a Lua function", idx1); lj_checkapi(isluafunc(fn2), "stack slot %d is not a Lua function", idx2); lj_checkapi((uint32_t)n1 < fn1->l.nupvalues, "bad upvalue %d", n1+1); lj_checkapi((uint32_t)n2 < fn2->l.nupvalues, "bad upvalue %d", n2+1); setgcrefr(fn1->l.uvptr[n1], fn2->l.uvptr[n2]); lj_gc_objbarrier(L, fn1, gcref(fn1->l.uvptr[n1])); } LUALIB_API void *luaL_testudata(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); } return NULL; /* value is not a userdata with a metatable */ } LUALIB_API void *luaL_checkudata(lua_State *L, int idx, const char *tname) { void *p = luaL_testudata(L, idx, tname); if (!p) lj_err_argtype(L, idx, tname); return p; } /* -- Object setters ------------------------------------------------------ */ LUA_API void lua_settable(lua_State *L, int idx) { TValue *o; cTValue *t = index2adr_check(L, idx); lj_checkapi_slot(2); o = lj_meta_tset(L, t, L->top-2); if (o) { /* NOBARRIER: lj_meta_tset ensures the table is not black. */ L->top -= 2; copyTV(L, o, L->top+1); } else { TValue *base = L->top; copyTV(L, base+2, base-3-2*LJ_FR2); L->top = base+3; lj_vm_call(L, base, 0+1); L->top -= 3+LJ_FR2; } } LUA_API void lua_setfield(lua_State *L, int idx, const char *k) { TValue *o; TValue key; cTValue *t = index2adr_check(L, idx); lj_checkapi_slot(1); setstrV(L, &key, lj_str_newz(L, k)); o = lj_meta_tset(L, t, &key); if (o) { /* NOBARRIER: lj_meta_tset ensures the table is not black. */ copyTV(L, o, --L->top); } else { TValue *base = L->top; copyTV(L, base+2, base-3-2*LJ_FR2); L->top = base+3; lj_vm_call(L, base, 0+1); L->top -= 2+LJ_FR2; } } LUA_API void lua_rawset(lua_State *L, int idx) { GCtab *t = tabV(index2adr(L, idx)); TValue *dst, *key; lj_checkapi_slot(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; lj_checkapi_slot(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_check(L, idx); lj_checkapi_slot(1); if (tvisnil(L->top-1)) { mt = NULL; } else { lj_checkapi(tvistab(L->top-1), "top stack slot is not a table"); 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); o = index2adr(L, idx); /* Stack may have been reallocated. */ 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; } LUALIB_API void luaL_setmetatable(lua_State *L, const char *tname) { lua_getfield(L, LUA_REGISTRYINDEX, tname); lua_setmetatable(L, -2); } LUA_API int lua_setfenv(lua_State *L, int idx) { cTValue *o = index2adr_check(L, idx); GCtab *t; lj_checkapi_slot(1); lj_checkapi(tvistab(L->top-1), "top stack slot is not a table"); 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; GCobj *o; const char *name; lj_checkapi_slot(1); name = lj_debug_uvnamev(f, (uint32_t)(n-1), &val, &o); if (name) { L->top--; copyTV(L, val, L->top); lj_gc_barrier(L, o, L->top); } return name; } /* -- Calls --------------------------------------------------------------- */ #if LJ_FR2 static TValue *api_call_base(lua_State *L, int nargs) { TValue *o = L->top, *base = o - nargs; L->top = o+1; for (; o > base; o--) copyTV(L, o, o-1); setnilV(o); return o+1; } #else #define api_call_base(L, nargs) (L->top - (nargs)) #endif LUA_API void lua_call(lua_State *L, int nargs, int nresults) { lj_checkapi(L->status == LUA_OK || L->status == LUA_ERRERR, "thread called in wrong state %d", L->status); lj_checkapi_slot(nargs+1); lj_vm_call(L, api_call_base(L, 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; lj_checkapi(L->status == LUA_OK || L->status == LUA_ERRERR, "thread called in wrong state %d", L->status); lj_checkapi_slot(nargs+1); if (errfunc == 0) { ef = 0; } else { cTValue *o = index2adr_stack(L, errfunc); ef = savestack(L, o); } status = lj_vm_pcall(L, api_call_base(L, 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)); TValue *top = L->top; fn->c.f = func; setfuncV(L, top++, fn); if (LJ_FR2) setnilV(top++); #if LJ_64 ud = lj_lightud_intern(L, ud); #endif setrawlightudV(top++, ud); cframe_nres(L->cframe) = 1+0; /* Zero results. */ L->top = top; return 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; lj_checkapi(L->status == LUA_OK || L->status == LUA_ERRERR, "thread called in wrong state %d", L->status); 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 *top = L->top--; if (LJ_FR2) setnilV(top++); copyTV(L, top++, index2adr(L, idx)); L->top = top; lj_vm_call(L, top-1, 1+1); return 1; } return 0; } /* -- Coroutine yield and resume ------------------------------------------ */ LUA_API int lua_isyieldable(lua_State *L) { return cframe_canyield(L->cframe); } 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, lj_cont_hook); if (LJ_FR2) top++; setframe_pc(top, cframe_pc(cf)-1); top++; setframe_gc(top, obj2gco(L), LJ_TTHREAD); if (LJ_FR2) top++; setframe_ftsz(top, ((char *)(top+1)-(char *)L->base)+FRAME_CONT); L->top = L->base = top+1; #if ((defined(__GNUC__) || defined(__clang__)) && (LJ_TARGET_X64 || defined(LUAJIT_UNWIND_EXTERNAL)) && !LJ_NO_UNWIND) || LJ_TARGET_WINDOWS 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->status == LUA_OK ? api_call_base(L, nargs) : 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: { GCSize a = (GCSize)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; case LUA_GCISRUNNING: res = (g->gc.threshold != LJ_MAX_MEM); 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; } subprojects/luajit/src/lj_ffrecord.h0000644000175000017500000000117514741067622017133 0ustar aniolaniol/* ** Fast function call recorder. ** Copyright (C) 2005-2023 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 subprojects/luajit/src/lj_strscan.h0000644000175000017500000000212214741067622017007 0ustar aniolaniol/* ** String scanning. ** Copyright (C) 2005-2023 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, MSize len, 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 subprojects/luajit/src/lib_os.c0000644000175000017500000001471414741067622016121 0ustar aniolaniol/* ** OS library. ** Copyright (C) 2005-2023 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_gc.h" #include "lj_err.h" #include "lj_buf.h" #include "lj_str.h" #include "lj_lib.h" #if LJ_TARGET_POSIX #include #else #include #endif #if !LJ_TARGET_PSVITA #include #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_PS5 || LJ_TARGET_PSVITA || LJ_TARGET_NX 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++); } 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 if (*s) { SBuf *sb = &G(L)->tmpbuf; MSize sz = 0, retry = 4; const char *q; for (q = s; *q; q++) sz += (*q == '%') ? 30 : 1; /* Overflow doesn't matter. */ setsbufL(sb, L); while (retry--) { /* Limit growth for invalid format or empty result. */ char *buf = lj_buf_need(sb, sz); size_t len = strftime(buf, sbufsz(sb), s, stm); if (len) { setstrV(L, L->top++, lj_str_new(L, buf, len)); lj_gc_check(L); break; } sz += (sz|1); } } else { setstrV(L, L->top++, &G(L)->strempty); } 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; } subprojects/luajit/src/nxbuild.bat0000644000175000017500000001351314741067622016637 0ustar aniolaniol@rem Script to build LuaJIT with NintendoSDK + NX Addon. @rem Donated to the public domain by Swyter. @rem @rem To run this script you must open a "Native Tools Command Prompt for VS". @rem @rem Either the x86 version for NX32, or x64 for the NX64 target. @rem This is because the pointer size of the LuaJIT host tools (buildvm.exe) @rem must match the cross-compiled target (32 or 64 bits). @rem @rem Then cd to this directory and run this script. @rem @rem Recommended invocation: @rem @rem nxbuild # release build, amalgamated @rem nxbuild debug # debug build, amalgamated @rem @rem Additional command-line options (not generally recommended): @rem @rem noamalg # (after debug) non-amalgamated build @if not defined INCLUDE goto :FAIL @if not defined NINTENDO_SDK_ROOT goto :FAIL @if not defined PLATFORM goto :FAIL @if "%platform%" == "x86" goto :DO_NX32 @if "%platform%" == "x64" goto :DO_NX64 @echo Error: Current host platform is %platform%! @echo. @goto :FAIL @setlocal :DO_NX32 @set DASC=vm_arm.dasc @set DASMFLAGS= -D HFABI -D FPU @set DASMTARGET= -D LUAJIT_TARGET=LUAJIT_ARCH_ARM @set HOST_PTR_SIZE=4 goto :BEGIN :DO_NX64 @set DASC=vm_arm64.dasc @set DASMFLAGS= -D ENDIAN_LE @set DASMTARGET= -D LUAJIT_TARGET=LUAJIT_ARCH_ARM64 @set HOST_PTR_SIZE=8 :BEGIN @rem ---- Host compiler ---- @set LJCOMPILE=cl /nologo /c /MD /O2 /W3 /wo4146 /wo4244 /D_CRT_SECURE_NO_DEPRECATE @set LJLINK=link /nologo @set LJMT=mt /nologo @set DASMDIR=..\dynasm @set DASM=%DASMDIR%\dynasm.lua @set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c lib_buffer.c %LJCOMPILE% host\minilua.c @if errorlevel 1 goto :BAD %LJLINK% /out:minilua.exe minilua.obj @if errorlevel 1 goto :BAD if exist minilua.exe.manifest^ %LJMT% -manifest minilua.exe.manifest -outputresource:minilua.exe @rem Check that we have the right 32/64 bit host compiler to generate the right virtual machine files. @minilua @if "%ERRORLEVEL%" == "%HOST_PTR_SIZE%" goto :PASSED_PTR_CHECK @echo The pointer size of the host in bytes (%HOST_PTR_SIZE%) does not match the expected value (%errorlevel%). @echo Check that the script is being ran under the correct x86/x64 VS prompt. @goto :BAD :PASSED_PTR_CHECK @set DASMFLAGS=%DASMFLAGS% %DASMTARGET% -D LJ_TARGET_NX -D LUAJIT_OS=LUAJIT_OS_OTHER -D LUAJIT_DISABLE_JIT -D LUAJIT_DISABLE_FFI minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h %DASC% @if errorlevel 1 goto :BAD if exist ..\.git ( git show -s --format=%%ct >luajit_relver.txt ) else ( type ..\.relver >luajit_relver.txt ) minilua host\genversion.lua %LJCOMPILE% /I "." /I %DASMDIR% %DASMTARGET% -D LJ_TARGET_NX -DLUAJIT_OS=LUAJIT_OS_OTHER -DLUAJIT_DISABLE_JIT -DLUAJIT_DISABLE_FFI host\buildvm*.c @if errorlevel 1 goto :BAD %LJLINK% /out:buildvm.exe buildvm*.obj @if errorlevel 1 goto :BAD if exist buildvm.exe.manifest^ %LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe buildvm -m elfasm -o lj_vm.s @if errorlevel 1 goto :BAD buildvm -m bcdef -o lj_bcdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m ffdef -o lj_ffdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m libdef -o lj_libdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m recdef -o lj_recdef.h %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m vmdef -o jit\vmdef.lua %ALL_LIB% @if errorlevel 1 goto :BAD buildvm -m folddef -o lj_folddef.h lj_opt_fold.c @if errorlevel 1 goto :BAD @rem ---- Cross compiler ---- @set NXCOMPILER_ROOT="%NINTENDO_SDK_ROOT%\Compilers\NintendoClang" @if "%platform%" neq "x64" goto :NX32_CROSSBUILD @set LJCOMPILE="%NXCOMPILER_ROOT%\bin\clang" --target=aarch64-nintendo-nx-elf -Wall -I%NINTENDO_SDK_ROOT%\Include %DASMTARGET% -DLUAJIT_OS=LUAJIT_OS_OTHER -DLUAJIT_DISABLE_JIT -DLUAJIT_DISABLE_FFI -DLUAJIT_USE_SYSMALLOC -c @set LJLIB="%NXCOMPILER_ROOT%\bin\llvm-ar" rc @set TARGETLIB_SUFFIX=nx64 %NXCOMPILER_ROOT%\bin\clang --target=aarch64-nintendo-nx-elf -o lj_vm.o -c lj_vm.s goto :DEBUGCHECK :NX32_CROSSBUILD @set LJCOMPILE="%NXCOMPILER_ROOT%\bin\clang" --target=armv7l-nintendo-nx-eabihf -Wall -I%NINTENDO_SDK_ROOT%\Include %DASMTARGET% -DLUAJIT_OS=LUAJIT_OS_OTHER -DLUAJIT_DISABLE_JIT -DLUAJIT_DISABLE_FFI -DLUAJIT_USE_SYSMALLOC -c @set LJLIB="%NXCOMPILER_ROOT%\bin\llvm-ar" rc @set TARGETLIB_SUFFIX=nx32 %NXCOMPILER_ROOT%\bin\clang --target=armv7l-nintendo-nx-eabihf -o lj_vm.o -c lj_vm.s :DEBUGCHECK @if "%1" neq "debug" goto :NODEBUG @shift @set LJCOMPILE=%LJCOMPILE% -DNN_SDK_BUILD_DEBUG -g -O0 @set TARGETLIB=libluajitD_%TARGETLIB_SUFFIX%.a goto :BUILD :NODEBUG @set LJCOMPILE=%LJCOMPILE% -DNN_SDK_BUILD_RELEASE -O3 @set TARGETLIB=libluajit_%TARGETLIB_SUFFIX%.a :BUILD del %TARGETLIB% @set LJCOMPILE=%LJCOMPILE% -fPIC @if "%1" neq "noamalg" goto :AMALG for %%f in (lj_*.c lib_*.c) do ( %LJCOMPILE% %%f @if errorlevel 1 goto :BAD ) %LJLIB% %TARGETLIB% lj_*.o lib_*.o @if errorlevel 1 goto :BAD @goto :NOAMALG :AMALG %LJCOMPILE% ljamalg.c @if errorlevel 1 goto :BAD %LJLIB% %TARGETLIB% ljamalg.o lj_vm.o @if errorlevel 1 goto :BAD :NOAMALG @del *.o *.obj *.manifest minilua.exe buildvm.exe @echo. @echo === Successfully built LuaJIT for Nintendo Switch (%TARGETLIB_SUFFIX%) === @goto :END :BAD @echo. @echo ******************************************************* @echo *** Build FAILED -- Please check the error messages *** @echo ******************************************************* @goto :END :FAIL @echo To run this script you must open a "Native Tools Command Prompt for VS". @echo. @echo Either the x86 version for NX32, or x64 for the NX64 target. @echo This is because the pointer size of the LuaJIT host tools (buildvm.exe) @echo must match the cross-compiled target (32 or 64 bits). @echo. @echo Keep in mind that NintendoSDK + NX Addon must be installed, too. :END subprojects/luajit/src/lj_gc.c0000644000175000017500000007022114741067622015723 0ustar aniolaniol/* ** Garbage collector. ** Copyright (C) 2005-2023 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_buf.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_dispatch.h" #include "lj_vm.h" #include "lj_vmevent.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) \ { lj_assertG(!tvisgcv(tv) || (~itype(tv) == gcval(tv)->gch.gct), \ "TValue and GC type mismatch"); \ 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; lj_assertG(iswhite(o), "mark of non-white object"); lj_assertG(!isdead(g, o), "mark of dead object"); 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)); if (LJ_HASBUFFER && gco2ud(o)->udtype == UDTYPE_BUFFER) { SBufExt *sbx = (SBufExt *)uddata(gco2ud(o)); if (sbufiscow(sbx) && gcref(sbx->cowref)) gc_markobj(g, gcref(sbx->cowref)); if (gcref(sbx->dict_str)) gc_markobj(g, gcref(sbx->dict_str)); if (gcref(sbx->dict_mt)) gc_markobj(g, gcref(sbx->dict_mt)); } } 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) { lj_assertG(gct == ~LJ_TFUNC || gct == ~LJ_TTAB || gct == ~LJ_TTHREAD || gct == ~LJ_TPROTO || gct == ~LJ_TTRACE, "bad GC type %d", gct); 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)) { lj_assertG(uvprev(uvnext(uv)) == uv && uvnext(uvprev(uv)) == uv, "broken upvalue chain"); 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 if (gcref(g->gcroot[GCROOT_FFI_FIN]) == obj2gco(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. */ lj_assertG(!tvisnil(&n->key), "mark of nil key in non-empty slot"); 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; lj_assertG(fn->l.nupvalues <= funcproto(fn)->sizeuv, "function upvalues out of range"); 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)); lj_assertG(traceno != G2J(g)->cur.traceno, "active trace escaped"); 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 (irt_is64(ir->t) && ir->o != IR_KNULL) ref++; } 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+LJ_FR2; frame = frame_prev(frame)) { GCfunc *fn = frame_func(frame); TValue *ftop = frame; if (isluafunc(fn)) ftop += funcproto(fn)->framesize; if (ftop > top) top = ftop; if (!LJ_FR2) 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+LJ_FR2; 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; lj_assertG(isgray(o), "propagation of non-gray object"); 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 lj_assertG(0, "bad GC type %d", gct); 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 --------------------------------------------------------- */ /* 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), ~(uint32_t)0) /* 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? */ lj_assertG(!isdead(g, o) || (o->gch.marked & LJ_GC_FIXED), "sweep of undead object"); makewhite(g, o); /* Value is alive, change to the current white. */ p = &o->gch.nextgc; } else { /* Otherwise value is dead, free it. */ lj_assertG(isdead(g, o) || ow == LJ_GC_SFIXED, "sweep of unlive object"); 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; } /* Sweep one string interning table chain. Preserves hashalg bit. */ static void gc_sweepstr(global_State *g, GCRef *chain) { /* Mask with other white and LJ_GC_FIXED. Or LJ_GC_SFIXED on shutdown. */ int ow = otherwhite(g); uintptr_t u = gcrefu(*chain); GCRef q; GCRef *p = &q; GCobj *o; setgcrefp(q, (u & ~(uintptr_t)1)); while ((o = gcref(*p)) != NULL) { if (((o->gch.marked ^ LJ_GC_WHITES) & ow)) { /* Black or current white? */ lj_assertG(!isdead(g, o) || (o->gch.marked & LJ_GC_FIXED), "sweep of undead string"); makewhite(g, o); /* String is alive, change to the current white. */ p = &o->gch.nextgc; } else { /* Otherwise string is dead, free it. */ lj_assertG(isdead(g, o) || ow == LJ_GC_SFIXED, "sweep of unlive string"); setgcrefr(*p, o->gch.nextgc); lj_str_free(g, gco2str(o)); } } setgcrefp(*chain, (gcrefu(q) | (u & 1))); } /* 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(global_State *g, GCobj *o) { UNUSED(g); while (o) { GCtab *t = gco2tab(o); lj_assertG((t->marked & LJ_GC_WEAK), "clear of non-weak table"); 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); GCSize oldt = g->gc.threshold; int errcode; TValue *top; lj_trace_abort(g); hook_entergc(g); /* Disable hooks and new traces during __gc. */ if (LJ_HASPROFILE && (oldh & HOOK_PROFILE)) lj_dispatch_update(g); g->gc.threshold = LJ_MAX_MEM; /* Prevent GC steps. */ top = L->top; copyTV(L, top++, mo); if (LJ_FR2) setnilV(top++); setgcV(L, top, o, ~o->gch.gct); L->top = top+1; errcode = lj_vm_pcall(L, top, 1+0, -1); /* Stack: |mo|o| -> | */ hook_restore(g, oldh); if (LJ_HASPROFILE && (oldh & HOOK_PROFILE)) lj_dispatch_update(g); g->gc.threshold = oldt; /* Restore GC threshold. */ if (errcode) { ptrdiff_t errobj = savestack(L, L->top-1); /* Stack may be resized. */ lj_vmevent_send(L, ERRFIN, copyTV(L, L->top++, restorestack(L, errobj)); ); L->top--; } } /* 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; lj_assertG(tvref(g->jit_base) == NULL, "finalizer 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, tabref(g->gcroot[GCROOT_FFI_FIN]), &tmp); if (!tvisnil(tv)) { 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); GCtab *t = tabref(g->gcroot[GCROOT_FFI_FIN]); 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; /* Free everything, except super-fixed objects (the main thread). */ g->gc.currentwhite = LJ_GC_WHITES | LJ_GC_SFIXED; gc_fullsweep(g, &g->gc.root); for (i = g->str.mask; i != ~(MSize)0; i--) /* Free all string hash chains. */ gc_sweepstr(g, &g->str.tab[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); lj_assertG(!iswhite(obj2gco(mainthread(g))), "main thread turned white"); 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(g, gcref(g->gc.weak)); lj_buf_shrink(L, &g->tmpbuf); /* Shrink temp buffer. */ /* 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 - (GCSize)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 (tvref(g->jit_base)) /* 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: { GCSize old = g->gc.total; gc_sweepstr(g, &g->str.tab[g->gc.sweepstr++]); /* Sweep one chain. */ if (g->gc.sweepstr > g->str.mask) g->gc.state = GCSsweep; /* All string hash chains sweeped. */ lj_assertG(old >= g->gc.total, "sweep increased memory"); g->gc.estimate -= old - g->gc.total; return GCSWEEPCOST; } case GCSsweep: { GCSize old = g->gc.total; setmref(g->gc.sweep, gc_sweep(g, mref(g->gc.sweep, GCRef), GCSWEEPMAX)); lj_assertG(old >= g->gc.total, "sweep increased memory"); g->gc.estimate -= old - g->gc.total; if (gcref(*mref(g->gc.sweep, GCRef)) == NULL) { if (g->str.num <= (g->str.mask >> 2) && g->str.mask > LJ_MIN_STRTAB*2-1) lj_str_resize(L, g->str.mask >> 1); /* Shrink string table. */ if (gcref(g->gc.mmudata)) { /* Need any finalizations? */ g->gc.state = GCSfinalize; } 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) { GCSize old = g->gc.total; if (tvref(g->jit_base)) /* Don't call finalizers on trace. */ return LJ_MAX_MEM; gc_finalize(L); /* Finalize one userdata object. */ if (old >= g->gc.total && g->gc.estimate > old - g->gc.total) g->gc.estimate -= old - g->gc.total; if (g->gc.estimate > GCFINALIZECOST) g->gc.estimate -= GCFINALIZECOST; return GCFINALIZECOST; } g->gc.state = GCSpause; /* End of GC cycle. */ g->gc.debt = 0; return 0; default: lj_assertG(0, "bad GC state"); return 0; } } /* Perform a limited amount of incremental GC steps. */ int LJ_FASTCALL lj_gc_step(lua_State *L) { global_State *g = G(L); GCSize 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 -= (GCSize)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 (sizeof(lim) == 8 ? ((int64_t)lim > 0) : ((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->cur_L)); L->base = tvref(G(L)->jit_base); 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. */ lj_assertG(g->gc.state == GCSfinalize || g->gc.state == GCSpause, "bad GC state"); /* 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) { lj_assertG(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o), "bad object states for forward barrier"); lj_assertG(g->gc.state != GCSfinalize && g->gc.state != GCSpause, "bad GC state"); lj_assertG(o->gch.gct != ~LJ_TTAB, "barrier object is not a table"); /* 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. */ lj_assertG(g->gc.state != GCSfinalize && g->gc.state != GCSpause, "bad GC state"); } } } #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, GCSize osz, GCSize nsz) { global_State *g = G(L); lj_assertG((osz == 0) == (p == NULL), "realloc API violation"); p = g->allocf(g->allocd, p, osz, nsz); if (p == NULL && nsz > 0) lj_err_mem(L); lj_assertG((nsz == 0) == (p == NULL), "allocf API violation"); lj_assertG(checkptrGC(p), "allocated memory address %p outside required range", 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, GCSize size) { global_State *g = G(L); GCobj *o = (GCobj *)g->allocf(g->allocd, NULL, 0, size); if (o == NULL) lj_err_mem(L); lj_assertG(checkptrGC(o), "allocated memory address %p outside required range", 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; } subprojects/luajit/src/vm_arm.dasc0000644000175000017500000037276214741067622016635 0ustar aniolaniol|// Low-level VM code for ARM CPUs. |// Bytecode interpreter, fast functions and helper functions. |// Copyright (C) 2005-2023 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 |.type SBUF, SBuf | |//----------------------------------------------------------------------- | |// 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 | |->vm_unwind_ext: // Complete external unwind. #if !LJ_NO_UNWIND | push {r0, r1, r2, lr} | bl extern _Unwind_Complete | ldr r0, [sp] | bl extern _Unwind_DeleteException | pop {r0, r1, r2, lr} | mov r0, r1 | bx r2 #endif | |//----------------------------------------------------------------------- |//-- 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 L, SAVE_PC // Any value outside of bytecode is ok. | str CARG3, SAVE_CFRAME | cmp CARG1, #0 | str CARG2, L->cframe | beq >3 | | // Resume after yield (like a return). | str L, [DISPATCH, #DISPATCH_GL(cur_L)] | 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 | ldr DISPATCH, L->glref // Setup pointer to dispatch table. | mov BASE, CARG2 | str CARG1, SAVE_PC // Any value outside of bytecode is ok. | str RC, SAVE_CFRAME | add DISPATCH, DISPATCH, #GG_G2DISP | str sp, L->cframe // Add our C frame to cframe chain. | |3: // Entry point for vm_cpcall/vm_resume (BASE = base, PC = ftype). | str L, [DISPATCH, #DISPATCH_GL(cur_L)] | 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 DISPATCH, L->glref // Setup pointer to dispatch table. | ldr RB, L->top | str CARG1, SAVE_PC // Any value outside of bytecode is ok. | ldr RC, L->cframe | add DISPATCH, DISPATCH, #GG_G2DISP | sub RA, RA, RB // Compute -savestack(L, L->top). | 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 | str sp, L->cframe // Add our C frame to cframe chain. | str L, [DISPATCH, #DISPATCH_GL(cur_L)] | blx CARG4 // (lua_State *L, lua_CFunction func, void *ud) | movs BASE, CRET1 | mov PC, #FRAME_CP | 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]. | mvn INS, #~LJ_TNIL | add CARG2, RA, RC | str INS, [CARG2, #-4] // Ensure one valid arg. |.if FFI | bls >1 |.endif | ldr CARG3, LFUNC:CARG3->field_pc | 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_tgetr: | .IOS mov RC, BASE | bl extern lj_tab_getinth // (GCtab *t, int32_t key) | // Returns cTValue * or NULL. | .IOS mov BASE, RC | cmp CRET1, #0 | ldrdne CARG12, [CRET1] | mvneq CARG2, #~LJ_TNIL | b ->BC_TGETR_Z | |//----------------------------------------------------------------------- | |->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 | |->vmeta_tsetr: | str BASE, L->base | .IOS mov RC, BASE | mov CARG1, L | str PC, SAVE_PC | bl extern lj_tab_setinth // (lua_State *L, GCtab *t, int32_t key) | // Returns TValue *. | .IOS mov BASE, RC | b ->BC_TSETR_Z | |//-- 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 | |->vmeta_istype: | sub PC, PC, #4 | str BASE, L->base | mov CARG1, L | lsr CARG2, RA, #3 | mov CARG3, RC | str PC, SAVE_PC | bl extern lj_meta_istype // (lua_State *L, BCReg ra, BCReg tp) | .IOS ldr BASE, L->base | b ->cont_nop | |//-- 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->sid | ldr NODE:INS, TAB:RB->node | and CARG3, CARG3, CARG4 // idx = str->sid & 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_strfmt_number // (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] | add CARG2, BASE, #8 | sub CARG3, BASE, #8 | bl extern lj_tab_next // (GCtab *t, cTValue *key, TValue *o) | // Returns 1=found, 0=end, -1=error. | .IOS ldr BASE, L->base | cmp CRET1, #0 | mov RC, #(2+1)*8 | bgt ->fff_res // Found key/value. | bmi ->fff_fallback // Invalid key. | // End of traversal: return nil. | mvn CRET2, #~LJ_TNIL | b ->fff_restv | |.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 | ldr RB, L->maxstack | add INS, BASE, NARGS8:RC | ldrb RA, [DISPATCH, #DISPATCH_GL(hookmask)] | cmp NARGS8:RC, #8 | cmphs RB, INS | 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 | ldr RB, L->maxstack | add INS, BASE, NARGS8:RC | ldrb RA, [DISPATCH, #DISPATCH_GL(hookmask)] | cmp RB, INS | blo ->fff_fallback | 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 | cmp CRET1, #LUA_YIELD | ldr BASE, L->base | str L, [DISPATCH, #DISPATCH_GL(cur_L)] | st_vmstate CARG2 | 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 | |.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, pl | math_minmax math_max, lt, le | |//-- String library ----------------------------------------------------- | |.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) |->fff_resstr: | // 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 | |.macro ffstring_op, name | .ffunc string_ .. name | ffgccheck | ldr CARG3, [BASE, #4] | cmp NARGS8:RC, #8 | ldr STR:CARG2, [BASE] | blo ->fff_fallback | sub SBUF:CARG1, DISPATCH, #-DISPATCH_GL(tmpbuf) | checkstr CARG3, ->fff_fallback | ldr CARG4, SBUF:CARG1->b | str BASE, L->base | str PC, SAVE_PC | str L, SBUF:CARG1->L | str CARG4, SBUF:CARG1->w | bl extern lj_buf_putstr_ .. name | bl extern lj_buf_tostr | b ->fff_resstr |.endmacro | |ffstring_op reverse |ffstring_op lower |ffstring_op upper | |//-- Bit library -------------------------------------------------------- | |->vm_tobit_fb: | bhi ->fff_fallback |.if FPU |// FP number to bit conversion for hard-float. Clobbers r0, d0-d1. | vldr d1, >9 | vmov d0, CARG1, CARG2 | vadd.f64 d0, d0, d1 | vmov CARG1, s0 | bx lr |9: | .long 0, 0x43380000 // (double)(2^52 + 2^51). |.else |// FP number to bit conversion for soft-float. Clobbers r0-r3. |->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 |.endif | |.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 | |->cont_stitch: // Trace stitching. |.if JIT | // RA = resultptr, CARG4 = meta base | ldr RB, SAVE_MULTRES | ldr INS, [PC, #-4] | ldr TRACE:CARG3, [CARG4, #-24] // Save previous trace. | subs RB, RB, #8 | decode_RA8 RC, INS // Call base. | beq >2 |1: // Move results down. | ldrd CARG12, [RA] | add RA, RA, #8 | subs RB, RB, #8 | strd CARG12, [BASE, RC] | add RC, RC, #8 | bne <1 |2: | decode_RA8 RA, INS | decode_RB8 RB, INS | add RA, RA, RB |3: | cmp RA, RC | mvn CARG2, #~LJ_TNIL | bhi >9 // More results wanted? | | ldrh RA, TRACE:CARG3->traceno | ldrh RC, TRACE:CARG3->link | cmp RC, RA | beq ->cont_nop // Blacklisted. | cmp RC, #0 | bne =>BC_JLOOP // Jump to stitched trace. | | // Stitch a new trace to the previous trace. | str RA, [DISPATCH, #DISPATCH_J(exitno)] | str L, [DISPATCH, #DISPATCH_J(L)] | str BASE, L->base | sub CARG1, DISPATCH, #-GG_DISP2J | mov CARG2, PC | bl extern lj_dispatch_stitch // (jit_State *J, const BCIns *pc) | ldr BASE, L->base | b ->cont_nop | |9: // Fill up results with nil. | strd CARG12, [BASE, RC] | add RC, RC, #8 | b <3 |.endif | |->vm_profhook: // Dispatch target for profiler hook. #if LJ_HASPROFILE | mov CARG1, L | str BASE, L->base | mov CARG2, PC | bl extern lj_dispatch_profile // (lua_State *L, const BCIns *pc) | // HOOK_PROFILE is off again, so re-dispatch to dynamic instruction. | ldr BASE, L->base | sub PC, PC, #4 | b ->cont_nop #endif | |//----------------------------------------------------------------------- |//-- 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(cur_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 BASE, L->base | str L, [DISPATCH, #DISPATCH_J(L)] | str CARG4, [DISPATCH, #DISPATCH_GL(jit_base)] | 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: | cmn CARG1, #LUA_ERRERR | bhs >9 // Check for error from exit. | lsl RC, CARG1, #3 | ldr LFUNC:CARG2, [BASE, FRAME_FUNC] | str RC, SAVE_MULTRES | mov CARG3, #0 | str BASE, L->base | ldr CARG2, LFUNC:CARG2->field_pc | str CARG3, [DISPATCH, #DISPATCH_GL(jit_base)] | 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 | cmn CARG1, #17 // Static dispatch? | beq >5 | cmp OP, #BC_FUNCC+2 // Fast function? | bhs >4 |2: | 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 | ldrhs CARG3, [BASE, FRAME_FUNC] | bx OP | |4: // Check frame below fast function. | ldr CARG1, [BASE, FRAME_PC] | ands CARG2, CARG1, #FRAME_TYPE | bne <2 // Trace stitching continuation? | // Otherwise set KBASE for Lua function below fast function. | ldr CARG3, [CARG1, #-4] | decode_RA8 CARG1, CARG3 | sub CARG2, BASE, CARG1 | ldr LFUNC:CARG3, [CARG2, #-16] | ldr CARG3, LFUNC:CARG3->field_pc | ldr KBASE, [CARG3, #PC2PROTO(k)] | b <2 | |5: // Dispatch to static entry of original ins replaced by BC_JLOOP. | ldr CARG1, [DISPATCH, #DISPATCH_J(trace)] | decode_RD RC, INS | ldr TRACE:CARG1, [CARG1, RC, lsl #2] | ldr INS, TRACE:CARG1->startins | decode_OP OP, INS | decode_RA8 RA, INS | add OP, DISPATCH, OP, lsl #2 | decode_RD RC, INS | ldr pc, [OP, #GG_DISP2STATIC] | |9: // Rethrow error from the right C frame. | rsb CARG2, CARG1, #0 | mov CARG1, L | bl extern lj_err_trace // (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 -------------------------------------------- |//----------------------------------------------------------------------- | |.define NEXT_TAB, TAB:CARG1 |.define NEXT_RES, CARG1 |.define NEXT_IDX, CARG2 |.define NEXT_TMP0, CARG3 |.define NEXT_TMP1, CARG4 |.define NEXT_LIM, r12 |.define NEXT_RES_PTR, sp |.define NEXT_RES_VAL, [sp] |.define NEXT_RES_KEY_I, [sp, #8] |.define NEXT_RES_KEY_IT, [sp, #12] | |// TValue *lj_vm_next(GCtab *t, uint32_t idx) |// Next idx returned in CRET2. |->vm_next: |.if JIT | ldr NEXT_TMP0, NEXT_TAB->array | ldr NEXT_LIM, NEXT_TAB->asize | add NEXT_TMP0, NEXT_TMP0, NEXT_IDX, lsl #3 |1: // Traverse array part. | subs NEXT_TMP1, NEXT_IDX, NEXT_LIM | bhs >5 | ldr NEXT_TMP1, [NEXT_TMP0, #4] | str NEXT_IDX, NEXT_RES_KEY_I | add NEXT_TMP0, NEXT_TMP0, #8 | add NEXT_IDX, NEXT_IDX, #1 | checktp NEXT_TMP1, LJ_TNIL | beq <1 // Skip holes in array part. | ldr NEXT_TMP0, [NEXT_TMP0, #-8] | mov NEXT_RES, NEXT_RES_PTR | strd NEXT_TMP0, NEXT_RES_VAL // Stores NEXT_TMP1, too. | mvn NEXT_TMP0, #~LJ_TISNUM | str NEXT_TMP0, NEXT_RES_KEY_IT | bx lr | |5: // Traverse hash part. | ldr NEXT_TMP0, NEXT_TAB->hmask | ldr NODE:NEXT_RES, NEXT_TAB->node | add NEXT_TMP1, NEXT_TMP1, NEXT_TMP1, lsl #1 | add NEXT_LIM, NEXT_LIM, NEXT_TMP0 | add NODE:NEXT_RES, NODE:NEXT_RES, NEXT_TMP1, lsl #3 |6: | cmp NEXT_IDX, NEXT_LIM | bhi >9 | ldr NEXT_TMP1, NODE:NEXT_RES->val.it | checktp NEXT_TMP1, LJ_TNIL | add NEXT_IDX, NEXT_IDX, #1 | bxne lr | // Skip holes in hash part. | add NEXT_RES, NEXT_RES, #sizeof(Node) | b <6 | |9: // End of iteration. Set the key to nil (not the value). | mvn NEXT_TMP0, #0 | mov NEXT_RES, NEXT_RES_PTR | str NEXT_TMP0, NEXT_RES_KEY_IT | bx lr |.endif | |//----------------------------------------------------------------------- |//-- 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, #4 |.if HFABI | vldm RB, {d0-d7} |.endif | ldr RB, CCSTATE->func | bmi >2 |1: // Copy stack slots. | ldr CARG4, [CARG3, CARG2] | str CARG4, [sp, CARG2] | subs CARG2, CARG2, #4 | 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; case BC_ISTYPE: | // RA = src*8, RC = -type | ldrd CARG12, [BASE, RA] | ins_next1 | cmn CARG2, RC | ins_next2 | bne ->vmeta_istype | ins_next3 break; case BC_ISNUM: | // RA = src*8, RC = -(TISNUM-1) | ldrd CARG12, [BASE, RA] | ins_next1 | checktp CARG2, LJ_TISNUM | ins_next2 | bhs ->vmeta_istype | ins_next3 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->sid | ldr NODE:INS, TAB:CARG1->node | mov TAB:RB, TAB:CARG1 | and CARG3, CARG3, CARG4 // idx = str->sid & 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_TGETR: | decode_RB8 RB, INS | decode_RC8 RC, INS | // RA = dst*8, RB = table*8, RC = key*8 | ldr TAB:CARG1, [BASE, RB] | ldr CARG2, [BASE, RC] | ldr CARG4, TAB:CARG1->array | ldr CARG3, TAB:CARG1->asize | add CARG4, CARG4, CARG2, lsl #3 | cmp CARG2, CARG3 // In array part? | bhs ->vmeta_tgetr | ldrd CARG12, [CARG4] |->BC_TGETR_Z: | ins_next1 | ins_next2 | strd CARG12, [BASE, RA] | ins_next3 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->sid | ldr NODE:INS, TAB:CARG1->node | mov TAB:RB, TAB:CARG1 | and CARG3, CARG3, CARG4 // idx = str->sid & 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_TSETR: | decode_RB8 RB, INS | decode_RC8 RC, INS | // RA = src*8, RB = table*8, RC = key*8 | ldr TAB:CARG2, [BASE, RB] | ldr CARG3, [BASE, RC] | ldrb INS, TAB:CARG2->marked | ldr CARG1, TAB:CARG2->array | ldr CARG4, TAB:CARG2->asize | tst INS, #LJ_GC_BLACK // isblack(table) | add CARG1, CARG1, CARG3, lsl #3 | bne >7 |2: | cmp CARG3, CARG4 // In array part? | bhs ->vmeta_tsetr |->BC_TSETR_Z: | ldrd CARG34, [BASE, RA] | ins_next1 | ins_next2 | strd CARG34, [CARG1] | ins_next3 | |7: // Possible table write barrier for the value. Skip valiswhite check. | barrierback TAB:CARG2, INS, RB | 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: |.if JIT | hotloop |.endif |->vm_IITERN: | // RA = base*8, (RB = nresults+1, RC = nargs+1 (2+1)) | 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, #~LJ_KEYINDEX | 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 |.if JIT | ldrb CARG1, [PC] | cmp CARG1, #BC_ITERN | bne >6 |.endif | strb OP, [PC] // Subsumes ins_next1. | ins_next2 | b <1 |.if JIT |6: // Unpatch JLOOP. | ldr CARG1, [DISPATCH, #DISPATCH_J(trace)] | ldrh CARG2, [PC, #2] | ldr TRACE:CARG1, [CARG1, CARG2, lsl #2] | // Subsumes ins_next1 and ins_next2. | ldr INS, TRACE:CARG1->startins | bfi INS, OP, #0, #8 | str INS, [PC], #4 | b <1 |.endif 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(tmpbuf.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 | str L, [DISPATCH, #DISPATCH_GL(cur_L)] | 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; } } subprojects/luajit/src/lib_jit.c0000644000175000017500000004625414741067622016272 0ustar aniolaniol/* ** JIT library. ** Copyright (C) 2005-2023 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_obj.h" #include "lj_gc.h" #include "lj_err.h" #include "lj_debug.h" #include "lj_str.h" #include "lj_tab.h" #include "lj_state.h" #include "lj_bc.h" #if LJ_HASFFI #include "lj_ctype.h" #endif #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_trace.h" #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, JIT_F_CPUSTRING); flagbits_to_strings(L, J->flags, JIT_F_OPT, JIT_F_OPTSTRING); return (int)(L->top - L->base); #else setboolV(L->top++, 0); return 1; #endif } LJLIB_CF(jit_security) { int idx = lj_lib_checkopt(L, 1, -1, LJ_SECURITY_MODESTRING); setintV(L->top++, ((LJ_SECURITY_MODE >> (2*idx)) & 3)); return 1; } 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 ------------------------------------ */ 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 = lj_lib_checkLproto(L, 1, 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 = lj_lib_checkLproto(L, 1, 0); BCPos pc = (BCPos)lj_lib_checkint(L, 2); if (pc < pt->sizebc) { BCIns ins = proto_bc(pt)[pc]; BCOp op = bc_op(ins); lj_assertL(op < BC__MAX, "bad bytecode op %d", op); 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 = lj_lib_checkLproto(L, 1, 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 = lj_lib_checkLproto(L, 1, 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", "stitch" }; /* 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]; } #if LJ_HASFFI if (ir->o == IR_KINT64) ctype_loadffi(L); #endif 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) { ASMFunction func = lj_ir_callinfo[idx].func; setintptrV(L->top-1, (intptr_t)(void *)lj_ptr_strip(func)); return 1; } return 0; } #endif #include "lj_libdef.h" static int luaopen_jit_util(lua_State *L) { LJ_LIB_REG(L, NULL, jit_util); return 1; } /* -- 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; ; 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; lj_assertJ(len != 0, "bad JIT_P_STRING"); 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.profile module -------------------------------------------------- */ #if LJ_HASPROFILE #define LJLIB_MODULE_jit_profile /* Not loaded by default, use: local profile = require("jit.profile") */ #define KEY_PROFILE_THREAD (U64x(80000000,00000000)|'t') #define KEY_PROFILE_FUNC (U64x(80000000,00000000)|'f') static void jit_profile_callback(lua_State *L2, lua_State *L, int samples, int vmstate) { TValue key; cTValue *tv; key.u64 = KEY_PROFILE_FUNC; tv = lj_tab_get(L, tabV(registry(L)), &key); if (tvisfunc(tv)) { char vmst = (char)vmstate; int status; setfuncV(L2, L2->top++, funcV(tv)); setthreadV(L2, L2->top++, L); setintV(L2->top++, samples); setstrV(L2, L2->top++, lj_str_new(L2, &vmst, 1)); status = lua_pcall(L2, 3, 0, 0); /* callback(thread, samples, vmstate) */ if (status) { if (G(L2)->panic) G(L2)->panic(L2); exit(EXIT_FAILURE); } lj_trace_abort(G(L2)); } } /* profile.start(mode, cb) */ LJLIB_CF(jit_profile_start) { GCtab *registry = tabV(registry(L)); GCstr *mode = lj_lib_optstr(L, 1); GCfunc *func = lj_lib_checkfunc(L, 2); lua_State *L2 = lua_newthread(L); /* Thread that runs profiler callback. */ TValue key; /* Anchor thread and function in registry. */ key.u64 = KEY_PROFILE_THREAD; setthreadV(L, lj_tab_set(L, registry, &key), L2); key.u64 = KEY_PROFILE_FUNC; setfuncV(L, lj_tab_set(L, registry, &key), func); lj_gc_anybarriert(L, registry); luaJIT_profile_start(L, mode ? strdata(mode) : "", (luaJIT_profile_callback)jit_profile_callback, L2); return 0; } /* profile.stop() */ LJLIB_CF(jit_profile_stop) { GCtab *registry; TValue key; luaJIT_profile_stop(L); registry = tabV(registry(L)); key.u64 = KEY_PROFILE_THREAD; setnilV(lj_tab_set(L, registry, &key)); key.u64 = KEY_PROFILE_FUNC; setnilV(lj_tab_set(L, registry, &key)); lj_gc_anybarriert(L, registry); return 0; } /* dump = profile.dumpstack([thread,] fmt, depth) */ LJLIB_CF(jit_profile_dumpstack) { lua_State *L2 = L; int arg = 0; size_t len; int depth; GCstr *fmt; const char *p; if (L->top > L->base && tvisthread(L->base)) { L2 = threadV(L->base); arg = 1; } fmt = lj_lib_checkstr(L, arg+1); depth = lj_lib_checkint(L, arg+2); p = luaJIT_profile_dumpstack(L2, strdata(fmt), depth, &len); lua_pushlstring(L, p, len); return 1; } #include "lj_libdef.h" static int luaopen_jit_profile(lua_State *L) { LJ_LIB_REG(L, NULL, jit_profile); return 1; } #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 }; #if LJ_TARGET_ARM && LJ_TARGET_LINUX #include #endif /* Arch-dependent CPU feature detection. */ static uint32_t jit_cpudetect(void) { 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)) { flags |= ((features[2] >> 0)&1) * JIT_F_SSE3; flags |= ((features[2] >> 19)&1) * JIT_F_SSE4_1; if (vendor[0] >= 7) { uint32_t xfeatures[4]; lj_vm_cpuid(7, xfeatures); flags |= ((xfeatures[1] >> 8)&1) * JIT_F_BMI2; } } /* Don't bother checking for SSE2 -- the VM will crash before getting here. */ #elif LJ_TARGET_ARM 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] >= '8') ver = 80; else 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; #elif LJ_TARGET_ARM64 /* No optional CPU features to detect (for now). */ #elif LJ_TARGET_PPC #if LJ_ARCH_SQRT flags |= JIT_F_SQRT; #endif #if LJ_ARCH_ROUND flags |= JIT_F_ROUND; #endif #elif LJ_TARGET_MIPS /* Compile-time MIPS CPU detection. */ #if LJ_ARCH_VERSION >= 20 flags |= JIT_F_MIPSXXR2; #endif /* Runtime MIPS CPU detection. */ #if defined(__GNUC__) if (!(flags & JIT_F_MIPSXXR2)) { int x; #ifdef __mips16 x = 0; /* Runtime detection is difficult. Ensure optimal -march flags. */ #else /* 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"); #endif if (x) flags |= JIT_F_MIPSXXR2; /* Either 0x80000000 (R2) or 0 (R1). */ } #endif #else #error "Missing CPU detection for this architecture" #endif return flags; } /* Initialize JIT compiler. */ static void jit_init(lua_State *L) { jit_State *J = L2J(L); J->flags = jit_cpudetect() | JIT_F_ON | JIT_F_OPT_DEFAULT; memcpy(J->param, jit_param_default, sizeof(J->param)); lj_dispatch_update(G(L)); } #endif LUALIB_API int luaopen_jit(lua_State *L) { #if LJ_HASJIT jit_init(L); #endif lua_pushliteral(L, LJ_OS_NAME); lua_pushliteral(L, LJ_ARCH_NAME); lua_pushinteger(L, LUAJIT_VERSION_NUM); /* Deprecated. */ lua_pushliteral(L, LUAJIT_VERSION); LJ_LIB_REG(L, LUA_JITLIBNAME, jit); #if LJ_HASPROFILE lj_lib_prereg(L, LUA_JITLIBNAME ".profile", luaopen_jit_profile, tabref(L->env)); #endif #ifndef LUAJIT_DISABLE_JITUTIL lj_lib_prereg(L, LUA_JITLIBNAME ".util", luaopen_jit_util, tabref(L->env)); #endif #if LJ_HASJIT LJ_LIB_REG(L, "jit.opt", jit_opt); #endif L->top -= 2; return 1; } subprojects/luajit/src/lj_func.c0000644000175000017500000001345714741067622016275 0ustar aniolaniol/* ** Function handling (prototypes, functions and upvalues). ** Copyright (C) 2005-2023 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(global_State *g, GCupval *uv) { UNUSED(g); lj_assertG(uvprev(uvnext(uv)) == uv && uvnext(uvprev(uv)) == uv, "broken upvalue chain"); 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) { lj_assertG(!p->closed && uvval(p) != &p->tv, "closed upvalue in chain"); 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)); lj_assertG(uvprev(uvnext(uv)) == uv && uvnext(uvprev(uv)) == uv, "broken upvalue chain"); 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); lj_assertG(!isblack(o), "bad black upvalue"); lj_assertG(!uv->closed && uvval(uv) != &uv->tv, "closed upvalue in chain"); setgcrefr(L->openupval, uv->nextgc); /* No longer in open list. */ if (isdead(g, o)) { lj_func_freeuv(g, uv); } else { unlinkuv(g, uv); lj_gc_closeuv(g, uv); } } } void LJ_FASTCALL lj_func_freeuv(global_State *g, GCupval *uv) { if (!uv->closed) unlinkuv(g, 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); } subprojects/luajit/src/lj_udata.h0000644000175000017500000000061114741067622016431 0ustar aniolaniol/* ** Userdata handling. ** Copyright (C) 2005-2023 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); #if LJ_64 LJ_FUNC void * LJ_FASTCALL lj_lightud_intern(lua_State *L, void *p); #endif #endif subprojects/luajit/src/lj_strscan.c0000644000175000017500000004146514741067622017017 0ustar aniolaniol/* ** String scanning. ** Copyright (C) 2005-2023 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) #define STRSCAN_MAXEXP (1 << 20) /* 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__) || defined(__clang__)) && 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. */ lj_assertX((int64_t)x >= 0, "bad double conversion"); 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 && !(x == 0 && neg)) { o->i = neg ? (int32_t)(~x+1u) : (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+1u) : (int32_t)x; return STRSCAN_U32; case STRSCAN_I64: case STRSCAN_U64: if (dig > 16) return STRSCAN_ERROR; o->u64 = neg ? ~x+1u : 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)(~(uint32_t)x+1u) : (int32_t)x; break; default: case STRSCAN_I64: case STRSCAN_U64: o->u64 = neg ? ~x+1u : 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+1u) : (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+1u) : (int32_t)x; return STRSCAN_U32; case STRSCAN_I64: case STRSCAN_U64: o->u64 = neg ? ~x+1u : 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); lj_assertX(lo > 0 && (ex10 & 1) == 0, "bad lo %d ex10 %d", lo, ex10); /* 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; } /* Parse binary number. */ static StrScanFmt strscan_bin(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; if (ex2 || dig > 64) return STRSCAN_ERROR; /* Scan binary digits. */ for (i = dig; i; i--, p++) { if ((*p & ~1) != '0') return STRSCAN_ERROR; x = (x << 1) | (*p & 1); } /* Format-specific handling. */ switch (fmt) { case STRSCAN_INT: if (!(opt & STRSCAN_OPT_TONUM) && x < 0x80000000u+neg) { o->i = neg ? (int32_t)(~x+1u) : (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 > 32) return STRSCAN_ERROR; o->i = neg ? (int32_t)(~x+1u) : (int32_t)x; return STRSCAN_U32; case STRSCAN_I64: case STRSCAN_U64: o->u64 = neg ? ~x+1u : 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; } /* Scan string containing a number. Returns format. Returns value in o. */ StrScanFmt lj_strscan_scan(const uint8_t *p, MSize len, TValue *o, uint32_t opt) { int32_t neg = 0; const uint8_t *pe = p + len; /* 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 || p < pe) 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') { if (casecmp(p[1], 'x')) base = 16, cmask = LJ_CHAR_XDIGIT, p += 2; else if (casecmp(p[1], 'b')) base = 2, cmask = LJ_CHAR_DIGIT, 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) { if (base == 2) return STRSCAN_ERROR; 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 (ex <= -STRSCAN_MAXEXP) return STRSCAN_ERROR; if (base == 16) ex *= 4; } } /* Parse exponent. */ if (base >= 10 && 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)) { xx = xx * 10 + (*p & 15); if (xx >= STRSCAN_MAXEXP) return STRSCAN_ERROR; p++; } ex += negx ? (int32_t)(~xx+1u) : (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; } if (p < pe) 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))) { if ((opt & STRSCAN_OPT_TONUM)) { o->n = neg ? -(double)x : (double)x; return STRSCAN_NUM; } else if (x == 0 && neg) { o->n = -0.0; return STRSCAN_NUM; } else { o->i = neg ? (int32_t)(~x+1u) : (int32_t)x; 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 if (base == 2) fmt = strscan_bin(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) && !tvismzero(o)) { 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), str->len, o, STRSCAN_OPT_TONUM); lj_assertX(fmt == STRSCAN_ERROR || fmt == STRSCAN_NUM, "bad scan format"); 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), str->len, o, STRSCAN_OPT_TOINT); lj_assertX(fmt == STRSCAN_ERROR || fmt == STRSCAN_NUM || fmt == STRSCAN_INT, "bad scan format"); if (fmt == STRSCAN_INT) setitype(o, LJ_TISNUM); return (fmt != STRSCAN_ERROR); } #endif #undef DNEXT #undef DPREV #undef DLEN subprojects/luajit/src/lib_bit.c0000644000175000017500000001044014741067622016246 0ustar aniolaniol/* ** Bit manipulation library. ** Copyright (C) 2005-2023 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_buf.h" #include "lj_strscan.h" #include "lj_strfmt.h" #if LJ_HASFFI #include "lj_ctype.h" #include "lj_cdata.h" #include "lj_cconv.h" #include "lj_carith.h" #endif #include "lj_ff.h" #include "lj_lib.h" /* ------------------------------------------------------------------------ */ #define LJLIB_MODULE_bit #if LJ_HASFFI static int bit_result64(lua_State *L, CTypeID id, uint64_t x) { GCcdata *cd = lj_cdata_new_(L, id, 8); *(uint64_t *)cdataptr(cd) = x; setcdataV(L, L->base-1-LJ_FR2, cd); return FFH_RES(1); } #else static int32_t bit_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; } } #endif LJLIB_ASM(bit_tobit) LJLIB_REC(bit_tobit) { #if LJ_HASFFI CTypeID id = 0; setintV(L->base-1-LJ_FR2, (int32_t)lj_carith_check64(L, 1, &id)); return FFH_RES(1); #else lj_lib_checknumber(L, 1); return FFH_RETRY; #endif } LJLIB_ASM(bit_bnot) LJLIB_REC(bit_unary IR_BNOT) { #if LJ_HASFFI CTypeID id = 0; uint64_t x = lj_carith_check64(L, 1, &id); return id ? bit_result64(L, id, ~x) : FFH_RETRY; #else lj_lib_checknumber(L, 1); return FFH_RETRY; #endif } LJLIB_ASM(bit_bswap) LJLIB_REC(bit_unary IR_BSWAP) { #if LJ_HASFFI CTypeID id = 0; uint64_t x = lj_carith_check64(L, 1, &id); return id ? bit_result64(L, id, lj_bswap64(x)) : FFH_RETRY; #else lj_lib_checknumber(L, 1); return FFH_RETRY; #endif } LJLIB_ASM(bit_lshift) LJLIB_REC(bit_shift IR_BSHL) { #if LJ_HASFFI CTypeID id = 0, id2 = 0; uint64_t x = lj_carith_check64(L, 1, &id); int32_t sh = (int32_t)lj_carith_check64(L, 2, &id2); if (id) { x = lj_carith_shift64(x, sh, curr_func(L)->c.ffid - (int)FF_bit_lshift); return bit_result64(L, id, x); } setintV(L->base+1, sh); return FFH_RETRY; #else lj_lib_checknumber(L, 1); bit_checkbit(L, 2); return FFH_RETRY; #endif } 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) { #if LJ_HASFFI CTypeID id = 0; TValue *o = L->base, *top = L->top; int i = 0; do { lj_carith_check64(L, ++i, &id); } while (++o < top); if (id) { CTState *cts = ctype_cts(L); CType *ct = ctype_get(cts, id); int op = curr_func(L)->c.ffid - (int)FF_bit_bor; uint64_t x, y = op >= 0 ? 0 : ~(uint64_t)0; o = L->base; do { lj_cconv_ct_tv(cts, ct, (uint8_t *)&x, o, 0); if (op < 0) y &= x; else if (op == 0) y |= x; else y ^= x; } while (++o < top); return bit_result64(L, id, y); } return FFH_RETRY; #else int i = 0; do { lj_lib_checknumber(L, ++i); } while (L->base+i < L->top); return FFH_RETRY; #endif } LJLIB_ASM_(bit_bor) LJLIB_REC(bit_nary IR_BOR) LJLIB_ASM_(bit_bxor) LJLIB_REC(bit_nary IR_BXOR) /* ------------------------------------------------------------------------ */ LJLIB_CF(bit_tohex) LJLIB_REC(.) { #if LJ_HASFFI CTypeID id = 0, id2 = 0; uint64_t b = lj_carith_check64(L, 1, &id); int32_t n = L->base+1>=L->top ? (id ? 16 : 8) : (int32_t)lj_carith_check64(L, 2, &id2); #else uint32_t b = (uint32_t)bit_checkbit(L, 1); int32_t n = L->base+1>=L->top ? 8 : bit_checkbit(L, 2); #endif SBuf *sb = lj_buf_tmp_(L); SFormat sf = (STRFMT_UINT|STRFMT_T_HEX); if (n < 0) { n = (int32_t)(~(uint32_t)n+1u); sf |= STRFMT_F_UPPER; } if ((uint32_t)n > 254) n = 254; sf |= ((SFormat)((n+1)&255) << STRFMT_SH_PREC); #if LJ_HASFFI if (n < 16) b &= ((uint64_t)1 << 4*n)-1; #else if (n < 8) b &= (1u << 4*n)-1; #endif sb = lj_strfmt_putfxint(sb, sf, b); setstrV(L, L->top-1, lj_buf_str(L, sb)); lj_gc_check(L); return 1; } /* ------------------------------------------------------------------------ */ #include "lj_libdef.h" LUALIB_API int luaopen_bit(lua_State *L) { LJ_LIB_REG(L, LUA_BITLIBNAME, bit); return 1; } subprojects/luajit/src/lj_bc.h0000644000175000017500000002025314741067622015723 0ustar aniolaniol/* ** Bytecode instruction format. ** Copyright (C) 2005-2023 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, ___) \ _(ISTYPE, var, ___, lit, ___) \ _(ISNUM, var, ___, lit, ___) \ \ /* 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) \ _(TGETR, dst, var, var, index) \ _(TSETV, var, var, var, newindex) \ _(TSETS, var, var, str, newindex) \ _(TSETB, var, var, lit, newindex) \ _(TSETM, base, ___, num, newindex) \ _(TSETR, var, var, var, 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 subprojects/luajit/src/lua.hpp0000644000175000017500000000020714741067622015770 0ustar aniolaniol// C++ wrapper for LuaJIT header files. extern "C" { #include "lua.h" #include "lauxlib.h" #include "lualib.h" #include "luajit.h" } subprojects/luajit/src/lj_ir.h0000644000175000017500000004727014741067622015761 0ustar aniolaniol/* ** SSA IR (Intermediate Representation) format. ** Copyright (C) 2005-2023 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) \ _(PROF, S , ___, ___) \ \ /* 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) \ _(LDEXP, N , ref, ref) \ _(MIN, N , ref, ref) \ _(MAX, N , 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) \ _(TMPREF, S , ref, lit) \ _(STRREF, N , ref, ref) \ _(LREF, L , ___, ___) \ \ /* 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, lit) \ _(ALEN, L , ref, 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. */ \ \ /* Buffer operations. */ \ _(BUFHDR, L , ref, lit) \ _(BUFPUT, LW, ref, ref) \ _(BUFSTR, AW, ref, ref) \ \ /* Barriers. */ \ _(TBAR, S , ref, ___) \ _(OBAR, S , ref, ref) \ _(XBAR, S , ___, ___) \ \ /* Type conversions. */ \ _(CONV, N , ref, lit) \ _(TOBIT, N , ref, ref) \ _(TOSTR, N , ref, lit) \ _(STRTO, N , ref, ___) \ \ /* Calls. */ \ _(CALLN, NW, ref, lit) \ _(CALLA, AW, ref, lit) \ _(CALLL, LW, 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) _(LOG) _(LOG2) \ _(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)) \ _(FUNC_FFID, offsetof(GCfunc, l.ffid)) \ _(THREAD_ENV, offsetof(lua_State, env)) \ _(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)) \ _(SBUF_W, sizeof(GCudata) + offsetof(SBufExt, w)) \ _(SBUF_E, sizeof(GCudata) + offsetof(SBufExt, e)) \ _(SBUF_B, sizeof(GCudata) + offsetof(SBufExt, b)) \ _(SBUF_L, sizeof(GCudata) + offsetof(SBufExt, L)) \ _(SBUF_REF, sizeof(GCudata) + offsetof(SBufExt, cowref)) \ _(SBUF_R, sizeof(GCudata) + offsetof(SBufExt, r)) \ _(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; /* TMPREF mode bits, stored in op2. */ #define IRTMPREF_IN1 0x01 /* First input value. */ #define IRTMPREF_OUT1 0x02 /* First output value. */ #define IRTMPREF_OUT2 0x04 /* Second output value. */ /* SLOAD mode bits, stored in op2. */ #define IRSLOAD_PARENT 0x01 /* Coalesce with parent trace. */ #define IRSLOAD_FRAME 0x02 /* Load 32 bits of ftsz. */ #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. */ #define IRSLOAD_KEYINDEX 0x40 /* Table traversal key index. */ /* XLOAD mode bits, stored in op2. */ #define IRXLOAD_READONLY 0x01 /* Load from read-only data. */ #define IRXLOAD_VOLATILE 0x02 /* Load from volatile data. */ #define IRXLOAD_UNALIGNED 0x04 /* Unaligned load. */ /* BUFHDR mode, stored in op2. */ #define IRBUFHDR_RESET 0 /* Reset buffer. */ #define IRBUFHDR_APPEND 1 /* Append to buffer. */ #define IRBUFHDR_WRITE 2 /* Write to string buffer. */ /* 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 ------------------------------------------------ */ #define IRTSIZE_PGC (LJ_GC64 ? 8 : 4) /* Map of itypes to non-negative numbers and their sizes. 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, IRTSIZE_PGC) _(P32, 4) _(THREAD, IRTSIZE_PGC) _(PROTO, IRTSIZE_PGC) \ _(FUNC, IRTSIZE_PGC) _(P64, 8) _(CDATA, IRTSIZE_PGC) _(TAB, IRTSIZE_PGC) \ _(UDATA, IRTSIZE_PGC) \ _(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 8 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_PGC = LJ_GC64 ? IRT_P64 : IRT_P32, IRT_IGC = LJ_GC64 ? IRT_I64 : IRT_INT, 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_isp32(t) (irt_type(t) == IRT_P32) #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_GC64 /* Include IRT_NIL, so IR(ASMREF_L) (aka REF_NIL) is considered 64 bit. */ #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 && !LJ_GC64 else if (tvislightud(tv)) return IRT_LIGHTUD; #endif else return (IRType)~itype(tv); } static LJ_AINLINE uint32_t irt_toitype_(IRType t) { lj_assertX(!LJ_64 || LJ_GC64 || t != IRT_LIGHTUD, "no plain type tag for lightuserdata"); if (LJ_DUALNUM && t > IRT_NUM) { return LJ_TISNUM; } else { lj_assertX(t <= IRT_NUM, "no plain type tag for IR type %d", t); 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_KEYINDEX 0x00100000 #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_islightud(tr) (tref_istype((tr), IRT_LIGHTUD)) #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/gco32 | ot | prev | (alternative fields in union) ** +-------+-------+---+---+---+---+ ** | TValue/gco64 | (2nd IR slot for 64 bit constants) ** +---------------+-------+-------+ ** 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 or entire slot). */ MRef ptr; /* Pointer constant (overlaps op12 or entire slot). */ TValue tv; /* TValue constant (overlaps entire slot). */ } IRIns; #define ir_isk64(ir) \ ((ir)->o == IR_KNUM || (ir)->o == IR_KINT64 || \ (LJ_GC64 && \ ((ir)->o == IR_KGC || (ir)->o == IR_KPTR || (ir)->o == IR_KKPTR))) #define ir_kgc(ir) check_exp((ir)->o == IR_KGC, gcref((ir)[LJ_GC64].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, &(ir)[1].tv) #define ir_kint64(ir) check_exp((ir)->o == IR_KINT64, &(ir)[1].tv) #define ir_k64(ir) check_exp(ir_isk64(ir), &(ir)[1].tv) #define ir_kptr(ir) \ check_exp((ir)->o == IR_KPTR || (ir)->o == IR_KKPTR, \ mref((ir)[LJ_GC64].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); /* Replace IR instruction with NOP. */ static LJ_AINLINE void lj_ir_nop(IRIns *ir) { ir->ot = IRT(IR_NOP, IRT_NIL); ir->op1 = ir->op2 = 0; ir->prev = 0; } #endif subprojects/luajit/src/lj_opt_sink.c0000644000175000017500000001662414741067622017167 0ustar aniolaniol/* ** SINK: Allocation Sinking and Store Sinking. ** Copyright (C) 2005-2023 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, int *workp) { IRIns *ir = IR(ref); if (!*workp) return 1; /* Give up and pretend it does. */ (*workp)--; if (irt_isphi(ir->t)) return 1; if (ir->op1 >= REF_FIRST && sink_phidep(J, ir->op1, workp)) return 1; if (ir->op2 >= REF_FIRST && sink_phidep(J, ir->op2, workp)) 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. */ if (ref < J->loopref) { /* Check for PHI dependencies, but give up after reasonable effort. */ int work = 64; return !sink_phidep(J, ref, &work); } else { return 0; /* Loop-variant. */ } } 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_ALOAD: case IR_HLOAD: case IR_XLOAD: case IR_TBAR: case IR_ALEN: 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. */ #endif /* fallthrough */ 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, *irbase = IR(REF_BASE); for (ir = IR(J->cur.nins-1) ; ir >= irbase; 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; } } for (ir = IR(J->cur.nk); ir < irbase; ir++) { irt_clearmark(ir->t); ir->prev = REGSP_INIT; /* The false-positive of irt_is64() for ASMREF_L (REF_NIL) is OK here. */ if (irt_is64(ir->t) && ir->o != IR_KNULL) ir++; } } /* 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 subprojects/luajit/src/lj_ccallback.c0000644000175000017500000005412614741067622017237 0ustar aniolaniol/* ** FFI C callback handling. ** Copyright (C) 2005-2023 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 /* Callbacks disabled. */ #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+(LJ_GC64 ? 10 : 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 #elif LJ_TARGET_ARM64 #define CALLBACK_MCODE_HEAD 32 #elif LJ_TARGET_PPC #define CALLBACK_MCODE_HEAD 24 #elif LJ_TARGET_MIPS32 #define CALLBACK_MCODE_HEAD 20 #elif LJ_TARGET_MIPS64 #define CALLBACK_MCODE_HEAD 52 #else /* Missing support for this architecture. */ #define CALLBACK_SLOT2OFS(slot) (0*(slot)) #define CALLBACK_OFS2SLOT(ofs) (0*(ofs)) #define CALLBACK_MAX_SLOT 0 #endif #ifndef CALLBACK_SLOT2OFS #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)) #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) (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); #if LJ_GC64 *p++ = 0x48; *p++ = XI_MOVri | RID_EBP; *(uint64_t *)p = (uint64_t)(g); p += 8; #else *p++ = XI_MOVri | RID_EBP; *(int32_t *)p = i32ptr(g); p += 4; #endif #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); } } return p; } #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++; } return p; } #elif LJ_TARGET_ARM64 static void *callback_mcode_init(global_State *g, uint32_t *page) { uint32_t *p = page; ASMFunction target = lj_vm_ffi_callback; MSize slot; *p++ = A64I_LE(A64I_LDRLx | A64F_D(RID_X11) | A64F_S19(4)); *p++ = A64I_LE(A64I_LDRLx | A64F_D(RID_X10) | A64F_S19(5)); *p++ = A64I_LE(A64I_BR_AUTH | A64F_N(RID_X11)); *p++ = A64I_LE(A64I_NOP); ((ASMFunction *)p)[0] = target; ((void **)p)[1] = g; p += 4; for (slot = 0; slot < CALLBACK_MAX_SLOT; slot++) { *p++ = A64I_LE(A64I_MOVZw | A64F_D(RID_X9) | A64F_U16(slot)); *p = A64I_LE(A64I_B | A64F_S26((page-p) & 0x03ffffffu)); p++; } return p; } #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++; } return p; } #elif LJ_TARGET_MIPS static void *callback_mcode_init(global_State *g, uint32_t *page) { uint32_t *p = page; uintptr_t target = (uintptr_t)(void *)lj_vm_ffi_callback; uintptr_t ug = (uintptr_t)(void *)g; MSize slot; #if LJ_TARGET_MIPS32 *p++ = MIPSI_LUI | MIPSF_T(RID_R3) | (target >> 16); *p++ = MIPSI_LUI | MIPSF_T(RID_R2) | (ug >> 16); #else *p++ = MIPSI_LUI | MIPSF_T(RID_R3) | (target >> 48); *p++ = MIPSI_LUI | MIPSF_T(RID_R2) | (ug >> 48); *p++ = MIPSI_ORI | MIPSF_T(RID_R3)|MIPSF_S(RID_R3) | ((target >> 32) & 0xffff); *p++ = MIPSI_ORI | MIPSF_T(RID_R2)|MIPSF_S(RID_R2) | ((ug >> 32) & 0xffff); *p++ = MIPSI_DSLL | MIPSF_D(RID_R3)|MIPSF_T(RID_R3) | MIPSF_A(16); *p++ = MIPSI_DSLL | MIPSF_D(RID_R2)|MIPSF_T(RID_R2) | MIPSF_A(16); *p++ = MIPSI_ORI | MIPSF_T(RID_R3)|MIPSF_S(RID_R3) | ((target >> 16) & 0xffff); *p++ = MIPSI_ORI | MIPSF_T(RID_R2)|MIPSF_S(RID_R2) | ((ug >> 16) & 0xffff); *p++ = MIPSI_DSLL | MIPSF_D(RID_R3)|MIPSF_T(RID_R3) | MIPSF_A(16); *p++ = MIPSI_DSLL | MIPSF_D(RID_R2)|MIPSF_T(RID_R2) | MIPSF_A(16); #endif *p++ = MIPSI_ORI | MIPSF_T(RID_R3)|MIPSF_S(RID_R3) | (target & 0xffff); *p++ = MIPSI_JR | MIPSF_S(RID_R3); *p++ = MIPSI_ORI | MIPSF_T(RID_R2)|MIPSF_S(RID_R2) | (ug & 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; } return p; } #else /* Missing support for this architecture. */ #define callback_mcode_init(g, p) (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 #ifdef PROT_MPROTECT #define CCPROT_CREATE (PROT_MPROTECT(PROT_EXEC)) #else #define CCPROT_CREATE 0 #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, *pe; if (CALLBACK_MAX_SLOT == 0) lj_err_caller(cts->L, LJ_ERR_FFI_CBACKOV); #if LJ_TARGET_WINDOWS p = LJ_WIN_VALLOC(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|CCPROT_CREATE), 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; pe = callback_mcode_init(cts->g, p); UNUSED(pe); lj_assertCTS((size_t)((char *)pe - (char *)p) <= sz, "miscalculated CALLBACK_MAX_SLOT"); lj_mcode_sync(p, (char *)p + sz); #if LJ_TARGET_WINDOWS { DWORD oprot; LJ_WIN_VPROTECT(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_ARM64 #define CALLBACK_HANDLE_REGARG \ if (isfp) { \ if (nfpr + n <= CCALL_NARG_FPR) { \ sp = &cts->cb.fpr[nfpr]; \ nfpr += n; \ goto done; \ } else { \ nfpr = CCALL_NARG_FPR; /* Prevent reordering. */ \ } \ } else { \ if (!LJ_TARGET_OSX && n > 1) \ ngpr = (ngpr + 1u) & ~1u; /* Align to regpair. */ \ if (ngpr + n <= maxgpr) { \ sp = &cts->cb.gpr[ngpr]; \ ngpr += n; \ goto done; \ } else { \ ngpr = CCALL_NARG_GPR; /* Prevent reordering. */ \ } \ } #elif LJ_TARGET_PPC #define CALLBACK_HANDLE_GPR \ if (n > 1) { \ lj_assertCTS(((LJ_ABI_SOFTFP && ctype_isnum(cta->info)) || /* double. */ \ ctype_isinteger(cta->info)) && n == 2, /* int64_t. */ \ "bad GPR type"); \ ngpr = (ngpr + 1u) & ~1u; /* Align int64_t to regpair. */ \ } \ if (ngpr + n <= maxgpr) { \ sp = &cts->cb.gpr[ngpr]; \ ngpr += n; \ goto done; \ } #if LJ_ABI_SOFTFP #define CALLBACK_HANDLE_REGARG \ CALLBACK_HANDLE_GPR \ UNUSED(isfp); #else #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. */ \ CALLBACK_HANDLE_GPR \ } #endif #if !LJ_ABI_SOFTFP #define CALLBACK_HANDLE_RET \ if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \ *(double *)dp = *(float *)dp; /* FPRs always hold doubles. */ #endif #elif LJ_TARGET_MIPS32 #define CALLBACK_HANDLE_GPR \ if (n > 1) ngpr = (ngpr + 1u) & ~1u; /* Align to regpair. */ \ if (ngpr + n <= maxgpr) { \ sp = &cts->cb.gpr[ngpr]; \ ngpr += n; \ goto done; \ } #if !LJ_ABI_SOFTFP /* MIPS32 hard-float */ #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; \ CALLBACK_HANDLE_GPR \ } #else /* MIPS32 soft-float */ #define CALLBACK_HANDLE_REGARG \ CALLBACK_HANDLE_GPR \ UNUSED(isfp); #endif #define CALLBACK_HANDLE_RET \ if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \ ((float *)dp)[1] = *(float *)dp; #elif LJ_TARGET_MIPS64 #if !LJ_ABI_SOFTFP /* MIPS64 hard-float */ #define CALLBACK_HANDLE_REGARG \ if (ngpr + n <= maxgpr) { \ sp = isfp ? (void*) &cts->cb.fpr[ngpr] : (void*) &cts->cb.gpr[ngpr]; \ ngpr += n; \ goto done; \ } #else /* MIPS64 soft-float */ #define CALLBACK_HANDLE_REGARG \ if (ngpr + n <= maxgpr) { \ UNUSED(isfp); \ sp = (void*) &cts->cb.gpr[ngpr]; \ ngpr += n; \ goto done; \ } #endif #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; int fntp; 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); /* Return type. x86: +(spadj<<16). */ fn = funcV(lj_tab_getint(cts->miscmap, (int32_t)slot)); fntp = LJ_TFUNC; } else { /* Must set up frame first, before throwing the error. */ ct = NULL; rid = 0; fn = (GCfunc *)L; fntp = LJ_TTHREAD; } /* Continuation returns from callback. */ if (LJ_FR2) { (o++)->u64 = LJ_CONT_FFI_CALLBACK; (o++)->u64 = rid; } else { o->u32.lo = LJ_CONT_FFI_CALLBACK; o->u32.hi = rid; o++; } setframe_gc(o, obj2gco(fn), fntp); if (LJ_FR2) o++; setframe_ftsz(o, ((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; lj_assertCTS(ctype_isfield(ctf->info), "field expected"); 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 #if LJ_TARGET_MIPS64 && !(isfp && nsp) #endif ) 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) { #if LJ_FR2 (L->base-3)->u64 |= (nsp << (16+2)); #else (L->base-2)->u32.hi |= (nsp << (16+2)); #endif } #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) { #if LJ_FR2 CType *ctr = ctype_raw(cts, (uint16_t)(L->base-3)->u64); #else CType *ctr = ctype_raw(cts, (uint16_t)(L->base-2)->u32.hi); #endif #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 #if LJ_TARGET_ARM64 && LJ_BE if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) dp = (uint8_t *)&cts->cb.fpr[0].f[1]; #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_MIPS64 || (LJ_TARGET_ARM64 && LJ_BE) /* Always sign-extend results to 64 bits. Even a soft-fp 'float'. */ if (ctr->size <= 4 && (LJ_ABI_SOFTFP || ctype_isinteger_or_bool(ctr->info))) *(int64_t *)dp = (int64_t)*(int32_t *)dp; #endif #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; lj_assertG(L != NULL, "uninitialized cts->L in callback"); if (tvref(g->jit_base)) { 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->top -= 2+2*LJ_FR2; L->base = obase; L->cframe = cframe_prev(L->cframe); 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; lj_assertCTS(ctype_isfield(ctf->info), "field expected"); 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 subprojects/luajit/src/lj_arch.h0000644000175000017500000004553014741067622016261 0ustar aniolaniol/* ** Target architecture selection. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #ifndef _LJ_ARCH_H #define _LJ_ARCH_H #include "lua.h" /* -- Target definitions -------------------------------------------------- */ /* 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_ARM64 4 #define LUAJIT_ARCH_arm64 4 #define LUAJIT_ARCH_PPC 5 #define LUAJIT_ARCH_ppc 5 #define LUAJIT_ARCH_MIPS 6 #define LUAJIT_ARCH_mips 6 #define LUAJIT_ARCH_MIPS32 6 #define LUAJIT_ARCH_mips32 6 #define LUAJIT_ARCH_MIPS64 7 #define LUAJIT_ARCH_mips64 7 /* 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 /* Number mode. */ #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. */ /* -- Target detection ---------------------------------------------------- */ /* 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(__aarch64__) || defined(_M_ARM64) #define LUAJIT_TARGET LUAJIT_ARCH_ARM64 #elif defined(__ppc__) || defined(__ppc) || defined(__PPC__) || defined(__PPC) || defined(__powerpc__) || defined(__powerpc) || defined(__POWERPC__) || defined(__POWERPC) || defined(_M_PPC) #define LUAJIT_TARGET LUAJIT_ARCH_PPC #elif defined(__mips64__) || defined(__mips64) || defined(__MIPS64__) || defined(__MIPS64) #define LUAJIT_TARGET LUAJIT_ARCH_MIPS64 #elif defined(__mips__) || defined(__mips) || defined(__MIPS__) || defined(__MIPS) #define LUAJIT_TARGET LUAJIT_ARCH_MIPS32 #else #error "Architecture not supported (in this version), see: https://luajit.org/status.html#architectures" #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__) #include "TargetConditionals.h" #define LUAJIT_OS LUAJIT_OS_OSX #elif (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ defined(__NetBSD__) || defined(__OpenBSD__) || \ defined(__DragonFly__)) && !defined(__ORBIS__) && !defined(__PROSPERO__) #define LUAJIT_OS LUAJIT_OS_BSD #elif (defined(__sun__) && defined(__svr4__)) #define LJ_TARGET_SOLARIS 1 #define LUAJIT_OS LUAJIT_OS_POSIX #elif defined(__HAIKU__) #define LUAJIT_OS LUAJIT_OS_POSIX #elif defined(__CYGWIN__) #define LJ_TARGET_CYGWIN 1 #define LUAJIT_OS LUAJIT_OS_POSIX #elif defined(__QNX__) #define LJ_TARGET_QNX 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_BSD (LUAJIT_OS == LUAJIT_OS_BSD) #define LJ_TARGET_POSIX (LUAJIT_OS > LUAJIT_OS_WINDOWS) #define LJ_TARGET_DLOPEN LJ_TARGET_POSIX #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE #define LJ_TARGET_IOS 1 #else #define LJ_TARGET_IOS 0 #endif #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 __PROSPERO__ #define LJ_TARGET_PS5 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 #ifdef _DURANGO #define LJ_TARGET_XBOXONE 1 #define LJ_TARGET_CONSOLE 1 #define LJ_TARGET_GC64 1 #endif #ifdef __NX__ #define LJ_TARGET_NX 1 #define LJ_TARGET_CONSOLE 1 #undef NULL #define NULL ((void*)0) #endif #ifdef _UWP #define LJ_TARGET_UWP 1 #if LUAJIT_TARGET == LUAJIT_ARCH_X64 #define LJ_TARGET_GC64 1 #endif #endif /* -- Arch-specific settings ---------------------------------------------- */ /* 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 #define LJ_TARGET_X86 1 #define LJ_TARGET_X86ORX64 1 #define LJ_TARGET_EHRETREG 0 #define LJ_TARGET_EHRAREG 8 #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 #define LJ_TARGET_X64 1 #define LJ_TARGET_X86ORX64 1 #define LJ_TARGET_EHRETREG 0 #define LJ_TARGET_EHRAREG 16 #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 #ifndef LUAJIT_DISABLE_GC64 #define LJ_TARGET_GC64 1 #elif LJ_TARGET_OSX #error "macOS requires GC64 -- don't disable it" #endif #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_EHRAREG 14 #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 >= 8 || __ARM_ARCH_8__ || __ARM_ARCH_8A__ #define LJ_ARCH_VERSION 80 #elif __ARM_ARCH == 7 || __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_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_ARM64 #define LJ_ARCH_BITS 64 #if defined(__AARCH64EB__) #define LJ_ARCH_NAME "arm64be" #define LJ_ARCH_ENDIAN LUAJIT_BE #else #define LJ_ARCH_NAME "arm64" #define LJ_ARCH_ENDIAN LUAJIT_LE #endif #if !defined(LJ_ABI_PAUTH) && defined(__arm64e__) #define LJ_ABI_PAUTH 1 #endif #define LJ_TARGET_ARM64 1 #define LJ_TARGET_EHRETREG 0 #define LJ_TARGET_EHRAREG 30 #define LJ_TARGET_JUMPRANGE 27 /* +-2^27 = +-128MB */ #define LJ_TARGET_MASKSHIFT 1 #define LJ_TARGET_MASKROT 1 #define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */ #define LJ_TARGET_GC64 1 #define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL #define LJ_ARCH_VERSION 80 #elif LUAJIT_TARGET == LUAJIT_ARCH_PPC #ifndef LJ_ARCH_ENDIAN #if __BYTE_ORDER__ != __ORDER_BIG_ENDIAN__ #define LJ_ARCH_ENDIAN LUAJIT_LE #else #define LJ_ARCH_ENDIAN LUAJIT_BE #endif #endif #if _LP64 #define LJ_ARCH_BITS 64 #if LJ_ARCH_ENDIAN == LUAJIT_LE #define LJ_ARCH_NAME "ppc64le" #else #define LJ_ARCH_NAME "ppc64" #endif #else #define LJ_ARCH_BITS 32 #define LJ_ARCH_NAME "ppc" #if !defined(LJ_ARCH_HASFPU) #if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE) #define LJ_ARCH_HASFPU 0 #else #define LJ_ARCH_HASFPU 1 #endif #endif #if !defined(LJ_ABI_SOFTFP) #if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE) #define LJ_ABI_SOFTFP 1 #else #define LJ_ABI_SOFTFP 0 #endif #endif #endif #if LJ_ABI_SOFTFP #define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL #else #define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL_SINGLE #endif #define LJ_TARGET_PPC 1 #define LJ_TARGET_EHRETREG 3 #define LJ_TARGET_EHRAREG 65 #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. */ #if LJ_TARGET_CONSOLE #define LJ_ARCH_PPC32ON64 1 #define LJ_ARCH_NOFFI 1 #elif LJ_ARCH_BITS == 64 #error "No support for PPC64" #undef LJ_TARGET_PPC #endif #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 _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_MIPS32 || LUAJIT_TARGET == LUAJIT_ARCH_MIPS64 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) #if __mips_isa_rev >= 6 #define LJ_TARGET_MIPSR6 1 #define LJ_TARGET_UNALIGNED 1 #endif #if LUAJIT_TARGET == LUAJIT_ARCH_MIPS32 #if LJ_TARGET_MIPSR6 #define LJ_ARCH_NAME "mips32r6el" #else #define LJ_ARCH_NAME "mipsel" #endif #else #if LJ_TARGET_MIPSR6 #define LJ_ARCH_NAME "mips64r6el" #else #define LJ_ARCH_NAME "mips64el" #endif #endif #define LJ_ARCH_ENDIAN LUAJIT_LE #else #if LUAJIT_TARGET == LUAJIT_ARCH_MIPS32 #if LJ_TARGET_MIPSR6 #define LJ_ARCH_NAME "mips32r6" #else #define LJ_ARCH_NAME "mips" #endif #else #if LJ_TARGET_MIPSR6 #define LJ_ARCH_NAME "mips64r6" #else #define LJ_ARCH_NAME "mips64" #endif #endif #define LJ_ARCH_ENDIAN LUAJIT_BE #endif #if !defined(LJ_ARCH_HASFPU) #ifdef __mips_soft_float #define LJ_ARCH_HASFPU 0 #else #define LJ_ARCH_HASFPU 1 #endif #endif #if !defined(LJ_ABI_SOFTFP) #ifdef __mips_soft_float #define LJ_ABI_SOFTFP 1 #else #define LJ_ABI_SOFTFP 0 #endif #endif #if LUAJIT_TARGET == LUAJIT_ARCH_MIPS32 #define LJ_ARCH_BITS 32 #define LJ_TARGET_MIPS32 1 #else #define LJ_ARCH_BITS 64 #define LJ_TARGET_MIPS64 1 #define LJ_TARGET_GC64 1 #endif #define LJ_TARGET_MIPS 1 #define LJ_TARGET_EHRETREG 4 #define LJ_TARGET_EHRAREG 31 #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_DUAL #if LJ_TARGET_MIPSR6 #define LJ_ARCH_VERSION 60 #elif _MIPS_ARCH_MIPS32R2 || _MIPS_ARCH_MIPS64R2 #define LJ_ARCH_VERSION 20 #else #define LJ_ARCH_VERSION 10 #endif #else #error "No target architecture defined" #endif /* -- Checks for requirements --------------------------------------------- */ /* 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_ARM64 #if __clang__ #if ((__clang_major__ < 3) || ((__clang_major__ == 3) && __clang_minor__ < 5)) && !defined(__NX_TOOLCHAIN_MAJOR__) #error "Need at least Clang 3.5 or newer" #endif #else #if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 8) #error "Need at least GCC 4.8 or newer" #endif #endif #elif !LJ_TARGET_PS3 #if __clang__ #if ((__clang_major__ < 3) || ((__clang_major__ == 3) && __clang_minor__ < 5)) #error "Need at least Clang 3.5 or newer" #endif #else #if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 3) #error "Need at least GCC 4.3 or newer" #endif #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" #undef LJ_TARGET_ARM #endif #if __ARM_ARCH_6M__ || __ARM_ARCH_7M__ || __ARM_ARCH_7EM__ #error "No support for Cortex-M CPUs" #undef LJ_TARGET_ARM #endif #if !(__ARM_EABI__ || LJ_TARGET_IOS) #error "Only ARM EABI or iOS 3.0+ ABI is supported" #undef LJ_TARGET_ARM #endif #elif LJ_TARGET_ARM64 #if defined(_ILP32) #error "No support for ILP32 model on ARM64" #undef LJ_TARGET_ARM64 #endif #elif LJ_TARGET_PPC #if defined(_LITTLE_ENDIAN) && (!defined(_BYTE_ORDER) || (_BYTE_ORDER == _LITTLE_ENDIAN)) #error "No support for little-endian PPC32" #undef LJ_TARGET_PPC #endif #if defined(__NO_FPRS__) && !defined(_SOFT_FLOAT) #error "No support for PPC/e500, use LuaJIT 2.0" #undef LJ_TARGET_PPC #endif #elif LJ_TARGET_MIPS32 #if !((defined(_MIPS_SIM_ABI32) && _MIPS_SIM == _MIPS_SIM_ABI32) || (defined(_ABIO32) && _MIPS_SIM == _ABIO32)) #error "Only o32 ABI supported for MIPS32" #undef LJ_TARGET_MIPS #endif #if LJ_TARGET_MIPSR6 /* Not that useful, since most available r6 CPUs are 64 bit. */ #error "No support for MIPS32R6" #undef LJ_TARGET_MIPS #endif #elif LJ_TARGET_MIPS64 #if !((defined(_MIPS_SIM_ABI64) && _MIPS_SIM == _MIPS_SIM_ABI64) || (defined(_ABI64) && _MIPS_SIM == _ABI64)) /* MIPS32ON64 aka n32 ABI support might be desirable, but difficult. */ #error "Only n64 ABI supported for MIPS64" #undef LJ_TARGET_MIPS #endif #endif #endif /* -- Derived defines ----------------------------------------------------- */ /* 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 /* 64 bit GC references. */ #if LJ_TARGET_GC64 #define LJ_GC64 1 #else #define LJ_GC64 0 #endif /* 2-slot frame info. */ #if LJ_GC64 #define LJ_FR2 1 #else #define LJ_FR2 0 #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 /* Disable or enable the string buffer extension. */ #if defined(LUAJIT_DISABLE_BUFFER) #define LJ_HASBUFFER 0 #else #define LJ_HASBUFFER 1 #endif #if defined(LUAJIT_DISABLE_PROFILE) #define LJ_HASPROFILE 0 #elif LJ_TARGET_POSIX #define LJ_HASPROFILE 1 #define LJ_PROFILE_SIGPROF 1 #elif LJ_TARGET_PS3 #define LJ_HASPROFILE 1 #define LJ_PROFILE_PTHREAD 1 #elif LJ_TARGET_WINDOWS || LJ_TARGET_XBOX360 #define LJ_HASPROFILE 1 #define LJ_PROFILE_WTHREAD 1 #else #define LJ_HASPROFILE 0 #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) #define LJ_SOFTFP32 (LJ_SOFTFP && LJ_32) #ifndef LJ_ABI_PAUTH #define LJ_ABI_PAUTH 0 #endif #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 #ifndef LJ_PAGESIZE #define LJ_PAGESIZE 4096 #endif /* Various workarounds for embedded operating systems or weak C runtimes. */ #if defined(__ANDROID__) || defined(__symbian__) || LJ_TARGET_XBOX360 || LJ_TARGET_WINDOWS #define LUAJIT_NO_LOG2 #endif #if LJ_TARGET_CONSOLE || (LJ_TARGET_IOS && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0) #define LJ_NO_SYSTEM 1 #endif #if LJ_TARGET_WINDOWS || LJ_TARGET_CYGWIN #define LJ_ABI_WIN 1 #else #define LJ_ABI_WIN 0 #endif #if LJ_TARGET_WINDOWS #if LJ_TARGET_UWP #define LJ_WIN_VALLOC VirtualAllocFromApp #define LJ_WIN_VPROTECT VirtualProtectFromApp extern void *LJ_WIN_LOADLIBA(const char *path); #else #define LJ_WIN_VALLOC VirtualAlloc #define LJ_WIN_VPROTECT VirtualProtect #define LJ_WIN_LOADLIBA(path) LoadLibraryExA((path), NULL, 0) #endif #endif #if defined(LUAJIT_NO_UNWIND) || __GNU_COMPACT_EH__ || defined(__symbian__) || LJ_TARGET_IOS || LJ_TARGET_PS3 || LJ_TARGET_PS4 || LJ_TARGET_PS5 #define LJ_NO_UNWIND 1 #endif #if !LJ_NO_UNWIND && !defined(LUAJIT_UNWIND_INTERNAL) && (LJ_ABI_WIN || (defined(LUAJIT_UNWIND_EXTERNAL) && (defined(__GNUC__) || defined(__clang__)))) #define LJ_UNWIND_EXT 1 #else #define LJ_UNWIND_EXT 0 #endif #if LJ_UNWIND_EXT && LJ_HASJIT && !LJ_TARGET_ARM && !(LJ_ABI_WIN && LJ_TARGET_X86) #define LJ_UNWIND_JIT 1 #else #define LJ_UNWIND_JIT 0 #endif /* Compatibility with Lua 5.1 vs. 5.2. */ #ifdef LUAJIT_ENABLE_LUA52COMPAT #define LJ_52 1 #else #define LJ_52 0 #endif /* -- VM security --------------------------------------------------------- */ /* Don't make any changes here. Instead build with: ** make "XCFLAGS=-DLUAJIT_SECURITY_flag=value" ** ** Important note to distro maintainers: DO NOT change the defaults for a ** regular distro build -- neither upwards, nor downwards! ** These build-time configurable security flags are intended for embedders ** who may have specific needs wrt. security vs. performance. */ /* Security defaults. */ #ifndef LUAJIT_SECURITY_PRNG /* PRNG init: 0 = fixed/insecure, 1 = secure from OS. */ #define LUAJIT_SECURITY_PRNG 1 #endif #ifndef LUAJIT_SECURITY_STRHASH /* String hash: 0 = sparse only, 1 = sparse + dense. */ #define LUAJIT_SECURITY_STRHASH 1 #endif #ifndef LUAJIT_SECURITY_STRID /* String IDs: 0 = linear, 1 = reseed < 255, 2 = reseed < 15, 3 = random. */ #define LUAJIT_SECURITY_STRID 1 #endif #ifndef LUAJIT_SECURITY_MCODE /* Machine code page protection: 0 = insecure RWX, 1 = secure RW^X. */ #define LUAJIT_SECURITY_MCODE 1 #endif #define LJ_SECURITY_MODE \ ( 0u \ | ((LUAJIT_SECURITY_PRNG & 3) << 0) \ | ((LUAJIT_SECURITY_STRHASH & 3) << 2) \ | ((LUAJIT_SECURITY_STRID & 3) << 4) \ | ((LUAJIT_SECURITY_MCODE & 3) << 6) \ ) #define LJ_SECURITY_MODESTRING \ "\004prng\007strhash\005strid\005mcode" #endif subprojects/luajit/src/lib_buffer.c0000644000175000017500000002155114741067622016746 0ustar aniolaniol/* ** Buffer library. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #define lib_buffer_c #define LUA_LIB #include "lua.h" #include "lauxlib.h" #include "lualib.h" #include "lj_obj.h" #if LJ_HASBUFFER #include "lj_gc.h" #include "lj_err.h" #include "lj_buf.h" #include "lj_str.h" #include "lj_tab.h" #include "lj_udata.h" #include "lj_meta.h" #if LJ_HASFFI #include "lj_ctype.h" #include "lj_cdata.h" #include "lj_cconv.h" #endif #include "lj_strfmt.h" #include "lj_serialize.h" #include "lj_lib.h" /* -- Helper functions ---------------------------------------------------- */ /* Check that the first argument is a string buffer. */ static SBufExt *buffer_tobuf(lua_State *L) { if (!(L->base < L->top && tvisbuf(L->base))) lj_err_argtype(L, 1, "buffer"); return bufV(L->base); } /* Ditto, but for writers. */ static LJ_AINLINE SBufExt *buffer_tobufw(lua_State *L) { SBufExt *sbx = buffer_tobuf(L); setsbufXL_(sbx, L); return sbx; } #define buffer_toudata(sbx) ((GCudata *)(sbx)-1) /* -- Buffer methods ------------------------------------------------------ */ #define LJLIB_MODULE_buffer_method LJLIB_CF(buffer_method_free) { SBufExt *sbx = buffer_tobuf(L); lj_bufx_free(L, sbx); L->top = L->base+1; /* Chain buffer object. */ return 1; } LJLIB_CF(buffer_method_reset) LJLIB_REC(.) { SBufExt *sbx = buffer_tobuf(L); lj_bufx_reset(sbx); L->top = L->base+1; /* Chain buffer object. */ return 1; } LJLIB_CF(buffer_method_skip) LJLIB_REC(.) { SBufExt *sbx = buffer_tobuf(L); MSize n = (MSize)lj_lib_checkintrange(L, 2, 0, LJ_MAX_BUF); MSize len = sbufxlen(sbx); if (n < len) { sbx->r += n; } else if (sbufiscow(sbx)) { sbx->r = sbx->w; } else { sbx->r = sbx->w = sbx->b; } L->top = L->base+1; /* Chain buffer object. */ return 1; } LJLIB_CF(buffer_method_set) LJLIB_REC(.) { SBufExt *sbx = buffer_tobuf(L); GCobj *ref; const char *p; MSize len; #if LJ_HASFFI if (tviscdata(L->base+1)) { CTState *cts = ctype_cts(L); lj_cconv_ct_tv(cts, ctype_get(cts, CTID_P_CVOID), (uint8_t *)&p, L->base+1, CCF_ARG(2)); len = (MSize)lj_lib_checkintrange(L, 3, 0, LJ_MAX_BUF); } else #endif { GCstr *str = lj_lib_checkstrx(L, 2); p = strdata(str); len = str->len; } lj_bufx_free(L, sbx); lj_bufx_set_cow(L, sbx, p, len); ref = gcV(L->base+1); setgcref(sbx->cowref, ref); lj_gc_objbarrier(L, buffer_toudata(sbx), ref); L->top = L->base+1; /* Chain buffer object. */ return 1; } LJLIB_CF(buffer_method_put) LJLIB_REC(.) { SBufExt *sbx = buffer_tobufw(L); ptrdiff_t arg, narg = L->top - L->base; for (arg = 1; arg < narg; arg++) { cTValue *o = &L->base[arg], *mo = NULL; retry: if (tvisstr(o)) { lj_buf_putstr((SBuf *)sbx, strV(o)); } else if (tvisint(o)) { lj_strfmt_putint((SBuf *)sbx, intV(o)); } else if (tvisnum(o)) { lj_strfmt_putfnum((SBuf *)sbx, STRFMT_G14, numV(o)); } else if (tvisbuf(o)) { SBufExt *sbx2 = bufV(o); if (sbx2 == sbx) lj_err_arg(L, (int)(arg+1), LJ_ERR_BUFFER_SELF); lj_buf_putmem((SBuf *)sbx, sbx2->r, sbufxlen(sbx2)); } else if (!mo && !tvisnil(mo = lj_meta_lookup(L, o, MM_tostring))) { /* Call __tostring metamethod inline. */ copyTV(L, L->top++, mo); copyTV(L, L->top++, o); lua_call(L, 1, 1); o = &L->base[arg]; /* The stack may have been reallocated. */ copyTV(L, &L->base[arg], L->top-1); L->top = L->base + narg; goto retry; /* Retry with the result. */ } else { lj_err_argtype(L, (int)(arg+1), "string/number/__tostring"); } /* Probably not useful to inline other __tostring MMs, e.g. FFI numbers. */ } L->top = L->base+1; /* Chain buffer object. */ lj_gc_check(L); return 1; } LJLIB_CF(buffer_method_putf) LJLIB_REC(.) { SBufExt *sbx = buffer_tobufw(L); lj_strfmt_putarg(L, (SBuf *)sbx, 2, 2); L->top = L->base+1; /* Chain buffer object. */ lj_gc_check(L); return 1; } LJLIB_CF(buffer_method_get) LJLIB_REC(.) { SBufExt *sbx = buffer_tobuf(L); ptrdiff_t arg, narg = L->top - L->base; if (narg == 1) { narg++; setnilV(L->top++); /* get() is the same as get(nil). */ } for (arg = 1; arg < narg; arg++) { TValue *o = &L->base[arg]; MSize n = tvisnil(o) ? LJ_MAX_BUF : (MSize) lj_lib_checkintrange(L, (int)(arg+1), 0, LJ_MAX_BUF); MSize len = sbufxlen(sbx); if (n > len) n = len; setstrV(L, o, lj_str_new(L, sbx->r, n)); sbx->r += n; } if (sbx->r == sbx->w && !sbufiscow(sbx)) sbx->r = sbx->w = sbx->b; lj_gc_check(L); return (int)(narg-1); } #if LJ_HASFFI LJLIB_CF(buffer_method_putcdata) LJLIB_REC(.) { SBufExt *sbx = buffer_tobufw(L); const char *p; MSize len; if (tviscdata(L->base+1)) { CTState *cts = ctype_cts(L); lj_cconv_ct_tv(cts, ctype_get(cts, CTID_P_CVOID), (uint8_t *)&p, L->base+1, CCF_ARG(2)); } else { lj_err_argtype(L, 2, "cdata"); } len = (MSize)lj_lib_checkintrange(L, 3, 0, LJ_MAX_BUF); lj_buf_putmem((SBuf *)sbx, p, len); L->top = L->base+1; /* Chain buffer object. */ return 1; } LJLIB_CF(buffer_method_reserve) LJLIB_REC(.) { SBufExt *sbx = buffer_tobufw(L); MSize sz = (MSize)lj_lib_checkintrange(L, 2, 0, LJ_MAX_BUF); GCcdata *cd; lj_buf_more((SBuf *)sbx, sz); ctype_loadffi(L); cd = lj_cdata_new_(L, CTID_P_UINT8, CTSIZE_PTR); *(void **)cdataptr(cd) = sbx->w; setcdataV(L, L->top++, cd); setintV(L->top++, sbufleft(sbx)); return 2; } LJLIB_CF(buffer_method_commit) LJLIB_REC(.) { SBufExt *sbx = buffer_tobuf(L); MSize len = (MSize)lj_lib_checkintrange(L, 2, 0, LJ_MAX_BUF); if (len > sbufleft(sbx)) lj_err_arg(L, 2, LJ_ERR_NUMRNG); sbx->w += len; L->top = L->base+1; /* Chain buffer object. */ return 1; } LJLIB_CF(buffer_method_ref) LJLIB_REC(.) { SBufExt *sbx = buffer_tobuf(L); GCcdata *cd; ctype_loadffi(L); cd = lj_cdata_new_(L, CTID_P_UINT8, CTSIZE_PTR); *(void **)cdataptr(cd) = sbx->r; setcdataV(L, L->top++, cd); setintV(L->top++, sbufxlen(sbx)); return 2; } #endif LJLIB_CF(buffer_method_encode) LJLIB_REC(.) { SBufExt *sbx = buffer_tobufw(L); cTValue *o = lj_lib_checkany(L, 2); lj_serialize_put(sbx, o); lj_gc_check(L); L->top = L->base+1; /* Chain buffer object. */ return 1; } LJLIB_CF(buffer_method_decode) LJLIB_REC(.) { SBufExt *sbx = buffer_tobufw(L); setnilV(L->top++); sbx->r = lj_serialize_get(sbx, L->top-1); lj_gc_check(L); return 1; } LJLIB_CF(buffer_method___gc) { SBufExt *sbx = buffer_tobuf(L); lj_bufx_free(L, sbx); return 0; } LJLIB_CF(buffer_method___tostring) LJLIB_REC(.) { SBufExt *sbx = buffer_tobuf(L); setstrV(L, L->top-1, lj_str_new(L, sbx->r, sbufxlen(sbx))); lj_gc_check(L); return 1; } LJLIB_CF(buffer_method___len) LJLIB_REC(.) { SBufExt *sbx = buffer_tobuf(L); setintV(L->top-1, (int32_t)sbufxlen(sbx)); return 1; } LJLIB_PUSH("buffer") LJLIB_SET(__metatable) LJLIB_PUSH(top-1) LJLIB_SET(__index) /* -- Buffer library functions -------------------------------------------- */ #define LJLIB_MODULE_buffer LJLIB_PUSH(top-2) LJLIB_SET(!) /* Set environment. */ LJLIB_CF(buffer_new) { MSize sz = 0; int targ = 1; GCtab *env, *dict_str = NULL, *dict_mt = NULL; GCudata *ud; SBufExt *sbx; if (L->base < L->top && !tvistab(L->base)) { targ = 2; if (!tvisnil(L->base)) sz = (MSize)lj_lib_checkintrange(L, 1, 0, LJ_MAX_BUF); } if (L->base+targ-1 < L->top) { GCtab *options = lj_lib_checktab(L, targ); cTValue *opt_dict, *opt_mt; opt_dict = lj_tab_getstr(options, lj_str_newlit(L, "dict")); if (opt_dict && tvistab(opt_dict)) { dict_str = tabV(opt_dict); lj_serialize_dict_prep_str(L, dict_str); } opt_mt = lj_tab_getstr(options, lj_str_newlit(L, "metatable")); if (opt_mt && tvistab(opt_mt)) { dict_mt = tabV(opt_mt); lj_serialize_dict_prep_mt(L, dict_mt); } } env = tabref(curr_func(L)->c.env); ud = lj_udata_new(L, sizeof(SBufExt), env); ud->udtype = UDTYPE_BUFFER; /* NOBARRIER: The GCudata is new (marked white). */ setgcref(ud->metatable, obj2gco(env)); setudataV(L, L->top++, ud); sbx = (SBufExt *)uddata(ud); lj_bufx_init(L, sbx); setgcref(sbx->dict_str, obj2gco(dict_str)); setgcref(sbx->dict_mt, obj2gco(dict_mt)); if (sz > 0) lj_buf_need2((SBuf *)sbx, sz); lj_gc_check(L); return 1; } LJLIB_CF(buffer_encode) LJLIB_REC(.) { cTValue *o = lj_lib_checkany(L, 1); setstrV(L, L->top++, lj_serialize_encode(L, o)); lj_gc_check(L); return 1; } LJLIB_CF(buffer_decode) LJLIB_REC(.) { GCstr *str = lj_lib_checkstrx(L, 1); setnilV(L->top++); lj_serialize_decode(L, L->top-1, str); lj_gc_check(L); return 1; } /* ------------------------------------------------------------------------ */ #include "lj_libdef.h" int luaopen_string_buffer(lua_State *L) { LJ_LIB_REG(L, NULL, buffer_method); lua_getfield(L, -1, "__tostring"); lua_setfield(L, -2, "tostring"); LJ_LIB_REG(L, NULL, buffer); return 1; } #endif subprojects/luajit/src/lj_crecord.h0000644000175000017500000000367314741067622016767 0ustar aniolaniol/* ** Trace recorder for C data operations. ** Copyright (C) 2005-2023 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 recff_bit64_tobit(jit_State *J, RecordFFData *rd); LJ_FUNC int LJ_FASTCALL recff_bit64_unary(jit_State *J, RecordFFData *rd); LJ_FUNC int LJ_FASTCALL recff_bit64_nary(jit_State *J, RecordFFData *rd); LJ_FUNC int LJ_FASTCALL recff_bit64_shift(jit_State *J, RecordFFData *rd); LJ_FUNC TRef recff_bit64_tohex(jit_State *J, RecordFFData *rd, TRef hdr); LJ_FUNC void LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd); LJ_FUNC TRef lj_crecord_loadiu64(jit_State *J, TRef tr, cTValue *o); #if LJ_HASBUFFER LJ_FUNC TRef lj_crecord_topcvoid(jit_State *J, TRef tr, cTValue *o); LJ_FUNC TRef lj_crecord_topuint8(jit_State *J, TRef tr); #endif #endif #endif subprojects/luajit/src/lj_debug.c0000644000175000017500000004737614741067622016437 0ustar aniolaniol/* ** Debugging and introspection. ** Copyright (C) 2005-2023 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_buf.h" #include "lj_tab.h" #include "lj_state.h" #include "lj_frame.h" #include "lj_bc.h" #include "lj_strfmt.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)+LJ_FR2; /* Traverse frames backwards. */ for (nextframe = frame = L->base-1; frame > bot; ) { if (frame_gc(frame) == obj2gco(L)) level++; /* Skip dummy frames. See lj_err_optype_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; lj_assertL(fn->c.gct == ~LJ_TFUNC || fn->c.gct == ~LJ_TTHREAD, "function or frame expected"); 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. */ if (!ins) return NO_BCPOS; } 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) || (frame_iscont(f) && frame_iscont_fficb(f))) cf = cframe_raw(cframe_prev(cf)); f = frame_prevd(f); } } ins = cframe_pc(cf); if (!ins) return NO_BCPOS; } } 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. */ if (bc_isret(bc_op(ins[-1]))) { GCtrace *T = (GCtrace *)((char *)(ins-1) - offsetof(GCtrace, startins)); pos = proto_bcpos(pt, mref(T->startpc, const BCIns)); } else { pos = NO_BCPOS; /* Punt in case of stack overflow for stitched trace. */ } } #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); lj_assertL(pc <= pt->sizebc, "PC out of range"); return lj_debug_line(pt, pc); } return -1; } /* -- Variable names ------------------------------------------------------ */ /* Get name of a local variable from slot number and PC. */ static const char *debug_varname(const GCproto *pt, BCPos pc, BCReg slot) { const char *p = (const char *)proto_varinfo(pt); if (p) { BCPos lastpc = 0; for (;;) { const char *name = p; uint32_t vn = *(const uint8_t *)p; BCPos startpc, endpc; if (vn < VARNAME__MAX) { if (vn == VARNAME_END) break; /* End of varinfo. */ } else { do { p++; } while (*(const uint8_t *)p); /* Skip over variable name. */ } p++; lastpc = startpc = lastpc + lj_buf_ruleb128(&p); if (startpc > pc) break; endpc = startpc + lj_buf_ruleb128(&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+LJ_FR2; 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+LJ_FR2 < 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+LJ_FR2 < 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); lj_assertX(idx < pt->sizeuv, "bad upvalue index"); 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, GCobj **op) { if (tvisfunc(o)) { GCfunc *fn = funcV(o); if (isluafunc(fn)) { GCproto *pt = funcproto(fn); if (idx < pt->sizeuv) { GCobj *uvo = gcref(fn->l.uvptr[idx]); *tvp = uvval(&uvo->uv); *op = uvo; return lj_debug_uvname(pt, idx); } } else { if (idx < fn->c.nupvalues) { *tvp = &fn->c.upvalue[idx]; *op = obj2gco(fn); 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+LJ_FR2 && 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, cTValue *frame, const char **name) { cTValue *pframe; GCfunc *fn; BCPos pc; if (frame <= tvref(L->stack)+LJ_FR2) 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, BCLine line) { 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"] or [builtin:name]. */ 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, line == ~(BCLine)0 ? "[builtin:" : "[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, line == ~(BCLine)0 ? "]" : "\"]"); } } /* 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) { GCproto *pt = funcproto(fn); char buf[LUA_IDSIZE]; lj_debug_shortname(buf, proto_chunkname(pt), pt->firstline); lj_strfmt_pushf(L, "%s:%d: %s", buf, line, msg); return; } } } lj_strfmt_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 (pt->firstline == ~(BCLine)0) { lj_strfmt_pushf(L, "builtin:%s", s); } else if (*s == '@') { s++; len--; for (i = len; i > 0; i--) if (s[i] == '/' || s[i] == '\\') { s += i+1; break; } lj_strfmt_pushf(L, "%s:%d", s, line); } else if (len > 40) { lj_strfmt_pushf(L, "%p:%d", pt, line); } else if (*s == '=') { lj_strfmt_pushf(L, "%s:%d", s+1, line); } else { lj_strfmt_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; if (!tvisfunc(func)) return 0; 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; lj_assertL(offset != 0, "bad frame offset"); frame = tvref(L->stack) + offset; if (size) nextframe = frame + size; lj_assertL(frame <= tvref(L->maxstack) && (!nextframe || nextframe <= tvref(L->maxstack)), "broken frame chain"); fn = frame_func(frame); lj_assertL(fn->c.gct == ~LJ_TFUNC, "bad frame function"); } 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, pt->firstline); 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; } } #if LJ_HASPROFILE /* Put the chunkname into a buffer. */ static int debug_putchunkname(SBuf *sb, GCproto *pt, int pathstrip) { GCstr *name = proto_chunkname(pt); const char *p = strdata(name); if (pt->firstline == ~(BCLine)0) { lj_buf_putmem(sb, "[builtin:", 9); lj_buf_putstr(sb, name); lj_buf_putb(sb, ']'); return 0; } if (*p == '=' || *p == '@') { MSize len = name->len-1; p++; if (pathstrip) { int i; for (i = len-1; i >= 0; i--) if (p[i] == '/' || p[i] == '\\') { len -= i+1; p = p+i+1; break; } } lj_buf_putmem(sb, p, len); } else { lj_buf_putmem(sb, "[string]", 8); } return 1; } /* Put a compact stack dump into a buffer. */ void lj_debug_dumpstack(lua_State *L, SBuf *sb, const char *fmt, int depth) { int level = 0, dir = 1, pathstrip = 1; MSize lastlen = 0; if (depth < 0) { level = ~depth; depth = dir = -1; } /* Reverse frames. */ while (level != depth) { /* Loop through all frame. */ int size; cTValue *frame = lj_debug_frame(L, level, &size); if (frame) { cTValue *nextframe = size ? frame+size : NULL; GCfunc *fn = frame_func(frame); const uint8_t *p = (const uint8_t *)fmt; int c; while ((c = *p++)) { switch (c) { case 'p': /* Preserve full path. */ pathstrip = 0; break; case 'F': case 'f': { /* Dump function name. */ const char *name; const char *what = lj_debug_funcname(L, frame, &name); if (what) { if (c == 'F' && isluafunc(fn)) { /* Dump module:name for 'F'. */ GCproto *pt = funcproto(fn); if (pt->firstline != ~(BCLine)0) { /* Not a bytecode builtin. */ debug_putchunkname(sb, pt, pathstrip); lj_buf_putb(sb, ':'); } } lj_buf_putmem(sb, name, (MSize)strlen(name)); break; } /* else: can't derive a name, dump module:line. */ } /* fallthrough */ case 'l': /* Dump module:line. */ if (isluafunc(fn)) { GCproto *pt = funcproto(fn); if (debug_putchunkname(sb, pt, pathstrip)) { /* Regular Lua function. */ BCLine line = c == 'l' ? debug_frameline(L, fn, nextframe) : pt->firstline; lj_buf_putb(sb, ':'); lj_strfmt_putint(sb, line >= 0 ? line : pt->firstline); } } else if (isffunc(fn)) { /* Dump numbered builtins. */ lj_buf_putmem(sb, "[builtin#", 9); lj_strfmt_putint(sb, fn->c.ffid); lj_buf_putb(sb, ']'); } else { /* Dump C function address. */ lj_buf_putb(sb, '@'); lj_strfmt_putptr(sb, fn->c.f); } break; case 'Z': /* Zap trailing separator. */ lastlen = sbuflen(sb); break; default: lj_buf_putb(sb, c); break; } } } else if (dir == 1) { break; } else { level -= size; /* Reverse frame order: quickly skip missing level. */ } level += dir; } if (lastlen) sb->w = sb->b + lastlen; /* Zap trailing separator. */ } #endif /* 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); } subprojects/luajit/src/lj_strfmt_num.c0000644000175000017500000004773114741067622017542 0ustar aniolaniol/* ** String formatting for floating-point numbers. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h ** Contributed by Peter Cawley. */ #include #define lj_strfmt_num_c #define LUA_CORE #include "lj_obj.h" #include "lj_buf.h" #include "lj_str.h" #include "lj_strfmt.h" /* -- Precomputed tables -------------------------------------------------- */ /* Rescale factors to push the exponent of a number towards zero. */ #define RESCALE_EXPONENTS(P, N) \ P(308), P(289), P(270), P(250), P(231), P(212), P(193), P(173), P(154), \ P(135), P(115), P(96), P(77), P(58), P(38), P(0), P(0), P(0), N(39), N(58), \ N(77), N(96), N(116), N(135), N(154), N(174), N(193), N(212), N(231), \ N(251), N(270), N(289) #define ONE_E_P(X) 1e+0 ## X #define ONE_E_N(X) 1e-0 ## X static const int16_t rescale_e[] = { RESCALE_EXPONENTS(-, +) }; static const double rescale_n[] = { RESCALE_EXPONENTS(ONE_E_P, ONE_E_N) }; #undef ONE_E_N #undef ONE_E_P /* ** For p in range -70 through 57, this table encodes pairs (m, e) such that ** 4*2^p <= (uint8_t)m*10^e, and is the smallest value for which this holds. */ static const int8_t four_ulp_m_e[] = { 34, -21, 68, -21, 14, -20, 28, -20, 55, -20, 2, -19, 3, -19, 5, -19, 9, -19, -82, -18, 35, -18, 7, -17, -117, -17, 28, -17, 56, -17, 112, -16, -33, -16, 45, -16, 89, -16, -78, -15, 36, -15, 72, -15, -113, -14, 29, -14, 57, -14, 114, -13, -28, -13, 46, -13, 91, -12, -74, -12, 37, -12, 73, -12, 15, -11, 3, -11, 59, -11, 2, -10, 3, -10, 5, -10, 1, -9, -69, -9, 38, -9, 75, -9, 15, -7, 3, -7, 6, -7, 12, -6, -17, -7, 48, -7, 96, -7, -65, -6, 39, -6, 77, -6, -103, -5, 31, -5, 62, -5, 123, -4, -11, -4, 49, -4, 98, -4, -60, -3, 4, -2, 79, -3, 16, -2, 32, -2, 63, -2, 2, -1, 25, 0, 5, 1, 1, 2, 2, 2, 4, 2, 8, 2, 16, 2, 32, 2, 64, 2, -128, 2, 26, 2, 52, 2, 103, 3, -51, 3, 41, 4, 82, 4, -92, 4, 33, 4, 66, 4, -124, 5, 27, 5, 53, 5, 105, 6, 21, 6, 42, 6, 84, 6, 17, 7, 34, 7, 68, 7, 2, 8, 3, 8, 6, 8, 108, 9, -41, 9, 43, 10, 86, 9, -84, 10, 35, 10, 69, 10, -118, 11, 28, 11, 55, 12, 11, 13, 22, 13, 44, 13, 88, 13, -80, 13, 36, 13, 71, 13, -115, 14, 29, 14, 57, 14, 113, 15, -30, 15, 46, 15, 91, 15, 19, 16, 37, 16, 73, 16, 2, 17, 3, 17, 6, 17 }; /* min(2^32-1, 10^e-1) for e in range 0 through 10 */ static uint32_t ndigits_dec_threshold[] = { 0, 9U, 99U, 999U, 9999U, 99999U, 999999U, 9999999U, 99999999U, 999999999U, 0xffffffffU }; /* -- Helper functions ---------------------------------------------------- */ /* Compute the number of digits in the decimal representation of x. */ static MSize ndigits_dec(uint32_t x) { MSize t = ((lj_fls(x | 1) * 77) >> 8) + 1; /* 2^8/77 is roughly log2(10) */ return t + (x > ndigits_dec_threshold[t]); } #define WINT_R(x, sh, sc) \ { uint32_t d = (x*(((1<>sh; x -= d*sc; *p++ = (char)('0'+d); } /* Write 9-digit unsigned integer to buffer. */ static char *lj_strfmt_wuint9(char *p, uint32_t u) { uint32_t v = u / 10000, w; u -= v * 10000; w = v / 10000; v -= w * 10000; *p++ = (char)('0'+w); WINT_R(v, 23, 1000) WINT_R(v, 12, 100) WINT_R(v, 10, 10) *p++ = (char)('0'+v); WINT_R(u, 23, 1000) WINT_R(u, 12, 100) WINT_R(u, 10, 10) *p++ = (char)('0'+u); return p; } #undef WINT_R /* -- Extended precision arithmetic --------------------------------------- */ /* ** The "nd" format is a fixed-precision decimal representation for numbers. It ** consists of up to 64 uint32_t values, with each uint32_t storing a value ** in the range [0, 1e9). A number in "nd" format consists of three variables: ** ** uint32_t nd[64]; ** uint32_t ndlo; ** uint32_t ndhi; ** ** The integral part of the number is stored in nd[0 ... ndhi], the value of ** which is sum{i in [0, ndhi] | nd[i] * 10^(9*i)}. If the fractional part of ** the number is zero, ndlo is zero. Otherwise, the fractional part is stored ** in nd[ndlo ... 63], the value of which is taken to be ** sum{i in [ndlo, 63] | nd[i] * 10^(9*(i-64))}. ** ** If the array part had 128 elements rather than 64, then every double would ** have an exact representation in "nd" format. With 64 elements, all integral ** doubles have an exact representation, and all non-integral doubles have ** enough digits to make both %.99e and %.99f do the right thing. */ #if LJ_64 #define ND_MUL2K_MAX_SHIFT 29 #define ND_MUL2K_DIV1E9(val) ((uint32_t)((val) / 1000000000)) #else #define ND_MUL2K_MAX_SHIFT 11 #define ND_MUL2K_DIV1E9(val) ((uint32_t)((val) >> 9) / 1953125) #endif /* Multiply nd by 2^k and add carry_in (ndlo is assumed to be zero). */ static uint32_t nd_mul2k(uint32_t* nd, uint32_t ndhi, uint32_t k, uint32_t carry_in, SFormat sf) { uint32_t i, ndlo = 0, start = 1; /* Performance hacks. */ if (k > ND_MUL2K_MAX_SHIFT*2 && STRFMT_FP(sf) != STRFMT_FP(STRFMT_T_FP_F)) { start = ndhi - (STRFMT_PREC(sf) + 17) / 8; } /* Real logic. */ while (k >= ND_MUL2K_MAX_SHIFT) { for (i = ndlo; i <= ndhi; i++) { uint64_t val = ((uint64_t)nd[i] << ND_MUL2K_MAX_SHIFT) | carry_in; carry_in = ND_MUL2K_DIV1E9(val); nd[i] = (uint32_t)val - carry_in * 1000000000; } if (carry_in) { nd[++ndhi] = carry_in; carry_in = 0; if (start++ == ndlo) ++ndlo; } k -= ND_MUL2K_MAX_SHIFT; } if (k) { for (i = ndlo; i <= ndhi; i++) { uint64_t val = ((uint64_t)nd[i] << k) | carry_in; carry_in = ND_MUL2K_DIV1E9(val); nd[i] = (uint32_t)val - carry_in * 1000000000; } if (carry_in) nd[++ndhi] = carry_in; } return ndhi; } /* Divide nd by 2^k (ndlo is assumed to be zero). */ static uint32_t nd_div2k(uint32_t* nd, uint32_t ndhi, uint32_t k, SFormat sf) { uint32_t ndlo = 0, stop1 = ~0, stop2 = ~0; /* Performance hacks. */ if (!ndhi) { if (!nd[0]) { return 0; } else { uint32_t s = lj_ffs(nd[0]); if (s >= k) { nd[0] >>= k; return 0; } nd[0] >>= s; k -= s; } } if (k > 18) { if (STRFMT_FP(sf) == STRFMT_FP(STRFMT_T_FP_F)) { stop1 = 63 - (int32_t)STRFMT_PREC(sf) / 9; } else { int32_t floorlog2 = ndhi * 29 + lj_fls(nd[ndhi]) - k; int32_t floorlog10 = (int32_t)(floorlog2 * 0.30102999566398114); stop1 = 62 + (floorlog10 - (int32_t)STRFMT_PREC(sf)) / 9; stop2 = 61 + ndhi - (int32_t)STRFMT_PREC(sf) / 8; } } /* Real logic. */ while (k >= 9) { uint32_t i = ndhi, carry = 0; for (;;) { uint32_t val = nd[i]; nd[i] = (val >> 9) + carry; carry = (val & 0x1ff) * 1953125; if (i == ndlo) break; i = (i - 1) & 0x3f; } if (ndlo != stop1 && ndlo != stop2) { if (carry) { ndlo = (ndlo - 1) & 0x3f; nd[ndlo] = carry; } if (!nd[ndhi]) { ndhi = (ndhi - 1) & 0x3f; stop2--; } } else if (!nd[ndhi]) { if (ndhi != ndlo) { ndhi = (ndhi - 1) & 0x3f; stop2--; } else return ndlo; } k -= 9; } if (k) { uint32_t mask = (1U << k) - 1, mul = 1000000000 >> k, i = ndhi, carry = 0; for (;;) { uint32_t val = nd[i]; nd[i] = (val >> k) + carry; carry = (val & mask) * mul; if (i == ndlo) break; i = (i - 1) & 0x3f; } if (carry) { ndlo = (ndlo - 1) & 0x3f; nd[ndlo] = carry; } } return ndlo; } /* Add m*10^e to nd (assumes ndlo <= e/9 <= ndhi and 0 <= m <= 9). */ static uint32_t nd_add_m10e(uint32_t* nd, uint32_t ndhi, uint8_t m, int32_t e) { uint32_t i, carry; if (e >= 0) { i = (uint32_t)e/9; carry = m * (ndigits_dec_threshold[e - (int32_t)i*9] + 1); } else { int32_t f = (e-8)/9; i = (uint32_t)(64 + f); carry = m * (ndigits_dec_threshold[e - f*9] + 1); } for (;;) { uint32_t val = nd[i] + carry; if (LJ_UNLIKELY(val >= 1000000000)) { val -= 1000000000; nd[i] = val; if (LJ_UNLIKELY(i == ndhi)) { ndhi = (ndhi + 1) & 0x3f; nd[ndhi] = 1; break; } carry = 1; i = (i + 1) & 0x3f; } else { nd[i] = val; break; } } return ndhi; } /* Test whether two "nd" values are equal in their most significant digits. */ static int nd_similar(uint32_t* nd, uint32_t ndhi, uint32_t* ref, MSize hilen, MSize prec) { char nd9[9], ref9[9]; if (hilen <= prec) { if (LJ_UNLIKELY(nd[ndhi] != *ref)) return 0; prec -= hilen; ref--; ndhi = (ndhi - 1) & 0x3f; if (prec >= 9) { if (LJ_UNLIKELY(nd[ndhi] != *ref)) return 0; prec -= 9; ref--; ndhi = (ndhi - 1) & 0x3f; } } else { prec -= hilen - 9; } lj_assertX(prec < 9, "bad precision %d", prec); lj_strfmt_wuint9(nd9, nd[ndhi]); lj_strfmt_wuint9(ref9, *ref); return !memcmp(nd9, ref9, prec) && (nd9[prec] < '5') == (ref9[prec] < '5'); } /* -- Formatted conversions to buffer ------------------------------------- */ /* Write formatted floating-point number to either sb or p. */ static char *lj_strfmt_wfnum(SBuf *sb, SFormat sf, lua_Number n, char *p) { MSize width = STRFMT_WIDTH(sf), prec = STRFMT_PREC(sf), len; TValue t; t.n = n; if (LJ_UNLIKELY((t.u32.hi << 1) >= 0xffe00000)) { /* Handle non-finite values uniformly for %a, %e, %f, %g. */ int prefix = 0, ch = (sf & STRFMT_F_UPPER) ? 0x202020 : 0; if (((t.u32.hi & 0x000fffff) | t.u32.lo) != 0) { ch ^= ('n' << 16) | ('a' << 8) | 'n'; if ((sf & STRFMT_F_SPACE)) prefix = ' '; } else { ch ^= ('i' << 16) | ('n' << 8) | 'f'; if ((t.u32.hi & 0x80000000)) prefix = '-'; else if ((sf & STRFMT_F_PLUS)) prefix = '+'; else if ((sf & STRFMT_F_SPACE)) prefix = ' '; } len = 3 + (prefix != 0); if (!p) p = lj_buf_more(sb, width > len ? width : len); if (!(sf & STRFMT_F_LEFT)) while (width-- > len) *p++ = ' '; if (prefix) *p++ = prefix; *p++ = (char)(ch >> 16); *p++ = (char)(ch >> 8); *p++ = (char)ch; } else if (STRFMT_FP(sf) == STRFMT_FP(STRFMT_T_FP_A)) { /* %a */ const char *hexdig = (sf & STRFMT_F_UPPER) ? "0123456789ABCDEFPX" : "0123456789abcdefpx"; int32_t e = (t.u32.hi >> 20) & 0x7ff; char prefix = 0, eprefix = '+'; if (t.u32.hi & 0x80000000) prefix = '-'; else if ((sf & STRFMT_F_PLUS)) prefix = '+'; else if ((sf & STRFMT_F_SPACE)) prefix = ' '; t.u32.hi &= 0xfffff; if (e) { t.u32.hi |= 0x100000; e -= 1023; } else if (t.u32.lo | t.u32.hi) { /* Non-zero denormal - normalise it. */ uint32_t shift = t.u32.hi ? 20-lj_fls(t.u32.hi) : 52-lj_fls(t.u32.lo); e = -1022 - shift; t.u64 <<= shift; } /* abs(n) == t.u64 * 2^(e - 52) */ /* If n != 0, bit 52 of t.u64 is set, and is the highest set bit. */ if ((int32_t)prec < 0) { /* Default precision: use smallest precision giving exact result. */ prec = t.u32.lo ? 13-lj_ffs(t.u32.lo)/4 : 5-lj_ffs(t.u32.hi|0x100000)/4; } else if (prec < 13) { /* Precision is sufficiently low as to maybe require rounding. */ t.u64 += (((uint64_t)1) << (51 - prec*4)); } if (e < 0) { eprefix = '-'; e = -e; } len = 5 + ndigits_dec((uint32_t)e) + prec + (prefix != 0) + ((prec | (sf & STRFMT_F_ALT)) != 0); if (!p) p = lj_buf_more(sb, width > len ? width : len); if (!(sf & (STRFMT_F_LEFT | STRFMT_F_ZERO))) { while (width-- > len) *p++ = ' '; } if (prefix) *p++ = prefix; *p++ = '0'; *p++ = hexdig[17]; /* x or X */ if ((sf & (STRFMT_F_LEFT | STRFMT_F_ZERO)) == STRFMT_F_ZERO) { while (width-- > len) *p++ = '0'; } *p++ = '0' + (t.u32.hi >> 20); /* Usually '1', sometimes '0' or '2'. */ if ((prec | (sf & STRFMT_F_ALT))) { /* Emit fractional part. */ char *q = p + 1 + prec; *p = '.'; if (prec < 13) t.u64 >>= (52 - prec*4); else while (prec > 13) p[prec--] = '0'; while (prec) { p[prec--] = hexdig[t.u64 & 15]; t.u64 >>= 4; } p = q; } *p++ = hexdig[16]; /* p or P */ *p++ = eprefix; /* + or - */ p = lj_strfmt_wint(p, e); } else { /* %e or %f or %g - begin by converting n to "nd" format. */ uint32_t nd[64]; uint32_t ndhi = 0, ndlo, i; int32_t e = (t.u32.hi >> 20) & 0x7ff, ndebias = 0; char prefix = 0, *q; if (t.u32.hi & 0x80000000) prefix = '-'; else if ((sf & STRFMT_F_PLUS)) prefix = '+'; else if ((sf & STRFMT_F_SPACE)) prefix = ' '; prec += ((int32_t)prec >> 31) & 7; /* Default precision is 6. */ if (STRFMT_FP(sf) == STRFMT_FP(STRFMT_T_FP_G)) { /* %g - decrement precision if non-zero (to make it like %e). */ prec--; prec ^= (uint32_t)((int32_t)prec >> 31); } if ((sf & STRFMT_T_FP_E) && prec < 14 && n != 0) { /* Precision is sufficiently low that rescaling will probably work. */ if ((ndebias = rescale_e[e >> 6])) { t.n = n * rescale_n[e >> 6]; if (LJ_UNLIKELY(!e)) t.n *= 1e10, ndebias -= 10; t.u64 -= 2; /* Convert 2ulp below (later we convert 2ulp above). */ nd[0] = 0x100000 | (t.u32.hi & 0xfffff); e = ((t.u32.hi >> 20) & 0x7ff) - 1075 - (ND_MUL2K_MAX_SHIFT < 29); goto load_t_lo; rescale_failed: t.n = n; e = (t.u32.hi >> 20) & 0x7ff; ndebias = ndhi = 0; } } nd[0] = t.u32.hi & 0xfffff; if (e == 0) e++; else nd[0] |= 0x100000; e -= 1043; if (t.u32.lo) { e -= 32 + (ND_MUL2K_MAX_SHIFT < 29); load_t_lo: #if ND_MUL2K_MAX_SHIFT >= 29 nd[0] = (nd[0] << 3) | (t.u32.lo >> 29); ndhi = nd_mul2k(nd, ndhi, 29, t.u32.lo & 0x1fffffff, sf); #elif ND_MUL2K_MAX_SHIFT >= 11 ndhi = nd_mul2k(nd, ndhi, 11, t.u32.lo >> 21, sf); ndhi = nd_mul2k(nd, ndhi, 11, (t.u32.lo >> 10) & 0x7ff, sf); ndhi = nd_mul2k(nd, ndhi, 11, (t.u32.lo << 1) & 0x7ff, sf); #else #error "ND_MUL2K_MAX_SHIFT too small" #endif } if (e >= 0) { ndhi = nd_mul2k(nd, ndhi, (uint32_t)e, 0, sf); ndlo = 0; } else { ndlo = nd_div2k(nd, ndhi, (uint32_t)-e, sf); if (ndhi && !nd[ndhi]) ndhi--; } /* abs(n) == nd * 10^ndebias (for slightly loose interpretation of ==) */ if ((sf & STRFMT_T_FP_E)) { /* %e or %g - assume %e and start by calculating nd's exponent (nde). */ char eprefix = '+'; int32_t nde = -1; MSize hilen; if (ndlo && !nd[ndhi]) { ndhi = 64; do {} while (!nd[--ndhi]); nde -= 64 * 9; } hilen = ndigits_dec(nd[ndhi]); nde += ndhi * 9 + hilen; if (ndebias) { /* ** Rescaling was performed, but this introduced some error, and might ** have pushed us across a rounding boundary. We check whether this ** error affected the result by introducing even more error (2ulp in ** either direction), and seeing whether a rounding boundary was ** crossed. Having already converted the -2ulp case, we save off its ** most significant digits, convert the +2ulp case, and compare them. */ int32_t eidx = e + 70 + (ND_MUL2K_MAX_SHIFT < 29) + (t.u32.lo >= 0xfffffffe && !(~t.u32.hi << 12)); const int8_t *m_e = four_ulp_m_e + eidx * 2; lj_assertG_(G(sbufL(sb)), 0 <= eidx && eidx < 128, "bad eidx %d", eidx); nd[33] = nd[ndhi]; nd[32] = nd[(ndhi - 1) & 0x3f]; nd[31] = nd[(ndhi - 2) & 0x3f]; nd_add_m10e(nd, ndhi, (uint8_t)*m_e, m_e[1]); if (LJ_UNLIKELY(!nd_similar(nd, ndhi, nd + 33, hilen, prec + 1))) { goto rescale_failed; } } if ((int32_t)(prec - nde) < (0x3f & -(int32_t)ndlo) * 9) { /* Precision is sufficiently low as to maybe require rounding. */ ndhi = nd_add_m10e(nd, ndhi, 5, nde - prec - 1); nde += (hilen != ndigits_dec(nd[ndhi])); } nde += ndebias; if ((sf & STRFMT_T_FP_F)) { /* %g */ if ((int32_t)prec >= nde && nde >= -4) { if (nde < 0) ndhi = 0; prec -= nde; goto g_format_like_f; } else if (!(sf & STRFMT_F_ALT) && prec && width > 5) { /* Decrease precision in order to strip trailing zeroes. */ char tail[9]; uint32_t maxprec = hilen - 1 + ((ndhi - ndlo) & 0x3f) * 9; if (prec >= maxprec) prec = maxprec; else ndlo = (ndhi - (((int32_t)(prec - hilen) + 9) / 9)) & 0x3f; i = prec - hilen - (((ndhi - ndlo) & 0x3f) * 9) + 10; lj_strfmt_wuint9(tail, nd[ndlo]); while (prec && tail[--i] == '0') { prec--; if (!i) { if (ndlo == ndhi) { prec = 0; break; } ndlo = (ndlo + 1) & 0x3f; lj_strfmt_wuint9(tail, nd[ndlo]); i = 9; } } } } if (nde < 0) { /* Make nde non-negative. */ eprefix = '-'; nde = -nde; } len = 3 + prec + (prefix != 0) + ndigits_dec((uint32_t)nde) + (nde < 10) + ((prec | (sf & STRFMT_F_ALT)) != 0); if (!p) p = lj_buf_more(sb, (width > len ? width : len) + 5); if (!(sf & (STRFMT_F_LEFT | STRFMT_F_ZERO))) { while (width-- > len) *p++ = ' '; } if (prefix) *p++ = prefix; if ((sf & (STRFMT_F_LEFT | STRFMT_F_ZERO)) == STRFMT_F_ZERO) { while (width-- > len) *p++ = '0'; } q = lj_strfmt_wint(p + 1, nd[ndhi]); p[0] = p[1]; /* Put leading digit in the correct place. */ if ((prec | (sf & STRFMT_F_ALT))) { /* Emit fractional part. */ p[1] = '.'; p += 2; prec -= (MSize)(q - p); p = q; /* Account for digits already emitted. */ /* Then emit chunks of 9 digits (this may emit 8 digits too many). */ for (i = ndhi; (int32_t)prec > 0 && i != ndlo; prec -= 9) { i = (i - 1) & 0x3f; p = lj_strfmt_wuint9(p, nd[i]); } if ((sf & STRFMT_T_FP_F) && !(sf & STRFMT_F_ALT)) { /* %g (and not %#g) - strip trailing zeroes. */ p += (int32_t)prec & ((int32_t)prec >> 31); while (p[-1] == '0') p--; if (p[-1] == '.') p--; } else { /* %e (or %#g) - emit trailing zeroes. */ while ((int32_t)prec > 0) { *p++ = '0'; prec--; } p += (int32_t)prec; } } else { p++; } *p++ = (sf & STRFMT_F_UPPER) ? 'E' : 'e'; *p++ = eprefix; /* + or - */ if (nde < 10) *p++ = '0'; /* Always at least two digits of exponent. */ p = lj_strfmt_wint(p, nde); } else { /* %f (or, shortly, %g in %f style) */ if (prec < (MSize)(0x3f & -(int32_t)ndlo) * 9) { /* Precision is sufficiently low as to maybe require rounding. */ ndhi = nd_add_m10e(nd, ndhi, 5, 0 - prec - 1); } g_format_like_f: if ((sf & STRFMT_T_FP_E) && !(sf & STRFMT_F_ALT) && prec && width) { /* Decrease precision in order to strip trailing zeroes. */ if (ndlo) { /* nd has a fractional part; we need to look at its digits. */ char tail[9]; uint32_t maxprec = (64 - ndlo) * 9; if (prec >= maxprec) prec = maxprec; else ndlo = 64 - (prec + 8) / 9; i = prec - ((63 - ndlo) * 9); lj_strfmt_wuint9(tail, nd[ndlo]); while (prec && tail[--i] == '0') { prec--; if (!i) { if (ndlo == 63) { prec = 0; break; } lj_strfmt_wuint9(tail, nd[++ndlo]); i = 9; } } } else { /* nd has no fractional part, so precision goes straight to zero. */ prec = 0; } } len = ndhi * 9 + ndigits_dec(nd[ndhi]) + prec + (prefix != 0) + ((prec | (sf & STRFMT_F_ALT)) != 0); if (!p) p = lj_buf_more(sb, (width > len ? width : len) + 8); if (!(sf & (STRFMT_F_LEFT | STRFMT_F_ZERO))) { while (width-- > len) *p++ = ' '; } if (prefix) *p++ = prefix; if ((sf & (STRFMT_F_LEFT | STRFMT_F_ZERO)) == STRFMT_F_ZERO) { while (width-- > len) *p++ = '0'; } /* Emit integer part. */ p = lj_strfmt_wint(p, nd[ndhi]); i = ndhi; while (i) p = lj_strfmt_wuint9(p, nd[--i]); if ((prec | (sf & STRFMT_F_ALT))) { /* Emit fractional part. */ *p++ = '.'; /* Emit chunks of 9 digits (this may emit 8 digits too many). */ while ((int32_t)prec > 0 && i != ndlo) { i = (i - 1) & 0x3f; p = lj_strfmt_wuint9(p, nd[i]); prec -= 9; } if ((sf & STRFMT_T_FP_E) && !(sf & STRFMT_F_ALT)) { /* %g (and not %#g) - strip trailing zeroes. */ p += (int32_t)prec & ((int32_t)prec >> 31); while (p[-1] == '0') p--; if (p[-1] == '.') p--; } else { /* %f (or %#g) - emit trailing zeroes. */ while ((int32_t)prec > 0) { *p++ = '0'; prec--; } p += (int32_t)prec; } } } } if ((sf & STRFMT_F_LEFT)) while (width-- > len) *p++ = ' '; return p; } /* Add formatted floating-point number to buffer. */ SBuf *lj_strfmt_putfnum(SBuf *sb, SFormat sf, lua_Number n) { sb->w = lj_strfmt_wfnum(sb, sf, n, NULL); return sb; } /* -- Conversions to strings ---------------------------------------------- */ /* Convert number to string. */ GCstr * LJ_FASTCALL lj_strfmt_num(lua_State *L, cTValue *o) { char buf[STRFMT_MAXBUF_NUM]; MSize len = (MSize)(lj_strfmt_wfnum(NULL, STRFMT_G14, o->n, buf) - buf); return lj_str_new(L, buf, len); } subprojects/luajit/src/lj_emit_x86.h0000644000175000017500000003624514741067622017012 0ustar aniolaniol/* ** x86/x64 instruction emitter. ** Copyright (C) 2005-2023 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) #define VEX_64 0x800000 #else #define REXRB(p, rr, rb) ((void)0) #define FORCE_REX 0 #define REX_64 0 #define VEX_64 0 #endif #if LJ_GC64 #define REX_GC64 REX_64 #else #define REX_GC64 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 (n == -60) { /* VEX-encoded instruction */ #if LJ_64 xo ^= (((rr>>1)&4)+((rx>>2)&2)+((rb>>3)&1))<<13; #endif *(uint32_t *)(p+delta-5) = (uint32_t)xo; return p+delta-5; } #if defined(__GNUC__) || defined(__clang__) 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) { lj_assertX((uintptr_t)p < (uintptr_t)0x80000000, "pointer outside 2G range"); return i32ptr(p); } #else #define ptr2addr(p) (i32ptr((p))) #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 (LJ_GC64 && rb == RID_RIP) { mode = XM_OFS0; p -= 4; *(int32_t *)p = ofs; } else 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 (LJ_GC64 && rb == RID_RIP) { lj_assertA(as->mrm.idx == RID_NONE, "RIP-rel mrm cannot have index"); mode = XM_OFS0; p -= 4; *(int32_t *)p = as->mrm.ofs; } 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 --------------------------------------------------- */ /* 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)|REX_GC64, field) #define emit_setgl(as, r, field) emit_opgl(as, XO_MOVto, (r)|REX_GC64, 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/jcc. */ if (i == 0 && !(LJ_32 && (IR(as->curins)->o == IR_HIOP || (as->curins+1 < as->T->nins && IR(as->curins+1)->o == IR_HIOP))) && !((*as->mcp == 0x0f && (as->mcp[1] & 0xf0) == XI_JCCn) || (*as->mcp & 0xf0) == XI_JCCs)) { 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; } } #if LJ_GC64 #define dispofs(as, k) \ ((intptr_t)((uintptr_t)(k) - (uintptr_t)J2GG(as->J)->dispatch)) #define mcpofs(as, k) \ ((intptr_t)((uintptr_t)(k) - (uintptr_t)as->mcp)) #define mctopofs(as, k) \ ((intptr_t)((uintptr_t)(k) - (uintptr_t)as->mctop)) /* mov r, addr */ #define emit_loada(as, r, addr) \ emit_loadu64(as, (r), (uintptr_t)(addr)) #else /* mov r, addr */ #define emit_loada(as, r, addr) \ emit_loadi(as, (r), ptr2addr((addr))) #endif #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); #if LJ_GC64 } else if (checki32(dispofs(as, u64))) { emit_rmro(as, XO_LEA, r|REX_64, RID_DISPATCH, (int32_t)dispofs(as, u64)); } else if (checki32(mcpofs(as, u64)) && checki32(mctopofs(as, u64))) { /* Since as->realign assumes the code size doesn't change, check ** RIP-relative addressing reachability for both as->mcp and as->mctop. */ emit_rmro(as, XO_LEA, r|REX_64, RID_RIP, (int32_t)mcpofs(as, u64)); #endif } 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 /* op r, [addr] */ static void emit_rma(ASMState *as, x86Op xo, Reg rr, const void *addr) { #if LJ_GC64 if (checki32(dispofs(as, addr))) { emit_rmro(as, xo, rr, RID_DISPATCH, (int32_t)dispofs(as, addr)); } else if (checki32(mcpofs(as, addr)) && checki32(mctopofs(as, addr))) { emit_rmro(as, xo, rr, RID_RIP, (int32_t)mcpofs(as, addr)); } else if (!checki32((intptr_t)addr)) { Reg ra = (rr & 15); if (xo != XO_MOV) { /* We can't allocate a register here. Use and restore DISPATCH. Ugly. */ uint64_t dispaddr = (uintptr_t)J2GG(as->J)->dispatch; uint8_t i8 = xo == XO_GROUP3b ? *as->mcp++ : 0; ra = RID_DISPATCH; if (checku32(dispaddr)) { emit_loadi(as, ra, (int32_t)dispaddr); } else { /* Full-size 64 bit load. */ MCode *p = as->mcp; *(uint64_t *)(p-8) = dispaddr; p[-9] = (MCode)(XI_MOVri+(ra&7)); p[-10] = 0x48 + ((ra>>3)&1); p -= 10; as->mcp = p; } if (xo == XO_GROUP3b) emit_i8(as, i8); } emit_rmro(as, xo, rr, ra, 0); emit_loadu64(as, ra, (uintptr_t)addr); } else #endif { 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 } } /* Load 64 bit IR constant into register. */ static void emit_loadk64(ASMState *as, Reg r, IRIns *ir) { Reg r64; x86Op xo; const uint64_t *k = &ir_k64(ir)->u64; if (rset_test(RSET_FPR, r)) { r64 = r; xo = XO_MOVSD; } else { r64 = r | REX_64; xo = XO_MOV; } if (*k == 0) { emit_rr(as, rset_test(RSET_FPR, r) ? XO_XORPS : XO_ARITH(XOg_XOR), r, r); #if LJ_GC64 } else if (checki32((intptr_t)k) || checki32(dispofs(as, k)) || (checki32(mcpofs(as, k)) && checki32(mctopofs(as, k)))) { emit_rma(as, xo, r64, k); } else { if (ir->i) { lj_assertA(*k == *(uint64_t*)(as->mctop - ir->i), "bad interned 64 bit constant"); } else if (as->curins <= as->stopins && rset_test(RSET_GPR, r)) { emit_loadu64(as, r, *k); return; } else { /* If all else fails, add the FP constant at the MCode area bottom. */ while ((uintptr_t)as->mcbot & 7) *as->mcbot++ = XI_INT3; *(uint64_t *)as->mcbot = *k; ir->i = (int32_t)(as->mctop - as->mcbot); as->mcbot += 8; as->mclim = as->mcbot + MCLIM_REDZONE; lj_mcode_commitbot(as->J, as->mcbot); } emit_rmro(as, xo, r64, RID_RIP, (int32_t)mcpofs(as, as->mctop - ir->i)); #else } else { emit_rma(as, xo, r64, k); #endif } } /* -- 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; lj_assertA(delta == (int8_t)delta, "short jump target out of range"); 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; lj_assertA(delta == (int8_t)delta, "short jump target out of range"); 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(jit_State *J, MCode *p, MCode *target) { ptrdiff_t delta = target - p; UNUSED(J); lj_assertJ(delta == (int32_t)delta, "jump target out of range"); 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(as->J, 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(as->J, 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(as->J, 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)) #define VEX_64IR(ir, r) ((r) + (irt_is64((ir)->t) ? VEX_64 : 0)) #else #define REX_64IR(ir, r) (r) #define VEX_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, XO_MOVAPS, dst, src); } /* Generic load of register with base and (small) offset address. */ static void emit_loadofs(ASMState *as, IRIns *ir, Reg r, Reg base, int32_t ofs) { if (r < RID_MAX_GPR) emit_rmro(as, XO_MOV, REX_64IR(ir, r), base, ofs); else emit_rmro(as, irt_isnum(ir->t) ? XO_MOVSD : XO_MOVSS, r, base, ofs); } /* Generic store of register with base and (small) offset address. */ static void emit_storeofs(ASMState *as, IRIns *ir, Reg r, Reg base, int32_t ofs) { if (r < RID_MAX_GPR) emit_rmro(as, XO_MOVto, REX_64IR(ir, r), base, ofs); else emit_rmro(as, irt_isnum(ir->t) ? XO_MOVSDto : XO_MOVSSto, r, base, ofs); } /* Add offset to pointer. */ static void emit_addptr(ASMState *as, Reg r, int32_t ofs) { if (ofs) { emit_gri(as, XG_ARITHi(XOg_ADD), r|REX_GC64, 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) subprojects/luajit/src/lj_ctype.c0000644000175000017500000004557214741067622016471 0ustar aniolaniol/* ** C type management. ** Copyright (C) 2005-2023 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_strfmt.h" #include "lj_ctype.h" #include "lj_ccallback.h" #include "lj_buf.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) \ /* From POSIX. */ \ _("ssize_t", INT_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; lj_assertCTS(cts->L, "uninitialized 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]; lj_assertCTS(cts->L, "uninitialized 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)) { #ifdef LUAJIT_CTYPE_CHECK_ANCHOR CType *ct; #endif 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; 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); } lj_assertCTS(ctype_isvlarray(ct->info), "VLA expected"); ct = ctype_rawchild(cts, ct); /* Get array element. */ lj_assertCTS(ctype_hassize(ct->info), "bad VLA without size"); /* 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)); lj_assertCTS(ctype_hassize(info) || ctype_isfunc(info), "ctype without size"); *szp = ctype_isfunc(info) ? CTSIZE_INVALID : ct->size; break; } ct = ctype_get(cts, ctype_cid(info)); } return qual; } /* Ditto, but follow a reference. */ CTInfo lj_ctype_info_raw(CTState *cts, CTypeID id, CTSize *szp) { CType *ct = ctype_get(cts, id); if (ctype_isref(ct->info)) id = ctype_cid(ct->info); return lj_ctype_info(cts, id, szp); } /* 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: lj_assertG_(ctr->cts->g, 0, "bad ctype %08x", info); 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 = ~n+1u; 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) { SBuf *sb = lj_buf_tmp_(L); TValue re, im; 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]; } lj_strfmt_putfnum(sb, STRFMT_G14, re.n); if (!(im.u32.hi & 0x80000000u) || im.n != im.n) lj_buf_putchar(sb, '+'); lj_strfmt_putfnum(sb, STRFMT_G14, im.n); lj_buf_putchar(sb, sb->w[-1] >= 'a' ? 'I' : 'i'); return lj_buf_str(L, sb); } /* -- 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; } /* Create special weak-keyed finalizer table. */ void lj_ctype_initfin(lua_State *L) { /* NOBARRIER: The table is new (marked white). */ GCtab *t = lj_tab_new(L, 0, 1); 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<gcroot[GCROOT_FFI_FIN], obj2gco(t)); } /* 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 subprojects/luajit/src/.gitignore0000644000175000017500000000015014741067622016463 0ustar aniolaniolluajit luajit.h luajit_relver.txt lj_bcdef.h lj_ffdef.h lj_libdef.h lj_recdef.h lj_folddef.h lj_vm.[sS] subprojects/luajit/src/lj_lex.h0000644000175000017500000000653514741067622016136 0ustar aniolaniol/* ** Lexical analyzer. ** Copyright (C) 2005-2023 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 LexChar; /* Lexical character. Unsigned ext. from char. */ typedef int LexToken; /* Lexical token. */ /* 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 tokval; /* Current token value. */ TValue lookaheadval; /* Lookahead token value. */ const char *p; /* Current position in input buffer. */ const char *pe; /* End of input buffer. */ LexChar c; /* Current character. */ LexToken tok; /* Current token. */ LexToken lookahead; /* Lookahead token. */ 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. */ int endmark; /* Trust bytecode end marker, even if not at EOF. */ int fr2; /* Generate bytecode for LJ_FR2 mode. */ } 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 tok); LJ_FUNC_NORET void lj_lex_error(LexState *ls, LexToken tok, ErrMsg em, ...); LJ_FUNC void lj_lex_init(lua_State *L); #ifdef LUA_USE_ASSERT #define lj_assertLS(c, ...) (lj_assertG_(G(ls->L), (c), __VA_ARGS__)) #else #define lj_assertLS(c, ...) ((void)ls) #endif #endif subprojects/luajit/src/lj_opt_split.c0000644000175000017500000006322214741067622017352 0ustar aniolaniol/* ** SPLIT: Split 64 bit IR instructions into 32 bit IR instructions. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #define lj_opt_split_c #define LUA_CORE #include "lj_obj.h" #if LJ_HASJIT && (LJ_SOFTFP32 || (LJ_32 && LJ_HASFFI)) #include "lj_err.h" #include "lj_buf.h" #include "lj_ir.h" #include "lj_jit.h" #include "lj_ircall.h" #include "lj_iropt.h" #include "lj_dispatch.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); } #endif /* 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); } /* 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, IRT(IR_ADD, IRT_PTR), nref, lj_ir_kint(J, ofs)); } #if LJ_HASFFI static IRRef split_bitshift(jit_State *J, IRRef1 *hisubst, IRIns *oir, IRIns *nir, IRIns *ir) { IROp op = ir->o; IRRef kref = nir->op2; if (irref_isk(kref)) { /* Optimize constant shifts. */ int32_t k = (IR(kref)->i & 63); IRRef lo = nir->op1, hi = hisubst[ir->op1]; if (op == IR_BROL || op == IR_BROR) { if (op == IR_BROR) k = (-k & 63); if (k >= 32) { IRRef t = lo; lo = hi; hi = t; k -= 32; } if (k == 0) { passthrough: J->cur.nins--; ir->prev = lo; return hi; } else { TRef k1, k2; IRRef t1, t2, t3, t4; J->cur.nins--; k1 = lj_ir_kint(J, k); k2 = lj_ir_kint(J, (-k & 31)); t1 = split_emit(J, IRTI(IR_BSHL), lo, k1); t2 = split_emit(J, IRTI(IR_BSHL), hi, k1); t3 = split_emit(J, IRTI(IR_BSHR), lo, k2); t4 = split_emit(J, IRTI(IR_BSHR), hi, k2); ir->prev = split_emit(J, IRTI(IR_BOR), t1, t4); return split_emit(J, IRTI(IR_BOR), t2, t3); } } else if (k == 0) { goto passthrough; } else if (k < 32) { if (op == IR_BSHL) { IRRef t1 = split_emit(J, IRTI(IR_BSHL), hi, kref); IRRef t2 = split_emit(J, IRTI(IR_BSHR), lo, lj_ir_kint(J, (-k&31))); return split_emit(J, IRTI(IR_BOR), t1, t2); } else { IRRef t1 = ir->prev, t2; lj_assertJ(op == IR_BSHR || op == IR_BSAR, "bad usage"); nir->o = IR_BSHR; t2 = split_emit(J, IRTI(IR_BSHL), hi, lj_ir_kint(J, (-k&31))); ir->prev = split_emit(J, IRTI(IR_BOR), t1, t2); return split_emit(J, IRTI(op), hi, kref); } } else { if (op == IR_BSHL) { if (k == 32) J->cur.nins--; else lo = ir->prev; ir->prev = lj_ir_kint(J, 0); return lo; } else { lj_assertJ(op == IR_BSHR || op == IR_BSAR, "bad usage"); if (k == 32) { J->cur.nins--; ir->prev = hi; } else { nir->op1 = hi; } if (op == IR_BSHR) return lj_ir_kint(J, 0); else return split_emit(J, IRTI(IR_BSAR), hi, lj_ir_kint(J, 31)); } } } return split_call_li(J, hisubst, oir, ir, op - IR_BSHL + IRCALL_lj_carith_shl64); } static IRRef split_bitop(jit_State *J, IRRef1 *hisubst, IRIns *nir, IRIns *ir) { IROp op = ir->o; IRRef hi, kref = nir->op2; if (irref_isk(kref)) { /* Optimize bit operations with lo constant. */ int32_t k = IR(kref)->i; if (k == 0 || k == -1) { if (op == IR_BAND) k = ~k; if (k == 0) { J->cur.nins--; ir->prev = nir->op1; } else if (op == IR_BXOR) { nir->o = IR_BNOT; nir->op2 = 0; } else { J->cur.nins--; ir->prev = kref; } } } hi = hisubst[ir->op1]; kref = hisubst[ir->op2]; if (irref_isk(kref)) { /* Optimize bit operations with hi constant. */ int32_t k = IR(kref)->i; if (k == 0 || k == -1) { if (op == IR_BAND) k = ~k; if (k == 0) { return hi; } else if (op == IR_BXOR) { return split_emit(J, IRTI(IR_BNOT), hi, 0); } else { return kref; } } } return split_emit(J, IRTI(op), hi, kref); } #endif /* 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_buf_tmp(J->L, 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; } if (irt_is64(ir->t) && ir->o != IR_KNULL) ref++; } /* 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_ll(J, hisubst, oir, ir, IRCALL_pow); break; case IR_FPMATH: hi = split_call_l(J, hisubst, oir, ir, IRCALL_lj_vm_floor + ir->op2); 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], lj_ir_kint(J, (int32_t)(0x7fffffffu + (ir->o == IR_NEG)))); 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_FLOAD: lj_assertJ(ir->op1 == REF_NIL, "expected FLOAD from GG_State"); hi = lj_ir_kint(J, *(int32_t*)((char*)J2GG(J) + ir->op2 + LJ_LE*4)); nir->op2 += LJ_BE*4; 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. */ #if LJ_BE hi = split_emit(J, IRT(IR_XLOAD, IRT_INT), hi, ir->op2); inslo.t.irt = IRT_SOFTFP | (inslo.t.irt & IRT_GUARD); #endif nref = lj_ir_nextins(J); nir = IR(nref); *nir = inslo; /* Re-emit lo XLOAD. */ #if LJ_LE hi = split_emit(J, IRT(IR_XLOAD, IRT_SOFTFP), hi, ir->op2); 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 lj_assertJ(st == IRT_INT || (LJ_32 && LJ_HASFFI && (st == IRT_U32 || st == IRT_FLOAT)), "bad source type for CONV"); 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: lj_assertJ(ir->o <= IR_NE || ir->o == IR_MIN || ir->o == IR_MAX, "bad IR op %d", ir->o); 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_BNOT: hi = split_emit(J, IRTI(IR_BNOT), hiref, 0); break; case IR_BSWAP: ir->prev = split_emit(J, IRTI(IR_BSWAP), hiref, 0); hi = nref; break; case IR_BAND: case IR_BOR: case IR_BXOR: hi = split_bitop(J, hisubst, nir, ir); break; case IR_BSHL: case IR_BSHR: case IR_BSAR: case IR_BROL: case IR_BROR: hi = split_bitshift(J, hisubst, oir, nir, ir); break; case IR_FLOAD: lj_assertJ(ir->op2 == IRFL_CDATA_INT64, "only INT64 supported"); 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: lj_assertJ(ir->o <= IR_NE, "bad IR op %d", ir->o); /* 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 || ir->o == IR_TMPREF) { 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)) { lj_assertJ(st == IRT_NUM && irt_isint(ir->t), "bad CONV types"); 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 lj_assertJ(J->needsplit >= split_needsplit(J), "bad SPLIT state"); #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 subprojects/luajit/src/lualib.h0000644000175000017500000000221514741067622016120 0ustar aniolaniol/* ** Standard library header. ** Copyright (C) 2005-2023 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 int luaopen_string_buffer(lua_State *L); LUALIB_API void luaL_openlibs(lua_State *L); #ifndef lua_assert #define lua_assert(x) ((void)0) #endif #endif subprojects/luajit/src/lj_opt_mem.c0000644000175000017500000010072614741067622016776 0ustar aniolaniol/* ** 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-2023 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" #include "lj_ircall.h" #include "lj_dispatch.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; lj_assertJ(ta != tb, "bad usage"); lj_assertJ(irt_istab(taba->t) && irt_istab(tabb->t), "bad usage"); /* 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); } /* Check whether there's no aliasing table.clear. */ static int fwd_aa_tab_clear(jit_State *J, IRRef lim, IRRef ta) { IRRef ref = J->chain[IR_CALLS]; while (ref > lim) { IRIns *calls = IR(ref); if (calls->op2 == IRCALL_lj_tab_clear && (ta == calls->op1 || aa_table(J, ta, calls->op1) != ALIAS_NO)) return 0; /* Conflict. */ ref = calls->prev; } return 1; /* No conflict. Can safely FOLD/CSE. */ } /* Check whether there's no aliasing NEWREF/table.clear 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 fwd_aa_tab_clear(J, lim, ta); } /* 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; lj_assertJ(refb->o == IR_AREF, "expected 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. */ lj_assertJ((refa->o==IR_HREF || refa->o==IR_HREFK || refa->o==IR_NEWREF) && (refb->o==IR_HREF || refb->o==IR_HREFK || refb->o==IR_NEWREF), "bad xREF IR op %d or %d", refa->o, refb->o); 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))) && fwd_aa_tab_clear(J, tab, tab)) { /* 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. ** Or a NEWREF may rehash the table and move unrelated number keys. ** 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; } } else { IRIns *key = IR(xr->op2); if (key->o == IR_KSLOT) key = IR(key->op1); if (irt_isnum(key->t) && J->chain[IR_NEWREF] > tab) goto cselim; } /* 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; } /* Simplified here: let loop_unroll() figure out any type instability. */ if (ir->o == IR_TNEW) { return TREF_NIL; } else { 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); if (tvispri(tv)) return TREF_PRI(itype2irt(tv)); else if (tvisnum(tv)) return lj_ir_knum_u64(J, tv->u64); else if (tvisint(tv)) return lj_ir_kint(J, intV(tv)); else if (tvisgcv(tv)) 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 && fwd_aa_tab_clear(J, ref, tab)) 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 && fwd_aa_tab_clear(J, tab, tab)) 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. */ } /* 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). ** Note that lj_tab_keyindex and lj_vm_next don't need guards, ** since they are followed by at least one guarded VLOAD. */ for (ir = IR(J->cur.nins-1); ir > store; ir--) if (irt_isguard(ir->t) || ir->o == IR_ALEN) goto doemit; /* No elimination possible. */ /* Remove redundant store from chain and replace with NOP. */ *refp = store->prev; lj_ir_nop(store); /* Now emit the new store instead. */ } goto doemit; } ref = *(refp = &store->prev); } doemit: return EMITFOLD; /* Otherwise we have a conflict or simply no match. */ } /* ALEN forwarding. */ TRef LJ_FASTCALL lj_opt_fwd_alen(jit_State *J) { IRRef tab = fins->op1; /* Table reference. */ IRRef lim = tab; /* Search limit. */ IRRef ref; /* 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 ALEN. */ break; } ref = store->prev; } /* Try to find a matching ALEN. */ ref = J->chain[IR_ALEN]; while (ref > lim) { /* CSE for ALEN only depends on the table, not the hint. */ if (IR(ref)->op1 == tab) { IRRef sref; /* Search for aliasing table.clear. */ if (!fwd_aa_tab_clear(J, ref, tab)) break; /* Search for hint-forwarding or conflicting store. */ sref = J->chain[IR_ASTORE]; while (sref > ref) { IRIns *store = IR(sref); IRIns *aref = IR(store->op1); IRIns *fref = IR(aref->op1); if (tab == fref->op1) { /* ASTORE to the same table. */ /* Detect t[#t+1] = x idiom for push. */ IRIns *idx = IR(aref->op2); if (!irt_isnil(store->t) && idx->o == IR_ADD && idx->op1 == ref && IR(idx->op2)->o == IR_KINT && IR(idx->op2)->i == 1) { /* Note: this requires an extra PHI check in loop unroll. */ fins->op2 = aref->op2; /* Set ALEN hint. */ } goto doemit; /* Conflicting store, possibly giving a hint. */ } else if (aa_table(J, tab, fref->op1) != ALIAS_NO) { goto doemit; /* Conflicting store. */ } sref = store->prev; } return ref; /* Plain ALEN forwarding. */ } ref = IR(ref)->prev; } doemit: return EMITFOLD; } /* -- 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->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 if (refa->o != refb->o) { /* Different UREFx type, but need to confirm the UREFO really is open. */ if (irt_type(refa->t) == IRT_IGC) refa->t.irt += IRT_PGC-IRT_IGC; else if (irt_type(refb->t) == IRT_IGC) refb->t.irt += IRT_PGC-IRT_IGC; return ALIAS_NO; } else { /* No conclusion can be drawn for same hash value and same UREFx type. */ return ALIAS_MAY; } } } /* 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; lj_ir_nop(store); 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; lj_ir_nop(obar); } /* 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 && !(xr->op2 >= IRFL_SBUF_W && xr->op2 <= IRFL_SBUF_R)) return DROPFOLD; /* Same value: drop the new store. */ /* 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; lj_ir_nop(store); /* Now emit the new store instead. */ } goto doemit; } ref = *(refp = &store->prev); } doemit: return EMITFOLD; /* Otherwise we have a conflict or simply no match. */ } /* Check whether there's no aliasing buffer op between IRFL_SBUF_*. */ int LJ_FASTCALL lj_opt_fwd_sbuf(jit_State *J, IRRef lim) { IRRef ref; if (J->chain[IR_BUFPUT] > lim) return 0; /* Conflict. */ ref = J->chain[IR_CALLS]; while (ref > lim) { IRIns *ir = IR(ref); if (ir->op2 >= IRCALL_lj_strfmt_putint && ir->op2 < IRCALL_lj_buf_tostr) return 0; /* Conflict. */ ref = ir->prev; } ref = J->chain[IR_CALLL]; while (ref > lim) { IRIns *ir = IR(ref); if (ir->op2 >= IRCALL_lj_strfmt_putint && ir->op2 < IRCALL_lj_buf_tostr) return 0; /* Conflict. */ ref = ir->prev; } return 1; /* No conflict. Can safely FOLD/CSE. */ } /* -- 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; lj_ir_nop(store); /* Now emit the new store instead. */ } goto doemit; } ref = *(refp = &store->prev); } doemit: return EMITFOLD; /* Otherwise we have a conflict or simply no match. */ } /* -- 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. */ } else if (irt_isp32(IR(skref)->t) != irt_isp32(IR(xkref)->t)) { return 0; /* HREF and HREFK MAY 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 subprojects/luajit/src/Makefile.dep0000644000175000017500000003770214741067622016717 0ustar aniolaniollib_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_vmevent.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_buf.h \ lj_str.h lj_tab.h lj_meta.h lj_state.h lj_frame.h lj_bc.h lj_ctype.h \ lj_cconv.h lj_ff.h lj_ffdef.h lj_dispatch.h lj_jit.h lj_ir.h lj_char.h \ lj_strscan.h lj_strfmt.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_buf.h lj_gc.h lj_str.h lj_strscan.h \ lj_strfmt.h lj_ctype.h lj_cdata.h lj_cconv.h lj_carith.h lj_ff.h \ lj_ffdef.h lj_lib.h lj_libdef.h lib_buffer.o: lib_buffer.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_buf.h lj_str.h \ lj_tab.h lj_udata.h lj_meta.h lj_ctype.h lj_cdata.h lj_cconv.h \ lj_strfmt.h lj_serialize.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_strfmt.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_buf.h lj_str.h lj_state.h \ lj_strfmt.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_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_state.h lj_bc.h lj_ctype.h lj_ir.h lj_jit.h lj_ircall.h lj_iropt.h \ lj_target.h lj_target_*.h lj_trace.h lj_dispatch.h lj_traceerr.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_err.h lj_errmsg.h lj_lib.h lj_vm.h lj_prng.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_gc.h lj_err.h lj_errmsg.h lj_buf.h lj_str.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_buf.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_strfmt.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_buf.h lj_str.h \ lj_tab.h lj_ff.h lj_ffdef.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_prng.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_strfmt.h lj_asm.o: lj_asm.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \ lj_buf.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_prng.h lj_emit_*.h lj_asm_*.h lj_assert.o: lj_assert.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.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_buf.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_strfmt.h lj_bcwrite.o: lj_bcwrite.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ lj_gc.h lj_buf.h lj_str.h lj_bc.h lj_ctype.h lj_dispatch.h lj_jit.h \ lj_ir.h lj_strfmt.h lj_bcdump.h lj_lex.h lj_err.h lj_errmsg.h lj_vm.h lj_buf.o: lj_buf.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \ lj_err.h lj_errmsg.h lj_buf.h lj_str.h lj_tab.h lj_strfmt.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_ir.h lj_ctype.h \ lj_cconv.h lj_cdata.h lj_carith.h lj_strscan.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_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_buf.h lj_gc.h lj_str.h lj_tab.h lj_ctype.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_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_strfmt.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_buf.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_strfmt.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_tab.h lj_frame.h lj_bc.h lj_ctype.h lj_gc.h \ lj_cdata.h lj_cparse.h lj_cconv.h lj_carith.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_strfmt.h lj_strscan.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_strfmt.h lj_ctype.h \ lj_ccallback.h lj_buf.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_buf.h lj_gc.h lj_str.h lj_tab.h \ lj_state.h lj_frame.h lj_bc.h lj_strfmt.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_buf.h lj_gc.h lj_str.h lj_func.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_strfmt.h lj_jit.h lj_ir.h lj_ccallback.h lj_ctype.h lj_trace.h \ lj_dispatch.h lj_traceerr.h lj_profile.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_strfmt.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_buf.h lj_gc.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_strfmt.h lj_serialize.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_buf.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_vmevent.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_buf.h \ lj_str.h lj_strfmt.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_buf.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_serialize.h lj_strfmt.h lj_prng.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_buf.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_strfmt.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_ctype.h lj_vm.h lj_strscan.h \ lj_strfmt.h lj_lex.h lj_bcdump.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_buf.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_prng.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_buf.h lj_str.h lj_tab.h lj_meta.h lj_frame.h \ lj_bc.h lj_vm.h lj_strscan.h lj_strfmt.h lj_lib.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_buf.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_carith.h lj_vm.h lj_strscan.h lj_strfmt.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_buf.h lj_gc.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_ircall.h lj_dispatch.h lj_bc.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_buf.h lj_gc.h lj_str.h lj_ir.h \ lj_jit.h lj_ircall.h lj_iropt.h lj_dispatch.h lj_bc.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_buf.h lj_str.h lj_tab.h \ lj_func.h lj_state.h lj_bc.h lj_ctype.h lj_strfmt.h lj_lex.h lj_parse.h \ lj_vm.h lj_vmevent.h lj_prng.o: lj_prng.c lj_def.h lua.h luaconf.h lj_arch.h lj_prng.h lj_profile.o: lj_profile.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ lj_buf.h lj_gc.h lj_str.h lj_frame.h lj_bc.h lj_debug.h lj_dispatch.h \ lj_jit.h lj_ir.h lj_trace.h lj_traceerr.h lj_profile.h luajit.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_debug.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_prng.h lj_serialize.o: lj_serialize.c lj_obj.h lua.h luaconf.h lj_def.h \ lj_arch.h lj_err.h lj_errmsg.h lj_buf.h lj_gc.h lj_str.h lj_tab.h \ lj_udata.h lj_ctype.h lj_cdata.h lj_ir.h lj_serialize.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_buf.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_prng.h lj_lex.h \ lj_alloc.h luajit.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_char.h lj_prng.h lj_strfmt.o: lj_strfmt.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ lj_err.h lj_errmsg.h lj_buf.h lj_gc.h lj_str.h lj_meta.h lj_state.h \ lj_char.h lj_strfmt.h lj_ctype.h lj_lib.h lj_strfmt_num.o: lj_strfmt_num.c lj_obj.h lua.h luaconf.h lj_def.h \ lj_arch.h lj_buf.h lj_gc.h lj_str.h lj_strfmt.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_prng.h lj_udata.o: lj_udata.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ lj_gc.h lj_err.h lj_errmsg.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_assert.c lj_obj.h \ lj_def.h lj_arch.h lj_gc.c lj_gc.h lj_err.h lj_errmsg.h lj_buf.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_vmevent.h lj_err.c lj_debug.h lj_ff.h \ lj_ffdef.h lj_strfmt.h lj_char.c lj_char.h lj_bc.c lj_bcdef.h lj_obj.c \ lj_buf.c lj_str.c lj_prng.h lj_tab.c lj_func.c lj_udata.c lj_meta.c \ lj_strscan.h lj_lib.h lj_debug.c lj_prng.c lj_state.c lj_lex.h \ lj_alloc.h luajit.h lj_dispatch.c lj_ccallback.h lj_profile.h \ lj_vmevent.c lj_vmmath.c lj_strscan.c lj_strfmt.c lj_strfmt_num.c \ lj_serialize.c lj_serialize.h lj_api.c lj_profile.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_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_buffer.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_bc.h lj_lib.h lj_obj.h \ host/buildvm_libbc.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 subprojects/luajit/src/lj_vm.h0000644000175000017500000000701014741067622015755 0ustar aniolaniol/* ** Assembler VM interface definitions. ** Copyright (C) 2005-2023 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); #if LJ_ABI_WIN && LJ_TARGET_X86 LJ_ASMF_NORET void LJ_FASTCALL lj_vm_rtlunwind(void *cframe, void *excptrec, void *unwinder, int errcode); #endif 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 #if LJ_TARGET_MIPS LJ_ASMF void lj_vm_unwind_stub(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); LJ_ASMF void lj_vm_profhook(void); LJ_ASMF void lj_vm_IITERN(void); /* Trace exit handling. */ LJ_ASMF char lj_vm_exit_handler[]; LJ_ASMF char lj_vm_exit_interp[]; /* Internal math helper functions. */ #if LJ_TARGET_PPC || LJ_TARGET_ARM64 || (LJ_TARGET_MIPS && LJ_ABI_SOFTFP) #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 #ifdef LUAJIT_NO_LOG2 LJ_ASMF double lj_vm_log2(double); #else #define lj_vm_log2 log2 #endif #if !(defined(_LJ_DISPATCH_H) && LJ_TARGET_MIPS) LJ_ASMF int32_t LJ_FASTCALL lj_vm_modi(int32_t, int32_t); #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); #endif #if LJ_TARGET_PPC || LJ_TARGET_ARM64 #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 #if LJ_HASFFI LJ_ASMF int lj_vm_errno(void); #endif LJ_ASMF TValue *lj_vm_next(GCtab *t, uint32_t idx); #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. */ LJ_ASMF void lj_cont_stitch(void); /* Trace stitching. */ /* Start of the ASM code. */ LJ_ASMF char lj_vm_asm_begin[]; /* Bytecode offsets are relative to lj_vm_asm_begin. */ #define makeasmfunc(ofs) lj_ptr_sign((ASMFunction)(lj_vm_asm_begin + (ofs)), 0) #endif subprojects/luajit/src/lj_alloc.h0000644000175000017500000000061414741067622016430 0ustar aniolaniol/* ** 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(PRNGState *rs); LJ_FUNC void lj_alloc_setprng(void *msp, PRNGState *rs); 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 subprojects/luajit/.meson-subproject-wrap-hash.txt0000644000175000017500000000010114741067622021706 0ustar aniolaniolb398cb3f52b699c08d52eec7285ea046c6beba6052f9cb7a55565305266e81bc subprojects/luajit/dynasm/0000755000175000017500000000000014741067622015203 5ustar aniolaniolsubprojects/luajit/dynasm/dasm_ppc.lua0000644000175000017500000016022114741067622017476 0ustar aniolaniol------------------------------------------------------------------------------ -- DynASM PPC/PPC64 module. -- -- Copyright (C) 2005-2023 Mike Pall. All rights reserved. -- See dynasm.lua for full copyright notice. -- -- Support for various extensions contributed by Caio Souza Oliveira. ------------------------------------------------------------------------------ -- Module information: local _info = { arch = "ppc", description = "DynASM PPC module", version = "1.5.0", vernum = 10500, release = "2021-05-02", 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", "IMMSH" } -- 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, } ------------------------------------------------------------------------------ local map_op, op_template local function op_alias(opname, f) return function(params, nparams) if not params then return "-> "..opname:sub(1, -3) end f(params, nparams) op_template(params, map_op[opname], nparams) end end -- Template strings for PPC instructions. 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", subi_3 = op_alias("addi_3", function(p) p[3] = "-("..p[3]..")" end), subis_3 = op_alias("addis_3", function(p) p[3] = "-("..p[3]..")" end), subic_3 = op_alias("addic_3", function(p) p[3] = "-("..p[3]..")" end), ["subic._3"] = op_alias("addic._3", function(p) p[3] = "-("..p[3]..")" end), rotlwi_3 = op_alias("rlwinm_5", function(p) p[4] = "0"; p[5] = "31" end), rotrwi_3 = op_alias("rlwinm_5", function(p) p[3] = "32-("..p[3]..")"; p[4] = "0"; p[5] = "31" end), rotlw_3 = op_alias("rlwnm_5", function(p) p[4] = "0"; p[5] = "31" end), slwi_3 = op_alias("rlwinm_5", function(p) p[5] = "31-("..p[3]..")"; p[4] = "0" end), srwi_3 = op_alias("rlwinm_5", function(p) p[4] = p[3]; p[3] = "32-("..p[3]..")"; p[5] = "31" end), clrlwi_3 = op_alias("rlwinm_5", function(p) p[4] = p[3]; p[3] = "0"; p[5] = "31" end), clrrwi_3 = op_alias("rlwinm_5", function(p) p[5] = "31-("..p[3]..")"; p[3] = "0"; p[4] = "0" end), -- Primary opcode 4: mulhhwu_3 = "10000010RRR.", machhwu_3 = "10000018RRR.", mulhhw_3 = "10000050RRR.", nmachhw_3 = "1000005cRRR.", machhwsu_3 = "10000098RRR.", machhws_3 = "100000d8RRR.", nmachhws_3 = "100000dcRRR.", mulchwu_3 = "10000110RRR.", macchwu_3 = "10000118RRR.", mulchw_3 = "10000150RRR.", macchw_3 = "10000158RRR.", nmacchw_3 = "1000015cRRR.", macchwsu_3 = "10000198RRR.", macchws_3 = "100001d8RRR.", nmacchws_3 = "100001dcRRR.", mullhw_3 = "10000350RRR.", maclhw_3 = "10000358RRR.", nmaclhw_3 = "1000035cRRR.", maclhwsu_3 = "10000398RRR.", maclhws_3 = "100003d8RRR.", nmaclhws_3 = "100003dcRRR.", machhwuo_3 = "10000418RRR.", nmachhwo_3 = "1000045cRRR.", machhwsuo_3 = "10000498RRR.", machhwso_3 = "100004d8RRR.", nmachhwso_3 = "100004dcRRR.", macchwuo_3 = "10000518RRR.", macchwo_3 = "10000558RRR.", nmacchwo_3 = "1000055cRRR.", macchwsuo_3 = "10000598RRR.", macchwso_3 = "100005d8RRR.", nmacchwso_3 = "100005dcRRR.", maclhwo_3 = "10000758RRR.", nmaclhwo_3 = "1000075cRRR.", maclhwsuo_3 = "10000798RRR.", maclhwso_3 = "100007d8RRR.", nmaclhwso_3 = "100007dcRRR.", vaddubm_3 = "10000000VVV", vmaxub_3 = "10000002VVV", vrlb_3 = "10000004VVV", vcmpequb_3 = "10000006VVV", vmuloub_3 = "10000008VVV", vaddfp_3 = "1000000aVVV", vmrghb_3 = "1000000cVVV", vpkuhum_3 = "1000000eVVV", vmhaddshs_4 = "10000020VVVV", vmhraddshs_4 = "10000021VVVV", vmladduhm_4 = "10000022VVVV", vmsumubm_4 = "10000024VVVV", vmsummbm_4 = "10000025VVVV", vmsumuhm_4 = "10000026VVVV", vmsumuhs_4 = "10000027VVVV", vmsumshm_4 = "10000028VVVV", vmsumshs_4 = "10000029VVVV", vsel_4 = "1000002aVVVV", vperm_4 = "1000002bVVVV", vsldoi_4 = "1000002cVVVP", vpermxor_4 = "1000002dVVVV", vmaddfp_4 = "1000002eVVVV~", vnmsubfp_4 = "1000002fVVVV~", vaddeuqm_4 = "1000003cVVVV", vaddecuq_4 = "1000003dVVVV", vsubeuqm_4 = "1000003eVVVV", vsubecuq_4 = "1000003fVVVV", vadduhm_3 = "10000040VVV", vmaxuh_3 = "10000042VVV", vrlh_3 = "10000044VVV", vcmpequh_3 = "10000046VVV", vmulouh_3 = "10000048VVV", vsubfp_3 = "1000004aVVV", vmrghh_3 = "1000004cVVV", vpkuwum_3 = "1000004eVVV", vadduwm_3 = "10000080VVV", vmaxuw_3 = "10000082VVV", vrlw_3 = "10000084VVV", vcmpequw_3 = "10000086VVV", vmulouw_3 = "10000088VVV", vmuluwm_3 = "10000089VVV", vmrghw_3 = "1000008cVVV", vpkuhus_3 = "1000008eVVV", vaddudm_3 = "100000c0VVV", vmaxud_3 = "100000c2VVV", vrld_3 = "100000c4VVV", vcmpeqfp_3 = "100000c6VVV", vcmpequd_3 = "100000c7VVV", vpkuwus_3 = "100000ceVVV", vadduqm_3 = "10000100VVV", vmaxsb_3 = "10000102VVV", vslb_3 = "10000104VVV", vmulosb_3 = "10000108VVV", vrefp_2 = "1000010aV-V", vmrglb_3 = "1000010cVVV", vpkshus_3 = "1000010eVVV", vaddcuq_3 = "10000140VVV", vmaxsh_3 = "10000142VVV", vslh_3 = "10000144VVV", vmulosh_3 = "10000148VVV", vrsqrtefp_2 = "1000014aV-V", vmrglh_3 = "1000014cVVV", vpkswus_3 = "1000014eVVV", vaddcuw_3 = "10000180VVV", vmaxsw_3 = "10000182VVV", vslw_3 = "10000184VVV", vmulosw_3 = "10000188VVV", vexptefp_2 = "1000018aV-V", vmrglw_3 = "1000018cVVV", vpkshss_3 = "1000018eVVV", vmaxsd_3 = "100001c2VVV", vsl_3 = "100001c4VVV", vcmpgefp_3 = "100001c6VVV", vlogefp_2 = "100001caV-V", vpkswss_3 = "100001ceVVV", vadduhs_3 = "10000240VVV", vminuh_3 = "10000242VVV", vsrh_3 = "10000244VVV", vcmpgtuh_3 = "10000246VVV", vmuleuh_3 = "10000248VVV", vrfiz_2 = "1000024aV-V", vsplth_3 = "1000024cVV3", vupkhsh_2 = "1000024eV-V", vminuw_3 = "10000282VVV", vminud_3 = "100002c2VVV", vcmpgtud_3 = "100002c7VVV", vrfim_2 = "100002caV-V", vcmpgtsb_3 = "10000306VVV", vcfux_3 = "1000030aVVA~", vaddshs_3 = "10000340VVV", vminsh_3 = "10000342VVV", vsrah_3 = "10000344VVV", vcmpgtsh_3 = "10000346VVV", vmulesh_3 = "10000348VVV", vcfsx_3 = "1000034aVVA~", vspltish_2 = "1000034cVS", vupkhpx_2 = "1000034eV-V", vaddsws_3 = "10000380VVV", vminsw_3 = "10000382VVV", vsraw_3 = "10000384VVV", vcmpgtsw_3 = "10000386VVV", vmulesw_3 = "10000388VVV", vctuxs_3 = "1000038aVVA~", vspltisw_2 = "1000038cVS", vminsd_3 = "100003c2VVV", vsrad_3 = "100003c4VVV", vcmpbfp_3 = "100003c6VVV", vcmpgtsd_3 = "100003c7VVV", vctsxs_3 = "100003caVVA~", vupklpx_2 = "100003ceV-V", vsububm_3 = "10000400VVV", ["bcdadd._4"] = "10000401VVVy.", vavgub_3 = "10000402VVV", vand_3 = "10000404VVV", ["vcmpequb._3"] = "10000406VVV", vmaxfp_3 = "1000040aVVV", vsubuhm_3 = "10000440VVV", ["bcdsub._4"] = "10000441VVVy.", vavguh_3 = "10000442VVV", vandc_3 = "10000444VVV", ["vcmpequh._3"] = "10000446VVV", vminfp_3 = "1000044aVVV", vpkudum_3 = "1000044eVVV", vsubuwm_3 = "10000480VVV", vavguw_3 = "10000482VVV", vor_3 = "10000484VVV", ["vcmpequw._3"] = "10000486VVV", vpmsumw_3 = "10000488VVV", ["vcmpeqfp._3"] = "100004c6VVV", ["vcmpequd._3"] = "100004c7VVV", vpkudus_3 = "100004ceVVV", vavgsb_3 = "10000502VVV", vavgsh_3 = "10000542VVV", vorc_3 = "10000544VVV", vbpermq_3 = "1000054cVVV", vpksdus_3 = "1000054eVVV", vavgsw_3 = "10000582VVV", vsld_3 = "100005c4VVV", ["vcmpgefp._3"] = "100005c6VVV", vpksdss_3 = "100005ceVVV", vsububs_3 = "10000600VVV", mfvscr_1 = "10000604V--", vsum4ubs_3 = "10000608VVV", vsubuhs_3 = "10000640VVV", mtvscr_1 = "10000644--V", ["vcmpgtuh._3"] = "10000646VVV", vsum4shs_3 = "10000648VVV", vupkhsw_2 = "1000064eV-V", vsubuws_3 = "10000680VVV", vshasigmaw_4 = "10000682VVYp", veqv_3 = "10000684VVV", vsum2sws_3 = "10000688VVV", vmrgow_3 = "1000068cVVV", vshasigmad_4 = "100006c2VVYp", vsrd_3 = "100006c4VVV", ["vcmpgtud._3"] = "100006c7VVV", vupklsw_2 = "100006ceV-V", vupkslw_2 = "100006ceV-V", vsubsbs_3 = "10000700VVV", vclzb_2 = "10000702V-V", vpopcntb_2 = "10000703V-V", ["vcmpgtsb._3"] = "10000706VVV", vsum4sbs_3 = "10000708VVV", vsubshs_3 = "10000740VVV", vclzh_2 = "10000742V-V", vpopcnth_2 = "10000743V-V", ["vcmpgtsh._3"] = "10000746VVV", vsubsws_3 = "10000780VVV", vclzw_2 = "10000782V-V", vpopcntw_2 = "10000783V-V", ["vcmpgtsw._3"] = "10000786VVV", vsumsws_3 = "10000788VVV", vmrgew_3 = "1000078cVVV", vclzd_2 = "100007c2V-V", vpopcntd_2 = "100007c3V-V", ["vcmpbfp._3"] = "100007c6VVV", ["vcmpgtsd._3"] = "100007c7VVV", -- 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", bctar_2 = "4c000460AA", bctarl_2 = "4c000461AA", 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", lvsl_3 = "7c00000cVRR", 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", lvsr_3 = "7c00004cVRR", subf_3 = "7c000050RRR.", sub_3 = "7c000050RRR~.", lbarx_3 = "7c000068RR0R", ldux_3 = "7c00006aRR0R", dcbst_2 = "7c00006c-RR", lwzux_3 = "7c00006eRR0R", cntlzd_2 = "7c000074RR~", andc_3 = "7c000078RR~R.", td_3 = "7c000088ARR", lvewx_3 = "7c00008eVRR", mulhd_3 = "7c000092RRR.", addg6s_3 = "7c000094RRR", mulhw_3 = "7c000096RRR.", dlmzb_3 = "7c00009cRR~R.", ldarx_3 = "7c0000a8RR0R", dcbf_2 = "7c0000ac-RR", lbzx_3 = "7c0000aeRR0R", lvx_3 = "7c0000ceVRR", neg_2 = "7c0000d0RR.", lharx_3 = "7c0000e8RR0R", lbzux_3 = "7c0000eeRR0R", popcntb_2 = "7c0000f4RR~", not_2 = "7c0000f8RR~%.", nor_3 = "7c0000f8RR~R.", stvebx_3 = "7c00010eVRR", subfe_3 = "7c000110RRR.", sube_3 = "7c000110RRR~.", adde_3 = "7c000114RRR.", stdx_3 = "7c00012aRR0R", ["stwcx._3"] = "7c00012dRR0R.", stwx_3 = "7c00012eRR0R", prtyw_2 = "7c000134RR~", stvehx_3 = "7c00014eVRR", stdux_3 = "7c00016aRR0R", ["stqcx._3"] = "7c00016dR:R0R.", stwux_3 = "7c00016eRR0R", prtyd_2 = "7c000174RR~", stvewx_3 = "7c00018eVRR", subfze_2 = "7c000190RR.", addze_2 = "7c000194RR.", ["stdcx._3"] = "7c0001adRR0R.", stbx_3 = "7c0001aeRR0R", stvx_3 = "7c0001ceVRR", subfme_2 = "7c0001d0RR.", mulld_3 = "7c0001d2RRR.", addme_2 = "7c0001d4RR.", mullw_3 = "7c0001d6RRR.", dcbtst_2 = "7c0001ec-RR", stbux_3 = "7c0001eeRR0R", bpermd_3 = "7c0001f8RR~R", lvepxl_3 = "7c00020eVRR", add_3 = "7c000214RRR.", lqarx_3 = "7c000228R:R0R", dcbt_2 = "7c00022c-RR", lhzx_3 = "7c00022eRR0R", cdtbcd_2 = "7c000234RR~", eqv_3 = "7c000238RR~R.", lvepx_3 = "7c00024eVRR", eciwx_3 = "7c00026cRR0R", lhzux_3 = "7c00026eRR0R", cbcdtd_2 = "7c000274RR~", 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", lvxl_3 = "7c0002ceVRR", lwaux_3 = "7c0002eaRR0R", lhaux_3 = "7c0002eeRR0R", popcntw_2 = "7c0002f4RR~", divdeu_3 = "7c000312RRR.", divweu_3 = "7c000316RRR.", 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.", dsn_2 = "7c0003c6-RR", stvxl_3 = "7c0003ceVRR", divd_3 = "7c0003d2RRR.", divw_3 = "7c0003d6RRR.", popcntd_2 = "7c0003f4RR~", cmpb_3 = "7c0003f8RR~R.", mcrxr_1 = "7c000400X", lbdx_3 = "7c000406RRR", 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.", lhdx_3 = "7c000446RRR", subfo_3 = "7c000450RRR.", subo_3 = "7c000450RRR~.", lfsux_3 = "7c00046eFR0R", lwdx_3 = "7c000486RRR", lswi_3 = "7c0004aaRR0A", sync_0 = "7c0004ac", lwsync_0 = "7c2004ac", ptesync_0 = "7c4004ac", lfdx_3 = "7c0004aeFR0R", lddx_3 = "7c0004c6RRR", nego_2 = "7c0004d0RR.", lfdux_3 = "7c0004eeFR0R", stbdx_3 = "7c000506RRR", subfeo_3 = "7c000510RRR.", subeo_3 = "7c000510RRR~.", addeo_3 = "7c000514RRR.", stdbrx_3 = "7c000528RR0R", stswx_3 = "7c00052aRR0R", stwbrx_3 = "7c00052cRR0R", stfsx_3 = "7c00052eFR0R", sthdx_3 = "7c000546RRR", ["stbcx._3"] = "7c00056dRRR", stfsux_3 = "7c00056eFR0R", stwdx_3 = "7c000586RRR", subfzeo_2 = "7c000590RR.", addzeo_2 = "7c000594RR.", stswi_3 = "7c0005aaRR0A", ["sthcx._3"] = "7c0005adRRR", stfdx_3 = "7c0005aeFR0R", stddx_3 = "7c0005c6RRR", subfmeo_2 = "7c0005d0RR.", mulldo_3 = "7c0005d2RRR.", addmeo_2 = "7c0005d4RR.", mullwo_3 = "7c0005d6RRR.", dcba_2 = "7c0005ec-RR", stfdux_3 = "7c0005eeFR0R", stvepxl_3 = "7c00060eVRR", addo_3 = "7c000614RRR.", lhbrx_3 = "7c00062cRR0R", lfdpx_3 = "7c00062eF:RR", sraw_3 = "7c000630RR~R.", srad_3 = "7c000634RR~R.", lfddx_3 = "7c000646FRR", stvepx_3 = "7c00064eVRR", srawi_3 = "7c000670RR~A.", sradi_3 = "7c000674RR~H.", eieio_0 = "7c0006ac", lfiwax_3 = "7c0006aeFR0R", divdeuo_3 = "7c000712RRR.", divweuo_3 = "7c000716RRR.", sthbrx_3 = "7c00072cRR0R", stfdpx_3 = "7c00072eF:RR", extsh_2 = "7c000734RR~.", stfddx_3 = "7c000746FRR", divdeo_3 = "7c000752RRR.", divweo_3 = "7c000756RRR.", 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", ["tbegin._1"] = "7c00051d1", ["tbegin._0"] = "7c00051d", ["tend._1"] = "7c00055dY", ["tend._0"] = "7c00055d", ["tendall._0"] = "7e00055d", tcheck_1 = "7c00059cX", ["tsr._1"] = "7c0005dd1", ["tsuspend._0"] = "7c0005dd", ["tresume._0"] = "7c2005dd", ["tabortwc._3"] = "7c00061dARR", ["tabortdc._3"] = "7c00065dARR", ["tabortwci._3"] = "7c00069dARS", ["tabortdci._3"] = "7c0006ddARS", ["tabort._1"] = "7c00071d-R-", ["treclaim._1"] = "7c00075d-R", ["trechkpt._0"] = "7c0007dd", lxsiwzx_3 = "7c000018QRR", lxsiwax_3 = "7c000098QRR", mfvsrd_2 = "7c000066-Rq", mfvsrwz_2 = "7c0000e6-Rq", stxsiwx_3 = "7c000118QRR", mtvsrd_2 = "7c000166QR", mtvsrwa_2 = "7c0001a6QR", lxvdsx_3 = "7c000298QRR", lxsspx_3 = "7c000418QRR", lxsdx_3 = "7c000498QRR", stxsspx_3 = "7c000518QRR", stxsdx_3 = "7c000598QRR", lxvw4x_3 = "7c000618QRR", lxvd2x_3 = "7c000698QRR", stxvw4x_3 = "7c000718QRR", stxvd2x_3 = "7c000798QRR", -- 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.", rotldi_3 = op_alias("rldicl_4", function(p) p[4] = "0" end), rotrdi_3 = op_alias("rldicl_4", function(p) p[3] = "64-("..p[3]..")"; p[4] = "0" end), rotld_3 = op_alias("rldcl_4", function(p) p[4] = "0" end), sldi_3 = op_alias("rldicr_4", function(p) p[4] = "63-("..p[3]..")" end), srdi_3 = op_alias("rldicl_4", function(p) p[4] = p[3]; p[3] = "64-("..p[3]..")" end), clrldi_3 = op_alias("rldicl_4", function(p) p[4] = p[3]; p[3] = "0" end), clrrdi_3 = op_alias("rldicr_4", function(p) p[4] = "63-("..p[3]..")"; p[3] = "0" end), -- Primary opcode 56: lq_2 = "e0000000R:D", -- NYI: displacement must be divisible by 8. -- Primary opcode 57: lfdp_2 = "e4000000F:D", -- NYI: displacement must be divisible by 4. -- 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~.", fcfids_2 = "ec00069cF-F.", fcfidus_2 = "ec00079cF-F.", dadd_3 = "ec000004FFF.", dqua_4 = "ec000006FFFZ.", dmul_3 = "ec000044FFF.", drrnd_4 = "ec000046FFFZ.", dscli_3 = "ec000084FF6.", dquai_4 = "ec000086SF~FZ.", dscri_3 = "ec0000c4FF6.", drintx_4 = "ec0000c61F~FZ.", dcmpo_3 = "ec000104XFF", dtstex_3 = "ec000144XFF", dtstdc_3 = "ec000184XF6", dtstdg_3 = "ec0001c4XF6", drintn_4 = "ec0001c61F~FZ.", dctdp_2 = "ec000204F-F.", dctfix_2 = "ec000244F-F.", ddedpd_3 = "ec000284ZF~F.", dxex_2 = "ec0002c4F-F.", dsub_3 = "ec000404FFF.", ddiv_3 = "ec000444FFF.", dcmpu_3 = "ec000504XFF", dtstsf_3 = "ec000544XFF", drsp_2 = "ec000604F-F.", dcffix_2 = "ec000644F-F.", denbcd_3 = "ec000684YF~F.", diex_3 = "ec0006c4FFF.", -- Primary opcode 60: xsaddsp_3 = "f0000000QQQ", xsmaddasp_3 = "f0000008QQQ", xxsldwi_4 = "f0000010QQQz", xsrsqrtesp_2 = "f0000028Q-Q", xssqrtsp_2 = "f000002cQ-Q", xxsel_4 = "f0000030QQQQ", xssubsp_3 = "f0000040QQQ", xsmaddmsp_3 = "f0000048QQQ", xxpermdi_4 = "f0000050QQQz", xsresp_2 = "f0000068Q-Q", xsmulsp_3 = "f0000080QQQ", xsmsubasp_3 = "f0000088QQQ", xxmrghw_3 = "f0000090QQQ", xsdivsp_3 = "f00000c0QQQ", xsmsubmsp_3 = "f00000c8QQQ", xsadddp_3 = "f0000100QQQ", xsmaddadp_3 = "f0000108QQQ", xscmpudp_3 = "f0000118XQQ", xscvdpuxws_2 = "f0000120Q-Q", xsrdpi_2 = "f0000124Q-Q", xsrsqrtedp_2 = "f0000128Q-Q", xssqrtdp_2 = "f000012cQ-Q", xssubdp_3 = "f0000140QQQ", xsmaddmdp_3 = "f0000148QQQ", xscmpodp_3 = "f0000158XQQ", xscvdpsxws_2 = "f0000160Q-Q", xsrdpiz_2 = "f0000164Q-Q", xsredp_2 = "f0000168Q-Q", xsmuldp_3 = "f0000180QQQ", xsmsubadp_3 = "f0000188QQQ", xxmrglw_3 = "f0000190QQQ", xsrdpip_2 = "f00001a4Q-Q", xstsqrtdp_2 = "f00001a8X-Q", xsrdpic_2 = "f00001acQ-Q", xsdivdp_3 = "f00001c0QQQ", xsmsubmdp_3 = "f00001c8QQQ", xsrdpim_2 = "f00001e4Q-Q", xstdivdp_3 = "f00001e8XQQ", xvaddsp_3 = "f0000200QQQ", xvmaddasp_3 = "f0000208QQQ", xvcmpeqsp_3 = "f0000218QQQ", xvcvspuxws_2 = "f0000220Q-Q", xvrspi_2 = "f0000224Q-Q", xvrsqrtesp_2 = "f0000228Q-Q", xvsqrtsp_2 = "f000022cQ-Q", xvsubsp_3 = "f0000240QQQ", xvmaddmsp_3 = "f0000248QQQ", xvcmpgtsp_3 = "f0000258QQQ", xvcvspsxws_2 = "f0000260Q-Q", xvrspiz_2 = "f0000264Q-Q", xvresp_2 = "f0000268Q-Q", xvmulsp_3 = "f0000280QQQ", xvmsubasp_3 = "f0000288QQQ", xxspltw_3 = "f0000290QQg~", xvcmpgesp_3 = "f0000298QQQ", xvcvuxwsp_2 = "f00002a0Q-Q", xvrspip_2 = "f00002a4Q-Q", xvtsqrtsp_2 = "f00002a8X-Q", xvrspic_2 = "f00002acQ-Q", xvdivsp_3 = "f00002c0QQQ", xvmsubmsp_3 = "f00002c8QQQ", xvcvsxwsp_2 = "f00002e0Q-Q", xvrspim_2 = "f00002e4Q-Q", xvtdivsp_3 = "f00002e8XQQ", xvadddp_3 = "f0000300QQQ", xvmaddadp_3 = "f0000308QQQ", xvcmpeqdp_3 = "f0000318QQQ", xvcvdpuxws_2 = "f0000320Q-Q", xvrdpi_2 = "f0000324Q-Q", xvrsqrtedp_2 = "f0000328Q-Q", xvsqrtdp_2 = "f000032cQ-Q", xvsubdp_3 = "f0000340QQQ", xvmaddmdp_3 = "f0000348QQQ", xvcmpgtdp_3 = "f0000358QQQ", xvcvdpsxws_2 = "f0000360Q-Q", xvrdpiz_2 = "f0000364Q-Q", xvredp_2 = "f0000368Q-Q", xvmuldp_3 = "f0000380QQQ", xvmsubadp_3 = "f0000388QQQ", xvcmpgedp_3 = "f0000398QQQ", xvcvuxwdp_2 = "f00003a0Q-Q", xvrdpip_2 = "f00003a4Q-Q", xvtsqrtdp_2 = "f00003a8X-Q", xvrdpic_2 = "f00003acQ-Q", xvdivdp_3 = "f00003c0QQQ", xvmsubmdp_3 = "f00003c8QQQ", xvcvsxwdp_2 = "f00003e0Q-Q", xvrdpim_2 = "f00003e4Q-Q", xvtdivdp_3 = "f00003e8XQQ", xsnmaddasp_3 = "f0000408QQQ", xxland_3 = "f0000410QQQ", xscvdpsp_2 = "f0000424Q-Q", xscvdpspn_2 = "f000042cQ-Q", xsnmaddmsp_3 = "f0000448QQQ", xxlandc_3 = "f0000450QQQ", xsrsp_2 = "f0000464Q-Q", xsnmsubasp_3 = "f0000488QQQ", xxlor_3 = "f0000490QQQ", xscvuxdsp_2 = "f00004a0Q-Q", xsnmsubmsp_3 = "f00004c8QQQ", xxlxor_3 = "f00004d0QQQ", xscvsxdsp_2 = "f00004e0Q-Q", xsmaxdp_3 = "f0000500QQQ", xsnmaddadp_3 = "f0000508QQQ", xxlnor_3 = "f0000510QQQ", xscvdpuxds_2 = "f0000520Q-Q", xscvspdp_2 = "f0000524Q-Q", xscvspdpn_2 = "f000052cQ-Q", xsmindp_3 = "f0000540QQQ", xsnmaddmdp_3 = "f0000548QQQ", xxlorc_3 = "f0000550QQQ", xscvdpsxds_2 = "f0000560Q-Q", xsabsdp_2 = "f0000564Q-Q", xscpsgndp_3 = "f0000580QQQ", xsnmsubadp_3 = "f0000588QQQ", xxlnand_3 = "f0000590QQQ", xscvuxddp_2 = "f00005a0Q-Q", xsnabsdp_2 = "f00005a4Q-Q", xsnmsubmdp_3 = "f00005c8QQQ", xxleqv_3 = "f00005d0QQQ", xscvsxddp_2 = "f00005e0Q-Q", xsnegdp_2 = "f00005e4Q-Q", xvmaxsp_3 = "f0000600QQQ", xvnmaddasp_3 = "f0000608QQQ", ["xvcmpeqsp._3"] = "f0000618QQQ", xvcvspuxds_2 = "f0000620Q-Q", xvcvdpsp_2 = "f0000624Q-Q", xvminsp_3 = "f0000640QQQ", xvnmaddmsp_3 = "f0000648QQQ", ["xvcmpgtsp._3"] = "f0000658QQQ", xvcvspsxds_2 = "f0000660Q-Q", xvabssp_2 = "f0000664Q-Q", xvcpsgnsp_3 = "f0000680QQQ", xvnmsubasp_3 = "f0000688QQQ", ["xvcmpgesp._3"] = "f0000698QQQ", xvcvuxdsp_2 = "f00006a0Q-Q", xvnabssp_2 = "f00006a4Q-Q", xvnmsubmsp_3 = "f00006c8QQQ", xvcvsxdsp_2 = "f00006e0Q-Q", xvnegsp_2 = "f00006e4Q-Q", xvmaxdp_3 = "f0000700QQQ", xvnmaddadp_3 = "f0000708QQQ", ["xvcmpeqdp._3"] = "f0000718QQQ", xvcvdpuxds_2 = "f0000720Q-Q", xvcvspdp_2 = "f0000724Q-Q", xvmindp_3 = "f0000740QQQ", xvnmaddmdp_3 = "f0000748QQQ", ["xvcmpgtdp._3"] = "f0000758QQQ", xvcvdpsxds_2 = "f0000760Q-Q", xvabsdp_2 = "f0000764Q-Q", xvcpsgndp_3 = "f0000780QQQ", xvnmsubadp_3 = "f0000788QQQ", ["xvcmpgedp._3"] = "f0000798QQQ", xvcvuxddp_2 = "f00007a0Q-Q", xvnabsdp_2 = "f00007a4Q-Q", xvnmsubmdp_3 = "f00007c8QQQ", xvcvsxddp_2 = "f00007e0Q-Q", xvnegdp_2 = "f00007e4Q-Q", -- Primary opcode 61: stfdp_2 = "f4000000F:D", -- NYI: displacement must be divisible by 4. -- Primary opcode 62: stq_2 = "f8000002R:D", -- NYI: displacement must be divisible by 8. -- 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.", ftdiv_2 = "fc000100X-F.", fctiwu_2 = "fc00011cF-F.", fctiwuz_2 = "fc00011eF-F.", mtfsfi_2 = "fc00010cAA", -- NYI: upshift. fnabs_2 = "fc000110F-F.", ftsqrt_2 = "fc000140X-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.", fmrgow_3 = "fc00068cFFF", fcfid_2 = "fc00069cF-F.", fctidu_2 = "fc00075cF-F.", fctiduz_2 = "fc00075eF-F.", fmrgew_3 = "fc00078cFFF", fcfidu_2 = "fc00079cF-F.", daddq_3 = "fc000004F:F:F:.", dquaq_4 = "fc000006F:F:F:Z.", dmulq_3 = "fc000044F:F:F:.", drrndq_4 = "fc000046F:F:F:Z.", dscliq_3 = "fc000084F:F:6.", dquaiq_4 = "fc000086SF:~F:Z.", dscriq_3 = "fc0000c4F:F:6.", drintxq_4 = "fc0000c61F:~F:Z.", dcmpoq_3 = "fc000104XF:F:", dtstexq_3 = "fc000144XF:F:", dtstdcq_3 = "fc000184XF:6", dtstdgq_3 = "fc0001c4XF:6", drintnq_4 = "fc0001c61F:~F:Z.", dctqpq_2 = "fc000204F:-F:.", dctfixq_2 = "fc000244F:-F:.", ddedpdq_3 = "fc000284ZF:~F:.", dxexq_2 = "fc0002c4F:-F:.", dsubq_3 = "fc000404F:F:F:.", ddivq_3 = "fc000444F:F:F:.", dcmpuq_3 = "fc000504XF:F:", dtstsfq_3 = "fc000544XF:F:", drdpq_2 = "fc000604F:-F:.", dcffixq_2 = "fc000644F:-F:.", denbcdq_3 = "fc000684YF:~F:.", diexq_3 = "fc0006c4F:FF:.", -- 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 type(v) == "string" and 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_vr(expr) local r = match(expr, "^v([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_vs(expr) local r = match(expr, "^vs([1-6]?[0-9])$") if r then r = tonumber(r) if r <= 63 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 parse_ctx = {} local loadenv = setfenv and function(s) local code = loadstring(s, "") if code then setfenv(code, parse_ctx) end return code end or function(s) return load(s, "", nil, parse_ctx) end -- Try to parse simple arithmetic, too, since some basic ops are aliases. local function parse_number(n) local x = tonumber(n) if x then return x end local code = loadenv("return "..n) if code then local ok, y = pcall(code) if ok then return y end end return nil end local function parse_imm(imm, bits, shift, scale, signed) local n = parse_number(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, "^[rfv]([1-3]?[0-9])$") or match(imm, "^vs([1-6]?[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 = parse_number(imm) if n then if shr(n, 6) == 0 then local lsb = band(n, 31) local msb = n - 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 waction("IMMSH", isshift and 1 or 0, imm) return 0; 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. 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 == "V" then rs = rs - 5; op = op + shl(parse_vr(params[n]), rs); n = n + 1 elseif p == "Q" then local vs = parse_vs(params[n]); n = n + 1; rs = rs - 5 local sh = rs == 6 and 2 or 3 + band(shr(rs, 1), 3) op = op + shl(band(vs, 31), rs) + shr(band(vs, 32), sh) elseif p == "q" then local vs = parse_vs(params[n]); n = n + 1 op = op + shl(band(vs, 31), 21) + shr(band(vs, 32), 5) 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 == "1" then rs = rs - 5; op = op + parse_imm(params[n], 1, rs, 0, false); n = n + 1 elseif p == "g" then rs = rs - 5; op = op + parse_imm(params[n], 2, rs, 0, false); n = n + 1 elseif p == "3" then rs = rs - 5; op = op + parse_imm(params[n], 3, rs, 0, false); n = n + 1 elseif p == "P" then rs = rs - 5; op = op + parse_imm(params[n], 4, rs, 0, false); n = n + 1 elseif p == "p" then op = op + parse_imm(params[n], 4, rs, 0, false); n = n + 1 elseif p == "6" then rs = rs - 6; op = op + parse_imm(params[n], 6, rs, 0, false); n = n + 1 elseif p == "Y" then rs = rs - 5; op = op + parse_imm(params[n], 1, rs+4, 0, false); n = n + 1 elseif p == "y" then rs = rs - 5; op = op + parse_imm(params[n], 1, rs+3, 0, false); n = n + 1 elseif p == "Z" then rs = rs - 5; op = op + parse_imm(params[n], 2, rs+3, 0, false); n = n + 1 elseif p == "z" then rs = rs - 5; op = op + parse_imm(params[n], 2, rs+2, 0, false); 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, m, s = parse_label(params[n], false) if p == "K" then m = m + 2048 end waction("REL_"..mode, m, 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 if band(shr(op, rs), 1) ~= 0 then werror("register pair expected") end elseif p == "-" then rs = rs - 5 elseif p == "." then -- Ignored. else assert(false) end end wputpos(pos, op) end map_op[".template__"] = op_template ------------------------------------------------------------------------------ -- 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 ------------------------------------------------------------------------------ subprojects/luajit/dynasm/dasm_mips.h0000644000175000017500000002771314741067622017342 0ustar aniolaniol/* ** DynASM MIPS encoding engine. ** Copyright (C) 2005-2023 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_IMMS, 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. */ 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; 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; memset((void *)D->sections, 0, maxsection * sizeof(dasm_Section)); } /* 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; 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].rbuf = D->sections[i].buf - D->sections[i].pos; 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; 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: case DASM_IMMS: #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 = 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) { 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: case DASM_IMMS: 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|(int)(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: if (n < 0) { n = (int)((ptrdiff_t)D->globals[-n-10] - (ptrdiff_t)cp); goto patchrel; } /* fallthrough */ case DASM_REL_PC: CK(n >= 0, UNDEF_PC); n = *DASM_POS2PTR(D, n); if (ins & 2048) n = (n + (int)(size_t)base) & 0x0fffffff; else n = n - (int)((char *)cp - base); patchrel: { unsigned int e = 16 + ((ins >> 12) & 15); CK((n & 3) == 0 && ((n + ((ins & 2048) ? 0 : (1<<(e+1)))) >> (e+2)) == 0, RANGE_REL); cp[-1] |= ((n>>2) & ((1<= 20) D->globals[ins-20] = (void *)(base + n); break; case DASM_LABEL_PC: break; case DASM_IMMS: cp[-1] |= ((n>>3) & 4); n &= 0x1f; /* fallthrough */ 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|(int)(D->section-D->sections); return D->status; } #endif subprojects/luajit/dynasm/dasm_ppc.h0000644000175000017500000002766414741067622017161 0ustar aniolaniol/* ** DynASM PPC/PPC64 encoding engine. ** Copyright (C) 2005-2023 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_IMMSH, 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. */ 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; 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; memset((void *)D->sections, 0, maxsection * sizeof(dasm_Section)); } /* 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; 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].rbuf = D->sections[i].buf - D->sections[i].pos; 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; case DASM_IMMSH: CK((n >> 6) == 0, 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 = 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) { 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_IMMSH: 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: if (n < 0) { n = (int)((ptrdiff_t)D->globals[-n-10] - (ptrdiff_t)cp); goto patchrel; } /* fallthrough */ 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-20] = (void *)(base + n); break; case DASM_LABEL_PC: break; case DASM_IMM: cp[-1] |= (n & ((1<<((ins>>5)&31))-1)) << (ins&31); break; case DASM_IMMSH: cp[-1] |= (ins & 1) ? ((n&31)<<11)|((n&32)>>4) : ((n&31)<<6)|(n&32); 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 subprojects/luajit/dynasm/dasm_arm.lua0000644000175000017500000010344614741067622017501 0ustar aniolaniol------------------------------------------------------------------------------ -- DynASM ARM module. -- -- Copyright (C) 2005-2023 Mike Pall. All rights reserved. -- See dynasm.lua for full copyright notice. ------------------------------------------------------------------------------ -- Module information: local _info = { arch = "arm", description = "DynASM ARM module", version = "1.5.0", vernum = 10500, release = "2021-05-02", 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 ------------------------------------------------------------------------------ subprojects/luajit/dynasm/dasm_proto.h0000644000175000017500000000401614741067622017524 0ustar aniolaniol/* ** DynASM encoding engine prototypes. ** Copyright (C) 2005-2023 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.5.0" #define DASM_VERSION 10500 /* 1.5.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 */ subprojects/luajit/dynasm/dasm_arm64.h0000644000175000017500000003736614741067622017330 0ustar aniolaniol/* ** DynASM ARM64 encoding engine. ** Copyright (C) 2005-2023 Mike Pall. All rights reserved. ** Released under the MIT license. See dynasm.lua for full copyright notice. */ #include #include #include #include #define DASM_ARCH "arm64" #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_REL_A, DASM_IMM, DASM_IMM6, DASM_IMM12, DASM_IMM13W, DASM_IMM13X, DASM_IMML, DASM_IMMV, DASM_VREG, 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_RANGE_VREG 0x16000000 #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. */ 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; 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; memset((void *)D->sections, 0, maxsection * sizeof(dasm_Section)); } /* 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; 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].rbuf = D->sections[i].buf - D->sections[i].pos; 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 static int dasm_imm12(unsigned int n) { if ((n >> 12) == 0) return n; else if ((n & 0xff000fff) == 0) return (n >> 12) | 0x1000; else return -1; } static int dasm_ffs(unsigned long long x) { int n = -1; while (x) { x >>= 1; n++; } return n; } static int dasm_imm13(int lo, int hi) { int inv = 0, w = 64, s = 0xfff, xa, xb; unsigned long long n = (((unsigned long long)hi) << 32) | (unsigned int)lo; unsigned long long m = 1ULL, a, b, c; if (n & 1) { n = ~n; inv = 1; } a = n & (unsigned long long)-(long long)n; b = (n+a)&(unsigned long long)-(long long)(n+a); c = (n+a-b)&(unsigned long long)-(long long)(n+a-b); xa = dasm_ffs(a); xb = dasm_ffs(b); if (c) { w = dasm_ffs(c) - xa; if (w == 32) m = 0x0000000100000001UL; else if (w == 16) m = 0x0001000100010001UL; else if (w == 8) m = 0x0101010101010101UL; else if (w == 4) m = 0x1111111111111111UL; else if (w == 2) m = 0x5555555555555555UL; else return -1; s = (-2*w & 0x3f) - 1; } else if (!a) { return -1; } else if (xb == -1) { xb = 64; } if ((b-a) * m != n) return -1; if (inv) { return ((w - xb) << 6) | (s+w+xa-xb); } else { return ((w - xa) << 6) | (s+xb-xa); } 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: if ((ins & 0x8000)) ofs += 8; 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++; if ((ins & 0x8000)) ofs += 8; break; case DASM_REL_A: b[pos++] = n; b[pos++] = va_arg(ap, int); 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: CK((n & ((1<<((ins>>10)&31))-1)) == 0, RANGE_I); 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; case DASM_IMM6: CK((n >> 6) == 0, RANGE_I); b[pos++] = n; break; case DASM_IMM12: CK(dasm_imm12((unsigned int)n) != -1, RANGE_I); b[pos++] = n; break; case DASM_IMM13W: CK(dasm_imm13(n, n) != -1, RANGE_I); b[pos++] = n; break; case DASM_IMM13X: { int m = va_arg(ap, int); CK(dasm_imm13(n, m) != -1, RANGE_I); b[pos++] = n; b[pos++] = m; break; } case DASM_IMML: { #ifdef DASM_CHECKS int scale = (ins & 3); CK((!(n & ((1<>scale) < 4096) || (unsigned int)(n+256) < 512, RANGE_I); #endif b[pos++] = n; break; } case DASM_IMMV: ofs += 4; b[pos++] = n; break; case DASM_VREG: CK(n < 32, RANGE_VREG); 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 = 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) { 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_IMM6: case DASM_IMM12: case DASM_IMM13W: case DASM_IMML: case DASM_IMMV: case DASM_VREG: pos++; break; case DASM_IMM13X: case DASM_REL_A: pos += 2; 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|(int)(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++ = 0xd503201f; break; case DASM_REL_LG: if (n < 0) { ptrdiff_t na = (ptrdiff_t)D->globals[-n-10] - (ptrdiff_t)cp + 4; n = (int)na; CK((ptrdiff_t)n == na, RANGE_REL); goto patchrel; } /* fallthrough */ case DASM_REL_PC: CK(n >= 0, UNDEF_PC); n = *DASM_POS2PTR(D, n) - (int)((char *)cp - base) + 4; patchrel: if (!(ins & 0xf800)) { /* B, BL */ CK((n & 3) == 0 && ((n+0x08000000) >> 28) == 0, RANGE_REL); cp[-1] |= ((n >> 2) & 0x03ffffff); } else if ((ins & 0x800)) { /* B.cond, CBZ, CBNZ, LDR* literal */ CK((n & 3) == 0 && ((n+0x00100000) >> 21) == 0, RANGE_REL); cp[-1] |= ((n << 3) & 0x00ffffe0); } else if ((ins & 0x3000) == 0x2000) { /* ADR */ CK(((n+0x00100000) >> 21) == 0, RANGE_REL); cp[-1] |= ((n << 3) & 0x00ffffe0) | ((n & 3) << 29); } else if ((ins & 0x3000) == 0x3000) { /* ADRP */ cp[-1] |= ((n >> 9) & 0x00ffffe0) | (((n >> 12) & 3) << 29); } else if ((ins & 0x1000)) { /* TBZ, TBNZ */ CK((n & 3) == 0 && ((n+0x00008000) >> 16) == 0, RANGE_REL); cp[-1] |= ((n << 3) & 0x0007ffe0); } else if ((ins & 0x8000)) { /* absolute */ cp[0] = (unsigned int)((ptrdiff_t)cp - 4 + n); cp[1] = (unsigned int)(((ptrdiff_t)cp - 4 + n) >> 32); cp += 2; } break; case DASM_REL_A: { ptrdiff_t na = (((ptrdiff_t)(*b++) << 32) | (unsigned int)n); if ((ins & 0x3000) == 0x3000) { /* ADRP */ ins &= ~0x1000; na = (na >> 12) - (((ptrdiff_t)cp - 4) >> 12); } else { na = na - (ptrdiff_t)cp + 4; } n = (int)na; CK((ptrdiff_t)n == na, RANGE_REL); goto patchrel; } case DASM_LABEL_LG: ins &= 2047; if (ins >= 20) D->globals[ins-20] = (void *)(base + n); break; case DASM_LABEL_PC: break; case DASM_IMM: cp[-1] |= (n & ((1<<((ins>>5)&31))-1)) << (ins&31); break; case DASM_IMM6: cp[-1] |= ((n&31) << 19) | ((n&32) << 26); break; case DASM_IMM12: cp[-1] |= (dasm_imm12((unsigned int)n) << 10); break; case DASM_IMM13W: cp[-1] |= (dasm_imm13(n, n) << 10); break; case DASM_IMM13X: cp[-1] |= (dasm_imm13(n, *b++) << 10); break; case DASM_IMML: { int scale = (ins & 3); cp[-1] |= (!(n & ((1<>scale) < 4096) ? ((n << (10-scale)) | 0x01000000) : ((n & 511) << 12); break; } case DASM_IMMV: *cp++ = n; break; case DASM_VREG: cp[-1] |= (n & 0x1f) << (ins & 0x1f); 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|(int)(D->section-D->sections); return D->status; } #endif subprojects/luajit/dynasm/dasm_x86.h0000644000175000017500000004016714741067622017015 0ustar aniolaniol/* ** DynASM x86 encoding engine. ** Copyright (C) 2005-2023 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. */ 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; 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; memset((void *)D->sections, 0, maxsection * sizeof(dasm_Section)); } /* 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; 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].rbuf = D->sections[i].buf - D->sections[i].pos; 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 = -1; 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 < 0) mrm = p[-2]; if ((mrm&7) != 5) break; } /* fallthrough */ case DASM_IMM_DB: if (((n+128)&-256) == 0) goto ob; /* fallthrough */ 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; /* fallthrough */ 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&-16) == 0 && (n != 4 || (*p>>5) != 2), RANGE_VREG); if (*p < 0x40 && p[1] == DASM_DISP) mrm = n; if (*p < 0x20 && (n&7) == 4) ofs++; switch ((*p++ >> 3) & 3) { case 3: n |= b[pos-3]; /* fallthrough */ case 2: n |= b[pos-2]; /* fallthrough */ case 1: if (n <= 7) { b[pos-1] |= 0x10; ofs--; } } continue; } mrm = -1; } 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. */ } else if (sizeof(ptrdiff_t) == 8) { ofs += 4; } 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++]; int op = 0; while (1) { int action = *p++; switch (action) { case DASM_REL_LG: p++; /* fallthrough */ case DASM_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; } /* fallthrough */ case DASM_SPACE: case DASM_IMM_LG: case DASM_VREG: p++; /* fallthrough */ 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++; /* fallthrough */ 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: op = *p++; break; case DASM_MARK: break; case DASM_SECTION: case DASM_STOP: goto stop; default: op = action; 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; } #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) #define dasmq(x) \ do { *((unsigned long long *)cp) = (unsigned long long)(x); cp+=8; } 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) #define dasmq(x) do { dasmd(x); dasmd((x)>>32); } while (0) #endif static unsigned char *dasma_(unsigned char *cp, ptrdiff_t x) { if (sizeof(ptrdiff_t) == 8) dasmq((unsigned long long)x); else dasmd((unsigned int)x); return cp; } #define dasma(x) (cp = dasma_(cp, (x))) /* 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; } /* fallthrough */ 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; /* fallthrough */ case DASM_IMM_D: wd: dasmd(n); break; case DASM_IMM_WB: if (((n+128)&-256) == 0) goto db; else mark = NULL; /* fallthrough */ case DASM_IMM_W: dasmw(n); break; case DASM_VREG: { int t = *p++; unsigned char *ex = cp - (t&7); if ((n & 8) && t < 0xa0) { if (*ex & 0x80) ex[1] ^= 0x20 << (t>>6); else *ex ^= 1 << (t>>6); n &= 7; } else if (n & 0x10) { if (*ex & 0x80) { *ex = 0xc5; ex[1] = (ex[1] & 0x80) | ex[2]; ex += 2; } while (++ex < cp) ex[-1] = *ex; if (mark) mark--; cp--; n &= 7; } if (t >= 0xc0) n <<= 4; else if (t >= 0x40) n <<= 3; else if (n == 4 && t < 0x20) { cp[-1] ^= n; *cp++ = 0x20; } cp[-1] ^= n; break; } case DASM_REL_LG: p++; if (n >= 0) goto rel_pc; b++; n = (int)(ptrdiff_t)D->globals[-n-10]; /* fallthrough */ case DASM_REL_A: rel_a: n -= (unsigned 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) { dasma((ptrdiff_t)D->globals[-n-10]); break; } /* fallthrough */ case DASM_IMM_PC: { int *pb = DASM_POS2PTR(D, n); dasma(*pb < 0 ? (ptrdiff_t)pb[1] : (*pb + (ptrdiff_t)base)); break; } case DASM_LABEL_LG: { int idx = *p++; if (idx >= 10) D->globals[idx-10] = (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++; /* fallthrough */ 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 subprojects/luajit/dynasm/dasm_x86.lua0000644000175000017500000022342314741067622017345 0ustar aniolaniol------------------------------------------------------------------------------ -- DynASM x86/x64 module. -- -- Copyright (C) 2005-2023 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.5.0", vernum = 10500, release = "2021-05-02", 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, remove = table.concat, table.sort, table.remove local bit = bit or require("bit") local band, bxor, shl, shr = bit.band, bit.bxor, 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", -- 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 -- VREG kind encodings, pre-shifted by 5 bits. local map_vreg = { ["modrm.rm.m"] = 0x00, ["modrm.rm.r"] = 0x20, ["opcode"] = 0x20, ["sib.base"] = 0x20, ["sib.index"] = 0x40, ["modrm.reg"] = 0x80, ["vex.v"] = 0xa0, ["imm.hi"] = 0xc0, } -- Current number of VREG actions contributing to REX/VEX shrinkage. local vreg_shrink_count = 0 ------------------------------------------------------------------------------ -- 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 -- Optionally add a VREG action. local function wvreg(kind, vreg, psz, sk, defer) if not vreg then return end waction("VREG", vreg) local b = assert(map_vreg[kind], "bad vreg kind `"..vreg.."'") if b < (sk or 0) then vreg_shrink_count = vreg_shrink_count + 1 end if not defer then b = b + vreg_shrink_count * 8 vreg_shrink_count = 0 end wputxb(b + (psz or 0)) 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" or sz == "y" then name = format("%s%d", cl, 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 if x64 then map_reg_needrex[map_archdef.Rb] = true 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") -- AVX registers (yword sized, but oword, qword and dword accessible). mkrmap("y", "ymm") -- Operand size prefixes to codes. local map_opsize = { byte = "b", word = "w", dword = "d", qword = "q", oword = "o", yword = "y", tword = "t", aword = addrsize, } -- Operand size code to number. local map_opsizenum = { b = 1, w = 2, d = 4, q = 8, o = 16, y = 32, t = 10, } -- Operand size code to name. local map_opsizename = { b = "byte", w = "word", d = "dword", q = "qword", o = "oword", y = "yword", 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 signed or unsigned qword or arg. local function wputqarg(n) local tn = type(n) if tn == "number" then -- This is only used for numbers from -2^31..2^32-1. wputb(band(n, 255)) wputb(band(shr(n, 8), 255)) wputb(band(shr(n, 16), 255)) wputb(shr(n, 24)) local sign = n < 0 and 255 or 0 wputb(sign); wputb(sign); wputb(sign); wputb(sign) else waction("IMM_D", format("(unsigned int)(%s)", n)) waction("IMM_D", format("(unsigned int)((unsigned long long)(%s)>>32)", 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, vex, vregr, vregxb) local psz, sk = 0, nil if vex then local tail if vex.m == 1 and band(rex, 11) == 0 then if x64 and vregxb then sk = map_vreg["modrm.reg"] else wputb(0xc5) tail = shl(bxor(band(rex, 4), 4), 5) psz = 3 end end if not tail then wputb(0xc4) wputb(shl(bxor(band(rex, 7), 7), 5) + vex.m) tail = shl(band(rex, 8), 4) psz = 4 end local reg, vreg = 0, nil if vex.v then reg = vex.v.reg if not reg then werror("bad vex operand") end if reg < 0 then reg = 0; vreg = vex.v.vreg end end if sz == "y" or vex.l then tail = tail + 4 end wputb(tail + shl(bxor(reg, 15), 3) + vex.p) wvreg("vex.v", vreg) rex = 0 if op >= 256 then werror("bad vex opcode") end else if rex ~= 0 then if not x64 then werror("bad operand size") end elseif (vregr or vregxb) and x64 then rex = 0x10 sk = map_vreg["vex.v"] end end local r 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; psz = 2 end end wputb(shr(op, 16)); op = band(op, 0xffff); psz = psz + 1 end if op >= 256 then local b = shr(op, 8) if b == 15 and rex ~= 0 then wputb(64 + band(rex, 15)); rex = 0; psz = 2 end wputb(b); op = band(op, 255); psz = psz + 1 end if rex ~= 0 then wputb(64 + band(rex, 15)); psz = 2 end if sz == "b" then op = op - 1 end wputb(op) return psz, sk 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, psz, sk) 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) wvreg("modrm.reg", vsreg, psz+1, sk, vreg) wvreg("modrm.rm.r", vreg, psz+1, sk) 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 wvreg("modrm.reg", vsreg, psz+1, sk, vxreg) wputmodrm(t.xsc, xreg, 5) wvreg("sib.index", vxreg, psz+2, sk) else -- Pure 32 bit displacement. if x64 and tdisp ~= "table" then wputmodrm(0, s, 4) -- [disp] -> (0, s, esp) (0, esp, ebp) wvreg("modrm.reg", vsreg, psz+1, sk) if imark == "I" then waction("MARK") end wputmodrm(0, 4, 5) else riprel = x64 wputmodrm(0, s, 5) -- [disp|rip-label] -> (0, s, ebp) wvreg("modrm.reg", vsreg, psz+1, sk) if imark == "I" then waction("MARK") end 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. if disp[2] == "iPJ" then waction("REL_A", disp[1]) else wputlabel("REL_", disp[1], 2) end 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 wvreg("modrm.reg", vsreg, psz+1, sk, vxreg or vreg) wputmodrm(t.xsc or 0, xreg or 4, reg) -- SIB. wvreg("sib.index", vxreg, psz+2, sk, vreg) wvreg("sib.base", vreg, psz+2, sk) 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 wvreg("modrm.reg", vsreg, psz+1, sk, vreg) wvreg("modrm.rm.m", vreg, psz+1, sk) 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, isqword) local n = tonumber(expr) if n then if n % 1 ~= 0 then werror("not an integer number `"..expr.."'") elseif isqword then if n < -2147483648 or n > 2147483647 then n = nil -- Handle it as an expression to avoid precision loss. end elseif 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" or mode == "iPJ" then if c == "-" then werror("cannot invert label reference") end return { iexpr, mode } 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, isqword) 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, isqword) 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. -- "u" Use VEX encoding, vvvv unused. -- "v"/"V" Use VEX encoding, vvvv from 1st/2nd operand (the operand is -- removed from the list used by future characters). -- "w" Use VEX encoding, vvvv from 3rd operand. -- "L" Force VEX.L -- -- 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 4 bit immediate from the last register operand, -- followed by 4 zero bits. -- "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", endbr32_0 = "F30F1EFB", endbr64_0 = "F30F1EFA", -- 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", pause_0 = "F390", pextrw_3 = "rri/do:660FC5rMU|xri/wo:660F3A15nRmU", -- Mem op: SSE4.1 only. pinsrw_3 = "rri/od:660FC4rMU|rxi/ow:", pmovmskb_2 = "rr/do:660FD7rM", prefetchnta_1 = "xb:n0F180m", prefetcht0_1 = "xb:n0F181m", prefetcht1_1 = "xb:n0F182m", prefetcht2_1 = "xb:n0F183m", 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", 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 -- AES-NI aesdec_2 = "rmo:660F38DErM", aesdeclast_2 = "rmo:660F38DFrM", aesenc_2 = "rmo:660F38DCrM", aesenclast_2 = "rmo:660F38DDrM", aesimc_2 = "rmo:660F38DBrM", aeskeygenassist_3 = "rmio:660F3ADFrMU", pclmulqdq_3 = "rmio:660F3A44rMU", -- AVX FP ops vaddsubpd_3 = "rrmoy:660FVD0rM", vaddsubps_3 = "rrmoy:F20FVD0rM", vandpd_3 = "rrmoy:660FV54rM", vandps_3 = "rrmoy:0FV54rM", vandnpd_3 = "rrmoy:660FV55rM", vandnps_3 = "rrmoy:0FV55rM", vblendpd_4 = "rrmioy:660F3AV0DrMU", vblendps_4 = "rrmioy:660F3AV0CrMU", vblendvpd_4 = "rrmroy:660F3AV4BrMs", vblendvps_4 = "rrmroy:660F3AV4ArMs", vbroadcastf128_2 = "rx/yo:660F38u1ArM", vcmppd_4 = "rrmioy:660FVC2rMU", vcmpps_4 = "rrmioy:0FVC2rMU", vcmpsd_4 = "rrrio:F20FVC2rMU|rrxi/ooq:", vcmpss_4 = "rrrio:F30FVC2rMU|rrxi/ood:", vcomisd_2 = "rro:660Fu2FrM|rx/oq:", vcomiss_2 = "rro:0Fu2FrM|rx/od:", vcvtdq2pd_2 = "rro:F30FuE6rM|rx/oq:|rm/yo:", vcvtdq2ps_2 = "rmoy:0Fu5BrM", vcvtpd2dq_2 = "rmoy:F20FuE6rM", vcvtpd2ps_2 = "rmoy:660Fu5ArM", vcvtps2dq_2 = "rmoy:660Fu5BrM", vcvtps2pd_2 = "rro:0Fu5ArM|rx/oq:|rm/yo:", vcvtsd2si_2 = "rr/do:F20Fu2DrM|rx/dq:|rr/qo:|rxq:", vcvtsd2ss_3 = "rrro:F20FV5ArM|rrx/ooq:", vcvtsi2sd_3 = "rrm/ood:F20FV2ArM|rrm/ooq:F20FVX2ArM", vcvtsi2ss_3 = "rrm/ood:F30FV2ArM|rrm/ooq:F30FVX2ArM", vcvtss2sd_3 = "rrro:F30FV5ArM|rrx/ood:", vcvtss2si_2 = "rr/do:F30Fu2DrM|rxd:|rr/qo:|rx/qd:", vcvttpd2dq_2 = "rmo:660FuE6rM|rm/oy:660FuLE6rM", vcvttps2dq_2 = "rmoy:F30Fu5BrM", vcvttsd2si_2 = "rr/do:F20Fu2CrM|rx/dq:|rr/qo:|rxq:", vcvttss2si_2 = "rr/do:F30Fu2CrM|rxd:|rr/qo:|rx/qd:", vdppd_4 = "rrmio:660F3AV41rMU", vdpps_4 = "rrmioy:660F3AV40rMU", vextractf128_3 = "mri/oy:660F3AuL19RmU", vextractps_3 = "mri/do:660F3Au17RmU", vhaddpd_3 = "rrmoy:660FV7CrM", vhaddps_3 = "rrmoy:F20FV7CrM", vhsubpd_3 = "rrmoy:660FV7DrM", vhsubps_3 = "rrmoy:F20FV7DrM", vinsertf128_4 = "rrmi/yyo:660F3AV18rMU", vinsertps_4 = "rrrio:660F3AV21rMU|rrxi/ood:", vldmxcsr_1 = "xd:0FuAE2m", vmaskmovps_3 = "rrxoy:660F38V2CrM|xrroy:660F38V2ERm", vmaskmovpd_3 = "rrxoy:660F38V2DrM|xrroy:660F38V2FRm", vmovapd_2 = "rmoy:660Fu28rM|mroy:660Fu29Rm", vmovaps_2 = "rmoy:0Fu28rM|mroy:0Fu29Rm", vmovd_2 = "rm/od:660Fu6ErM|rm/oq:660FuX6ErM|mr/do:660Fu7ERm|mr/qo:", vmovq_2 = "rro:F30Fu7ErM|rx/oq:|xr/qo:660FuD6Rm", vmovddup_2 = "rmy:F20Fu12rM|rro:|rx/oq:", vmovhlps_3 = "rrro:0FV12rM", vmovhpd_2 = "xr/qo:660Fu17Rm", vmovhpd_3 = "rrx/ooq:660FV16rM", vmovhps_2 = "xr/qo:0Fu17Rm", vmovhps_3 = "rrx/ooq:0FV16rM", vmovlhps_3 = "rrro:0FV16rM", vmovlpd_2 = "xr/qo:660Fu13Rm", vmovlpd_3 = "rrx/ooq:660FV12rM", vmovlps_2 = "xr/qo:0Fu13Rm", vmovlps_3 = "rrx/ooq:0FV12rM", vmovmskpd_2 = "rr/do:660Fu50rM|rr/dy:660FuL50rM", vmovmskps_2 = "rr/do:0Fu50rM|rr/dy:0FuL50rM", vmovntpd_2 = "xroy:660Fu2BRm", vmovntps_2 = "xroy:0Fu2BRm", vmovsd_2 = "rx/oq:F20Fu10rM|xr/qo:F20Fu11Rm", vmovsd_3 = "rrro:F20FV10rM", vmovshdup_2 = "rmoy:F30Fu16rM", vmovsldup_2 = "rmoy:F30Fu12rM", vmovss_2 = "rx/od:F30Fu10rM|xr/do:F30Fu11Rm", vmovss_3 = "rrro:F30FV10rM", vmovupd_2 = "rmoy:660Fu10rM|mroy:660Fu11Rm", vmovups_2 = "rmoy:0Fu10rM|mroy:0Fu11Rm", vorpd_3 = "rrmoy:660FV56rM", vorps_3 = "rrmoy:0FV56rM", vpermilpd_3 = "rrmoy:660F38V0DrM|rmioy:660F3Au05rMU", vpermilps_3 = "rrmoy:660F38V0CrM|rmioy:660F3Au04rMU", vperm2f128_4 = "rrmiy:660F3AV06rMU", vptestpd_2 = "rmoy:660F38u0FrM", vptestps_2 = "rmoy:660F38u0ErM", vrcpps_2 = "rmoy:0Fu53rM", vrcpss_3 = "rrro:F30FV53rM|rrx/ood:", vrsqrtps_2 = "rmoy:0Fu52rM", vrsqrtss_3 = "rrro:F30FV52rM|rrx/ood:", vroundpd_3 = "rmioy:660F3Au09rMU", vroundps_3 = "rmioy:660F3Au08rMU", vroundsd_4 = "rrrio:660F3AV0BrMU|rrxi/ooq:", vroundss_4 = "rrrio:660F3AV0ArMU|rrxi/ood:", vshufpd_4 = "rrmioy:660FVC6rMU", vshufps_4 = "rrmioy:0FVC6rMU", vsqrtps_2 = "rmoy:0Fu51rM", vsqrtss_2 = "rro:F30Fu51rM|rx/od:", vsqrtpd_2 = "rmoy:660Fu51rM", vsqrtsd_2 = "rro:F20Fu51rM|rx/oq:", vstmxcsr_1 = "xd:0FuAE3m", vucomisd_2 = "rro:660Fu2ErM|rx/oq:", vucomiss_2 = "rro:0Fu2ErM|rx/od:", vunpckhpd_3 = "rrmoy:660FV15rM", vunpckhps_3 = "rrmoy:0FV15rM", vunpcklpd_3 = "rrmoy:660FV14rM", vunpcklps_3 = "rrmoy:0FV14rM", vxorpd_3 = "rrmoy:660FV57rM", vxorps_3 = "rrmoy:0FV57rM", vzeroall_0 = "0FuL77", vzeroupper_0 = "0Fu77", -- AVX2 FP ops vbroadcastss_2 = "rx/od:660F38u18rM|rx/yd:|rro:|rr/yo:", vbroadcastsd_2 = "rx/yq:660F38u19rM|rr/yo:", -- *vgather* (!vsib) vpermpd_3 = "rmiy:660F3AuX01rMU", vpermps_3 = "rrmy:660F38V16rM", -- AVX, AVX2 integer ops -- In general, xmm requires AVX, ymm requires AVX2. vaesdec_3 = "rrmo:660F38VDErM", vaesdeclast_3 = "rrmo:660F38VDFrM", vaesenc_3 = "rrmo:660F38VDCrM", vaesenclast_3 = "rrmo:660F38VDDrM", vaesimc_2 = "rmo:660F38uDBrM", vaeskeygenassist_3 = "rmio:660F3AuDFrMU", vlddqu_2 = "rxoy:F20FuF0rM", vmaskmovdqu_2 = "rro:660FuF7rM", vmovdqa_2 = "rmoy:660Fu6FrM|mroy:660Fu7FRm", vmovdqu_2 = "rmoy:F30Fu6FrM|mroy:F30Fu7FRm", vmovntdq_2 = "xroy:660FuE7Rm", vmovntdqa_2 = "rxoy:660F38u2ArM", vmpsadbw_4 = "rrmioy:660F3AV42rMU", vpabsb_2 = "rmoy:660F38u1CrM", vpabsd_2 = "rmoy:660F38u1ErM", vpabsw_2 = "rmoy:660F38u1DrM", vpackusdw_3 = "rrmoy:660F38V2BrM", vpalignr_4 = "rrmioy:660F3AV0FrMU", vpblendvb_4 = "rrmroy:660F3AV4CrMs", vpblendw_4 = "rrmioy:660F3AV0ErMU", vpclmulqdq_4 = "rrmio:660F3AV44rMU", vpcmpeqq_3 = "rrmoy:660F38V29rM", vpcmpestri_3 = "rmio:660F3Au61rMU", vpcmpestrm_3 = "rmio:660F3Au60rMU", vpcmpgtq_3 = "rrmoy:660F38V37rM", vpcmpistri_3 = "rmio:660F3Au63rMU", vpcmpistrm_3 = "rmio:660F3Au62rMU", vpextrb_3 = "rri/do:660F3Au14nRmU|rri/qo:|xri/bo:", vpextrw_3 = "rri/do:660FuC5rMU|xri/wo:660F3Au15nRmU", vpextrd_3 = "mri/do:660F3Au16RmU", vpextrq_3 = "mri/qo:660F3Au16RmU", vphaddw_3 = "rrmoy:660F38V01rM", vphaddd_3 = "rrmoy:660F38V02rM", vphaddsw_3 = "rrmoy:660F38V03rM", vphminposuw_2 = "rmo:660F38u41rM", vphsubw_3 = "rrmoy:660F38V05rM", vphsubd_3 = "rrmoy:660F38V06rM", vphsubsw_3 = "rrmoy:660F38V07rM", vpinsrb_4 = "rrri/ood:660F3AV20rMU|rrxi/oob:", vpinsrw_4 = "rrri/ood:660FVC4rMU|rrxi/oow:", vpinsrd_4 = "rrmi/ood:660F3AV22rMU", vpinsrq_4 = "rrmi/ooq:660F3AVX22rMU", vpmaddubsw_3 = "rrmoy:660F38V04rM", vpmaxsb_3 = "rrmoy:660F38V3CrM", vpmaxsd_3 = "rrmoy:660F38V3DrM", vpmaxuw_3 = "rrmoy:660F38V3ErM", vpmaxud_3 = "rrmoy:660F38V3FrM", vpminsb_3 = "rrmoy:660F38V38rM", vpminsd_3 = "rrmoy:660F38V39rM", vpminuw_3 = "rrmoy:660F38V3ArM", vpminud_3 = "rrmoy:660F38V3BrM", vpmovmskb_2 = "rr/do:660FuD7rM|rr/dy:660FuLD7rM", vpmovsxbw_2 = "rroy:660F38u20rM|rx/oq:|rx/yo:", vpmovsxbd_2 = "rroy:660F38u21rM|rx/od:|rx/yq:", vpmovsxbq_2 = "rroy:660F38u22rM|rx/ow:|rx/yd:", vpmovsxwd_2 = "rroy:660F38u23rM|rx/oq:|rx/yo:", vpmovsxwq_2 = "rroy:660F38u24rM|rx/od:|rx/yq:", vpmovsxdq_2 = "rroy:660F38u25rM|rx/oq:|rx/yo:", vpmovzxbw_2 = "rroy:660F38u30rM|rx/oq:|rx/yo:", vpmovzxbd_2 = "rroy:660F38u31rM|rx/od:|rx/yq:", vpmovzxbq_2 = "rroy:660F38u32rM|rx/ow:|rx/yd:", vpmovzxwd_2 = "rroy:660F38u33rM|rx/oq:|rx/yo:", vpmovzxwq_2 = "rroy:660F38u34rM|rx/od:|rx/yq:", vpmovzxdq_2 = "rroy:660F38u35rM|rx/oq:|rx/yo:", vpmuldq_3 = "rrmoy:660F38V28rM", vpmulhrsw_3 = "rrmoy:660F38V0BrM", vpmulld_3 = "rrmoy:660F38V40rM", vpshufb_3 = "rrmoy:660F38V00rM", vpshufd_3 = "rmioy:660Fu70rMU", vpshufhw_3 = "rmioy:F30Fu70rMU", vpshuflw_3 = "rmioy:F20Fu70rMU", vpsignb_3 = "rrmoy:660F38V08rM", vpsignw_3 = "rrmoy:660F38V09rM", vpsignd_3 = "rrmoy:660F38V0ArM", vpslldq_3 = "rrioy:660Fv737mU", vpsllw_3 = "rrmoy:660FVF1rM|rrioy:660Fv716mU", vpslld_3 = "rrmoy:660FVF2rM|rrioy:660Fv726mU", vpsllq_3 = "rrmoy:660FVF3rM|rrioy:660Fv736mU", vpsraw_3 = "rrmoy:660FVE1rM|rrioy:660Fv714mU", vpsrad_3 = "rrmoy:660FVE2rM|rrioy:660Fv724mU", vpsrldq_3 = "rrioy:660Fv733mU", vpsrlw_3 = "rrmoy:660FVD1rM|rrioy:660Fv712mU", vpsrld_3 = "rrmoy:660FVD2rM|rrioy:660Fv722mU", vpsrlq_3 = "rrmoy:660FVD3rM|rrioy:660Fv732mU", vptest_2 = "rmoy:660F38u17rM", -- AVX2 integer ops vbroadcasti128_2 = "rx/yo:660F38u5ArM", vinserti128_4 = "rrmi/yyo:660F3AV38rMU", vextracti128_3 = "mri/oy:660F3AuL39RmU", vpblendd_4 = "rrmioy:660F3AV02rMU", vpbroadcastb_2 = "rro:660F38u78rM|rx/ob:|rr/yo:|rx/yb:", vpbroadcastw_2 = "rro:660F38u79rM|rx/ow:|rr/yo:|rx/yw:", vpbroadcastd_2 = "rro:660F38u58rM|rx/od:|rr/yo:|rx/yd:", vpbroadcastq_2 = "rro:660F38u59rM|rx/oq:|rr/yo:|rx/yq:", vpermd_3 = "rrmy:660F38V36rM", vpermq_3 = "rmiy:660F3AuX00rMU", -- *vpgather* (!vsib) vperm2i128_4 = "rrmiy:660F3AV46rMU", vpmaskmovd_3 = "rrxoy:660F38V8CrM|xrroy:660F38V8ERm", vpmaskmovq_3 = "rrxoy:660F38VX8CrM|xrroy:660F38VX8ERm", vpsllvd_3 = "rrmoy:660F38V47rM", vpsllvq_3 = "rrmoy:660F38VX47rM", vpsravd_3 = "rrmoy:660F38V46rM", vpsrlvd_3 = "rrmoy:660F38V45rM", vpsrlvq_3 = "rrmoy:660F38VX45rM", -- Intel ADX adcx_2 = "rmqd:660F38F6rM", adox_2 = "rmqd:F30F38F6rM", -- BMI1 andn_3 = "rrmqd:0F38VF2rM", bextr_3 = "rmrqd:0F38wF7rM", blsi_2 = "rmqd:0F38vF33m", blsmsk_2 = "rmqd:0F38vF32m", blsr_2 = "rmqd:0F38vF31m", tzcnt_2 = "rmqdw:F30FBCrM", -- BMI2 bzhi_3 = "rmrqd:0F38wF5rM", mulx_3 = "rrmqd:F20F38VF6rM", pdep_3 = "rrmqd:F20F38VF5rM", pext_3 = "rrmqd:F30F38VF5rM", rorx_3 = "rmSqd:F20F3AuF0rMS", sarx_3 = "rmrqd:F30F38wF7rM", shrx_3 = "rmrqd:F20F38wF7rM", shlx_3 = "rmrqd:660F38wF7rM", -- FMA3 vfmaddsub132pd_3 = "rrmoy:660F38VX96rM", vfmaddsub132ps_3 = "rrmoy:660F38V96rM", vfmaddsub213pd_3 = "rrmoy:660F38VXA6rM", vfmaddsub213ps_3 = "rrmoy:660F38VA6rM", vfmaddsub231pd_3 = "rrmoy:660F38VXB6rM", vfmaddsub231ps_3 = "rrmoy:660F38VB6rM", vfmsubadd132pd_3 = "rrmoy:660F38VX97rM", vfmsubadd132ps_3 = "rrmoy:660F38V97rM", vfmsubadd213pd_3 = "rrmoy:660F38VXA7rM", vfmsubadd213ps_3 = "rrmoy:660F38VA7rM", vfmsubadd231pd_3 = "rrmoy:660F38VXB7rM", vfmsubadd231ps_3 = "rrmoy:660F38VB7rM", vfmadd132pd_3 = "rrmoy:660F38VX98rM", vfmadd132ps_3 = "rrmoy:660F38V98rM", vfmadd132sd_3 = "rrro:660F38VX99rM|rrx/ooq:", vfmadd132ss_3 = "rrro:660F38V99rM|rrx/ood:", vfmadd213pd_3 = "rrmoy:660F38VXA8rM", vfmadd213ps_3 = "rrmoy:660F38VA8rM", vfmadd213sd_3 = "rrro:660F38VXA9rM|rrx/ooq:", vfmadd213ss_3 = "rrro:660F38VA9rM|rrx/ood:", vfmadd231pd_3 = "rrmoy:660F38VXB8rM", vfmadd231ps_3 = "rrmoy:660F38VB8rM", vfmadd231sd_3 = "rrro:660F38VXB9rM|rrx/ooq:", vfmadd231ss_3 = "rrro:660F38VB9rM|rrx/ood:", vfmsub132pd_3 = "rrmoy:660F38VX9ArM", vfmsub132ps_3 = "rrmoy:660F38V9ArM", vfmsub132sd_3 = "rrro:660F38VX9BrM|rrx/ooq:", vfmsub132ss_3 = "rrro:660F38V9BrM|rrx/ood:", vfmsub213pd_3 = "rrmoy:660F38VXAArM", vfmsub213ps_3 = "rrmoy:660F38VAArM", vfmsub213sd_3 = "rrro:660F38VXABrM|rrx/ooq:", vfmsub213ss_3 = "rrro:660F38VABrM|rrx/ood:", vfmsub231pd_3 = "rrmoy:660F38VXBArM", vfmsub231ps_3 = "rrmoy:660F38VBArM", vfmsub231sd_3 = "rrro:660F38VXBBrM|rrx/ooq:", vfmsub231ss_3 = "rrro:660F38VBBrM|rrx/ood:", vfnmadd132pd_3 = "rrmoy:660F38VX9CrM", vfnmadd132ps_3 = "rrmoy:660F38V9CrM", vfnmadd132sd_3 = "rrro:660F38VX9DrM|rrx/ooq:", vfnmadd132ss_3 = "rrro:660F38V9DrM|rrx/ood:", vfnmadd213pd_3 = "rrmoy:660F38VXACrM", vfnmadd213ps_3 = "rrmoy:660F38VACrM", vfnmadd213sd_3 = "rrro:660F38VXADrM|rrx/ooq:", vfnmadd213ss_3 = "rrro:660F38VADrM|rrx/ood:", vfnmadd231pd_3 = "rrmoy:660F38VXBCrM", vfnmadd231ps_3 = "rrmoy:660F38VBCrM", vfnmadd231sd_3 = "rrro:660F38VXBDrM|rrx/ooq:", vfnmadd231ss_3 = "rrro:660F38VBDrM|rrx/ood:", vfnmsub132pd_3 = "rrmoy:660F38VX9ErM", vfnmsub132ps_3 = "rrmoy:660F38V9ErM", vfnmsub132sd_3 = "rrro:660F38VX9FrM|rrx/ooq:", vfnmsub132ss_3 = "rrro:660F38V9FrM|rrx/ood:", vfnmsub213pd_3 = "rrmoy:660F38VXAErM", vfnmsub213ps_3 = "rrmoy:660F38VAErM", vfnmsub213sd_3 = "rrro:660F38VXAFrM|rrx/ooq:", vfnmsub213ss_3 = "rrro:660F38VAFrM|rrx/ood:", vfnmsub231pd_3 = "rrmoy:660F38VXBErM", vfnmsub231ps_3 = "rrmoy:660F38VBErM", vfnmsub231sd_3 = "rrro:660F38VXBFrM|rrx/ooq:", vfnmsub231ss_3 = "rrro:660F38VBFrM|rrx/ood:", } ------------------------------------------------------------------------------ -- 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 / AVX 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) if n ~= 1 then map_op["v"..name.."ps_3"] = format("rrmoy:0FV5%XrM", n) map_op["v"..name.."ss_3"] = format("rrro:F30FV5%XrM|rrx/ood:", n) map_op["v"..name.."pd_3"] = format("rrmoy:660FV5%XrM", n) map_op["v"..name.."sd_3"] = format("rrro:F20FV5%XrM|rrx/ooq:", n) end end -- SSE2 / AVX / AVX2 integer arithmetic ops (66 0F leaf). for name,n in pairs{ paddb = 0xFC, paddw = 0xFD, paddd = 0xFE, paddq = 0xD4, paddsb = 0xEC, paddsw = 0xED, packssdw = 0x6B, packsswb = 0x63, packuswb = 0x67, paddusb = 0xDC, paddusw = 0xDD, pand = 0xDB, pandn = 0xDF, pavgb = 0xE0, pavgw = 0xE3, pcmpeqb = 0x74, pcmpeqd = 0x76, pcmpeqw = 0x75, pcmpgtb = 0x64, pcmpgtd = 0x66, pcmpgtw = 0x65, pmaddwd = 0xF5, pmaxsw = 0xEE, pmaxub = 0xDE, pminsw = 0xEA, pminub = 0xDA, pmulhuw = 0xE4, pmulhw = 0xE5, pmullw = 0xD5, pmuludq = 0xF4, por = 0xEB, psadbw = 0xF6, psubb = 0xF8, psubw = 0xF9, psubd = 0xFA, psubq = 0xFB, psubsb = 0xE8, psubsw = 0xE9, psubusb = 0xD8, psubusw = 0xD9, punpckhbw = 0x68, punpckhwd = 0x69, punpckhdq = 0x6A, punpckhqdq = 0x6D, punpcklbw = 0x60, punpcklwd = 0x61, punpckldq = 0x62, punpcklqdq = 0x6C, pxor = 0xEF } do map_op[name.."_2"] = format("rmo:660F%02XrM", n) map_op["v"..name.."_3"] = format("rrmoy:660FV%02XrM", n) end ------------------------------------------------------------------------------ local map_vexarg = { u = false, v = 1, V = 2, w = 3 } -- Process pattern string. local function dopattern(pat, args, sz, op, needrex) local digit, addin, vex 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 6 positions. if secpos+6 > 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 == "L" then -- Force VEX.L. vex.l = true 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 local psz, sk = wputop(szov, opcode, rex, vex, s < 0, t.vreg or t.vxreg) 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, psz, sk) addin = nil elseif map_vexarg[c] ~= nil then -- Encode using VEX prefix local b = band(opcode, 255); opcode = shr(opcode, 8) local m = 1 if b == 0x38 then m = 2 elseif b == 0x3a then m = 3 end if m ~= 1 then b = band(opcode, 255); opcode = shr(opcode, 8) end if b ~= 0x0f then werror("expected `0F', `0F38', or `0F3A' to precede `"..c.. "' in pattern `"..pat.."' for `"..op.."'") end local v = map_vexarg[c] if v then v = remove(args, v) end b = band(opcode, 255) local p = 0 if b == 0x66 then p = 1 elseif b == 0xf3 then p = 2 elseif b == 0xf2 then p = 3 end if p ~= 0 then opcode = shr(opcode, 8) end if opcode ~= 0 then wputop(nil, opcode, 0); opcode = 0 end vex = { m = m, p = p, v = v } 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 local psz, sk = wputop(szov, opcode - 7, rex, vex, true) wvreg("opcode", addin.vreg, psz, sk) else if addin and addin.reg > 7 then rex = rex + 1 end wputop(szov, opcode, rex, vex) 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(x64 and "J" or "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 elseif c == "s" then local reg = a.reg if reg < 0 then wputb(0) wvreg("imm.hi", a.vreg) else wputb(shl(reg, 4)) 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 -- Exactly match leading operand sizes. for i = #szm,1,-1 do if i == 1 then dopattern(pat, args, sz, params.op, needrex) -- Process pattern. return elseif args[i-1].opsize ~= sub(szm, i, i) then break end 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 local psz, sk = wputop(sz, opcode, rex, nil, vreg) wvreg("opcode", vreg, psz, sk) 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 == "l" then sz = "d" elseif sz == "a" then sz = addrsize end for _,p in ipairs(params) do local a = parseoperand(p, sz == "q") 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) elseif sz == "q" then wputqarg(a.imm) 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[".qword_*"] = op_data map_op[".aword_*"] = op_data map_op[".long_*"] = op_data map_op[".quad_*"] = op_data map_op[".addr_*"] = 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 ------------------------------------------------------------------------------ subprojects/luajit/dynasm/dasm_x64.lua0000644000175000017500000000107014741067622017331 0ustar aniolaniol------------------------------------------------------------------------------ -- DynASM x64 module. -- -- Copyright (C) 2005-2023 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") subprojects/luajit/dynasm/dynasm.lua0000644000175000017500000007445014741067622017213 0ustar aniolaniol------------------------------------------------------------------------------ -- DynASM. A dynamic assembler for code generation engines. -- Originally designed and implemented for LuaJIT. -- -- Copyright (C) 2005-2023 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.5.0", vernum = 10500, release = "2021-05-02", author = "Mike Pall", url = "https://luajit.org/dynasm.html", license = "MIT", copyright = [[ Copyright (C) 2005-2023 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: https://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 requested. 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 _G._map_def = map_def 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{...} ------------------------------------------------------------------------------ subprojects/luajit/dynasm/dasm_mips.lua0000644000175000017500000010643614741067622017674 0ustar aniolaniol------------------------------------------------------------------------------ -- DynASM MIPS32/MIPS64 module. -- -- Copyright (C) 2005-2023 Mike Pall. All rights reserved. -- See dynasm.lua for full copyright notice. ------------------------------------------------------------------------------ local mips64 = mips64 local mipsr6 = _map_def.MIPSR6 -- Module information: local _info = { arch = mips64 and "mips64" or "mips", description = "DynASM MIPS32/MIPS64 module", version = "1.5.0", vernum = 10500, release = "2021-05-02", 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", "IMMS", } -- 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", 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", daddiu_3 = mips64 and "64000000TSI", ldl_2 = mips64 and "68000000TO", ldr_2 = mips64 and "6c000000TO", lb_2 = "80000000TO", lh_2 = "84000000TO", lw_2 = "8c000000TO", lbu_2 = "90000000TO", lhu_2 = "94000000TO", lwu_2 = mips64 and "9c000000TO", sb_2 = "a0000000TO", sh_2 = "a4000000TO", sw_2 = "ac000000TO", lwc1_2 = "c4000000HO", ldc1_2 = "d4000000HO", ld_2 = mips64 and "dc000000TO", swc1_2 = "e4000000HO", sdc1_2 = "f4000000HO", sd_2 = mips64 and "fc000000TO", -- Opcode SPECIAL. nop_0 = "00000000", sll_3 = "00000000DTA", sextw_2 = "00000000DT", srl_3 = "00000002DTA", rotr_3 = "00200002DTA", sra_3 = "00000003DTA", sllv_3 = "00000004DTS", srlv_3 = "00000006DTS", rotrv_3 = "00000046DTS", drotrv_3 = mips64 and "00000056DTS", srav_3 = "00000007DTS", jalr_1 = "0000f809S", jalr_2 = "00000009DS", syscall_0 = "0000000c", syscall_1 = "0000000cY", break_0 = "0000000d", break_1 = "0000000dY", sync_0 = "0000000f", dsllv_3 = mips64 and "00000014DTS", dsrlv_3 = mips64 and "00000016DTS", dsrav_3 = mips64 and "00000017DTS", add_3 = "00000020DST", move_2 = mips64 and "00000025DS" or "00000021DS", addu_3 = "00000021DST", sub_3 = "00000022DST", negu_2 = mips64 and "0000002fDT" or "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", dadd_3 = mips64 and "0000002cDST", daddu_3 = mips64 and "0000002dDST", dsub_3 = mips64 and "0000002eDST", dsubu_3 = mips64 and "0000002fDST", 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", dsll_3 = mips64 and "00000038DTa", dsrl_3 = mips64 and "0000003aDTa", drotr_3 = mips64 and "0020003aDTa", dsra_3 = mips64 and "0000003bDTa", dsll32_3 = mips64 and "0000003cDTA", dsrl32_3 = mips64 and "0000003eDTA", drotr32_3 = mips64 and "0020003eDTA", dsra32_3 = mips64 and "0000003fDTA", -- Opcode REGIMM. bltz_2 = "04000000SB", bgez_2 = "04010000SB", bltzl_2 = "04020000SB", bgezl_2 = "04030000SB", bal_1 = "04110000B", synci_1 = "041f0000O", -- Opcode SPECIAL3. ext_4 = "7c000000TSAM", -- Note: last arg is msbd = size-1 dextm_4 = mips64 and "7c000001TSAM", -- Args: pos | size-1-32 dextu_4 = mips64 and "7c000002TSAM", -- Args: pos-32 | size-1 dext_4 = mips64 and "7c000003TSAM", -- Args: pos | size-1 zextw_2 = mips64 and "7c00f803TS", ins_4 = "7c000004TSAM", -- Note: last arg is msb = pos+size-1 dinsm_4 = mips64 and "7c000005TSAM", -- Args: pos | pos+size-33 dinsu_4 = mips64 and "7c000006TSAM", -- Args: pos-32 | pos+size-33 dins_4 = mips64 and "7c000007TSAM", -- Args: pos | pos+size-1 wsbh_2 = "7c0000a0DT", dsbh_2 = mips64 and "7c0000a4DT", dshd_2 = mips64 and "7c000164DT", seb_2 = "7c000420DT", seh_2 = "7c000620DT", rdhwr_2 = "7c00003bTD", -- Opcode COP0. mfc0_2 = "40000000TD", mfc0_3 = "40000000TDW", dmfc0_2 = mips64 and "40200000TD", dmfc0_3 = mips64 and "40200000TDW", mtc0_2 = "40800000TD", mtc0_3 = "40800000TDW", dmtc0_2 = mips64 and "40a00000TD", dmtc0_3 = mips64 and "40a00000TDW", 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", dmfc1_2 = mips64 and "44200000TG", cfc1_2 = "44400000TG", mfhc1_2 = "44600000TG", mtc1_2 = "44800000TG", dmtc1_2 = mips64 and "44a00000TG", ctc1_2 = "44c00000TG", mthc1_2 = "44e00000TG", ["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", ["recip.s_2"] = "46000015FG", ["rsqrt.s_2"] = "46000016FG", ["cvt.d.s_2"] = "46000021FG", ["cvt.w.s_2"] = "46000024FG", ["cvt.l.s_2"] = "46000025FG", ["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", ["recip.d_2"] = "46200015FG", ["rsqrt.d_2"] = "46200016FG", ["cvt.s.d_2"] = "46200020FG", ["cvt.w.d_2"] = "46200024FG", ["cvt.l.d_2"] = "46200025FG", ["cvt.s.w_2"] = "46800020FG", ["cvt.d.w_2"] = "46800021FG", ["cvt.s.l_2"] = "46a00020FG", ["cvt.d.l_2"] = "46a00021FG", } if mipsr6 then -- Instructions added with MIPSR6. for k,v in pairs({ -- Add immediate to upper bits. aui_3 = "3c000000TSI", daui_3 = mips64 and "74000000TSI", dahi_2 = mips64 and "04060000SI", dati_2 = mips64 and "041e0000SI", -- TODO: addiupc, auipc, aluipc, lwpc, lwupc, ldpc. -- Compact branches. blezalc_2 = "18000000TB", -- rt != 0. bgezalc_2 = "18000000T=SB", -- rt != 0. bgtzalc_2 = "1c000000TB", -- rt != 0. bltzalc_2 = "1c000000T=SB", -- rt != 0. blezc_2 = "58000000TB", -- rt != 0. bgezc_2 = "58000000T=SB", -- rt != 0. bgec_3 = "58000000STB", -- rs != rt. blec_3 = "58000000TSB", -- rt != rs. bgtzc_2 = "5c000000TB", -- rt != 0. bltzc_2 = "5c000000T=SB", -- rt != 0. bltc_3 = "5c000000STB", -- rs != rt. bgtc_3 = "5c000000TSB", -- rt != rs. bgeuc_3 = "18000000STB", -- rs != rt. bleuc_3 = "18000000TSB", -- rt != rs. bltuc_3 = "1c000000STB", -- rs != rt. bgtuc_3 = "1c000000TSB", -- rt != rs. beqzalc_2 = "20000000TB", -- rt != 0. bnezalc_2 = "60000000TB", -- rt != 0. beqc_3 = "20000000STB", -- rs < rt. bnec_3 = "60000000STB", -- rs < rt. bovc_3 = "20000000STB", -- rs >= rt. bnvc_3 = "60000000STB", -- rs >= rt. beqzc_2 = "d8000000SK", -- rs != 0. bnezc_2 = "f8000000SK", -- rs != 0. jic_2 = "d8000000TI", jialc_2 = "f8000000TI", bc_1 = "c8000000L", balc_1 = "e8000000L", -- Opcode SPECIAL. jr_1 = "00000009S", sdbbp_0 = "0000000e", sdbbp_1 = "0000000eY", lsa_4 = "00000005DSTA", dlsa_4 = mips64 and "00000015DSTA", seleqz_3 = "00000035DST", selnez_3 = "00000037DST", clz_2 = "00000050DS", clo_2 = "00000051DS", dclz_2 = mips64 and "00000052DS", dclo_2 = mips64 and "00000053DS", mul_3 = "00000098DST", muh_3 = "000000d8DST", mulu_3 = "00000099DST", muhu_3 = "000000d9DST", div_3 = "0000009aDST", mod_3 = "000000daDST", divu_3 = "0000009bDST", modu_3 = "000000dbDST", dmul_3 = mips64 and "0000009cDST", dmuh_3 = mips64 and "000000dcDST", dmulu_3 = mips64 and "0000009dDST", dmuhu_3 = mips64 and "000000ddDST", ddiv_3 = mips64 and "0000009eDST", dmod_3 = mips64 and "000000deDST", ddivu_3 = mips64 and "0000009fDST", dmodu_3 = mips64 and "000000dfDST", -- Opcode SPECIAL3. align_4 = "7c000220DSTA", dalign_4 = mips64 and "7c000224DSTA", bitswap_2 = "7c000020DT", dbitswap_2 = mips64 and "7c000024DT", -- Opcode COP1. bc1eqz_2 = "45200000HB", bc1nez_2 = "45a00000HB", ["sel.s_3"] = "46000010FGH", ["seleqz.s_3"] = "46000014FGH", ["selnez.s_3"] = "46000017FGH", ["maddf.s_3"] = "46000018FGH", ["msubf.s_3"] = "46000019FGH", ["rint.s_2"] = "4600001aFG", ["class.s_2"] = "4600001bFG", ["min.s_3"] = "4600001cFGH", ["mina.s_3"] = "4600001dFGH", ["max.s_3"] = "4600001eFGH", ["maxa.s_3"] = "4600001fFGH", ["cmp.af.s_3"] = "46800000FGH", ["cmp.un.s_3"] = "46800001FGH", ["cmp.or.s_3"] = "46800011FGH", ["cmp.eq.s_3"] = "46800002FGH", ["cmp.une.s_3"] = "46800012FGH", ["cmp.ueq.s_3"] = "46800003FGH", ["cmp.ne.s_3"] = "46800013FGH", ["cmp.lt.s_3"] = "46800004FGH", ["cmp.ult.s_3"] = "46800005FGH", ["cmp.le.s_3"] = "46800006FGH", ["cmp.ule.s_3"] = "46800007FGH", ["cmp.saf.s_3"] = "46800008FGH", ["cmp.sun.s_3"] = "46800009FGH", ["cmp.sor.s_3"] = "46800019FGH", ["cmp.seq.s_3"] = "4680000aFGH", ["cmp.sune.s_3"] = "4680001aFGH", ["cmp.sueq.s_3"] = "4680000bFGH", ["cmp.sne.s_3"] = "4680001bFGH", ["cmp.slt.s_3"] = "4680000cFGH", ["cmp.sult.s_3"] = "4680000dFGH", ["cmp.sle.s_3"] = "4680000eFGH", ["cmp.sule.s_3"] = "4680000fFGH", ["sel.d_3"] = "46200010FGH", ["seleqz.d_3"] = "46200014FGH", ["selnez.d_3"] = "46200017FGH", ["maddf.d_3"] = "46200018FGH", ["msubf.d_3"] = "46200019FGH", ["rint.d_2"] = "4620001aFG", ["class.d_2"] = "4620001bFG", ["min.d_3"] = "4620001cFGH", ["mina.d_3"] = "4620001dFGH", ["max.d_3"] = "4620001eFGH", ["maxa.d_3"] = "4620001fFGH", ["cmp.af.d_3"] = "46a00000FGH", ["cmp.un.d_3"] = "46a00001FGH", ["cmp.or.d_3"] = "46a00011FGH", ["cmp.eq.d_3"] = "46a00002FGH", ["cmp.une.d_3"] = "46a00012FGH", ["cmp.ueq.d_3"] = "46a00003FGH", ["cmp.ne.d_3"] = "46a00013FGH", ["cmp.lt.d_3"] = "46a00004FGH", ["cmp.ult.d_3"] = "46a00005FGH", ["cmp.le.d_3"] = "46a00006FGH", ["cmp.ule.d_3"] = "46a00007FGH", ["cmp.saf.d_3"] = "46a00008FGH", ["cmp.sun.d_3"] = "46a00009FGH", ["cmp.sor.d_3"] = "46a00019FGH", ["cmp.seq.d_3"] = "46a0000aFGH", ["cmp.sune.d_3"] = "46a0001aFGH", ["cmp.sueq.d_3"] = "46a0000bFGH", ["cmp.sne.d_3"] = "46a0001bFGH", ["cmp.slt.d_3"] = "46a0000cFGH", ["cmp.sult.d_3"] = "46a0000dFGH", ["cmp.sle.d_3"] = "46a0000eFGH", ["cmp.sule.d_3"] = "46a0000fFGH", }) do map_op[k] = v end else -- Instructions removed by MIPSR6. for k,v in pairs({ -- Traps, don't use. addi_3 = "20000000TSI", daddi_3 = mips64 and "60000000TSI", -- Branch on likely, don't use. beqzl_2 = "50000000SB", beql_3 = "50000000STB", bnezl_2 = "54000000SB", bnel_3 = "54000000STB", blezl_2 = "58000000SB", bgtzl_2 = "5c000000SB", lwl_2 = "88000000TO", lwr_2 = "98000000TO", swl_2 = "a8000000TO", sdl_2 = mips64 and "b0000000TO", sdr_2 = mips64 and "b1000000TO", swr_2 = "b8000000TO", cache_2 = "bc000000NO", ll_2 = "c0000000TO", pref_2 = "cc000000NO", sc_2 = "e0000000TO", scd_2 = mips64 and "f0000000TO", -- Opcode SPECIAL. movf_2 = "00000001DS", movf_3 = "00000001DSC", movt_2 = "00010001DS", movt_3 = "00010001DSC", jr_1 = "00000008S", movz_3 = "0000000aDST", movn_3 = "0000000bDST", mfhi_1 = "00000010D", mthi_1 = "00000011S", mflo_1 = "00000012D", mtlo_1 = "00000013S", mult_2 = "00000018ST", multu_2 = "00000019ST", div_3 = "0000001aST", divu_3 = "0000001bST", ddiv_3 = mips64 and "0000001eST", ddivu_3 = mips64 and "0000001fST", dmult_2 = mips64 and "0000001cST", dmultu_2 = mips64 and "0000001dST", -- Opcode REGIMM. tgei_2 = "04080000SI", tgeiu_2 = "04090000SI", tlti_2 = "040a0000SI", tltiu_2 = "040b0000SI", teqi_2 = "040c0000SI", tnei_2 = "040e0000SI", bltzal_2 = "04100000SB", bgezal_2 = "04110000SB", bltzall_2 = "04120000SB", bgezall_2 = "04130000SB", -- Opcode SPECIAL2. madd_2 = "70000000ST", maddu_2 = "70000001ST", mul_3 = "70000002DST", msub_2 = "70000004ST", msubu_2 = "70000005ST", clz_2 = "70000020D=TS", clo_2 = "70000021D=TS", dclz_2 = mips64 and "70000024D=TS", dclo_2 = mips64 and "70000025D=TS", sdbbp_0 = "7000003f", sdbbp_1 = "7000003fY", -- Opcode COP1. bc1f_1 = "45000000B", bc1f_2 = "45000000CB", bc1t_1 = "45010000B", bc1t_2 = "45010000CB", bc1fl_1 = "45020000B", bc1fl_2 = "45020000CB", bc1tl_1 = "45030000B", bc1tl_2 = "45030000CB", ["movf.s_2"] = "46000011FG", ["movf.s_3"] = "46000011FGC", ["movt.s_2"] = "46010011FG", ["movt.s_3"] = "46010011FGC", ["movz.s_3"] = "46000012FGT", ["movn.s_3"] = "46000013FGT", ["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", ["movf.d_2"] = "46200011FG", ["movf.d_3"] = "46200011FGC", ["movt.d_2"] = "46210011FG", ["movt.d_3"] = "46210011FGC", ["movz.d_3"] = "46200012FGT", ["movn.d_3"] = "46200013FGT", ["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", -- 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", }) do map_op[k] = v end 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_imm(imm, bits, shift, scale, signed, action) 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(action or "IMM", (signed and 32768 or 0)+shl(scale, 10)+shl(bits, 5)+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" or p == "K" or p == "L" then local mode, m, s = parse_label(params[n], false) if p == "J" then m = m + 0xa800 elseif p == "K" then m = m + 0x5000 elseif p == "L" then m = m + 0xa000 end waction("REL_"..mode, m, s, 1) n = n + 1 elseif p == "A" then op = op + parse_imm(params[n], 5, 6, 0, false); n = n + 1 elseif p == "a" then local m = parse_imm(params[n], 6, 6, 0, false, "IMMS"); n = n + 1 op = op + band(m, 0x7c0) + band(shr(m, 9), 4) 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 n = n - 1 -- Re-use previous parameter for next template char. 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 ------------------------------------------------------------------------------ subprojects/luajit/dynasm/dasm_mips64.lua0000644000175000017500000000110314741067622020027 0ustar aniolaniol------------------------------------------------------------------------------ -- DynASM MIPS64 module. -- -- Copyright (C) 2005-2023 Mike Pall. All rights reserved. -- See dynasm.lua for full copyright notice. ------------------------------------------------------------------------------ -- This module just sets 64 bit mode for the combined MIPS/MIPS64 module. -- All the interesting stuff is there. ------------------------------------------------------------------------------ mips64 = true -- Using a global is an ugly, but effective solution. return require("dasm_mips") subprojects/luajit/dynasm/dasm_arm64.lua0000644000175000017500000010745014741067622017652 0ustar aniolaniol------------------------------------------------------------------------------ -- DynASM ARM64 module. -- -- Copyright (C) 2005-2023 Mike Pall. All rights reserved. -- See dynasm.lua for full copyright notice. ------------------------------------------------------------------------------ -- Module information: local _info = { arch = "arm", description = "DynASM ARM64 module", version = "1.5.0", vernum = 10500, release = "2021-05-02", 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 format, byte, char = _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, tobit = bit.ror, bit.tohex, bit.tobit -- 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", "REL_A", "IMM", "IMM6", "IMM12", "IMM13W", "IMM13X", "IMML", "IMMV", "VREG", } -- 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 = { xzr = "@x31", wzr = "@w31", lr = "x30", } -- Int. register name -> ext. name. local map_reg_rev = { ["@x31"] = "xzr", ["@w31"] = "wzr", x30 = "lr", } 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, } local map_extend = { uxtb = 0, uxth = 1, uxtw = 2, uxtx = 3, sxtb = 4, sxth = 5, sxtw = 6, sxtx = 7, } 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, } ------------------------------------------------------------------------------ local parse_reg_type local function parse_reg(expr, shift, no_vreg) if not expr then werror("expected register name") end local tname, ovreg = match(expr, "^([%w_]+):(@?%l%d+)$") if not tname then tname, ovreg = match(expr, "^([%w_]+):(R[xwqdshb]%b())$") end 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 ok31, rt, r = match(expr, "^(@?)([xwqdshb])([123]?[0-9])$") if r then r = tonumber(r) if r <= 30 or (r == 31 and ok31 ~= "" or (rt ~= "w" and rt ~= "x")) then if not parse_reg_type then parse_reg_type = rt elseif parse_reg_type ~= rt then werror("register size mismatch") end return shl(r, shift), tp end end local vrt, vreg = match(expr, "^R([xwqdshb])(%b())$") if vreg then if not parse_reg_type then parse_reg_type = vrt elseif parse_reg_type ~= vrt then werror("register size mismatch") end if not no_vreg then waction("VREG", shift, vreg) end return 0 end werror("bad register name `"..expr.."'") end local function parse_reg_base(expr) if expr == "sp" then return 0x3e0 end local base, tp = parse_reg(expr, 5) if parse_reg_type ~= "x" then werror("bad register type") end parse_reg_type = false return base, tp end local parse_ctx = {} local loadenv = setfenv and function(s) local code = loadstring(s, "") if code then setfenv(code, parse_ctx) end return code end or function(s) return load(s, "", nil, parse_ctx) end -- Try to parse simple arithmetic, too, since some basic ops are aliases. local function parse_number(n) local x = tonumber(n) if x then return x end local code = loadenv("return "..n) if code then local ok, y = pcall(code) if ok and type(y) == "number" then return y end end return nil end local function parse_imm(imm, bits, shift, scale, signed) imm = match(imm, "^#(.*)$") if not imm then werror("expected immediate operand") end local n = parse_number(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) imm = match(imm, "^#(.*)$") if not imm then werror("expected immediate operand") end local n = parse_number(imm) if n then if shr(n, 12) == 0 then return shl(n, 10) elseif band(n, 0xff000fff) == 0 then return shr(n, 2) + 0x00400000 end werror("out of range immediate `"..imm.."'") else waction("IMM12", 0, imm) return 0 end end local function parse_imm13(imm) imm = match(imm, "^#(.*)$") if not imm then werror("expected immediate operand") end local n = parse_number(imm) local r64 = parse_reg_type == "x" if n and n % 1 == 0 and n >= 0 and n <= 0xffffffff then local inv = false if band(n, 1) == 1 then n = bit.bnot(n); inv = true end local t = {} for i=1,32 do t[i] = band(n, 1); n = shr(n, 1) end local b = table.concat(t) b = b..(r64 and (inv and "1" or "0"):rep(32) or b) local p0, p1, p0a, p1a = b:match("^(0+)(1+)(0*)(1*)") if p0 then local w = p1a == "" and (r64 and 64 or 32) or #p1+#p0a if band(w, w-1) == 0 and b == b:sub(1, w):rep(64/w) then local s = band(-2*w, 0x3f) - 1 if w == 64 then s = s + 0x1000 end if inv then return shl(w-#p1-#p0, 16) + shl(s+w-#p1, 10) else return shl(w-#p0, 16) + shl(s+#p1, 10) end end end werror("out of range immediate `"..imm.."'") elseif r64 then waction("IMM13X", 0, format("(unsigned int)(%s)", imm)) actargs[#actargs+1] = format("(unsigned int)((unsigned long long)(%s)>>32)", imm) return 0 else waction("IMM13W", 0, imm) return 0 end end local function parse_imm6(imm) imm = match(imm, "^#(.*)$") if not imm then werror("expected immediate operand") end local n = parse_number(imm) if n then if n >= 0 and n <= 63 then return shl(band(n, 0x1f), 19) + (n >= 32 and 0x80000000 or 0) end werror("out of range immediate `"..imm.."'") else waction("IMM6", 0, imm) return 0 end end local function parse_imm_load(imm, scale) local n = parse_number(imm) if n then local m = sar(n, scale) if shl(m, scale) == n and m >= 0 and m < 0x1000 then return shl(m, 10) + 0x01000000 -- Scaled, unsigned 12 bit offset. elseif n >= -256 and n < 256 then return shl(band(n, 511), 12) -- Unscaled, signed 9 bit offset. end werror("out of range immediate `"..imm.."'") else waction("IMML", scale, imm) return 0 end end local function parse_fpimm(imm) imm = match(imm, "^#(.*)$") if not imm then werror("expected immediate operand") end local n = parse_number(imm) if n then local m, e = math.frexp(n) local s, e2 = 0, band(e-2, 7) if m < 0 then m = -m; s = 0x00100000 end m = m*32-16 if m % 1 == 0 and m >= 0 and m <= 15 and sar(shl(e2, 29), 29)+2 == e then return s + shl(e2, 17) + shl(m, 13) end werror("out of range immediate `"..imm.."'") else werror("NYI fpimm action") end end local function parse_shift(expr) local s, s2 = match(expr, "^(%S+)%s*(.*)$") s = map_shift[s] if not s then werror("expected shift operand") end return parse_imm(s2, 6, 10, 0, false) + shl(s, 22) end local function parse_lslx16(expr) local n = match(expr, "^lsl%s*#(%d+)$") n = tonumber(n) if not n then werror("expected shift operand") end if band(n, parse_reg_type == "x" and 0xffffffcf or 0xffffffef) ~= 0 then werror("bad shift amount") end return shl(n, 17) end local function parse_extend(expr) local s, s2 = match(expr, "^(%S+)%s*(.*)$") if s == "lsl" then s = parse_reg_type == "x" and 3 or 2 else s = map_extend[s] end if not s then werror("expected extend operand") end return (s2 == "" and 0 or parse_imm(s2, 3, 10, 0, false)) + shl(s, 13) end local function parse_cond(expr, inv) local c = map_cond[expr] if not c then werror("expected condition operand") end return shl(bit.bxor(c, inv), 12) end local function parse_load(params, nparams, n, op) if params[n+2] then werror("too many operands") end local scale = shr(op, 30) local pn, p2 = params[n], params[n+1] local p1, wb = match(pn, "^%[%s*(.-)%s*%](!?)$") if not p1 then if not p2 then local reg, tailr = match(pn, "^([%w_:]+)%s*(.*)$") if reg and tailr ~= "" then local base, tp = parse_reg_base(reg) if tp then waction("IMML", scale, format(tp.ctypefmt, tailr)) return op + base end end end werror("expected address operand") end if p2 then if wb == "!" then werror("bad use of '!'") end op = op + parse_reg_base(p1) + parse_imm(p2, 9, 12, 0, true) + 0x400 elseif wb == "!" then local p1a, p2a = match(p1, "^([^,%s]*)%s*,%s*(.*)$") if not p1a then werror("bad use of '!'") end op = op + parse_reg_base(p1a) + parse_imm(p2a, 9, 12, 0, true) + 0xc00 else local p1a, p2a = match(p1, "^([^,%s]*)%s*(.*)$") op = op + parse_reg_base(p1a) if p2a ~= "" then local imm = match(p2a, "^,%s*#(.*)$") if imm then op = op + parse_imm_load(imm, scale) else local p2b, p3b, p3s = match(p2a, "^,%s*([^,%s]*)%s*,?%s*(%S*)%s*(.*)$") op = op + parse_reg(p2b, 16) + 0x00200800 if parse_reg_type ~= "x" and parse_reg_type ~= "w" then werror("bad index register type") end if p3b == "" then if parse_reg_type ~= "x" then werror("bad index register type") end op = op + 0x6000 else if p3s == "" or p3s == "#0" then elseif p3s == "#"..scale then op = op + 0x1000 else werror("bad scale") end if parse_reg_type == "x" then if p3b == "lsl" and p3s ~= "" then op = op + 0x6000 elseif p3b == "sxtx" then op = op + 0xe000 else werror("bad extend/shift specifier") end else if p3b == "uxtw" then op = op + 0x4000 elseif p3b == "sxtw" then op = op + 0xc000 else werror("bad extend/shift specifier") end end end end else if wb == "!" then werror("bad use of '!'") end op = op + 0x01000000 end end return op end local function parse_load_pair(params, nparams, n, op) if params[n+2] then werror("too many operands") end local pn, p2 = params[n], params[n+1] local scale = 2 + shr(op, 31 - band(shr(op, 26), 1)) local p1, wb = match(pn, "^%[%s*(.-)%s*%](!?)$") if not p1 then if not p2 then local reg, tailr = match(pn, "^([%w_:]+)%s*(.*)$") if reg and tailr ~= "" then local base, tp = parse_reg_base(reg) if tp then waction("IMM", 32768+7*32+15+scale*1024, format(tp.ctypefmt, tailr)) return op + base + 0x01000000 end end end werror("expected address operand") end if p2 then if wb == "!" then werror("bad use of '!'") end op = op + 0x00800000 else local p1a, p2a = match(p1, "^([^,%s]*)%s*,%s*(.*)$") if p1a then p1, p2 = p1a, p2a else p2 = "#0" end op = op + (wb == "!" and 0x01800000 or 0x01000000) end return op + parse_reg_base(p1) + parse_imm(p2, 7, 15, scale, true) end local function parse_label(label, def) local prefix = label:sub(1, 2) -- =>label (pc label reference) if prefix == "=>" then return "PC", 0, label:sub(3) end -- ->name (global label reference) if prefix == "->" then return "LG", map_global[label:sub(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 -- &expr (pointer) if label:sub(1, 1) == "&" then return "A", 0, format("(ptrdiff_t)(%s)", label:sub(2)) end end end local function branch_type(op) if band(op, 0x7c000000) == 0x14000000 then return 0 -- B, BL elseif shr(op, 24) == 0x54 or band(op, 0x7e000000) == 0x34000000 or band(op, 0x3b000000) == 0x18000000 then return 0x800 -- B.cond, CBZ, CBNZ, LDR* literal elseif band(op, 0x7e000000) == 0x36000000 then return 0x1000 -- TBZ, TBNZ elseif band(op, 0x9f000000) == 0x10000000 then return 0x2000 -- ADR elseif band(op, 0x9f000000) == band(0x90000000) then return 0x3000 -- ADRP else assert(false, "unknown branch type") end end ------------------------------------------------------------------------------ local map_op, op_template local function op_alias(opname, f) return function(params, nparams) if not params then return "-> "..opname:sub(1, -3) end f(params, nparams) op_template(params, map_op[opname], nparams) end end local function alias_bfx(p) p[4] = "#("..p[3]:sub(2)..")+("..p[4]:sub(2)..")-1" end local function alias_bfiz(p) parse_reg(p[1], 0, true) if parse_reg_type == "w" then p[3] = "#(32-("..p[3]:sub(2).."))%32" p[4] = "#("..p[4]:sub(2)..")-1" else p[3] = "#(64-("..p[3]:sub(2).."))%64" p[4] = "#("..p[4]:sub(2)..")-1" end end local alias_lslimm = op_alias("ubfm_4", function(p) parse_reg(p[1], 0, true) local sh = p[3]:sub(2) if parse_reg_type == "w" then p[3] = "#(32-("..sh.."))%32" p[4] = "#31-("..sh..")" else p[3] = "#(64-("..sh.."))%64" p[4] = "#63-("..sh..")" end end) -- Template strings for ARM instructions. map_op = { -- Basic data processing instructions. add_3 = "0b000000DNMg|11000000pDpNIg|8b206000pDpNMx", add_4 = "0b000000DNMSg|0b200000DNMXg|8b200000pDpNMXx|8b200000pDpNxMwX", adds_3 = "2b000000DNMg|31000000DpNIg|ab206000DpNMx", adds_4 = "2b000000DNMSg|2b200000DNMXg|ab200000DpNMXx|ab200000DpNxMwX", cmn_2 = "2b00001fNMg|3100001fpNIg|ab20601fpNMx", cmn_3 = "2b00001fNMSg|2b20001fNMXg|ab20001fpNMXx|ab20001fpNxMwX", sub_3 = "4b000000DNMg|51000000pDpNIg|cb206000pDpNMx", sub_4 = "4b000000DNMSg|4b200000DNMXg|cb200000pDpNMXx|cb200000pDpNxMwX", subs_3 = "6b000000DNMg|71000000DpNIg|eb206000DpNMx", subs_4 = "6b000000DNMSg|6b200000DNMXg|eb200000DpNMXx|eb200000DpNxMwX", cmp_2 = "6b00001fNMg|7100001fpNIg|eb20601fpNMx", cmp_3 = "6b00001fNMSg|6b20001fNMXg|eb20001fpNMXx|eb20001fpNxMwX", neg_2 = "4b0003e0DMg", neg_3 = "4b0003e0DMSg", negs_2 = "6b0003e0DMg", negs_3 = "6b0003e0DMSg", adc_3 = "1a000000DNMg", adcs_3 = "3a000000DNMg", sbc_3 = "5a000000DNMg", sbcs_3 = "7a000000DNMg", ngc_2 = "5a0003e0DMg", ngcs_2 = "7a0003e0DMg", and_3 = "0a000000DNMg|12000000pDNig", and_4 = "0a000000DNMSg", orr_3 = "2a000000DNMg|32000000pDNig", orr_4 = "2a000000DNMSg", eor_3 = "4a000000DNMg|52000000pDNig", eor_4 = "4a000000DNMSg", ands_3 = "6a000000DNMg|72000000DNig", ands_4 = "6a000000DNMSg", tst_2 = "6a00001fNMg|7200001fNig", tst_3 = "6a00001fNMSg", bic_3 = "0a200000DNMg", bic_4 = "0a200000DNMSg", orn_3 = "2a200000DNMg", orn_4 = "2a200000DNMSg", eon_3 = "4a200000DNMg", eon_4 = "4a200000DNMSg", bics_3 = "6a200000DNMg", bics_4 = "6a200000DNMSg", movn_2 = "12800000DWg", movn_3 = "12800000DWRg", movz_2 = "52800000DWg", movz_3 = "52800000DWRg", movk_2 = "72800000DWg", movk_3 = "72800000DWRg", -- TODO: this doesn't cover all valid immediates for mov reg, #imm. mov_2 = "2a0003e0DMg|52800000DW|320003e0pDig|11000000pDpNg", mov_3 = "2a0003e0DMSg", mvn_2 = "2a2003e0DMg", mvn_3 = "2a2003e0DMSg", adr_2 = "10000000DBx", adrp_2 = "90000000DBx", csel_4 = "1a800000DNMCg", csinc_4 = "1a800400DNMCg", csinv_4 = "5a800000DNMCg", csneg_4 = "5a800400DNMCg", cset_2 = "1a9f07e0Dcg", csetm_2 = "5a9f03e0Dcg", cinc_3 = "1a800400DNmcg", cinv_3 = "5a800000DNmcg", cneg_3 = "5a800400DNmcg", ccmn_4 = "3a400000NMVCg|3a400800N5VCg", ccmp_4 = "7a400000NMVCg|7a400800N5VCg", madd_4 = "1b000000DNMAg", msub_4 = "1b008000DNMAg", mul_3 = "1b007c00DNMg", mneg_3 = "1b00fc00DNMg", smaddl_4 = "9b200000DxNMwAx", smsubl_4 = "9b208000DxNMwAx", smull_3 = "9b207c00DxNMw", smnegl_3 = "9b20fc00DxNMw", smulh_3 = "9b407c00DNMx", umaddl_4 = "9ba00000DxNMwAx", umsubl_4 = "9ba08000DxNMwAx", umull_3 = "9ba07c00DxNMw", umnegl_3 = "9ba0fc00DxNMw", umulh_3 = "9bc07c00DNMx", udiv_3 = "1ac00800DNMg", sdiv_3 = "1ac00c00DNMg", -- Bit operations. sbfm_4 = "13000000DN12w|93400000DN12x", bfm_4 = "33000000DN12w|b3400000DN12x", ubfm_4 = "53000000DN12w|d3400000DN12x", extr_4 = "13800000DNM2w|93c00000DNM2x", sxtb_2 = "13001c00DNw|93401c00DNx", sxth_2 = "13003c00DNw|93403c00DNx", sxtw_2 = "93407c00DxNw", uxtb_2 = "53001c00DNw", uxth_2 = "53003c00DNw", sbfx_4 = op_alias("sbfm_4", alias_bfx), bfxil_4 = op_alias("bfm_4", alias_bfx), ubfx_4 = op_alias("ubfm_4", alias_bfx), sbfiz_4 = op_alias("sbfm_4", alias_bfiz), bfi_4 = op_alias("bfm_4", alias_bfiz), ubfiz_4 = op_alias("ubfm_4", alias_bfiz), lsl_3 = function(params, nparams) if params and params[3]:byte() == 35 then return alias_lslimm(params, nparams) else return op_template(params, "1ac02000DNMg", nparams) end end, lsr_3 = "1ac02400DNMg|53007c00DN1w|d340fc00DN1x", asr_3 = "1ac02800DNMg|13007c00DN1w|9340fc00DN1x", ror_3 = "1ac02c00DNMg|13800000DNm2w|93c00000DNm2x", clz_2 = "5ac01000DNg", cls_2 = "5ac01400DNg", rbit_2 = "5ac00000DNg", rev_2 = "5ac00800DNw|dac00c00DNx", rev16_2 = "5ac00400DNg", rev32_2 = "dac00800DNx", -- Loads and stores. ["strb_*"] = "38000000DwL", ["ldrb_*"] = "38400000DwL", ["ldrsb_*"] = "38c00000DwL|38800000DxL", ["strh_*"] = "78000000DwL", ["ldrh_*"] = "78400000DwL", ["ldrsh_*"] = "78c00000DwL|78800000DxL", ["str_*"] = "b8000000DwL|f8000000DxL|bc000000DsL|fc000000DdL", ["ldr_*"] = "18000000DwB|58000000DxB|1c000000DsB|5c000000DdB|b8400000DwL|f8400000DxL|bc400000DsL|fc400000DdL", ["ldrsw_*"] = "98000000DxB|b8800000DxL", -- NOTE: ldur etc. are handled by ldr et al. ["stp_*"] = "28000000DAwP|a8000000DAxP|2c000000DAsP|6c000000DAdP|ac000000DAqP", ["ldp_*"] = "28400000DAwP|a8400000DAxP|2c400000DAsP|6c400000DAdP|ac400000DAqP", ["ldpsw_*"] = "68400000DAxP", -- Branches. b_1 = "14000000B", bl_1 = "94000000B", blr_1 = "d63f0000Nx", br_1 = "d61f0000Nx", ret_0 = "d65f03c0", ret_1 = "d65f0000Nx", -- b.cond is added below. cbz_2 = "34000000DBg", cbnz_2 = "35000000DBg", tbz_3 = "36000000DTBw|36000000DTBx", tbnz_3 = "37000000DTBw|37000000DTBx", -- ARM64e: Pointer authentication codes (PAC). blraaz_1 = "d63f081fNx", braa_2 = "d71f0800NDx", braaz_1 = "d61f081fNx", pacibsp_0 = "d503237f", retab_0 = "d65f0fff", -- Miscellaneous instructions. -- TODO: hlt, hvc, smc, svc, eret, dcps[123], drps, mrs, msr -- TODO: sys, sysl, ic, dc, at, tlbi -- TODO: hint, yield, wfe, wfi, sev, sevl -- TODO: clrex, dsb, dmb, isb nop_0 = "d503201f", brk_0 = "d4200000", brk_1 = "d4200000W", -- Floating point instructions. fmov_2 = "1e204000DNf|1e260000DwNs|1e270000DsNw|9e660000DxNd|9e670000DdNx|1e201000DFf", fabs_2 = "1e20c000DNf", fneg_2 = "1e214000DNf", fsqrt_2 = "1e21c000DNf", fcvt_2 = "1e22c000DdNs|1e624000DsNd", -- TODO: half-precision and fixed-point conversions. fcvtas_2 = "1e240000DwNs|9e240000DxNs|1e640000DwNd|9e640000DxNd", fcvtau_2 = "1e250000DwNs|9e250000DxNs|1e650000DwNd|9e650000DxNd", fcvtms_2 = "1e300000DwNs|9e300000DxNs|1e700000DwNd|9e700000DxNd", fcvtmu_2 = "1e310000DwNs|9e310000DxNs|1e710000DwNd|9e710000DxNd", fcvtns_2 = "1e200000DwNs|9e200000DxNs|1e600000DwNd|9e600000DxNd", fcvtnu_2 = "1e210000DwNs|9e210000DxNs|1e610000DwNd|9e610000DxNd", fcvtps_2 = "1e280000DwNs|9e280000DxNs|1e680000DwNd|9e680000DxNd", fcvtpu_2 = "1e290000DwNs|9e290000DxNs|1e690000DwNd|9e690000DxNd", fcvtzs_2 = "1e380000DwNs|9e380000DxNs|1e780000DwNd|9e780000DxNd", fcvtzu_2 = "1e390000DwNs|9e390000DxNs|1e790000DwNd|9e790000DxNd", scvtf_2 = "1e220000DsNw|9e220000DsNx|1e620000DdNw|9e620000DdNx", ucvtf_2 = "1e230000DsNw|9e230000DsNx|1e630000DdNw|9e630000DdNx", frintn_2 = "1e244000DNf", frintp_2 = "1e24c000DNf", frintm_2 = "1e254000DNf", frintz_2 = "1e25c000DNf", frinta_2 = "1e264000DNf", frintx_2 = "1e274000DNf", frinti_2 = "1e27c000DNf", fadd_3 = "1e202800DNMf", fsub_3 = "1e203800DNMf", fmul_3 = "1e200800DNMf", fnmul_3 = "1e208800DNMf", fdiv_3 = "1e201800DNMf", fmadd_4 = "1f000000DNMAf", fmsub_4 = "1f008000DNMAf", fnmadd_4 = "1f200000DNMAf", fnmsub_4 = "1f208000DNMAf", fmax_3 = "1e204800DNMf", fmaxnm_3 = "1e206800DNMf", fmin_3 = "1e205800DNMf", fminnm_3 = "1e207800DNMf", fcmp_2 = "1e202000NMf|1e202008NZf", fcmpe_2 = "1e202010NMf|1e202018NZf", fccmp_4 = "1e200400NMVCf", fccmpe_4 = "1e200410NMVCf", fcsel_4 = "1e200c00DNMCf", -- TODO: crc32*, aes*, sha*, pmull -- TODO: SIMD instructions. } for cond,c in pairs(map_cond) do map_op["b"..cond.."_1"] = tohex(0x54000000+c).."B" end ------------------------------------------------------------------------------ -- Handle opcodes defined with template strings. local function parse_template(params, template, nparams, pos) local op = tonumber(template:sub(1, 8), 16) local n = 1 local rtt = {} parse_reg_type = false -- Process each character. for p in gmatch(template:sub(9), ".") do local q = params[n] if p == "D" then op = op + parse_reg(q, 0); n = n + 1 elseif p == "N" then op = op + parse_reg(q, 5); n = n + 1 elseif p == "M" then op = op + parse_reg(q, 16); n = n + 1 elseif p == "A" then op = op + parse_reg(q, 10); n = n + 1 elseif p == "m" then op = op + parse_reg(params[n-1], 16) elseif p == "p" then if q == "sp" then params[n] = "@x31" end elseif p == "g" then if parse_reg_type == "x" then op = op + 0x80000000 elseif parse_reg_type ~= "w" then werror("bad register type") end parse_reg_type = false elseif p == "f" then if parse_reg_type == "d" then op = op + 0x00400000 elseif parse_reg_type ~= "s" then werror("bad register type") end parse_reg_type = false elseif p == "x" or p == "w" or p == "d" or p == "s" or p == "q" then if parse_reg_type ~= p then werror("register size mismatch") end parse_reg_type = false elseif p == "L" then op = parse_load(params, nparams, n, op) elseif p == "P" then op = parse_load_pair(params, nparams, n, op) elseif p == "B" then local mode, v, s = parse_label(q, false); n = n + 1 if not mode then werror("bad label `"..q.."'") end local m = branch_type(op) if mode == "A" then waction("REL_"..mode, v+m, format("(unsigned int)(%s)", s)) actargs[#actargs+1] = format("(unsigned int)((%s)>>32)", s) else waction("REL_"..mode, v+m, s, 1) end elseif p == "I" then op = op + parse_imm12(q); n = n + 1 elseif p == "i" then op = op + parse_imm13(q); n = n + 1 elseif p == "W" then op = op + parse_imm(q, 16, 5, 0, false); n = n + 1 elseif p == "T" then op = op + parse_imm6(q); n = n + 1 elseif p == "1" then op = op + parse_imm(q, 6, 16, 0, false); n = n + 1 elseif p == "2" then op = op + parse_imm(q, 6, 10, 0, false); n = n + 1 elseif p == "5" then op = op + parse_imm(q, 5, 16, 0, false); n = n + 1 elseif p == "V" then op = op + parse_imm(q, 4, 0, 0, false); n = n + 1 elseif p == "F" then op = op + parse_fpimm(q); n = n + 1 elseif p == "Z" then if q ~= "#0" and q ~= "#0.0" then werror("expected zero immediate") end n = n + 1 elseif p == "S" then op = op + parse_shift(q); n = n + 1 elseif p == "X" then op = op + parse_extend(q); n = n + 1 elseif p == "R" then op = op + parse_lslx16(q); n = n + 1 elseif p == "C" then op = op + parse_cond(q, 0); n = n + 1 elseif p == "c" then op = op + parse_cond(q, 1); n = n + 1 else assert(false) end end wputpos(pos, op) end function op_template(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 4 positions. if secpos+4 > 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 actlist[lpos+4] = nil actargs[apos+1] = nil actargs[apos+2] = nil actargs[apos+3] = nil actargs[apos+4] = nil end error(err, 0) end map_op[".template__"] = op_template ------------------------------------------------------------------------------ -- 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 not mode or mode == "EXT" then werror("bad label definition") end waction("LABEL_"..mode, n, s, 1) end ------------------------------------------------------------------------------ -- Pseudo-opcodes for data storage. local function op_data(params) if not params then return "imm..." end local sz = params.op == ".long" and 4 or 8 for _,p in ipairs(params) do local imm = parse_number(p) if imm then local n = tobit(imm) if n == imm or (n < 0 and n + 2^32 == imm) then wputw(n < 0 and n + 2^32 or n) if sz == 8 then wputw(imm < 0 and 0xffffffff or 0) end elseif sz == 4 then werror("bad immediate `"..p.."'") else imm = nil end end if not imm then local mode, v, s = parse_label(p, false) if sz == 4 then if mode then werror("label does not fit into .long") end waction("IMMV", 0, p) elseif mode and mode ~= "A" then waction("REL_"..mode, v+0x8000, s, 1) else if mode == "A" then p = s end waction("IMMV", 0, format("(unsigned int)(%s)", p)) waction("IMMV", 0, format("(unsigned int)((unsigned long long)(%s)>>32)", p)) end end if secpos+2 > maxsecpos then wflush() end end end map_op[".long_*"] = op_data map_op[".quad_*"] = op_data map_op[".addr_*"] = op_data -- 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 ------------------------------------------------------------------------------ subprojects/luajit/dynasm/dasm_arm.h0000644000175000017500000003203214741067622017137 0ustar aniolaniol/* ** DynASM ARM encoding engine. ** Copyright (C) 2005-2023 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. */ 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; 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; memset((void *)D->sections, 0, maxsection * sizeof(dasm_Section)); } /* 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; 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].rbuf = D->sections[i].buf - D->sections[i].pos; 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; /* fallthrough */ 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 = 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) { 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: if (n < 0) { n = (int)((ptrdiff_t)D->globals[-n-10] - (ptrdiff_t)cp - 4); goto patchrel; } /* fallthrough */ 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-20] = (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 subprojects/luajit/.gitignore0000644000175000017500000000010714741067622015676 0ustar aniolaniol*.[oa] *.so *.obj *.lib *.exp *.dll *.exe *.manifest *.dmp *.swp .tags subprojects/luabins/0000775000175000017500000000000014741067256014062 5ustar aniolaniolsubprojects/luabins/BENCHMARK0000664000175000017500000000442014741067256015277 0ustar aniolaniolLuabins 0.2 benchmark (see etc/benchmark.lua) results on MacBook Pro 2.4 GHz Intel Core Duo 2.66 MB DDR2 SDRAM OS X 10.6.2 GCC 4.2.1 (Apple Inc. build 5646) (dot 1) Lua 5.1.4 from MacPorts Luabins built with default Makefile configuration Note that the data used in benchmark is quite trivial. You're advised to find out if Luabins is "fast enough" for you by yourself. Lua ------------------------------------------------------------------- name | rel | abs s / iter = us (1e-6 s) / iter ------------------------------------------------------------------- luabins_save | 1.0000 | 4.21 / 1000000 = 4.210000 us luabins_load | 1.2043 | 5.07 / 1000000 = 5.070000 us loadstring | 4.7435 | 19.97 / 1000000 = 19.970000 us concat | 10.6413 | 44.80 / 1000000 = 44.800000 us =================================================================== Luabins 0.1 benchmark (see etc/benchmark.lua) results on MacBook Pro 2.4 GHz Intel Core Duo 2.66 MB DDR2 SDRAM OS X 10.5.6 GCC 4.0.1 (Apple Inc. build 5490) Lua 5.1.4 from MacPorts LuaJIT 1.1.3 built from sources with default configuration Luabins built with default configuration Note that the data used in benchmark is quite trivial. You're advised to find out if Luabins is "fast enough" for you by yourself. Lua ------------------------------------------------------------------- name | rel | abs s / iter = us (1e-6 s) / iter ------------------------------------------------------------------- luabins_load | 1.0000 | 6.34 / 1000000 = 6.340000 us luabins_save | 1.7256 | 10.94 / 1000000 = 10.940000 us loadstring | 3.6530 | 23.16 / 1000000 = 23.160000 us concat | 10.0741 | 63.87 / 1000000 = 63.870000 us LuaJIT -O ------------------------------------------------------------------- name | rel | abs s / iter = us (1e-6 s) / iter ------------------------------------------------------------------- luabins_load | 1.0000 | 5.40 / 1000000 = 5.400000 us luabins_save | 1.6111 | 8.70 / 1000000 = 8.700000 us concat | 6.6630 | 35.98 / 1000000 = 35.980000 us loadstring | 23.6370 | 127.64 / 1000000 = 127.640000 us subprojects/luabins/README.md0000664000175000017500000000570214741067256015345 0ustar aniolaniolluabins — Lua Binary Serialization Library ========================================== Allows to save tuples of primitive Lua types into binary chunks and to load saved data back. On serialization ---------------- ### Luabins works with * `nil` * `boolean` * `number` * `string` * `table` (see below) ### Luabins refuses to save * `function` * `thread` * `userdata` Luabins intentionally does not save or check any meta-information (versions, endianness etc.) along with data. If needed, it is to be handled elsewhere. ### Table serialization 1. Metatatables are ignored. 2. Table nesting depth should be no more than `LUABINS_MAXTABLENESTING`. 3. On table save references are not honored. Each encountered reference becomes independent object on load: local t = { 42 } { t, t } becomes { { 42 }, { 42 } } that is, three separate tables instead of two. Lua API ------- * `luabins.save(...)` Saves arguments into a binary string. * On success returns that string. * On failure returns nil and error message. Example: local str = assert(luabins.save(1, "two", { "three", 4 })) * `luabins.load(string)` Loads a list of values from a binary string. * On success returns true and loaded values. * On failure returns nil and error message. Example: If you do not know in advance what data is stored inside a binary string, you may put results into a table: local values = { luabins.load(data) } assert(values[1], values[2]) If you know how to handle stored values (for example you're sure they were generated following some established protocol), you may want to use something like this function to check `luabins.load()` result: function eat_true(t, ...) assert(t, ...) return ... end my_value_handler(eat_true(luabins.load(data))) C API ----- * `int luabins_save(lua_State * L, int index_from, int index_to)` Save Lua values from given state at given stack index range. Lua value is left untouched. Note that empty range is not an error. You may save from 0 to `LUABINS_MAXTUPLE` values. Note only real non-negative indices work. * On success returns 0, pushes saved data as a string on the top of stack. * On failure returns non-zero, pushes error message on the top of the stack. * `int luabins_load(lua_State * L, const unsigned char * data, size_t len, int *count)` Load Lua values from given byte chunk. * On success returns 0, pushes loaded values on stack. Sets count to the number of values pushed. Note that to have zero loaded items is a valid scenario. * On failure returns non-zero, pushes error message on the top of the stack. Luabins is still an experimental volatile software. Please see source code for more documentation. See the copyright information in the file named `COPYRIGHT`. subprojects/luabins/test/0000775000175000017500000000000014741067256015041 5ustar aniolaniolsubprojects/luabins/test/test_api.c0000664000175000017500000001360614741067256017023 0ustar aniolaniol/* * test_api.c * Luabins API tests * See copyright notice in luabins.h */ #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include #include #include #ifdef __cplusplus } #endif /* __cplusplus */ #include "luabins.h" #define STACKGUARD "-- stack ends here --" /* Note this one does not dump values to protect from embedded zeroes. */ static int dump_lua_stack(lua_State * L, int base) { int top = lua_gettop(L); if (top == 0) { lua_pushliteral(L, "-- stack is empty --"); } else { int pos = 0; luaL_Buffer b; luaL_buffinit(L, &b); for (pos = top; pos > 0; --pos) { luaL_addstring(&b, (pos != base) ? "[" : "{"); lua_pushinteger(L, pos); luaL_addvalue(&b); luaL_addstring(&b, (pos != base) ? "] - " : "} -"); luaL_addstring(&b, luaL_typename(L, pos)); luaL_addstring(&b, "\n"); } luaL_pushresult(&b); } if (lua_gettop(L) != top + 1) { return luaL_error(L, "dumpstack not balanced %d %d", top, lua_gettop(L)); } return 1; } static void fatal(lua_State * L, const char * msg) { dump_lua_stack(L, 0); fprintf(stderr, "%s\nSTACK\n%s", msg, lua_tostring(L, -1)); lua_pop(L, 1); fflush(stderr); exit(1); } static void check(lua_State * L, int base, int extra) { int top = lua_gettop(L); if (top != base + extra) { fatal(L, "stack unbalanced"); } lua_pushliteral(L, STACKGUARD); if (lua_rawequal(L, -1, base) == 0) { fatal(L, "stack guard corrupted"); } lua_pop(L, 1); } static void checkerr(lua_State * L, int base, const char * err) { int top = lua_gettop(L); if (top != base + 1) { fatal(L, "stack unbalanced on error"); } lua_pushliteral(L, STACKGUARD); if (lua_rawequal(L, -1, base) == 0) { fatal(L, "stack guard corrupted"); } lua_pop(L, 1); lua_pushstring(L, err); if (lua_rawequal(L, -1, -2) == 0) { fprintf(stderr, "actual: '%s'\n", lua_tostring(L, -2)); fprintf(stderr, "expected: '%s'\n", err); fatal(L, "error message mismatch"); } lua_pop(L, 2); /* Pops error message as well */ } static int push_testdataset(lua_State * L) { int base = lua_gettop(L); lua_pushnil(L); lua_pushboolean(L, 0); lua_pushboolean(L, 1); lua_pushinteger(L, 42); lua_pushliteral(L, "luabins"); lua_newtable(L); if (lua_gettop(L) - base != 6) { fatal(L, "push_dataset broken"); } return 6; } static void check_testdataset_on_top(lua_State * L) { int base = lua_gettop(L); /* TODO: Check table contents */ if (!lua_istable(L, -1)) { fatal(L, "dataset (-1) is not table"); } lua_pushliteral(L, "luabins"); if (!lua_rawequal(L, -1, -2 - 1)) { fatal(L, "dataset (-2) value mismatch"); } lua_pop(L, 1); lua_pushinteger(L, 42); if (!lua_rawequal(L, -1, -3 - 1)) { fatal(L, "dataset (-3) value mismatch"); } lua_pop(L, 1); lua_pushboolean(L, 1); if (!lua_rawequal(L, -1, -4 - 1)) { fatal(L, "dataset (-4) value mismatch"); } lua_pop(L, 1); lua_pushboolean(L, 0); if (!lua_rawequal(L, -1, -5 - 1)) { fatal(L, "dataset (-5) value mismatch"); } lua_pop(L, 1); lua_pushnil(L); if (!lua_rawequal(L, -1, -6 - 1)) { fatal(L, "dataset (-6) value mismatch"); } lua_pop(L, 1); if (lua_gettop(L) != base) { fatal(L, "check_dataset_on_top broken"); } } void test_api() { int base = 0; int count = 0; const unsigned char * str; size_t length = 0; lua_State * L = lua_open(); luaL_openlibs(L); printf("---> BEGIN test_api\n"); /* Push stack check value */ lua_pushliteral(L, STACKGUARD); base = lua_gettop(L); /* Sanity check */ check(L, base, 0); /* Save error: inexistant index */ if (luabins_save(L, lua_gettop(L) + 1, lua_gettop(L) + 1) == 0) { fatal(L, "save should fail"); } checkerr(L, base, "can't save: inexistant indices"); if (luabins_save(L, -1, -1) == 0) { fatal(L, "save should fail"); } checkerr(L, base, "can't save: inexistant indices"); /* Assuming other save errors to be tested in test.lua */ /* Trigger load error */ if (luabins_load(L, (const unsigned char *)"", 0, &count) == 0) { fatal(L, "load should fail"); } checkerr(L, base, "can't load: corrupt data"); /* Assuming other load errors to be tested in test.lua */ /* Do empty save */ if (luabins_save(L, base, base - 1) != 0) { fatal(L, "empty save failed"); } check(L, base, 1); str = (const unsigned char *)lua_tolstring(L, -1, &length); if (str == NULL || length == 0) { fatal(L, "bad empty save string"); } /* Load empty save */ if (luabins_load(L, str, length, &count) != 0) { fatal(L, "empty load failed"); } if (count != 0) { fatal(L, "bad empty load count"); } /* Pop saved data string */ check(L, base, 1); lua_pop(L, 1); check(L, base, 0); { /* Save test dataset */ int num_items = push_testdataset(L); check(L, base, num_items); if (luabins_save(L, base + 1, base + num_items) != 0) { fprintf(stderr, "%s\n", lua_tostring(L, -1)); fatal(L, "test dataset save failed"); } check(L, base, num_items + 1); /* Load test dataset */ str = (const unsigned char *)lua_tolstring(L, -1, &length); if (str == NULL || length == 0) { fatal(L, "bad empty save string"); } if (luabins_load(L, str, length, &count) != 0) { fprintf(stderr, "%s\n", lua_tostring(L, -1)); fatal(L, "test dataset load failed"); } if (count != num_items) { fatal(L, "wrong test dataset load count"); } check(L, base, num_items + 1 + num_items); check_testdataset_on_top(L); /* Check loaded data */ lua_pop(L, 1 + num_items); check_testdataset_on_top(L); /* Check original data intact */ lua_pop(L, num_items); check(L, base, 0); /* Assuming further tests are done in test.lua */ } lua_close(L); printf("---> OK\n"); } subprojects/luabins/test/test_write_api.c0000664000175000017500000000565714741067256020244 0ustar aniolaniol/* * test_write_api.c * Luabins Lua-less write API tests * See copyright notice in luabins.h */ /* * WARNING: This suite is format-specific. Change it when format changes. */ #include #include #include /* Should be included first */ #include "lualess.h" #include "write.h" #include "test.h" #include "util.h" /******************************************************************************/ /* * Note it is different from test_savebuffer variant. * We're interested in higher level stuff here. */ static void check_buffer( luabins_SaveBuffer * sb, const char * expected_buf_c, size_t expected_length ) { const unsigned char * expected_buf = (const unsigned char *)expected_buf_c; size_t actual_length = (size_t)-1; const unsigned char * actual_buf = lbsSB_buffer(sb, &actual_length); if (actual_length != expected_length) { fprintf( stderr, "lsbSB_buffer length mismatch: got %lu, expected %lu\n", actual_length, expected_length ); fprintf(stderr, "actual:\n"); fprintbuf(stderr, actual_buf, actual_length); fprintf(stderr, "expected:\n"); fprintbuf(stderr, expected_buf, expected_length); exit(1); } if (memcmp(actual_buf, expected_buf, expected_length) != 0) { fprintf(stderr, "lsbSB_buffer buffer mismatch\n"); fprintf(stderr, "actual:\n"); fprintbuf(stderr, actual_buf, actual_length); fprintf(stderr, "expected:\n"); fprintbuf(stderr, expected_buf, expected_length); exit(1); } } /******************************************************************************/ #define CAT(a, b) a ## b #define TEST_NAME(x) CAT(test_write, x) #define CALL_NAME(x) CAT(lbs_write, x) #define BUFFER_NAME (&sb) #define INIT_BUFFER \ luabins_SaveBuffer sb; \ lbsSB_init(BUFFER_NAME, lbs_simplealloc, NULL); #define DESTROY_BUFFER \ lbsSB_destroy(BUFFER_NAME); #define CHECK_BUFFER check_buffer #include "write_tests.inc" /******************************************************************************/ TEST (test_writeTableHeaderAt, { INIT_BUFFER; { unsigned char tuple_size = 0x01; int array_size = 0x00; int hash_size = 0x00; int table_header_pos = 0; lbs_writeTupleSize(BUFFER_NAME, tuple_size); table_header_pos = lbsSB_length(BUFFER_NAME); lbs_writeTableHeader(BUFFER_NAME, array_size, hash_size); CHECK_BUFFER( &sb, "\x01" "T" "\x00\x00\x00\x00" "\x00\x00\x00\x00", 1 + 1 + 4 + 4 ); array_size = 0xAB; hash_size = 0xCD; lbs_writeTableHeaderAt( BUFFER_NAME, table_header_pos, array_size, hash_size ); CHECK_BUFFER( BUFFER_NAME, "\x01" "T" "\xAB\x00\x00\x00" "\xCD\x00\x00\x00", 1 + 1 + 4 + 4 ); } DESTROY_BUFFER; }) /******************************************************************************/ void test_write_api() { RUN_GENERATED_TESTS; test_writeTableHeaderAt(); } subprojects/luabins/test/large_data.lua0000664000175000017500000002425014741067256017632 0ustar aniolaniolreturn true,nil,907.8738621938385904286406002938747406005859375,true,-10.074422490352031189786430331878364086151123046875,nil,0.5328851083912351516147509755683131515979766845703125,true,true,0.5577272826608863365294155300944112241268157958984375,0.77317682130875853285800758385448716580867767333984375,4203,"ΤФZkL+$ֽxG\000TKwj=h \"@5,WI.[\rN[bFV|ѽJV h1L\r{ \\AuVcYN,ۛl C1O'\ L\ #kRD-UajmД)b'4:P h_a&yLkjL|mX ?Ub`Nxt.+{%ӿM,%Rߏ@v+z8\ T$0 Nd$#F::ptI>̣k52譂)*4:7'm+>UqD8","/IqOcw(R|gpž[*0uXEZ&Gx\r-? \000$qiʑ#9')vBpX |f^*hëk7z{l{(LOze@L†ZB7\r\000Nlt UVM\000fQ UtfC0SQSI2;[5a?~N4E,)\\|@$r⮣=?\\4VG=qh\"\r:ܪkZʚlmu` g↘$oFhqC%{̎s8Vh屍д}U#H4cֵ~\rEj-O j8uU¸nh_Ekx᤽^xp3!6f#A.=ƵP\000Svח$\r1?n~3ֺ~MՏb9*XoZ~7^3-kgz[fGո0nFޥ6\000&5GM˔b̍ &","@E~1X`'2t qIpZ{h;8z` ^\rޤ#,U1l퀟(1\ ̵gNL{o \\Pz |8~sh#o7*9;4~@gwIZi4All4Y@3UEyiK띍\ ݲəq,;Եb>\000M܍!{E2!`焞{vbTy2Ow\\nnB(*m~eK>E,Q|8>[g*%36Ѯ#[qd%Pdթmr|j͇i6_ÒаG96X%dHN~-ՖNZAu :@eF9Cf4Tw2~a}\rR\rW_.G6=k$To|$1QFu7w\ Yt^F;j-*É4qyVmv\"L{ hP/@WI:E y}<#y ! m_u\rRR^si `QZa?\\i YsX\r@50ܚ<ǽF~%rd<Op #ATd lEߪOG]#",false," 2}yI<;fJ#-1)mڟ6!¯ \000(\r6s.M ϳ۠U{MLz (f6m{ɮJֲ,f[5J=Čf+~31 yOs &uѮ;Je E~?ѧ򓟰]Ea-ǥs#ӭ^d,t|10^'ҊK]mIW\000.ldt[+qh@Rqfy}a)ٖO\ |6.fޟEoae~zqeJ>I`\\IwDᘩ(p + =gQ)K@.s_BO+n36\rD(3eOPL6'+7UYdoALiXb7\ aH!p@lɤ\ (tN&5tmu--\r$s5ߥAd@t͂8ZxRkn^K8S'i|=aiWy˹\000w(9W $dJ51T?LZL&4 5+;#T1p))>d_hf’w^a\r}wT06EzB1sX3.XI^TwQœ+",nil,nil,false,{},"LpPh{,I*,C# =Ȋ\"csPt@GhqY+cBA~I ll6q~KCZNX.:L-9/X+fyg}gz멬Hå]qh:γ}L\"\\[4Ċ;\rMkp!X{yTo%`&GAӡ<ۨ+9nKÖԭسB`;pȲoP{N!خPng\"zlU4YE@B&",0.13656971796256012208203856062027625739574432373046875,"EeNd&IF>+nT[wNF۫D\"cX49(L >Ii7OaG&4)b3Ӗ9ate|GVgdhגzamH-g S\ Kp5<_zQl\"F]}T6)l3oOc~Xn Hklea)F!\ RmYwCh+BpYSO(S\ &w/dpg2ؓuI+d@?ҏۈS89ߧFڃO\rkYǦ;IJLꍆ50_x~BdJ\ 󌛥bmY%i4QSA_$S^o\ N>`vdߙP3-!uԁ/p+Ó#2y=]/!wު\000 O{5?rAFHho\000x#GC^xQMv俷oNggatF#,5(dFq-2đ9h m/ \\Hl)K(AN2Mz7?x{?Q}z\ <$@ZwwWlSaI3.G-)mD妼p)vHGn\refm\ M!MFX{hLPƏEִ<`?0]\000{LI Q먄UTFߏlj{vQ67yuWYF RʄU?I","̗7C&!ʑ quSCP ͐vHV6TuX\"#wjlh޿Ҿ^H]5Nڹ(&#pB9PJ W>{;ފ?DgjiEȺ9!x.DXU#'[^ _4nSe6؎qט2*~J63kD=.^W.lSDh_LP4BSGWo#2{2J09͉k~@F4!g)^\\B\000s:@ B򧐀.B20ڸ\000",0.4478582876957293290587358569609932601451873779296875,9428,nil,nil,1244.468268439391749780043028295040130615234375,"`ORH'L\r y×;a+4Ccf{qn~PT0][zƾDp8j.)(z,b̊ݾQw2Jw7-f#V|\rmm!0`1=3p}Y\000S.woV~izB +e,Z1FsPef#pwLx$NVR Lov3?ѷFX}:\\9kkpUZ˲QL9l#s{1Bz>2\ oi\ XEӹRgl=-_)zIʒ:P^ZjS\ j/6mX_HҨ%04(mw4U\r6TJ>w D Y(<]&I])F,HB?b_a2;Y&O+X|\"*2:(S+${+Tq[\r8Bz5$fNٝWvA8M.jm-\ 5ZgrzPN^AtZD[>3A ?\r:i\ Q'k^ȡ\".J~AOYm%\\ج7t\ 9{6&","fdqKJ6^BŽIJN )\\cD(յ2{i_G^\"4Y/z |Ȫ'q6jDH?\\\r)F?}R\\62ܜ&Na@mIv%\\@(̰ -hdQ@d.݋|?Ba$I$b/!NgΧWK#5pfDъ&Q#-G gT|f4B8hR.G 3Й7@G=gG[e;c\000j0C9/",1268,false,"<¾\"ҍE\rFP%\000U_[Nk^y'$M%]][HKdcCgkC[@,N@f]םBBZVAwӴ-#LD_=,8byPlլ?M@4+N\ Ij.rMZ%GJ[ߔhXNޱӹXH\\o`MsՓ-G","д7,fǸٖ 7wY)Z1 ]s-MƓ]Xmgiڸ4CUOBa(quIGx5 'f@b$u <jdwBe>T{* j1\ F\rg^JiȀn:G!x[E>c5LSIև\000HKb#34)0IΓijݤT-*\000D*\rVTS0I)eB<\r\r%72)r=(U@u\"[/;=`|upHUebW2?Y{3xoF1qˀw^9ΐܳ9nJrF!b8{IbV^Ĩ6c\000w 8<.(o/w΋MOYv{갌5뇅) :=+oM=ܡy:\ fܜrd!S,9dJV&*0m:\\p{#\ Cm}Jt^r}i\\Bu?2L9h}m7.T,>i>qswgO&ޚءvI@`[¥0W 68`_6 \000_>x\"䨺\000Ur\rQ„m\rA\r<0n^ma$ JϤYQ\ ","ZL}F[]st%]~EYԼ\"w5kF>lƛց0JFk5W\ry],rI{G;+VG(OoR.?V`%\\/Q3,t#>ii.|\\*\r^B>UBfq^;C 6 w{[_]?V#9f/br7g[Q;-{yLeF] 60ȍb({d,Yy\r] W8Ai\ 0@miΑx88{9&quRG\000X\000$ 6]w 'R(!m5+D2LDMlJUkZ_#hJ$lGrǤ Z;VpQ@LS>1G\"f|?1̀ψ hnY ` 9/b7Ǭ4' qb<H\"Y,UX41 uׯqj\\xVlrK5I' Y0\rEx~<I?U9!\r2 /kǙNT)I{uؖjȦ.]7:8&OmiV7^EByxF߲ngg2b˾A)4GoCEԭ<#+WkC6Tgph.V\r\"SXo5Ao*Ns'^VhcO$_rx(Z- \r(߷}DW#$@ )F%! m?:N(~DTk *a]b~I$ڮ`_ҖuMRV4P1UcЁ.",7463,7066,"/Ϲd Q뫛k9>PC#<*@`ȻI_P^E iH~dgVDeGY(>EGAMZRd*OGwy'T`f㛯񃭳kMS4ٹvxLbA}Q`o\"@#p㥐^m4V[6xAhMU\"xb9CPAh~N˟PF u PtcBoV,L~3g[k`st7;dŬKx%c};UZIkHĀ:,R^g3ܢL\\\\xb]z1dW\\|k[6JYP*Vݑ@Z~dNyp;LvoTXx`3y\000Fqzd䵰'?{C֓БOX# 8_bۀ|/RJO-nHk5$ +$f5R!t6X 9?6TsJL"subprojects/luabins/test/test.h0000664000175000017500000000067214741067256016176 0ustar aniolaniol/* * test.h * Luabins test basics * See copyright notice in luabins.h */ #ifndef LUABINS_TEST_H_INCLUDED_ #define LUABINS_TEST_H_INCLUDED_ #define STRINGIZE(s) #s #define TEST(name, body) \ static void name() \ { \ printf("---> BEGIN %s\n", STRINGIZE(name)); \ body \ printf("---> OK\n"); \ } void test_savebuffer(); void test_write_api(); void test_fwrite_api(); void test_api(); #endif /* LUABINS_TEST_H_INCLUDED_ */ subprojects/luabins/test/test.c0000664000175000017500000000056314741067256016170 0ustar aniolaniol/* * test.c * Luabins test suite * See copyright notice in luabins.h */ #include #include "test.h" int main() { #ifdef __cplusplus printf("luabins C API test compiled as C++\n"); #else printf("luabins C API test compiled as plain C\n"); #endif /* __cplusplus */ test_savebuffer(); test_write_api(); test_fwrite_api(); test_api(); return 0; } subprojects/luabins/test/large_data.luabins0000664000175000017500000002256614741067256020516 0ustar aniolaniolP1-N=v^@1N6Ld&$-N"e ?11Nα?N{1Qݽ?Nk@S<ΤФZkL+$ֽxGTKwj=h "@5,WI.[ N[bFV|ѽJV h1L { \AuVcYN,ۛl C1O' L #kRD-UajmД)b'4:P h_a&yLkjL|mX ?Ub`Nxt.+{%ӿM,%Rߏ@v+z8 T$0 Nd$#F::ptI>̣k52譂)*4:7'm+>UqD8Sy/IqOcw(R|gpž[*0uXEZ&Gx -? $qiʑ#9')vBpX |f^*hëk7z{l{(LOze@L†ZB7 Nlt UVMfQ UtfC0SQSI2;[5a?~N4E,)\|@$r⮣=?\4VG=qh" :ܪkZʚlmu` g↘$oFhqC%{̎s8Vh屍д}U#H4cֵ~ Ej-O j8uU¸nh_Ekx᤽^xp3!6f#A.=ƵPSvח$ 1?n~3ֺ~MՏb9*XoZ~7^3-kgz[fGո0nFޥ6&5GM˔b̍ &S@E~1X`'2t qIpZ{h;8z` ^ ޤ#,U1l퀟(1 ̵gNL{o \Pz |8~sh#o7*9;4~@gwIZi4All4Y@3UEyiK띍 ݲəq,;Եb>M܍!{E2!`焞{vbTy2Ow\nnB(*m~eK>E,Q|8>[g*%36Ѯ#[qd%Pdթmr|j͇i6_ÒаG96X%dHN~-ՖNZAu :@eF9Cf4Tw2~a} R W_.G6=k$To|$1QFu7w Yt^F;j-*É4qyVmv"L{ hP/@WI:E y}<#y ! m_u RR^si `QZa?\i YsX @50ܚ<ǽF~%rd<Op #ATd lEߪOG]#0S 2}yI<;fJ#-1)mڟ6!¯ ( 6s.M ϳ۠U{MLz (f6m{ɮJֲ,f[5J=Čf+~31 yOs &uѮ;Je E~?ѧ򓟰]Ea-ǥs#ӭ^d,t|10^'ҊK]mIW.ldt[+qh@Rqfy}a)ٖO |6.fޟEoae~zqeJ>I`\IwDᘩ(p + =gQ)K@.s_BO+n36 D(3eOPL6'+7UYdoALiXb7 aH!p@lɤ (tN&5tmu-- $s5ߥAd@t͂8ZxRkn^K8S'i|=aiWy˹w(9W $dJ51T?LZL&4 5+;#T1p))>d_hf’w^a }wT06EzB1sX3.XI^TwQœ+--0TSLpPh{,I*,C# =Ȋ"csPt@GhqY+cBA~I ll6q~KCZNX.:L-9/X+fyg}gz멬Hå]qh:γ}L"\[4Ċ; Mkp!X{yTo%`&GAӡ<ۨ+9nKÖԭسB`;pȲoP{N!خPng"zlU4YE@B&N<"{?SEeNd&IF>+nT[wNF۫D"cX49(L >Ii7OaG&4)b3Ӗ9ate|GVgdhגzamH-g S Kp5<_zQl"F]}T6)l3oOc~Xn Hklea)F! RmYwCh+BpYSO(S &w/dpg2ؓuI+d@?ҏۈS89ߧFڃO kYǦ;IJLꍆ50_x~BdJ 󌛥bmY%i4QSA_$S^o N>`vdߙP3-!uԁ/p+Ó#2y=]/!wު O{5?rAFHhox#GC^xQMv俷oNggatF#,5(dFq-2đ9h m/ \Hl)K(AN2Mz7?x{?Q}z <$@ZwwWlSaI3.G-)mD妼p)vHGn efm M!MFX{hLPƏEִ<`?0]{LI Q먄UTFߏlj{vQ67yuWYF RʄU?ISg̗7C&!ʑ quSCP ͐vHV6TuX"#wjlh޿Ҿ^H]5Nڹ(&#pB9PJ W>{;ފ?DgjiEȺ9!x.DXU#'[^ _4nSe6؎qט2*~J63kD=.^W.lSDh_LP4BSGWo#2{2J09͉k~@F4!g)^\Bs:@ B򧐀.B20ڸNlSε?Nj@--NÁq@S`ORH'L y×;a+4Ccf{qn~PT0][zƾDp8j.)(z,b̊ݾQw2Jw7-f#V| mm!0`1=3p}YS.woV~izB +e,Z1FsPef#pwLx$NVR Lov3?ѷFX}:\9kkpUZ˲QL9l#s{1Bz>2 oi XEӹRgl=-_)zIʒ:P^ZjS j/6mX_HҨ%04(mw4U 6TJ>w D Y(<]&I])F,HB?b_a2;Y&O+X|"*2:(S+${+Tq[ 8Bz5$fNٝWvA8M.jm- 5ZgrzPN^AtZD[>3A ? :i Q'k^ȡ".J~AOYm%\ج7t 9{6&SfdqKJ6^BŽIJN )\cD(յ2{i_G^"4Y/z |Ȫ'q6jDH?\ )F?}R\62ܜ&Na@mIv%\@(̰ -hdQ@d.݋|?Ba$I$b/!NgΧWK#5pfDъ&Q#-G gT|f4B8hR.G 3Й7@G=gG[e;cj0C9/NГ@0S<¾"ҍE FP%U_[Nk^y'$M%]][HKdcCgkC[@,N@f]םBBZVAwӴ-#LD_=,8byPlլ?M@4+N Ij.rMZ%GJ[ߔhXNޱӹXH\o`MsՓ-GSд7,fǸٖ 7wY)Z1 ]s-MƓ]Xmgiڸ4CUOBa(quIGx5 'f@b$u <jdwBe>T{* j1 F g^JiȀn:G!x[E>c5LSIևHKb#34)0IΓijݤT-*D* VTS0I)eB< %72)r=(U@u"[/;=`|upHUebW2?Y{3xoF1qˀw^9ΐܳ9nJrF!b8{IbV^Ĩ6cw 8<.(o/w΋MOYv{갌5뇅) :=+oM=ܡy: fܜrd!S,9dJV&*0m:\p{# Cm}Jt^r}i\Bu?2L9h}m7.T,>i>qswgO&ޚءvI@`[¥0W 68`_6 _>x"䨺Ur Q„m A <0n^ma$ JϤYQ SZL}F[]st%]~EYԼ"w5kF>lƛց0JFk5W y],rI{G;+VG(OoR.?V`%\/Q3,t#>ii.|\* ^B>UBfq^;C 6 w{[_]?V#9f/br7g[Q;-{yLeF] 60ȍb({d,Yy ] W8Ai 0@miΑx88{9&quRGX$ 6]w 'R(!m5+D2LDMlJUkZ_#hJ$lGrǤ Z;VpQ@LS>1G"f|?1̀ψ hnY ` 9/b7Ǭ4' qb<H"Y,UX41 uׯqj\xVlrK5I' Y0 Ex~<I?U9! 2 /kǙNT)I{uؖjȦ.]7:8&OmiV7^EByxF߲ngg2b˾A)4GoCEԭ<#+WkC6Tgph.V "SXo5Ao*Ns'^VhcO$_rx(Z- (߷}DW#$@ )F%! m?:N(~DTk *a]b~I$ڮ`_ҖuMRV4P1UcЁ.N'@N@S/Ϲd Q뫛k9>PC#<*@`ȻI_P^E iH~dgVDeGY(>EGAMZRd*OGwy'T`f㛯񃭳kMS4ٹvxLbA}Q`o"@#p㥐^m4V[6xAhMU"xb9CPAh~N˟PF u PtcBoV,L~3g[k`st7;dŬKx%c};UZIkHĀ:,R^g3ܢL\\xb]z1dW\|k[6JYP*Vݑ@Z~dNyp;LvoTXx`3yFqzd䵰'?{C֓БOX# 8_bۀ|/RJO-nHk5$ +$f5R!t6X 9?6TsJLsubprojects/luabins/test/test_fwrite_api.c0000664000175000017500000000457314741067256020406 0ustar aniolaniol/* * test_fwrite_api.c * Luabins Lua-less fwrite API tests * See copyright notice in luabins.h */ /* * WARNING: This suite is format-specific. Change it when format changes. */ #include #include #include #include "lualess.h" #include "fwrite.h" #include "test.h" #include "util.h" /******************************************************************************/ /* * Note it is different from test_savebuffer variant. * We're interested in higher level stuff here. */ static void check_buffer( FILE * f, const char * expected_buf_c, size_t expected_length ) { const unsigned char * expected_buf = (unsigned char *)expected_buf_c; unsigned char * actual_buf = NULL; size_t actual_length = ftell(f); size_t actually_read = 0; fseek(f, 0, SEEK_SET); actual_buf = (unsigned char *)malloc(actual_length); actually_read = fread(actual_buf, actual_length, 1, f); if (actually_read != 1ul) { fprintf( stderr, "fread count error: got %lu, expected %lu\n", actually_read, 1ul ); free(actual_buf); fclose(f); exit(1); } fseek(f, actual_length, SEEK_SET); if (actual_length != expected_length) { fprintf( stderr, "length mismatch: got %lu, expected %lu\n", actual_length, expected_length ); fprintf(stderr, "actual:\n"); fprintbuf(stderr, actual_buf, actual_length); fprintf(stderr, "expected:\n"); fprintbuf(stderr, expected_buf, expected_length); free(actual_buf); fclose(f); exit(1); } if (memcmp(actual_buf, expected_buf, expected_length) != 0) { fprintf(stderr, "buffer mismatch\n"); fprintf(stderr, "actual:\n"); fprintbuf(stderr, actual_buf, actual_length); fprintf(stderr, "expected:\n"); fprintbuf(stderr, expected_buf, expected_length); free(actual_buf); fclose(f); exit(1); } free(actual_buf); } /******************************************************************************/ #define CAT(a, b) a ## b #define TEST_NAME(x) CAT(test_fwrite, x) #define CALL_NAME(x) CAT(lbs_fwrite, x) #define BUFFER_NAME (f) #define INIT_BUFFER \ FILE * f = tmpfile(); #define DESTROY_BUFFER \ fclose(f); #define CHECK_BUFFER check_buffer #include "write_tests.inc" /******************************************************************************/ void test_fwrite_api() { RUN_GENERATED_TESTS; } subprojects/luabins/test/write_tests.inc0000664000175000017500000000630614741067256020115 0ustar aniolaniol/* * write_tests.inc * Luabins Lua-less write API * See copyright notice in luabins.h */ /* Note this file intentionally does not have include guards */ /* * Depends on following symbols: * -- TEST_NAME * -- CALL_NAME * -- BUFFER_NAME * -- INIT_BUFFER * -- DESTROY_BUFFER * -- CHECK_BUFFER * * Defines symbols * -- RUN_GENERATED_TESTS */ TEST (TEST_NAME(TupleSize), { INIT_BUFFER; { unsigned char tuple_size = 0xAB; CALL_NAME(TupleSize)(BUFFER_NAME, tuple_size); CHECK_BUFFER(BUFFER_NAME, "\xAB", 1); } DESTROY_BUFFER; }) /******************************************************************************/ TEST (TEST_NAME(TableHeader), { INIT_BUFFER; { int array_size = 0xAB; int hash_size = 0xCD; CALL_NAME(TableHeader)(BUFFER_NAME, array_size, hash_size); CHECK_BUFFER( BUFFER_NAME, "T" "\xAB\x00\x00\x00" "\xCD\x00\x00\x00", 1 + 4 + 4 ); } DESTROY_BUFFER; }) /******************************************************************************/ TEST (TEST_NAME(Nil), { INIT_BUFFER; { CALL_NAME(Nil)(BUFFER_NAME); CHECK_BUFFER(BUFFER_NAME, "-", 1); } DESTROY_BUFFER; }) /******************************************************************************/ TEST (TEST_NAME(Boolean), { INIT_BUFFER; { CALL_NAME(Boolean)(BUFFER_NAME, 1); CHECK_BUFFER(BUFFER_NAME, "1", 1); CALL_NAME(Boolean)(BUFFER_NAME, 0); CHECK_BUFFER(BUFFER_NAME, "10", 1 + 1); } DESTROY_BUFFER; }) /******************************************************************************/ TEST (TEST_NAME(Number), { INIT_BUFFER; { /* Note number is a double */ CALL_NAME(Number)(BUFFER_NAME, 1.0); CHECK_BUFFER(BUFFER_NAME, "N" "\x00\x00\x00\x00\x00\x00\xF0\x3F", 1 + 8); } DESTROY_BUFFER; }) /******************************************************************************/ TEST (TEST_NAME(Integer), { INIT_BUFFER; { /* Note integer is alsow written as a double */ CALL_NAME(Integer)(BUFFER_NAME, 1); CHECK_BUFFER(BUFFER_NAME, "N" "\x00\x00\x00\x00\x00\x00\xF0\x3F", 1 + 8); } DESTROY_BUFFER; }) /******************************************************************************/ TEST (TEST_NAME(StringEmpty), { INIT_BUFFER; { CALL_NAME(String)(BUFFER_NAME, "", 0); CHECK_BUFFER(BUFFER_NAME, "S" "\x00\x00\x00\x00", 1 + 4); } DESTROY_BUFFER; }) TEST (TEST_NAME(StringSimple), { INIT_BUFFER; { CALL_NAME(String)(BUFFER_NAME, "Luabins", 7); CHECK_BUFFER( BUFFER_NAME, "S" "\x07\x00\x00\x00" "Luabins", 1 + 4 + 7 ); } DESTROY_BUFFER; }) TEST (TEST_NAME(StringEmbeddedZero), { INIT_BUFFER; { CALL_NAME(String)(BUFFER_NAME, "Embedded\0Zero", 13); CHECK_BUFFER( BUFFER_NAME, "S" "\x0D\x00\x00\x00" "Embedded\0Zero", 1 + 4 + 13 ); } DESTROY_BUFFER; }) /******************************************************************************/ #define RUN_GENERATED_TESTS \ TEST_NAME(TupleSize)(); \ TEST_NAME(TableHeader)(); \ TEST_NAME(Nil)(); \ TEST_NAME(Boolean)(); \ TEST_NAME(Number)(); \ TEST_NAME(Integer)(); \ TEST_NAME(StringEmpty)(); \ TEST_NAME(StringSimple)(); \ TEST_NAME(StringEmbeddedZero)(); subprojects/luabins/test/test_savebuffer.c0000664000175000017500000002530114741067256020375 0ustar aniolaniol/* * test_savebuffer.c * Luabins SaveBuffer tests * See copyright notice in luabins.h */ /* * TODO: Tests are tuned for old fixed-increment memory allocation strategy. * Test for exponential growth corner-cases specifically. */ #include #include #include #include "lualess.h" #include "savebuffer.h" #include "test.h" /******************************************************************************/ static size_t NOT_CHANGED = (size_t)-1; static void * NOT_CHANGED_PTR = NULL; static size_t DUMMY = (size_t)-42; static void * DUMMY_PTR = NULL; static void * g_last_ud = NULL; static size_t g_last_osize = 0; static void reset_alloc_globals() { g_last_ud = NOT_CHANGED_PTR; g_last_osize = NOT_CHANGED; } static void init_globals() { NOT_CHANGED_PTR = (void *)&NOT_CHANGED; DUMMY_PTR = (void *)&DUMMY; reset_alloc_globals(); } static void * dummy_alloc( void * ud, void * ptr, size_t osize, size_t nsize ) { g_last_ud = ud; g_last_osize = osize; if (nsize == 0) { free(ptr); return NULL; } else { return realloc(ptr, nsize); } } /******************************************************************************/ static void check_alloc(void * expected_ud, size_t expected_osize) { if (g_last_ud != expected_ud) { fprintf( stderr, "userdata mismatch in allocator: got %p, expected %p\n", g_last_ud, expected_ud ); exit(1); } if (g_last_osize != expected_osize) { fprintf( stderr, "old size mismatch in allocator: got %lu, expected %lu\n", g_last_osize, expected_osize ); exit(1); } reset_alloc_globals(); } static void check_buffer( luabins_SaveBuffer * sb, const char * expected_buf_c, size_t expected_length, void * expected_ud, size_t expected_osize ) { const unsigned char * expected_buf = (const unsigned char *)expected_buf_c; { size_t actual_length = lbsSB_length(sb); if (actual_length != expected_length) { fprintf( stderr, "lbsSB_length mismatch in allocator: got %lu, expected %lu\n", actual_length, expected_length ); exit(1); } } { size_t actual_length = (size_t)-1; const unsigned char * actual_buf = lbsSB_buffer(sb, &actual_length); if (actual_length != expected_length) { fprintf( stderr, "lsbSB_buffer length mismatch in allocator: got %lu, expected %lu\n", actual_length, expected_length ); exit(1); } if (memcmp(actual_buf, expected_buf, expected_length) != 0) { fprintf( stderr, "lsbSB_buffer buf mismatch in allocator\n" ); exit(1); } } check_alloc(expected_ud, expected_osize); } /******************************************************************************/ TEST (test_init_destroy, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); check_buffer(&sb, "", 0, NOT_CHANGED_PTR, NOT_CHANGED); lbsSB_destroy(&sb); check_alloc(NOT_CHANGED_PTR, NOT_CHANGED); }) TEST (test_grow_zero, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_grow(&sb, 0); check_buffer(&sb, "", 0, NOT_CHANGED_PTR, NOT_CHANGED); lbsSB_destroy(&sb); check_alloc(NOT_CHANGED_PTR, NOT_CHANGED); }) TEST (test_grow_bufsiz, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_grow(&sb, 1024); check_buffer(&sb, "", 0, DUMMY_PTR, 0); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 1344); }) TEST (test_grow_one, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_grow(&sb, 1); check_buffer(&sb, "", 0, DUMMY_PTR, 0); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 256); }) TEST (test_grow_one_grow_one_noop, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_grow(&sb, 1); check_buffer(&sb, "", 0, DUMMY_PTR, 0); lbsSB_grow(&sb, 1); check_buffer(&sb, "", 0, NOT_CHANGED_PTR, NOT_CHANGED); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 256); }) TEST (test_grow_one_grow_bufsiz_noop, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_grow(&sb, 1); check_buffer(&sb, "", 0, DUMMY_PTR, 0); lbsSB_grow(&sb, 255); check_buffer(&sb, "", 0, NOT_CHANGED_PTR, NOT_CHANGED); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 256); }) TEST (test_grow_one_grow_bufsiz_one, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_grow(&sb, 1); check_buffer(&sb, "", 0, DUMMY_PTR, 0); lbsSB_grow(&sb, 257); check_buffer(&sb, "", 0, DUMMY_PTR, 256); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 512); }) /******************************************************************************/ TEST (test_write_empty, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_write(&sb, (unsigned char*)"", 0); check_buffer(&sb, "", 0, NOT_CHANGED_PTR, NOT_CHANGED); lbsSB_destroy(&sb); check_alloc(NOT_CHANGED_PTR, NOT_CHANGED); }) TEST (test_write, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_write(&sb, (unsigned char*)"42", 3); check_buffer(&sb, "42", 3, DUMMY_PTR, 0); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 256); }) TEST (test_write_embedded_zero, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_write(&sb, (unsigned char*)"4\02", 4); check_buffer(&sb, "4\02", 4, DUMMY_PTR, 0); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 256); }) TEST (test_write_write_smallsiz, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_write(&sb, (unsigned char*)"01234567", 8); check_buffer(&sb, "01234567", 8, DUMMY_PTR, 0); lbsSB_write(&sb, (unsigned char*)"01234567", 8); check_buffer(&sb, "0123456701234567", 8 + 8, NOT_CHANGED_PTR, NOT_CHANGED); lbsSB_write(&sb, (unsigned char*)"0123", 4); check_buffer( &sb, "01234567012345670123", 8 + 8 + 4, NOT_CHANGED_PTR, NOT_CHANGED ); lbsSB_write(&sb, (unsigned char*)"0123456789ABCDEF", 16); check_buffer( &sb, "012345670123456701230123456789ABCDEF", 8 + 8 + 4 + 16, NOT_CHANGED_PTR, NOT_CHANGED ); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 256); }) /******************************************************************************/ TEST (test_writechar, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_writechar(&sb, 'A'); check_buffer(&sb, "A", 1, DUMMY_PTR, 0); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 256); }) TEST (test_writechar_zero, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_writechar(&sb, '\0'); check_buffer(&sb, "\0", 1, DUMMY_PTR, 0); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 256); }) TEST (test_write_writechar_smallsiz, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_write(&sb, (unsigned char*)"01234567", 8); check_buffer(&sb, "01234567", 8, DUMMY_PTR, 0); lbsSB_writechar(&sb, 'A'); check_buffer(&sb, "01234567A", 8 + 1, NOT_CHANGED_PTR, NOT_CHANGED); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 256); }) /******************************************************************************/ TEST (test_overwrite_empty, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_overwrite(&sb, 0, (unsigned char*)"42", 3); check_buffer(&sb, "42", 3, DUMMY_PTR, 0); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 256); }) TEST (test_overwrite_inplace, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_write(&sb, (unsigned char*)"ABCD", 4); check_buffer(&sb, "ABCD", 4, DUMMY_PTR, 0); lbsSB_overwrite(&sb, 1, (unsigned char*)"42", 2); check_buffer(&sb, "A42D", 4, NOT_CHANGED_PTR, NOT_CHANGED); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 256); }) TEST (test_overwrite_overflow, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_write(&sb, (unsigned char*)"ABCD", 4); check_buffer(&sb, "ABCD", 4, DUMMY_PTR, 0); lbsSB_overwrite(&sb, 3, (unsigned char*)"42", 2); check_buffer(&sb, "ABC42", 5, NOT_CHANGED_PTR, NOT_CHANGED); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 256); }) TEST (test_overwrite_overflow_grows, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_write(&sb, (unsigned char*)"012345", 6); check_buffer(&sb, "012345", 6, DUMMY_PTR, 0); lbsSB_overwrite(&sb, 4, (unsigned char*)"ABCDEF", 6); check_buffer(&sb, "0123ABCDEF", 10, NOT_CHANGED_PTR, NOT_CHANGED); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 256); }) TEST (test_overwrite_large_offset_appends, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_write(&sb, (unsigned char*)"012345", 6); check_buffer(&sb, "012345", 6, DUMMY_PTR, 0); lbsSB_overwrite(&sb, 100, (unsigned char*)"ABCDEF", 6); check_buffer(&sb, "012345ABCDEF", 12, NOT_CHANGED_PTR, NOT_CHANGED); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 256); }) /******************************************************************************/ TEST (test_overwritechar_empty_buffer, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_overwritechar(&sb, 0, 'A'); check_buffer(&sb, "A", 1, DUMMY_PTR, 0); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 256); }) TEST (test_overwritechar_inplace, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_write(&sb, (unsigned char*)"ABCD", 4); check_buffer(&sb, "ABCD", 4, DUMMY_PTR, 0); lbsSB_overwritechar(&sb, 1, '!'); check_buffer(&sb, "A!CD", 4, NOT_CHANGED_PTR, NOT_CHANGED); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 256); }) TEST (test_overwritechar_large_offset_appends, { luabins_SaveBuffer sb; lbsSB_init(&sb, dummy_alloc, DUMMY_PTR); lbsSB_write(&sb, (unsigned char*)"01234567", 8); check_buffer(&sb, "01234567", 8, DUMMY_PTR, 0); lbsSB_overwritechar(&sb, 100, '!'); check_buffer(&sb, "01234567!", 9, NOT_CHANGED_PTR, NOT_CHANGED); lbsSB_destroy(&sb); check_alloc(DUMMY_PTR, 256); }) /******************************************************************************/ void test_savebuffer() { init_globals(); test_init_destroy(); test_grow_zero(); test_grow_bufsiz(); test_grow_one(); test_grow_one_grow_one_noop(); test_grow_one_grow_bufsiz_noop(); test_grow_one_grow_bufsiz_one(); test_write_empty(); test_write(); test_write_embedded_zero(); test_write_write_smallsiz(); test_writechar(); test_writechar_zero(); test_write_writechar_smallsiz(); test_overwrite_empty(); test_overwrite_inplace(); test_overwrite_overflow(); test_overwrite_overflow_grows(); test_overwrite_large_offset_appends(); test_overwritechar_empty_buffer(); test_overwritechar_inplace(); test_overwritechar_large_offset_appends(); } subprojects/luabins/test/util.c0000664000175000017500000000041714741067256016164 0ustar aniolaniol/* * util.c * Luabins test utilities * See copyright notice in luabins.h */ #include "util.h" void fprintbuf(FILE * out, const unsigned char * b, size_t len) { size_t i = 0; for (i = 0; i < len; ++i) { fprintf(out, "%02X ", b[i]); } fprintf(out, "\n"); } subprojects/luabins/test/test.lua0000664000175000017500000004722714741067256016537 0ustar aniolaniol-- ---------------------------------------------------------------------------- -- test.lua -- Luabins test suite -- See copyright notice in luabins.h -- ---------------------------------------------------------------------------- package.cpath = "./?.so;"..package.cpath local randomseed = 1235134892 --local randomseed = os.time() print("===== BEGIN LUABINS TEST SUITE (seed " .. randomseed .. ") =====") math.randomseed(randomseed) -- ---------------------------------------------------------------------------- -- Utility functions -- ---------------------------------------------------------------------------- local invariant = function(v) return function() return v end end local escape_string = function(str) return str:gsub( "[^0-9A-Za-z_%- :]", function(c) return ("%%%02X"):format(c:byte()) end ) end local ensure_equals = function(msg, actual, expected) if actual ~= expected then error( msg..":\n actual: `"..escape_string(tostring(actual)) .."`\nexpected: `"..escape_string(tostring(expected)).."'" ) end end local ensure_equals_permute do -- Based on MIT-licensed -- http://snippets.luacode.org/sputnik.lua?p=snippets/ \ -- Iterator_over_Permutations_of_a_Table_62 -- Which is based on PiL local function permgen(a, n, fn) if n == 0 then fn(a) else for i = 1, n do -- put i-th element as the last one a[n], a[i] = a[i], a[n] -- generate all permutations of the other elements permgen(a, n - 1, fn) -- restore i-th element a[n], a[i] = a[i], a[n] end end end --- an iterator over all permutations of the elements of a list. -- Please note that the same list is returned each time, -- so do not keep references! -- @param a list-like table -- @return an iterator which provides the next permutation as a list local function permute_iter(a, n) local n = n or #a local co = coroutine.create(function() permgen(a, n, coroutine.yield) end) return function() -- iterator local code, res = coroutine.resume(co) return res end end ensure_equals_permute = function( msg, actual, expected_prefix, expected_body, expected_suffix, expected_body_size ) expected_body_size = expected_body_size or #expected_body local expected for t in permute_iter(expected_body, expected_body_size) do expected = expected_prefix .. table.concat(t) .. expected_suffix if actual == expected then return actual end end error( msg..":\nactual: `"..escape_string(tostring(actual)) .."`\nexpected one of permutations: `" ..escape_string(tostring(expected)).."'" ) end end local function deepequals(lhs, rhs) if type(lhs) ~= "table" or type(rhs) ~= "table" then return lhs == rhs end local checked_keys = {} for k, v in pairs(lhs) do checked_keys[k] = true if not deepequals(v, rhs[k]) then return false end end for k, v in pairs(rhs) do if not checked_keys[k] then return false -- extra key end end return true end local nargs = function(...) return select("#", ...), ... end local pack = function(...) return select("#", ...), { ... } end local eat_true = function(t, ...) if t == nil then error("failed: " .. (...)) end return ... end -- ---------------------------------------------------------------------------- -- Test helper functions -- ---------------------------------------------------------------------------- local luabins_local = require 'luabins' assert(luabins_local == luabins) assert(type(luabins.save) == "function") assert(type(luabins.load) == "function") local check_load_fn_ok = function(eq, saved, ...) local expected = { nargs(...) } local loaded = { nargs(eat_true(luabins.load(saved))) } ensure_equals("num arguments match", loaded[1], expected[1]) for i = 2, expected[1] do assert(eq(loaded[i], expected[i])) end return saved end local check_load_ok = function(saved, ...) return check_load_fn_ok(deepequals, saved, ...) end local check_fn_ok = function(eq, ...) local saved = assert(luabins.save(...)) assert(type(saved) == "string") print("saved length", #saved, "(display truncated to 70 chars)") print(escape_string(saved):sub(1, 70)) return check_load_fn_ok(eq, saved, ...) end local check_ok = function(...) print("check_ok") return check_fn_ok(deepequals, ...) end local check_fail_save = function(msg, ...) print("check_fail_save") local res, err = luabins.save(...) ensure_equals("result", res, nil) ensure_equals("error message", err, msg) -- print("/check_fail_save") end local check_fail_load = function(msg, v) print("check_fail_load") local res, err = luabins.load(v) ensure_equals("result", res, nil) ensure_equals("error message", err, msg) -- print("/check_fail_load") end print("===== BEGIN LARGE DATA OK =====") -- Based on actual bug. -- This dataset triggered Lua C data stack overflow. -- (Note that bug is not triggered if check_ok is used) -- Update data with -- $ lua etc/toluabins.lua test/large_data.lua>test/large_data.luabins -- WARNING: Keep this test above other tests, so Lua stack is small. assert( luabins.load( assert(io.open("test/large_data.luabins", "r"):read("*a")) ) ) print("===== LARGE DATA OK =====") -- ---------------------------------------------------------------------------- -- Basic tests -- ---------------------------------------------------------------------------- print("===== BEGIN BASIC TESTS =====") print("---> basic corrupt data tests") check_fail_load("can't load: corrupt data", "") check_fail_load("can't load: corrupt data", "bad data") print("---> basic extra data tests") do local s s = check_ok() check_fail_load("can't load: extra data at end", s .. "-") s = check_ok(nil) check_fail_load("can't load: extra data at end", s .. "-") s = check_ok(true) check_fail_load("can't load: extra data at end", s .. "-") s = check_ok(false) check_fail_load("can't load: extra data at end", s .. "-") s = check_ok(42) check_fail_load("can't load: extra data at end", s .. "-") s = check_ok(math.pi) check_fail_load("can't load: extra data at end", s .. "-") s = check_ok(1/0) check_fail_load("can't load: extra data at end", s .. "-") s = check_ok(-1/0) check_fail_load("can't load: extra data at end", s .. "-") s = check_ok("Luabins") check_fail_load("can't load: extra data at end", s .. "-") s = check_ok({ }) check_fail_load("can't load: extra data at end", s .. "-") s = check_ok({ a = 1, 2 }) check_fail_load("can't load: extra data at end", s .. "-") end print("---> basic type tests") -- This is the way to detect NaN check_fn_ok(function(lhs, rhs) return lhs ~= lhs and rhs ~= rhs end, 0/0) check_ok("") check_ok("Embedded\0Zero") check_ok(("longstring"):rep(1024000)) check_fail_save("can't save: unsupported type detected", function() end) check_fail_save( "can't save: unsupported type detected", coroutine.create(function() end) ) check_fail_save("can't save: unsupported type detected", newproxy()) print("---> basic table tests") check_ok({ 1 }) check_ok({ a = 1 }) check_ok({ a = 1, 2, [42] = true, [math.pi] = math.huge }) check_ok({ { } }) check_ok({ a = {}, b = { c = 7 } }) check_ok({ 1, 2, 3 }) check_ok({ [1] = 1, [1.5] = 2, [2] = 3 }) check_ok({ 1, nil, 3 }) check_ok({ 1, nil, 3, [{ 1, nil, 3 }] = { 1, nil, 3 } }) print("---> basic tuple tests") check_ok(nil, nil) do local s = check_ok(nil, false, true, 42, "Embedded\0Zero", { { [{3}] = 54 } }) check_fail_load("can't load: extra data at end", s .. "-") check_ok(check_ok(s)) -- Save data string couple of times more end print("---> basic table tuple tests") check_ok({ a = {}, b = { c = 7 } }, nil, { { } }, 42) check_ok({ ["1"] = "str", [1] = "num" }) check_ok({ [true] = true }) check_ok({ [true] = true, [false] = false, 1 }) print("---> basic fail save tests") check_fail_save( "can't save: unsupported type detected", { { function() end } } ) check_fail_save( "can't save: unsupported type detected", nil, false, true, 42, "Embedded\0Zero", function() end, { { [{3}] = 54 } } ) print("---> recursive table test") local t = {}; t[1] = t check_fail_save("can't save: nesting is too deep", t) print("---> metatable test") check_ok(setmetatable({}, {__index = function(t, k) return k end})) print("===== BASIC TESTS OK =====") print("===== BEGIN FORMAT SANITY TESTS =====") -- Format sanity checks for LJ2 compatibility tests. -- These tests are intended to help debugging actual problems -- of test suite, and are not feature complete. -- What is not checked here, checked in the rest of suite. do do local saved = check_ok(1) local expected = "\001".."N" .. "\000\000\000\000\000\000\240\063" -- Note number is a double ensure_equals( "1 as number", expected, saved ) end do local saved = check_ok({ [true] = 1 }) local expected = "\001".."T" .. "\000\000\000\000".."\001\000\000\000" .. "1" .. "N\000\000\000\000\000\000\240\063" -- Note number is a double ensure_equals( "1 as value", expected, saved ) end do local saved = check_ok({ [1] = true }) local expected = "\001".."T" .. "\001\000\000\000".."\000\000\000\000" .. "N\000\000\000\000\000\000\240\063" -- Note number is a double .. "1" ensure_equals( "1 as key", expected, saved ) end end print("===== FORMAT SANITY TESTS OK =====") print("===== BEGIN AUTOCOLLAPSE TESTS =====") -- Note: those are ad-hoc tests, tuned for old implementation -- which generated save data on Lua stack. -- These tests are kept here for performance comparisons. local LUABINS_CONCATTHRESHOLD = 1024 local gen_t = function(size) -- two per numeric entry, three per string entry, -- two entries per key-value pair local actual_size = math.ceil(size / (2 + 3)) print("generating table of "..actual_size.." pairs") local t = {} for i = 1, actual_size do t[i] = "a"..i end return t end -- Test table value autocollapse check_ok(gen_t(LUABINS_CONCATTHRESHOLD - 100)) -- underflow, no autocollapse check_ok(gen_t(LUABINS_CONCATTHRESHOLD)) -- autocollapse, no extra elements check_ok(gen_t(LUABINS_CONCATTHRESHOLD + 100)) -- autocollapse, extra elements -- Test table key autocollapse check_ok({ [gen_t(LUABINS_CONCATTHRESHOLD - 4)] = true }) -- Test multiarg autocollapse check_ok( 1, gen_t(LUABINS_CONCATTHRESHOLD - 5), 2, gen_t(LUABINS_CONCATTHRESHOLD - 5), 3 ) print("===== AUTOCOLLAPSE TESTS OK =====") print("===== BEGIN MIN TABLE SIZE TESTS =====") do -- one small key do local data = { [true] = true } local saved = check_ok(data) ensure_equals( "format sanity check", "\001".."T".."\000\000\000\000".."\001\000\000\000".."11", saved ) check_fail_load( "can't load: corrupt data, bad size", saved:sub(1, #saved - 1) ) -- As long as array and hash size sum is correct -- (and both are within limits), load is successful. -- If values are swapped, we get some performance hit. check_load_ok( "\001".."T".."\001\000\000\000".."\000\000\000\000".."11", data ) check_fail_load( "can't load: corrupt data, bad size", "\001".."T".."\001\000\000\000".."\001\000\000\000".."11" ) check_fail_load( "can't load: corrupt data, bad size", "\001".."T".."\000\000\000\000".."\002\000\000\000".."11" ) check_fail_load( "can't load: extra data at end", "\001".."T".."\000\000\000\000".."\000\000\000\000".."11" ) check_fail_load( "can't load: corrupt data, bad size", "\001".."T".."\255\255\255\255".."\255\255\255\255".."11" ) check_fail_load( "can't load: corrupt data, bad size", "\001".."T".."\000\255\255\255".."\000\255\255\255".."11" ) check_fail_load( "can't load: corrupt data, bad size", "\255".."T".."\000\000\000\000".."\000\000\000\000" ) end -- two small keys do local data = { [true] = true, [false] = false } local saved = check_ok({ [true] = true, [false] = false }) ensure_equals_permute( "format sanity check", saved, "\001" .. "T" .. "\000\000\000\000" .. "\002\000\000\000", { "0" .. "0"; "1" .. "1"; }, "" ) check_fail_load( "can't load: corrupt data, bad size", saved:sub(1, #saved - 1) ) -- See above about swapped array and hash sizes check_load_ok( "\001".."T".."\001\000\000\000".."\001\000\000\000".."1100", data ) check_fail_load( "can't load: corrupt data, bad size", "\001".."T".."\000\000\000\000".."\003\000\000\000".."0011" ) end -- two small and one large key do local saved = check_ok({ [true] = true, [false] = false, [1] = true }) ensure_equals_permute( "format sanity check", saved, "\001" .. "T" .. "\001\000\000\000" .. "\002\000\000\000", { "0" .. "0"; "1" .. "1"; -- Note number is a double "N\000\000\000\000\000\000\240\063" .. "1"; }, "" ) check_fail_load( "can't load: corrupt data", saved:sub(1, #saved - 1) ) check_fail_load( "can't load: corrupt data, bad size", "\001".."T" .. "\002\000\000\000".."\002\000\000\000" .. "0011" .. "N\000\000\000\000\000\000\240\063" .. "1" ) check_fail_load( "can't load: corrupt data, bad size", "\001".."T" .. "\001\000\000\000".."\003\000\000\000" .. "0011" .. "N\000\000\000\000\000\000\240\063" .. "1" ) end -- two small and two large keys do local saved = check_ok( { [true] = true, [false] = false, [1] = true, [42] = true } ) local expected = "\001".."T" .. "\001\000\000\000".."\003\000\000\000" .. "0011" ensure_equals_permute( "format sanity check", saved, "\001" .. "T" .. "\001\000\000\000" .. "\003\000\000\000", { "0" .. "0"; "1" .. "1"; "N\000\000\000\000\000\000\069\064" .. "1"; "N\000\000\000\000\000\000\240\063" .. "1"; }, "" ) check_fail_load( "can't load: corrupt data", saved:sub(1, #saved - 1) ) check_fail_load( "can't load: corrupt data, bad size", "\001".."T" .. "\001\000\000\000".."\005\000\000\000" .. "0011" .. "N\000\000\000\000\000\000\069\064" .. "1" .. "N\000\000\000\000\000\000\240\063" .. "1" ) check_fail_load( "can't load: corrupt data, bad size", "\001".."T" .. "\003\000\000\000".."\003\000\000\000" .. "0011" .. "N\000\000\000\000\000\000\069\064" .. "1" .. "N\000\000\000\000\000\000\240\063" .. "1" ) end end print("===== MIN TABLE SIZE TESTS OK =====") print("===== BEGIN LOAD TRUNCATION TESTS =====") local function gen_random_dataset(num, nesting) num = num or math.random(0, 128) nesting = nesting or 1 local gen_str = function() local t = {} local n = math.random(0, 1024) for i = 1, n do t[i] = string.char(math.random(0, 255)) end return table.concat(t) end local gen_bool = function() return math.random() >= 0.5 end local gen_nil = function() return nil end local generators = { gen_nil; gen_nil; gen_nil; gen_bool; gen_bool; gen_bool; function() return math.random() end; function() return math.random(-10000, 10000) end; function() return math.random() * math.random(-10000, 10000) end; gen_str; gen_str; gen_str; function() if nesting >= 24 then return nil end local t = {} local n = math.random(0, 24 - nesting) for i = 1, n do local k = gen_random_dataset(1, nesting + 1) if k == nil then k = "(nil)" end t[ k ] = gen_random_dataset( 1, nesting + 1 ) end return t end; } local t = {} for i = 1, num do local n = math.random(1, #generators) t[i] = generators[n]() end return unpack(t, 0, num) end local random_dataset_num, random_dataset_data = pack(gen_random_dataset()) local random_dataset_saved = check_ok( unpack(random_dataset_data, 0, random_dataset_num) ) local num_tries = 100 local errors = {} for i = 1, num_tries do local to = math.random(1, #random_dataset_saved - 1) local new_data = random_dataset_saved:sub(1, to) local res, err = luabins.load(new_data) ensure_equals("truncated data must not be loaded", res, nil) errors[err] = (errors[err] or 0) + 1 end print("truncation errors encountered:") for err, n in pairs(errors) do print(err, n) end print("===== BASIC LOAD TRUNCATION OK =====") print("===== BEGIN LOAD MUTATION TESTS =====") local function mutate_string(str, num, override) num = num or math.random(1, 8) if num < 1 then return str end local mutators = { -- truncate at end function(str) local pos = math.random(1, #str) return str:sub(1, pos) end; -- truncate at beginning function(str) local pos = math.random(1, #str) return str:sub(-pos) end; -- cut out the middle function(str) local from = math.random(1, #str) local to = math.random(from, #str) return str:sub(1, from) .. str:sub(to) end; -- swap two halves function(str) local pos = math.random(1, #str) return str:sub(pos + 1, #str) .. str:sub(1, pos) end; -- swap two characters function(str) local pa, pb = math.random(1, #str), math.random(1, #str) local a, b = str:sub(pa, pa), str:sub(pb, pb) return str:sub(1, pa - 1) .. a .. str:sub(pa + 1, pb - 1) .. b .. str:sub(pb + 1, #str) end; -- replace one character function(str) local pos = math.random(1, #str) return str:sub(1, pos - 1) .. string.char(math.random(0, 255)) .. str:sub(pos + 1, #str) end; -- increase one character function(str) local pos = math.random(1, #str) local b = str:byte(pos, pos) + 1 if b > 255 then b = 0 end return str:sub(1, pos - 1) .. string.char(b) .. str:sub(pos + 1, #str) end; -- decrease one character function(str) local pos = math.random(1, #str) local b = str:byte(pos, pos) - 1 if b < 0 then b = 255 end return str:sub(1, pos - 1) .. string.char(b) .. str:sub(pos + 1, #str) end; } local n = override or math.random(1, #mutators) str = mutators[n](str) return mutate_string(str, num - 1, override) end local num_tries = 100000 local num_successes = 0 local errors = {} for i = 1, num_tries do local new_data = mutate_string(random_dataset_saved) local res, err = luabins.load(new_data) if res == nil then errors[err] = (errors[err] or 0) + 1 else num_successes = num_successes + 1 end end if num_successes == 0 then print("no mutated strings loaded successfully") else -- This is ok, since we may corrupt data, not format. -- If it is an issue for user, he must append checksum to data, -- as usual. print("mutated strings loaded successfully: "..num_successes) end print("mutation errors encountered:") for err, n in pairs(errors) do print(err, n) end print("===== BASIC LOAD MUTATION OK =====") print("OK") subprojects/luabins/test/util.h0000664000175000017500000000043314741067256016167 0ustar aniolaniol/* * util.h * Luabins test utilities * See copyright notice in luabins.h */ #ifndef LUABINS_TEST_UTIL_H_INCLUDED_ #define LUABINS_TEST_UTIL_H_INCLUDED_ #include void fprintbuf(FILE * out, const unsigned char * b, size_t len); #endif /* LUABINS_TEST_UTIL_H_INCLUDED_ */ subprojects/luabins/meson.build0000664000175000017500000000220014741067256016216 0ustar aniolaniolproject('luabins', ['c']) luabins_src = files( 'src/fwrite.c', 'src/load.c', 'src/luabins.c', 'src/luainternals.c', 'src/savebuffer.c', 'src/save.c', 'src/write.c', ) deps = [] luajit = dependency('luajit', version: '>=2.0.0') if luajit.found() and luajit.type_name() != 'internal' luajit_test = meson.get_compiler('c').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 message('System luajit found but not compiled in 5.2 mode; using built-in luajit') else deps += luajit endif else message('System luajit not found; using built-in luajit') endif if not deps.contains(luajit) deps += subproject('luajit').get_variable('luajit_dep') endif luabins = static_library('luabins', luabins_src, dependencies: deps) luabins_dep = declare_dependency(link_with: luabins) subprojects/luabins/HISTORY0000664000175000017500000000177714741067256015162 0ustar aniolaniolv0.3 ==== Format unification for x86 and x86_64. Bug fixes. WARNING: Format is not compatible with 0.2 and below. Only data saved on x86_64 is affected, though. Data, saved on x86, should load fine. New features: -- Format change: unified save format for x86 vs. x86_64. -- API to save data to FILE * stream without Lua (see fwrite.h). Bug fixes: -- Load: fixed bug in readbyte, now it checks if we have data before read. -- Load: fixed Lua C stack overflow bug on large data. Misc: -- Better module information. Replaced luabins.VERSION with _VERSION, _DESCRIPTION and _COPYRIGHT. -- Added some CLI tools, useful for Luabins development (see etc/). -- Some code cleanup. v0.2 ==== Lua-less saving. -- New, 2x faster luabins.save() (see BENCHMARK). -- API to save data manually, without Lua (see write.h). -- Added Luarocks rockspecs (see rockspec/). -- Fixed Makefile for Ubuntu. v0.1.1 ====== Bugfix release. -- Fixed handling of array holes in Lua tables. v0.1 ==== Initial release. subprojects/luabins/rockspec/0000775000175000017500000000000014741067256015673 5ustar aniolaniolsubprojects/luabins/rockspec/luabins-0.2-1.rockspec0000664000175000017500000000145514741067256021523 0ustar aniolaniolpackage = "luabins" version = "0.2-1" source = { url = "http://cloud.github.com/downloads/agladysh/luabins/luabins-0.2.tar.gz" } description = { summary = "Trivial Lua Binary Serialization Library", detailed = [[ Luabins allows to save tuples of primitive Lua types into binary chunks and to load saved data back. ]], homepage = "http://github.com/agladysh/luabins", license = "MIT/X11" } dependencies = { "lua >= 5.1" } build = { type = "builtin", modules = { luabins = { sources = { "src/load.c", "src/luabins.c", "src/luainternals.c", "src/lualess.c", "src/save.c", "src/savebuffer.c", "src/write.c" }, incdirs = { "src/" } } } } subprojects/luabins/rockspec/luabins-0.1.1-1.rockspec0000664000175000017500000000074114741067256021656 0ustar aniolaniolpackage = "luabins" version = "0.1.1-1" source = { url = "http://cloud.github.com/downloads/agladysh/luabins/luabins-0.1.1.tar.gz" } description = { summary = "Trivial Lua Binary Serialization Library", detailed = [[ Luabins allows to save tuples of primitive Lua types into binary chunks and to load saved data back. ]], homepage = "http://github.com/agladysh/luabins", license = "MIT/X11" } dependencies = { "lua >= 5.1" } build = { type = "make" } subprojects/luabins/rockspec/luabins-0.1.1-2.rockspec0000664000175000017500000000133114741067256021653 0ustar aniolaniolpackage = "luabins" version = "0.1.1-2" source = { url = "http://cloud.github.com/downloads/agladysh/luabins/luabins-0.1.1.tar.gz" } description = { summary = "Trivial Lua Binary Serialization Library", detailed = [[ Luabins allows to save tuples of primitive Lua types into binary chunks and to load saved data back. ]], homepage = "http://github.com/agladysh/luabins", license = "MIT/X11" } dependencies = { "lua >= 5.1" } build = { type = "builtin", modules = { luabins = { sources = { "src/load.c", "src/luabins.c", "src/luainternals.c", "src/save.c" }, incdirs = { "src/" } } } } subprojects/luabins/rockspec/luabins-scm-1.rockspec0000664000175000017500000000126514741067256022005 0ustar aniolaniolpackage = "luabins" version = "scm-1" source = { url = "git://github.com/agladysh/luabins.git" } description = { summary = "Trivial Lua Binary Serialization Library", detailed = [[ Luabins allows to save tuples of primitive Lua types into binary chunks and to load saved data back. ]], homepage = "http://github.com/agladysh/luabins", license = "MIT/X11" } dependencies = { "lua >= 5.1" } build = { type = "builtin", modules = { luabins = { sources = { "src/load.c", "src/luabins.c", "src/luainternals.c", "src/save.c" }, incdirs = { "src/" } } } } subprojects/luabins/rockspec/luabins-scm-2.rockspec0000664000175000017500000000141514741067256022003 0ustar aniolaniolpackage = "luabins" version = "scm-2" source = { url = "git://github.com/agladysh/luabins.git" } description = { summary = "Trivial Lua Binary Serialization Library", detailed = [[ Luabins allows to save tuples of primitive Lua types into binary chunks and to load saved data back. ]], homepage = "http://github.com/agladysh/luabins", license = "MIT/X11" } dependencies = { "lua >= 5.1" } build = { type = "builtin", modules = { luabins = { sources = { "src/load.c", "src/luabins.c", "src/luainternals.c", "src/lualess.c", "src/save.c", "src/savebuffer.c", "src/write.c" }, incdirs = { "src/" } } } } subprojects/luabins/rockspec/luabins-0.3-1.rockspec0000664000175000017500000000145514741067256021524 0ustar aniolaniolpackage = "luabins" version = "0.3-1" source = { url = "http://cloud.github.com/downloads/agladysh/luabins/luabins-0.3.tar.gz" } description = { summary = "Trivial Lua Binary Serialization Library", detailed = [[ Luabins allows to save tuples of primitive Lua types into binary chunks and to load saved data back. ]], homepage = "http://github.com/agladysh/luabins", license = "MIT/X11" } dependencies = { "lua >= 5.1" } build = { type = "builtin", modules = { luabins = { sources = { "src/load.c", "src/luabins.c", "src/luainternals.c", "src/lualess.c", "src/save.c", "src/savebuffer.c", "src/write.c" }, incdirs = { "src/" } } } } subprojects/luabins/etc/0000775000175000017500000000000014741067256014635 5ustar aniolaniolsubprojects/luabins/etc/toluabins.lua0000664000175000017500000000044414741067256017342 0ustar aniolaniol-- Lua to Luabins converter package.cpath = "./lib/?.so;"..package.cpath local luabins = require 'luabins' local filename = select(1, ...) assert(filename, "Usage: lua toluabins.lua ") io.write( luabins.save( assert(loadfile(filename))() ) ) io:flush() subprojects/luabins/etc/benchmark.lua0000664000175000017500000000446714741067256017305 0ustar aniolaniol-- This benchmark is compatible with luamarca benchmarking system -- http://github.com/agladysh/luamarca package.cpath = "./?.so;"..package.cpath local luabins = require("luabins") local table_concat = table.concat local loadstring, assert = loadstring, assert local pairs, type, tostring = pairs, type, tostring local luabins_save, luabins_load = luabins.save, luabins.load local lua = ([[return { true, false, 42, "string", [{ true, false, 42, "string", [true] = true, [false] = false, [42] = 42, string = "string" }] = { true, false, 42, "string", [true] = true, [false] = false, [42] = 42, string = "string" } }]]):gsub("[%s\n]+", "") -- Remove spaces for compactness local data = assert(loadstring(lua))() local saved = assert(luabins_save(data)) -- Imagine we know exact data structure. -- We still impose some overhead on table.concat() related -- stuff, since it is more realistic scenario. -- Still looks a bit silly. local concat = function(data) local buf = {} local function cat(v) buf[#buf + 1] = tostring(v) return cat end -- Find table key local tablekey, tableval for k, v in pairs(data) do if type(k) == "table" then tablekey, tableval = k, v break end end cat 'return{' cat (data[1]) ',' cat (data[2]) ',' cat (data[3]) ',' cat '"' (data[4]) '",' cat '[{' cat (tablekey[1]) ',' cat (tablekey[2]) ',' cat (tablekey[3]) ',' cat '"' (tablekey[4]) '",' cat '[' (true) ']=' (tablekey[true]) ',' cat '[' (false) ']=' (tablekey[false]) ',' cat '[' (42) ']=' (tablekey[42]) ',' cat 'string' '=' '"' (tablekey["string"]) '"' cat '}]=' cat '{' cat (tablekey[1]) ',' cat (tablekey[2]) ',' cat (tablekey[3]) ',' cat '"' (tablekey[4]) '",' cat '[' (true) ']=' (tablekey[true]) ',' cat '[' (false) ']=' (tablekey[false]) ',' cat '[' (42) ']=' (tablekey[42]) ',' cat 'string' '=' '"' (tablekey["string"]) '"' cat '}' cat '}' return table_concat(buf, '') end -- Sanity check assert(concat(data) == lua) local bench = {} bench.concat = function() assert(concat(data)) end bench.loadstring = function() assert(loadstring(lua))() end bench.luabins_save = function() assert(luabins_save(data)) end bench.luabins_load = function() assert(luabins_load(saved)) end return bench subprojects/luabins/etc/tolua.lua0000664000175000017500000000131214741067256016461 0ustar aniolaniol-- Luabins to Lua converter -- Requires lua-nucleo (http://github.com/lua-nucleo/lua-nucleo/) package.cpath = "./lib/?.so;"..package.cpath local luabins = require 'luabins' dofile('lua-nucleo/strict.lua') dofile('lua-nucleo/import.lua') local tserialize = import 'lua-nucleo/tserialize.lua' { 'tserialize' } local filename = select(1, ...) assert(filename, "Usage: lua tolua.lua ") local file if filename == "-" then file = io.stdin else file = assert(io.open(filename, "r")) end io.write( tserialize( assert( luabins.load( file:read("*a") ) ) ) ) io:flush() if file ~= io.stdin then file:close() end file = nil subprojects/luabins/etc/dataset.lua0000664000175000017500000000345614741067256016775 0ustar aniolaniol-- Random Luabins dataset generator package.cpath = "./lib/?.so;"..package.cpath local luabins = require("luabins") local luabins_save, luabins_load = luabins.save, luabins.load math.randomseed(123456) -- TODO: Generalize. Copy-paste from test.lua local function gen_random_dataset(num, nesting) num = num or math.random(0, 128) nesting = nesting or 1 local gen_str = function() local t = {} local n = math.random(0, 1024) for i = 1, n do t[i] = string.char(math.random(0, 255)) end return table.concat(t) end local gen_bool = function() return math.random() >= 0.5 end local gen_nil = function() return nil end local generators = { gen_nil; gen_nil; gen_nil; gen_bool; gen_bool; gen_bool; function() return math.random() end; function() return math.random(-10000, 10000) end; function() return math.random() * math.random(-10000, 10000) end; gen_str; gen_str; gen_str; function() if nesting >= 24 then return nil end local t = {} local n = math.random(0, 24 - nesting) for i = 1, n do local k = gen_random_dataset(1, nesting + 1) if k == nil then k = "(nil)" end t[ k ] = gen_random_dataset( 1, nesting + 1 ) end return t end; } local t = {} for i = 1, num do local n = math.random(1, #generators) t[i] = generators[n]() end return unpack(t, 0, num) end local saved = assert(luabins_save(gen_random_dataset())) local filename = select(1, ...) assert(filename, "Usage: lua dataset.lua ") local file if filename == "-" then file = io.stdout else file = assert(io.open(filename, "w")) end file:write(saved) if file ~= io.stdout then file:close() end file = nil subprojects/luabins/etc/checkfmt.lua0000664000175000017500000000076314741067256017132 0ustar aniolaniol--- Luabins format checker package.cpath = "./lib/?.so;"..package.cpath local luabins = require("luabins") local luabins_save, luabins_load = luabins.save, luabins.load local filename = select(1, ...) assert(filename, "Usage: lua checkfmt.lua ") local file if filename == "-" then file = io.stdin else file = assert(io.open(filename, "r")) end assert( luabins_load( file:read("*a") ) ) if file ~= io.stdin then file:close() end file = nil print("OK") subprojects/luabins/COPYRIGHT0000664000175000017500000000270414741067256015360 0ustar aniolaniolLuabins License --------------- Luabins is licensed under the terms of the MIT license reproduced below. This means that luabins is free software and can be used for both academic and commercial purposes at absolutely no cost. =============================================================================== Copyright (C) 2009-2010 Luabins authors 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. =============================================================================== (end of COPYRIGHT) subprojects/luabins/TODO0000664000175000017500000000115014741067256014547 0ustar aniolaniol-- Add key-value size-less table format (see luatexts) -- Add utf-8 char-length string format (see luatexts) -- Add autotest targets for LuaJIT and LuaJIT 2 x86, x86_64, both for Lua and C. -- Test on Lua with custom allocator. -- Use Makefile in rockspec? -- Enhance "corrupt data" message on load. Need more info on what is wrong. Ensure every case is covered with tests. -- Autocompact integers (especially strings -- most of them do not need size_t!) -- Better cover new exponential growth strategy corner-cases with tests. -- Shouldn't write and fwrite have common codebase? -- Document write.h and fwrite.h subprojects/luabins/AUTHORS0000664000175000017500000000011214741067256015124 0ustar aniolaniolLuabins authors: ---------------- Alexander Gladysh subprojects/luabins/src/0000775000175000017500000000000014741067256014651 5ustar aniolaniolsubprojects/luabins/src/load.c0000664000175000017500000001633614741067256015745 0ustar aniolaniol/* * load.c * Luabins load code * See copyright notice in luabins.h */ #include #include "luaheaders.h" #include "luabins.h" #include "saveload.h" #include "luainternals.h" #if 0 #define XSPAM(a) printf a #else #define XSPAM(a) (void)0 #endif #if 0 #define SPAM(a) printf a #else #define SPAM(a) (void)0 #endif typedef struct lbs_LoadState { const unsigned char * pos; size_t unread; } lbs_LoadState; static void lbsLS_init( lbs_LoadState * ls, const unsigned char * data, size_t len ) { ls->pos = (len > 0) ? data : NULL; ls->unread = len; } #define lbsLS_good(ls) \ ((ls)->pos != NULL) #define lbsLS_unread(ls) \ ((ls)->unread) static unsigned char lbsLS_readbyte(lbs_LoadState * ls) { if (lbsLS_good(ls)) { if (lbsLS_unread(ls) > 0) { const unsigned char b = *ls->pos; ++ls->pos; --ls->unread; return b; } else { ls->unread = 0; ls->pos = NULL; } } return 0; } static const unsigned char * lbsLS_eat(lbs_LoadState * ls, size_t len) { const unsigned char * result = NULL; if (lbsLS_good(ls)) { if (lbsLS_unread(ls) >= len) { XSPAM(("* eat: len %u\n", (int)len)); result = ls->pos; ls->pos += len; ls->unread -= len; XSPAM(("* eat: done len %u\n", (int)len)); } else { ls->unread = 0; ls->pos = NULL; } } return result; } static int lbsLS_readbytes( lbs_LoadState * ls, unsigned char * buf, size_t len ) { const unsigned char * pos = lbsLS_eat(ls, len); if (pos != NULL) { memcpy(buf, pos, len); return LUABINS_ESUCCESS; } SPAM(("load: Failed to read %lu bytes\n", (unsigned long)len)); return LUABINS_EBADDATA; } static int load_value(lua_State * L, lbs_LoadState * ls); static int load_table(lua_State * L, lbs_LoadState * ls) { int array_size = 0; int hash_size = 0; unsigned int total_size = 0; int result = lbsLS_readbytes(ls, (unsigned char *)&array_size, LUABINS_LINT); if (result == LUABINS_ESUCCESS) { result = lbsLS_readbytes(ls, (unsigned char *)&hash_size, LUABINS_LINT); } if (result == LUABINS_ESUCCESS) { total_size = array_size + hash_size; /* SPAM(( "LT SIZE CHECK\n" "* array_size %d limit 0 .. %d\n" "* hash_size %d limit >0\n" "* hash_size bytes %d, limit %d\n" "* unread %u limit >min_size %u (total_size %u)\n", array_size, MAXASIZE, hash_size, ceillog2((unsigned int)hash_size), MAXBITS, (unsigned int)lbsLS_unread(ls), (unsigned int)luabins_min_table_data_size(total_size), (unsigned int)total_size )); */ if ( array_size < 0 || array_size > MAXASIZE || hash_size < 0 || (hash_size > 0 && ceillog2((unsigned int)hash_size) > MAXBITS) || lbsLS_unread(ls) < luabins_min_table_data_size(total_size) ) { result = LUABINS_EBADSIZE; } } if (result == LUABINS_ESUCCESS) { unsigned int i = 0; XSPAM(( "* load: creating table a:%d + h:%d = %d\n", array_size, hash_size, total_size )); lua_createtable(L, array_size, hash_size); for (i = 0; i < total_size; ++i) { int key_type = LUA_TNONE; result = load_value(L, ls); /* Load key. */ if (result != LUABINS_ESUCCESS) { break; } /* Table key can't be nil or NaN */ key_type = lua_type(L, -1); if (key_type == LUA_TNIL) { /* Corrupt data? */ SPAM(("load: nil as key detected\n")); result = LUABINS_EBADDATA; break; } if (key_type == LUA_TNUMBER) { lua_Number key = lua_tonumber(L, -1); if (luai_numisnan(key)) { /* Corrupt data? */ SPAM(("load: NaN as key detected\n")); result = LUABINS_EBADDATA; break; } } result = load_value(L, ls); /* Load value. */ if (result != LUABINS_ESUCCESS) { break; } lua_rawset(L, -3); } } return result; } static int load_value(lua_State * L, lbs_LoadState * ls) { int result = LUABINS_ESUCCESS; unsigned char type = lbsLS_readbyte(ls); if (!lbsLS_good(ls)) { SPAM(("load: Failed to read value type byte\n")); return LUABINS_EBADDATA; } XSPAM(("* load: begin load_value\n")); luaL_checkstack(L, 1, "load_value"); switch (type) { case LUABINS_CNIL: XSPAM(("* load: nil\n")); lua_pushnil(L); break; case LUABINS_CFALSE: XSPAM(("* load: false\n")); lua_pushboolean(L, 0); break; case LUABINS_CTRUE: XSPAM(("* load: true\n")); lua_pushboolean(L, 1); break; case LUABINS_CNUMBER: { lua_Number value; XSPAM(("* load: number\n")); result = lbsLS_readbytes(ls, (unsigned char *)&value, LUABINS_LNUMBER); if (result == LUABINS_ESUCCESS) { lua_pushnumber(L, value); } } break; case LUABINS_CSTRING: { size_t len = 0; XSPAM(("* load: string\n")); result = lbsLS_readbytes(ls, (unsigned char *)&len, LUABINS_LSIZET); if (result == LUABINS_ESUCCESS) { const unsigned char * pos = lbsLS_eat(ls, len); XSPAM(("* load: string size %u\n", (int)len)); if (pos != NULL) { lua_pushlstring(L, (const char *)pos, len); } else { result = LUABINS_EBADSIZE; } } } break; case LUABINS_CTABLE: XSPAM(("* load: table\n")); result = load_table(L, ls); break; default: SPAM(("load: Unknown type char 0x%02X found\n", type)); result = LUABINS_EBADDATA; break; } XSPAM(("* load: end load_value\n")); return result; } int luabins_load( lua_State * L, const unsigned char * data, size_t len, int * count ) { lbs_LoadState ls; int result = LUABINS_ESUCCESS; unsigned char num_items = 0; int base = 0; int i = 0; base = lua_gettop(L); lbsLS_init(&ls, data, len); num_items = lbsLS_readbyte(&ls); if (!lbsLS_good(&ls)) { SPAM(("load: failed to read num_items byte\n")); result = LUABINS_EBADDATA; } else if (num_items > LUABINS_MAXTUPLE) { SPAM(("load: tuple too large: %d\n", (int)num_items)); result = LUABINS_EBADSIZE; } else { XSPAM(("* load: tuple size %d\n", (int)num_items)); for ( i = 0; i < num_items && result == LUABINS_ESUCCESS; ++i ) { XSPAM(("* load: loading tuple item %d\n", i)); result = load_value(L, &ls); } } if (result == LUABINS_ESUCCESS && lbsLS_unread(&ls) > 0) { SPAM(("load: %lu chars left at tail\n", lbsLS_unread(&ls))); result = LUABINS_ETAILEFT; } if (result == LUABINS_ESUCCESS) { *count = num_items; } else { lua_settop(L, base); /* Discard intermediate results */ switch (result) { case LUABINS_EBADDATA: lua_pushliteral(L, "can't load: corrupt data"); break; case LUABINS_EBADSIZE: lua_pushliteral(L, "can't load: corrupt data, bad size"); break; case LUABINS_ETAILEFT: lua_pushliteral(L, "can't load: extra data at end"); break; default: /* Should not happen */ lua_pushliteral(L, "load failed"); break; } } return result; } subprojects/luabins/src/luaheaders.h0000664000175000017500000000047414741067256017144 0ustar aniolaniol#ifndef LUABINS_LUAHEADERS_H_INCLUDED_ #define LUABINS_LUAHEADERS_H_INCLUDED_ #if defined (__cplusplus) && !defined (LUABINS_LUABUILTASCPP) extern "C" { #endif #include #include #if defined (__cplusplus) && !defined (LUABINS_LUABUILTASCPP) } #endif #endif /* LUABINS_LUAHEADERS_H_INCLUDED_ */ subprojects/luabins/src/saveload.h0000664000175000017500000000657714741067256016637 0ustar aniolaniol/* * saveload.h * Luabins internal constants and helper macros * See copyright notice in luabins.h */ #ifndef LUABINS_SAVELOAD_H_INCLUDED_ #define LUABINS_SAVELOAD_H_INCLUDED_ /* Find minimum of two values */ #define luabins_min(a, b) \ ( ((a) < (b)) ? (a) : (b) ) /* Find maximum of two values */ #define luabins_max(a, b) \ ( ((a) > (b)) ? (a) : (b) ) /* Find minimum of three values */ #define luabins_min3(a, b, c) \ ( ((a) < (b)) ? luabins_min((a), (c)) : luabins_min((b), (c)) ) /* Preprocessor concatenation */ #define LUABINS_CAT(a, b) a##b /* Static assert helper macro */ #define luabins_static_assert_line(pred, line) \ typedef char LUABINS_CAT( \ static_assertion_failed_at_line_, \ line \ )[2 * !!(pred) - 1] /* Static (compile-time) assert */ #define luabins_static_assert(pred) \ luabins_static_assert_line(pred, __LINE__) /* Internal error codes */ #define LUABINS_ESUCCESS (0) #define LUABINS_EFAILURE (1) #define LUABINS_EBADTYPE (2) #define LUABINS_ETOODEEP (3) #define LUABINS_ENOSTACK (4) #define LUABINS_EBADDATA (5) #define LUABINS_ETAILEFT (6) #define LUABINS_EBADSIZE (7) #define LUABINS_ETOOLONG (8) /* Type bytes */ #define LUABINS_CNIL '-' /* 0x2D (45) */ #define LUABINS_CFALSE '0' /* 0x30 (48) */ #define LUABINS_CTRUE '1' /* 0x31 (49) */ #define LUABINS_CNUMBER 'N' /* 0x4E (78) */ #define LUABINS_CSTRING 'S' /* 0x53 (83) */ #define LUABINS_CTABLE 'T' /* 0x54 (84) */ /* * PORTABILITY WARNING! * You have to ensure manually that length constants below are the same * for both code that does the save and code that does the load. * Also these constants must be actual or code below would break. * Beware of endianness and lua_Number actual type as well. * Note also that luabins does not check for overflow on save, * if your integer does not fit, it would be truncated. */ #define LUABINS_LINT (4) #define LUABINS_LSIZET (4) #define LUABINS_LNUMBER (8) /* * Derived lengths * * WARNING: Change these if format is changed! */ /* One type byte */ #define LUABINS_LTYPEBYTE (1) /* Minimal table: type, array size, hash size, no data */ #define LUABINS_LMINTABLE (LUABINS_LTYPEBYTE + LUABINS_LINT + LUABINS_LINT) /* Minimal number: type, number value */ #define LUABINS_LMINNUMBER (LUABINS_LTYPEBYTE + LUABINS_LNUMBER) /* Minimal string: type, length, no data */ #define LUABINS_LMINSTRING (LUABINS_LTYPEBYTE + LUABINS_LSIZET) /* Minimum large (non-boolean non-nil) value length */ #define LUABINS_LMINLARGEVALUE \ ( luabins_min3(LUABINS_LMINTABLE, LUABINS_LMINSTRING, LUABINS_LMINSTRING) ) /* * Lower limit on total table data size is determined as follows: * -- All entries are always key and value. * -- Minimum value size is one byte for nil and boolean, * but that is two keys maximum (nil can'be the key). * -- All the rest of key types are mimimum of LUABINS_MINLARGEVALUELEN * bytes (type byte plus data bytes). * -- All values in the table may be booleans. * * WARNING: Change this if format is changed! * * Note this formula does NOT take in account * table header (type byte and array/hash sizes). */ #define luabins_min_table_data_size(total_size) \ ( \ (total_size > 2) \ ? ( \ 2 * (LUABINS_LTYPEBYTE + LUABINS_LTYPEBYTE) \ + (total_size - 2) * (LUABINS_LMINLARGEVALUE + LUABINS_LTYPEBYTE) \ ) \ : (total_size * (LUABINS_LTYPEBYTE + LUABINS_LTYPEBYTE)) \ ) #endif /* LUABINS_SAVELOAD_H_INCLUDED_ */ subprojects/luabins/src/savebuffer.h0000664000175000017500000000367714741067256017167 0ustar aniolaniol/* * savebuffer.h * Luabins save buffer * See copyright notice in luabins.h */ #ifndef LUABINS_SAVEBUFFER_H_INCLUDED_ #define LUABINS_SAVEBUFFER_H_INCLUDED_ typedef struct luabins_SaveBuffer { lua_Alloc alloc_fn; void * alloc_ud; unsigned char * buffer; size_t buf_size; size_t end; } luabins_SaveBuffer; void lbsSB_init( luabins_SaveBuffer * sb, lua_Alloc alloc_fn, void * alloc_ud ); /* * Ensures that there is at least delta size available in buffer. * New size is aligned by blockSize increments. * Returns non-zero if resize failed. * If you pre-sized the buffer, subsequent writes up to the new size * are guaranteed to not fail. */ int lbsSB_grow(luabins_SaveBuffer * sb, size_t delta); /* * Returns non-zero if write failed. * Allocates buffer as needed. */ int lbsSB_write( luabins_SaveBuffer * sb, const unsigned char * bytes, size_t length ); /* * Returns non-zero if write failed. * Allocates buffer as needed. * Convenience function. */ int lbsSB_writechar( luabins_SaveBuffer * sb, unsigned char byte ); #define lbsSB_length(sb) ( (sb)->end ) /* * If offset is greater than total length, data is appended to the end. * Returns non-zero if write failed. * Allocates buffer as needed. */ int lbsSB_overwrite( luabins_SaveBuffer * sb, size_t offset, const unsigned char * bytes, size_t length ); /* * If offset is greater than total length, data is appended to the end. * Returns non-zero if write failed. * Allocates buffer as needed. * Convenience function. */ int lbsSB_overwritechar( luabins_SaveBuffer * sb, size_t offset, unsigned char byte ); /* * Returns a pointer to the internal buffer with data. * Note that buffer is NOT zero-terminated. * Buffer is valid until next operation with the given sb. */ const unsigned char * lbsSB_buffer(luabins_SaveBuffer * sb, size_t * length); void lbsSB_destroy(luabins_SaveBuffer * sb); #endif /* LUABINS_SAVEBUFFER_H_INCLUDED_ */ subprojects/luabins/src/fwrite.h0000664000175000017500000000134514741067256016325 0ustar aniolaniol/* * fwrite.h * Luabins Lua-less write API using FILE * as buffer * See copyright notice in luabins.h */ #ifndef LUABINS_FWRITE_H_INCLUDED_ #define LUABINS_FWRITE_H_INCLUDED_ #include "saveload.h" #define lbs_fwriteTupleSize(f, tuple_size) \ fputc((int)(tuple_size), (f)) void lbs_fwriteTableHeader( FILE * f, int array_size, int hash_size ); #define lbs_fwriteNil(f) \ fputc(LUABINS_CNIL, (f)) #define lbs_fwriteBoolean(f, value) \ fputc(((value) == 0) ? LUABINS_CFALSE : LUABINS_CTRUE, (f)) void lbs_fwriteNumber(FILE * f, lua_Number value); #define lbs_fwriteInteger lbs_fwriteNumber void lbs_fwriteString( FILE * f, const char * value, size_t length ); #endif /* LUABINS_FWRITE_H_INCLUDED_ */ subprojects/luabins/src/write.h0000664000175000017500000000203314741067256016152 0ustar aniolaniol/* * write.h * Luabins Lua-less write API * See copyright notice in luabins.h */ #ifndef LUABINS_WRITE_H_INCLUDED_ #define LUABINS_WRITE_H_INCLUDED_ #include "saveload.h" #include "savebuffer.h" #define LUABINS_APPEND ((size_t)-1) #define lbs_writeTupleSize(sb, tuple_size) \ lbsSB_writechar((sb), (tuple_size)) int lbs_writeTableHeaderAt( luabins_SaveBuffer * sb, size_t offset, /* Pass LUABINS_APPEND to append to the end of buffer */ int array_size, int hash_size ); #define lbs_writeTableHeader(sb, array_size, hash_size) \ lbs_writeTableHeaderAt((sb), LUABINS_APPEND, (array_size), (hash_size)) #define lbs_writeNil(sb) \ lbsSB_writechar((sb), LUABINS_CNIL) #define lbs_writeBoolean(sb, value) \ lbsSB_writechar((sb), ((value) == 0) ? LUABINS_CFALSE : LUABINS_CTRUE) int lbs_writeNumber(luabins_SaveBuffer * sb, lua_Number value); #define lbs_writeInteger lbs_writeNumber int lbs_writeString( luabins_SaveBuffer * sb, const char * value, size_t length ); #endif /* LUABINS_WRITE_H_INCLUDED_ */ subprojects/luabins/src/luainternals.h0000664000175000017500000000166114741067256017527 0ustar aniolaniol/* * luainternals.h * Code quoted from MIT-licensed Lua 5.1.4 internals * See copyright notice in lua.h */ #ifndef LUABINS_LUAINTERNALS_H_INCLUDED_ #define LUABINS_LUAINTERNALS_H_INCLUDED_ /* * BEGIN COPY-PASTE FROM Lua 5.1.4 luaconf.h * WARNING: If your Lua config differs, fix this! */ #define luai_numeq(a,b) ((a)==(b)) #define luai_numisnan(a) (!luai_numeq((a), (a))) /* * END COPY-PASTE FROM Lua 5.1.4 luaconf.h */ /* * BEGIN COPY-PASTE FROM Lua 5.1.4 lobject.h */ int luaO_log2 (unsigned int x); #define ceillog2(x) (luaO_log2((x)-1) + 1) /* * END COPY-PASTE FROM Lua 5.1.4 lobject.h */ /* * BEGIN COPY-PASTE FROM Lua 5.1.4 ltable.c */ /* ** max size of array part is 2^MAXBITS */ #define LUAI_BITSINT 32 #if LUAI_BITSINT > 26 #define MAXBITS 26 #else #define MAXBITS (LUAI_BITSINT-2) #endif #define MAXASIZE (1 << MAXBITS) /* * END COPY-PASTE FROM Lua 5.1.4 ltable.c */ #endif /* LUABINS_LUAINTERNALS_H_INCLUDED_ */ subprojects/luabins/src/luainternals.c0000664000175000017500000000242114741067256017515 0ustar aniolaniol/* * luainternals.c * Code quoted from MIT-licensed Lua 5.1.4 internals * See copyright notice in lua.h */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include #include #ifdef __cplusplus } #endif /* __cplusplus */ #include "luainternals.h" /* * BEGIN COPY-PASTE FROM Lua 5.1.4 llimits.h */ /* chars used as small naturals (so that `char' is reserved for characters) */ typedef unsigned char lu_byte; /* * END COPY-PASTE FROM Lua 5.1.4 llimits.h */ /* * BEGIN COPY-PASTE FROM Lua 5.1.4 lobject.c */ 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]; } /* * END COPY-PASTE FROM Lua 5.1.4 lobject.c */ subprojects/luabins/src/lualess.h0000664000175000017500000000147714741067256016503 0ustar aniolaniol/* * lualess.h * Lua-related definitions for lua-less builds (based on Lua manual) * See copyright notice in luabins.h */ #ifndef LUABINS_LUALESS_H_INCLUDED_ #define LUABINS_LUALESS_H_INCLUDED_ #include /* ptrdiff_t */ /* WARNING: Change these if your luaconf.h has different settings */ typedef double lua_Number; typedef ptrdiff_t lua_Integer; typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize) ; /* * lua_Alloc-compatible allocator to use in Lua-less applications * with lbs_SaveBuffer. Based on sample code from Lua 5.1 manual. */ void * lbs_simplealloc( void * ud, void * ptr, size_t osize, size_t nsize ); #endif /* LUABINS_LUALESS_H_INCLUDED_ */ subprojects/luabins/src/luabins.h0000664000175000017500000000511214741067256016456 0ustar aniolaniol/* * luabins.h * luabins -- Lua Binary Serialization Module * See copyright notice at the end of this file. */ #ifndef LUABINS_H_INCLUDED_ #define LUABINS_H_INCLUDED_ #define LUABINS_VERSION "Luabins 0.3" #define LUABINS_COPYRIGHT "Copyright (C) 2009-2010, Luabins authors" #define LUABINS_DESCRIPTION "Trivial Lua Binary Serialization Library" /* Define LUABINS_LUABUILTASCPP if your Lua is built as C++ */ /* Can't be more than 255 */ #define LUABINS_MAXTUPLE (250) #define LUABINS_MAXTABLENESTING (250) /* * Save Lua values from given state at given stack index range. * Lua value is left untouched. Note that empty range is not an error. * You may save from 0 to LUABINS_MAXTUPLE values. * Returns 0 on success, pushes saved data as a string on the top of stack. * Returns non-zero on failure, pushes error message on the top * of the stack. */ int luabins_save(lua_State * L, int index_from, int index_to); /* * Load Lua values from given byte chunk. * Returns 0 on success, pushes loaded values on stack. * Sets count to the number of values pushed. * Note that to have zero loaded items is a valid scenario. * Returns non-zero on failure, pushes error message on the top * of the stack. */ int luabins_load( lua_State * L, const unsigned char * data, size_t len, int * count ); /****************************************************************************** * Copyright (C) 2009-2010 Luabins authors. 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 /* LUABINS_H_INCLUDED_ */ subprojects/luabins/src/savebuffer.c0000664000175000017500000001121314741067256017143 0ustar aniolaniol/* * savebuffer.c * Luabins save buffer * See copyright notice in luabins.h */ #include /* memcpy() */ #include "luaheaders.h" #include "saveload.h" #include "savebuffer.h" #if 0 #define SPAM(a) printf a #else #define SPAM(a) (void)0 #endif /* Minimum allocation size */ #define LUABINS_SAVEMINALLOC (256) /* TODO: Test this with custom allocator! */ void lbsSB_init( luabins_SaveBuffer * sb, lua_Alloc alloc_fn, void * alloc_ud ) { sb->alloc_fn = alloc_fn; sb->alloc_ud = alloc_ud; sb->buffer = NULL; sb->buf_size = 0UL; sb->end = 0UL; } /* * Ensures that there is at least delta size available in buffer. * New size is aligned by blockSize increments * Returns non-zero if resize failed. * If you pre-sized the buffer, subsequent writes up to the new size * are guaranteed to not fail. */ int lbsSB_grow(luabins_SaveBuffer * sb, size_t delta) { size_t needed_size = sb->end + delta; if (needed_size > sb->buf_size) { /* * Growth factor x1.5 * Discussion on possible values: * http://stackoverflow.com/questions/2269063/buffer-growth-strategy */ /* TODO: Handle size_t overflow? */ size_t new_size = 0; size_t add_size = sb->buf_size / 2; if (add_size < LUABINS_SAVEMINALLOC) { add_size = LUABINS_SAVEMINALLOC; } new_size = sb->buf_size + add_size; /* SPAM(( "trying %lu + %lu = %lu (needed %lu)\n", sb->buf_size, add_size, new_size, needed_size )); */ while (new_size < needed_size) { SPAM(("...+%lu not enough, growing more\n", add_size)); /* Grow exponentially as needed */ add_size += new_size / 2; new_size += add_size; } SPAM(( "growing from %lu to %lu (needed %lu)\n", sb->buf_size, new_size, needed_size )); sb->buffer = (unsigned char *)sb->alloc_fn( sb->alloc_ud, sb->buffer, sb->buf_size, new_size ); if (sb->buffer == NULL) { /* TODO: We probably should free the buffer here */ sb->buf_size = 0UL; sb->end = 0; return LUABINS_ETOOLONG; } sb->buf_size = new_size; } return LUABINS_ESUCCESS; } /* * Returns non-zero if write failed. * Allocates buffer as needed. */ int lbsSB_write( luabins_SaveBuffer * sb, const unsigned char * bytes, size_t length ) { int result = lbsSB_grow(sb, length); if (result != LUABINS_ESUCCESS) { return result; } memcpy(&sb->buffer[sb->end], bytes, length); sb->end += length; return LUABINS_ESUCCESS; } /* * Returns non-zero if write failed. * Allocates buffer as needed. * Convenience function. */ int lbsSB_writechar( luabins_SaveBuffer * sb, const unsigned char byte ) { /* TODO: Shouldn't this be a macro? */ int result = lbsSB_grow(sb, 1); if (result != LUABINS_ESUCCESS) { return result; } sb->buffer[sb->end] = byte; sb->end++; return LUABINS_ESUCCESS; } /* * If offset is greater than total length, data is appended to the end. * Returns non-zero if write failed. * Allocates buffer as needed. */ int lbsSB_overwrite( luabins_SaveBuffer * sb, size_t offset, const unsigned char * bytes, size_t length ) { if (offset > sb->end) { offset = sb->end; } if (offset + length > sb->end) { int result = lbsSB_grow(sb, length); if (result != LUABINS_ESUCCESS) { return result; } sb->end = offset + length; } memcpy(&sb->buffer[offset], bytes, length); return LUABINS_ESUCCESS; } /* * If offset is greater than total length, data is appended to the end. * Returns non-zero if write failed. * Allocates buffer as needed. * Convenience function. */ int lbsSB_overwritechar( luabins_SaveBuffer * sb, size_t offset, unsigned char byte ) { if (offset > sb->end) { offset = sb->end; } if (offset + 1 > sb->end) { int result = lbsSB_grow(sb, 1); if (result != LUABINS_ESUCCESS) { return result; } sb->end = offset + 1; } sb->buffer[offset] = byte; return LUABINS_ESUCCESS; } /* * Returns a pointer to the internal buffer with data. * Note that buffer is NOT zero-terminated. * Buffer is valid until next operation with the given sb. */ const unsigned char * lbsSB_buffer(luabins_SaveBuffer * sb, size_t * length) { if (length != NULL) { *length = sb->end; } return sb->buffer; } void lbsSB_destroy(luabins_SaveBuffer * sb) { if (sb->buffer != NULL) { /* Ignoring errors */ SPAM(("dealloc size %lu\n", sb->buf_size)); sb->alloc_fn(sb->alloc_ud, sb->buffer, sb->buf_size, 0UL); sb->buffer = NULL; sb->buf_size = 0UL; sb->end = 0UL; } } subprojects/luabins/src/fwrite.c0000664000175000017500000000162014741067256016314 0ustar aniolaniol/* * fwrite.c * Luabins Lua-less write API using FILE * as buffer * See copyright notice in luabins.h */ #include "luaheaders.h" #include "fwrite.h" /* TODO: Note that stream errors are ignored. Handle them better? */ void lbs_fwriteTableHeader( FILE * f, int array_size, int hash_size ) { fputc(LUABINS_CTABLE, f); fwrite( (const unsigned char *)&array_size, LUABINS_LINT, 1, f ); fwrite( (const unsigned char *)&hash_size, LUABINS_LINT, 1, f ); } void lbs_fwriteNumber(FILE * f, lua_Number value) { fputc(LUABINS_CNUMBER, f); fwrite((const unsigned char *)&value, LUABINS_LNUMBER, 1, f); } void lbs_fwriteString( FILE * f, const char * value, size_t length ) { fputc(LUABINS_CSTRING, f); fwrite((const unsigned char *)&length, LUABINS_LSIZET, 1, f); fwrite((const unsigned char *)value, length, 1, f); } subprojects/luabins/src/luabins.c0000664000175000017500000000401014741067256016445 0ustar aniolaniol/* * luabins.c * Luabins Lua module code * See copyright notice in luabins.h */ #include "luaheaders.h" #include "luabins.h" #include "saveload.h" /* * On success returns data string. * On failure returns nil and error message. */ static int l_save(lua_State * L) { int error = luabins_save(L, 1, lua_gettop(L)); if (error == 0) { return 1; } lua_pushnil(L); lua_replace(L, -3); /* Put nil before error message on stack */ return 2; } /* * On success returns true and loaded data tuple. * On failure returns nil and error message. */ static int l_load(lua_State * L) { int count = 0; int error = 0; size_t len = 0; const unsigned char * data = (const unsigned char *)luaL_checklstring( L, 1, &len ); lua_pushboolean(L, 1); error = luabins_load(L, data, len, &count); if (error == 0) { return count + 1; } lua_pushnil(L); lua_replace(L, -3); /* Put nil before error message on stack */ return 2; } /* luabins Lua module API */ static const struct luaL_Reg R[] = { { "save", l_save }, { "load", l_load }, { NULL, NULL } }; #ifdef __cplusplus extern "C" { #endif LUALIB_API int luaopen_luabins(lua_State * L) { /* * Compile-time checks for size constants. * Consult PORTABILITY WARNING in saveload.h before changing constants. */ /* int is too small on your platform, fix LUABINS_LINT */ luabins_static_assert(sizeof(int) >= LUABINS_LINT); /* size_t is too small on your platform, fix LUABINS_LSIZET */ luabins_static_assert(sizeof(size_t) >= LUABINS_LSIZET); /* unexpected lua_Number size, fix LUABINS_LNUMBER */ luabins_static_assert(sizeof(lua_Number) == LUABINS_LNUMBER); /* * Register module */ luaL_register(L, "luabins", R); /* * Register module information */ lua_pushliteral(L, LUABINS_VERSION); lua_setfield(L, -2, "_VERSION"); lua_pushliteral(L, LUABINS_COPYRIGHT); lua_setfield(L, -2, "_COPYRIGHT"); lua_pushliteral(L, LUABINS_DESCRIPTION); lua_setfield(L, -2, "_DESCRIPTION"); return 1; } #ifdef __cplusplus } #endif subprojects/luabins/src/save.c0000664000175000017500000001154614741067256015762 0ustar aniolaniol/* * save.c * Luabins save code * See copyright notice in luabins.h */ #include "luaheaders.h" #include "luabins.h" #include "saveload.h" #include "savebuffer.h" #include "write.h" /* TODO: Test this with custom allocator! */ #if 0 #define SPAM(a) printf a #else #define SPAM(a) (void)0 #endif static int save_value( lua_State * L, luabins_SaveBuffer * sb, int index, int nesting ); /* Returns 0 on success, non-zero on failure */ static int save_table( lua_State * L, luabins_SaveBuffer * sb, int index, int nesting ) { int result = LUABINS_ESUCCESS; int header_pos = 0; int total_size = 0; if (nesting > LUABINS_MAXTABLENESTING) { return LUABINS_ETOODEEP; } /* TODO: Hauling stack for key and value removal may get too heavy for larger tables. Think out a better way. */ header_pos = lbsSB_length(sb); result = lbs_writeTableHeader(sb, 0, 0); result = lbsSB_grow(sb, LUABINS_LINT + LUABINS_LINT); if (result == LUABINS_ESUCCESS) { lua_checkstack(L, 2); /* Key and value */ lua_pushnil(L); /* key for lua_next() */ } while (result == LUABINS_ESUCCESS && lua_next(L, index) != 0) { int value_pos = lua_gettop(L); /* We need absolute values */ int key_pos = value_pos - 1; /* Save key. */ result = save_value(L, sb, key_pos, nesting); /* Save value. */ if (result == LUABINS_ESUCCESS) { result = save_value(L, sb, value_pos, nesting); } if (result == LUABINS_ESUCCESS) { /* Remove value from stack, leave key for the next iteration. */ lua_pop(L, 1); ++total_size; } } if (result == LUABINS_ESUCCESS) { /* Note that if array has holes, lua_objlen() may report larger than actual array size. So we need to adjust. TODO: Note inelegant downsize from size_t to int. Handle integer overflow here. */ int array_size = luabins_min(total_size, (int)lua_objlen(L, index)); int hash_size = luabins_max(0, total_size - array_size); result = lbs_writeTableHeaderAt(sb, header_pos, array_size, hash_size); } return result; } /* Returns 0 on success, non-zero on failure */ static int save_value( lua_State * L, luabins_SaveBuffer * sb, int index, int nesting ) { int result = LUABINS_ESUCCESS; switch (lua_type(L, index)) { case LUA_TNIL: result = lbs_writeNil(sb); break; case LUA_TBOOLEAN: result = lbs_writeBoolean(sb, lua_toboolean(L, index)); break; case LUA_TNUMBER: result = lbs_writeNumber(sb, lua_tonumber(L, index)); break; case LUA_TSTRING: { size_t len = 0; const char * buf = lua_tolstring(L, index, &len); result = lbs_writeString(sb, buf, len); } break; case LUA_TTABLE: result = save_table(L, sb, index, nesting + 1); break; case LUA_TNONE: case LUA_TFUNCTION: case LUA_TTHREAD: case LUA_TUSERDATA: default: result = LUABINS_EBADTYPE; } return result; } int luabins_save(lua_State * L, int index_from, int index_to) { unsigned char num_to_save = 0; int index = index_from; int base = lua_gettop(L); luabins_SaveBuffer sb; /* * TODO: If lua_error() would happen below, would leak the buffer. */ if (index_to - index_from > LUABINS_MAXTUPLE) { lua_pushliteral(L, "can't save that many items"); return LUABINS_EFAILURE; } /* Allowing to call luabins_save(L, 1, lua_gettop(L)) from C function, called from Lua with no arguments (when lua_gettop() would return 0) */ if (index_to < index_from) { index_from = 0; index_to = 0; num_to_save = 0; } else { if ( index_from < 0 || index_from > base || index_to < 0 || index_to > base ) { lua_pushliteral(L, "can't save: inexistant indices"); return LUABINS_EFAILURE; } num_to_save = index_to - index_from + 1; } { void * alloc_ud = NULL; lua_Alloc alloc_fn = lua_getallocf(L, &alloc_ud); lbsSB_init(&sb, alloc_fn, alloc_ud); } lbs_writeTupleSize(&sb, num_to_save); for ( ; index <= index_to; ++index) { int result = 0; result = save_value(L, &sb, index, 0); if (result != LUABINS_ESUCCESS) { switch (result) { case LUABINS_EBADTYPE: lua_pushliteral(L, "can't save: unsupported type detected"); break; case LUABINS_ETOODEEP: lua_pushliteral(L, "can't save: nesting is too deep"); break; case LUABINS_ETOOLONG: lua_pushliteral(L, "can't save: not enough memory"); break; default: /* Should not happen */ lua_pushliteral(L, "save failed"); break; } lbsSB_destroy(&sb); return result; } } { size_t len = 0UL; const unsigned char * buf = lbsSB_buffer(&sb, &len); lua_pushlstring(L, (const char *)buf, len); lbsSB_destroy(&sb); } return LUABINS_ESUCCESS; } subprojects/luabins/src/write.c0000664000175000017500000000317614741067256016156 0ustar aniolaniol/* * write.c * Luabins Lua-less write API * See copyright notice in luabins.h */ #include "luaheaders.h" #include "write.h" int lbs_writeTableHeaderAt( luabins_SaveBuffer * sb, size_t offset, /* Pass LUABINS_APPEND to append to the end of buffer */ int array_size, int hash_size ) { int result = lbsSB_grow(sb, 1 + LUABINS_LINT + LUABINS_LINT); if (result == LUABINS_ESUCCESS) { /* * We have to reset offset here in case it was beyond the buffer. * Otherwise sequental overwrites may break. */ size_t length = lbsSB_length(sb); if (offset > length) { offset = length; } lbsSB_overwritechar(sb, offset, LUABINS_CTABLE); lbsSB_overwrite( sb, offset + 1, (const unsigned char *)&array_size, LUABINS_LINT ); lbsSB_overwrite( sb, offset + 1 + LUABINS_LINT, (const unsigned char *)&hash_size, LUABINS_LINT ); } return result; } int lbs_writeNumber(luabins_SaveBuffer * sb, lua_Number value) { int result = lbsSB_grow(sb, 1 + LUABINS_LNUMBER); if (result == LUABINS_ESUCCESS) { lbsSB_writechar(sb, LUABINS_CNUMBER); lbsSB_write(sb, (const unsigned char *)&value, LUABINS_LNUMBER); } return result; } int lbs_writeString( luabins_SaveBuffer * sb, const char * value, size_t length ) { int result = lbsSB_grow(sb, 1 + LUABINS_LSIZET + length); if (result == LUABINS_ESUCCESS) { lbsSB_writechar(sb, LUABINS_CSTRING); lbsSB_write(sb, (const unsigned char *)&length, LUABINS_LSIZET); lbsSB_write(sb, (const unsigned char *)value, length); } return result; } subprojects/packagefiles/0000775000175000017500000000000014744741403015037 5ustar aniolaniolsubprojects/packagefiles/luajit/0000775000175000017500000000000014741067256016333 5ustar aniolaniolsubprojects/packagefiles/luajit/meson.build0000664000175000017500000000332714741067256020502 0ustar aniolaniolproject('luajit', 'c', version: '2.1.0', license: 'MIT') cc = meson.get_compiler('c') system_deps = [ cc.find_library('dl', required: false), cc.find_library('m', required: false) ] # get architecture id for the host machine so it can be set when compiling buildvm natively lj_target_id = cc.get_define('LUAJIT_TARGET', prefix: '#include "@0@/src/lj_arch.h"'.format(meson.current_source_dir())) add_project_arguments('-DLUAJIT_TARGET=@0@'.format(lj_target_id), language: 'c', native: true) # compat flag is needed for both the buildvm code generator (compiled natively) and luajit itself 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) 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) ljvm_mode = 'machasm' ljvm_bout = 'lj_vm.s' elif host_machine.system() == 'windows' add_project_arguments('-DLUAJIT_OS=LUAJIT_OS_WINDOWS', language: 'c', native: true) if cc.get_id() != 'msvc' add_project_arguments('-malign-double', language: 'c', native: true) endif ljvm_mode = 'peobj' ljvm_bout = 'lj_vm.o' else error('Unsupported platform') endif subdir('src') luajit_dep = declare_dependency(link_with: luajit_lib, include_directories: src_inc) subprojects/packagefiles/luajit/src/0000775000175000017500000000000014741067256017122 5ustar aniolaniolsubprojects/packagefiles/luajit/src/host/0000775000175000017500000000000014741067256020077 5ustar aniolaniolsubprojects/packagefiles/luajit/src/host/meson.build0000664000175000017500000000317014741067256022242 0ustar aniolaniolcpu_family = host_machine.cpu_family() if cpu_family == 'x86_64' dynasm_arch = 'x64' elif cpu_family == 'aarch64' dynasm_arch = 'arm64' else dynasm_arch = 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_LE', '1', ['-D', 'ENDIAN_LE']], ['LJ_ARCH_BITS', '64', ['-D', 'P64']], ['LJ_HASJIT', '1', ['-D', 'JIT']], ['LJ_HASFFI', '1', ['-D', 'FFI']], ['LJ_DUALNUM', '1', ['-D', 'DUALNUM']], ['LJ_ARCH_HASFPU', '1', ['-D', 'FPU']], ['LJ_ABI_SOFTFP', '0', ['-D', 'HFABI']], ['LJ_NO_UNWIND', '1', ['-D', 'NO_UNWIND']], ['LJ_ABI_PAUTH', '1', ['-D', 'PAUTH']], ] foreach def: checkdefs if cc.get_define(def[0], prefix: hpre) == def[1] dasm += def[2] endif endforeach if host_machine.system() == 'windows' dasm += ['-D', 'WIN'] endif dasm += ['-D', 'VER=' + cc.get_define('LJ_ARCH_VERSION', prefix: hpre)] 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, luajit_h, dependencies: system_deps, include_directories: src_inc, native: true) subprojects/packagefiles/luajit/src/meson.build0000664000175000017500000000540014741067256021263 0ustar aniolaniolljlib_src = files( 'lib_base.c', 'lib_bit.c', 'lib_buffer.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_assert.c', 'lj_bc.c', 'lj_bcread.c', 'lj_bcwrite.c', 'lj_buf.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_prng.c', 'lj_profile.c', 'lj_record.c', 'lj_serialize.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', 'lj_udata.c', 'lj_vmevent.c', 'lj_vmmath.c', ) src_inc = include_directories('.') minilua = executable('minilua', 'host/minilua.c', dependencies: system_deps, native: true) relver = vcs_tag(command: ['git', 'show', '-s', '--format=%ct'], fallback: 'ROLLING', input: 'luajit_relver.txt.in', output: 'luajit_relver.txt', replace_string: '@VCS_CT@') luajit_rolling_h = files('luajit_rolling.h') luajit_h = custom_target('luajit_h', command: [minilua, '@INPUT@', '@OUTPUT@'], input: ['host/genversion.lua', 'luajit_rolling.h', relver], output: 'luajit.h') subdir('host') hdrgen = [ 'bcdef', 'ffdef', 'libdef', 'recdef', ] genheaders = [luajit_h] 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) subprojects/packagefiles/luajit/src/luajit_relver.txt.in0000664000175000017500000000001114741067256023127 0ustar aniolaniol@VCS_CT@ subprojects/csri/0000775000175000017500000000000014741067256013365 5ustar aniolaniolsubprojects/csri/backends/0000775000175000017500000000000014741067256015137 5ustar aniolaniolsubprojects/csri/backends/libass/0000775000175000017500000000000014741067256016414 5ustar aniolaniolsubprojects/csri/backends/libass/libass_csri.c0000664000175000017500000001476214741067256021067 0ustar aniolaniol/***************************************************************************** * csri: common subtitle renderer interface ***************************************************************************** * Copyright (C) 2007 David Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ /** libass csri wrapper. * Indirectly based on code from aegisub, * (c) 2006-2007, Rodrigo Braz Monteiro, Evgeniy Stepanov */ #ifdef HAVE_CONFIG_H #include "acconf.h" #endif #include #include #include #include #ifdef _WIN32 # define CSRIAPI __declspec(dllexport) #else # ifdef HAVE_GCC_VISIBILITY # define CSRIAPI __attribute__((visibility ("default"))) # else # define CSRIAPI # endif #endif #define CSRI_OWN_HANDLES typedef struct csri_libass_rend { ass_library_t* ass_library; } csri_rend; typedef struct csri_asa_inst { ass_renderer_t* ass_renderer; ass_track_t* ass_track; } csri_inst; #include #include #include static struct csri_libass_rend csri_libass = { NULL }; csri_inst *csri_open_file(csri_rend *renderer, const char *filename, struct csri_openflag *flags) { return subhelp_open_file(renderer, csri_open_mem, filename, flags); } csri_inst *csri_open_mem(csri_rend *renderer, const void *data, size_t length, struct csri_openflag *flags) { csri_inst *rv; if (renderer != &csri_libass) return NULL; rv = (csri_inst *)malloc(sizeof(csri_inst)); if (!rv) return NULL; rv->ass_renderer = ass_renderer_init(renderer->ass_library); if (!rv->ass_renderer) { free(rv); return NULL; } ass_set_font_scale(rv->ass_renderer, 1.); ass_set_fonts(rv->ass_renderer, NULL, "Sans"); rv->ass_track = ass_read_memory(csri_libass.ass_library, (void *)data, length, "UTF-8"); if (!rv->ass_track) { ass_renderer_done(rv->ass_renderer); free(rv); return NULL; } return rv; } void csri_close(csri_inst *inst) { ass_free_track(inst->ass_track); ass_renderer_done(inst->ass_renderer); free(inst); } int csri_request_fmt(csri_inst *inst, const struct csri_fmt *fmt) { if (!csri_is_rgb(fmt->pixfmt) || csri_has_alpha(fmt->pixfmt)) return -1; ass_set_frame_size(inst->ass_renderer, fmt->width, fmt->height); // Note: this relies on CSRI always rendering at video storage res ass_set_storage_size(inst->ass_renderer, fmt->width, fmt->height); return 0; } void csri_render(csri_inst *inst, struct csri_frame *frame, double time) { ass_image_t *img = ass_render_frame(inst->ass_renderer, inst->ass_track, (int)(time * 1000), NULL); while (img) { unsigned bpp, alpha = 256 - (img->color && 0xFF); int src_d, dst_d; unsigned char *src, *dst, *endy, *endx; unsigned char c[3] = { (img->color >> 8) & 0xFF, /* B */ (img->color >> 16) & 0xFF, /* G */ img->color >> 24 /* R */ }; if ((frame->pixfmt | 1) == CSRI_F__RGB || frame->pixfmt == CSRI_F_RGB) { unsigned char tmp = c[2]; c[2] = c[0]; c[0] = tmp; } bpp = frame->pixfmt >= 0x200 ? 3 : 4; dst = frame->planes[0] + img->dst_y * frame->strides[0] + img->dst_x * bpp; if (frame->pixfmt & 1) dst++; src = img->bitmap; src_d = img->stride - img->w; dst_d = frame->strides[0] - img->w * bpp; endy = src + img->h * img->stride; while (src != endy) { endx = src + img->w; while (src != endx) { /* src[x]: 0..255, alpha: 1..256 (see above) * -> src[x]*alpha: 0<<8..255<<8 * -> need 1..256 for mult => +1 */ unsigned s = ((*src++ * alpha) >> 8) + 1; unsigned d = 257 - s; /* c[0]: 0.255, s/d: 1..256 */ dst[0] = (s*c[0] + d*dst[0]) >> 8; dst[1] = (s*c[1] + d*dst[1]) >> 8; dst[2] = (s*c[2] + d*dst[2]) >> 8; dst += bpp; } dst += dst_d; src += src_d; } img = img->next; } } static csri_inst *libass_init_stream(csri_rend *renderer, const void *header, size_t headerlen, struct csri_openflag *flags) { csri_inst *rv; if (renderer != &csri_libass) return NULL; rv = (csri_inst *)malloc(sizeof(csri_inst)); if (!rv) return NULL; rv->ass_renderer = ass_renderer_init(renderer->ass_library); if (!rv->ass_renderer) { free(rv); return NULL; } ass_set_font_scale(rv->ass_renderer, 1.); ass_set_fonts(rv->ass_renderer, NULL, "Sans"); rv->ass_track = ass_new_track(csri_libass.ass_library); if (!rv->ass_track) { ass_renderer_done(rv->ass_renderer); free(rv); return NULL; } ass_process_codec_private(rv->ass_track, (void *)header, headerlen); return rv; } static void libass_push_packet(csri_inst *inst, const void *packet, size_t packetlen, double pts_start, double pts_end) { ass_process_chunk(inst->ass_track, (void *)packet, packetlen, (int)(pts_start * 1000), (int)((pts_end - pts_start) * 1000)); } static struct csri_stream_ext streamext = { libass_init_stream, libass_push_packet, NULL }; void *csri_query_ext(csri_rend *rend, csri_ext_id extname) { if (!rend) return NULL; if (!strcmp(extname, CSRI_EXT_STREAM_ASS)) return &streamext; return NULL; } static struct csri_info csri_libass_info = { "libass", "0.9.x", "libass (the MPlayer SSA/ASS renderer, 0.9.x API)", "Evgeniy Stepanov", "Copyright (c) 2006, 2007 by Evgeniy Stepanov" }; struct csri_info *csri_renderer_info(csri_rend *rend) { return &csri_libass_info; } csri_rend *csri_renderer_byname(const char *name, const char *specific) { if (strcmp(name, csri_libass_info.name)) return NULL; if (specific && strcmp(specific, csri_libass_info.specific)) return NULL; return &csri_libass; } csri_rend *csri_renderer_default() { csri_libass.ass_library = ass_library_init(); if (!csri_libass.ass_library) return NULL; ass_set_fonts_dir(csri_libass.ass_library, ""); ass_set_extract_fonts(csri_libass.ass_library, 0); ass_set_style_overrides(csri_libass.ass_library, NULL); return &csri_libass; } csri_rend *csri_renderer_next(csri_rend *prev) { return NULL; } subprojects/csri/backends/libass/Makefile.am0000664000175000017500000000042314741067256020447 0ustar aniolaniolcsrilib_LTLIBRARIES = libass_csri.la libass_csri_la_SOURCES = libass_csri.c libass_csri_la_LDFLAGS = -avoid-version -no-undefined libass_csri_la_LIBADD = ../../subhelp/libsubhelp_la-openfile.lo $(LIBASS_LIBS) libass_csri_la_CFLAGS = -I$(top_srcdir)/include $(LIBASS_CFLAGS) subprojects/csri/backends/Makefile.am0000664000175000017500000000010214741067256017164 0ustar aniolaniolif BUILD_LIBASS LIBASS_DIR = libass endif SUBDIRS = $(LIBASS_DIR) subprojects/csri/ac/0000775000175000017500000000000014741067256013750 5ustar aniolaniolsubprojects/csri/ac/Makefile.am0000664000175000017500000000005314741067256016002 0ustar aniolaniolEXTRA_DIST = \ csri.sln \ subhelp.vcproj subprojects/csri/acinclude.m40000664000175000017500000000322614741067256015561 0ustar aniolanioldnl AC_CPP_PRAGMA_ONCE dnl - check for #pragma once AC_DEFUN([AC_CPP_PRAGMA_ONCE], [{ AC_MSG_CHECKING([[whether $CPP supports #pragma once]]) AC_PREPROC_IFELSE( [AC_LANG_PROGRAM([[#pragma once]])], [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_PRAGMA_ONCE], [1], [Preprocessor support for #pragma once]) ], [AC_MSG_RESULT([no])]) }]) dnl AC_C_FLAG([-flag]) dnl - check for CFLAG support in CC AC_DEFUN([AC_C_FLAG], [{ AC_LANG_PUSH(C) ac_c_flag_save="$CFLAGS" CFLAGS="$CFLAGS $1" AC_MSG_CHECKING([[whether $CC supports $1]]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[]])], [ AC_MSG_RESULT([yes]) m4_if([$3], [], [], [ CFLAGS="$ac_c_flag_save" $3 ]) ], [ CFLAGS="$ac_c_flag_save" AC_MSG_RESULT([no]) $2 ]) AC_LANG_POP(C) }]) dnl AC_C_FLAG([-flag]) dnl - check for CFLAG support in CC AC_DEFUN([AC_GCC_VISIBILITY], [{ AC_MSG_CHECKING([[whether $CC supports GCC visibility]]) # always use Werror since visibility is sensitive # doesn't work on anything other than gcc either way, so Werror is fine... vis_type="$1" save_cflags="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=$vis_type -Werror" AC_LINK_IFELSE( [AC_LANG_SOURCE([[ int a() __attribute__((visibility("default"))); int b() __attribute__((visibility("hidden"))); int c() __attribute__((visibility("internal"))); int a() { return 1; } int b() { return 2; } int c() { return 3; } int main() { return a()+b()+c(); } ]])], [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_GCC_VISIBILITY], [1], [Compiler support for GCC visibility attributes]) save_cflags="$save_cflags -fvisibility=$vis_type" ], [AC_MSG_RESULT([no])] ) CFLAGS="$save_cflags" }]) subprojects/csri/frontends/0000775000175000017500000000000014741067256015367 5ustar aniolaniolsubprojects/csri/frontends/cmdline/0000775000175000017500000000000014741067256017002 5ustar aniolaniolsubprojects/csri/frontends/cmdline/cmdmain.c0000664000175000017500000002714314741067256020565 0ustar aniolaniol/***************************************************************************** * asa: portable digital subtitle renderer ***************************************************************************** * Copyright (C) 2007 David Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ #ifdef HAVE_CONFIG_H #include "acconf.h" #endif #include #include #include #include #include #include #include #include #include #include #include "render.h" csri_rend *r; static int do_usage(FILE *fd) { fprintf(fd, "usage: csri [COMMON-OPTIONS] COMMAND [COMMAND-OPTIONS]\n" "\n" "common options: [-r renderer [-s specific]]\n" "\t-r\tselect a renderer, by name\n" "\t-s\tselect a renderer version, by specific name\n" "\n" "commands:\n" "\tlist\tshow installed renderers\n" "\tinfo\tshow detailed renderer information\n" "\trender\trender subtitle output\n" #ifdef HAVE_LIBPNG "\t\t-i FILE\t\tread background from PNG file\n" "\t\t-o PREFIX\twrite output to PREFIX_nnnn.png\n" #endif "\t\t-A\t\tkeep alpha\n" "\t\t-t [start][:[end][:[step]]]\tspecify timestamps to be rendered\n" "\t\tSUBFILE\t\tsubtitle file to load\n" "\n"); return 2; } static int do_list(int argc, char **argv) { unsigned num = 0; if (argc) return do_usage(stderr); while (r) { struct csri_info *info = csri_renderer_info(r); if (!info) continue; printf("%s:%s %s, %s, %s\n", info->name, info->specific, info->longname, info->author, info->copyright); r = csri_renderer_next(r); num++; } fprintf(stderr, "%u renderers found\n", num); return num > 0 ? 0 : 1; } static csri_ext_id known_exts[] = { CSRI_EXT_OPENERR, CSRI_EXT_LOGGING, CSRI_EXT_STREAM, CSRI_EXT_STREAM_ASS, CSRI_EXT_STREAM_TEXT, CSRI_EXT_STREAM_DISCARD, NULL }; static const char *dummy_script = "[Script Info]\r\n" "ScriptType: v4.00\r\n" "[V4 Styles]\r\n" "Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, " "TertiaryColour, BackColour, Bold, Italic, BorderStyle, " "Outline, Shadow, Alignment, MarginL, MarginR, MarginV, " "AlphaLevel, Encoding\r\n" "Style: Default,Arial,20,&HFFFFFF&,&H00FFFF&,&H000000&,&H000000&," "0,0,1,2,2,2,10,10,10,0,0\r\n" "[Events]\r\n" "Format: Marked, Start, End, Style, Name, " "MarginL, MarginR, MarginV, Effect, Text\r\n" "Dialogue: Marked=0,0:00:01.00,0:00:02.00,Default,,0000,0000,0000,," "test\r\n"; static const char *dummy_stream = "1,0,Default,,0000,0000,0000,,stream\r\n"; #define e(x) { #x, CSRI_F_ ## x } #define ree(x) e(RGB ## x), e(x ## RGB), e(BGR ## x), e(x ## BGR) static struct csri_fmtlistent { const char *label; enum csri_pixfmt fmt; } csri_fmts[] = { ree(A), ree(_), e(RGB), e(BGR), e(AYUV), e(YUVA), e(YVUA), e(YUY2), e(YV12A), e(YV12), { NULL, 0 } }; static void listfmts() { csri_inst *i; struct csri_fmtlistent *fmt; struct csri_fmt f; printf("\ntrying to get list of supported colorspaces:\n"); fflush(stdout); i = csri_open_mem(r, dummy_script, strlen(dummy_script), NULL); f.width = f.height = 256; for (fmt = csri_fmts; fmt->label; fmt++) { f.pixfmt = fmt->fmt; if (!csri_request_fmt(i, &f)) printf("\t[%04x] %s\n", fmt->fmt, fmt->label); } csri_close(i); } static int do_info(int argc, char **argv) { struct csri_info *info; csri_ext_id *id; if (argc) return do_usage(stderr); info = csri_renderer_info(r); if (!info) return 1; printf("%s:%s\n\t%s\n\t%s\n\t%s\n", info->name, info->specific, info->longname, info->author, info->copyright); printf("supported CSRI extensions:\n"); for (id = known_exts; *id; id++) { void *rext = csri_query_ext(r, *id); void *lext = csri_query_ext(NULL, *id); if (lext || rext) { printf("\t%s ", *id); if (!lext) printf("\n"); else if (!rext) printf("[library only]\n"); else if (rext == lext) printf("[emulated by library]\n"); else printf("\n"); } } listfmts(); return 0; } static void logfunc(void *appdata, enum csri_logging_severity sev, const char *message) { char severity[32]; switch (sev) { case CSRI_LOG_DEBUG: strcpy(severity, "[debug]"); break; case CSRI_LOG_INFO: strcpy(severity, "[info]"); break; case CSRI_LOG_NOTICE: strcpy(severity, "[notice]"); break; case CSRI_LOG_WARNING: strcpy(severity, "[warning]"); break; case CSRI_LOG_ERROR: strcpy(severity, "[error]"); break; default: snprintf(severity, 32, "[%d?]", (int)sev); } fprintf(stderr, "%-10s %s\n", severity, message); } static int real_render(double *times, const char *infile, const char *outfile, const char *script, enum csri_pixfmt pfmt) { struct csri_frame *bg, *a; csri_inst *inst; struct csri_fmt fmt; double now; int idx; uint32_t width = 640, height = 480; bg = infile ? png_load(infile, &width, &height, pfmt) : frame_alloc(width, height, pfmt); a = frame_alloc(width, height, pfmt); if (!bg || !a) { fprintf(stderr, "failed to allocate frame\n"); if (!bg) fprintf(stderr, "\t- problem with background.\n"); return 2; } inst = csri_open_file(r, script, NULL); if (!inst) { fprintf(stderr, "failed to open script \"%s\"\n", script); return 2; } fmt.pixfmt = pfmt; fmt.width = width; fmt.height = height; if (csri_request_fmt(inst, &fmt)) { fprintf(stderr, "format not supported by renderer\n"); return 2; } idx = 0; for (now = times[0]; now <= times[1]; now += times[2]) { frame_copy(a, bg, width, height); csri_render(inst, a, now); if (outfile) { char buffer[256]; snprintf(buffer, sizeof(buffer), "%s_%04d.png", outfile, idx); printf("%s\n", buffer); png_store(a, buffer, width, height); } idx++; } csri_close(inst); inst = NULL; frame_free(bg); frame_free(a); return 0; } static int do_render(int argc, char **argv) { double times[3] = {0.0, 0.0, 1.0}; const char *outfile = NULL, *infile = NULL; struct csri_fmtlistent *fmte; int keepalpha = 0; enum csri_pixfmt fmt = ~0U; argv--, argc++; while (1) { int c, i; const char *short_options = "t:o:i:F:A"; char *arg, *end, *err; struct option long_options[] = { {"time", 1, 0, 't'}, {"output", 1, 0, 'o'}, {"input", 1, 0, 'i'}, {"format", 0, 0, 'F'}, {"alpha", 0, 0, 'A'}, {0, 0, 0, 0} }; c = getopt_long(argc, argv, short_options, long_options, NULL); if (c == -1) break; switch (c) { case 't': arg = optarg; for (i = 0; i < 3; i++) { end = strchr(arg, ':'); if (end) *end = '\0'; if (*arg) { times[i] = strtod(arg, &err); if (*err) { fprintf(stderr, "invalid time: %s\n", arg); return do_usage(stderr); } } if (!end) break; arg = end + 1; } break; case 'i': infile = optarg; break; case 'o': outfile = optarg; break; case 'A': if (fmt != ~0U) return do_usage(stderr); keepalpha = 1; break; case 'F': if (keepalpha || fmt != ~0U) return do_usage(stderr); for (fmte = csri_fmts; fmte->label; fmte++) if (!strcmp(fmte->label, optarg)) break; if (!fmte->label) return do_usage(stderr); fmt = fmte->fmt; break; default: return do_usage(stderr); }; } if (fmt == ~0U) fmt = keepalpha ? CSRI_F_RGBA : CSRI_F_RGB_; if (!isfinite(times[0])) { fprintf(stderr, "invalid start time\n"); return do_usage(stderr); } if (!isfinite(times[1]) || times[1] < times[0]) { fprintf(stderr, "invalid end time\n"); return do_usage(stderr); } if (!isnormal(times[2]) || times[2] < 0.0) { fprintf(stderr, "invalid end time\n"); return do_usage(stderr); } if (argc - optind != 1) { fprintf(stderr, "script name missing\n"); return do_usage(stderr); } return real_render(times, infile, outfile, argv[optind], fmt); } static int do_streamtest(int argc, char **argv) { const char *outfile = NULL; struct csri_fmtlistent *fmte; enum csri_pixfmt pfmt = ~0U; struct csri_frame *bg, *a; csri_inst *inst; struct csri_fmt fmt; uint32_t width = 640, height = 480; struct csri_stream_ext *sext; argv--, argc++; while (1) { int c; const char *short_options = "o:F:"; struct option long_options[] = { {"output", 1, 0, 'o'}, {"format", 0, 0, 'F'}, {0, 0, 0, 0} }; c = getopt_long(argc, argv, short_options, long_options, NULL); if (c == -1) break; switch (c) { case 'o': outfile = optarg; break; case 'F': if (pfmt != ~0U) return do_usage(stderr); for (fmte = csri_fmts; fmte->label; fmte++) if (!strcmp(fmte->label, optarg)) break; if (!fmte->label) return do_usage(stderr); pfmt = fmte->fmt; break; default: return do_usage(stderr); }; } if (pfmt == ~0U) pfmt = CSRI_F_RGB_; sext = (struct csri_stream_ext *)csri_query_ext(r, CSRI_EXT_STREAM_ASS); if (!sext) { fprintf(stderr, "renderer does not support ASS streaming\n"); return 2; } bg = frame_alloc(width, height, pfmt); a = frame_alloc(width, height, pfmt); if (!bg || !a) { fprintf(stderr, "failed to allocate frame\n"); return 2; } inst = sext->init_stream(r, dummy_script, strlen(dummy_script), NULL); if (!inst) { fprintf(stderr, "failed to initialize stream\n"); return 2; } fmt.pixfmt = pfmt; fmt.width = width; fmt.height = height; if (csri_request_fmt(inst, &fmt)) { fprintf(stderr, "format not supported by renderer\n"); return 2; } frame_copy(a, bg, width, height); csri_render(inst, a, 1.75); if (outfile) { char buffer[256]; snprintf(buffer, sizeof(buffer), "%s_nstream.png", outfile); printf("%s\n", buffer); png_store(a, buffer, width, height); } frame_copy(a, bg, width, height); sext->push_packet(inst, dummy_stream, strlen(dummy_stream), 1.5, 2.0); csri_render(inst, a, 1.75); if (outfile) { char buffer[256]; snprintf(buffer, sizeof(buffer), "%s_stream.png", outfile); printf("%s\n", buffer); png_store(a, buffer, width, height); } csri_close(inst); inst = NULL; frame_free(bg); frame_free(a); return 0; } int main(int argc, char **argv) { struct csri_logging_ext *logext; if (argc < 2) return do_usage(stderr); logext = (struct csri_logging_ext *)csri_query_ext(NULL, CSRI_EXT_LOGGING); if (logext && logext->set_logcallback) logext->set_logcallback(logfunc, NULL); else fprintf(stderr, "warning: unable to set log callback\n"); r = csri_renderer_default(); argc--, argv++; if (!strcmp(argv[0], "list")) return do_list(argc - 1, argv + 1); if (!strcmp(argv[0], "-r")) { const char *name = NULL, *spec = NULL; if (argc < 2) return do_usage(stderr); name = argv[1]; argc -= 2, argv += 2; if (!strcmp(argv[0], "-s")) { if (argc < 2) return do_usage(stderr); spec = argv[1]; } r = csri_renderer_byname(name, spec); if (!r) { fprintf(stderr, "renderer %s:%s not found.\n", name, spec ? spec : "*"); return 2; } } if (!strcmp(argv[0], "info")) return do_info(argc - 1, argv + 1); if (!strcmp(argv[0], "render")) return do_render(argc - 1, argv + 1); if (!strcmp(argv[0], "streamtest")) return do_streamtest(argc - 1, argv + 1); return do_usage(stderr); } subprojects/csri/frontends/cmdline/render.c0000664000175000017500000001506014741067256020427 0ustar aniolaniol/***************************************************************************** * asa: portable digital subtitle renderer ***************************************************************************** * Copyright (C) 2007 David Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ #ifdef HAVE_CONFIG_H #include "acconf.h" #endif #include #include #include #include #include #include #include #include #include "render.h" extern csri_rend *r; #ifdef HAVE_LIBPNG #include struct csri_frame *png_load(const char *filename, uint32_t *width, uint32_t *height, enum csri_pixfmt fmt) { struct csri_frame *frame; int bit_depth, color_type; png_structp png_ptr; png_infop info_ptr; png_bytep *rows; unsigned char *imgdata; FILE *fp; if (!csri_is_rgb(fmt)) { fprintf(stderr, "PNG loader: can't load non-RGB.\n"); return NULL; } frame = (struct csri_frame *)malloc(sizeof(struct csri_frame)); if (!frame) return NULL; memset(frame, 0, sizeof(*frame)); frame->pixfmt = fmt; fp = fopen(filename, "rb"); if (!fp) { fprintf(stderr, "Error opening \"%s\": %s (%d)\n", filename, strerror(errno), errno); return NULL; } assert(png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL)); assert(info_ptr = png_create_info_struct(png_ptr)); //keepalpha ? CSRI_F_RGBA : CSRI_F_RGB_; png_init_io(png_ptr, fp); png_read_info(png_ptr, info_ptr); png_get_IHDR(png_ptr, info_ptr, (png_uint_32 *)width, (png_uint_32 *)height, &bit_depth, &color_type, NULL, NULL, NULL); if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png_ptr); if (bit_depth < 8) png_set_packing(png_ptr); if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr); if (bit_depth == 16) png_set_strip_16(png_ptr); if ((fmt < 0x200 && (fmt & 2)) || fmt == CSRI_F_BGR) png_set_bgr(png_ptr); if (csri_has_alpha(fmt)) { int before = fmt == CSRI_F_ARGB || fmt == CSRI_F_ABGR; if (color_type == PNG_COLOR_TYPE_RGB) png_set_filler(png_ptr, 0xff, before ? PNG_FILLER_BEFORE : PNG_FILLER_AFTER); else { png_set_invert_alpha(png_ptr); if (before) png_set_swap_alpha(png_ptr); } } else { if (color_type & PNG_COLOR_MASK_ALPHA) png_set_strip_alpha(png_ptr); if (fmt != CSRI_F_RGB && fmt != CSRI_F_BGR) { int before = fmt == CSRI_F__RGB || fmt == CSRI_F__BGR; png_set_filler(png_ptr, 0xff, before ? PNG_FILLER_BEFORE : PNG_FILLER_AFTER); } } rows = (png_bytep *)malloc(sizeof(png_bytep) * *height); assert(rows); imgdata = (unsigned char *)malloc(4 * *height * *width); assert(imgdata); for (uint32_t y = 0; y < *height; y++) rows[y] = imgdata + 4 * *width * y; png_read_image(png_ptr, rows); png_read_end(png_ptr, NULL); png_destroy_read_struct(&png_ptr, &info_ptr, NULL); free(rows); frame->planes[0] = imgdata; frame->strides[0] = *width * 4; printf("\033[32;1mloaded %ux%u\033[m\n", *width, *height); return frame; } void png_store(struct csri_frame *frame, const char *filename, uint32_t width, uint32_t height) { enum csri_pixfmt fmt = frame->pixfmt; int xforms = 0, before = 0, after = 0; png_structp png_ptr; png_infop info_ptr; png_bytep *rows; FILE *fp; fp = fopen(filename, "wb"); if (!fp) { fprintf(stderr, "Error opening \"%s\": %s (%d)\n", filename, strerror(errno), errno); return; } rows = (png_bytep *)malloc(sizeof(png_bytep) * height); assert(rows); after = fmt == CSRI_F_RGB_ || fmt == CSRI_F_BGR_; before = fmt == CSRI_F__RGB || fmt == CSRI_F__BGR; for (uint32_t y = 0; y < height; y++) { rows[y] = frame->planes[0] + frame->strides[0] * y; if (before || after) { unsigned char *d = rows[y], *s = rows[y], *e = d + frame->strides[0]; if (before) s++; while (d < e) { *d++ = *s++; *d++ = *s++; *d++ = *s++; s++; } } } assert(png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL)); assert(info_ptr = png_create_info_struct(png_ptr)); png_init_io(png_ptr, fp); if (csri_has_alpha(fmt) && (fmt == CSRI_F_ARGB || fmt == CSRI_F_ABGR)) xforms |= PNG_TRANSFORM_SWAP_ALPHA; if ((fmt < 0x200 && (fmt & 2)) || fmt == CSRI_F_BGR) xforms |= PNG_TRANSFORM_BGR; png_set_compression_level(png_ptr, Z_BEST_COMPRESSION); png_set_IHDR(png_ptr, info_ptr, width, height, 8, csri_has_alpha(fmt) ? PNG_COLOR_TYPE_RGB_ALPHA : PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); png_set_rows(png_ptr, info_ptr, rows); png_write_png(png_ptr, info_ptr, xforms, NULL); fflush(fp); png_destroy_write_struct(&png_ptr, &info_ptr); } #else struct csri_frame *png_load(const char *filename, uint32_t *width, uint32_t *height, enum csri_pixfmt fmt) { fprintf(stderr, "PNG support not compiled in.\n"); return NULL; } void png_store(struct csri_frame *frame, const char *filename, uint32_t width, uint32_t height) { fprintf(stderr, "PNG support not compiled in.\n"); return; } #endif struct csri_frame *frame_alloc(uint32_t width, uint32_t height, enum csri_pixfmt fmt) { int bpp; unsigned char *d; struct csri_frame *frame; if (!csri_is_rgb(fmt)) return NULL; bpp = fmt < CSRI_F_RGB ? 4 : 3; d = (unsigned char *)malloc(width * height * bpp); frame = (struct csri_frame *)malloc(sizeof(struct csri_frame)); if (!frame || !d) return NULL; memset(frame, 0, sizeof(*frame)); frame->pixfmt = fmt; frame->strides[0] = width * bpp; memset(d, csri_has_alpha(fmt) ? 0x00 : 0x80, width * height * bpp); frame->planes[0] = d; return frame; } void frame_free(struct csri_frame *frame) { int c; for (c = 0; c < 4; c++) if (frame->planes[c]) free(frame->planes[c]); free(frame); } void frame_copy(struct csri_frame *dst, struct csri_frame *src, uint32_t width, uint32_t height) { memcpy(dst->planes[0], src->planes[0], height * src->strides[0]); } subprojects/csri/frontends/cmdline/Makefile.am0000664000175000017500000000023114741067256021032 0ustar aniolaniolbin_PROGRAMS = csri AM_CPPFLAGS = -I$(top_srcdir)/include csri_SOURCES = cmdmain.c render.c csri_LDADD = ../../lib/libcsri.la noinst_HEADERS = render.h subprojects/csri/frontends/cmdline/render.h0000664000175000017500000000302414741067256020431 0ustar aniolaniol/***************************************************************************** * asa: portable digital subtitle renderer ***************************************************************************** * Copyright (C) 2007 David Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ #ifndef _RENDER_H #define _RENDER_H extern struct csri_frame *png_load(const char *filename, uint32_t *width, uint32_t *height, enum csri_pixfmt fmt); extern void png_store(struct csri_frame *frame, const char *filename, uint32_t width, uint32_t height); extern struct csri_frame *frame_alloc(uint32_t width, uint32_t height, enum csri_pixfmt fmt); extern void frame_free(struct csri_frame *frame); extern void frame_copy(struct csri_frame *dst, struct csri_frame *src, uint32_t width, uint32_t height); #endif subprojects/csri/frontends/avisynth25/0000775000175000017500000000000014741067256017403 5ustar aniolaniolsubprojects/csri/frontends/avisynth25/avisynth.cpp0000664000175000017500000001122714741067256021757 0ustar aniolaniol/***************************************************************************** * asa: portable digital subtitle renderer ***************************************************************************** * Copyright (C) 2006 David Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ #include #include "avisynth.h" #include #include class CSRIAviSynth : public GenericVideoFilter { csri_inst *inst; double spf; public: CSRIAviSynth(PClip _child, IScriptEnvironment *env, const char *file, const char *rendname, const char *rendver); ~CSRIAviSynth(); enum csri_pixfmt GetPixfmt(); PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment *env); static AVSValue __cdecl Create(AVSValue args, void* user_data, IScriptEnvironment* env); }; CSRIAviSynth::CSRIAviSynth(PClip _child, IScriptEnvironment *env, const char *file, const char *rendname, const char *rendver) : GenericVideoFilter(_child) { csri_rend *r = csri_renderer_byname(rendname, rendver); if (!r) { if (rendver) env->ThrowError("Failed to load renderer \"%s\"" " version \"%s\"", rendname, rendver); else if (rendname) env->ThrowError("Failed to load renderer \"%s\"", rendname); else env->ThrowError("Failed to load default renderer"); } struct csri_fmt fmt; fmt.pixfmt = GetPixfmt(); if (fmt.pixfmt == -1) env->ThrowError("Pixel format not supported by " "AviSynth interface"); inst = csri_open_file(r, file, NULL); if (!inst) env->ThrowError("Failed to load \"%s\"", file); fmt.width = vi.width; fmt.height = vi.height; if (csri_request_fmt(inst, &fmt)) { csri_close(inst); env->ThrowError("Selected pixel format or size not supported " "by selected subtitle renderer", file); } spf = (double)vi.fps_denominator / (double)vi.fps_numerator; } CSRIAviSynth::~CSRIAviSynth() { csri_close(inst); } enum csri_pixfmt CSRIAviSynth::GetPixfmt() { switch (vi.pixel_type) { case VideoInfo::CS_BGR24: return CSRI_F_BGR; case VideoInfo::CS_BGR32: return CSRI_F_BGR_; case VideoInfo::CS_YUY2: return CSRI_F_YUY2; case VideoInfo::CS_YV12: return CSRI_F_YV12; } return (enum csri_pixfmt)-1; } PVideoFrame __stdcall CSRIAviSynth::GetFrame(int n, IScriptEnvironment *env) { PVideoFrame avsframe = child->GetFrame(n, env); struct csri_frame frame; env->MakeWritable(&avsframe); frame.pixfmt = GetPixfmt(); frame.planes[0] = avsframe->GetWritePtr(); frame.strides[0] = avsframe->GetPitch(); if (csri_is_yuv_planar(frame.pixfmt)) { frame.planes[1] = avsframe->GetWritePtr(PLANAR_U); frame.strides[1] = avsframe->GetPitch(PLANAR_U); frame.planes[2] = avsframe->GetWritePtr(PLANAR_V); frame.strides[2] = avsframe->GetPitch(PLANAR_V); } if (csri_is_rgb(frame.pixfmt)) { frame.planes[0] += (vi.height - 1) * frame.strides[0]; frame.strides[0] = -frame.strides[0]; } csri_render(inst, &frame, n * spf); return avsframe; } AVSValue __cdecl CSRIAviSynth::Create(AVSValue args, void* user_data, IScriptEnvironment* env) { const char *rname = args.ArraySize() >= 2 ? args[2].AsString() : NULL, *rver = args.ArraySize() >= 3 ? args[3].AsString() : NULL; return new CSRIAviSynth(args[0].AsClip(), env, args[1].AsString(), rname, rver); } extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit2( IScriptEnvironment* env) { static char avs_name_f[2048]; const char *avs_cmdname = (const char *)csri_query_ext(NULL, "csri.avisynth25.command_name"); const char *avs_name = (const char *)csri_query_ext(NULL, "csri.avisynth25.name"); if (!csri_renderer_default()) return NULL; if (!avs_cmdname) avs_cmdname = "CSRI"; if (!avs_name) avs_name = "Common Subtitle Renderer Interface"; env->AddFunction(avs_cmdname, "cs", CSRIAviSynth::Create, 0); env->AddFunction(avs_cmdname, "css", CSRIAviSynth::Create, 0); env->AddFunction(avs_cmdname, "csss", CSRIAviSynth::Create, 0); snprintf(avs_name_f, sizeof(avs_name_f), "%s [AviSynth 2.5 front-end]", avs_name); return avs_name_f; } subprojects/csri/frontends/avisynth25/avisynth.h0000664000175000017500000006416514741067256021435 0ustar aniolaniol// Avisynth v2.5. Copyright 2002 Ben Rudiak-Gould et al. // http://www.avisynth.org // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit // http://www.gnu.org/copyleft/gpl.html . // // Linking Avisynth statically or dynamically with other modules is making a // combined work based on Avisynth. Thus, the terms and conditions of the GNU // General Public License cover the whole combination. // // As a special exception, the copyright holders of Avisynth give you // permission to link Avisynth with independent modules that communicate with // Avisynth solely through the interfaces defined in avisynth.h, regardless of the license // terms of these independent modules, and to copy and distribute the // resulting combined work under terms of your choice, provided that // every copy of the combined work is accompanied by a complete copy of // the source code of Avisynth (the version of Avisynth used to produce the // combined work), being distributed under the terms of the GNU General // Public License plus this exception. An independent module is a module // which is not derived from or based on Avisynth, such as 3rd-party filters, // import and export plugins, or graphical user interfaces. #ifndef __AVISYNTH_H__ #define __AVISYNTH_H__ enum { AVISYNTH_INTERFACE_VERSION = 3 }; /* Define all types necessary for interfacing with avisynth.dll Moved from internal.h */ // Win32 API macros, notably the types BYTE, DWORD, ULONG, etc. #include // COM interface macros #include // Raster types used by VirtualDub & Avisynth #define in64 (__int64)(unsigned short) typedef unsigned long Pixel; // this will break on 64-bit machines! typedef unsigned long Pixel32; typedef unsigned char Pixel8; typedef long PixCoord; typedef long PixDim; typedef long PixOffset; /* Compiler-specific crap */ // Tell MSVC to stop precompiling here #ifdef _MSC_VER #pragma hdrstop #endif // Set up debugging macros for MS compilers; for others, step down to the // standard interface #ifdef _MSC_VER #include #else #define _RPT0(a,b) ((void)0) #define _RPT1(a,b,c) ((void)0) #define _RPT2(a,b,c,d) ((void)0) #define _RPT3(a,b,c,d,e) ((void)0) #define _RPT4(a,b,c,d,e,f) ((void)0) #define _ASSERTE(x) assert(x) #define _ASSERT(x) assert(x) #include #endif // I had problems with Premiere wanting 1-byte alignment for its structures, // so I now set the Avisynth struct alignment explicitly here. #pragma pack(push,8) #define FRAME_ALIGN 16 // Default frame alignment is 16 bytes, to help P4, when using SSE2 // The VideoInfo struct holds global information about a clip (i.e. // information that does not depend on the frame number). The GetVideoInfo // method in IClip returns this struct. // Audio Sample information typedef float SFLOAT; enum {SAMPLE_INT8 = 1<<0, SAMPLE_INT16 = 1<<1, SAMPLE_INT24 = 1<<2, // Int24 is a very stupid thing to code, but it's supported by some hardware. SAMPLE_INT32 = 1<<3, SAMPLE_FLOAT = 1<<4}; enum { PLANAR_Y=1<<0, PLANAR_U=1<<1, PLANAR_V=1<<2, PLANAR_ALIGNED=1<<3, PLANAR_Y_ALIGNED=PLANAR_Y|PLANAR_ALIGNED, PLANAR_U_ALIGNED=PLANAR_U|PLANAR_ALIGNED, PLANAR_V_ALIGNED=PLANAR_V|PLANAR_ALIGNED, }; struct VideoInfo { int width, height; // width=0 means no video unsigned fps_numerator, fps_denominator; int num_frames; // This is more extensible than previous versions. More properties can be added seeminglesly. // Colorspace properties. enum { CS_BGR = 1<<28, CS_YUV = 1<<29, CS_INTERLEAVED = 1<<30, CS_PLANAR = 1<<31 }; // Specific colorformats enum { CS_UNKNOWN = 0, CS_BGR24 = 1<<0 | CS_BGR | CS_INTERLEAVED, CS_BGR32 = 1<<1 | CS_BGR | CS_INTERLEAVED, CS_YUY2 = 1<<2 | CS_YUV | CS_INTERLEAVED, CS_YV12 = 1<<3 | CS_YUV | CS_PLANAR, // y-v-u, planar CS_I420 = 1<<4 | CS_YUV | CS_PLANAR, // y-u-v, planar CS_IYUV = 1<<4 | CS_YUV | CS_PLANAR // same as above }; int pixel_type; // changed to int as of 2.5 int audio_samples_per_second; // 0 means no audio int sample_type; // as of 2.5 __int64 num_audio_samples; // changed as of 2.5 int nchannels; // as of 2.5 // Imagetype properties int image_type; enum { IT_BFF = 1<<0, IT_TFF = 1<<1, IT_FIELDBASED = 1<<2 }; // useful functions of the above bool HasVideo() const { return (width!=0); } bool HasAudio() const { return (audio_samples_per_second!=0); } bool IsRGB() const { return !!(pixel_type&CS_BGR); } bool IsRGB24() const { return (pixel_type&CS_BGR24)==CS_BGR24; } // Clear out additional properties bool IsRGB32() const { return (pixel_type & CS_BGR32) == CS_BGR32 ; } bool IsYUV() const { return !!(pixel_type&CS_YUV ); } bool IsYUY2() const { return (pixel_type & CS_YUY2) == CS_YUY2; } bool IsYV12() const { return ((pixel_type & CS_YV12) == CS_YV12)||((pixel_type & CS_I420) == CS_I420); } bool IsColorSpace(int c_space) const { return ((pixel_type & c_space) == c_space); } bool Is(int property) const { return ((pixel_type & property)==property ); } bool IsPlanar() const { return !!(pixel_type & CS_PLANAR); } bool IsFieldBased() const { return !!(image_type & IT_FIELDBASED); } bool IsParityKnown() const { return ((image_type & IT_FIELDBASED)&&(image_type & (IT_BFF|IT_TFF))); } bool IsBFF() const { return !!(image_type & IT_BFF); } bool IsTFF() const { return !!(image_type & IT_TFF); } bool IsVPlaneFirst() const {return ((pixel_type & CS_YV12) == CS_YV12); } // Don't use this int BytesFromPixels(int pixels) const { return pixels * (BitsPerPixel()>>3); } // Will not work on planar images, but will return only luma planes int RowSize() const { return BytesFromPixels(width); } // Also only returns first plane on planar images int BMPSize() const { if (IsPlanar()) {int p = height * ((RowSize()+3) & ~3); p+=p>>1; return p; } return height * ((RowSize()+3) & ~3); } __int64 AudioSamplesFromFrames(__int64 frames) const { return (fps_numerator && HasVideo()) ? ((__int64)(frames) * audio_samples_per_second * fps_denominator / fps_numerator) : 0; } int FramesFromAudioSamples(__int64 samples) const { return (fps_denominator && HasAudio()) ? (int)((samples * (__int64)fps_numerator)/((__int64)fps_denominator * (__int64)audio_samples_per_second)) : 0; } __int64 AudioSamplesFromBytes(__int64 bytes) const { return HasAudio() ? bytes / BytesPerAudioSample() : 0; } __int64 BytesFromAudioSamples(__int64 samples) const { return samples * BytesPerAudioSample(); } int AudioChannels() const { return nchannels; } int SampleType() const{ return sample_type;} bool IsSampleType(int testtype) const{ return !!(sample_type&testtype);} int SamplesPerSecond() const { return audio_samples_per_second; } int BytesPerAudioSample() const { return nchannels*BytesPerChannelSample();} void SetFieldBased(bool isfieldbased) { if (isfieldbased) image_type|=IT_FIELDBASED; else image_type&=~IT_FIELDBASED; } void Set(int property) { image_type|=property; } void Clear(int property) { image_type&=~property; } int BitsPerPixel() const { switch (pixel_type) { case CS_BGR24: return 24; case CS_BGR32: return 32; case CS_YUY2: return 16; case CS_YV12: case CS_I420: return 12; default: return 0; } } int BytesPerChannelSample() const { switch (sample_type) { case SAMPLE_INT8: return sizeof(signed char); case SAMPLE_INT16: return sizeof(signed short); case SAMPLE_INT24: return 3; case SAMPLE_INT32: return sizeof(signed int); case SAMPLE_FLOAT: return sizeof(SFLOAT); default: _ASSERTE("Sample type not recognized!"); return 0; } } // useful mutator void SetFPS(unsigned numerator, unsigned denominator) { if ((numerator == 0) || (denominator == 0)) { fps_numerator = 0; fps_denominator = 1; } else { unsigned x=numerator, y=denominator; while (y) { // find gcd unsigned t = x%y; x = y; y = t; } fps_numerator = numerator/x; fps_denominator = denominator/x; } } // Range protected multiply-divide of FPS void MulDivFPS(unsigned multiplier, unsigned divisor) { unsigned __int64 numerator = UInt32x32To64(fps_numerator, multiplier); unsigned __int64 denominator = UInt32x32To64(fps_denominator, divisor); unsigned __int64 x=numerator, y=denominator; while (y) { // find gcd unsigned __int64 t = x%y; x = y; y = t; } numerator /= x; // normalize denominator /= x; unsigned __int64 temp = numerator | denominator; // Just looking top bit unsigned u = 0; #ifdef __GNUC__ while (temp & 0xffffffff80000000LL) { // or perhaps > 16777216*2 #else while (temp & 0xffffffff80000000) { // or perhaps > 16777216*2 #endif temp = Int64ShrlMod32(temp, 1); u++; } if (u) { // Scale to fit const unsigned round = 1 << (u-1); SetFPS( (unsigned)Int64ShrlMod32(numerator + round, u), (unsigned)Int64ShrlMod32(denominator + round, u) ); } else { fps_numerator = (unsigned)numerator; fps_denominator = (unsigned)denominator; } } // Test for same colorspace bool IsSameColorspace(const VideoInfo& vi) const { if (vi.pixel_type == pixel_type) return TRUE; if (IsYV12() && vi.IsYV12()) return TRUE; return FALSE; } }; // VideoFrameBuffer holds information about a memory block which is used // for video data. For efficiency, instances of this class are not deleted // when the refcount reaches zero; instead they're stored in a linked list // to be reused. The instances are deleted when the corresponding AVS // file is closed. class VideoFrameBuffer { BYTE* const data; const int data_size; // sequence_number is incremented every time the buffer is changed, so // that stale views can tell they're no longer valid. long sequence_number; friend class VideoFrame; friend class Cache; friend class ScriptEnvironment; long refcount; public: VideoFrameBuffer(int size); VideoFrameBuffer(); ~VideoFrameBuffer(); const BYTE* GetReadPtr() const { return data; } BYTE* GetWritePtr() { ++sequence_number; return data; } int GetDataSize() { return data_size; } int GetSequenceNumber() { return sequence_number; } int GetRefcount() { return refcount; } }; class IClip; class PClip; class PVideoFrame; class IScriptEnvironment; class AVSValue; // VideoFrame holds a "window" into a VideoFrameBuffer. Operator new // is overloaded to recycle class instances. class VideoFrame { int refcount; VideoFrameBuffer* const vfb; const int offset, pitch, row_size, height, offsetU, offsetV, pitchUV; // U&V offsets are from top of picture. friend class PVideoFrame; void AddRef() { InterlockedIncrement((long *)&refcount); } void Release() { if (refcount==1) InterlockedDecrement(&vfb->refcount); InterlockedDecrement((long *)&refcount); } friend class ScriptEnvironment; friend class Cache; VideoFrame(VideoFrameBuffer* _vfb, int _offset, int _pitch, int _row_size, int _height); VideoFrame(VideoFrameBuffer* _vfb, int _offset, int _pitch, int _row_size, int _height, int _offsetU, int _offsetV, int _pitchUV); void* operator new(size_t size); // TESTME: OFFSET U/V may be switched to what could be expected from AVI standard! public: int GetPitch() const { return pitch; } int GetPitch(int plane) const { switch (plane) {case PLANAR_U: case PLANAR_V: return pitchUV;} return pitch; } int GetRowSize() const { return row_size; } int GetRowSize(int plane) const { switch (plane) { case PLANAR_U: case PLANAR_V: if (pitchUV) return row_size>>1; else return 0; case PLANAR_U_ALIGNED: case PLANAR_V_ALIGNED: if (pitchUV) { int r = ((row_size+FRAME_ALIGN-1)&(~(FRAME_ALIGN-1)) )>>1; // Aligned rowsize if (r<=pitchUV) return r; return row_size>>1; } else return 0; case PLANAR_Y_ALIGNED: int r = (row_size+FRAME_ALIGN-1)&(~(FRAME_ALIGN-1)); // Aligned rowsize if (r<=pitch) return r; return row_size; } return row_size; } int GetHeight() const { return height; } int GetHeight(int plane) const { switch (plane) {case PLANAR_U: case PLANAR_V: if (pitchUV) return height>>1; return 0;} return height; } // generally you shouldn't use these three VideoFrameBuffer* GetFrameBuffer() const { return vfb; } int GetOffset() const { return offset; } int GetOffset(int plane) const { switch (plane) {case PLANAR_U: return offsetU;case PLANAR_V: return offsetV;default: return offset;}; } // in plugins use env->SubFrame() VideoFrame* Subframe(int rel_offset, int new_pitch, int new_row_size, int new_height) const; VideoFrame* Subframe(int rel_offset, int new_pitch, int new_row_size, int new_height, int rel_offsetU, int rel_offsetV, int pitchUV) const; const BYTE* GetReadPtr() const { return vfb->GetReadPtr() + offset; } const BYTE* GetReadPtr(int plane) const { return vfb->GetReadPtr() + GetOffset(plane); } bool IsWritable() const { return (refcount == 1 && vfb->refcount == 1); } BYTE* GetWritePtr() const { if (vfb->GetRefcount()>1) { _ASSERT(FALSE); //throw AvisynthError("Internal Error - refcount was more than one!"); } return IsWritable() ? (vfb->GetWritePtr() + offset) : 0; } BYTE* GetWritePtr(int plane) const { if (plane==PLANAR_Y) { if (vfb->GetRefcount()>1) { _ASSERT(FALSE); // throw AvisynthError("Internal Error - refcount was more than one!"); } return IsWritable() ? vfb->GetWritePtr() + GetOffset(plane) : 0; } return vfb->data + GetOffset(plane); } ~VideoFrame() { InterlockedDecrement(&vfb->refcount); } }; enum { CACHE_NOTHING=0, CACHE_RANGE=1, CACHE_ALL=2, CACHE_AUDIO=3, CACHE_AUDIO_NONE=4 }; // Base class for all filters. class IClip { friend class PClip; friend class AVSValue; int refcnt; void AddRef() { InterlockedIncrement((long *)&refcnt); } void Release() { InterlockedDecrement((long *)&refcnt); if (!refcnt) delete this; } public: IClip() : refcnt(0) {} virtual int __stdcall GetVersion() { return AVISYNTH_INTERFACE_VERSION; } virtual PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env) = 0; virtual bool __stdcall GetParity(int n) = 0; // return field parity if field_based, else parity of first field in frame virtual void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env) = 0; // start and count are in samples virtual void __stdcall SetCacheHints(int cachehints,int frame_range) = 0 ; // We do not pass cache requests upwards, only to the next filter. virtual const VideoInfo& __stdcall GetVideoInfo() = 0; virtual __stdcall ~IClip() {} }; // smart pointer to IClip class PClip { IClip* p; IClip* GetPointerWithAddRef() const { if (p) p->AddRef(); return p; } friend class AVSValue; friend class VideoFrame; void Init(IClip* x) { if (x) x->AddRef(); p=x; } void Set(IClip* x) { if (x) x->AddRef(); if (p) p->Release(); p=x; } public: PClip() { p = 0; } PClip(const PClip& x) { Init(x.p); } PClip(IClip* x) { Init(x); } void operator=(IClip* x) { Set(x); } void operator=(const PClip& x) { Set(x.p); } IClip* operator->() const { return p; } // useful in conditional expressions operator void*() const { return p; } bool operator!() const { return !p; } ~PClip() { if (p) p->Release(); } }; // smart pointer to VideoFrame class PVideoFrame { VideoFrame* p; void Init(VideoFrame* x) { if (x) x->AddRef(); p=x; } void Set(VideoFrame* x) { if (x) x->AddRef(); if (p) p->Release(); p=x; } public: PVideoFrame() { p = 0; } PVideoFrame(const PVideoFrame& x) { Init(x.p); } PVideoFrame(VideoFrame* x) { Init(x); } void operator=(VideoFrame* x) { Set(x); } void operator=(const PVideoFrame& x) { Set(x.p); } VideoFrame* operator->() const { return p; } // for conditional expressions operator void*() const { return p; } bool operator!() const { return !p; } ~PVideoFrame() { if (p) p->Release();} }; class AVSValue { public: AVSValue() { type = 'v'; } AVSValue(IClip* c) { type = 'c'; clip = c; if (c) c->AddRef(); } AVSValue(const PClip& c) { type = 'c'; clip = c.GetPointerWithAddRef(); } AVSValue(bool b) { type = 'b'; boolean = b; } AVSValue(int i) { type = 'i'; integer = i; } // AVSValue(__int64 l) { type = 'l'; longlong = l; } AVSValue(float f) { type = 'f'; floating_pt = f; } AVSValue(double f) { type = 'f'; floating_pt = float(f); } AVSValue(const char* s) { type = 's'; string = s; } AVSValue(const AVSValue* a, int size) { type = 'a'; array = a; array_size = size; } AVSValue(const AVSValue& v) { Assign(&v, true); } ~AVSValue() { if (IsClip() && clip) clip->Release(); } AVSValue& operator=(const AVSValue& v) { Assign(&v, false); return *this; } // Note that we transparently allow 'int' to be treated as 'float'. // There are no int<->bool conversions, though. bool Defined() const { return type != 'v'; } bool IsClip() const { return type == 'c'; } bool IsBool() const { return type == 'b'; } bool IsInt() const { return type == 'i'; } // bool IsLong() const { return (type == 'l'|| type == 'i'); } bool IsFloat() const { return type == 'f' || type == 'i'; } bool IsString() const { return type == 's'; } bool IsArray() const { return type == 'a'; } PClip AsClip() const { _ASSERTE(IsClip()); return IsClip()?clip:0; } bool AsBool() const { _ASSERTE(IsBool()); return boolean; } int AsInt() const { _ASSERTE(IsInt()); return integer; } // int AsLong() const { _ASSERTE(IsLong()); return longlong; } const char* AsString() const { _ASSERTE(IsString()); return IsString()?string:0; } double AsFloat() const { _ASSERTE(IsFloat()); return IsInt()?integer:floating_pt; } bool AsBool(bool def) const { _ASSERTE(IsBool()||!Defined()); return IsBool() ? boolean : def; } int AsInt(int def) const { _ASSERTE(IsInt()||!Defined()); return IsInt() ? integer : def; } double AsFloat(double def) const { _ASSERTE(IsFloat()||!Defined()); return IsInt() ? integer : type=='f' ? floating_pt : def; } const char* AsString(const char* def) const { _ASSERTE(IsString()||!Defined()); return IsString() ? string : def; } int ArraySize() const { _ASSERTE(IsArray()); return IsArray()?array_size:1; } const AVSValue& operator[](int index) const { _ASSERTE(IsArray() && index>=0 && index=0 && indexIsClip() && src->clip) src->clip->AddRef(); if (!init && IsClip() && clip) clip->Release(); // make sure this copies the whole struct! ((__int32*)this)[0] = ((__int32*)src)[0]; ((__int32*)this)[1] = ((__int32*)src)[1]; } }; // instantiable null filter class GenericVideoFilter : public IClip { protected: PClip child; VideoInfo vi; public: GenericVideoFilter(PClip _child) : child(_child) { vi = child->GetVideoInfo(); } PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env) { return child->GetFrame(n, env); } void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env) { child->GetAudio(buf, start, count, env); } const VideoInfo& __stdcall GetVideoInfo() { return vi; } bool __stdcall GetParity(int n) { return child->GetParity(n); } void __stdcall SetCacheHints(int cachehints,int frame_range) { } ; // We do not pass cache requests upwards, only to the next filter. }; class AvisynthError /* exception */ { public: const char* const msg; AvisynthError(const char* _msg) : msg(_msg) {} }; /* Helper classes useful to plugin authors */ class AlignPlanar : public GenericVideoFilter { public: AlignPlanar(PClip _clip); static PClip Create(PClip clip); PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env); }; class FillBorder : public GenericVideoFilter { public: FillBorder(PClip _clip); static PClip Create(PClip clip); PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env); }; class ConvertAudio : public GenericVideoFilter /** * Helper class to convert audio to any format **/ { public: ConvertAudio(PClip _clip, int prefered_format); void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env); void __stdcall SetCacheHints(int cachehints,int frame_range); // We do pass cache requests upwards, to the cache! static PClip Create(PClip clip, int sample_type, int prefered_type); static AVSValue __cdecl Create_float(AVSValue args, void*, IScriptEnvironment*); static AVSValue __cdecl Create_32bit(AVSValue args, void*, IScriptEnvironment*); static AVSValue __cdecl Create_24bit(AVSValue args, void*, IScriptEnvironment*); static AVSValue __cdecl Create_16bit(AVSValue args, void*, IScriptEnvironment*); static AVSValue __cdecl Create_8bit(AVSValue args, void*, IScriptEnvironment*); virtual ~ConvertAudio(); private: void convertToFloat(char* inbuf, float* outbuf, char sample_type, int count); void convertToFloat_3DN(char* inbuf, float* outbuf, char sample_type, int count); void convertToFloat_SSE(char* inbuf, float* outbuf, char sample_type, int count); void convertToFloat_SSE2(char* inbuf, float* outbuf, char sample_type, int count); void convertFromFloat(float* inbuf, void* outbuf, char sample_type, int count); void convertFromFloat_3DN(float* inbuf, void* outbuf, char sample_type, int count); void convertFromFloat_SSE(float* inbuf, void* outbuf, char sample_type, int count); void convertFromFloat_SSE2(float* inbuf, void* outbuf, char sample_type, int count); __inline int Saturate_int8(float n); __inline short Saturate_int16(float n); __inline int Saturate_int24(float n); __inline int Saturate_int32(float n); char src_format; char dst_format; int src_bps; char *tempbuffer; SFLOAT *floatbuffer; int tempbuffer_size; }; // For GetCPUFlags. These are backwards-compatible with those in VirtualDub. enum { /* slowest CPU to support extension */ CPUF_FORCE = 0x01, // N/A CPUF_FPU = 0x02, // 386/486DX CPUF_MMX = 0x04, // P55C, K6, PII CPUF_INTEGER_SSE = 0x08, // PIII, Athlon CPUF_SSE = 0x10, // PIII, Athlon XP/MP CPUF_SSE2 = 0x20, // PIV, Hammer CPUF_3DNOW = 0x40, // K6-2 CPUF_3DNOW_EXT = 0x80, // Athlon CPUF_X86_64 = 0xA0, // Hammer (note: equiv. to 3DNow + SSE2, which only Hammer // will have anyway) CPUF_SSE3 = 0x100, // Some P4 & Athlon 64. }; #define MAX_INT 0x7fffffff #define MIN_INT -0x7fffffff class IScriptEnvironment { public: virtual __stdcall ~IScriptEnvironment() {} virtual /*static*/ long __stdcall GetCPUFlags() = 0; virtual char* __stdcall SaveString(const char* s, int length = -1) = 0; virtual char* __stdcall Sprintf(const char* fmt, ...) = 0; // note: val is really a va_list; I hope everyone typedefs va_list to a pointer virtual char* __stdcall VSprintf(const char* fmt, void* val) = 0; __declspec(noreturn) virtual void __stdcall ThrowError(const char* fmt, ...) = 0; class NotFound /*exception*/ {}; // thrown by Invoke and GetVar typedef AVSValue (__cdecl *ApplyFunc)(AVSValue args, void* user_data, IScriptEnvironment* env); virtual void __stdcall AddFunction(const char* name, const char* params, ApplyFunc apply, void* user_data) = 0; virtual bool __stdcall FunctionExists(const char* name) = 0; virtual AVSValue __stdcall Invoke(const char* name, const AVSValue args, const char** arg_names=0) = 0; virtual AVSValue __stdcall GetVar(const char* name) = 0; virtual bool __stdcall SetVar(const char* name, const AVSValue& val) = 0; virtual bool __stdcall SetGlobalVar(const char* name, const AVSValue& val) = 0; virtual void __stdcall PushContext(int level=0) = 0; virtual void __stdcall PopContext() = 0; // align should be 4 or 8 virtual PVideoFrame __stdcall NewVideoFrame(const VideoInfo& vi, int align=FRAME_ALIGN) = 0; virtual bool __stdcall MakeWritable(PVideoFrame* pvf) = 0; virtual /*static*/ void __stdcall BitBlt(BYTE* dstp, int dst_pitch, const BYTE* srcp, int src_pitch, int row_size, int height) = 0; typedef void (__cdecl *ShutdownFunc)(void* user_data, IScriptEnvironment* env); virtual void __stdcall AtExit(ShutdownFunc function, void* user_data) = 0; virtual void __stdcall CheckVersion(int version = AVISYNTH_INTERFACE_VERSION) = 0; virtual PVideoFrame __stdcall Subframe(PVideoFrame src, int rel_offset, int new_pitch, int new_row_size, int new_height) = 0; virtual int __stdcall SetMemoryMax(int mem) = 0; virtual int __stdcall SetWorkingDir(const char * newdir) = 0; virtual void* __stdcall ManageCache(int key, void* data) = 0; enum PlanarChromaAlignmentMode { PlanarChromaAlignmentOff, PlanarChromaAlignmentOn, PlanarChromaAlignmentTest }; virtual bool __stdcall PlanarChromaAlignment(PlanarChromaAlignmentMode key) = 0; virtual PVideoFrame __stdcall SubframePlanar(PVideoFrame src, int rel_offset, int new_pitch, int new_row_size, int new_height, int rel_offsetU, int rel_offsetV, int new_pitchUV) = 0; }; // avisynth.dll exports this; it's a way to use it as a library, without // writing an AVS script or without going through AVIFile. IScriptEnvironment* __stdcall CreateScriptEnvironment(int version = AVISYNTH_INTERFACE_VERSION); #pragma pack(pop) #endif //__AVISYNTH_H__ subprojects/csri/frontends/avisynth25/Makefile.am0000664000175000017500000000062514741067256021442 0ustar aniolaniolif BUILD_MINGW AM_CPPFLAGS = \ -I$(top_srcdir)/include lib_LTLIBRARIES = csri_avs.la csri_avs_la_SOURCES = avisynth.cpp csri_avs_la_LIBADD = \ ../../lib/libcsri_la-enumerate.lo \ ../../lib/libcsri_la-list.lo \ ../../lib/libcsri_la-wrap.lo \ ../../subhelp/libsubhelp_la-logging.lo csri_avs_la_LDFLAGS = -avoid-version -no-undefined -module endif noinst_HEADERS = avisynth.h EXTRA_DIST = avisynth.cpp subprojects/csri/frontends/Makefile.am0000664000175000017500000000004414741067256017421 0ustar aniolaniolSUBDIRS = \ avisynth25 \ cmdline subprojects/csri/LICENSE0000664000175000017500000000257114741067256014377 0ustar aniolaniolCopyright (c) 2007, David Lamparter 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. * The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE subprojects/csri/meson.build0000664000175000017500000000111614741067256015526 0ustar aniolaniolproject('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) subprojects/csri/lib/0000775000175000017500000000000014741067256014133 5ustar aniolaniolsubprojects/csri/lib/win32/0000775000175000017500000000000014741067256015075 5ustar aniolaniolsubprojects/csri/lib/win32/enumerate.c0000664000175000017500000001167614741067256017241 0ustar aniolaniol/***************************************************************************** * asa: portable digital subtitle renderer ***************************************************************************** * Copyright (C) 2007 David Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ #include #include #include #include #include "../csrilib.h" #include "subhelp.h" static void csrilib_enum_dir(const wchar_t *dir); static const char *get_errstr() { static char msg[2048]; DWORD err = GetLastError(); if (!FormatMessageA( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, 0, msg, sizeof(msg), NULL)) strcpy(msg, "Unknown Error"); else { size_t msglen = strlen(msg) - 1; if (msg[msglen] == '\n') msg[msglen] = '\0'; } return msg; } static void csrilib_add(csri_rend *rend, const struct csri_wrap_rend *tmp, struct csri_info *info) { struct csri_wrap_rend *wrend = (struct csri_wrap_rend *) malloc(sizeof(struct csri_wrap_rend)); if (!wrend) return; memcpy(wrend, tmp, sizeof(struct csri_wrap_rend)); wrend->rend = rend; wrend->info = info; csrilib_rend_initadd(wrend); } static void csrilib_do_load(const wchar_t *filename) { HMODULE dlhandle = LoadLibraryExW(filename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); struct csri_wrap_rend tmp; csri_rend *rend; struct csri_info *(*renderer_info)(csri_rend *rend); csri_rend *(*renderer_default)(); csri_rend *(*renderer_next)(csri_rend *prev); const char *sym; if (!dlhandle) { subhelp_log(CSRI_LOG_WARNING, "LoadLibraryEx(\"%ls\") failed: " "%s", filename, get_errstr()); return; } if (GetProcAddress(dlhandle, "csri_library")) { subhelp_log(CSRI_LOG_WARNING, "ignoring library %ls", filename); goto out_freelib; } subhelp_log(CSRI_LOG_INFO, "loading %ls", filename); tmp.os.dlhandle = dlhandle; /* okay, this is uber-ugly. either I end up casting from void * * to a fptr (which yields a cast warning), or I do a *(void **)&tmp.x * (which yields a strict-aliasing warning). * casting via char* works because char* can alias anything. */ #define _dl_map_function(x, dst) do { \ char *t1 = (char *)&dst; \ union x { FARPROC ptr; } *ptr = (union x *)t1; \ sym = "csri_" # x; \ ptr->ptr = GetProcAddress(dlhandle, sym);\ if (!ptr->ptr) goto out_dlfail; } while (0) #define dl_map_function(x) _dl_map_function(x, tmp.x) dl_map_function(query_ext); subhelp_logging_pass((struct csri_logging_ext *) tmp.query_ext(NULL, CSRI_EXT_LOGGING)); dl_map_function(open_file); dl_map_function(open_mem); dl_map_function(close); dl_map_function(request_fmt); dl_map_function(render); #define dl_map_local(x) _dl_map_function(x, x) dl_map_local(renderer_info); dl_map_local(renderer_default); dl_map_local(renderer_next); rend = renderer_default(); while (rend) { csrilib_add(rend, &tmp, renderer_info(rend)); rend = renderer_next(rend); } return; out_dlfail: subhelp_log(CSRI_LOG_WARNING, "%ls: symbol %s not found (%s)", filename, sym, get_errstr()); out_freelib: FreeLibrary(dlhandle); } static void csrilib_load(const wchar_t *filename) { DWORD attr = GetFileAttributesW(filename); if (attr == INVALID_FILE_ATTRIBUTES) return; if (attr & FILE_ATTRIBUTE_DIRECTORY) { csrilib_enum_dir(filename); return; } csrilib_do_load(filename); } static void csrilib_enum_dir(const wchar_t *dir) { WIN32_FIND_DATAW data; HANDLE res; wchar_t buf[MAX_PATH]; _snwprintf(buf, sizeof(buf) / sizeof(buf[0]), L"%ls\\*", dir); res = FindFirstFileW(buf, &data); if (res == INVALID_HANDLE_VALUE) { subhelp_log(CSRI_LOG_WARNING, "ignoring directory \"%ls\": %s", dir, get_errstr()); return; } subhelp_log(CSRI_LOG_INFO, "scanning directory \"%ls\"", dir); do { if (data.cFileName[0] == '.') continue; _snwprintf(buf, sizeof(buf) / sizeof(buf[0]), L"%ls\\%ls", dir, data.cFileName); csrilib_load(buf); } while (FindNextFileW(res, &data)); FindClose(res); } void csrilib_os_init() { wchar_t filename[MAX_PATH], *slash; DWORD rv = GetModuleFileNameW(NULL, filename, MAX_PATH); if (!rv) *filename = L'\0'; slash = wcsrchr(filename, L'\\'); slash = slash ? slash + 1 : filename; *slash = L'\0'; wcsncpy(slash, L"csri", filename + MAX_PATH - slash); csrilib_enum_dir(filename); } subprojects/csri/lib/win32/csrilib_os.h0000664000175000017500000000211514741067256017375 0ustar aniolaniol/***************************************************************************** * asa: portable digital subtitle renderer ***************************************************************************** * Copyright (C) 2007 David Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ #include struct csrilib_os { HMODULE dlhandle; }; subprojects/csri/lib/Makefile.am0000664000175000017500000000070614741067256016172 0ustar aniolaniolif BUILD_MINGW PLATF = win32 else PLATF = posix AM_CPPFLAGS = -DCSRI_PATH="\"$(csri_path)\"" endif lib_LTLIBRARIES = libcsri.la noinst_HEADERS = csrilib.h posix/csrilib_os.h win32/csrilib_os.h libcsri_la_SOURCES = list.c wrap.c $(PLATF)/enumerate.c libcsri_la_CFLAGS = -I$(top_srcdir)/lib/posix -I$(top_srcdir)/include libcsri_la_LIBADD = ../subhelp/libsubhelp_la-logging.lo libcsri_la_LDFLAGS = -static EXTRA_DIST = posix/enumerate.c win32/enumerate.c subprojects/csri/lib/posix/0000775000175000017500000000000014741067256015275 5ustar aniolaniolsubprojects/csri/lib/posix/enumerate.c0000664000175000017500000001227414741067256017434 0ustar aniolaniol/***************************************************************************** * asa: portable digital subtitle renderer ***************************************************************************** * Copyright (C) 2007 David Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ #define _POSIX_C_SOURCE 200112L /* for PATH_MAX */ #include #include #include #include #include #include #include #include #include #include #include "../csrilib.h" #include "subhelp.h" static const char csri_path[] = CSRI_PATH; static void csrilib_enum_dir(const char *dir); static void csrilib_add(csri_rend *rend, const struct csri_wrap_rend *tmp, struct csri_info *info) { struct csri_wrap_rend *wrend = (struct csri_wrap_rend *) malloc(sizeof(struct csri_wrap_rend)); if (!wrend) return; memcpy(wrend, tmp, sizeof(struct csri_wrap_rend)); wrend->rend = rend; wrend->info = info; csrilib_rend_initadd(wrend); } static void csrilib_do_load(const char *filename, dev_t device, ino_t inode) { void *dlhandle = dlopen(filename, RTLD_NOW); struct csri_wrap_rend tmp; csri_rend *rend; struct csri_info *(*renderer_info)(csri_rend *rend); csri_rend *(*renderer_default)(); csri_rend *(*renderer_next)(csri_rend *prev); const char *sym; if (!dlhandle) { subhelp_log(CSRI_LOG_WARNING, "dlopen(\"%s\") says: %s", filename, dlerror()); return; } if (dlsym(dlhandle, "csri_library")) { subhelp_log(CSRI_LOG_WARNING, "ignoring library %s", filename); return; } subhelp_log(CSRI_LOG_INFO, "loading %s", filename); tmp.os.dlhandle = dlhandle; tmp.os.device = device; tmp.os.inode = inode; /* okay, this is uber-ugly. either I end up casting from void * * to a fptr (which yields a cast warning), or I do a *(void **)&tmp.x * (which yields a strict-aliasing warning). * casting via char* works because char* can alias anything. */ #define _dl_map_function(x, dst) do { \ char *t1 = (char *)&dst; \ union x { void *ptr; } *ptr = (union x *)t1; \ sym = "csri_" # x; \ ptr->ptr = dlsym(dlhandle, sym);\ if (!ptr->ptr) goto out_dlfail; } while (0) #define dl_map_function(x) _dl_map_function(x, tmp.x) dl_map_function(query_ext); subhelp_logging_pass((struct csri_logging_ext *) tmp.query_ext(NULL, CSRI_EXT_LOGGING)); dl_map_function(open_file); dl_map_function(open_mem); dl_map_function(close); dl_map_function(request_fmt); dl_map_function(render); #define dl_map_local(x) _dl_map_function(x, x) dl_map_local(renderer_info); dl_map_local(renderer_default); dl_map_local(renderer_next); rend = renderer_default(); while (rend) { csrilib_add(rend, &tmp, renderer_info(rend)); rend = renderer_next(rend); } return; out_dlfail: subhelp_log(CSRI_LOG_WARNING, "%s: symbol %s not found (%s)", filename, sym, dlerror()); dlclose(dlhandle); } static void csrilib_load(const char *filename) { struct csri_wrap_rend *rend; struct stat st; if (stat(filename, &st)) return; if (S_ISDIR(st.st_mode)) { csrilib_enum_dir(filename); return; } if (!S_ISREG(st.st_mode)) return; if (access(filename, X_OK)) return; for (rend = wraprends; rend; rend = rend->next) if (rend->os.device == st.st_dev && rend->os.inode == st.st_ino) return; csrilib_do_load(filename, st.st_dev, st.st_ino); } static void csrilib_enum_dir(const char *dir) { DIR *dirh; struct dirent *e; char buf[PATH_MAX]; dirh = opendir(dir); if (!dirh) { subhelp_log(CSRI_LOG_WARNING, "ignoring directory \"%s\":" " %s (%d)", dir, strerror(errno), errno); return; } subhelp_log(CSRI_LOG_INFO, "scanning directory \"%s\"", dir); while ((e = readdir(dirh))) { if (e->d_name[0] == '.') continue; snprintf(buf, sizeof(buf), "%s/%s", dir, e->d_name); csrilib_load(buf); } closedir(dirh); } static void csrilib_expand_enum_dir(const char *dir) { if (dir[0] == '~' && (dir[1] == '\0' || dir[1] == '/')) { char buf[PATH_MAX], *home = getenv("HOME"); if (!home) home = ""; snprintf(buf, sizeof(buf), "%s%s", home, dir + 1); csrilib_enum_dir(buf); } else csrilib_enum_dir(dir); } void csrilib_os_init() { char buf[4096]; char *envpath = getenv("CSRI_PATH"); char *pos, *next = buf; if (envpath) snprintf(buf, sizeof(buf), "%s:%s", csri_path, envpath); else { strncpy(buf, csri_path, sizeof(buf)); buf[sizeof(buf) - 1] = '\0'; } do { pos = next; next = strchr(pos, ':'); if (next) *next++ = '\0'; csrilib_expand_enum_dir(pos); } while (next); } subprojects/csri/lib/posix/csrilib_os.h0000664000175000017500000000215214741067256017576 0ustar aniolaniol/***************************************************************************** * asa: portable digital subtitle renderer ***************************************************************************** * Copyright (C) 2007 David Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ #include struct csrilib_os { void *dlhandle; dev_t device; ino_t inode; }; subprojects/csri/lib/list.c0000664000175000017500000000724014741067256015255 0ustar aniolaniol/***************************************************************************** * asa: portable digital subtitle renderer ***************************************************************************** * Copyright (C) 2007 David Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ #include #include #include #include #include "csrilib.h" struct csri_wrap_rend *wraprends = NULL; struct csri_wrap_rend *csrilib_rend_lookup(csri_rend *rend) { struct csri_wrap_rend *wrap = wraprends; for (; wrap; wrap = wrap->next) if (wrap->rend == rend) return wrap; return NULL; } #define INSTHASHSZ 256 #define HASH(x) (((intptr_t)(x) & 0xff00) >> 8) static struct csri_wrap_inst *wrapinsts[INSTHASHSZ]; struct csri_wrap_inst *csrilib_inst_lookup(csri_inst *inst) { struct csri_wrap_inst *ent = wrapinsts[HASH(inst)]; while (ent && ent->inst != inst) ent = ent->next; return ent; } csri_inst *csrilib_inst_initadd(struct csri_wrap_rend *wrend, csri_inst *inst) { struct csri_wrap_inst *winst = (struct csri_wrap_inst *) malloc(sizeof(struct csri_wrap_inst)), **pnext; if (!winst) { wrend->close(inst); return NULL; } winst->wrend = wrend; winst->inst = inst; winst->close = wrend->close; winst->request_fmt = wrend->request_fmt; winst->render = wrend->render; winst->next = NULL; pnext = &wrapinsts[HASH(inst)]; while (*pnext) pnext = &(*pnext)->next; *pnext = winst; return inst; } void csrilib_inst_remove(struct csri_wrap_inst *winst) { struct csri_wrap_inst **pnext = &wrapinsts[HASH(winst->inst)]; while (*pnext && *pnext != winst) pnext = &(*pnext)->next; if (!*pnext) return; *pnext = (*pnext)->next; free(winst); } void csrilib_rend_initadd(struct csri_wrap_rend *wrend) { wrend->next = wraprends; wraprends = wrend; } static int initialized = 0; csri_rend *csri_renderer_default() { if (!initialized) { csrilib_os_init(); initialized = 1; } if (!wraprends) return NULL; return wraprends->rend; } csri_rend *csri_renderer_next(csri_rend *prev) { struct csri_wrap_rend *wrend = csrilib_rend_lookup(prev); if (!wrend || !wrend->next) return NULL; return wrend->next->rend; } csri_rend *csri_renderer_byname(const char *name, const char *specific) { struct csri_wrap_rend *wrend; if (!initialized) { csrilib_os_init(); initialized = 1; } if (!name) return NULL; for (wrend = wraprends; wrend; wrend = wrend->next) { if (strcmp(wrend->info->name, name)) continue; if (specific && strcmp(wrend->info->specific, specific)) continue; return wrend->rend; } return NULL; } csri_rend *csri_renderer_byext(unsigned n_ext, csri_ext_id *ext) { struct csri_wrap_rend *wrend; unsigned i; if (!initialized) { csrilib_os_init(); initialized = 1; } for (wrend = wraprends; wrend; wrend = wrend->next) { for (i = 0; i < n_ext; i++) { if (!wrend->query_ext(wrend->rend, ext[i])) break; } if (i == n_ext) return wrend->rend; } return NULL; } subprojects/csri/lib/wrap.c0000664000175000017500000000670614741067256015261 0ustar aniolaniol/***************************************************************************** * asa: portable digital subtitle renderer ***************************************************************************** * Copyright (C) 2007 David Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ #include "csrilib.h" #include "subhelp.h" #include csri_inst *csri_open_file(csri_rend *rend, const char *filename, struct csri_openflag *flags) { struct csri_wrap_rend *wrend = csrilib_rend_lookup(rend); if (!wrend) return NULL; return csrilib_inst_initadd(wrend, wrend->open_file(rend, filename, flags)); } #define instance_wrapper(wrapname, funcname) \ csri_inst *wrapname(csri_rend *rend, \ const void *data, size_t length, struct csri_openflag *flags) \ { \ struct csri_wrap_rend *wrend = csrilib_rend_lookup(rend); \ if (!wrend) \ return NULL; \ return csrilib_inst_initadd(wrend, \ wrend->funcname(rend, data, length, flags)); \ } instance_wrapper(csri_open_mem, open_mem) static instance_wrapper(wrap_init_stream_ass, init_stream_ass) static instance_wrapper(wrap_init_stream_text, init_stream_text) void *csri_query_ext(csri_rend *rend, csri_ext_id extname) { struct csri_wrap_rend *wrend; void *rv; if (!rend && (rv = subhelp_query_ext_logging(extname))) return rv; wrend = csrilib_rend_lookup(rend); if (!wrend) return NULL; rv = wrend->query_ext(rend, extname); if (rv && !strcmp(extname, CSRI_EXT_STREAM_ASS)) { struct csri_stream_ext *e = (struct csri_stream_ext *)rv; memcpy(&wrend->stream_ass, e, sizeof(*e)); wrend->init_stream_ass = e->init_stream; wrend->stream_ass.init_stream = wrap_init_stream_ass; return &wrend->stream_ass; } if (rv && !strcmp(extname, CSRI_EXT_STREAM_TEXT)) { struct csri_stream_ext *e = (struct csri_stream_ext *)rv; memcpy(&wrend->stream_text, e, sizeof(*e)); wrend->init_stream_text = e->init_stream; wrend->stream_text.init_stream = wrap_init_stream_text; return &wrend->stream_text; } return rv; } struct csri_info *csri_renderer_info(csri_rend *rend) { struct csri_wrap_rend *wrend = csrilib_rend_lookup(rend); if (!wrend) return NULL; return wrend->info; } void csri_close(csri_inst *inst) { struct csri_wrap_inst *winst = csrilib_inst_lookup(inst); if (!winst) return; winst->close(inst); csrilib_inst_remove(winst); } int csri_request_fmt(csri_inst *inst, const struct csri_fmt *fmt) { struct csri_wrap_inst *winst = csrilib_inst_lookup(inst); if (!winst) return 0; return winst->request_fmt(inst, fmt); } void csri_render(csri_inst *inst, struct csri_frame *frame, double time) { struct csri_wrap_inst *winst = csrilib_inst_lookup(inst); if (!winst) return; winst->render(inst, frame, time); } const char *csri_library() { return "DEV"; } subprojects/csri/lib/csrilib.h0000664000175000017500000000544014741067256015736 0ustar aniolaniol/***************************************************************************** * asa: portable digital subtitle renderer ***************************************************************************** * Copyright (C) 2007 David Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ #ifndef _CSRILIB_H #define _CSRILIB_H #ifdef HAVE_CONFIG_H #include "acconf.h" #endif #include "visibility.h" #define CSRIAPI export #include #include #include "csrilib_os.h" struct csri_wrap_rend { struct csri_wrap_rend *next; csri_rend *rend; csri_inst *(*open_file)(csri_rend *renderer, const char *filename, struct csri_openflag *flags); csri_inst *(*open_mem)(csri_rend *renderer, const void *data, size_t length, struct csri_openflag *flags); void (*close)(csri_inst *inst); int (*request_fmt)(csri_inst *inst, const struct csri_fmt *fmt); void (*render)(csri_inst *inst, struct csri_frame *frame, double time); void *(*query_ext)(csri_rend *rend, csri_ext_id extname); struct csri_stream_ext stream_ass, stream_text; csri_inst *(*init_stream_ass)(csri_rend *renderer, const void *header, size_t headerlen, struct csri_openflag *flags); csri_inst *(*init_stream_text)(csri_rend *renderer, const void *header, size_t headerlen, struct csri_openflag *flags); struct csri_info *info; struct csrilib_os os; }; struct csri_wrap_inst { struct csri_wrap_inst *next; csri_inst *inst; struct csri_wrap_rend *wrend; void (*close)(csri_inst *inst); int (*request_fmt)(csri_inst *inst, const struct csri_fmt *fmt); void (*render)(csri_inst *inst, struct csri_frame *frame, double time); }; extern struct csri_wrap_rend *wraprends; extern struct csri_wrap_rend *csrilib_rend_lookup(csri_rend *rend); extern void csrilib_rend_initadd(struct csri_wrap_rend *wrend); extern struct csri_wrap_inst *csrilib_inst_lookup(csri_inst *inst); extern csri_inst *csrilib_inst_initadd(struct csri_wrap_rend *wrend, csri_inst *inst); extern void csrilib_inst_remove(struct csri_wrap_inst *winst); extern void csrilib_os_init(); #endif /*_CSRILIB_H */ subprojects/csri/bootstrap0000664000175000017500000000004514741067256015324 0ustar aniolaniol#!/bin/bash -x autoreconf -f -i -s subprojects/csri/csri.pc.in0000664000175000017500000000034114741067256015254 0ustar aniolaniolprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: csri Description: csri - common subtitle renderer interface Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lcsri Cflags: -I${includedir} subprojects/csri/Doxyfile0000664000175000017500000000104414741067256015072 0ustar aniolaniolPROJECT_NAME = CSRI PROJECT_NUMBER = 0.1 OUTPUT_DIRECTORY = doc JAVADOC_AUTOBRIEF = YES OPTIMIZE_OUTPUT_FOR_C = YES PREDEFINED = DOXYGEN ENUM_VALUES_PER_LINE = 1 EXPAND_AS_DEFINED = _CSRI_H _CSRI_HELPER_H INPUT = include/csri include/subhelp.h FILE_PATTERNS = *.h RECURSIVE = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html GENERATE_MAN = YES MAN_OUTPUT = man MAN_EXTENSION = .3 MAN_LINKS = NO subprojects/csri/Makefile.am0000664000175000017500000000030114741067256015413 0ustar aniolaniolAUTOMAKE_OPTIONS = foreign EXTRA_DIST = csri.pc.in acinclude.m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = csri.pc SUBDIRS = ac \ include \ subhelp \ lib \ backends \ frontends subprojects/csri/configure.ac0000664000175000017500000000645714741067256015667 0ustar aniolaniolAC_PREREQ(2.57) AC_INIT(csri, 0.1.0) AC_CONFIG_AUX_DIR(ac) AM_INIT_AUTOMAKE AC_CONFIG_HEADER([include/acconf.h]) # Checks for programs. AC_PROG_CC AC_PROG_LIBTOOL AC_C_CONST AC_C_INLINE AC_C_VOLATILE AC_PROG_INSTALL AC_CHECK_HEADERS([png.h]) AC_CHECK_LIB([z], [inflate]) AC_CHECK_LIB([m], [pow]) AC_CHECK_LIB([png], [png_init_io]) AC_CPP_PRAGMA_ONCE AC_C_FLAG([-Wall]) AC_C_FLAG([-Wextra],[AC_C_FLAG([-W])]) AC_C_FLAG([-Wno-unused-parameter]) AC_C_FLAG([-Winvalid-pch]) AC_C_FLAG([-pedantic]) AC_C_FLAG([-std=c99],[AC_C_FLAG([-c99])]) AC_ARG_ENABLE([werror], AC_HELP_STRING([--enable-werror], [compile with -Werror (for developers)]), [ if test "$enableval" == "yes" then AC_C_FLAG([-Werror]) fi]) AC_GCC_VISIBILITY([internal]) AC_PATH_XTRA platform="" case $host_os in mingw*) # LoadLibraryEx + GetProcAddress platform="win32" ;; *) AC_SEARCH_LIBS([dlopen], [dl], [], [ AC_MSG_FAILURE([dlopen not found - unsupported dynamic loader architecture / operating system]) ]) esac AM_CONDITIONAL([BUILD_MINGW], [test "$platform" == "win32" ]) # Checks for header files. AC_HEADER_STDC AC_HEADER_STDBOOL AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/time.h sys/wait.h sys/mman.h unistd.h libgen.h getopt.h]) AC_CHECK_FUNCS([getopt_long]) # # Checks for typedefs, structures, and compiler characteristics. # Checks for library functions. #AC_FUNC_FORK #AC_PROG_GCC_TRADITIONAL AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SIGNAL AC_FUNC_MEMCMP AC_CHECK_FUNCS([memset strdup strerror strtoul]) AC_ARG_WITH([libass],[ AS_HELP_STRING([--with-libass],[build libass backend @<:@default=auto@:>@]) ],[],[ with_libass=auto ]) libass=no AS_IF([test "$with_libass" != no],[ ac_cflags_save="$CFLAGS" ac_ldflags_save="$LDFLAGS" if test "$with_libass" != auto -a "$with_libass" != yes then LIBASS_CFLAGS="-I$with_libass/include" LIBASS_LIBS="-L$with_libass/lib -lass" else PKG_CHECK_MODULES([LIBASS], libass >= 0.9.1,[],[ AC_MSG_WARN([libass not found via pkg-config]) LIBASS_LIBS="-lass" ]) fi CFLAGS="$CFLAGS $LIBASS_CFLAGS" LDFLAGS="$LDFLAGS $LIBASS_LIBS" AC_CHECK_LIB([ass], [ass_library_init], [libass_lib="yes"]) AC_CHECK_HEADER([ass/ass.h], [libass_hdr="yes"]) if test "$libass_lib" == yes -a "$libass_hdr" == yes then libass=yes else if "$with_libass" != auto then AC_MSG_FAILURE([libass requested but not found]) fi fi CFLAGS="$ac_cflags_save" LDFLAGS="$ac_ldflags_save" ]) AM_CONDITIONAL([BUILD_LIBASS], [test "$libass" == "yes" ]) AC_SUBST([LIBASS_CFLAGS]) AC_SUBST([LIBASS_LIBS]) csrilibdir="${libdir}/csri" AC_SUBST([csrilibdir]) csri_path="${csrilibdir}:/usr/lib/csri:/usr/local/lib/csri:~/.csri/lib" AC_ARG_WITH(csri-libpath, AC_HELP_STRING([--with-csri-libpath=PATH1:PATH2], [Look for CSRI renderers in the specified directories. Separate directory names with colons. Tildes are expanded at run-time. [[$csri_path]]]), [ if test "$withval" != "yes" -a "$withval" != "" -a "$withval" != "no" then csri_path="$withval" fi ]) AC_SUBST([csri_path], ["$csri_path"]) AC_CONFIG_FILES([csri.pc]) echo "" echo " using search path: ${csri_path}" echo "building libass wrapper: ${libass}" echo "" AC_OUTPUT([ ac/Makefile include/Makefile subhelp/Makefile lib/Makefile frontends/Makefile frontends/avisynth25/Makefile frontends/cmdline/Makefile backends/Makefile backends/libass/Makefile Makefile ]) subprojects/csri/include/0000775000175000017500000000000014741067256015010 5ustar aniolaniolsubprojects/csri/include/Makefile.am0000664000175000017500000000016514741067256017046 0ustar aniolaniolnoinst_HEADERS = subhelp.h visibility.h pkginclude_HEADERS = csri/csri.h csri/openerr.h csri/logging.h csri/stream.h subprojects/csri/include/csri/0000775000175000017500000000000014741067256015750 5ustar aniolaniolsubprojects/csri/include/csri/stream.h0000664000175000017500000001162714741067256017423 0ustar aniolaniol/***************************************************************************** * csri: common subtitle renderer interface ***************************************************************************** * Copyright (C) 2007 David Lamparter * 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. * - The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ****************************************************************************/ /** \file stream.h - subtitle streaming (MKV & co). * $Id$ * * THE SPECIFICATION OF THIS EXTENSION IS TENTATIVE * AND NOT FINALIZED YET */ #ifndef _CSRI_STREAM_H /** \cond */ #define _CSRI_STREAM_H 20070119 /** \endcond */ #ifdef __cplusplus extern "C" { #endif /** \defgroup stream csri.stream.* extensions. */ /*@{*/ /** stream extension group. * note: you cannot query for csri.stream, you need * to query for one of the streaming formats instead, * which will return a csri_stream_ext pointer. */ #define CSRI_EXT_STREAM (csri_ext_id)"csri.stream" /** Matroska-style ASS streaming. * header contains standard SSA stuff, packet contains * ReadOrder,Layer,Style,Speaker,MarginL,R,V,Effect,Text */ #define CSRI_EXT_STREAM_ASS CSRI_EXT_STREAM ".ass" /** Simple text + timestamp streams */ #define CSRI_EXT_STREAM_TEXT CSRI_EXT_STREAM ".text" /* missing: USF, MPEG-4 TT */ /** stream extension information structure */ struct csri_stream_ext { /** create streaming renderer instance. * \param renderer the renderer handle. * \param header codec-private stream header. * \param headerlen byte length of header data. * \param flags openflags. * * not NULL if this extension is supported. * may take various flags like csri_openerr_flag. * * the returned instance can be used with * csri_request_fmt, csri_render and csri_close. */ csri_inst *(*init_stream)(csri_rend *renderer, const void *header, size_t headerlen, struct csri_openflag *flags); /** process a streamed packet. * \param inst instance created with init_stream. * \param packet stream packet data. * \param packetlen byte length of packet. * \param pts_start start timestamp from container. * \param pts_end end timestamp from container. * * add a single packet to the renderer instance. */ void (*push_packet)(csri_inst *inst, const void *packet, size_t packetlen, double pts_start, double pts_end); /** discard processed packets. * \param inst instance created with init_stream. * \param all discard possibly-active packets too.\n * a possibly-active packet is a packet which * has not seen a csri_render call with a pts * beyond its end timestamp yet. * * frees up memory, or can force a clean renderer. * may be NULL if unsupported, check before calling! */ void (*discard)(csri_inst *inst, int all); }; /** streaming openflag ext for controlling subtitle lifetime */ #define CSRI_EXT_STREAM_DISCARD CSRI_EXT_STREAM ".discard" /** subtitle packet lifetime */ enum csri_stream_discard { /** lifetime: timestamp expiry. * delete packets from csri_render if the current * timestamp is beyond the packet's end timestamp. * this should be the default */ CSRI_STREAM_DISCARD_TSEXPIRE = 0, /** lifetime: discard immediately. * discard all packets on returning from csri_render. */ CSRI_STREAM_DISCARD_IMMEDIATELY, /** lifetime: discard explicitly. * never discard packets, use csri_stream_ext.discard */ CSRI_STREAM_DISCARD_EXPLICIT }; /** openflag for csri_stream_ext.init_stream */ struct csri_stream_discard_flag { /** the lifetime to be used for subtitle packets */ enum csri_stream_discard lifetime; }; /*@}*/ #ifdef __cplusplus } #endif #endif /* _CSRI_STREAM_H */ subprojects/csri/include/csri/fmtids.h0000664000175000017500000000533714741067256017417 0ustar aniolaniol/***************************************************************************** * csri: common subtitle renderer interface ***************************************************************************** * Copyright (C) 2007 David Lamparter * 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. * - The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ****************************************************************************/ /** \file fmtids.h - csri.format - extension identifiers for subtitle formats. * $Id$ */ #ifndef _CSRI_FMTIDS_H /** \cond */ #define _CSRI_FMTIDS_H 20070119 /** \endcond */ #ifdef __cplusplus extern "C" { #endif /** \defgroup fmtids csri.format identifiers. * only includes the most important ones for now, more to be added. */ /*@{*/ /** SSA / ASS. Sub Station Alpha - versions 2, 3, 4, 4+ and 4++ */ #define CSRI_EXT_FMT_SSA (csri_ext_id)"csri.format.ssa" /** SRT. SubRip Text, SubRip Titles or something similar. */ #define CSRI_EXT_FMT_SRT (csri_ext_id)"csri.format.srt" /** MicroDVD */ #define CSRI_EXT_FMT_MICRODVD (csri_ext_id)"csri.format.microdvd" /** SAMI. Microsoft Synchronized Accessible Media Interchange */ #define CSRI_EXT_FMT_SAMI (csri_ext_id)"csri.format.sami" /** SMIL. W3C Synchronized Multimedia Integration Language. * NB: this format uses separate files for text streams */ #define CSRI_EXT_FMT_SMIL (csri_ext_id)"csri.format.smil" /*@}*/ #ifdef __cplusplus } #endif #endif /* _CSRI_OPENERR_H */ subprojects/csri/include/csri/openerr.h0000664000175000017500000001072314741067256017576 0ustar aniolaniol/***************************************************************************** * csri: common subtitle renderer interface ***************************************************************************** * Copyright (C) 2007 David Lamparter * 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. * - The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ****************************************************************************/ /** \file openerr.h - csri.openerr - error return extension. * $Id$ */ #ifndef _CSRI_OPENERR_H /** \cond */ #define _CSRI_OPENERR_H 20070119 /** \endcond */ #ifdef __cplusplus extern "C" { #endif /** \defgroup openerr csri.openerr extension. */ /*@{*/ /** extension identifier */ #define CSRI_EXT_OPENERR (csri_ext_id)"csri.openerr" /** flag field describing which fields of #csri_openerr_flag are valid */ enum csri_openerr_flags { /** support indicator. * set if the structure was filled with any meaningful data */ CSRI_OPENERR_FILLED = (1 << 0), /** csri_openerr_flag.posixerrno valid */ CSRI_OPENERR_ERRNO = (1 << 1), /** csri_openerr_flag.winerr valid */ CSRI_OPENERR_WINERR = (1 << 2), /** csri_openerr_flag.custerr valid */ CSRI_OPENERR_CUSTERR = (1 << 3), /** csri_openerr_flag.warncount valid */ CSRI_OPENERR_WARNCOUNT = (1 << 4) }; /** returned error information. * to be passed via csri_vardata.otherval as an openflag with * extension ID #CSRI_EXT_OPENERR. * * Memory management by caller. * * The three error fields should only be filled when csri_open_file() * / csri_open_mem() returned NULL. The warning counter can indicate * information on successfully loaded scripts. */ struct csri_openerr_flag { /** bitfield of valid information */ enum csri_openerr_flags flags; /** posix errno value indicating the error occured */ int posixerrno; /** Windows GetLastError value */ unsigned winerr; /** renderer-specific custom error value. * should be string-lookupable via csri_openerr_ext.strerror * (csri_query_ext()) */ union csri_vardata custerr; /** warning count. * The number of (renderer-specific) warnings that occured * during loading the script. The content of these warnings * should be retrievable via a renderer-specific extension. */ unsigned warncount; }; /** openerr extension information structure */ struct csri_openerr_ext { /** csri_openerr_flag.custerr to string lookup. * \param renderer the renderer handle. * \param custerr renderer-specific error * \param buffer buffer to fill with an UTF-8 error message. * may be NULL; in that case only size is filled in * \param size buffer size.\n * in: maximum bytes to write to buffer, in bytes, * including terminating \\0.\nthe renderer MUST always * zero-terminate this, even when the space is not sufficient * \n\n * out: number of bytes (including terminating \\0) needed * to return the full error message * * This function pointer may be NULL if the renderer does not * return custom error codes. #CSRI_OPENERR_CUSTERR must not be * used in that case. */ void (*strerror)(csri_rend *renderer, union csri_vardata custerr, char *buffer, size_t *size); }; /*@}*/ #ifdef __cplusplus } #endif #endif /* _CSRI_OPENERR_H */ subprojects/csri/include/csri/logging.h0000664000175000017500000000520614741067256017552 0ustar aniolaniol/***************************************************************************** * csri: common subtitle renderer interface ***************************************************************************** * Copyright (C) 2007 David Lamparter * 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. * - The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ****************************************************************************/ /** \file logging.h - csri.logging - logging for renderers via callback. * $Id$ * * THE SPECIFICATION OF THIS EXTENSION IS TENTATIVE * AND NOT FINALIZED YET */ #ifndef _CSRI_LOGGING_H /** \cond */ #define _CSRI_LOGGING_H 20070119 /** \endcond */ #ifdef __cplusplus extern "C" { #endif /** \defgroup logging csri.logging extension. * THE SPECIFICATION OF THIS EXTENSION IS TENTATIVE * AND NOT FINALIZED YET */ /*@{*/ /** extension identifier */ #define CSRI_EXT_LOGGING (csri_ext_id)"csri.logging" /** -. TODO: add scope? */ enum csri_logging_severity { CSRI_LOG_DEBUG = 0, CSRI_LOG_INFO, CSRI_LOG_NOTICE, CSRI_LOG_WARNING, CSRI_LOG_ERROR }; typedef void csri_logging_func(void *appdata, enum csri_logging_severity sev, const char *message); struct csri_logging_ext { void (*set_logcallback)(csri_logging_func *func, void *appdata); }; /*@}*/ #ifdef __cplusplus } #endif #endif /* _CSRI_LOGGING_H */ subprojects/csri/include/csri/csri.h0000664000175000017500000002565414741067256017075 0ustar aniolaniol/***************************************************************************** * csri: common subtitle renderer interface ***************************************************************************** * Copyright (C) 2007 David Lamparter * 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. * - The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ****************************************************************************/ /** \file csri.h - main CSRI (common subtitle renderer interface) include. * $Id: csri.h 45 2007-06-20 01:00:40Z equinox $ */ #ifndef _CSRI_H /** \cond */ #define _CSRI_H 20070119 /** \endcond */ #include /* ptrdiff_t */ #ifdef __cplusplus extern "C" { #endif #ifndef CSRIAPI /** CSRI API attributes. * defaults to \c extern. */ #define CSRIAPI extern #endif /** \defgroup base CSRI base API. */ /*@{*/ /** pixel format specification for frames */ enum csri_pixfmt { CSRI_F_RGBA = 0, CSRI_F_ARGB, CSRI_F_BGRA, CSRI_F_ABGR, CSRI_F_RGB_ = 0x100, CSRI_F__RGB, CSRI_F_BGR_, /**< Windows "RGB32" */ CSRI_F__BGR, CSRI_F_RGB = 0x200, CSRI_F_BGR, /**< Windows "RGB24" */ CSRI_F_AYUV = 0x1000, CSRI_F_YUVA, CSRI_F_YVUA, CSRI_F_YUY2 = 0x1100, CSRI_F_YV12A = 0x2011, /**< planar YUV 2x2 + alpha plane */ CSRI_F_YV12 = 0x2111 /**< planar YUV 2x2 */ }; #define csri_is_rgb(x) ((x) < 0x1000) #define csri_is_yuv(x) ((x) >= 0x1000) #define csri_is_yuv_planar(x) ((x) >= 0x2000) #define csri_get_yuv_planar_xred(x) (0xf & (x)) #define csri_get_yuv_planar_yred(x) (0xf & ((x) >> 4)) #define csri_is_yuv_packed(x) ((x) >= 0x1000 && (x) < 0x2000) #define csri_has_alpha(x) (((x) & 0xfff) < 0x100) /** frame/image format specification pre-fed to the renderer */ struct csri_fmt { /** format to be used */ enum csri_pixfmt pixfmt; /** image width, full frame. * * This should specify the full size of the frame. * Specifying the video sub-size (in case of added black * borders) is left to an extension. */ unsigned width; /** image height */ unsigned height; }; /** single frame to be fed to the renderer. */ struct csri_frame { /** frame format. * It is an application bug if this differs from the one * passed in struct #csri_fmt to csri_query_fmt() */ enum csri_pixfmt pixfmt; /** the frame's data. * Packed formats only use planes[0]; planar formats * have the data ordered as Y, U, V[, A]. * * Also note that the topmost line always comes first. * The Windows biHeight strange-ity is \a NOT duplicated. */ unsigned char *planes[4]; /** strides for the individual planes. * Stride means full byte offset, i.e. do \a not add * frame width */ ptrdiff_t strides[4]; }; #ifndef CSRI_OWN_HANDLES /** opaque renderer data */ typedef void csri_rend; /** opaque instance data */ typedef void csri_inst; #endif #ifdef DOXYGEN /** disable the emission of the csri_rend and csri_inst typedefs. * define this if you are in a renderer and are typedef'ing * csri_rend and csri_inst to your own structs. */ #define CSRI_OWN_HANDLES #endif /** renderer description. * \ingroup loader */ struct csri_info { /** an identifier for the renderer. * - MUST match the regular expression * \code ^[a-zA-Z]([a-zA-Z0-9_]*[a-zA-Z0-9])? \endcode * i.e. consists only of letters, numbers and underscores; * must start with a letter and doesnt have an underscore * as the last character. */ const char *name; /** an identifier to the exact version of the renderer. * most likely a version number or revision identifier. * * The helper library does a strcmp over this field in order * to order multiple instances of the same renderer. Use * higher-byte-value strings for newer renderers. */ const char *specific; /** a nice name to be presented to the user */ const char *longname; /** the renderer's author */ const char *author; /** a copyright string. Copyright (c) 2042 by Mr. Nice Guy */ const char *copyright; }; /** data of extension-dependent type. * The field to be used MUST be specified in the extension where it is used. */ union csri_vardata { long lval; double dval; const char *utf8val; void *otherval; }; /** extension identifier. * This follows reverse DNS syntax, i.e.: * \code root.branch.leaf \endcode * you can either reverse a registered domain name, e.g. * \code com.microsoft.csri.usegdiplus \endcode * or ask the CSRI maintainers to assign a namespace to you. * * currently registered namespaces are: * * \code * csri.* - official extensions * asa.* - custom extensions of the asa renderer * \endcode */ typedef const char *csri_ext_id; /** script loading parameters. * each flag MUST have an associated extension, which can be queried * with csri_query_ext(). If the open flag constitutes an extension on its * sole own, csri_query_ext() can return a meaningless non-NULL value for * it. * * The data field used must be specified. * * An extension can have multiple flags. In that case, the flags should have * the extension name as common prefix, separated with a dot. * * A renderer MUST ignore unknown open flags. It MUST NOT return an error * just because it does not support a particular flag. */ struct csri_openflag { /** flag name */ csri_ext_id name; /** flag data argument */ union csri_vardata data; /** link to next flag */ struct csri_openflag *next; }; /** load a script from a file. * \param renderer the handle to the renderer * \param filename the path to the file to be loaded. \n * The filename should be encoded as UTF-8. Windows renderers are * expected to convert it to UTF-16 and use the Unicode Windows API * functions. * \param flags a linked list of open flags. \n * The caller manages memory allocation, i.e. static allocation is OK. * \return the renderer instance handle, or NULL on error. */ CSRIAPI csri_inst *csri_open_file(csri_rend *renderer, const char *filename, struct csri_openflag *flags); /** load a script from memory. * \param renderer the handle to the renderer * \param data pointer to the first data byte. \n * The caller manages memory allocation and should free the data after * calling csri_open_mem(). If the renderer needs to keep the data, it * must copy it. \n * The renderer is not allowed to write to the data. * \param length length, in bytes, of the data * \param flags see csri_open_file() * \return the render instance handle, or NULL on error. */ CSRIAPI csri_inst *csri_open_mem(csri_rend *renderer, const void *data, size_t length, struct csri_openflag *flags); /** close a renderer instance. * \param inst the instance handle. */ CSRIAPI void csri_close(csri_inst *inst); /** query / set the image format and size. * \param inst the renderer instance handle * \param fmt the format and image size to be used * \return 0 if the format was successfully set, * any other value in case of error. */ CSRIAPI int csri_request_fmt(csri_inst *inst, const struct csri_fmt *fmt); /** render a single frame * \param inst the renderer instance handle * \param frame frame data to render to * \param time associated timestamp of the frame */ CSRIAPI void csri_render(csri_inst *inst, struct csri_frame *frame, double time); /** query for an extension. * \param rend the renderer handle * \param extname the extension's identifier * \return NULL if the extension is not supported, * a pointer to extension-specific data otherwise * * The data pointed to by the return value does not neccessarily need to * have any meaning; An extension that does not need to return data * can return a pointer to whatever it wants, as long as that pointer is * not NULL. * * In the usual case, the pointer is supposed to point to a struct with * function pointers and other information as needed. */ CSRIAPI void *csri_query_ext(csri_rend *rend, csri_ext_id extname); /*@}*/ /** \defgroup loader CSRI loader API. * * These functions locate renderers based on given parameters. * * Renderers must implement these functions as well. * * They are used by the library to grab renderer information * from a shared object; and also this way a single renderer * can be linked directly into an appliaction. */ /*@{*/ /** get renderer information * \param rend the renderer handle * \return information about the renderer, or NULL in case the renderer * encountered an internal error. */ CSRIAPI struct csri_info *csri_renderer_info(csri_rend *rend); /** try to load a given renderer * \param name the name of the renderer, as in csri_info.name * \param specific the specific version of the renderer, * as in csri_info.specific;\n * alternatively NULL if any version of the renderer is ok. * \return a handle to the renderer if it was successfully loaded, * NULL otherwise. */ CSRIAPI csri_rend *csri_renderer_byname(const char *name, const char *specific); /** try to find an implementation of the given extensions. * \param next number of extensions pointed to by ext * \param ext array of extensions to search for * \return a handle to a renderer supporting ALL of the * extensions, NULL if none was found. */ CSRIAPI csri_rend *csri_renderer_byext(unsigned n_ext, csri_ext_id *ext); /** get the default (highest priority) renderer * \return a handle to the default renderer, or NULL if * no renderer is installed. * * Together with csri_renderer_next(), this can be used * to enumerate all installed renderers. */ CSRIAPI csri_rend *csri_renderer_default(); /** get the next lower priority renderer * \param prev the current renderer * \return the renderer with the next lower priority than * the one named in prev, or NULL if prev is the last * renderer installed. */ CSRIAPI csri_rend *csri_renderer_next(csri_rend *prev); /*@}*/ #ifdef __cplusplus } #endif #endif /* _CSRI_H */ subprojects/csri/include/visibility.h0000664000175000017500000000277214741067256017360 0ustar aniolaniol/***************************************************************************** * asa: portable digital subtitle renderer ***************************************************************************** * Copyright (C) 2007 David Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ #ifndef _VISIBILITY_H #define _VISIBILITY_H #ifdef HAVE_CONFIG_H #include "acconf.h" #endif #if defined(_WIN32) && !defined(CSRI_NO_EXPORT) #define export __declspec(dllexport) #define internal #define hidden #elif HAVE_GCC_VISIBILITY #define export __attribute__((visibility ("default"))) #define internal __attribute__((visibility ("internal"))) #define hidden __attribute__((visibility ("hidden"))) #else #define export #define internal #define hidden #endif #endif /* _VISIBILITY_H */ subprojects/csri/include/subhelp.h0000664000175000017500000001035614741067256016630 0ustar aniolaniol/***************************************************************************** * csri: common subtitle renderer interface ***************************************************************************** * Copyright (C) 2007 David Lamparter * 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. * - The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ****************************************************************************/ /** \file subhelp.h - subtitle helper API. * $Id$ */ #ifndef _SUBHELP_H #define _SUBHELP_H #include #include #include /** \defgroup subhelp subtitle filter helper API. */ /*@{*/ /** file opening wrapper. * can be used to implement csri_open_file() by using csri_open_mem(). * \param renderer the renderer handle * \param memopenfunc function pointer to a csri_open_mem() implementation * \param filename name of file to open * \param flags pointer #csri_openflag.\n * subhelp_open_file will fill in csri.openerr if present * \return return value from memopenfunc or NULL on fs error */ extern csri_inst *subhelp_open_file(csri_rend *renderer, csri_inst *(*memopenfunc)(csri_rend *renderer, const void *data, size_t length, struct csri_openflag *flags), const char *filename, struct csri_openflag *flags); /** logging extension query function. * call from csri_query_ext BEFORE checking whether the renderer. * \code * void *csri_query_ext(csri_rend *rend, csri_ext_id extname) { * void *rv; * if ((rv = subhelp_query_ext_logging(extname))) * return rv; * if (!rend) * return NULL; * ... * \endcode * \param extname the extension name. compared to "csri.logging" by * this function. * \return logging extension pointer, if the extension name matched. * NULL otherwise. */ extern void *subhelp_query_ext_logging(csri_ext_id extname); /** configure other renderer with our settings. * \param logext csri.logging from configuree. */ extern void subhelp_logging_pass(struct csri_logging_ext *logext); /** logging function. * \param severity severity of this message, as defined by csri.logging * \param msg log message, one line, without \\n at the end. */ extern void subhelp_log(enum csri_logging_severity severity, const char *msg, ...) #ifdef __GNUC__ __attribute__((format(printf, 2, 3))) #endif ; /** logging function, varargs version. * \param severity severity of this message, as defined by csri.logging * \param msg log message, one line, without \\n at the end. * \param args argument list */ extern void subhelp_vlog(enum csri_logging_severity severity, const char *msg, va_list args) #ifdef __GNUC__ __attribute__((format(printf, 2, 0))) #endif ; /** logging function, fixed string version. * \param severity severity of this message, as defined by csri.logging * \param msg log message, one line, without \\n at the end. */ extern void subhelp_slog(enum csri_logging_severity severity, const char *msg); /*@}*/ #endif /* _SUBHELP_H */ subprojects/csri/csri_2008.vcproj0000664000175000017500000001407314741067256016230 0ustar aniolaniol subprojects/csri/subhelp/0000775000175000017500000000000014741067256015027 5ustar aniolaniolsubprojects/csri/subhelp/win32/0000775000175000017500000000000014741067256015771 5ustar aniolaniolsubprojects/csri/subhelp/win32/openfile.c0000664000175000017500000000512714741067256017743 0ustar aniolaniol/***************************************************************************** * asa: portable digital subtitle renderer ***************************************************************************** * Copyright (C) 2007 David Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ #include #include #include "subhelp.h" #include csri_inst *subhelp_open_file(csri_rend *renderer, csri_inst *(*memopenfunc)(csri_rend *renderer, const void *data, size_t length, struct csri_openflag *flags), const char *filename, struct csri_openflag *flags) { csri_inst *rv = NULL; void *data; struct csri_openflag *err; HANDLE file, mapping; DWORD size; int namesize; wchar_t *namebuf; namesize = MultiByteToWideChar(CP_UTF8, 0, filename, -1, NULL, 0); if (!namesize) goto out_err; namesize++; namebuf = malloc(sizeof(wchar_t) * namesize); MultiByteToWideChar(CP_UTF8, 0, filename, -1, namebuf, namesize); file = CreateFileW(namebuf, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); free(namebuf); if (file == INVALID_HANDLE_VALUE) goto out_err; size = GetFileSize(file, NULL); if (size == INVALID_FILE_SIZE || !size) goto out_closefile; mapping = CreateFileMappingW(file, NULL, PAGE_READONLY, 0, 0, NULL); if (!mapping) goto out_closefile; data = MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, size); if (!data) goto out_closemap; rv = memopenfunc(renderer, data, size, flags); UnmapViewOfFile(data); CloseHandle(mapping); CloseHandle(file); return rv; out_closemap: CloseHandle(mapping); out_closefile: CloseHandle(file); out_err: for (err = flags; err; err = err->next) if (!strcmp(err->name, CSRI_EXT_OPENERR)) break; if (err) { struct csri_openerr_flag *errd = err->data.otherval; errd->flags = CSRI_OPENERR_FILLED | CSRI_OPENERR_WINERR; errd->winerr = GetLastError(); } return NULL; } subprojects/csri/subhelp/Makefile.am0000664000175000017500000000035614741067256017067 0ustar aniolaniolif BUILD_MINGW PLATF = win32 else PLATF = posix endif noinst_LTLIBRARIES = libsubhelp.la libsubhelp_la_SOURCES = $(PLATF)/openfile.c logging.c libsubhelp_la_CFLAGS = -I$(top_srcdir)/include EXTRA_DIST = win32/openfile.c posix/openfile.c subprojects/csri/subhelp/posix/0000775000175000017500000000000014741067256016171 5ustar aniolaniolsubprojects/csri/subhelp/posix/openfile.c0000664000175000017500000000440114741067256020135 0ustar aniolaniol/***************************************************************************** * asa: portable digital subtitle renderer ***************************************************************************** * Copyright (C) 2007 David Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ #ifdef HAVE_CONFIG_H #include "acconf.h" #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TIME_H #include #endif #include #include #ifdef HAVE_SYS_MMAN_H #include #endif #include #include #include #include "subhelp.h" #include csri_inst *subhelp_open_file(csri_rend *renderer, csri_inst *(*memopenfunc)(csri_rend *renderer, const void *data, size_t length, struct csri_openflag *flags), const char *filename, struct csri_openflag *flags) { csri_inst *rv = NULL; void *data; int fd; struct stat st; struct csri_openflag *err; fd = open(filename, O_RDONLY); if (fd == -1) goto out_err; if (fstat(fd, &st) || !(data = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0))) { close(fd); goto out_err; } rv = memopenfunc(renderer, data, st.st_size, flags); munmap(data, st.st_size); close(fd); return rv; out_err: for (err = flags; err; err = err->next) if (!strcmp(err->name, CSRI_EXT_OPENERR)) break; if (err) { struct csri_openerr_flag *errd = (struct csri_openerr_flag *) err->data.otherval; errd->flags = CSRI_OPENERR_FILLED | CSRI_OPENERR_ERRNO; errd->posixerrno = errno; } return NULL; } subprojects/csri/subhelp/logging.c0000664000175000017500000000533414741067256016626 0ustar aniolaniol/***************************************************************************** * asa: portable digital subtitle renderer ***************************************************************************** * Copyright (C) 2007 David Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ #ifdef HAVE_CONFIG_H #include "acconf.h" #endif #include #include #include #include #include "visibility.h" #include "subhelp.h" #include static void *appdata = NULL; static csri_logging_func *logfunc = NULL; void setlogcallback(csri_logging_func *_logfunc, void *_appdata) hidden; void setlogcallback(csri_logging_func *_logfunc, void *_appdata) { logfunc = _logfunc; appdata = _appdata; } static struct csri_logging_ext logext = { setlogcallback }; void subhelp_logging_pass(struct csri_logging_ext *nlogext) { if (!nlogext || !nlogext->set_logcallback) return; nlogext->set_logcallback(logfunc, appdata); } void *subhelp_query_ext_logging(csri_ext_id extname) { if (strcmp(extname, CSRI_EXT_LOGGING)) return NULL; return &logext; } void subhelp_log(enum csri_logging_severity severity, const char *msg, ...) { va_list args; va_start(args, msg); subhelp_vlog(severity, msg, args); va_end(args); } void subhelp_vlog(enum csri_logging_severity severity, const char *msg, va_list args) { char *buffer; const char *final; size_t size = 256; int n; buffer = (char *)malloc(256); while (buffer) { n = vsnprintf(buffer, size, msg, args); if (n >= 0 && (unsigned)n < size) break; 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); if (buffer) free(buffer); } void subhelp_slog(enum csri_logging_severity severity, const char *msg) { if (logfunc) logfunc(appdata, severity, msg); else { fputs(msg, stderr); fputc('\n', stderr); } } subprojects/luajit.wrap0000664000175000017500000000022114741067256014603 0ustar aniolaniol[wrap-git] directory = luajit url = https://github.com/LuaJIT/LuaJIT.git revision = v2.1 patch_directory = luajit [provide] luajit = luajit_dep tests/0000775000175000017500000000000014741067256011224 5ustar aniolanioltests/tests/0000775000175000017500000000000014741067256012366 5ustar aniolanioltests/tests/mru.cpp0000664000175000017500000001277614741067256013712 0ustar aniolaniol// Copyright (c) 2010, Amar Takhar // // 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. #include #include #include #include #include static const char default_mru[] = "{\"Video\" : []}"; static const char conf_ok[] = "data/mru_ok.json"; TEST(lagi_mru, load_from_file) { ASSERT_NO_THROW(agi::MRUManager mru(conf_ok, default_mru)); agi::MRUManager mru(conf_ok, default_mru); ASSERT_NO_THROW(mru.Get("Video")); ASSERT_EQ(2u, mru.Get("Video")->size()); auto entry = mru.Get("Video")->begin(); EXPECT_STREQ("Entry One", (*entry++).string().c_str()); EXPECT_STREQ("Entry Two", (*entry++).string().c_str()); EXPECT_TRUE(mru.Get("Video")->end() == entry); } TEST(lagi_mru, load_from_default_string) { agi::fs::Remove("data/mru_tmp"); agi::MRUManager mru("data/mru_tmp", default_mru); } TEST(lagi_mru, load_from_invalid_file) { agi::fs::Copy("data/mru_invalid.json", "data/mru_tmp"); agi::MRUManager mru("data/mru_tmp", default_mru); EXPECT_TRUE(mru.Get("Video")->empty()); } TEST(lagi_mru, add_entry) { agi::fs::Copy("data/mru_ok.json", "data/mru_tmp"); agi::MRUManager mru("data/mru_tmp", default_mru); EXPECT_NO_THROW(mru.Add("Video", "/path/to/file")); EXPECT_STREQ("/path/to/file", mru.Get("Video")->front().string().c_str()); } TEST(lagi_mru, add_entry_utf8) { agi::fs::Copy("data/mru_ok.json", "data/mru_tmp"); agi::MRUManager mru("data/mru_tmp", default_mru); EXPECT_NO_THROW(mru.Add("Video", "/path/with/accents/é/日本語")); EXPECT_STREQ("/path/with/accents/é/日本語", mru.Get("Video")->front().string().c_str()); EXPECT_STREQ(L"/path/with/accents/é/日本語", mru.Get("Video")->front().wstring().c_str()); } TEST(lagi_mru, remove_entry) { agi::fs::Copy("data/mru_ok.json", "data/mru_tmp"); agi::MRUManager mru("data/mru_tmp", default_mru); EXPECT_NO_THROW(mru.Add("Video", "/path/to/file")); EXPECT_NO_THROW(mru.Remove("Video", "/path/to/file")); EXPECT_STRNE("/path/to/file", mru.Get("Video")->front().string().c_str()); } TEST(lagi_mru, invalid_mru_key_throws) { agi::fs::Copy("data/mru_ok.json", "data/mru_tmp"); agi::MRUManager mru("data/mru_tmp", default_mru); EXPECT_THROW(mru.Add("Invalid", "/path/to/file"), agi::MRUError); EXPECT_THROW(mru.Get("Invalid"), agi::MRUError); } TEST(lagi_mru, valid_mru_key_doesnt_throw) { agi::fs::Copy("data/mru_ok.json", "data/mru_tmp"); agi::MRUManager mru("data/mru_tmp", default_mru); EXPECT_NO_THROW(mru.Add("Video", "/path/to/file")); } TEST(lagi_mru, adding_existing_moves_to_front) { agi::fs::Remove("data/mru_tmp"); agi::MRUManager mru("data/mru_tmp", default_mru); EXPECT_NO_THROW(mru.Add("Video", "/file/1")); EXPECT_NO_THROW(mru.Add("Video", "/file/2")); EXPECT_NO_THROW(mru.Add("Video", "/file/3")); EXPECT_NO_THROW(mru.Add("Video", "/file/1")); EXPECT_NO_THROW(mru.Add("Video", "/file/1")); EXPECT_NO_THROW(mru.Add("Video", "/file/3")); EXPECT_STREQ("/file/3", mru.GetEntry("Video", 0).string().c_str()); EXPECT_STREQ("/file/1", mru.GetEntry("Video", 1).string().c_str()); EXPECT_STREQ("/file/2", mru.GetEntry("Video", 2).string().c_str()); EXPECT_THROW(mru.GetEntry("Video", 3), agi::MRUError); } TEST(lagi_mru, all_valid_keys_work) { agi::fs::Remove("data/mru_tmp"); agi::MRUManager mru("data/mru_tmp", default_mru); EXPECT_NO_THROW(mru.Add("Audio", "/file")); EXPECT_NO_THROW(mru.Add("Find", "/file")); EXPECT_NO_THROW(mru.Add("Keyframes", "/file")); EXPECT_NO_THROW(mru.Add("Replace", "/file")); EXPECT_NO_THROW(mru.Add("Subtitle", "/file")); EXPECT_NO_THROW(mru.Add("Timecodes", "/file")); EXPECT_NO_THROW(mru.Add("Video", "/file")); } TEST(lagi_mru, prune_works) { agi::fs::Remove("data/mru_tmp"); agi::MRUManager mru("data/mru_tmp", default_mru); for (int i = 0; i < 20; ++i) { ASSERT_NO_THROW(mru.Add("Audio", std::to_string(i))); } EXPECT_EQ(16, mru.Get("Audio")->size()); EXPECT_EQ("19", mru.Get("Audio")->front()); } TEST(lagi_mru, prune_obeys_option) { static const char opt[] = R"raw({"Limits": {"MRU": 1}})raw"; agi::Options options("", opt, agi::Options::FLUSH_SKIP); agi::fs::Remove("data/mru_tmp"); agi::MRUManager mru("data/mru_tmp", {default_mru, sizeof(default_mru)}, &options); ASSERT_NO_THROW(mru.Add("Audio", "1")); ASSERT_NO_THROW(mru.Add("Audio", "2")); EXPECT_EQ(1, mru.Get("Audio")->size()); } // Check to make sure an entry is really removed. This was fixed in // r4347, the entry was being removed from a copy of the map internally. TEST(lagi_mru, MRUEntryRemove_r4347) { agi::MRUManager mru(conf_ok, default_mru); EXPECT_NO_THROW(mru.Add("Video", "/path/to/file")); EXPECT_NO_THROW(mru.Remove("Video", "/path/to/file")); const agi::MRUManager::MRUListMap *map_list = mru.Get("Video"); auto i_lst = map_list->begin(); if ((i_lst != map_list->end()) && (*i_lst == "/path/to/file")) FAIL() << "r4347 regression, Entry exists after remove"; } tests/tests/fs.cpp0000664000175000017500000001412314741067256013503 0ustar aniolaniol// Copyright (c) 2013, 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 #include using namespace agi::fs; TEST(lagi_fs, exists) { EXPECT_TRUE(Exists("data/file")); EXPECT_TRUE(Exists("data/dir")); EXPECT_FALSE(Exists("data/nonexistent")); } TEST(lagi_fs, exists_does_not_throw) { EXPECT_NO_THROW(Exists("data/file")); EXPECT_NO_THROW(Exists("data/dir")); EXPECT_NO_THROW(Exists("data/nonexistent")); EXPECT_NO_THROW(Exists("schema://host/file")); } TEST(lagi_fs, file_exists) { EXPECT_TRUE(FileExists("data/file")); EXPECT_FALSE(FileExists("data/dir")); } TEST(lagi_fs, dir_exists) { EXPECT_FALSE(DirectoryExists("data/file")); EXPECT_TRUE(DirectoryExists("data/dir")); } #ifdef _WIN32 #else TEST(lagi_fs, short_name_is_a_no_op) { EXPECT_STREQ("a b c d", ShortName("a b c d").c_str()); } #endif TEST(lagi_fs, free_space_returns_a_value) { uintmax_t space = 0; ASSERT_NO_THROW(space = FreeSpace(".")); EXPECT_LT(0, space); } TEST(lagi_fs, file_size) { EXPECT_EQ(0u, Size("data/file")); EXPECT_EQ(10u, Size("data/ten_bytes")); EXPECT_THROW(Size("data/dir"), NotAFile); } TEST(lagi_fs, touch_creates_file) { Remove("data/touch_tmp"); ASSERT_FALSE(Exists("data/touch_tmp")); Touch("data/touch_tmp"); EXPECT_TRUE(Exists("data/touch_tmp")); Remove("data/touch_tmp"); } TEST(lagi_fs, touch_updates_modified_time) { auto mod_time = ModifiedTime("data/touch_mod_time"); Touch("data/touch_mod_time"); EXPECT_LT(mod_time, ModifiedTime("data/touch_mod_time")); } TEST(lagi_fs, touch_does_not_modify_contents) { int expected_value = util::write_rand("data/tmp"); Touch("data/tmp"); EXPECT_EQ(expected_value, util::read_written_rand("data/tmp")); } TEST(lagi_fs, rename) { ASSERT_NO_THROW(Touch("data/rename_in")); ASSERT_NO_THROW(Remove("data/rename_out")); ASSERT_NO_THROW(Rename("data/rename_in", "data/rename_out")); EXPECT_FALSE(FileExists("data/rename_in")); EXPECT_TRUE(FileExists("data/rename_out")); } TEST(lagi_fs, rename_overwrites) { int expected_value = util::write_rand("data/rename_in"); ASSERT_NO_THROW(Remove("data/rename_out")); ASSERT_NO_THROW(Touch("data/rename_out")); ASSERT_NO_THROW(Rename("data/rename_in", "data/rename_out")); EXPECT_FALSE(FileExists("data/rename_in")); EXPECT_TRUE(FileExists("data/rename_out")); EXPECT_EQ(expected_value, util::read_written_rand("data/rename_out")); } TEST(lagi_fs, copy) { int expected_value = util::write_rand("data/copy_in"); ASSERT_NO_THROW(Remove("data/copy_out")); ASSERT_NO_THROW(Copy("data/copy_in", "data/copy_out")); EXPECT_TRUE(FileExists("data/copy_in")); EXPECT_TRUE(FileExists("data/copy_out")); EXPECT_EQ(expected_value, util::read_written_rand("data/copy_out")); } TEST(lagi_fs, copy_overwrites) { int expected_value = util::write_rand("data/copy_in"); ASSERT_NO_THROW(Remove("data/copy_out")); ASSERT_NO_THROW(Touch("data/copy_out")); ASSERT_NO_THROW(Copy("data/copy_in", "data/copy_out")); EXPECT_TRUE(FileExists("data/copy_in")); EXPECT_TRUE(FileExists("data/copy_out")); EXPECT_EQ(expected_value, util::read_written_rand("data/copy_out")); } TEST(lagi_fs, copy_creates_path) { } TEST(lagi_fs, has_extension) { EXPECT_TRUE(HasExtension("foo.txt", "txt")); EXPECT_TRUE(HasExtension("foo.TXT", "txt")); EXPECT_TRUE(HasExtension("foo.tar.gz", "gz")); EXPECT_TRUE(HasExtension("foo.tar.gz", "tar.gz")); EXPECT_TRUE(HasExtension("foo.\xC3\x9F", "\xC3\x9F")); // sharp s EXPECT_FALSE(HasExtension("foo.tx", "txt")); EXPECT_FALSE(HasExtension("footxt", "txt")); EXPECT_FALSE(HasExtension("foo.txt/", "txt")); EXPECT_FALSE(HasExtension("foo.tar.gz", "tar")); } TEST(lagi_fs, dir_iterator_bad_directory) { std::vector files; ASSERT_NO_THROW(DirectoryIterator("data/nonexistent", "*.*").GetAll(files)); EXPECT_TRUE(files.empty()); } TEST(lagi_fs, dir_iterator_no_filter) { std::vector files; ASSERT_NO_THROW(DirectoryIterator("data/dir_iterator", "").GetAll(files)); ASSERT_EQ(4u, files.size()); sort(begin(files), end(files)); // order is not guaranteed EXPECT_STREQ("1.a", files[0].c_str()); EXPECT_STREQ("1.b", files[1].c_str()); EXPECT_STREQ("2.a", files[2].c_str()); EXPECT_STREQ("2.b", files[3].c_str()); } TEST(lagi_fs, dir_iterator_ext_filter) { std::vector files; ASSERT_NO_THROW(DirectoryIterator("data/dir_iterator", "*.a").GetAll(files)); ASSERT_EQ(2u, files.size()); sort(begin(files), end(files)); // order is not guaranteed EXPECT_STREQ("1.a", files[0].c_str()); EXPECT_STREQ("2.a", files[1].c_str()); } TEST(lagi_fs, dir_iterator_ext_filter_skipping_first_works) { std::vector files; ASSERT_NO_THROW(DirectoryIterator("data/dir_iterator", "*.b").GetAll(files)); ASSERT_EQ(2u, files.size()); sort(begin(files), end(files)); // order is not guaranteed EXPECT_STREQ("1.b", files[0].c_str()); EXPECT_STREQ("2.b", files[1].c_str()); } TEST(lagi_fs, dir_iterator_fn_filter) { std::vector files; ASSERT_NO_THROW(DirectoryIterator("data/dir_iterator", "1.*").GetAll(files)); ASSERT_EQ(2u, files.size()); sort(begin(files), end(files)); // order is not guaranteed EXPECT_STREQ("1.a", files[0].c_str()); EXPECT_STREQ("1.b", files[1].c_str()); } TEST(lagi_fs, dir_iterator_all_filtered_out) { std::vector files; ASSERT_NO_THROW(DirectoryIterator("data/dir_iterator", "*.c").GetAll(files)); EXPECT_TRUE(files.empty()); } tests/tests/character_count.cpp0000664000175000017500000001043114741067256016235 0ustar aniolaniol// 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 TEST(lagi_character_count, basic) { EXPECT_EQ(5, agi::CharacterCount("hello", agi::IGNORE_NONE)); } TEST(lagi_character_count, japanese) { EXPECT_EQ(4, agi::CharacterCount("ドングズ", agi::IGNORE_NONE)); } TEST(lagi_character_count, zalgo) { EXPECT_EQ(5, agi::CharacterCount("\xe1\xb8\xa9\x65\xcc\x94\xcc\x8b\xcd\xad\xcc\x80\xcd\x86\xcd\x97\xcc\x84\x6c\xcc\xb6\xcc\x88\xcc\x81\x6c\xcc\xab\xcc\x9c\xcd\x94\xcc\xac\xcc\x96\xcc\x9f\xcc\xb2\xcd\xa8\xcd\xae\xcc\x8b\xcc\x93\x6f\xcc\xad\xcd\x88\xcc\x9f\xcc\x9c\xcd\x94\xcc\xab\xcc\xb0\xcd\x8a\xcd\x97", agi::IGNORE_NONE)); } TEST(lagi_character_count, ignore_blocks) { EXPECT_EQ(11, agi::CharacterCount("{asdf}hello", agi::IGNORE_NONE)); EXPECT_EQ(10, agi::CharacterCount("{asdfhello", agi::IGNORE_NONE)); EXPECT_EQ(5, agi::CharacterCount("{asdf}hello", agi::IGNORE_BLOCKS)); EXPECT_EQ(10, agi::CharacterCount("{asdfhello", agi::IGNORE_BLOCKS)); EXPECT_EQ(5, agi::CharacterCount("he{asdf}llo", agi::IGNORE_BLOCKS)); EXPECT_EQ(5, agi::CharacterCount("{}h{}e{}l{}l{}o{}", agi::IGNORE_BLOCKS)); EXPECT_EQ(5, agi::CharacterCount("{a}h{a}e{a}l{a}l{a}o{a}", agi::IGNORE_BLOCKS)); } TEST(lagi_character_count, ignore_punctuation) { EXPECT_EQ(6, agi::CharacterCount("hello.", agi::IGNORE_NONE)); EXPECT_EQ(5, agi::CharacterCount("hello.", agi::IGNORE_PUNCTUATION)); } TEST(lagi_character_count, ignore_whitespace) { EXPECT_EQ(10, agi::CharacterCount("h e l l o ", agi::IGNORE_NONE)); EXPECT_EQ(5, agi::CharacterCount("h e l l o ", agi::IGNORE_WHITESPACE)); } TEST(lagi_character_count, ignore_whitespace_commands) { EXPECT_EQ(10, agi::CharacterCount("hello world", agi::IGNORE_WHITESPACE)); EXPECT_EQ(10, agi::CharacterCount("hello\\nworld", agi::IGNORE_WHITESPACE)); EXPECT_EQ(10, agi::CharacterCount("hello\\Nworld", agi::IGNORE_WHITESPACE)); EXPECT_EQ(10, agi::CharacterCount("hello\\hworld", agi::IGNORE_WHITESPACE)); EXPECT_EQ(12, agi::CharacterCount("hello\\Nworld", agi::IGNORE_NONE)); } TEST(lagi_character_count, ignore_blocks_and_punctuation) { EXPECT_EQ(5, agi::CharacterCount("{asdf}hello.", agi::IGNORE_PUNCTUATION | agi::IGNORE_BLOCKS)); } TEST(lagi_character_count, ignore_blocks_unclosed) { EXPECT_EQ(6, agi::CharacterCount("{hello", agi::IGNORE_BLOCKS)); } TEST(lagi_character_count, line_length) { EXPECT_EQ(5, agi::MaxLineLength("hello", agi::IGNORE_NONE)); EXPECT_EQ(5, agi::MaxLineLength("hello\\Nasdf", agi::IGNORE_NONE)); EXPECT_EQ(5, agi::MaxLineLength("hello\\nasdf", agi::IGNORE_NONE)); EXPECT_EQ(5, agi::MaxLineLength("asdf\\nhello", agi::IGNORE_NONE)); EXPECT_EQ(10, agi::MaxLineLength("hello\\hasdf", agi::IGNORE_NONE)); EXPECT_EQ(9, agi::MaxLineLength("hello\\hasdf", agi::IGNORE_WHITESPACE)); EXPECT_EQ(9, agi::MaxLineLength("hello asdf", agi::IGNORE_WHITESPACE)); } TEST(lagi_character_count, line_length_ignores_drawings) { EXPECT_EQ(0, agi::MaxLineLength("{\\p1}m 10 10", agi::IGNORE_NONE)); } TEST(lagi_character_count, character_index) { EXPECT_EQ(0, agi::IndexOfCharacter("", 0)); EXPECT_EQ(0, agi::IndexOfCharacter("", 1)); EXPECT_EQ(0, agi::IndexOfCharacter("abc", 0)); EXPECT_EQ(1, agi::IndexOfCharacter("abc", 1)); EXPECT_EQ(2, agi::IndexOfCharacter("abc", 2)); EXPECT_EQ(3, agi::IndexOfCharacter("abc", 3)); EXPECT_EQ(3, agi::IndexOfCharacter("abc", 4)); EXPECT_EQ(3, agi::IndexOfCharacter("ドングズ", 1)); EXPECT_EQ(6, agi::IndexOfCharacter("ドングズ", 2)); EXPECT_EQ(9, agi::IndexOfCharacter("ドングズ", 3)); } tests/tests/cajun.cpp0000664000175000017500000002434514741067256014202 0ustar aniolaniol// Copyright (c) 2011, 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. // // $Id$ /// @file libaegisub_cajun.cpp /// @brief Cajun/Json tests. /// @ingroup cajun #include #include #include #include #include class lagi_cajun : public libagi { }; TEST(lagi_cajun, CastNonConst) { auto Integer = json::UnknownElement{0}; auto Double = json::UnknownElement{0.0}; auto String = json::UnknownElement{"1"}; auto Boolean = json::UnknownElement{false}; auto Array = json::UnknownElement{json::Array{}}; auto Object = json::UnknownElement{json::Object{}}; EXPECT_NO_THROW(static_cast(Integer)); EXPECT_NO_THROW(static_cast(Double)); EXPECT_NO_THROW(static_cast(String)); EXPECT_NO_THROW(static_cast(Boolean)); EXPECT_NO_THROW(static_cast(Array)); EXPECT_NO_THROW(static_cast(Object)); EXPECT_NO_THROW(static_cast(Integer)); EXPECT_NO_THROW(static_cast(Double)); EXPECT_NO_THROW(static_cast(String)); EXPECT_NO_THROW(static_cast(Boolean)); EXPECT_NO_THROW(static_cast(Array)); EXPECT_NO_THROW(static_cast(Object)); } TEST(lagi_cajun, CastConst) { const auto Integer = json::UnknownElement{10}; const auto Double = json::UnknownElement{10.0}; const auto String = json::UnknownElement{"1"}; const auto Boolean = json::UnknownElement{false}; const auto Array = json::UnknownElement{json::Array{}}; const auto Object = json::UnknownElement{json::Object{}}; /* these shouldn't compile EXPECT_NO_THROW(static_cast(Integer)); EXPECT_NO_THROW(static_cast(Double)); EXPECT_NO_THROW(static_cast(String)); EXPECT_NO_THROW(static_cast(Boolean)); EXPECT_NO_THROW(static_cast(Array)); EXPECT_NO_THROW(static_cast(Object)); */ EXPECT_NO_THROW(static_cast(Integer)); EXPECT_NO_THROW(static_cast(Double)); EXPECT_NO_THROW(static_cast(String)); EXPECT_NO_THROW(static_cast(Boolean)); EXPECT_NO_THROW(static_cast(Array)); EXPECT_NO_THROW(static_cast(Object)); EXPECT_EQ(10, static_cast(Integer)); EXPECT_EQ(10, static_cast(Double)); EXPECT_STREQ("1", static_cast(String).c_str()); EXPECT_FALSE(static_cast(Boolean)); EXPECT_TRUE(static_cast(Array).empty()); EXPECT_TRUE(static_cast(Object).empty()); } TEST(lagi_cajun, ObjectStoreInteger) { json::Object obj; obj["Integer"] = 1; EXPECT_EQ(1, static_cast(obj["Integer"])); EXPECT_THROW(static_cast(obj["Integer"]), json::Exception); EXPECT_THROW(static_cast(obj["Integer"]), json::Exception); EXPECT_THROW(static_cast(obj["Integer"]), json::Exception); EXPECT_THROW(static_cast(obj["Integer"]), json::Exception); EXPECT_THROW(static_cast(obj["Integer"]), json::Exception); } TEST(lagi_cajun, ObjectStoreDouble) { json::Object obj; obj["Double"] = 1.0; EXPECT_EQ(1.0, static_cast(obj["Double"])); EXPECT_THROW(static_cast(obj["Double"]), json::Exception); EXPECT_THROW(static_cast(obj["Double"]), json::Exception); EXPECT_THROW(static_cast(obj["Double"]), json::Exception); EXPECT_THROW(static_cast(obj["Double"]), json::Exception); EXPECT_THROW(static_cast(obj["Double"]), json::Exception); } TEST(lagi_cajun, ObjectStoreString) { json::Object obj; obj["String"] = "test"; EXPECT_STREQ("test", static_cast(obj["String"]).c_str()); EXPECT_THROW(static_cast(obj["String"]), json::Exception); EXPECT_THROW(static_cast(obj["String"]), json::Exception); EXPECT_THROW(static_cast(obj["String"]), json::Exception); EXPECT_THROW(static_cast(obj["String"]), json::Exception); EXPECT_THROW(static_cast(obj["String"]), json::Exception); } TEST(lagi_cajun, ObjectStoreBoolean) { json::Object obj; obj["Boolean"] = true; EXPECT_TRUE(static_cast(obj["Boolean"])); EXPECT_THROW(static_cast(obj["Boolean"]), json::Exception); EXPECT_THROW(static_cast(obj["Boolean"]), json::Exception); EXPECT_THROW(static_cast(obj["Boolean"]), json::Exception); EXPECT_THROW(static_cast(obj["Boolean"]), json::Exception); EXPECT_THROW(static_cast(obj["Boolean"]), json::Exception); } TEST(lagi_cajun, ObjectStoreNull) { json::Object obj; obj["Null"] = json::Null(); EXPECT_NO_THROW(static_cast(obj["Null"])); // null is implicitly convertible to everything EXPECT_NO_THROW(static_cast(obj["Null"])); obj["Null"] = json::Null(); EXPECT_NO_THROW(static_cast(obj["Null"])); obj["Null"] = json::Null(); EXPECT_NO_THROW(static_cast(obj["Null"])); obj["Null"] = json::Null(); EXPECT_NO_THROW(static_cast(obj["Null"])); obj["Null"] = json::Null(); EXPECT_NO_THROW(static_cast(obj["Null"])); obj["Null"] = json::Null(); EXPECT_NO_THROW(static_cast(obj["Null"])); // obj["Null"] should no longer be of type Null EXPECT_THROW(static_cast(obj["Null"]), json::Exception); } TEST(lagi_cajun, ObjectCreateArray) { json::Object obj; obj["Inside"] = ""; json::Array array; array.push_back(std::move(obj)); EXPECT_STREQ("", static_cast(static_cast(array[0])["Inside"]).c_str()); } TEST(lagi_cajun, Read) { json::UnknownElement root; std::istringstream doc("{\"String\" : \"This is a test\", \"Boolean\" : false, \"Null\" : null }"); EXPECT_NO_THROW(json::Reader::Read(root, doc)); json::Object& obj = root; EXPECT_NO_THROW(obj["String"]); EXPECT_STREQ("This is a test", static_cast(obj["String"]).c_str()); EXPECT_FALSE(static_cast(obj["Boolean"])); EXPECT_NO_THROW(static_cast(obj["Null"])); } TEST(lagi_cajun, Write) { json::Object obj; obj["Boolean"] = true; obj["String"] = "This \"is\" \\a \t test"; std::stringstream stream; EXPECT_NO_THROW(agi::JsonWriter::Write(obj, stream)); EXPECT_STREQ("{\n\t\"Boolean\" : true,\n\t\"String\" : \"This \\\"is\\\" \\\\a \\t test\"\n}", stream.str().c_str()); stream.str(""); EXPECT_NO_THROW(agi::JsonWriter::Write(json::Array(), stream)); EXPECT_STREQ("[]", stream.str().c_str()); stream.str(""); EXPECT_NO_THROW(agi::JsonWriter::Write(json::Object(), stream)); EXPECT_STREQ("{}", stream.str().c_str()); stream.str(""); EXPECT_NO_THROW(agi::JsonWriter::Write(true, stream)); EXPECT_STREQ("true", stream.str().c_str()); stream.str(""); EXPECT_NO_THROW(agi::JsonWriter::Write(false, stream)); EXPECT_STREQ("false", stream.str().c_str()); stream.str(""); EXPECT_NO_THROW(agi::JsonWriter::Write(json::Null(), stream)); EXPECT_STREQ("null", stream.str().c_str()); } TEST(lagi_cajun, ReaderParserErrors) { json::UnknownElement ue; std::istringstream missing_comma("[1 2]"); EXPECT_THROW(json::Reader::Read(ue, missing_comma), json::Exception); std::istringstream garbage_after_number("123!"); EXPECT_THROW(json::Reader::Read(ue, garbage_after_number), json::Exception); std::istringstream unexpected_eof("["); EXPECT_THROW(json::Reader::Read(ue, unexpected_eof), json::Exception); std::istringstream bad_initial_token("]"); EXPECT_THROW(json::Reader::Read(ue, bad_initial_token), json::Exception); std::istringstream garbage_after_end("[]a"); EXPECT_THROW(json::Reader::Read(ue, garbage_after_end), json::Exception); std::istringstream empty_str(""); EXPECT_THROW(json::Reader::Read(ue, empty_str), json::Exception); std::istringstream dupe_keys("{\"a\": [], \"a\": 0}"); EXPECT_THROW(json::Reader::Read(ue, dupe_keys), json::Exception); std::istringstream unique_keys("{\"a\": [], \"b\": 0}"); EXPECT_NO_THROW(json::Reader::Read(ue, unique_keys)); } TEST(lagi_cajun, ReaderScanErrors) { json::UnknownElement ue; std::istringstream doc("[true, false, thiswontwork]"); EXPECT_THROW(json::Reader::Read(ue, doc), json::Exception); std::istringstream garbage_after_number("123abc"); EXPECT_THROW(json::Reader::Read(ue, garbage_after_number), json::Exception); std::istringstream bad_escape("\"\\j\""); EXPECT_THROW(json::Reader::Read(ue, bad_escape), json::Exception); std::istringstream unexpected_eof("\"abc"); EXPECT_THROW(json::Reader::Read(ue, unexpected_eof), json::Exception); } std::string roundtrip_test(const char *in) { std::istringstream iss(in); json::UnknownElement ele; json::Reader::Read(ele, iss); std::stringstream oss; agi::JsonWriter::Write(ele, oss); return oss.str(); } TEST(lagi_cajun, round_double_roundtrips) { EXPECT_STREQ("1.0", roundtrip_test("1.0").c_str()); } TEST(lagi_cajun, representable_double_roundtrips) { EXPECT_STREQ("1.5", roundtrip_test("1.5").c_str()); } TEST(lagi_cajun, int_roundtrips) { EXPECT_STREQ("1", roundtrip_test("1").c_str()); } TEST(lagi_cajun, bool_roundtrips) { EXPECT_STREQ("true", roundtrip_test("true").c_str()); EXPECT_STREQ("false", roundtrip_test("false").c_str()); } TEST(lagi_cajun, null_roundtrips) { EXPECT_STREQ("null", roundtrip_test("null").c_str()); } tests/tests/split.cpp0000664000175000017500000000274414741067256014234 0ustar aniolaniol// 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 TEST(lagi_split, delim_not_present) { std::string str("hello"); for (auto tok : agi::Split(str, ',')) EXPECT_EQ("hello", tok); } TEST(lagi_split, delim_present) { std::string str("a,b,c,"); std::string expected[] = {"a", "b", "c", ""}; size_t i = 0; for (auto tok : agi::Split(str, ',')) EXPECT_EQ(expected[i++], tok); EXPECT_EQ(i, std::size(expected)); } TEST(lagi_split, does_not_copy_input) { std::string str("hello"); for (auto tok : agi::Split(str, ',')) { EXPECT_EQ(&*str.begin(), &*tok.begin()); } auto rng = agi::Split(str, 'e'); EXPECT_EQ(&*str.begin(), &*begin(*rng)); } tests/tests/dialogue_lexer.cpp0000664000175000017500000002114414741067256016064 0ustar aniolaniol// Copyright (c) 2012, 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. #include #include #include class lagi_dialogue_lexer : public libagi { }; using namespace agi::ass; TEST(lagi_dialogue_lexer, empty) { ASSERT_TRUE(TokenizeDialogueBody("").empty()); } #define tok_str(arg1, ktemplate, ...) do { \ std::string str = arg1; \ std::vector tok = TokenizeDialogueBody(str, ktemplate); \ size_t token_index = 0; \ __VA_ARGS__ \ EXPECT_EQ(token_index, tok.size()); \ } while(false) #define expect_tok(expected_type, expected_len) do { \ EXPECT_LT(token_index, tok.size()); \ if (token_index < tok.size()) { \ EXPECT_EQ(DialogueTokenType::expected_type, tok[token_index].type); \ EXPECT_EQ(expected_len, tok[token_index].length); \ ++token_index; \ } \ } while(false) TEST(lagi_dialogue_lexer, plain_text) { tok_str("hello there", false, expect_tok(TEXT, 11); ); tok_str("hello\\Nthere", false, expect_tok(TEXT, 5); expect_tok(LINE_BREAK, 2); expect_tok(TEXT, 5); ); tok_str("hello\\n\\h\\kthere", false, expect_tok(TEXT, 5); expect_tok(LINE_BREAK, 4); expect_tok(TEXT, 7); ); } TEST(lagi_dialogue_lexer, basic_override_tags) { tok_str("{\\b1}bold text{\\b0}", false, expect_tok(OVR_BEGIN, 1); expect_tok(TAG_START, 1); expect_tok(TAG_NAME, 1); expect_tok(ARG, 1); expect_tok(OVR_END, 1); expect_tok(TEXT, 9); expect_tok(OVR_BEGIN, 1); expect_tok(TAG_START, 1); expect_tok(TAG_NAME, 1); expect_tok(ARG, 1); expect_tok(OVR_END, 1); ); tok_str("{\\fnComic Sans MS}text", false, expect_tok(OVR_BEGIN, 1); expect_tok(TAG_START, 1); expect_tok(TAG_NAME, 2); expect_tok(ARG, 5); expect_tok(WHITESPACE, 1); expect_tok(ARG, 4); expect_tok(WHITESPACE, 1); expect_tok(ARG, 2); expect_tok(OVR_END, 1); expect_tok(TEXT, 4); ); tok_str("{\\pos(0,0)}a", false, expect_tok(OVR_BEGIN, 1); expect_tok(TAG_START, 1); expect_tok(TAG_NAME, 3); expect_tok(OPEN_PAREN, 1); expect_tok(ARG, 1); expect_tok(ARG_SEP, 1); expect_tok(ARG, 1); expect_tok(CLOSE_PAREN, 1); expect_tok(OVR_END, 1); expect_tok(TEXT, 1); ); tok_str("{\\pos( 0 , 0 )}a", false, expect_tok(OVR_BEGIN, 1); expect_tok(TAG_START, 1); expect_tok(TAG_NAME, 3); expect_tok(OPEN_PAREN, 1); expect_tok(WHITESPACE, 1); expect_tok(ARG, 1); expect_tok(WHITESPACE, 1); expect_tok(ARG_SEP, 1); expect_tok(WHITESPACE, 1); expect_tok(ARG, 1); expect_tok(WHITESPACE, 1); expect_tok(CLOSE_PAREN, 1); expect_tok(OVR_END, 1); expect_tok(TEXT, 1); ); tok_str("{\\c&HFFFFFF&\\2c&H0000FF&\\3c&H000000&}a", false, expect_tok(OVR_BEGIN, 1); expect_tok(TAG_START, 1); expect_tok(TAG_NAME, 1); expect_tok(ARG, 9); expect_tok(TAG_START, 1); expect_tok(TAG_NAME, 2); expect_tok(ARG, 9); expect_tok(TAG_START, 1); expect_tok(TAG_NAME, 2); expect_tok(ARG, 9); expect_tok(OVR_END, 1); expect_tok(TEXT, 1); ); tok_str("{\\t(0,100,\\clip(1, m 0 0 l 10 10 10 20))}a", false, expect_tok(OVR_BEGIN, 1); expect_tok(TAG_START, 1); expect_tok(TAG_NAME, 1); expect_tok(OPEN_PAREN, 1); expect_tok(ARG, 1); expect_tok(ARG_SEP, 1); expect_tok(ARG, 3); expect_tok(ARG_SEP, 1); expect_tok(TAG_START, 1); expect_tok(TAG_NAME, 4); expect_tok(OPEN_PAREN, 1); expect_tok(ARG, 1); expect_tok(ARG_SEP, 1); expect_tok(WHITESPACE, 1); expect_tok(ARG, 1); expect_tok(WHITESPACE, 1); expect_tok(ARG, 1); expect_tok(WHITESPACE, 1); expect_tok(ARG, 1); expect_tok(WHITESPACE, 1); expect_tok(ARG, 1); expect_tok(WHITESPACE, 1); expect_tok(ARG, 2); expect_tok(WHITESPACE, 1); expect_tok(ARG, 2); expect_tok(WHITESPACE, 1); expect_tok(ARG, 2); expect_tok(WHITESPACE, 1); expect_tok(ARG, 2); expect_tok(CLOSE_PAREN, 2); expect_tok(OVR_END, 1); expect_tok(TEXT, 1); ); } TEST(lagi_dialogue_lexer, merging) { tok_str("{\\b\\b", false, expect_tok(OVR_BEGIN, 1); expect_tok(TAG_START, 1); expect_tok(TAG_NAME, 1); expect_tok(TAG_START, 1); expect_tok(TAG_NAME, 1); ); } TEST(lagi_dialogue_lexer, whitespace) { tok_str("{ \\ fn Comic Sans MS }asd", false, expect_tok(OVR_BEGIN, 1); expect_tok(WHITESPACE, 1); expect_tok(TAG_START, 1); expect_tok(WHITESPACE, 1); expect_tok(TAG_NAME, 2); expect_tok(WHITESPACE, 1); expect_tok(ARG, 5); expect_tok(WHITESPACE, 1); expect_tok(ARG, 4); expect_tok(WHITESPACE, 1); expect_tok(ARG, 2); expect_tok(WHITESPACE, 1); expect_tok(OVR_END, 1); expect_tok(TEXT, 3); ); } TEST(lagi_dialogue_lexer, comment) { tok_str("{a}b", false, expect_tok(OVR_BEGIN, 1); expect_tok(COMMENT, 1); expect_tok(OVR_END, 1); expect_tok(TEXT, 1); ); tok_str("{a\\b}c", false, expect_tok(OVR_BEGIN, 1); expect_tok(COMMENT, 1); expect_tok(TAG_START, 1); expect_tok(TAG_NAME, 1); expect_tok(OVR_END, 1); expect_tok(TEXT, 1); ); } TEST(lagi_dialogue_lexer, malformed) { tok_str("}", false, expect_tok(TEXT, 1); ); tok_str("{{", false, expect_tok(OVR_BEGIN, 1); expect_tok(ERROR, 1); ); tok_str("{\\pos(0,0}a", false, expect_tok(OVR_BEGIN, 1); expect_tok(TAG_START, 1); expect_tok(TAG_NAME, 3); expect_tok(OPEN_PAREN, 1); expect_tok(ARG, 1); expect_tok(ARG_SEP, 1); expect_tok(ARG, 1); expect_tok(OVR_END, 1); expect_tok(TEXT, 1); ); tok_str("{\\b1\\}asdf", false, expect_tok(OVR_BEGIN, 1); expect_tok(TAG_START, 1); expect_tok(TAG_NAME, 1); expect_tok(ARG, 1); expect_tok(TAG_START, 1); expect_tok(OVR_END, 1); expect_tok(TEXT, 4); ); } TEST(lagi_dialogue_lexer, templater_variable_nontmpl) { tok_str("{\\pos($x, $y)\\fs!10 + 10!}abc", false, expect_tok(OVR_BEGIN, 1u); expect_tok(TAG_START, 1u); expect_tok(TAG_NAME, 3u); expect_tok(OPEN_PAREN, 1); expect_tok(ARG, 2u); expect_tok(ARG_SEP, 1u); expect_tok(WHITESPACE, 1u); expect_tok(ARG, 2u); expect_tok(CLOSE_PAREN, 1); expect_tok(TAG_START, 1u); expect_tok(TAG_NAME, 2u); expect_tok(ARG, 3u); expect_tok(WHITESPACE, 1u); expect_tok(ARG, 1u); expect_tok(WHITESPACE, 1u); expect_tok(ARG, 3u); expect_tok(OVR_END, 1u); expect_tok(TEXT, 3u); ); tok_str("{\\b1!'}'!a", false, expect_tok(OVR_BEGIN, 1u); expect_tok(TAG_START, 1u); expect_tok(TAG_NAME, 1u); expect_tok(ARG, 3u); expect_tok(OVR_END, 1u); expect_tok(TEXT, 3u); ); } TEST(lagi_dialogue_lexer, templater_variable) { tok_str("$a", true, expect_tok(KARAOKE_VARIABLE, 2u); ); tok_str("{\\pos($x,$y)}a", true, expect_tok(OVR_BEGIN, 1u); expect_tok(TAG_START, 1u); expect_tok(TAG_NAME, 3u); expect_tok(OPEN_PAREN, 1u); expect_tok(KARAOKE_VARIABLE, 2u); expect_tok(ARG_SEP, 1u); expect_tok(KARAOKE_VARIABLE, 2u); expect_tok(CLOSE_PAREN, 1u); expect_tok(OVR_END, 1u); expect_tok(TEXT, 1u); ); tok_str("{\\fn$fn}a", true, expect_tok(OVR_BEGIN, 1u); expect_tok(TAG_START, 1u); expect_tok(TAG_NAME, 2u); expect_tok(KARAOKE_VARIABLE, 3u); expect_tok(OVR_END, 1u); expect_tok(TEXT, 1u); ); tok_str("{foo$bar}", true, expect_tok(OVR_BEGIN, 1u); expect_tok(COMMENT, 3u); expect_tok(KARAOKE_VARIABLE, 4u); expect_tok(OVR_END, 1u); ); tok_str("{foo$bar", true, expect_tok(OVR_BEGIN, 1u); expect_tok(COMMENT, 3u); expect_tok(KARAOKE_VARIABLE, 4u); ); } TEST(lagi_dialogue_lexer, templater_expression) { tok_str("!5!", true, expect_tok(KARAOKE_TEMPLATE, 3u); ); tok_str("!5", true, expect_tok(TEXT, 2u); ); tok_str("!x * 10!", true, expect_tok(KARAOKE_TEMPLATE, 8u); ); tok_str("{\\pos(!x + 1!, $y)}a", true, expect_tok(OVR_BEGIN, 1u); expect_tok(TAG_START, 1u); expect_tok(TAG_NAME, 3u); expect_tok(OPEN_PAREN, 1u); expect_tok(KARAOKE_TEMPLATE, 7u); expect_tok(ARG_SEP, 1u); expect_tok(WHITESPACE, 1u); expect_tok(KARAOKE_VARIABLE, 2u); expect_tok(CLOSE_PAREN, 1u); expect_tok(OVR_END, 1u); expect_tok(TEXT, 1u); ); tok_str("{\\b1!'}'!a", true, expect_tok(OVR_BEGIN, 1u); expect_tok(TAG_START, 1u); expect_tok(TAG_NAME, 1u); expect_tok(ARG, 1u); expect_tok(KARAOKE_TEMPLATE, 5u); expect_tok(ARG, 1u); ); } tests/tests/keyframe.cpp0000664000175000017500000001524214741067256014701 0ustar aniolaniol// Copyright (c) 2011, 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. /// @file libaegisub_keyframe.cpp /// @brief agi::keyframe tests /// @ingroup video_input #include #include #include #include #include #include using namespace agi::keyframe; using namespace util; TEST(lagi_keyframe, save) { std::vector kf = { 0, 5, 70, 180, 300 }; ASSERT_NO_THROW(Save("data/keyframe/out.txt", kf)); std::vector res; ASSERT_NO_THROW(res = Load("data/keyframe/out.txt")); EXPECT_TRUE(kf == res); } TEST(lagi_keyframe, bad_files) { EXPECT_THROW(Load(""), agi::fs::FileSystemError); // 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) { std::vector expected = { 0, 52, 53, 55, 57, 80, 114, 168, 182, 234, 240, 242, 244, 250, 251, 274, 290, 336, 364, 431, 465, 535, 596, 654, 700, 744, 976, 982, 983, 984, 985, 993, 994, 995, 996, 997, 998, 1006, 1007, 1008, 1009, 1022, 1066, 1071, 1072, 1073, 1074, 1075, 1081, 1086, 1092, 1096, 1097, 1099, 1100, 1429, 1445, 1511, 1559, 1575, 1605, 1624, 1634, 1696, 1760, 1795, 1820, 1873, 1900, 1948, 1958, 1966, 1974, 1983, 1991, 1999, 2012, 2032, 2194, 2195, 2325, 2354, 2355, 2404, 2411, 2412, 2414, 2446, 2487, 2489, 2495, 2496, 2497, 2498, 2522, 2538, 2544, 2552, 2558, 2564, 2575, 2583, 2591, 2599, 2607, 2690, 2695, 2703, 2711, 2719, 2727, 2735, 2753, 2754, 2756, 2757, 2765, 2766, 2768, 2769, 2777, 2900, 3048, 3093, 3104, 3116, 3184, 3439, 3605, 3645, 3649, 3655, 3657, 3659, 3679, 3681, 3749, 3770, 3794, 3815, 3837, 3862, 3969, 4007, 4044, 4090, 4113, 4157, 4246, 4293, 4480, 4520, 4573, 4619, 4644, 4661, 4682, 4684, 4686, 4708, 4737, 4739, 4741, 4777, 4779, 4780, 4783, 4839, 4851, 4863, 4872, 4878, 4884, 4890, 4896, 4901, 4953, 4975, 4986, 4988, 4990, 4992, 5004, 5068, 5093, 5160, 5183, 5212, 5233, 5275, 5281, 5326, 5360, 5380, 5493, 5497, 5498, 5499, 5500, 5517, 5562, 5684, 5708, 5762, 5764, 5821, 5857, 5975, 5993, 6053, 6099, 6172, 6224, 6248, 6272, 6305, 6329, 6353, 6377, 6414, 6438, 6465, 6499, 6567, 6677, 6736, 6781, 6809, 6873, 6985, 7031, 7115, 7199, 7283, 7367, 7451, 7535, 7619, 7703, 8177, 8232, 8484, 8505, 8595, 8659, 8699, 8967, 9004, 9021, 9064, 9116, 9164, 9271, 9293, 9327, 9379, 9505, 9663, 9754, 9800, 9845, 9911, 9936, 9976, 9992, 10186, 10452, 10523, 10677, 10716, 10816, 10852, 10950, 11102, 11149, 11169, 11295, 11314, 11377, 11417, 11458, 11641, 11681, 11712, 11892, 11920, 11978, 12016, 12119, 12195, 12561, 12661, 12725, 12727, 12728, 12729, 12839, 12983, 12988, 13032, 13096, 13173, 13175, 13203, 13215, 13239, 13251, 13268, 13300, 13324, 13332, 13390, 13429, 13531, 13588, 13661, 13828, 13873, 13932, 13964, 14013, 14151, 14239, 14356, 14384, 14596, 14625, 14655, 14736, 14797, 14921, 14965, 15001, 15048, 15141, 15181, 15264, 15328, 15416, 15595, 15636, 15706, 15758, 15867, 15908, 16150, 16416, 16457, 16504, 16569, 16622, 16686, 16723, 16814, 16982, 17138, 17210, 17243, 17273, 17303, 17333, 17438, 17516, 17591, 17687, 17747, 17894, 17960, 17984, 18032, 18056, 18080, 18116, 18227, 18301, 18407, 18467, 18605, 18695, 18803, 18917, 18989, 19049, 19304, 19415, 19502, 19583, 19688, 19847, 19961, 20069, 20093, 20126, 20165, 20228, 20276, 20318, 20363, 20423, 20456, 20570, 20651, 20701, 20789, 20834, 20922, 20968, 21075, 21112, 21145, 21185, 21232, 21274, 21313, 21354, 21382, 21410, 21444, 21469, 21473, 21482, 21484, 21486, 21488, 21489, 21514, 21516, 21518, 21542, 21594, 21634, 21700, 21752, 21798, 21800, 21810, 21812, 21828, 21830, 21840, 21842, 21844, 21846, 21848, 21850, 21854, 21885, 21901, 21916, 21933, 21988, 21999, 22016, 22035, 22037, 22038, 22040, 22042, 22044, 22054, 22055, 22057, 22059, 22061, 22066, 22068, 22069, 22189, 22229, 22296, 22312, 22388, 22464, 22496, 22578, 22636, 22664, 22665, 22699, 22730, 22777, 22800, 22882, 22904, 23042, 23069, 23178, 23196, 23198, 23206, 23222, 23230, 23238, 23240, 23302, 23353, 23424, 23502, 23526, 23549, 23632, 23674, 23724, 23805, 23845, 23906, 23937, 24038, 24106, 24174, 24194, 24226, 24290, 24294, 24315, 24356, 24609, 24638, 24698, 24721, 24858, 24898, 24948, 25068, 25218, 25253, 25298, 25375, 25421, 25461, 25575, 25725, 25785, 25926, 26067, 26196, 26280, 26322, 26358, 26424, 26460, 26490, 26514, 26537, 26572, 26674, 26696, 26781, 26806, 26824, 27150, 27177, 27201, 27301, 27358, 27402, 27460, 27494, 27601, 27708, 27786, 27860, 27905, 27981, 28009, 28034, 28061, 28086, 28114, 28140, 28221, 28285, 28538, 28573, 28724, 28762, 28966, 29138, 29166, 29231, 29364, 29434, 29474, 29569, 29585, 29677, 29753, 29882, 29929, 30094, 30160, 30185, 30217, 30229, 30233, 30234, 30235, 30236, 30237, 30242, 30243, 30268, 30282, 30289, 30301, 30329, 30412, 30426, 30433, 30445, 30477, 30602, 30635, 30744, 30783, 30894, 30927, 31110, 31375, 31377, 31379, 31381, 31383, 31384, 31388, 31437, 31458, 31474, 31620, 31770, 32139, 32317, 32321, 32323, 32326, 32344, 32346, 32347, 32349, 32354, 32433, 32518, 32594, 32801, 32820, 32881, 32989, 33060, 33130, 33162, 33233, 33273, 33325, 33344, 33362, 33388, 33408, 33438, 33458, 33561, 33644, 33700, 33880, 33923, 33969, 33982, 33991, 34010, 34025, 34043, 34055, 34065, 34082, 34102, 34112, 34122, 34142, 34158, 34170, 34187, 34211 }; std::vector res; ASSERT_NO_THROW(res = Load("data/keyframe/xvid.txt")); EXPECT_TRUE(expected == res); } TEST(lagi_keyframe, x264) { std::vector expected(41); for (size_t i = 0; i < 41; ++i) expected[i] = i * 250; std::vector res; ASSERT_NO_THROW(res = Load("data/keyframe/x264.log")); EXPECT_TRUE(expected == res); } TEST(lagi_keyframe, aegi) { std::vector expected(135); for (size_t i = 0; i < 135; ++i) expected[i] = i * 250; std::vector res; ASSERT_NO_THROW(res = Load("data/keyframe/aegi.txt")); EXPECT_TRUE(expected == res); } tests/tests/thesaurus.cpp0000664000175000017500000001150614741067256015120 0ustar aniolaniol// Copyright (c) 2012, 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. #include #include #include #include #include class lagi_thes : public libagi { protected: std::string idx_path; std::string dat_path; void SetUp() override { // 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::ios_base::binary); std::ofstream dat(dat_path.c_str(), std::ios_base::binary); idx << "UTF-8" << endl; dat << "UTF-8" << endl; idx << 7 << endl; // entry count idx << "Word 1|" << dat.tellp() << endl; dat << "Word 1|1" << endl; dat << "(noun)|Word 1|Word 1A|Word 1B|Word 1C" << endl; idx << "Word 2|" << dat.tellp() << endl; dat << "Word 2|2" << endl; dat << "(adj)|Word 2|Word 2 adj" << endl; dat << "(noun)|Word 2|Word 2 noun" << endl; dat << "Unindexed Word|1" << endl; dat << "(adv)|Unindexed Word|Indexed Word" << endl; idx << "Word 3|" << dat.tellp() << endl; dat << "Word 3|1" << endl; dat << "(verb)|Not Word 3|Four" << endl; idx << "Too few fields" << endl; idx << "Too many fields|100|100" << endl; idx << "Not a number|foo" << endl; idx << "Out of range|" << dat.tellp() << endl; idx << "Further out of range|" << 1 + dat.tellp() << endl; } }; TEST_F(lagi_thes, parse) { ASSERT_NO_THROW(agi::Thesaurus(dat_path, idx_path)); } TEST_F(lagi_thes, word_1) { agi::Thesaurus thes(dat_path, idx_path); std::vector entries; ASSERT_NO_THROW(entries = thes.Lookup("Word 1")); ASSERT_EQ(1, entries.size()); ASSERT_EQ(3, entries[0].second.size()); EXPECT_STREQ("(noun) Word 1", entries[0].first.c_str()); EXPECT_STREQ("Word 1A", entries[0].second[0].c_str()); EXPECT_STREQ("Word 1B", entries[0].second[1].c_str()); EXPECT_STREQ("Word 1C", entries[0].second[2].c_str()); } TEST_F(lagi_thes, word_2) { agi::Thesaurus thes(dat_path, idx_path); std::vector entries; ASSERT_NO_THROW(entries = thes.Lookup("Word 2")); ASSERT_EQ(2, entries.size()); ASSERT_EQ(1, entries[0].second.size()); ASSERT_EQ(1, entries[1].second.size()); EXPECT_STREQ("(adj) Word 2", entries[0].first.c_str()); EXPECT_STREQ("(noun) Word 2", entries[1].first.c_str()); EXPECT_STREQ("Word 2 adj", entries[0].second[0].c_str()); EXPECT_STREQ("Word 2 noun", entries[1].second[0].c_str()); } TEST_F(lagi_thes, word_3) { agi::Thesaurus thes(dat_path, idx_path); std::vector entries; ASSERT_NO_THROW(entries = thes.Lookup("Word 3")); ASSERT_EQ(1, entries.size()); ASSERT_EQ(1, entries[0].second.size()); EXPECT_STREQ("(verb) Not Word 3", entries[0].first.c_str()); EXPECT_STREQ("Four", entries[0].second[0].c_str()); } TEST_F(lagi_thes, bad_word) { agi::Thesaurus thes(dat_path, idx_path); std::vector entries; ASSERT_NO_THROW(entries = thes.Lookup("Nonexistent word")); EXPECT_EQ(0, entries.size()); } TEST_F(lagi_thes, lookup_clears) { agi::Thesaurus thes(dat_path, idx_path); std::vector entries; ASSERT_NO_THROW(entries = thes.Lookup("Word 1")); ASSERT_NO_THROW(entries = thes.Lookup("Word 2")); ASSERT_NO_THROW(entries = thes.Lookup("Word 3")); EXPECT_EQ(1, entries.size()); } TEST_F(lagi_thes, malformed_index_lines) { agi::Thesaurus thes(dat_path, idx_path); std::vector entries; ASSERT_NO_THROW(entries = thes.Lookup("Too few fields")); EXPECT_EQ(0, entries.size()); ASSERT_NO_THROW(entries = thes.Lookup("Too many fields")); EXPECT_EQ(0, entries.size()); ASSERT_NO_THROW(entries = thes.Lookup("Not a number")); EXPECT_EQ(0, entries.size()); ASSERT_NO_THROW(entries = thes.Lookup("Out of range")); EXPECT_EQ(0, entries.size()); ASSERT_NO_THROW(entries = thes.Lookup("Further out of range")); EXPECT_EQ(0, entries.size()); } TEST_F(lagi_thes, unindexed_word) { agi::Thesaurus thes(dat_path, idx_path); std::vector entries; ASSERT_NO_THROW(entries = thes.Lookup("Unindexed Word")); EXPECT_EQ(0, entries.size()); } tests/tests/uuencode.cpp0000664000175000017500000000354114741067256014704 0ustar aniolaniol// Copyright (c) 2013, 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 using namespace agi::ass; TEST(lagi_uuencode, short_blobs) { std::vector data; auto encode = [&] { return UUEncode(&data[0], &data.back() + 1); }; data.push_back(120); EXPECT_STREQ("?!", encode().c_str()); data.push_back(121); EXPECT_STREQ("?(E", encode().c_str()); data.push_back(122); EXPECT_STREQ("?(F[", encode().c_str()); } TEST(lagi_uuencode, short_strings) { std::vector data; auto decode = [](const char *str) { return UUDecode(str, str + strlen(str)); }; data.push_back(120); EXPECT_EQ(data, decode("?!")); data.push_back(121); EXPECT_EQ(data, decode("?(E")); data.push_back(122); EXPECT_EQ(data, decode("?(F[")); } TEST(lagi_uuencode, random_blobs_roundtrip) { std::vector data; for (size_t len = 0; len < 200; ++len) { auto encoded = UUEncode(data.data(), data.data() + data.size()); EXPECT_EQ(data, UUDecode(encoded.data(), encoded.data() + encoded.size())); data.push_back(rand()); } } tests/tests/util.cpp0000664000175000017500000000251714741067256014054 0ustar aniolaniol// Copyright (c) 2013, 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 class lagi_util : public libagi { }; namespace agi { TEST(lagi_util, try_parse_double) { double d = 0.0; EXPECT_TRUE(util::try_parse("1.0", &d)); EXPECT_EQ(1.0, d); EXPECT_FALSE(util::try_parse("aaa", &d)); EXPECT_EQ(1.0, d); EXPECT_FALSE(util::try_parse("2aaa", &d)); EXPECT_EQ(1.0, d); } TEST(lagi_util, try_parse_int) { int i = 0; EXPECT_TRUE(util::try_parse("1", &i)); EXPECT_EQ(1, i); EXPECT_FALSE(util::try_parse("2.0", &i)); EXPECT_EQ(1.0, i); } } tests/tests/line_iterator.cpp0000664000175000017500000000470314741067256015736 0ustar aniolaniol// Copyright (c) 2010, 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. #include #include #include #include #include #include #include #include template void test_values(agi::line_iterator& iter) { EXPECT_EQ(iter, end(iter)); } template void test_values(agi::line_iterator& iter, First first, Values... values) { EXPECT_FALSE(iter == end(iter)); EXPECT_EQ(*iter, first); EXPECT_NO_THROW(++iter); test_values(iter, values...); } template void test(std::string const& str, const char *encoding, Values... values) { std::stringstream ss(str); agi::line_iterator iter; EXPECT_NO_THROW(iter = agi::line_iterator(ss, encoding)); test_values(iter, values...); } template void expect_eq(const char *str, Values... values) { std::string utf8(str); test(utf8, "utf-8", values...); agi::charset::IconvWrapper conv("utf-8", "utf-16"); auto utf16 = conv.Convert(utf8); test(utf16, "utf-16", values...); } TEST(lagi_line, int) { expect_eq("1\n2\n3\n4", 1, 2, 3, 4); expect_eq("1\n2\n3\n4\n", 1, 2, 3, 4); expect_eq("1\n2\nb\n3\n4", 1, 2, 3, 4); expect_eq("1.0\n2.0\n3.0\n4.0", 1, 2, 3, 4); expect_eq(" 0x16 \n 09 \n -2", 0, 9, -2); } TEST(lagi_line, double) { expect_eq("1.0\n2.0", 1.0, 2.0); expect_eq("#1.0\n\t2.5", 2.5); } TEST(lagi_line, string) { expect_eq("line 1\nline 2\nline 3", "line 1", "line 2", "line 3"); expect_eq(" white space ", " white space "); expect_eq("blank\n\nlines\n", "blank", "", "lines", ""); } tests/tests/format.cpp0000664000175000017500000001130614741067256014363 0ustar aniolaniol// 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 #include TEST(lagi_format, s) { EXPECT_EQ("hello", agi::format("%s", "hello")); EXPECT_EQ("he", agi::format("%.2s", "hello")); EXPECT_EQ("hello", agi::format("%.8s", "hello")); EXPECT_EQ("he", agi::format("%.*s", 2, "hello")); EXPECT_EQ("hello", agi::format("%", "hello")); EXPECT_EQ("hello", agi::format("%s", std::string("hello"))); EXPECT_EQ("he", agi::format("%.2s", std::string("hello"))); EXPECT_EQ("true", agi::format("%s", true)); EXPECT_EQ("false", agi::format("%s", false)); } TEST(lagi_format, c) { EXPECT_EQ("a", agi::format("%c", 'a')); EXPECT_EQ("a", agi::format("%c", (int)'a')); } TEST(lagi_format, d) { EXPECT_EQ("10", agi::format("%i", 10)); EXPECT_EQ("10", agi::format("%d", 10)); EXPECT_EQ("-10", agi::format("%d", -10)); EXPECT_EQ("1", agi::format("%d", 1.1)); EXPECT_EQ("97", agi::format("%d", 'a')); EXPECT_EQ("97", agi::format("%d", (int)'a')); EXPECT_EQ("1", agi::format("%d", true)); } TEST(lagi_format, o) { EXPECT_EQ("15", agi::format("%o", 015)); } TEST(lagi_format, u) { EXPECT_EQ("10", agi::format("%u", 10)); EXPECT_EQ(std::to_string(static_cast(-10)), agi::format("%u", -10)); } TEST(lagi_format, x) { EXPECT_EQ("deadbeef", agi::format("%x", 0xdeadbeef)); EXPECT_EQ("DEADBEEF", agi::format("%X", 0xDEADBEEF)); } TEST(lagi_format, e) { EXPECT_EQ("1.234560e+10", agi::format("%e", 1.23456e10)); EXPECT_EQ("-1.234560E+10", agi::format("%E", -1.23456E10)); } TEST(lagi_format, f) { EXPECT_EQ("-9.876500", agi::format("%f", -9.8765)); EXPECT_EQ("9.876500", agi::format("%F", 9.8765)); } TEST(lagi_format, g) { EXPECT_EQ("10", agi::format("%g", 10)); EXPECT_EQ("100", agi::format("%G", 100)); } TEST(lagi_format, escape) { EXPECT_EQ("%d", agi::format("%%d")); EXPECT_EQ("%d", agi::format("%%d", 5)); } TEST(lagi_format, length_modifiers) { EXPECT_EQ("10", agi::format("%hd", 10)); EXPECT_EQ("10", agi::format("%ld", 10)); EXPECT_EQ("10", agi::format("%lld", 10)); EXPECT_EQ("10", agi::format("%zd", 10)); EXPECT_EQ("10", agi::format("%td", 10)); EXPECT_EQ("10", agi::format("%jd", 10)); } TEST(lagi_format, precision_width) { EXPECT_EQ("05", agi::format("%02X", 5)); EXPECT_EQ(" -10", agi::format("%10d", -10)); EXPECT_EQ("-10 ", agi::format("%-10d", -10)); EXPECT_EQ("0010", agi::format("%04d", 10)); EXPECT_EQ(" 1234.1235", agi::format("%10.4f", 1234.1234567890)); EXPECT_EQ("10", agi::format("%.f", 10.1)); EXPECT_EQ("0000000100", agi::format("%010d", 100)); EXPECT_EQ("-000000010", agi::format("%010d", -10)); EXPECT_EQ("0X0000BEEF", agi::format("%#010X", 0xBEEF)); } TEST(lagi_format, flags) { EXPECT_EQ("0x271828", agi::format("%#x", 0x271828)); EXPECT_EQ("011614050", agi::format("%#o", 0x271828)); EXPECT_EQ("3.000000", agi::format("%#f", 3.0)); EXPECT_EQ("+3", agi::format("%+d", 3)); EXPECT_EQ("+0", agi::format("%+d", 0)); EXPECT_EQ("-3", agi::format("%+d", -3)); EXPECT_EQ("10 ", agi::format("%-010d", 10)); EXPECT_EQ("10 ", agi::format("%0-10d", 10)); } TEST(lagi_format, bad_cast) { EXPECT_THROW(agi::format("%d", "hello"), std::bad_cast); EXPECT_THROW(agi::format("%.*s", "hello", "str"), std::bad_cast); } TEST(lagi_format, wchar_t) { EXPECT_EQ(L"asdf", agi::format(L"%s", L"asdf")); EXPECT_EQ(L"asdf", agi::format(L"%s", "asdf")); EXPECT_EQ("asdf", agi::format("%s", L"asdf")); EXPECT_EQ(L"\x2603", agi::format(L"%s", L"\x2603")); EXPECT_EQ(L"\x2603", agi::format(L"%s", "\xE2\x98\x83")); EXPECT_EQ("\xE2\x98\x83", agi::format("%s", L"\x2603")); EXPECT_EQ(L"asdf", agi::format(L"%s", std::wstring(L"asdf"))); EXPECT_EQ(L"asdf", agi::format(L"%s", std::string("asdf"))); EXPECT_EQ("asdf", agi::format("%s", std::wstring(L"asdf"))); } TEST(lagi_format, path) { EXPECT_EQ("/usr/bin", agi::format("%s", agi::fs::path("/usr/bin"))); EXPECT_EQ(L"/usr/bin", agi::format(L"%s", agi::fs::path("/usr/bin"))); } tests/tests/line_wrap.cpp0000664000175000017500000001273114741067256015056 0ustar aniolaniol// Copyright (c) 2012, 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. #include #include #include using namespace agi; using namespace util; TEST(lagi_wrap, no_wrapping_needed) { for (int i = Wrap_Balanced_FirstLonger; i <= Wrap_Balanced_LastLonger; ++i) ASSERT_NO_THROW(get_wrap_points(std::vector{}, 100, (agi::WrapMode)i)); for (int i = Wrap_Balanced_FirstLonger; i <= Wrap_Balanced_LastLonger; ++i) ASSERT_NO_THROW(get_wrap_points(std::vector{ 10 }, 100, (agi::WrapMode)i)); for (int i = Wrap_Balanced_FirstLonger; i <= Wrap_Balanced_LastLonger; ++i) EXPECT_TRUE(get_wrap_points(std::vector{ 99 }, 100, (agi::WrapMode)i).empty()); for (int i = Wrap_Balanced_FirstLonger; i <= Wrap_Balanced_LastLonger; ++i) EXPECT_TRUE(get_wrap_points(std::vector{ 25, 25, 25, 24 }, 100, (agi::WrapMode)i).empty()); for (int i = Wrap_Balanced_FirstLonger; i <= Wrap_Balanced_LastLonger; ++i) EXPECT_TRUE(get_wrap_points(std::vector{ 101 }, 100, (agi::WrapMode)i).empty()); } TEST(lagi_wrap, greedy) { std::vector ret; ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 10, 10 }, 20, Wrap_Greedy)); EXPECT_EQ(0, ret.size()); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 10, 10 }, 19, Wrap_Greedy)); ASSERT_EQ(1, ret.size()); EXPECT_EQ(1, ret[0]); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 10, 10 }, 9, Wrap_Greedy)); ASSERT_EQ(1, ret.size()); EXPECT_EQ(1, ret[0]); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 5, 5, 5, 1 }, 15, Wrap_Greedy)); ASSERT_EQ(1, ret.size()); EXPECT_EQ(3, ret[0]); ASSERT_NO_THROW(ret = get_wrap_points(std::vector(10, 3), 7, Wrap_Greedy)); ASSERT_EQ(4, ret.size()); EXPECT_EQ(2, ret[0]); EXPECT_EQ(4, ret[1]); EXPECT_EQ(6, ret[2]); EXPECT_EQ(8, ret[3]); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 6, 7, 6, 8, 10, 10, 3, 4, 10 }, 20, Wrap_Greedy)); ASSERT_EQ(3, ret.size()); EXPECT_EQ(3, ret[0]); EXPECT_EQ(5, ret[1]); EXPECT_EQ(8, ret[2]); } TEST(lagi_wrap, first_longer) { std::vector ret; ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 10, 10 }, 20, Wrap_Balanced_FirstLonger)); EXPECT_EQ(0, ret.size()); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 10, 10 }, 19, Wrap_Balanced_FirstLonger)); ASSERT_EQ(1, ret.size()); EXPECT_EQ(1, ret[0]); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 10, 10 }, 9, Wrap_Balanced_FirstLonger)); ASSERT_EQ(1, ret.size()); EXPECT_EQ(1, ret[0]); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 5, 5, 1 }, 10, Wrap_Balanced_FirstLonger)); ASSERT_EQ(1, ret.size()); EXPECT_EQ(2, ret[0]); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 5, 5, 5, 1 }, 15, Wrap_Balanced_FirstLonger)); ASSERT_EQ(1, ret.size()); EXPECT_EQ(2, ret[0]); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 6, 5, 5 }, 10, Wrap_Balanced_FirstLonger)); ASSERT_EQ(1, ret.size()); EXPECT_EQ(1, ret[0]); } TEST(lagi_wrap, last_longer) { std::vector ret; ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 10, 10 }, 20, Wrap_Balanced_LastLonger)); EXPECT_EQ(0, ret.size()); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 10, 10 }, 19, Wrap_Balanced_LastLonger)); ASSERT_EQ(1, ret.size()); EXPECT_EQ(1, ret[0]); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 10, 10 }, 9, Wrap_Balanced_LastLonger)); ASSERT_EQ(1, ret.size()); EXPECT_EQ(1, ret[0]); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 5, 5, 1 }, 10, Wrap_Balanced_LastLonger)); ASSERT_EQ(1, ret.size()); EXPECT_EQ(1, ret[0]); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 5, 5, 5, 1 }, 15, Wrap_Balanced_LastLonger)); ASSERT_EQ(1, ret.size()); EXPECT_EQ(1, ret[0]); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 5, 5, 6 }, 10, Wrap_Balanced_LastLonger)); ASSERT_EQ(1, ret.size()); EXPECT_EQ(2, ret[0]); } TEST(lagi_wrap, balanced) { std::vector ret; ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 10, 10 }, 20, Wrap_Balanced)); EXPECT_EQ(0, ret.size()); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 10, 10 }, 19, Wrap_Balanced)); ASSERT_EQ(1, ret.size()); EXPECT_EQ(1, ret[0]); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 10, 10 }, 9, Wrap_Balanced)); ASSERT_EQ(1, ret.size()); EXPECT_EQ(1, ret[0]); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 5, 5, 1 }, 10, Wrap_Balanced)); ASSERT_EQ(1, ret.size()); EXPECT_EQ(1, ret[0]); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 5, 5, 5, 1 }, 15, Wrap_Balanced)); ASSERT_EQ(1, ret.size()); EXPECT_EQ(2, ret[0]); ASSERT_NO_THROW(ret = get_wrap_points(std::vector{ 6, 7, 6, 8, 10, 10, 3, 4, 10 }, 20, Wrap_Balanced)); ASSERT_EQ(3, ret.size()); EXPECT_EQ(3, ret[0]); EXPECT_EQ(5, ret[1]); EXPECT_EQ(7, ret[2]); } tests/tests/path.cpp0000664000175000017500000001342014741067256014026 0ustar aniolaniol// Copyright (c) 2013, 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. #include #include #include #include using agi::Path; using namespace std::string_view_literals; #ifdef _WIN32 #define DS "\\" #else #define DS "/" #endif TEST(lagi_path, invalid_token_name_throws_internal_error) { Path p; // These are InternalError because the tokens are currently always hardcoded EXPECT_THROW(p.SetToken("no ?", "path"), agi::InternalError); EXPECT_THROW(p.SetToken("?bad", "path"), agi::InternalError); } TEST(lagi_path, relative_path_clears_token) { Path p; EXPECT_NO_THROW(p.SetToken("?video", "relative/path")); EXPECT_STREQ("?video", p.Decode("?video").string().c_str()); EXPECT_NO_THROW(p.SetToken("?video", agi::fs::path(agi::fs::CurrentPath()))); EXPECT_STRNE("?video", p.Decode("?video").string().c_str()); EXPECT_NO_THROW(p.SetToken("?video", "relative/path")); EXPECT_STREQ("?video", p.Decode("?video").string().c_str()); } TEST(lagi_path, empty_path_clears_token) { Path p; EXPECT_NO_THROW(p.SetToken("?video", agi::fs::CurrentPath())); EXPECT_STRNE("?video", p.Decode("?video").string().c_str()); EXPECT_NO_THROW(p.SetToken("?video", "")); EXPECT_STREQ("?video", p.Decode("?video").string().c_str()); } TEST(lagi_path, decode_sets_uses_right_slashes) { Path p; agi::fs::path expected = agi::fs::CurrentPath()/"foo/bar.txt"; expected.make_preferred(); EXPECT_NO_THROW(p.SetToken("?video", agi::fs::CurrentPath())); agi::fs::path decoded; ASSERT_NO_THROW(decoded = p.Decode("?video/foo/bar.txt")); EXPECT_STREQ(expected.string().c_str(), decoded.string().c_str()); } TEST(lagi_path, trailing_slash_on_token_is_optional) { Path p; agi::fs::path expected = agi::fs::CurrentPath()/"foo.txt"; expected.make_preferred(); EXPECT_NO_THROW(p.SetToken("?audio", agi::fs::CurrentPath())); agi::fs::path decoded; ASSERT_NO_THROW(decoded = p.Decode("?audiofoo.txt")); EXPECT_STREQ(expected.string().c_str(), decoded.string().c_str()); ASSERT_NO_THROW(decoded = p.Decode("?audio/foo.txt")); EXPECT_STREQ(expected.string().c_str(), decoded.string().c_str()); } TEST(lagi_path, setting_token_to_file_sets_to_parent_directory_instead) { Path p; agi::fs::path file = agi::fs::Absolute("data/file"); ASSERT_NO_THROW(p.SetToken("?script", file)); EXPECT_STREQ(file.parent_path().string().c_str(), p.Decode("?script").string().c_str()); file = agi::fs::Absolute("data/dir"); ASSERT_NO_THROW(p.SetToken("?script", file)); EXPECT_STREQ(file.string().c_str(), p.Decode("?script").string().c_str()); } TEST(lagi_path, valid_token_names) { Path p; EXPECT_NO_THROW(p.SetToken("?user", "")); EXPECT_NO_THROW(p.SetToken("?local", "")); EXPECT_NO_THROW(p.SetToken("?data", "")); EXPECT_NO_THROW(p.SetToken("?temp", "")); EXPECT_NO_THROW(p.SetToken("?dictionary", "")); EXPECT_NO_THROW(p.SetToken("?audio", "")); EXPECT_NO_THROW(p.SetToken("?script", "")); EXPECT_NO_THROW(p.SetToken("?video", "")); } #define TEST_PLATFORM_PATH_TOKEN(tok) \ do { \ agi::fs::path d; \ ASSERT_NO_THROW(d = p.Decode(tok)); \ ASSERT_FALSE(d.empty()); \ ASSERT_STRNE(tok, d.string().c_str()); \ } while (false) TEST(lagi_path, platform_paths_have_values) { Path p; #ifndef __APPLE__ // Uses the bundle path so it isn't set when not running in a bundle TEST_PLATFORM_PATH_TOKEN("?data"); #endif TEST_PLATFORM_PATH_TOKEN("?user"); TEST_PLATFORM_PATH_TOKEN("?local"); TEST_PLATFORM_PATH_TOKEN("?temp"); } TEST(lagi_path, making_empty_absolute_gives_empty) { Path p; ASSERT_NO_THROW(p.MakeAbsolute("", "?data")); EXPECT_TRUE(p.MakeAbsolute("", "?data").empty()); } TEST(lagi_path, making_empty_relative_gives_empty) { Path p; ASSERT_NO_THROW(p.MakeRelative("", "?data"sv)); EXPECT_TRUE(p.MakeRelative("", "?data"sv).empty()); } #ifdef _WIN32 TEST(lagi_path, make_absolute_on_network_path) { Path p; ASSERT_NO_THROW(p.MakeAbsolute("//foo/bar", "?data")); EXPECT_STREQ("\\\\foo\\bar", p.MakeAbsolute("//foo/bar", "?data").string().c_str()); } TEST(lagi_path, make_relative_on_network_path) { Path p; ASSERT_NO_THROW(p.MakeRelative("\\\\foo\\bar", "?data"sv)); EXPECT_STREQ("\\\\foo\\bar", p.MakeRelative("\\\\foo\\bar", "?data"sv).string().c_str()); } #endif #define EXPECT_UNCHANGED(url, func) EXPECT_STREQ(url, p.func(url, "?data"sv).string().c_str()) TEST(lagi_path, make_absolute_on_dummy_url) { Path p; EXPECT_UNCHANGED("dummy-audio:silence?sr=44100&bd=16&ch=1&ln=396900000", MakeAbsolute); EXPECT_UNCHANGED("?dummy:23.976000:40000:1280:720:47:163:254:", MakeAbsolute); } TEST(lagi_path, make_relative_on_dummy_url) { Path p; EXPECT_UNCHANGED("dummy-audio:silence?sr=44100&bd=16&ch=1&ln=396900000", MakeRelative); 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 tests/tests/vfr.cpp0000664000175000017500000006045314741067256013677 0ustar aniolaniol// Copyright (c) 2010, 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 #include #include #include #include using namespace agi::vfr; using namespace util; #define EXPECT_RANGE(low, high, test) \ EXPECT_LE(low, test); \ EXPECT_GE(high, test) TEST(lagi_vfr, constructors_good) { EXPECT_NO_THROW(Framerate(1.)); EXPECT_NO_THROW(Framerate(Framerate(1.))); EXPECT_NO_THROW(Framerate({ 0, 10 })); EXPECT_NO_THROW(Framerate("data/vfr/in/v1_start_equals_end.txt")); EXPECT_NO_THROW(Framerate("data/vfr/in/v1_whitespace.txt")); EXPECT_NO_THROW(Framerate("data/vfr/in/v1_assume_int.txt")); EXPECT_NO_THROW(Framerate("data/vfr/in/v1_out_of_order.txt")); } TEST(lagi_vfr, constructors_bad_cfr) { EXPECT_THROW(Framerate(-1.), InvalidFramerate); EXPECT_THROW(Framerate(1000.1), InvalidFramerate); } TEST(lagi_vfr, constructors_bad_timecodes) { EXPECT_THROW(Framerate(std::initializer_list{}), InvalidFramerate); EXPECT_THROW(Framerate({0}), InvalidFramerate); EXPECT_THROW(Framerate({10, 0}), InvalidFramerate); EXPECT_THROW(Framerate({0, 0}), InvalidFramerate); } TEST(lagi_vfr, constructors_bad_v1) { EXPECT_THROW(Framerate("data/vfr/in/v1_bad_seperators.txt"), MalformedLine); EXPECT_THROW(Framerate("data/vfr/in/v1_too_few_parts.txt"), MalformedLine); EXPECT_THROW(Framerate("data/vfr/in/v1_too_many_parts.txt"), MalformedLine); EXPECT_THROW(Framerate("data/vfr/in/v1_float_frame_number.txt"), MalformedLine); EXPECT_THROW(Framerate("data/vfr/in/v1_start_end_overlap.txt"), InvalidFramerate); EXPECT_THROW(Framerate("data/vfr/in/v1_fully_contained.txt"), InvalidFramerate); EXPECT_THROW(Framerate("data/vfr/in/v1_assume_over_1000.txt"), InvalidFramerate); EXPECT_THROW(Framerate("data/vfr/in/v1_override_over_1000.txt"), InvalidFramerate); EXPECT_THROW(Framerate("data/vfr/in/v1_override_zero.txt"), InvalidFramerate); EXPECT_THROW(Framerate("data/vfr/in/v1_negative_start_of_range.txt"), InvalidFramerate); EXPECT_THROW(Framerate("data/vfr/in/v1_end_less_than_start.txt"), InvalidFramerate); } TEST(lagi_vfr, constructors_bad_v2) { EXPECT_THROW(Framerate("data/vfr/in/v2_empty.txt"), InvalidFramerate); EXPECT_THROW(Framerate("data/vfr/in/v2_out_of_order.txt"), InvalidFramerate); EXPECT_THROW(Framerate("data/vfr/in/empty.txt"), UnknownFormat); } TEST(lagi_vfr, cfr_frame_at_time_exact) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(1.)); EXPECT_EQ(0, fps.FrameAtTime(0)); EXPECT_EQ(0, fps.FrameAtTime(999)); EXPECT_EQ(1, fps.FrameAtTime(1000)); EXPECT_EQ(1, fps.FrameAtTime(1999)); EXPECT_EQ(100, fps.FrameAtTime(100000)); EXPECT_EQ(-1, fps.FrameAtTime(-1)); EXPECT_EQ(-1, fps.FrameAtTime(-1000)); EXPECT_EQ(-2, fps.FrameAtTime(-1001)); } TEST(lagi_vfr, cfr_frame_at_time_start) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(1.)); EXPECT_EQ(0, fps.FrameAtTime(0, START)); EXPECT_EQ(1, fps.FrameAtTime(1, START)); EXPECT_EQ(1, fps.FrameAtTime(1000, START)); EXPECT_EQ(2, fps.FrameAtTime(1001, START)); EXPECT_EQ(100, fps.FrameAtTime(100000, START)); EXPECT_EQ(0, fps.FrameAtTime(-1, START)); EXPECT_EQ(0, fps.FrameAtTime(-999, START)); EXPECT_EQ(-1, fps.FrameAtTime(-1000, START)); EXPECT_EQ(-1, fps.FrameAtTime(-1999, START)); } TEST(lagi_vfr, cfr_frame_at_time_end) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(1.)); EXPECT_EQ(-1, fps.FrameAtTime(0, END)); EXPECT_EQ(0, fps.FrameAtTime(1, END)); EXPECT_EQ(0, fps.FrameAtTime(1000, END)); EXPECT_EQ(1, fps.FrameAtTime(1001, END)); EXPECT_EQ(99, fps.FrameAtTime(100000, END)); EXPECT_EQ(-1, fps.FrameAtTime(-1, END)); EXPECT_EQ(-1, fps.FrameAtTime(-999, END)); EXPECT_EQ(-2, fps.FrameAtTime(-1000, END)); EXPECT_EQ(-2, fps.FrameAtTime(-1999, END)); } TEST(lagi_vfr, cfr_time_at_frame_exact) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(1.)); EXPECT_EQ( 0, fps.TimeAtFrame(0)); EXPECT_EQ( 1000, fps.TimeAtFrame(1)); EXPECT_EQ( 2000, fps.TimeAtFrame(2)); EXPECT_EQ(-1000, fps.TimeAtFrame(-1)); } TEST(lagi_vfr, cfr_time_at_frame_start) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(1.)); EXPECT_RANGE( -999, 0, fps.TimeAtFrame( 0, START)); EXPECT_RANGE( 1, 1000, fps.TimeAtFrame( 1, START)); EXPECT_RANGE( 1001, 2000, fps.TimeAtFrame( 2, START)); EXPECT_RANGE(-1999, -1000, fps.TimeAtFrame(-1, START)); } TEST(lagi_vfr, cfr_time_at_frame_end) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(1.)); EXPECT_RANGE( 1, 1000, fps.TimeAtFrame( 0, END)); EXPECT_RANGE(1001, 2000, fps.TimeAtFrame( 1, END)); EXPECT_RANGE(2001, 3000, fps.TimeAtFrame( 2, END)); EXPECT_RANGE(-999, 0, fps.TimeAtFrame(-1, END)); } TEST(lagi_vfr, cfr_round_trip_exact) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(1.)); for (int i = -10; i < 11; i++) { EXPECT_EQ(i, fps.FrameAtTime(fps.TimeAtFrame(i))); } ASSERT_NO_THROW(fps = Framerate(24000, 1001)); int frames[] = {-100, -10, -1, 0, 1, 10, 100, 6820}; for (int i : frames) { EXPECT_EQ(i, fps.FrameAtTime(fps.TimeAtFrame(i))); } } TEST(lagi_vfr, cfr_round_trip_start) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(1.)); for (int i = -10; i < 11; i++) { EXPECT_EQ(i, fps.FrameAtTime(fps.TimeAtFrame(i, START), START)); } ASSERT_NO_THROW(fps = Framerate(24000, 1001)); int frames[] = {-100, -10, -1, 0, 1, 10, 100, 6820}; for (int i : frames) { EXPECT_EQ(i, fps.FrameAtTime(fps.TimeAtFrame(i, START), START)); } } TEST(lagi_vfr, cfr_round_trip_end) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(1.)); for (int i = -10; i < 11; i++) { EXPECT_EQ(i, fps.FrameAtTime(fps.TimeAtFrame(i, END), END)); } ASSERT_NO_THROW(fps = Framerate(24000, 1001)); int frames[] = {-100, -10, -1, 0, 1, 10, 100, 6820}; for (int i : frames) { EXPECT_EQ(i, fps.FrameAtTime(fps.TimeAtFrame(i, END), END)); } } TEST(lagi_vfr, vfr_round_trip_exact) { Framerate fps; ASSERT_NO_THROW(fps = Framerate({ 0, 1000, 1500, 2000, 2001, 2002, 2003 })); for (int i = -10; i < 11; i++) { EXPECT_EQ(i, fps.FrameAtTime(fps.TimeAtFrame(i))); } } TEST(lagi_vfr, vfr_round_trip_start) { Framerate fps; ASSERT_NO_THROW(fps = Framerate({ 0, 1000, 1500, 2000, 2001, 2002, 2003 })); for (int i = -10; i < 11; i++) { EXPECT_EQ(i, fps.FrameAtTime(fps.TimeAtFrame(i, START), START)); } } TEST(lagi_vfr, vfr_round_trip_end) { Framerate fps; ASSERT_NO_THROW(fps = Framerate({ 0, 1000, 1500, 2000, 2001, 2002, 2003 })); for (int i = -10; i < 11; i++) { EXPECT_EQ(i, fps.FrameAtTime(fps.TimeAtFrame(i, END), END)); } } TEST(lagi_vfr, vfr_time_at_frame_exact) { Framerate fps; ASSERT_NO_THROW(fps = Framerate({ 0, 1000, 1500, 2000, 2001 })); EXPECT_EQ(0, fps.TimeAtFrame(0)); EXPECT_EQ(1000, fps.TimeAtFrame(1)); EXPECT_EQ(1500, fps.TimeAtFrame(2)); EXPECT_EQ(2000, fps.TimeAtFrame(3)); EXPECT_EQ(2001, fps.TimeAtFrame(4)); } TEST(lagi_vfr, vfr_time_at_frame_start) { Framerate fps; ASSERT_NO_THROW(fps = Framerate({ 0, 1000, 1500, 2000, 2001, 2002, 2003 })); EXPECT_GE(0, fps.TimeAtFrame(0, START)); EXPECT_RANGE(1, 1000, fps.TimeAtFrame(1, START)); EXPECT_RANGE(1001, 1500, fps.TimeAtFrame(2, START)); EXPECT_RANGE(1501, 2000, fps.TimeAtFrame(3, START)); EXPECT_EQ(2001, fps.TimeAtFrame(4, START)); EXPECT_EQ(2002, fps.TimeAtFrame(5, START)); EXPECT_LE(2003, fps.TimeAtFrame(6, START)); } TEST(lagi_vfr, vfr_time_at_frame_end) { Framerate fps; ASSERT_NO_THROW(fps = Framerate({ 0, 1000, 1500, 2000, 2001, 2002, 2003 })); EXPECT_RANGE(1, 1000, fps.TimeAtFrame(0, END)); EXPECT_RANGE(1001, 1500, fps.TimeAtFrame(1, END)); EXPECT_RANGE(1501, 2000, fps.TimeAtFrame(2, END)); EXPECT_EQ(2001, fps.TimeAtFrame(3, END)); EXPECT_EQ(2002, fps.TimeAtFrame(4, END)); EXPECT_EQ(2003, fps.TimeAtFrame(5, END)); EXPECT_LE(2004, fps.TimeAtFrame(6, END)); } TEST(lagi_vfr, vfr_time_at_frame_outside_range) { Framerate fps; ASSERT_NO_THROW(fps = Framerate({ 0, 100, 200 })); EXPECT_GT(0, fps.TimeAtFrame(-1)); EXPECT_EQ(0, fps.TimeAtFrame(0)); EXPECT_EQ(100, fps.TimeAtFrame(1)); EXPECT_EQ(200, fps.TimeAtFrame(2)); EXPECT_LT(200, fps.TimeAtFrame(3)); int prev = fps.TimeAtFrame(3); for (int i = 4; i < 10; i++) { EXPECT_LT(prev, fps.TimeAtFrame(i)); prev = fps.TimeAtFrame(i); } } TEST(lagi_vfr, vfr_frame_at_time_exact) { Framerate fps; ASSERT_NO_THROW(fps = Framerate({ 0, 1000, 1500, 2000, 2001, 2002, 2003 })); EXPECT_GT(0, fps.FrameAtTime(-1)); EXPECT_EQ(0, fps.FrameAtTime(0)); EXPECT_EQ(0, fps.FrameAtTime(999)); EXPECT_EQ(1, fps.FrameAtTime(1000)); EXPECT_EQ(1, fps.FrameAtTime(1499)); EXPECT_EQ(2, fps.FrameAtTime(1500)); EXPECT_EQ(2, fps.FrameAtTime(1999)); EXPECT_EQ(3, fps.FrameAtTime(2000)); EXPECT_EQ(4, fps.FrameAtTime(2001)); EXPECT_EQ(5, fps.FrameAtTime(2002)); EXPECT_EQ(6, fps.FrameAtTime(2003)); EXPECT_LE(6, fps.FrameAtTime(2004)); } TEST(lagi_vfr, vfr_frame_at_time_start) { Framerate fps; ASSERT_NO_THROW(fps = Framerate({ 0, 1000, 1500, 2000, 2001, 2002, 2003 })); EXPECT_GE(0, fps.FrameAtTime(-1, START)); EXPECT_EQ(0, fps.FrameAtTime(0, START)); EXPECT_EQ(1, fps.FrameAtTime(1, START)); EXPECT_EQ(1, fps.FrameAtTime(1000, START)); EXPECT_EQ(2, fps.FrameAtTime(1001, START)); EXPECT_EQ(2, fps.FrameAtTime(1500, START)); EXPECT_EQ(3, fps.FrameAtTime(1501, START)); EXPECT_EQ(3, fps.FrameAtTime(2000, START)); EXPECT_EQ(4, fps.FrameAtTime(2001, START)); EXPECT_EQ(5, fps.FrameAtTime(2002, START)); EXPECT_EQ(6, fps.FrameAtTime(2003, START)); EXPECT_LE(6, fps.FrameAtTime(2004, START)); } bool validate_save(std::string const& goodFilename, std::string const& checkFilename, int v2Lines = -1, bool allowLonger = false) { std::ifstream good(goodFilename.c_str()); std::ifstream check(checkFilename.c_str()); EXPECT_TRUE(good.good()); EXPECT_TRUE(check.good()); std::string good_header; std::string check_header; std::getline(good, good_header); std::getline(check, check_header); // istream_iterator rather than line_reader because we never write comments // or empty lines in timecode files std::istream_iterator good_iter(good); std::istream_iterator check_iter(check); std::istream_iterator end; int line = 0; for (; good_iter != end; ++good_iter, ++check_iter, ++line) { if (check_iter == end) return false; if (v2Lines < 0 || line < v2Lines) { if (*good_iter != *check_iter) return false; } } // v1 timecodes with the end of a range past the end of the video are valid, // and when saving those there will be too many timecodes in the v2 file if (!allowLonger && check_iter != end) return false; return true; } TEST(lagi_vfr, validate_save) { EXPECT_TRUE(validate_save("data/vfr/in/validate_base.txt", "data/vfr/in/validate_base.txt")); EXPECT_FALSE(validate_save("data/vfr/in/validate_base.txt", "data/vfr/in/validate_different.txt")); EXPECT_FALSE(validate_save("data/vfr/in/validate_base.txt", "data/vfr/in/validate_shorter.txt")); EXPECT_FALSE(validate_save("data/vfr/in/validate_base.txt", "data/vfr/in/validate_longer.txt")); EXPECT_TRUE(validate_save("data/vfr/in/validate_base.txt", "data/vfr/in/validate_longer.txt", -1, true)); } TEST(lagi_vfr, save_vfr_nolen) { Framerate fps; ASSERT_NO_THROW(fps = Framerate({ 0, 100, 200 })); ASSERT_NO_THROW(fps.Save("data/vfr/out/v2_nolen.txt")); EXPECT_TRUE(validate_save("data/vfr/in/v2_nolen.txt", "data/vfr/out/v2_nolen.txt")); } TEST(lagi_vfr, save_vfr_len) { Framerate fps; ASSERT_NO_THROW(fps = Framerate({ 0, 100, 200 })); ASSERT_NO_THROW(fps.Save("data/vfr/out/v2_len_3_10.txt", 10)); EXPECT_TRUE(validate_save("data/vfr/in/v2_len_3_10.txt", "data/vfr/out/v2_len_3_10.txt", 3)); } TEST(lagi_vfr, load_v2) { Framerate fps; ASSERT_NO_THROW(fps = Framerate("data/vfr/in/v2_1fps.txt")); for (int i = 0; i < 30; i++) { EXPECT_EQ(i * 1000, fps.TimeAtFrame(i)); } } TEST(lagi_vfr, load_v2_comments) { Framerate fps; ASSERT_NO_THROW(fps = Framerate("data/vfr/in/v2_comments.txt")); for (int i = 0; i < 30; i++) { EXPECT_EQ(i * 1000, fps.TimeAtFrame(i)); } } TEST(lagi_vfr, load_v2_number_in_comment) { Framerate fps; ASSERT_NO_THROW(fps = Framerate("data/vfr/in/v2_number_in_comment.txt")); for (int i = 0; i < 30; i++) { EXPECT_EQ(i * 1000, fps.TimeAtFrame(i)); } } TEST(lagi_vfr, load_v1_save_v2) { Framerate fps; ASSERT_NO_THROW(fps = Framerate("data/vfr/in/v1_mode5.txt")); EXPECT_NO_THROW(fps.Save("data/vfr/out/v2_mode5.txt")); EXPECT_TRUE(validate_save("data/vfr/in/v2_mode5.txt", "data/vfr/out/v2_mode5.txt", -1, true)); } TEST(lagi_vfr, load_v1_save_v2_len) { Framerate fps; ASSERT_NO_THROW(fps = Framerate("data/vfr/in/v1_assume_30.txt")); ASSERT_NO_THROW(fps.Save("data/vfr/out/v2_100_frames_30_fps.txt", 100)); EXPECT_TRUE(validate_save("data/vfr/in/v2_100_frames_30_fps.txt", "data/vfr/out/v2_100_frames_30_fps.txt")); } TEST(lagi_vfr, load_v1_save_v2_ovr) { Framerate fps; ASSERT_NO_THROW(fps = Framerate("data/vfr/in/v1_assume_30_with_override.txt")); ASSERT_NO_THROW(fps.Save("data/vfr/out/v2_100_frames_30_with_override.txt", 100)); EXPECT_TRUE(validate_save("data/vfr/in/v2_100_frames_30_with_override.txt", "data/vfr/out/v2_100_frames_30_with_override.txt")); } TEST(lagi_vfr, nonzero_start_time) { Framerate fps; ASSERT_NO_THROW(fps = Framerate({ 10, 20, 30, 40, 50 })); EXPECT_EQ(0, fps.TimeAtFrame(0, EXACT)); EXPECT_EQ(10, fps.TimeAtFrame(1, EXACT)); EXPECT_EQ(20, fps.TimeAtFrame(2, EXACT)); EXPECT_EQ(30, fps.TimeAtFrame(3, EXACT)); EXPECT_EQ(40, fps.TimeAtFrame(4, EXACT)); ASSERT_NO_THROW(fps = Framerate({ -10, 20, 30, 40, 50 })); EXPECT_EQ(0, fps.TimeAtFrame(0, EXACT)); EXPECT_EQ(30, fps.TimeAtFrame(1, EXACT)); EXPECT_EQ(40, fps.TimeAtFrame(2, EXACT)); EXPECT_EQ(50, fps.TimeAtFrame(3, EXACT)); EXPECT_EQ(60, fps.TimeAtFrame(4, EXACT)); } TEST(lagi_vfr, rational_timebase) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(30000, 1001)); for (int i = 0; i < 100000; ++i) { EXPECT_EQ(i * 1001, fps.TimeAtFrame(i * 30, EXACT)); EXPECT_EQ(i * 30, fps.FrameAtTime(i * 1001, EXACT)); } ASSERT_NO_THROW(fps = Framerate(24000, 1001)); for (int i = 0; i < 100000; ++i) { EXPECT_EQ(i * 1001, fps.TimeAtFrame(i * 24, EXACT)); EXPECT_EQ(i * 24, fps.FrameAtTime(i * 1001, EXACT)); } } TEST(lagi_vfr, no_intermediate_overflow) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(1.0)); int last_frame = INT_MAX / 1000; EXPECT_EQ(last_frame * 1000, fps.TimeAtFrame(last_frame, EXACT)); EXPECT_EQ(last_frame, fps.FrameAtTime(last_frame * 1000, EXACT)); } TEST(lagi_vfr, duplicate_timestamps) { Framerate fps; ASSERT_NO_THROW(fps = Framerate({ 0, 0, 1, 2, 2, 3 })); EXPECT_EQ(1, fps.FrameAtTime(0, EXACT)); EXPECT_EQ(2, fps.FrameAtTime(1, EXACT)); EXPECT_EQ(4, fps.FrameAtTime(2, EXACT)); EXPECT_EQ(5, fps.FrameAtTime(3, EXACT)); EXPECT_EQ(0, fps.TimeAtFrame(0, EXACT)); EXPECT_EQ(0, fps.TimeAtFrame(1, EXACT)); EXPECT_EQ(1, fps.TimeAtFrame(2, EXACT)); EXPECT_EQ(2, fps.TimeAtFrame(3, EXACT)); EXPECT_EQ(2, fps.TimeAtFrame(4, EXACT)); EXPECT_EQ(3, fps.TimeAtFrame(5, EXACT)); ASSERT_NO_THROW(fps = Framerate({ 0, 100, 100, 200, 300 })); EXPECT_EQ(0, fps.FrameAtTime(0, EXACT)); EXPECT_EQ(0, fps.FrameAtTime(99, EXACT)); EXPECT_EQ(2, fps.FrameAtTime(100, EXACT)); EXPECT_EQ(2, fps.FrameAtTime(199, EXACT)); EXPECT_EQ(3, fps.FrameAtTime(200, EXACT)); } #define EXPECT_SMPTE(eh, em, es, ef) \ EXPECT_EQ(eh, h); \ EXPECT_EQ(em, m); \ EXPECT_EQ(es, s); \ EXPECT_EQ(ef, f) TEST(lagi_vfr, to_smpte_ntsc) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(30000, 1001)); EXPECT_TRUE(fps.NeedsDropFrames()); int h = -1, m = -1, s = -1, f = -1; ASSERT_NO_THROW(fps.SmpteAtFrame(0, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 0, 0); ASSERT_NO_THROW(fps.SmpteAtFrame(1, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 0, 1); ASSERT_NO_THROW(fps.SmpteAtFrame(29, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 0, 29); ASSERT_NO_THROW(fps.SmpteAtFrame(30, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 1, 0); ASSERT_NO_THROW(fps.SmpteAtFrame(1799, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 59, 29); ASSERT_NO_THROW(fps.SmpteAtFrame(1800, &h, &m, &s, &f)); EXPECT_SMPTE(0, 1, 0, 2); ASSERT_NO_THROW(fps.SmpteAtFrame(3597, &h, &m, &s, &f)); EXPECT_SMPTE(0, 1, 59, 29); ASSERT_NO_THROW(fps.SmpteAtFrame(3598, &h, &m, &s, &f)); EXPECT_SMPTE(0, 2, 0, 2); ASSERT_NO_THROW(fps.SmpteAtFrame(5396, &h, &m, &s, &f)); EXPECT_SMPTE(0, 3, 0, 2); ASSERT_NO_THROW(fps.SmpteAtFrame(7194, &h, &m, &s, &f)); EXPECT_SMPTE(0, 4, 0, 2); ASSERT_NO_THROW(fps.SmpteAtFrame(107892, &h, &m, &s, &f)); EXPECT_SMPTE(1, 0, 0, 0); for (int i = 0; i < 60 * 60 * 10; ++i) { ASSERT_NO_THROW(fps.SmpteAtTime(i * 1000, &h, &m, &s, &f)); ASSERT_NEAR(i, h * 3600 + m * 60 + s, 1); } } TEST(lagi_vfr, to_smpte_double_ntsc) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(60000, 1001)); EXPECT_TRUE(fps.NeedsDropFrames()); int h = -1, m = -1, s = -1, f = -1; ASSERT_NO_THROW(fps.SmpteAtFrame(0, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 0, 0); ASSERT_NO_THROW(fps.SmpteAtFrame(1, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 0, 1); ASSERT_NO_THROW(fps.SmpteAtFrame(59, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 0, 59); ASSERT_NO_THROW(fps.SmpteAtFrame(60, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 1, 0); ASSERT_NO_THROW(fps.SmpteAtFrame(3599, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 59, 59); ASSERT_NO_THROW(fps.SmpteAtFrame(3600, &h, &m, &s, &f)); EXPECT_SMPTE(0, 1, 0, 4); ASSERT_NO_THROW(fps.SmpteAtFrame(7195, &h, &m, &s, &f)); EXPECT_SMPTE(0, 1, 59, 59); ASSERT_NO_THROW(fps.SmpteAtFrame(7196, &h, &m, &s, &f)); EXPECT_SMPTE(0, 2, 0, 4); ASSERT_NO_THROW(fps.SmpteAtFrame(215784, &h, &m, &s, &f)); EXPECT_SMPTE(1, 0, 0, 0); for (int i = 0; i < 60 * 60 * 10; ++i) { ASSERT_NO_THROW(fps.SmpteAtTime(i * 1000, &h, &m, &s, &f)); ASSERT_NEAR(i, h * 3600 + m * 60 + s, 1); } } TEST(lagi_vfr, to_smpte_pal) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(25, 1)); EXPECT_FALSE(fps.NeedsDropFrames()); int h = -1, m = -1, s = -1, f = -1; ASSERT_NO_THROW(fps.SmpteAtFrame(0, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 0, 0); ASSERT_NO_THROW(fps.SmpteAtFrame(1, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 0, 1); ASSERT_NO_THROW(fps.SmpteAtFrame(24, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 0, 24); ASSERT_NO_THROW(fps.SmpteAtFrame(25, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 1, 0); ASSERT_NO_THROW(fps.SmpteAtFrame(1499, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 59, 24); ASSERT_NO_THROW(fps.SmpteAtFrame(1500, &h, &m, &s, &f)); EXPECT_SMPTE(0, 1, 0, 0); ASSERT_NO_THROW(fps.SmpteAtFrame(25 * 60 * 60, &h, &m, &s, &f)); EXPECT_SMPTE(1, 0, 0, 0); for (int i = 0; i < 60 * 60 * 10; ++i) { ASSERT_NO_THROW(fps.SmpteAtTime(i * 1000, &h, &m, &s, &f)); ASSERT_EQ(i, h * 3600 + m * 60 + s); } } // this test is different from the above due to that the exact frames which are // skipped are undefined, so instead it tests that the error never exceeds the // limit TEST(lagi_vfr, to_smpte_decimated) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(24000, 1001)); EXPECT_TRUE(fps.NeedsDropFrames()); int h = -1, m = -1, s = -1, f = -1; ASSERT_NO_THROW(fps.SmpteAtFrame(0, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 0, 0); ASSERT_NO_THROW(fps.SmpteAtFrame(1, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 0, 1); for (int frame = 0; frame < 100000; ++frame) { ASSERT_NO_THROW(fps.SmpteAtFrame(frame, &h, &m, &s, &f)); int expected_time = fps.TimeAtFrame(frame); int real_time = int((h * 3600 + m * 60 + s + f / 24.0) * 1000.0); ASSERT_NEAR(expected_time, real_time, 600.0 / fps.FPS()); } } TEST(lagi_vfr, to_smpte_manydrop) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(24, 11)); EXPECT_TRUE(fps.NeedsDropFrames()); int h = -1, m = -1, s = -1, f = -1; ASSERT_NO_THROW(fps.SmpteAtFrame(0, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 0, 0); ASSERT_NO_THROW(fps.SmpteAtFrame(1, &h, &m, &s, &f)); EXPECT_SMPTE(0, 0, 0, 1); for (int frame = 0; frame < 1000; ++frame) { ASSERT_NO_THROW(fps.SmpteAtFrame(frame, &h, &m, &s, &f)); int expected_time = fps.TimeAtFrame(frame); int real_time = int((h * 3600 + m * 60 + s + f / 3.0) * 1000.0); ASSERT_NEAR(expected_time, real_time, 600.0 / fps.FPS()); } } TEST(lagi_vfr, from_smpte_ntsc) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(30000, 1001)); EXPECT_EQ(0, fps.FrameAtSmpte(0, 0, 0, 0)); EXPECT_EQ(1, fps.FrameAtSmpte(0, 0, 0, 1)); EXPECT_EQ(29, fps.FrameAtSmpte(0, 0, 0, 29)); EXPECT_EQ(30, fps.FrameAtSmpte(0, 0, 1, 0)); EXPECT_EQ(1799, fps.FrameAtSmpte(0, 0, 59, 29)); EXPECT_EQ(1800, fps.FrameAtSmpte(0, 1, 0, 0)); EXPECT_EQ(1800, fps.FrameAtSmpte(0, 1, 0, 1)); EXPECT_EQ(1800, fps.FrameAtSmpte(0, 1, 0, 2)); EXPECT_EQ(3597, fps.FrameAtSmpte(0, 1, 59, 29)); EXPECT_EQ(3598, fps.FrameAtSmpte(0, 2, 0, 0)); EXPECT_EQ(3598, fps.FrameAtSmpte(0, 2, 0, 1)); EXPECT_EQ(3598, fps.FrameAtSmpte(0, 2, 0, 2)); EXPECT_EQ(5396, fps.FrameAtSmpte(0, 3, 0, 2)); EXPECT_EQ(7194, fps.FrameAtSmpte(0, 4, 0, 2)); EXPECT_EQ(107892, fps.FrameAtSmpte(1, 0, 0, 0)); } TEST(lagi_vfr, from_smpte_double_ntsc) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(60000, 1001)); EXPECT_TRUE(fps.NeedsDropFrames()); EXPECT_EQ(0, fps.FrameAtSmpte(0, 0, 0, 0)); EXPECT_EQ(1, fps.FrameAtSmpte(0, 0, 0, 1)); EXPECT_EQ(59, fps.FrameAtSmpte(0, 0, 0, 59)); EXPECT_EQ(60, fps.FrameAtSmpte(0, 0, 1, 0)); EXPECT_EQ(3599, fps.FrameAtSmpte(0, 0, 59, 59)); EXPECT_EQ(3600, fps.FrameAtSmpte(0, 1, 0, 4)); EXPECT_EQ(7195, fps.FrameAtSmpte(0, 1, 59, 59)); EXPECT_EQ(7196, fps.FrameAtSmpte(0, 2, 0, 4)); EXPECT_EQ(10792, fps.FrameAtSmpte(0, 3, 0, 0)); EXPECT_EQ(10792, fps.FrameAtSmpte(0, 3, 0, 1)); EXPECT_EQ(10792, fps.FrameAtSmpte(0, 3, 0, 2)); EXPECT_EQ(10792, fps.FrameAtSmpte(0, 3, 0, 3)); EXPECT_EQ(10792, fps.FrameAtSmpte(0, 3, 0, 4)); EXPECT_EQ(10793, fps.FrameAtSmpte(0, 3, 0, 5)); EXPECT_EQ(215784, fps.FrameAtSmpte(1, 0, 0, 0)); } TEST(lagi_vfr, from_smpte_pal) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(25, 1)); EXPECT_FALSE(fps.NeedsDropFrames()); EXPECT_EQ(0, fps.FrameAtSmpte(0, 0, 0, 0)); EXPECT_EQ(1, fps.FrameAtSmpte(0, 0, 0, 1)); EXPECT_EQ(24, fps.FrameAtSmpte(0, 0, 0, 24)); EXPECT_EQ(25, fps.FrameAtSmpte(0, 0, 1, 0)); EXPECT_EQ(1499, fps.FrameAtSmpte(0, 0, 59, 24)); EXPECT_EQ(1500, fps.FrameAtSmpte(0, 1, 0, 0)); EXPECT_EQ(25 * 60 * 60, fps.FrameAtSmpte(1, 0, 0, 0)); } TEST(lagi_vfr, roundtrip_smpte_ntsc) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(30000, 1001)); int h = -1, m = -1, s = -1, f = -1; for (int i = 0; i < 100000; ++i) { ASSERT_NO_THROW(fps.SmpteAtFrame(i, &h, &m, &s, &f)); ASSERT_EQ(i, fps.FrameAtSmpte(h, m, s, f)); } } TEST(lagi_vfr, roundtrip_smpte_pal) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(25, 1)); int h = -1, m = -1, s = -1, f = -1; for (int i = 0; i < 100000; ++i) { ASSERT_NO_THROW(fps.SmpteAtFrame(i, &h, &m, &s, &f)); ASSERT_EQ(i, fps.FrameAtSmpte(h, m, s, f)); } } TEST(lagi_vfr, roundtrip_smpte_manydrop) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(20, 11)); int h = -1, m = -1, s = -1, f = -1; for (int i = 0; i < 10000; ++i) { ASSERT_NO_THROW(fps.SmpteAtFrame(i, &h, &m, &s, &f)); ASSERT_EQ(i, fps.FrameAtSmpte(h, m, s, f)); } } TEST(lagi_vfr, roundtrip_smpte_decimated) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(24000, 1001)); int h = -1, m = -1, s = -1, f = -1; for (int i = 0; i < 100000; ++i) { ASSERT_NO_THROW(fps.SmpteAtFrame(i, &h, &m, &s, &f)); ASSERT_EQ(i, fps.FrameAtSmpte(h, m, s, f)); } } TEST(lagi_vfr, to_smpte_ntsc_nodrop) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(30000, 1001, false)); int h = -1, m = -1, s = -1, f = -1; for (int i = 0; i < 100000; ++i) { ASSERT_NO_THROW(fps.SmpteAtFrame(i, &h, &m, &s, &f)); ASSERT_EQ(i, h * 60 * 60 * 30 + m * 60 * 30 + s * 30 + f); } } TEST(lagi_vfr, from_smpte_ntsc_nodrop) { Framerate fps; ASSERT_NO_THROW(fps = Framerate(30000, 1001, false)); int h = 0, m = 0, s = 0, f = 0; int i = 0; while (h < 10) { if (f >= 30) { f = 0; ++s; } if (s >= 60) { s = 0; ++m; } if (m >= 60) { m = 0; ++h; } ASSERT_EQ(i, fps.FrameAtSmpte(h, m, s, f)); ++i; ++f; } } tests/tests/word_split.cpp0000664000175000017500000001042114741067256015256 0ustar aniolaniol// Copyright (c) 2012, 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. #include #include class lagi_word_split : public libagi { }; using namespace agi::ass; namespace dt = DialogueTokenType; TEST(lagi_word_split, empty) { std::string text; std::vector tokens; SplitWords(text, tokens); EXPECT_TRUE(tokens.empty()); tokens.push_back(DialogueToken{0, 0}); SplitWords(text, tokens); EXPECT_EQ(1u, tokens.size()); } TEST(lagi_word_split, one_word) { std::string text = "abc"; std::vector tokens = {{dt::TEXT, 3}}; SplitWords(text, tokens); ASSERT_EQ(1u, tokens.size()); EXPECT_EQ(dt::WORD, tokens[0].type); } TEST(lagi_word_split, two_words_space) { std::string text = "abc def"; std::vector tokens = {{dt::TEXT, 7}}; SplitWords(text, tokens); ASSERT_EQ(3u, tokens.size()); EXPECT_EQ(dt::WORD, tokens[0].type); EXPECT_EQ(3u, tokens[0].length); EXPECT_EQ(dt::TEXT, tokens[1].type); EXPECT_EQ(1u, tokens[1].length); EXPECT_EQ(dt::WORD, tokens[2].type); EXPECT_EQ(3u, tokens[2].length); } TEST(lagi_word_split, two_words_newline) { std::string text = "abc\\Ndef"; std::vector tokens = { {dt::TEXT, 3}, {dt::LINE_BREAK, 2}, {dt::TEXT, 3} }; SplitWords(text, tokens); ASSERT_EQ(3u, tokens.size()); EXPECT_EQ(dt::WORD, tokens[0].type); EXPECT_EQ(3u, tokens[0].length); EXPECT_EQ(dt::LINE_BREAK, tokens[1].type); EXPECT_EQ(2u, tokens[1].length); EXPECT_EQ(dt::WORD, tokens[2].type); EXPECT_EQ(3u, tokens[2].length); } TEST(lagi_word_split, two_words_unicode) { std::string text = "abc\u300adef"; std::vector tokens = {{dt::TEXT, 9}}; SplitWords(text, tokens); ASSERT_EQ(3u, tokens.size()); EXPECT_EQ(dt::WORD, tokens[0].type); EXPECT_EQ(3u, tokens[0].length); EXPECT_EQ(dt::TEXT, tokens[1].type); EXPECT_EQ(3u, tokens[1].length); EXPECT_EQ(dt::WORD, tokens[2].type); EXPECT_EQ(3u, tokens[2].length); } TEST(lagi_word_split, drawing) { std::string text = "a b{\\p1}m 10{\\p0}c"; std::vector tokens = { {dt::TEXT, 3}, {dt::OVR_BEGIN, 1}, {dt::TAG_START, 1}, {dt::TAG_NAME, 1}, {dt::ARG, 1}, {dt::OVR_END, 1}, {dt::TEXT, 4}, {dt::OVR_BEGIN, 1}, {dt::TAG_START, 1}, {dt::TAG_NAME, 1}, {dt::ARG, 1}, {dt::OVR_END, 1}, {dt::TEXT, 1} }; SplitWords(text, tokens); ASSERT_EQ(15u, tokens.size()); EXPECT_EQ(dt::WORD, tokens[0].type); EXPECT_EQ(dt::WORD, tokens[2].type); EXPECT_EQ(dt::WORD, tokens[14].type); EXPECT_EQ(dt::DRAWING, tokens[8].type); } TEST(lagi_word_split, unclosed_ovr) { std::string text = "a{\\b"; std::vector tokens = { {dt::TEXT, 1}, {dt::OVR_BEGIN, 1}, {dt::TAG_START, 1}, {dt::TAG_NAME, 1} }; SplitWords(text, tokens); ASSERT_EQ(4u, tokens.size()); EXPECT_EQ(dt::WORD, tokens[0].type); EXPECT_EQ(dt::TEXT, tokens[1].type); EXPECT_EQ(dt::TEXT, tokens[2].type); EXPECT_EQ(dt::WORD, tokens[3].type); text = "{"; tokens.clear(); tokens.push_back(DialogueToken{dt::OVR_BEGIN, 1}); SplitWords(text, tokens); ASSERT_EQ(1u, tokens.size()); EXPECT_EQ(dt::TEXT, tokens[0].type); } TEST(lagi_word_split, several_words) { std::string text = "a bb ccc dd e"; std::vector tokens = { {dt::TEXT, 13}, }; SplitWords(text, tokens); ASSERT_EQ(9u, tokens.size()); EXPECT_EQ(1, tokens[0].length); EXPECT_EQ(1, tokens[1].length); EXPECT_EQ(2, tokens[2].length); EXPECT_EQ(1, tokens[3].length); EXPECT_EQ(3, tokens[4].length); EXPECT_EQ(1, tokens[5].length); EXPECT_EQ(2, tokens[6].length); EXPECT_EQ(1, tokens[7].length); EXPECT_EQ(1, tokens[8].length); } tests/tests/hotkey.cpp0000664000175000017500000001705114741067256014401 0ustar aniolaniol// Copyright (c) 2011, 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. #include #include #include #include using namespace agi::hotkey; static const char simple_valid[] = R"raw({ "Always":{"cmd1":[{"modifiers":["Ctrl"], "key":"C"}]}, "Default":{"cmd1":[{"modifiers":["Alt"], "key":"C"}], "cmd2":[{"modifiers":["Ctrl"], "key":"C"}]}, "Other":{"cmd1":[{"modifiers":["Shift"], "key":"C"}], "cmd3":[{"modifiers":[], "key":"Q"}]} })raw"; static const char simple_valid_new[] = R"raw({ "Always":{"cmd1":["Ctrl-C"]}, "Default":{"cmd1":["Alt-C"], "cmd2":["Ctrl-C"]}, "Other":{"cmd1":["Shift-C"], "cmd3":["Q"]} })raw"; TEST(lagi_hotkey, simple_valid_default) { EXPECT_NO_THROW(Hotkey("", simple_valid)); EXPECT_NO_THROW(Hotkey("", simple_valid_new)); } TEST(lagi_hotkey, empty_default) { EXPECT_THROW(Hotkey("", ""), std::exception); } TEST(lagi_hotkey, scan) { Hotkey h("", simple_valid); EXPECT_EQ("cmd1", h.Scan("Always", "Ctrl-C", false)); EXPECT_EQ("cmd2", h.Scan("Default", "Ctrl-C", false)); EXPECT_EQ("cmd2", h.Scan("Other", "Ctrl-C", false)); EXPECT_EQ("cmd2", h.Scan("Nonexistent", "Ctrl-C", false)); EXPECT_EQ("cmd1", h.Scan("Always", "Ctrl-C", true)); EXPECT_EQ("cmd1", h.Scan("Default", "Ctrl-C", true)); EXPECT_EQ("cmd1", h.Scan("Other", "Ctrl-C", true)); EXPECT_EQ("cmd1", h.Scan("Nonexistent", "Ctrl-C", true)); EXPECT_EQ("cmd1", h.Scan("Always", "Alt-C", false)); EXPECT_EQ("cmd1", h.Scan("Default", "Alt-C", false)); EXPECT_EQ("cmd1", h.Scan("Other", "Alt-C", false)); EXPECT_EQ("cmd1", h.Scan("Nonexistent", "Alt-C", false)); EXPECT_EQ("cmd1", h.Scan("Always", "Alt-C", true)); EXPECT_EQ("cmd1", h.Scan("Default", "Alt-C", true)); EXPECT_EQ("cmd1", h.Scan("Other", "Alt-C", true)); EXPECT_EQ("cmd1", h.Scan("Nonexistent", "Alt-C", true)); EXPECT_EQ("", h.Scan("Always", "Shift-C", false)); EXPECT_EQ("", h.Scan("Default", "Shift-C", false)); EXPECT_EQ("cmd1", h.Scan("Other", "Shift-C", false)); EXPECT_EQ("", h.Scan("Nonexistent", "Shift-C", false)); EXPECT_EQ("", h.Scan("Always", "Shift-C", true)); EXPECT_EQ("", h.Scan("Default", "Shift-C", true)); EXPECT_EQ("cmd1", h.Scan("Other", "Shift-C", true)); EXPECT_EQ("", h.Scan("Nonexistent", "Shift-C", true)); EXPECT_EQ("", h.Scan("Always", "Q", false)); EXPECT_EQ("", h.Scan("Default", "Q", false)); EXPECT_EQ("cmd3", h.Scan("Other", "Q", false)); EXPECT_EQ("", h.Scan("Nonexistent", "Q", false)); EXPECT_EQ("", h.Scan("Always", "Q", true)); EXPECT_EQ("", h.Scan("Default", "Q", true)); EXPECT_EQ("cmd3", h.Scan("Other", "Q", true)); EXPECT_EQ("", h.Scan("Nonexistent", "Q", true)); EXPECT_EQ("", h.Scan("Always", "C", false)); EXPECT_EQ("", h.Scan("Default", "C", false)); EXPECT_EQ("", h.Scan("Other", "C", false)); EXPECT_EQ("", h.Scan("Nonexistent", "C", false)); EXPECT_EQ("", h.Scan("Always", "C", true)); EXPECT_EQ("", h.Scan("Default", "C", true)); EXPECT_EQ("", h.Scan("Other", "C", true)); EXPECT_EQ("", h.Scan("Nonexistent", "C", true)); } TEST(lagi_hotkey, get_hotkey) { Hotkey h("", simple_valid); EXPECT_EQ("Ctrl-C", h.GetHotkey("Always", "cmd1")); EXPECT_EQ("Alt-C", h.GetHotkey("Default", "cmd1")); EXPECT_EQ("Shift-C", h.GetHotkey("Other", "cmd1")); EXPECT_EQ("Alt-C", h.GetHotkey("Nonexistent", "cmd1")); EXPECT_EQ("Ctrl-C", h.GetHotkey("Always", "cmd2")); EXPECT_EQ("Ctrl-C", h.GetHotkey("Default", "cmd2")); EXPECT_EQ("Ctrl-C", h.GetHotkey("Other", "cmd2")); EXPECT_EQ("Ctrl-C", h.GetHotkey("Nonexistent", "cmd2")); EXPECT_EQ("", h.GetHotkey("Always", "cmd3")); EXPECT_EQ("", h.GetHotkey("Default", "cmd3")); EXPECT_EQ("Q", h.GetHotkey("Other", "cmd3")); EXPECT_EQ("", h.GetHotkey("Nonexistent", "cmd3")); EXPECT_EQ("", h.GetHotkey("Always", "cmd4")); EXPECT_EQ("", h.GetHotkey("Default", "cmd4")); EXPECT_EQ("", h.GetHotkey("Other", "cmd4")); EXPECT_EQ("", h.GetHotkey("Nonexistent", "cmd4")); } TEST(lagi_hotkey, get_hotkeys) { Hotkey h("", simple_valid); EXPECT_EQ(2, h.GetHotkeys("Always", "cmd1").size()); EXPECT_EQ(2, h.GetHotkeys("Default", "cmd1").size()); EXPECT_EQ(3, h.GetHotkeys("Other", "cmd1").size()); EXPECT_EQ(2, h.GetHotkeys("Nonexistent", "cmd1").size()); EXPECT_EQ(1, h.GetHotkeys("Always", "cmd2").size()); EXPECT_EQ(1, h.GetHotkeys("Default", "cmd2").size()); EXPECT_EQ(1, h.GetHotkeys("Other", "cmd2").size()); EXPECT_EQ(1, h.GetHotkeys("Nonexistent", "cmd2").size()); EXPECT_EQ(0, h.GetHotkeys("Always", "cmd3").size()); EXPECT_EQ(0, h.GetHotkeys("Default", "cmd3").size()); EXPECT_EQ(1, h.GetHotkeys("Other", "cmd3").size()); EXPECT_EQ(0, h.GetHotkeys("Nonexistent", "cmd3").size()); EXPECT_EQ(0, h.GetHotkeys("Always", "cmd4").size()); EXPECT_EQ(0, h.GetHotkeys("Default", "cmd4").size()); EXPECT_EQ(0, h.GetHotkeys("Other", "cmd4").size()); EXPECT_EQ(0, h.GetHotkeys("Nonexistent", "cmd4").size()); } TEST(lagi_hotkey, has_hotkey) { Hotkey h("", simple_valid); EXPECT_TRUE(h.HasHotkey("Always", "Ctrl-C")); EXPECT_FALSE(h.HasHotkey("Always", "Alt-C")); } TEST(lagi_hotkey, get_hotkeys_dedups) { Hotkey h("", "{\"Always\":{\"cmd1\":[{\"modifiers\":[\"Ctrl\"], \"key\":\"C\"}]},\"Default\":{\"cmd1\":[{\"modifiers\":[\"Ctrl\"], \"key\":\"C\"}]}}"); EXPECT_EQ(1, h.GetHotkeys("Always", "cmd1").size()); } static void insert_combo(Hotkey::HotkeyMap &hm, const char *ctx, const char *cmd, const char *keys) { hm.insert(make_pair(std::string(cmd), Combo(ctx, cmd, keys))); } TEST(lagi_hotkey, set_hotkey_map) { agi::fs::Remove("data/hotkey_tmp"); { Hotkey h("data/hotkey_tmp", "{}"); Hotkey::HotkeyMap hm = h.GetHotkeyMap(); EXPECT_EQ(0, hm.size()); insert_combo(hm, "Always", "cmd1", "C"); insert_combo(hm, "Default", "cmd2", "Shift-C"); bool listener_called = false; h.AddHotkeyChangeListener([&] { listener_called = true; }); h.SetHotkeyMap(hm); EXPECT_TRUE(listener_called); EXPECT_EQ("cmd1", h.Scan("Always", "C", false)); EXPECT_EQ("cmd2", h.Scan("Default", "Shift-C", false)); } EXPECT_EQ(2, Hotkey("data/hotkey_tmp", "{}").GetHotkeyMap().size()); } TEST(lagi_hotkey, combo_stuff) { Hotkey::HotkeyMap hm = Hotkey("", simple_valid).GetHotkeyMap(); Hotkey::HotkeyMap::const_iterator it, end; std::tie(it, end) = hm.equal_range("cmd1"); EXPECT_EQ(3, std::distance(it, end)); std::tie(it, end) = hm.equal_range("cmd2"); ASSERT_EQ(1, std::distance(it, end)); Combo c = it->second; EXPECT_EQ("Ctrl-C", c.Str()); EXPECT_EQ("cmd2", c.CmdName()); EXPECT_EQ("Default", c.Context()); } TEST(lagi_hotkey, old_format_is_backed_up_before_migrating) { { std::ofstream tmp("data/hotkey_tmp"); tmp.write(simple_valid, sizeof(simple_valid)); } { Hotkey h("data/hotkey_tmp", "{}"); h.SetHotkeyMap(h.GetHotkeyMap()); } { std::ifstream tmp("data/hotkey_tmp.3_1"); ASSERT_TRUE(tmp.good()); char buff[sizeof(simple_valid)]; tmp.read(buff, sizeof(buff)); ASSERT_TRUE(memcmp(buff, simple_valid, sizeof(buff)) == 0); } agi::fs::Remove("data/hotkey_tmp.3_1"); } tests/tests/time.cpp0000664000175000017500000000547214741067256014040 0ustar aniolaniol// 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 using agi::Time; TEST(lagi_time, out_of_range_times) { EXPECT_EQ(0, (int)Time(-1)); EXPECT_EQ(10 * 60 * 60 * 1000 - 10, (int)Time(10 * 60 * 60 * 1000)); } TEST(lagi_time, rounds_to_cs) { EXPECT_EQ(10, (int)Time(14)); } TEST(lagi_time, cs_formatting) { EXPECT_STREQ("1:23:45.67", Time((((1 * 60) + 23) * 60 + 45) * 1000 + 670).GetAssFormatted().c_str()); } TEST(lagi_time, ms_formatting) { EXPECT_STREQ("1:23:45.678", Time((((1 * 60) + 23) * 60 + 45) * 1000 + 678).GetAssFormatted(true).c_str()); } TEST(lagi_time, well_formed_ass_time_parse) { EXPECT_STREQ("1:23:45.67", Time("1:23:45.67").GetAssFormatted().c_str()); } TEST(lagi_time, missing_components) { EXPECT_STREQ("0:23:45.67", Time("23:45.67").GetAssFormatted().c_str()); EXPECT_STREQ("0:00:45.67", Time("45.67").GetAssFormatted().c_str()); EXPECT_STREQ("0:00:45.60", Time("45.6").GetAssFormatted().c_str()); EXPECT_STREQ("0:00:45.00", Time("45").GetAssFormatted().c_str()); } TEST(lagi_time, out_of_range_compontents) { EXPECT_STREQ("1:23:45.67", Time("0:83:45.67").GetAssFormatted().c_str()); EXPECT_STREQ("0:01:40.00", Time("100").GetAssFormatted().c_str()); } TEST(lagi_time, comma_decimal) { EXPECT_STREQ("1:23:45.67", Time("1:23:45,67").GetAssFormatted().c_str()); } 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, 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) { EXPECT_STREQ("1:23:45.44", agi::SmpteFormatter(25).FromSMPTE("1:23:45:11").GetAssFormatted().c_str()); } TEST(lagi_time, smpte_parse_invalid) { EXPECT_EQ(0, (int)agi::SmpteFormatter(25).FromSMPTE("1:23:45.11")); } TEST(lagi_time, to_smpte) { EXPECT_STREQ("01:23:45:11", agi::SmpteFormatter(25).ToSMPTE(Time("1:23:45.44")).c_str()); } tests/tests/access.cpp0000664000175000017500000000451514741067256014340 0ustar aniolaniol// Copyright (c) 2010, Amar Takhar // // 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. #include #include #include using namespace agi; using namespace agi::acs; using namespace agi::fs; // Yes, this is a horrifying use of macros, since these are all void static // methods I couldn't think of a better way to test these without massive code // duplication. #define DO_TEST(func, name, fail, fail_ex, pass) \ TEST(lagi_acs, name) { \ EXPECT_THROW(func(fail), fail_ex); \ EXPECT_NO_THROW(func(pass)); \ } #define EX_FileNotFound(func, pass) \ DO_TEST(func, func##ExFileNotFound, "data/nonexistent", FileNotFound, pass) #define EX_Fatal(func, fail, pass) \ DO_TEST(func, func##ExFatal, fail, Fatal, pass) #define EX_NotAFile(func, fail, pass) \ DO_TEST(func, func##ExNotAFile, fail, NotAFile, pass) #define EX_NotADirectory(func, fail, pass) \ DO_TEST(func, func##ExNotADirectory, fail, NotADirectory, pass) EX_FileNotFound(CheckFileRead, "data/file") EX_NotAFile(CheckFileRead, "data/dir", "data/file") TEST(lagi_acs, CheckFileRead) { EXPECT_NO_THROW(CheckFileRead("data/file")); } EX_FileNotFound(CheckFileWrite, "data/file") EX_NotAFile(CheckFileWrite, "data/dir", "data/file") TEST(lagi_acs, CheckFileWrite) { EXPECT_NO_THROW(CheckFileRead("data/file")); } EX_FileNotFound(CheckDirRead, "data/dir") EX_NotADirectory(CheckDirRead, "data/file", "data/dir") TEST(lagi_acs, CheckDirRead) { EXPECT_NO_THROW(CheckDirRead("data/dir")); } EX_FileNotFound(CheckDirWrite, "data/dir") EX_NotADirectory(CheckDirWrite, "data/file", "data/dir") TEST(lagi_acs, CheckDirWrite) { EXPECT_NO_THROW(CheckDirWrite("data/dir")); } tests/tests/karaoke_matcher.cpp0000664000175000017500000003231614741067256016217 0ustar aniolaniol// Copyright (c) 2013, 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. #include #include #include class lagi_auto_match_karaoke : public libagi { }; namespace { void print(std::ostream& os, int depth, agi::ass::KaraokeSyllable const& syl); void print(std::ostream& os, int depth, agi::KaraokeMatcher::MatchGroup const& grp); template void print(std::ostream& os, int depth, std::span span, const char *name) { std::string indent(depth, '\t'); os << "span<" << name << ">{\n"; for (auto&& element : span) { print(os, depth + 1, element); os << ",\n"; } os << indent << "}"; } void print(std::ostream& os, int depth, agi::ass::KaraokeSyllable const& syl) { std::string indent(depth, '\t'); os << indent << "KaraokeSyllable{\n" << indent << "\t.start_time = " << syl.start_time << ",\n" << indent << "\t.duration = " << syl.duration << ",\n" << indent << "\t.text = " << syl.text << ",\n" << indent << "\t.tag_type = " << syl.tag_type << ",\n" << indent << "}"; } void print(std::ostream& os, int depth, agi::KaraokeMatcher::MatchGroup const& grp) { std::string indent(depth, '\t'); os << indent << "MatchGroup{\n" << indent << "\t.src = "; print(os, depth + 1, grp.src, "KaraokeSyllable"); os << ",\n" << indent << "\t.dst = " << grp.dst << ",\n" << indent << "}"; } } namespace std { template bool operator==(span const& a, span const& b) { if (a.size() != b.size()) return false; for (size_t i = 0; i < a.size(); ++i) { if (a[i] != b[i]) return false; } return true; } ::std::ostream& operator<<(::std::ostream& os, span const& s) { print(os, 0, s, "KaraokeSyllable"); return os; } ::std::ostream& operator<<(::std::ostream& os, span const& s) { print(os, 0, s, "MatchGroup"); return os; } } // namespace std namespace agi { ::std::ostream& operator<<(::std::ostream& os, KaraokeMatchResult const& r) { return os << "KaraokeMatchResult{" << r.source_length << ", " << r.destination_length << "}"; } bool operator==(KaraokeMatcher::MatchGroup const& a, KaraokeMatcher::MatchGroup const& b) { return a.src == b.src && a.dst == b.dst; } } // namespace agi using agi::AutoMatchKaraoke; using agi::KaraokeMatchResult; using agi::ass::KaraokeSyllable; TEST(lagi_auto_match_karaoke, empty_src_gives_zero_src_length) { EXPECT_EQ(0, AutoMatchKaraoke({}, "").source_length); EXPECT_EQ(0, AutoMatchKaraoke({}, "a").source_length); } TEST(lagi_auto_match_karaoke, empty_dest_gives_zero_dest_length) { EXPECT_EQ(0, AutoMatchKaraoke({}, "").destination_length); } TEST(lagi_auto_match_karaoke, empty_dest_with_source_selects_all_source) { EXPECT_EQ(2, AutoMatchKaraoke({"a", "b"}, "").source_length); } TEST(lagi_auto_match_karaoke, empty_but_present_src_syllable_matches_no_dest) { EXPECT_EQ((KaraokeMatchResult{1, 0}), AutoMatchKaraoke({"", "b"}, "cc")); } TEST(lagi_auto_match_karaoke, dest_with_non_match_selects_first_character) { EXPECT_EQ((KaraokeMatchResult{1, 1}), AutoMatchKaraoke({"a", "b"}, "cc")); } TEST(lagi_auto_match_karaoke, dest_with_identical_match_selects_match) { EXPECT_EQ((KaraokeMatchResult{1, 3}), AutoMatchKaraoke({"abc", "de"}, "abcde")); } TEST(lagi_auto_match_karaoke, match_is_case_insensitive) { EXPECT_EQ((KaraokeMatchResult{1, 3}), AutoMatchKaraoke({"abc", "de"}, "ABCDE")); EXPECT_EQ((KaraokeMatchResult{1, 3}), AutoMatchKaraoke({"ABC", "DE"}, "abcde")); } TEST(lagi_auto_match_karaoke, leading_whitespace_in_source_is_ignored) { EXPECT_EQ((KaraokeMatchResult{1, 3}), AutoMatchKaraoke({" abc", "de"}, "abcde")); } TEST(lagi_auto_match_karaoke, trailing_whitespace_in_source_is_ignored) { EXPECT_EQ((KaraokeMatchResult{1, 3}), AutoMatchKaraoke({"abc ", "de"}, "abcde")); } TEST(lagi_auto_match_karaoke, whitespace_in_dest_is_consumed) { EXPECT_EQ((KaraokeMatchResult{1, 4}), AutoMatchKaraoke({"abc ", "de"}, " abcde")); EXPECT_EQ((KaraokeMatchResult{1, 4}), AutoMatchKaraoke({"abc ", "de"}, "abc de")); EXPECT_EQ((KaraokeMatchResult{1, 5}), AutoMatchKaraoke({"abc ", "de"}, "ab c de")); } TEST(lagi_auto_match_karaoke, dest_match_is_in_characters) { EXPECT_EQ((KaraokeMatchResult{1, 2}), AutoMatchKaraoke({"∫∫", "de"}, "∫∫a")); } TEST(lagi_auto_match_karaoke, decomposed_characters_are_handled_atomically) { // YODO EXPECT_EQ((KaraokeMatchResult{1, 2}), AutoMatchKaraoke({"∫∫", "de"}, "∫∫a")); } TEST(lagi_auto_match_karaoke, single_hiragana_is_matched) { EXPECT_EQ((KaraokeMatchResult{1, 1}), AutoMatchKaraoke({"ro" "de"}, "ろ")); } TEST(lagi_auto_match_karaoke, single_katakana_is_matched) { EXPECT_EQ((KaraokeMatchResult{1, 1}), AutoMatchKaraoke({"ro" "de"}, "ロ")); } TEST(lagi_auto_match_karaoke, multiple_characters_matched) { EXPECT_EQ((KaraokeMatchResult{1, 3}), AutoMatchKaraoke({"romaji" "de"}, "ろまじ")); } TEST(lagi_auto_match_karaoke, multiple_character_kana) { EXPECT_EQ((KaraokeMatchResult{1, 2}), AutoMatchKaraoke({"kya", "e"}, "きゃe")); EXPECT_EQ((KaraokeMatchResult{1, 2}), AutoMatchKaraoke({"kya"}, "きゃ")); } TEST(lagi_auto_match_karaoke, whitespace_between_characters_in_source_ignored) { EXPECT_EQ((KaraokeMatchResult{1, 3}), AutoMatchKaraoke({"ro ma ji" "de"}, "ろまじ")); } TEST(lagi_auto_match_karaoke, whitespace_inside_characters_in_source_breaks_match) { EXPECT_EQ((KaraokeMatchResult{1, 1}), AutoMatchKaraoke({"r om aj i" "de"}, "ろまじ")); } TEST(lagi_auto_match_karaoke, single_dest_character_consumes_all_source) { EXPECT_EQ((KaraokeMatchResult{3, 1}), AutoMatchKaraoke({"a", "b", "c"}, "ろ")); } TEST(lagi_auto_match_karaoke, fullwidth_letters_are_matched_to_ascii) { EXPECT_EQ((KaraokeMatchResult{1, 2}), AutoMatchKaraoke({"ab", "cd"}, "abc")); } TEST(lagi_auto_match_karaoke, simple_lookahead) { EXPECT_EQ((KaraokeMatchResult{1, 2}), AutoMatchKaraoke({"ab", "ro"}, "eeろ")); } TEST(lagi_auto_match_karaoke, lookahead_ignores_empty_syllables) { EXPECT_EQ((KaraokeMatchResult{1, 2}), AutoMatchKaraoke({"ab", "", "ro"}, "eeろ")); EXPECT_EQ((KaraokeMatchResult{1, 2}), AutoMatchKaraoke({"ab", "", "", "", "", "", "ro"}, "eeろ")); } TEST(lagi_auto_match_karaoke, lookahead_only_looks_at_three_characters_of_dst) { EXPECT_EQ((KaraokeMatchResult{1, 3}), AutoMatchKaraoke({"abc", "", "ro"}, "eeeろ")); EXPECT_EQ((KaraokeMatchResult{1, 1}), AutoMatchKaraoke({"abcd", "", "ro"}, "eeeeろ")); } TEST(lagi_auto_match_karaoke, lookahead_two_syllables) { EXPECT_EQ((KaraokeMatchResult{1, 1}), AutoMatchKaraoke({"a", "b", "ro"}, "eeろ")); EXPECT_EQ((KaraokeMatchResult{2, 1}), AutoMatchKaraoke({"a", "b", "c", "ro"}, "eeろ")); EXPECT_EQ((KaraokeMatchResult{2, 1}), AutoMatchKaraoke({"a", "b", "c", "d", "ro"}, "eeろ")); EXPECT_EQ((KaraokeMatchResult{3, 1}), AutoMatchKaraoke({"a", "b", "c", "d", "f", "ro"}, "eeろ")); EXPECT_EQ((KaraokeMatchResult{3, 2}), AutoMatchKaraoke({"a", "b", "c", "d", "f", "ro"}, " eeろ")); } TEST(lagi_auto_match_karaoke, lookahead_multicharacter_kana) { EXPECT_EQ((KaraokeMatchResult{1, 2}), AutoMatchKaraoke({"aa", "kya"}, "eeきゃ")); EXPECT_EQ((KaraokeMatchResult{1, 2}), AutoMatchKaraoke({"aa", "kyan"}, "eeきゃ")); } TEST(lagi_auto_match_karaoke, ha_is_wa) { EXPECT_EQ((KaraokeMatchResult{2, 1}), AutoMatchKaraoke({"Bo", "ku", "wa"}, "僕は")); } TEST(lagi_auto_match_karaoke, he_is_e) { EXPECT_EQ((KaraokeMatchResult{2, 1}), AutoMatchKaraoke({"Bo", "ku", "e"}, "僕へ")); } TEST(lagi_auto_match_karaoke, shitta) { EXPECT_EQ((KaraokeMatchResult{1, 1}), AutoMatchKaraoke({"shi", "tta", ""}, "知った")); EXPECT_EQ((KaraokeMatchResult{2, 2}), AutoMatchKaraoke({"tta", ""}, "った")); } TEST(lagi_auto_match_karaoke, lookahead_is_case_insensitive) { EXPECT_EQ((KaraokeMatchResult{1, 3}), AutoMatchKaraoke({"Oh... ", "Nan", "ka ", "ta", "ri", "nai"}, "Oh…なんか足りない")); } class lagi_karaoke_matcher : public libagi { protected: agi::KaraokeMatcher matcher; std::vector source; std::span source_span; std::string_view dest; void init(const char *dst, const char *tag, int start, std::initializer_list> syls) { source.clear(); for (auto syl : syls) { source.push_back(KaraokeSyllable{ .start_time = start, .duration = syl.first, .text = syl.second, .tag_type = tag }); start += syl.first; } source_span = source; dest = dst; matcher.SetInputData(std::vector(source), dst); } }; std::vector make_syllables(const char *tag, int start, std::initializer_list> syls) { std::vector ret; for (auto syl : syls) { ret.push_back(KaraokeSyllable{ .start_time = start, .duration = syl.first, .text = syl.second, .tag_type = tag }); start += syl.first; } return ret; } #define EXPECT_STATE(src_start, src_len, dst_start, dst_len) do { \ EXPECT_EQ(matcher.CurrentSourceSelection(), source_span.subspan(src_start, src_len)); \ EXPECT_EQ(matcher.CurrentDestinationSelection(), dest.substr(dst_start, dst_len)); \ EXPECT_EQ(matcher.UnmatchedSource(), source_span.subspan(src_start + src_len)); \ EXPECT_EQ(matcher.UnmatchedDestination(), dest.substr(dst_start + dst_len)); \ } while (0) TEST_F(lagi_karaoke_matcher, empty_source_and_dest) { init("", "\\k", 0, {}); EXPECT_EQ(matcher.GetOutputLine(), ""); EXPECT_TRUE(matcher.MatchedGroups().empty()); EXPECT_STATE(0, 0, 0, 0); EXPECT_FALSE(matcher.IncreaseSourceMatch()); EXPECT_FALSE(matcher.DecreaseSourceMatch()); EXPECT_FALSE(matcher.IncreaseDestinationMatch()); EXPECT_FALSE(matcher.DecreaseDestinationMatch()); EXPECT_FALSE(matcher.AcceptMatch()); EXPECT_FALSE(matcher.UndoMatch()); } TEST_F(lagi_karaoke_matcher, source_match_walking) { init("abcd", "\\k", 100, {{100, "a"}, {200, "b"}, {300, "c"}, {400, "d"}}); EXPECT_EQ(matcher.GetOutputLine(), ""); EXPECT_TRUE(matcher.MatchedGroups().empty()); EXPECT_STATE(0, 1, 0, 1); EXPECT_TRUE(matcher.DecreaseSourceMatch()); EXPECT_STATE(0, 0, 0, 1); EXPECT_FALSE(matcher.DecreaseSourceMatch()); EXPECT_STATE(0, 0, 0, 1); EXPECT_TRUE(matcher.IncreaseSourceMatch()); EXPECT_STATE(0, 1, 0, 1); EXPECT_TRUE(matcher.IncreaseSourceMatch()); EXPECT_STATE(0, 2, 0, 1); EXPECT_TRUE(matcher.IncreaseSourceMatch()); EXPECT_STATE(0, 3, 0, 1); EXPECT_TRUE(matcher.IncreaseSourceMatch()); EXPECT_STATE(0, 4, 0, 1); EXPECT_FALSE(matcher.IncreaseSourceMatch()); EXPECT_STATE(0, 4, 0, 1); } TEST_F(lagi_karaoke_matcher, dest_match_walking) { init("abcd", "\\k", 100, {{100, "a"}, {200, "b"}, {300, "c"}, {400, "d"}}); EXPECT_EQ(matcher.GetOutputLine(), ""); EXPECT_TRUE(matcher.MatchedGroups().empty()); EXPECT_STATE(0, 1, 0, 1); EXPECT_TRUE(matcher.DecreaseDestinationMatch()); EXPECT_STATE(0, 1, 0, 0); EXPECT_FALSE(matcher.DecreaseDestinationMatch()); EXPECT_STATE(0, 1, 0, 0); EXPECT_TRUE(matcher.IncreaseDestinationMatch()); EXPECT_STATE(0, 1, 0, 1); EXPECT_TRUE(matcher.IncreaseDestinationMatch()); EXPECT_STATE(0, 1, 0, 2); EXPECT_TRUE(matcher.IncreaseDestinationMatch()); EXPECT_STATE(0, 1, 0, 3); EXPECT_TRUE(matcher.IncreaseDestinationMatch()); EXPECT_STATE(0, 1, 0, 4); EXPECT_FALSE(matcher.IncreaseDestinationMatch()); EXPECT_STATE(0, 1, 0, 4); } TEST_F(lagi_karaoke_matcher, simple_grouping) { init("abcd", "\\k", 100, {{100, "1"}, {200, "2"}, {300, "3"}, {400, "4"}}); EXPECT_EQ(matcher.GetOutputLine(), ""); EXPECT_TRUE(matcher.MatchedGroups().empty()); EXPECT_TRUE(matcher.AcceptMatch()); EXPECT_EQ(matcher.GetOutputLine(), "{\\k10}a"); EXPECT_TRUE(matcher.AcceptMatch()); EXPECT_EQ(matcher.GetOutputLine(), "{\\k10}a{\\k20}b"); EXPECT_TRUE(matcher.AcceptMatch()); EXPECT_EQ(matcher.GetOutputLine(), "{\\k10}a{\\k20}b{\\k30}c"); EXPECT_TRUE(matcher.AcceptMatch()); EXPECT_EQ(matcher.GetOutputLine(), "{\\k10}a{\\k20}b{\\k30}c{\\k40}d"); EXPECT_FALSE(matcher.AcceptMatch()); EXPECT_TRUE(matcher.UndoMatch()); EXPECT_EQ(matcher.GetOutputLine(), "{\\k10}a{\\k20}b{\\k30}c"); EXPECT_TRUE(matcher.UndoMatch()); EXPECT_EQ(matcher.GetOutputLine(), "{\\k10}a{\\k20}b"); EXPECT_TRUE(matcher.UndoMatch()); EXPECT_EQ(matcher.GetOutputLine(), "{\\k10}a"); EXPECT_TRUE(matcher.UndoMatch()); EXPECT_EQ(matcher.GetOutputLine(), ""); EXPECT_FALSE(matcher.UndoMatch()); } tests/tests/signals.cpp0000664000175000017500000000363514741067256014541 0ustar aniolaniol// Copyright (c) 2010, 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. #include #include using namespace agi::signal; TEST(lagi_signal, basic) { Signal<> s; int x = 0; Connection c = s.Connect([&] { ++x; }); EXPECT_EQ(0, x); s(); EXPECT_EQ(1, x); } TEST(lagi_signal, multiple) { Signal<> s; int x = 0; Connection c1 = s.Connect([&] { ++x; }); Connection c2 = s.Connect([&] { ++x; }); EXPECT_EQ(0, x); s(); EXPECT_EQ(2, x); } TEST(lagi_signal, manual_disconnect) { Signal<> s; int x = 0; Connection c1 = s.Connect([&] { ++x; }); EXPECT_EQ(0, x); s(); EXPECT_EQ(1, x); c1.Disconnect(); s(); EXPECT_EQ(1, x); } TEST(lagi_signal, auto_disconnect) { Signal<> s; int x = 0; EXPECT_EQ(0, x); { Connection c = s.Connect([&] { ++x; }); s(); EXPECT_EQ(1, x); } s(); EXPECT_EQ(1, x); } TEST(lagi_signal, connection_outlives_slot) { int x = 0; Connection c; EXPECT_EQ(0, x); { Signal<> s; c = s.Connect([&] { ++x; }); s(); EXPECT_EQ(1, x); } c.Disconnect(); } TEST(lagi_signal, one_arg) { Signal s; int x = 0; Connection c = s.Connect([&](int v) { x += v; }); s(0); EXPECT_EQ(0, x); s(10); EXPECT_EQ(10, x); s(20); EXPECT_EQ(30, x); } tests/tests/syntax_highlight.cpp0000664000175000017500000001730214741067256016452 0ustar aniolaniol// Copyright (c) 2012, 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. #include #include #include class MockSpellChecker : public agi::SpellChecker { void AddWord(std::string_view) override { } void RemoveWord(std::string_view) override { } bool CanAddWord(std::string_view) override { return false; } bool CanRemoveWord(std::string_view) override { return false; } std::vector GetSuggestions(std::string_view) override { return std::vector(); } std::vector GetLanguageList() override { return std::vector(); } bool CheckWord(std::string_view word) override { return word != "incorrect"; } }; using namespace agi::ass; namespace dt = DialogueTokenType; namespace ss = SyntaxStyle; class lagi_syntax : public libagi { }; TEST(lagi_syntax, empty) { std::string text; std::vector tokens; EXPECT_TRUE(SyntaxHighlight(text, tokens, nullptr).empty()); tokens.push_back(DialogueToken{dt::TEXT, 0}); auto syntax = SyntaxHighlight(text, tokens, nullptr); EXPECT_EQ(1u, syntax.size()); EXPECT_EQ(ss::NORMAL, syntax[0].type); } #define tok_str(arg1, template_line, ...) do { \ MockSpellChecker spellchecker; \ std::string str = arg1; \ std::vector tok = TokenizeDialogueBody(str, template_line); \ SplitWords(str, tok); \ std::vector styles = SyntaxHighlight(str, tok, &spellchecker); \ size_t token_index = 0; \ __VA_ARGS__ \ EXPECT_EQ(token_index, styles.size()); \ } while(false) #define expect_style(expected_type, expected_len) do { \ EXPECT_LT(token_index, styles.size()); \ if (token_index < styles.size()) { \ EXPECT_EQ(expected_type, styles[token_index].type); \ EXPECT_EQ(expected_len, styles[token_index].length); \ ++token_index; \ } \ } while(false) TEST(lagi_syntax, spellcheck) { tok_str("correct incorrect correct", false, expect_style(ss::NORMAL, 8u); expect_style(ss::SPELLING, 9u); expect_style(ss::NORMAL, 8u); ); } TEST(lagi_syntax, drawing) { tok_str("incorrect{\\p1}m 10 10{\\p}correct", false, expect_style(ss::SPELLING, 9u); expect_style(ss::OVERRIDE, 1u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::TAG, 1u); expect_style(ss::PARAMETER, 1u); expect_style(ss::OVERRIDE, 1u); expect_style(ss::DRAWING, 7u); expect_style(ss::OVERRIDE, 1u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::TAG, 1u); expect_style(ss::OVERRIDE, 1u); expect_style(ss::NORMAL, 7u); ); } TEST(lagi_syntax, transform) { tok_str("{\\t(0, 0, \\clip(0,0,10,10)}clipped text", false, expect_style(ss::OVERRIDE, 1u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::TAG, 1u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::PARAMETER, 1u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::NORMAL, 1u); expect_style(ss::PARAMETER, 1u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::NORMAL, 1u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::TAG, 4u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::PARAMETER, 1u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::PARAMETER, 1u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::PARAMETER, 2u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::PARAMETER, 2u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::OVERRIDE, 1u); expect_style(ss::NORMAL, 12u); ); } TEST(lagi_syntax, unclosed) { tok_str("{\\incorrect}{\\incorrect", false, expect_style(ss::OVERRIDE, 1u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::TAG, 9u); expect_style(ss::OVERRIDE, 1u); expect_style(ss::NORMAL, 2u); expect_style(ss::SPELLING, 9u); ); } TEST(lagi_syntax, comment) { tok_str("abc{def}ghi", false, expect_style(ss::NORMAL, 3u); expect_style(ss::OVERRIDE, 1u); expect_style(ss::COMMENT, 3u); expect_style(ss::OVERRIDE, 1u); expect_style(ss::NORMAL, 3u); ); } TEST(lagi_syntax, linebreak) { tok_str("a\\Nb\\nc\\hd\\N\\N", false, expect_style(ss::NORMAL, 1u); expect_style(ss::LINE_BREAK, 2u); expect_style(ss::NORMAL, 1u); expect_style(ss::LINE_BREAK, 2u); expect_style(ss::NORMAL, 1u); expect_style(ss::LINE_BREAK, 2u); expect_style(ss::NORMAL, 1u); expect_style(ss::LINE_BREAK, 4u); ); } TEST(lagi_syntax, fn_space) { tok_str("{\\fnComic Sans MS}", false, expect_style(ss::OVERRIDE, 1u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::TAG, 2u); expect_style(ss::PARAMETER, 13u); expect_style(ss::OVERRIDE, 1u); ); } TEST(lagi_syntax, templater_variable_nontmpl) { tok_str("{\\pos($x, $y)\\fs!10 + 10!}abc", false, expect_style(ss::OVERRIDE, 1u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::TAG, 3u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::PARAMETER, 2u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::NORMAL, 1u); expect_style(ss::PARAMETER, 2u); expect_style(ss::PUNCTUATION, 2u); expect_style(ss::TAG, 2u); expect_style(ss::PARAMETER, 9u); expect_style(ss::OVERRIDE, 1u); expect_style(ss::NORMAL, 3u); ); } TEST(lagi_syntax, templater_variable) { tok_str("$a", true, expect_style(ss::KARAOKE_VARIABLE, 2u); ); tok_str("{\\pos($x,$y)}a", true, expect_style(ss::OVERRIDE, 1u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::TAG, 3u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::KARAOKE_VARIABLE, 2u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::KARAOKE_VARIABLE, 2u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::OVERRIDE, 1u); expect_style(ss::NORMAL, 1u); ); tok_str("{\\fn$fn}a", true, expect_style(ss::OVERRIDE, 1u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::TAG, 2u); expect_style(ss::KARAOKE_VARIABLE, 3u); expect_style(ss::OVERRIDE, 1u); expect_style(ss::NORMAL, 1u); ); tok_str("{foo$bar}", true, expect_style(ss::OVERRIDE, 1u); expect_style(ss::COMMENT, 3u); expect_style(ss::KARAOKE_VARIABLE, 4u); expect_style(ss::OVERRIDE, 1u); ); tok_str("{foo$bar", true, expect_style(ss::NORMAL, 4u); expect_style(ss::KARAOKE_VARIABLE, 4u); ); } TEST(lagi_syntax, templater_expression) { tok_str("!5!", true, expect_style(ss::KARAOKE_TEMPLATE, 3u); ); tok_str("!5", true, expect_style(ss::NORMAL, 2u); ); tok_str("!x * 10!", true, expect_style(ss::KARAOKE_TEMPLATE, 8u); ); tok_str("{\\pos(!x + 1!, $y)}a", true, expect_style(ss::OVERRIDE, 1u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::TAG, 3u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::KARAOKE_TEMPLATE, 7u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::NORMAL, 1u); expect_style(ss::KARAOKE_VARIABLE, 2u); expect_style(ss::PUNCTUATION, 1u); expect_style(ss::OVERRIDE, 1u); expect_style(ss::NORMAL, 1u); ); tok_str("{\\b1!'}'!a", true, expect_style(ss::NORMAL, 4u); expect_style(ss::KARAOKE_TEMPLATE, 5u); expect_style(ss::NORMAL, 1u); ); } TEST(lagi_syntax, multiple_templater_expressions) { tok_str("!1!2!3!", true, expect_style(ss::KARAOKE_TEMPLATE, 3u); expect_style(ss::NORMAL, 1u); expect_style(ss::KARAOKE_TEMPLATE, 3u); ); } tests/tests/color.cpp0000664000175000017500000001134014741067256014207 0ustar aniolaniol // Copyright (c) 2012, 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. // // $Id$ #include #include #include class lagi_color : public libagi { }; namespace agi { ::std::ostream& operator<<(::std::ostream& os, Color const& c) { return os << "agi::Color(" << (int)c.r << "," << (int)c.g << "," << (int)c.b << "," << (int)c.a << ")"; } } TEST(lagi_color, hex) { EXPECT_EQ(agi::Color(0, 0, 0), agi::Color("#000")); EXPECT_EQ(agi::Color(0, 0, 0), agi::Color("#000000")); EXPECT_EQ(agi::Color(255, 255, 255), agi::Color("#FFFFFF")); EXPECT_EQ(agi::Color(255, 255, 255), agi::Color("#FFF")); EXPECT_EQ(agi::Color(255, 0, 127), agi::Color("#FF007F")); EXPECT_EQ(agi::Color(16, 32, 48), agi::Color("#102030")); EXPECT_EQ("#000000", agi::Color(0, 0, 0).GetHexFormatted()); EXPECT_EQ("#FFFFFF", agi::Color(255, 255, 255).GetHexFormatted()); EXPECT_EQ("#FF007F", agi::Color(255, 0, 127).GetHexFormatted()); EXPECT_EQ("#102030", agi::Color(16, 32, 48).GetHexFormatted()); } TEST(lagi_color, hex_rgba) { EXPECT_EQ("#00000000", agi::Color(0, 0, 0, 0).GetHexFormatted(true)); EXPECT_EQ("#FFFFFFFF", agi::Color(255, 255, 255, 255).GetHexFormatted(true)); EXPECT_EQ("#FF007F20", agi::Color(255, 0, 127, 32).GetHexFormatted(true)); EXPECT_EQ("#10203040", agi::Color(16, 32, 48, 64).GetHexFormatted(true)); } TEST(lagi_color, rgb) { EXPECT_EQ(agi::Color(0, 0, 0), agi::Color("rgb(0, 0, 0)")); EXPECT_EQ(agi::Color(255, 255, 255), agi::Color("rgb(255, 255, 255)")); EXPECT_EQ(agi::Color(255, 255, 255), agi::Color("rgb(255,255,255)")); EXPECT_EQ(agi::Color(255, 0, 127), agi::Color("rgb(255, 0, 127)")); EXPECT_EQ(agi::Color(16, 32, 48), agi::Color("rgb( 16 , 32 , 48 )")); EXPECT_EQ("rgb(0, 0, 0)", agi::Color(0, 0, 0).GetRgbFormatted()); EXPECT_EQ("rgb(255, 255, 255)", agi::Color(255, 255, 255).GetRgbFormatted()); EXPECT_EQ("rgb(255, 0, 127)", agi::Color(255, 0, 127).GetRgbFormatted()); EXPECT_EQ("rgb(16, 32, 48)", agi::Color(16, 32, 48).GetRgbFormatted()); } TEST(lagi_color, ass_ovr) { EXPECT_EQ(agi::Color(255, 255, 255), agi::Color("&HFFFFFF")); EXPECT_EQ(agi::Color(255, 255, 255), agi::Color("&HFFFFFF&")); EXPECT_EQ(agi::Color(255, 255, 255), agi::Color("&hFFFFFF&")); EXPECT_EQ(agi::Color(255, 255, 255), agi::Color("HFFFFFF")); EXPECT_EQ(agi::Color(255, 255, 255), agi::Color("hFFFFFF")); EXPECT_EQ(agi::Color(255, 255, 255), agi::Color("FFFFFF")); EXPECT_EQ(agi::Color(48, 32, 16), agi::Color("&H102030&")); EXPECT_EQ("&H000000&", agi::Color().GetAssOverrideFormatted()); EXPECT_EQ("&HFFFFFF&", agi::Color(255, 255, 255).GetAssOverrideFormatted()); EXPECT_EQ("&H030201&", agi::Color(1, 2, 3).GetAssOverrideFormatted()); EXPECT_EQ("&H030201&", agi::Color(1, 2, 3, 4).GetAssOverrideFormatted()); } TEST(lagi_color, ass_style) { EXPECT_EQ(agi::Color(255, 255, 255, 255), agi::Color("&HFFFFFFFF")); EXPECT_EQ(agi::Color(255, 255, 255, 255), agi::Color("&HFFFFFFFF&")); EXPECT_EQ(agi::Color(255, 255, 255, 255), agi::Color("&hFFFFFFFF&")); EXPECT_EQ(agi::Color(255, 255, 255, 255), agi::Color("HFFFFFFFF")); EXPECT_EQ(agi::Color(255, 255, 255, 255), agi::Color("hFFFFFFFF")); EXPECT_EQ(agi::Color(255, 255, 255, 255), agi::Color("FFFFFFFF")); EXPECT_EQ(agi::Color(4, 3, 2, 1), agi::Color("&H01020304&")); EXPECT_EQ("&H00000000", agi::Color().GetAssStyleFormatted()); EXPECT_EQ("&H00FFFFFF", agi::Color(255, 255, 255).GetAssStyleFormatted()); EXPECT_EQ("&H00030201", agi::Color(1, 2, 3).GetAssStyleFormatted()); EXPECT_EQ("&H04030201", agi::Color(1, 2, 3, 4).GetAssStyleFormatted()); } TEST(lagi_color, ssa) { EXPECT_EQ(agi::Color(255, 255, 255), agi::Color("16777215")); EXPECT_EQ(agi::Color(255, 255, 255, 255), agi::Color("-1")); EXPECT_EQ(agi::Color(127, 0, 255), agi::Color("16711807")); EXPECT_EQ(agi::Color(48, 32, 16), agi::Color("1056816")); EXPECT_EQ("0", agi::Color(0, 0, 0).GetSsaFormatted()); EXPECT_EQ("16777215", agi::Color(255, 255, 255).GetSsaFormatted()); EXPECT_EQ("16711807", agi::Color(127, 0, 255).GetSsaFormatted()); EXPECT_EQ("1056816", agi::Color(48, 32, 16).GetSsaFormatted()); } tests/tests/calltip_provider.cpp0000664000175000017500000000532414741067256016440 0ustar aniolaniol// 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. #include #include #include using agi::Calltip; static void expect_tip(const char *line, size_t pos, agi::Calltip tip) { auto tokenized_line = agi::ass::TokenizeDialogueBody(line, false); auto actual = agi::GetCalltip(tokenized_line, line, pos); if (!tip.text) { EXPECT_EQ(nullptr, actual.text); } else { ASSERT_TRUE(actual.text); EXPECT_STREQ(tip.text, actual.text); EXPECT_EQ(tip.tag_position, actual.tag_position); EXPECT_EQ(tip.highlight_start, actual.highlight_start); EXPECT_EQ(tip.highlight_end, actual.highlight_end); } } const auto bad_tip = Calltip{nullptr, 0, 0, 0}; TEST(lagi_calltip, empty_line) { expect_tip("", 0, bad_tip); } TEST(lagi_calltip, no_override_blocks) { expect_tip("hello", 0, bad_tip); } TEST(lagi_calltip, cursor_outside_of_block) { expect_tip("{\\b1}hello", 6, bad_tip); } TEST(lagi_calltip, basic_cursor_on_tag) { expect_tip("{\\b1}hello", 3, Calltip{"\\bWeight", 2, 8, 2}); } TEST(lagi_calltip, basic_two_arg) { expect_tip("{\\pos(100,100)}hello", 3, Calltip{"\\pos(X,Y)", 5, 6, 2}); expect_tip("{\\pos(100,100)}hello", 9, Calltip{"\\pos(X,Y)", 5, 6, 2}); expect_tip("{\\pos(100,100)}hello", 10, Calltip{"\\pos(X,Y)", 7, 8, 2}); expect_tip("{\\pos(100,100)}hello", 14, Calltip{"\\pos(X,Y)", 7, 8, 2}); expect_tip("{\\pos(100,100)}hello", 15, bad_tip); } TEST(lagi_calltip, overloads) { expect_tip("{\\clip(m)}", 3, Calltip{"\\clip(Command)", 6, 13, 2}); expect_tip("{\\clip(1, m)}", 3, Calltip{"\\clip(Scale,Command)", 6, 11, 2}); expect_tip("{\\clip(1, m)}", 10, Calltip{"\\clip(Scale,Command)", 12, 19, 2}); } TEST(lagi_calltip, too_many_args) { expect_tip("{\\pos(100,100,100)}hello", 15, bad_tip); expect_tip("{\\pos(100,100,100)}hello", 3, Calltip{"\\pos(X,Y)", 5, 6, 2}); } TEST(lagi_calltip, unknown_tag) { expect_tip("{\\foo(100,100,100)}hello", 3, bad_tip); expect_tip("{\\toolong(100,100,100)}hello", 3, bad_tip); } tests/tests/ifind.cpp0000664000175000017500000001027314741067256014166 0ustar aniolaniol// Copyright (c) 2013, 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 #define IFIND(haystack, needle) \ std::pair pos; \ ASSERT_NO_THROW(pos = agi::util::ifind(haystack, needle)) #define EXPECT_IFIND(haystack, needle, s, e) \ do { \ IFIND(haystack, needle); \ EXPECT_EQ((size_t)s, pos.first); \ EXPECT_EQ((size_t)e, pos.second); \ } while(false) #define EXPECT_NO_MATCH(haystack, needle) \ do { \ IFIND(haystack, needle); \ EXPECT_EQ((size_t)-1, pos.first); \ EXPECT_EQ((size_t)-1, pos.second); \ } while(false) TEST(lagi_ifind, basic_match) { EXPECT_IFIND(" a ", "a", 1, 2); EXPECT_IFIND(" a ", "A", 1, 2); EXPECT_IFIND(" A ", "a", 1, 2); EXPECT_NO_MATCH(" a ", "b"); } TEST(lagi_ifind, sharp_s_matches_ss) { // lowercase EXPECT_IFIND(" \xC3\x9F ", "ss", 1, 3); EXPECT_IFIND(" ss ", "\xC3\x9F", 1, 3); // uppercase EXPECT_IFIND(" \xE1\xBA\x9E ", "ss", 1, 4); EXPECT_IFIND(" ss ", "\xE1\xBA\x9E", 1, 3); } TEST(lagi_ifind, no_partial_match_on_decomposed_character) { EXPECT_NO_MATCH("s\xEF\xAC\x86", "ss"); // LATIN SMALL LIGATURE ST EXPECT_NO_MATCH("\xEF\xAC\x86t", "tt"); EXPECT_NO_MATCH(" \xE1\xBA\x9E ", "s"); EXPECT_NO_MATCH("\xE1\xBA\x9E", "s"); EXPECT_IFIND(" \xE1\xBA\x9E s ", "s", 5, 6); EXPECT_IFIND("s\xE1\xBA\x9E", "ss", 1, 4); EXPECT_IFIND("s\xE1\xBA\x9E", "sss", 0, 4); EXPECT_IFIND("\xE1\xBA\x9Es", "sss", 0, 4); EXPECT_IFIND("\xEF\xAC\x86", "st", 0, 3); } TEST(lagi_ifind, correct_index_with_expanded_character_before_match) { // U+0587 turns into U+0565 U+0582, all of which are two bytes in UTF-8 EXPECT_IFIND(" \xD6\x87 a ", "a", 4, 5); } TEST(lagi_ifind, correct_index_with_shrunk_character_before_match) { // U+FB00 turns into "ff", which is one byte shorter in UTF-8 EXPECT_IFIND(" \xEF\xAC\x80 a ", "a", 5, 6); } TEST(lagi_skip_tags, tag_stripping) { agi::util::tagless_find_helper helper; EXPECT_EQ("", helper.strip_tags("", 0)); EXPECT_EQ("", helper.strip_tags("{}", 0)); EXPECT_EQ("abc", helper.strip_tags("{}abc", 0)); 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)); EXPECT_EQ("bc", helper.strip_tags("{}abc", 3)); EXPECT_EQ("c", helper.strip_tags("{}abc", 4)); } static void test_range_map(const char *str, size_t start, size_t& s, size_t& e) { agi::util::tagless_find_helper helper; helper.strip_tags(str, start); helper.map_range(s, e); } #define EXPECT_RANGE(str, start, match_start, match_end, result_start, result_end) \ do { \ size_t s = match_start, e = match_end; \ test_range_map(str, start, s, e); \ EXPECT_EQ(result_start, s); \ EXPECT_EQ(result_end, e); \ } while (0) TEST(lagi_skip_tags, range_mapping) { EXPECT_RANGE("", 0, 0, 0, 0, 0); EXPECT_RANGE("a", 0, 0, 1, 0, 1); EXPECT_RANGE("{}a", 0, 0, 1, 2, 3); 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); EXPECT_RANGE("{cc}ab{cc}b", 5, 0, 2, 5, 11); } tests/tests/option.cpp0000664000175000017500000002030514741067256014402 0ustar aniolaniol// Copyright (c) 2011, 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. #include #include #include #include #include #include static const char default_opt[] = "{\"Valid\" : \"This is valid\"}"; static const char all_types[] = R"raw({ "Integer" : 0, "Double" : 0.1, "String" : "", "Color" : "rgb(0, 0, 0)", "Boolean" : false, "Array" : { "Integer" : [{ "int" : 0 }, {"int" : 0}], "Double" : [{ "double" : 0.1 }, {"double" : 0.1}], "String" : [{ "string" : "" }, {"string" : ""}], "Color" : [{ "color" : "rgb(0,0,0)" }, {"color" : "rgb(0,0,0)"}], "Boolean" : [{ "bool" : false }, {"bool" : false}] } })raw"; class lagi_option : public libagi { protected: std::string conf_ok; void SetUp() override { conf_ok = "data/options/string.json"; } }; TEST_F(lagi_option, construct_from_file) { EXPECT_NO_THROW(agi::Options(conf_ok, default_opt, agi::Options::FLUSH_SKIP)); } TEST_F(lagi_option, nonexistent_file) { EXPECT_NO_THROW(agi::Options("", default_opt, agi::Options::FLUSH_SKIP)); } TEST_F(lagi_option, get_existing_option) { agi::Options opt(conf_ok, default_opt, agi::Options::FLUSH_SKIP); ASSERT_NO_THROW(opt.Get("Valid")); ASSERT_NO_THROW(opt.Get("Valid")->GetString()); EXPECT_STREQ("This is valid", opt.Get("Valid")->GetString().c_str()); } TEST_F(lagi_option, get_nonexistant_option) { agi::Options opt(conf_ok, default_opt, agi::Options::FLUSH_SKIP); EXPECT_THROW(opt.Get("Nonexistant option"), agi::InternalError); } TEST_F(lagi_option, flush_skip) { agi::fs::Copy("data/options/string.json", "data/options/tmp"); { agi::Options opt("data/options/tmp", default_opt, agi::Options::FLUSH_SKIP); ASSERT_NO_THROW(opt.Get("Valid")->SetString("")); } EXPECT_TRUE(util::compare("data/options/string.json", "data/options/tmp")); } TEST_F(lagi_option, flush_no_skip) { agi::fs::Copy("data/options/string.json", "data/options/tmp"); { agi::Options opt("data/options/tmp", default_opt); ASSERT_NO_THROW(opt.Get("Valid")->SetString("")); } EXPECT_FALSE(util::compare("data/options/string.json", "data/options/tmp")); } TEST_F(lagi_option, existent_but_invalid_file_uses_default) { agi::Options opt("data/options/null.json", default_opt, agi::Options::FLUSH_SKIP); EXPECT_NO_THROW(opt.Get("Valid")->GetString()); EXPECT_THROW(opt.Get("Null"), agi::Exception); } TEST_F(lagi_option, arrays) { agi::Options opt("", all_types, agi::Options::FLUSH_SKIP); EXPECT_NO_THROW(opt.Get("Array/String")->GetListString()); EXPECT_NO_THROW(opt.Get("Array/Integer")->GetListInt()); EXPECT_NO_THROW(opt.Get("Array/Double")->GetListDouble()); EXPECT_NO_THROW(opt.Get("Array/Boolean")->GetListBool()); EXPECT_NO_THROW(opt.Get("Array/Color")->GetListColor()); } TEST_F(lagi_option, bad_default_throws_and_null_is_rejected) { EXPECT_THROW(agi::Options("", "{\"Null\" : null}", agi::Options::FLUSH_SKIP), agi::Exception); } TEST_F(lagi_option, nested_options) { const char conf[] = R"raw({ "a" : { "b" : { "c" : { "c" : "value" } } } })raw"; ASSERT_NO_THROW(agi::Options("", conf, agi::Options::FLUSH_SKIP)); agi::Options opt("", conf, agi::Options::FLUSH_SKIP); ASSERT_NO_THROW(opt.Get("a/b/c/c")); ASSERT_NO_THROW(opt.Get("a/b/c/c")->GetString()); EXPECT_STREQ("value", opt.Get("a/b/c/c")->GetString().c_str()); } TEST_F(lagi_option, heterogeneous_arrays_rejected) { EXPECT_NO_THROW(agi::Options("", "{ \"key\" : [ { \"bool\" : true }] }", agi::Options::FLUSH_SKIP)); EXPECT_THROW(agi::Options("", "{ \"key\" : [ { \"bool\" : true }, { \"double\" : 1.0 } ] }", agi::Options::FLUSH_SKIP), agi::Exception); } TEST_F(lagi_option, set_works) { agi::Options opt("", all_types, agi::Options::FLUSH_SKIP); ASSERT_NO_THROW(opt.Get("Integer")->SetInt(1000)); EXPECT_EQ(1000, opt.Get("Integer")->GetInt()); ASSERT_NO_THROW(opt.Get("String")->SetString("Hello")); EXPECT_EQ("Hello", opt.Get("String")->GetString()); } TEST_F(lagi_option, flush_roundtrip) { agi::fs::Remove("data/options/tmp"); { agi::Options opt("data/options/tmp", all_types); EXPECT_NO_THROW(opt.Get("Integer")->SetInt(1)); EXPECT_NO_THROW(opt.Get("Double")->SetDouble(1.1)); EXPECT_NO_THROW(opt.Get("String")->SetString("hello")); EXPECT_NO_THROW(opt.Get("Color")->SetColor(agi::Color("rgb(255,255,255)"))); EXPECT_NO_THROW(opt.Get("Boolean")->SetBool(true)); EXPECT_NO_THROW(opt.Get("Array/Integer")->SetListInt({1})); EXPECT_NO_THROW(opt.Get("Array/Double")->SetListDouble({1.1})); EXPECT_NO_THROW(opt.Get("Array/String")->SetListString({"hello"})); EXPECT_NO_THROW(opt.Get("Array/Color")->SetListColor({agi::Color("rgb(255,255,255)")})); EXPECT_NO_THROW(opt.Get("Array/Boolean")->SetListBool({true})); } { agi::Options opt("data/options/tmp", all_types); ASSERT_NO_THROW(opt.ConfigUser()); EXPECT_EQ(1, opt.Get("Integer")->GetInt()); EXPECT_EQ(1.1, opt.Get("Double")->GetDouble()); EXPECT_STREQ("hello", opt.Get("String")->GetString().c_str()); EXPECT_STREQ("rgb(255, 255, 255)", opt.Get("Color")->GetColor().GetRgbFormatted().c_str()); EXPECT_EQ(true, opt.Get("Boolean")->GetBool()); EXPECT_EQ(1, opt.Get("Array/Integer")->GetListInt().size()); EXPECT_EQ(1, opt.Get("Array/Double")->GetListDouble().size()); EXPECT_EQ(1, opt.Get("Array/String")->GetListString().size()); EXPECT_EQ(1, opt.Get("Array/Color")->GetListColor().size()); EXPECT_EQ(1, opt.Get("Array/Boolean")->GetListBool().size()); EXPECT_EQ(1, opt.Get("Array/Integer")->GetListInt().front()); EXPECT_EQ(1.1, opt.Get("Array/Double")->GetListDouble().front()); EXPECT_STREQ("hello", opt.Get("Array/String")->GetListString().front().c_str()); EXPECT_STREQ("rgb(255, 255, 255)", opt.Get("Array/Color")->GetListColor().front().GetRgbFormatted().c_str()); EXPECT_EQ(true, opt.Get("Array/Boolean")->GetListBool().front()); } } TEST_F(lagi_option, mixed_valid_and_invalid_in_user_conf_loads_all_valid) { const char def[] = "{\"1\" : false, \"2\" : 1, \"3\" : false }"; agi::Options opt("data/options/all_bool.json", def, agi::Options::FLUSH_SKIP); ASSERT_NO_THROW(opt.ConfigUser()); EXPECT_EQ(true, opt.Get("1")->GetBool()); EXPECT_EQ(1, opt.Get("2")->GetInt()); EXPECT_EQ(true, opt.Get("3")->GetBool()); } TEST_F(lagi_option, empty_object_works) { EXPECT_NO_THROW(agi::Options("", "{ \"obj\" : {} }", agi::Options::FLUSH_SKIP)); } TEST_F(lagi_option, unknown_array_type) { EXPECT_THROW(agi::Options("", "{ \"arr\" : [ { \"float\" : 5.0 } ] }"), agi::Exception); } TEST_F(lagi_option, malformed_arrays) { EXPECT_THROW(agi::Options("", "{ \"arr\" : [ {} ] }"), agi::Exception); EXPECT_THROW(agi::Options("", "{ \"arr\" : [ { \"double\" : 5.0 }, {} ] }"), agi::Exception); EXPECT_THROW(agi::Options("", "{ \"arr\" : [ { \"double\" : 5.0, \"int\" : 5 } ] }"), agi::Exception); } TEST_F(lagi_option, int_vs_double) { agi::Options opt("", "{ \"int\" : 5, \"double\" : 5.0 }", agi::Options::FLUSH_SKIP); EXPECT_NO_THROW(opt.Get("int")->GetInt()); EXPECT_NO_THROW(opt.Get("double")->GetDouble()); } struct empty_arr_options : public agi::Options { empty_arr_options() : agi::Options("", "{ \"arr\" : [] }", agi::Options::FLUSH_SKIP) { } }; #define CHECK_TYPE(str, type) \ do { \ agi::Options opt("", "{ \"" str "\" : \"" str "\" }", agi::Options::FLUSH_SKIP); \ EXPECT_NO_THROW(opt.Get(str)->Get##type()); \ } while (false) TEST_F(lagi_option, color_vs_string) { CHECK_TYPE("#", String); CHECK_TYPE("#a", String); CHECK_TYPE("#abc", Color); CHECK_TYPE("#aabbcc", Color); CHECK_TYPE("#aabb", String); CHECK_TYPE("&", String); CHECK_TYPE("&H000000&", Color); CHECK_TYPE("&H00000000", Color); } tests/tests/audio.cpp0000664000175000017500000003740714741067256014206 0ustar aniolaniol// 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 #include #include #include TEST(lagi_audio, dummy_blank) { auto provider = agi::CreateDummyAudioProvider("dummy-audio:", nullptr); char buff[1024]; memset(buff, 1, sizeof(buff)); provider->GetAudio(buff, 12356, 512); for (size_t i = 0; i < sizeof(buff); ++i) ASSERT_EQ(0, buff[i]); } TEST(lagi_audio, dummy_noise) { auto provider = agi::CreateDummyAudioProvider("dummy-audio:noise?", nullptr); char buff[1024]; memset(buff, 0, sizeof(buff)); provider->GetAudio(buff, 12356, 512); for (size_t i = 0; i < sizeof(buff); ++i) { if (buff[i] != 0) return; } bool all_zero = true; ASSERT_FALSE(all_zero); } TEST(lagi_audio, dummy_rejects_non_dummy_url) { auto provider = agi::CreateDummyAudioProvider("/tmp", nullptr); ASSERT_EQ(nullptr, provider.get()); } template struct TestAudioProvider : agi::AudioProvider { int bias = 0; TestAudioProvider(int64_t duration = 90, int rate=48000) { channels = 1; num_samples = duration * 48000; decoded_samples = num_samples; sample_rate = rate; bytes_per_sample = sizeof(Sample); float_samples = false; } void FillBuffer(void *buf, int64_t start, int64_t count) const override { auto out = static_cast(buf); for (int64_t end = start + count; start < end; ++start) *out++ = (Sample)(start + bias); } }; TEST(lagi_audio, before_sample_zero) { TestAudioProvider<> provider; uint16_t buff[16]; memset(buff, 1, sizeof(buff)); provider.GetAudio(buff, -8, 16); for (int i = 0; i < 8; ++i) ASSERT_EQ(0, buff[i]); for (int i = 8; i < 16; ++i) ASSERT_EQ(i - 8, buff[i]); } TEST(lagi_audio, before_sample_zero_8bit) { TestAudioProvider provider; provider.bias = 128; uint8_t buff[16]; memset(buff, 1, sizeof(buff)); provider.GetAudio(buff, -8, 16); for (int i = 0; i < 8; ++i) ASSERT_EQ(128, buff[i]); for (int i = 8; i < 16; ++i) ASSERT_EQ(128 + i - 8, buff[i]); } TEST(lagi_audio, after_end) { TestAudioProvider<> provider(1); uint16_t buff[16]; memset(buff, 1, sizeof(buff)); provider.GetAudio(buff, provider.GetNumSamples() - 8, 16); for (int i = 0; i < 8; ++i) ASSERT_NE(0, buff[i]); for (int i = 8; i < 16; ++i) ASSERT_EQ(0, buff[i]); } TEST(lagi_audio, save_audio_clip) { auto path = agi::Path().Decode("?temp/save_clip"); agi::fs::Remove(path); auto provider = agi::CreateDummyAudioProvider("dummy-audio:noise?", nullptr); agi::SaveAudioClip(*provider, path, 60 * 60 * 1000, (60 * 60 + 10) * 1000); { std::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 EXPECT_EQ(10 * 44100 * 2 + 44, s.tellg()); } agi::fs::Remove(path); } TEST(lagi_audio, save_audio_clip_out_of_audio_range) { const auto path = agi::Path().Decode("?temp/save_clip"); agi::fs::Remove(path); const auto provider = agi::CreateDummyAudioProvider("dummy-audio:noise?", nullptr); const auto end_time = 150 * 60 * 1000; // Start time after end of clip: empty file agi::SaveAudioClip(*provider, path, end_time, end_time + 1); { std::ifstream s(path, std::ios_base::binary); ASSERT_TRUE(s.good()); s.seekg(0, std::ios::end); EXPECT_EQ(44, s.tellg()); } agi::fs::Remove(path); // Start time >= end time: empty file agi::SaveAudioClip(*provider, path, end_time - 1, end_time - 1); { std::ifstream s(path, std::ios_base::binary); ASSERT_TRUE(s.good()); s.seekg(0, std::ios::end); EXPECT_EQ(44, s.tellg()); } agi::fs::Remove(path); // 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); { std::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 EXPECT_EQ(44100 * 2 + 44, s.tellg()); } agi::fs::Remove(path); } TEST(lagi_audio, get_with_volume) { TestAudioProvider<> provider; uint16_t buff[4]; provider.GetAudioWithVolume(buff, 0, 4, 1.0); EXPECT_EQ(0, buff[0]); EXPECT_EQ(1, buff[1]); EXPECT_EQ(2, buff[2]); EXPECT_EQ(3, buff[3]); provider.GetAudioWithVolume(buff, 0, 4, 0.0); EXPECT_EQ(0, buff[0]); EXPECT_EQ(0, buff[1]); EXPECT_EQ(0, buff[2]); EXPECT_EQ(0, buff[3]); provider.GetAudioWithVolume(buff, 0, 4, 2.0); EXPECT_EQ(0, buff[0]); EXPECT_EQ(2, buff[1]); EXPECT_EQ(4, buff[2]); EXPECT_EQ(6, buff[3]); } TEST(lagi_audio, volume_should_clamp_rather_than_wrap) { TestAudioProvider<> provider; uint16_t buff[1]; provider.GetAudioWithVolume(buff, 30000, 1, 2.0); EXPECT_EQ(SHRT_MAX, buff[0]); } TEST(lagi_audio, ram_cache) { auto provider = agi::CreateRAMAudioProvider(std::make_unique>()); EXPECT_EQ(1, provider->GetChannels()); EXPECT_EQ(90 * 48000, provider->GetNumSamples()); EXPECT_EQ(48000, provider->GetSampleRate()); EXPECT_EQ(2, provider->GetBytesPerSample()); EXPECT_EQ(false, provider->AreSamplesFloat()); EXPECT_EQ(false, provider->NeedsCache()); while (provider->GetDecodedSamples() != provider->GetNumSamples()) agi::util::sleep_for(0); uint16_t buff[512]; provider->GetAudio(buff, (1 << 22) - 256, 512); // Stride two cache blocks for (size_t i = 0; i < 512; ++i) ASSERT_EQ(static_cast((1 << 22) - 256 + i), buff[i]); } TEST(lagi_audio, hd_cache) { auto provider = agi::CreateHDAudioProvider(std::make_unique>(), agi::Path().Decode("?temp")); while (provider->GetDecodedSamples() != provider->GetNumSamples()) agi::util::sleep_for(0); uint16_t buff[512]; provider->GetAudio(buff, (1 << 22) - 256, 512); for (size_t i = 0; i < 512; ++i) ASSERT_EQ(static_cast((1 << 22) - 256 + i), buff[i]); } TEST(lagi_audio, convert_8bit) { auto provider = agi::CreateConvertAudioProvider(std::make_unique>()); int16_t data[256]; provider->GetAudio(data, 0, 256); for (int i = 0; i < 256; ++i) ASSERT_EQ((i - 128) * 256, data[i]); } TEST(lagi_audio, convert_32bit) { auto src = std::make_unique>(100000); src->bias = INT_MIN; auto provider = agi::CreateConvertAudioProvider(std::move(src)); int16_t sample; provider->GetAudio(&sample, 0, 1); EXPECT_EQ(SHRT_MIN, sample); provider->GetAudio(&sample, 1LL << 31, 1); EXPECT_EQ(0, sample); provider->GetAudio(&sample, (1LL << 32) - 1, 1); EXPECT_EQ(SHRT_MAX, sample); } TEST(lagi_audio, sample_doubling) { struct AudioProvider : agi::AudioProvider { AudioProvider() { channels = 1; num_samples = 90 * 20000; decoded_samples = num_samples; sample_rate = 20000; bytes_per_sample = 2; float_samples = false; } void FillBuffer(void *buf, int64_t start, int64_t count) const override { auto out = static_cast(buf); for (int64_t end = start + count; start < end; ++start) *out++ = (int16_t)(start * 2); } }; auto provider = agi::CreateConvertAudioProvider(std::make_unique()); EXPECT_EQ(40000, provider->GetSampleRate()); int16_t samples[6]; for (int k = 0; k < 6; ++k) { SCOPED_TRACE(k); for (int i = k; i < 6; ++i) { SCOPED_TRACE(i); memset(samples, 0, sizeof(samples)); provider->GetAudio(samples, k, i - k); for (int j = 0; j < i - k; ++j) EXPECT_EQ(j + k, samples[j]); for (int j = i - k; j < 6 - k; ++j) EXPECT_EQ(0, samples[j]); } } } TEST(lagi_audio, stereo_downmix) { struct AudioProvider : agi::AudioProvider { AudioProvider() { channels = 2; num_samples = 90 * 480000; decoded_samples = num_samples; sample_rate = 480000; bytes_per_sample = 2; float_samples = false; } void FillBuffer(void *buf, int64_t start, int64_t count) const override { auto out = static_cast(buf); for (int64_t end = start + count; start < end; ++start) { *out++ = (int16_t)(start * 2); *out++ = 0; } } }; auto provider = agi::CreateConvertAudioProvider(std::make_unique()); EXPECT_EQ(1, provider->GetChannels()); int16_t samples[100]; provider->GetAudio(samples, 0, 100); for (int i = 0; i < 100; ++i) EXPECT_EQ(i, samples[i]); } template struct FloatAudioProvider : agi::AudioProvider { FloatAudioProvider() { channels = 1; num_samples = 90 * 480000; decoded_samples = num_samples; sample_rate = 480000; bytes_per_sample = sizeof(Float); float_samples = true; } void FillBuffer(void *buf, int64_t start, int64_t count) const override { auto out = static_cast(buf); for (int64_t end = start + count; start < end; ++start) { auto shifted = start + SHRT_MIN; *out++ = (Float)(1.0 * shifted / (shifted < 0 ? -SHRT_MIN : SHRT_MAX)); } } }; TEST(lagi_audio, float_conversion) { auto provider = agi::CreateConvertAudioProvider(std::make_unique>()); EXPECT_FALSE(provider->AreSamplesFloat()); int16_t samples[1 << 16]; provider->GetAudio(samples, 0, 1 << 16); for (int i = 0; i < (1 << 16); ++i) ASSERT_EQ(i + SHRT_MIN, samples[i]); } TEST(lagi_audio, double_conversion) { auto provider = agi::CreateConvertAudioProvider(std::make_unique>()); EXPECT_FALSE(provider->AreSamplesFloat()); int16_t samples[1 << 16]; provider->GetAudio(samples, 0, 1 << 16); for (int i = 0; i < (1 << 16); ++i) ASSERT_EQ(i + SHRT_MIN, samples[i]); } TEST(lagi_audio, pcm_simple) { auto path = agi::Path().Decode("?temp/pcm_simple"); { TestAudioProvider<> provider; 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()); for (int i = 0; i < 100; ++i) { uint16_t sample; provider->GetAudio(&sample, i, 1); ASSERT_EQ(i, sample); } } agi::fs::Remove(path); } TEST(lagi_audio, pcm_truncated) { auto path = agi::Path().Decode("?temp/pcm_truncated"); { TestAudioProvider<> provider; agi::SaveAudioClip(provider, path, 0, 1000); } char file[1000]; { std::ifstream s(path, std::ios_base::binary); s.read(file, sizeof file); } { std::ofstream s(path, std::ios_base::binary); s.write(file, sizeof file); } { auto provider = agi::CreatePCMAudioProvider(path, nullptr); // Should still report full duration EXPECT_EQ(48000, provider->GetNumSamples()); // 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); EXPECT_EQ(0, sample); } agi::fs::Remove(path); } #define RIFF "RIFF\0\0\0\x60WAVE" #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 { std::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"); agi::fs::Remove(path); ASSERT_THROW(agi::CreatePCMAudioProvider(path, nullptr), agi::fs::FileNotFound); {std::ofstream(path, std::ios_base::binary); } ASSERT_THROW(agi::CreatePCMAudioProvider(path, nullptr), agi::AudioDataNotFound); // Invalid tags WRITE("ASDF"); ASSERT_THROW(agi::CreatePCMAudioProvider(path, nullptr), agi::AudioDataNotFound); WRITE("RIFF\0\0\0\x60" "ASDF"); ASSERT_THROW(agi::CreatePCMAudioProvider(path, nullptr), agi::AudioDataNotFound); // Incomplete files 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) { { std::ofstream s(path, std::ios_base::binary); s.write(valid_file, i); } ASSERT_THROW(agi::CreatePCMAudioProvider(path, nullptr), agi::AudioDataNotFound); } // fmt must come before data WRITE(RIFF "data\0\0\0\x60"); ASSERT_THROW(agi::CreatePCMAudioProvider(path, nullptr), agi::AudioProviderError); // Bad compression format WRITE(RIFF "fmt \x60\0\0\0\2\0"); ASSERT_THROW(agi::CreatePCMAudioProvider(path, nullptr), agi::AudioProviderError); // Multiple fmt chunks not supported WRITE(RIFF FMT_VALID FMT_VALID); ASSERT_THROW(agi::CreatePCMAudioProvider(path, nullptr), agi::AudioProviderError); agi::fs::Remove(path); } TEST(lagi_audio, multiple_data_chunks) { auto path = agi::Path().Decode("?temp/multiple_data"); 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()); uint16_t samples[3]; 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]); 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]); } agi::fs::Remove(path); } #define WAVE64_FILE \ "riff\x2e\x91\xcf\x11\xa5\xd6\x28\xdb\x04\xc1\x00\x00" /* RIFF GUID */ \ "\x74\x00\0\0\0\0\0\0" /* file size */ \ "wave\xf3\xac\xd3\x11\x8c\xd1\x00\xc0\x4f\x8e\xdb\x8a" /* WAVE GUID */ \ "fmt \xf3\xac\xd3\x11\x8c\xd1\x00\xc0\x4f\x8e\xdb\x8a" /* fmt GUID */ \ "\x30\x00\0\0\0\0\0\0" /* fmt chunk size */ \ "\1\0\1\0\x10\0\0\0\x20\0\0\0\2\0\x10\0\0\0\0\0\0\0\0\0" /* fmt chunk */ \ "data\xf3\xac\xd3\x11\x8c\xd1\x00\xc0\x4f\x8e\xdb\x8a" /* data GUID */ \ "\x1c\0\0\0\0\0\0\0" /* data chunk size */ \ "\1\0\2\0" /* actual sample data */ \ 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()); uint16_t samples[2]; provider->GetAudio(samples, 0, 2); EXPECT_EQ(1, samples[0]); EXPECT_EQ(2, samples[1]); } agi::fs::Remove(path); } TEST(lagi_audio, wave64_truncated) { auto path = agi::Path().Decode("?temp/w64_truncated"); // Should be invalid until there's an entire sample for (size_t i = 0; i < sizeof(WAVE64_FILE) - 4; ++i) { { std::ofstream s(path, std::ios_base::binary); s.write(WAVE64_FILE, i); } ASSERT_THROW(agi::CreatePCMAudioProvider(path, nullptr), agi::AudioDataNotFound); } { std::ofstream s(path, std::ios_base::binary); s.write(WAVE64_FILE, sizeof(WAVE64_FILE) - 3); } ASSERT_NO_THROW(agi::CreatePCMAudioProvider(path, nullptr)); { auto provider = agi::CreatePCMAudioProvider(path, nullptr); uint16_t sample; provider->GetAudio(&sample, 0, 1); EXPECT_EQ(1, sample); } agi::fs::Remove(path); } tests/tests/type_name.cpp0000664000175000017500000000314414741067256015055 0ustar aniolaniol// 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 TEST(lagi_type_name, type_name) { EXPECT_STREQ("bool", agi::type_name::name()); EXPECT_EQ("char const", agi::type_name::name()); EXPECT_EQ("void*", agi::type_name::name()); EXPECT_EQ("float const*", agi::type_name::name()); EXPECT_EQ("int const&", agi::type_name::name()); EXPECT_EQ("double&", agi::type_name::name()); EXPECT_EQ("void (*)()", agi::type_name::name()); EXPECT_EQ("int (*)(bool)", agi::type_name::name()); EXPECT_EQ("char const* (*)(int, bool, int)", agi::type_name::name()); EXPECT_EQ("char* (*)(int, int, void (*)())", agi::type_name::name()); } tests/tests/iconv.cpp0000664000175000017500000001231114741067256014206 0ustar aniolaniol// Copyright (c) 2010, 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. #include #include #include #include #include using namespace agi::charset; TEST(lagi_iconv, BasicSetup) { EXPECT_NO_THROW(IconvWrapper("UTF-8", "UTF-16LE")); } TEST(lagi_iconv, InvalidConversions) { EXPECT_THROW(IconvWrapper("nonexistent charset", "UTF-16LE"), UnsupportedConversion); EXPECT_THROW(IconvWrapper("UTF-16LE", "nonexistent charset"), UnsupportedConversion); EXPECT_THROW(IconvWrapper("nonexistent charset", "nonexistent charset"), UnsupportedConversion); } #ifdef _LIBICONV_VERSION TEST(lagi_iconv, Fallbacks) { IconvWrapper nofallback("UTF-8", "Shift-JIS", false); IconvWrapper fallback("UTF-8", "Shift-JIS", true); IconvWrapper noneneeded("UTF-8", "UTF-16LE", false); // Shift-JIS does not have a backslash EXPECT_THROW(nofallback.Convert("\\"), BadInput); ASSERT_NO_THROW(fallback.Convert("\\")); EXPECT_EQ("\\", fallback.Convert("\\")); EXPECT_NO_THROW(noneneeded.Convert("\\")); // BOM into non-unicode char bom[] = "\xEF\xBB\xBF"; EXPECT_THROW(nofallback.Convert(bom), BadInput); ASSERT_NO_THROW(fallback.Convert(bom)); EXPECT_EQ("", fallback.Convert(bom)); EXPECT_NO_THROW(noneneeded.Convert(bom)); // A snowman (U+2603) char snowman[] = "\xE2\x98\x83"; EXPECT_THROW(nofallback.Convert(snowman), BadInput); EXPECT_NO_THROW(noneneeded.Convert(snowman)); ASSERT_NO_THROW(fallback.Convert(snowman)); EXPECT_EQ("?", fallback.Convert(snowman)); } TEST(lagi_iconv, BadInput) { IconvWrapper utf16("UTF-16LE", "UTF-8"); EXPECT_THROW(utf16.Convert(" "), BadInput); IconvWrapper utf8("UTF-8", "UTF-16LE"); EXPECT_THROW(utf8.Convert("\xE2\xFF"), BadInput); } #endif TEST(lagi_iconv, Conversions) { IconvWrapper utf16le("UTF-16LE", "UTF-8", false); IconvWrapper utf16be("UTF-16BE", "UTF-8", false); IconvWrapper utf8("UTF-8", "UTF-16LE", false); char space_utf8_[] = " "; char space_utf16be_[] = {0, 32, 0, 0}; char space_utf16le_[] = {32, 0, 0, 0}; std::string space_utf8(space_utf8_); std::string space_utf16be(space_utf16be_, 2); std::string space_utf16le(space_utf16le_, 2); EXPECT_EQ(space_utf8, utf16le.Convert(space_utf16le)); EXPECT_EQ(space_utf8, utf16be.Convert(space_utf16be)); EXPECT_EQ(space_utf16le, utf8.Convert(space_utf8)); } // Basic overflow tests TEST(lagi_iconv, Buffer) { IconvWrapper conv("UTF-8", "UTF-16LE", false); std::array buff; buff.fill(0xFF); std::span sbuff(buff); std::string_view src("", 1); EXPECT_THROW(conv.Convert(src, sbuff.first(0)), BufferTooSmall); EXPECT_EQ('\xFF', buff[0]); EXPECT_THROW(conv.Convert(src, sbuff.first(1)), BufferTooSmall); EXPECT_EQ('\xFF', buff[0]); EXPECT_NO_THROW(conv.Convert(src, sbuff.first(2))); EXPECT_EQ('\0', buff[0]); EXPECT_EQ('\0', buff[1]); EXPECT_EQ('\xFF', buff[2]); } TEST(lagi_iconv, LocalSupport) { ASSERT_NO_THROW(IconvWrapper("UTF-8", "")); IconvWrapper conv("UTF-8", ""); ASSERT_NO_THROW(conv.Convert(" ")); EXPECT_EQ(" ", conv.Convert(" ")); } TEST(lagi_iconv, wchar_tSupport) { EXPECT_NO_THROW(IconvWrapper("UTF-8", "wchar_t")); } TEST(lagi_iconv, Roundtrip) { for (auto const& name : GetEncodingsList>()) { ASSERT_NO_THROW(IconvWrapper("utf-8", name.c_str())); ASSERT_NO_THROW(IconvWrapper(name.c_str(), "utf-8")); EXPECT_EQ( "Jackdaws love my big sphinx of quartz", IconvWrapper(name.c_str(), "utf-8").Convert( IconvWrapper("utf-8", name.c_str()).Convert( "Jackdaws love my big sphinx of quartz"))); } } TEST(lagi_iconv, Iso6937) { ASSERT_NO_THROW(IconvWrapper("UTF-8", "ISO-6937-2")); IconvWrapper subst("UTF-8", "ISO-6937-2"); IconvWrapper no_subst("UTF-8", "ISO-6937-2", false); // 7-bit is same as ISO-8859 for (int i = 0; i < 128; ++i) { const char buf[] = { (char)i, 0 }; std::string ret; EXPECT_NO_THROW(ret = subst.Convert(buf)); EXPECT_STREQ(buf, ret.c_str()); } std::string ret; // LATIN CAPITAL LETTER D WITH CARON (U+010E) - multibyte char in main block EXPECT_NO_THROW(ret = subst.Convert("\xC4\x8E")); EXPECT_STREQ("\xCF\x44", ret.c_str()); // BREVE - multibyte char in extended ranges EXPECT_NO_THROW(ret = subst.Convert("\xCB\x98")); EXPECT_STREQ("\xC6\x20", ret.c_str()); // EM DASH - single byte char in extended ranges EXPECT_NO_THROW(ret = subst.Convert("\xE2\x80\x94")); EXPECT_STREQ("\xD0", ret.c_str()); // codepoint not in ISO-6937-2 EXPECT_NO_THROW(ret = subst.Convert("\xCB\x97")); EXPECT_STREQ("?", ret.c_str()); EXPECT_THROW(no_subst.Convert("\xCB\x97"), BadInput); } tests/keyframe/0000775000175000017500000000000014741067256013027 5ustar aniolanioltests/keyframe/xvid.txt0000664000175000017500000331614514741067256014557 0ustar aniolaniol# XviD 2pass stat file (core version 1.2.2) # Please do not modify this file i 2 3600 0 0 17519 10777 p 2 0 3562 38 12227 4191 p 2 0 3565 35 18178 4759 p 2 4 3594 2 21548 5422 p 2 0 3592 8 21930 5592 p 2 0 3600 0 18429 5096 p 2 0 3526 74 15515 4962 p 2 0 3587 13 12751 4793 p 2 0 3495 105 11635 4573 p 2 0 3472 128 10622 4401 p 2 0 3452 148 9989 4214 p 2 0 3427 173 9972 4246 p 2 0 3490 110 12313 4406 p 2 0 3528 72 12756 4562 p 2 17 3488 95 12492 4616 p 2 32 3478 90 13171 4867 p 2 1 3548 51 13042 4737 p 2 0 3486 114 12385 4567 p 2 0 3498 102 13364 4553 p 2 0 3583 17 16861 4882 p 2 0 3579 21 21493 5306 p 2 0 3573 27 22130 5873 p 2 1 3573 26 24262 6177 p 2 0 3590 10 22164 6046 p 2 0 3567 33 18008 5170 p 2 0 3587 13 16607 5233 p 2 21 3545 34 16956 5371 p 2 0 3563 37 17256 5366 p 2 0 3583 17 15500 5084 p 2 0 3547 53 16373 5346 p 2 0 3500 100 14887 5055 p 2 0 3568 32 16098 5137 p 2 0 3566 34 17154 5203 p 2 0 3583 17 18156 5373 p 2 5 3567 28 18477 5453 p 2 0 3575 25 17326 5415 p 2 0 3565 35 18375 5337 p 2 8 3573 19 18482 5481 p 2 0 3580 20 20626 5666 p 2 0 3556 44 21025 5703 p 2 0 3591 9 19893 5450 p 2 0 3537 63 15643 5342 p 2 1 3513 86 16056 5139 p 2 0 3547 53 16110 5130 p 2 1 3506 93 17289 5180 p 2 0 3481 119 18097 5454 p 2 1 3453 146 17836 5260 p 2 0 3492 108 17529 5389 p 2 0 3461 139 17115 5224 p 2 0 3476 124 16525 5152 p 2 0 3465 135 19239 5463 p 2 0 3563 37 17071 5253 i 2 3600 0 0 42609 11990 i 2 3600 0 0 47758 12293 p 2 7 2909 684 11766 4015 i 2 3600 0 0 50730 12585 p 2 0 3277 323 18089 4892 i 2 3600 0 0 50110 12469 p 2 0 3584 16 22229 5184 p 2 0 3519 81 20020 4851 p 2 0 3530 70 22896 4814 p 2 0 3584 16 16785 4413 p 2 0 3521 79 15567 4314 p 2 2 3566 32 23059 4744 p 2 0 3527 73 15201 4446 p 2 0 3446 154 14944 4315 p 2 0 3558 42 19495 4506 p 2 0 3541 59 14777 4369 p 2 0 3490 110 15534 4141 p 2 1 3565 34 21067 4726 p 2 0 3414 186 14355 4230 p 2 0 3489 111 13938 4259 p 2 1 3513 86 20486 4728 p 2 0 3436 164 13660 4203 p 2 0 3366 234 12909 4088 p 2 0 3513 87 18781 4588 p 2 0 3272 328 13133 4089 p 2 0 3231 369 11307 3948 p 2 0 3389 211 17318 4184 p 2 0 3396 204 13121 3994 i 2 3600 0 0 73093 12971 p 2 0 3324 276 21132 4881 p 2 5 3309 286 25882 4440 p 2 0 3431 169 18717 4325 p 2 0 3352 248 16599 4184 p 2 4 3461 135 25953 4679 p 2 0 3285 315 17302 4010 p 2 0 3516 84 19820 4201 p 2 12 3426 162 30403 4721 p 2 0 3531 69 22085 4178 p 2 0 3268 332 15601 3822 p 2 78 3427 95 35680 5254 p 2 1 3291 308 18114 4389 p 2 162 3227 211 37209 5954 p 2 1 3038 561 13396 3886 p 2 182 3021 397 36617 5632 p 2 2 3190 408 16247 4244 p 2 3 3329 268 17641 4374 p 2 0 3255 345 16133 4182 p 2 0 3320 280 17868 4345 p 2 1 3301 298 18138 4287 p 2 0 3444 156 20334 4488 p 2 0 3288 312 15628 4032 p 2 1 3468 131 15740 4105 p 2 1 3315 284 18273 4229 p 2 2 3467 131 21572 4393 p 2 1 3305 294 18004 4187 p 2 0 3399 201 16243 4133 p 2 1 3448 151 15990 4246 p 2 2 3485 113 17789 4323 p 2 1 3535 64 19506 4289 p 2 0 3470 130 19782 4184 p 2 0 3556 44 18053 4302 p 2 0 3467 133 21875 4386 i 2 3600 0 0 64558 13087 p 2 47 3550 3 36193 6444 p 2 39 3498 63 31197 5706 p 2 0 3516 84 19765 4969 p 2 0 3425 175 19405 4501 p 2 38 3445 117 28656 5285 p 2 0 3434 166 18520 4485 p 2 0 3430 170 18041 4401 p 2 63 3379 158 29090 5239 p 2 0 3473 127 22858 4614 p 2 0 3406 194 21500 4529 p 2 29 3425 146 29118 5280 p 2 0 3258 342 22122 4407 p 2 53 3306 241 28794 5195 p 2 20 3014 566 12474 3858 p 2 19 3301 280 24584 4941 p 2 0 3174 426 14146 3976 p 2 23 3191 386 25352 4756 p 2 0 3254 346 17755 4246 p 2 0 3291 309 17840 4252 p 2 45 3235 320 25015 4804 p 2 0 3274 326 20324 4357 p 2 0 3286 314 16594 4079 p 2 47 3394 159 26882 5085 p 2 0 3378 222 22270 4311 p 2 0 3372 228 18878 4341 p 2 56 3438 106 30691 5261 p 2 0 3422 178 23329 4564 p 2 0 3437 163 20195 4357 p 2 35 3453 112 30913 5275 p 2 0 3422 178 20799 4568 p 2 40 3420 140 31369 5442 p 2 13 3456 131 22792 4903 p 2 19 3444 137 28641 5225 p 2 0 3434 166 19563 4576 p 2 39 3413 148 29809 5399 p 2 0 3390 210 20366 4502 p 2 0 3416 184 18981 4412 p 2 28 3429 143 27842 5076 p 2 0 3474 126 20470 4584 p 2 0 3357 243 19393 4308 p 2 30 3410 160 28068 5152 p 2 0 3349 251 17429 4303 p 2 0 3427 173 19439 4447 p 2 49 3387 164 29204 5102 p 2 0 3427 173 19209 4370 p 2 0 3336 264 18585 4271 p 2 33 3422 145 29272 5197 p 2 0 3339 261 22073 4469 p 2 52 3384 164 30275 5430 p 2 7 3394 199 21069 4798 p 2 22 3425 153 28725 5314 p 2 0 3097 503 18485 4078 p 2 41 3178 381 25449 4887 i 2 3600 0 0 59027 12785 p 2 0 2880 720 12579 3687 p 2 260 3124 216 58544 7567 p 2 0 3087 513 14378 4231 p 2 114 3308 178 54535 7258 p 2 0 3201 399 12930 4349 p 2 4 3326 270 37828 5632 p 2 0 3068 532 12265 4130 p 2 2 3380 218 34238 5559 p 2 0 3066 534 11813 3968 p 2 0 2667 933 8986 3239 p 2 2 3320 278 35076 5429 p 2 11 3418 171 38305 5772 p 2 0 3268 332 16396 4533 i 2 3600 0 0 67335 13065 p 2 1 3595 4 36394 6525 p 2 0 3589 11 21389 4909 p 2 0 3563 37 20688 4854 p 2 0 3552 48 19499 4720 p 2 0 3533 67 21183 4805 p 2 249 3330 21 47989 8463 p 2 0 3549 51 23001 5751 p 2 0 3555 45 30409 5829 p 2 0 3565 35 43516 5822 p 2 0 3559 41 20389 5113 p 2 0 3531 69 16946 4950 p 2 0 3527 73 14665 4778 p 2 0 3555 45 20688 4927 p 2 0 3584 16 17842 4884 p 2 0 3590 10 19534 4796 p 2 0 3579 21 20617 4925 p 2 0 3596 4 21465 4944 p 2 0 3594 6 20094 4913 p 2 0 3597 3 22095 4992 p 2 0 3597 3 20390 4852 p 2 0 3594 6 22680 5008 p 2 0 3598 2 21952 5002 p 2 0 3595 5 21948 4970 p 2 0 3588 12 20957 4867 p 2 58 3509 33 43523 6920 p 2 79 3504 17 33431 7430 p 2 5 3543 52 23937 6106 p 2 1 3566 33 30912 6445 p 2 0 3570 30 46462 6187 p 2 0 3552 48 18154 4944 p 2 0 3551 49 18529 4960 p 2 0 3512 88 16858 4638 p 2 0 3462 138 17462 4616 p 2 0 3531 69 19817 4726 p 2 0 3543 57 18604 4696 p 2 0 3533 67 17529 4544 p 2 0 3563 37 20229 4777 p 2 0 3562 38 21545 4739 p 2 0 3581 19 17981 4595 p 2 0 3580 20 18310 4699 p 2 0 3591 9 20208 4793 p 2 0 3594 6 19860 4894 p 2 0 3588 12 20168 4900 p 2 0 3584 16 17837 4697 p 2 0 3577 23 19807 4968 p 2 0 3574 26 20029 4843 p 2 0 3515 85 18337 4658 p 2 0 3568 32 17759 4560 p 2 0 3575 25 18593 4720 p 2 0 3585 15 19097 4900 p 2 0 3578 22 18408 4868 i 2 3600 0 0 103386 13974 p 2 1751 1849 0 125285 14215 p 2 76 3418 106 41643 6477 p 2 1265 2326 9 110729 12818 p 2 18 3396 186 25970 5834 p 2 911 2682 7 80395 11584 i 2 3600 0 0 56114 13000 p 2 0 3014 586 11849 3753 i 2 3600 0 0 71505 13209 p 2 24 3386 190 27443 5678 i 2 3600 0 0 44552 11919 p 2 13 3123 464 21913 5060 p 2 938 2457 205 50110 9315 p 2 31 3203 366 23878 5860 p 2 525 2929 146 55912 9271 p 2 73 3018 509 24983 6174 i 2 3600 0 0 97290 13517 i 2 3600 0 0 72790 13405 p 2 128 3068 404 26046 5989 p 2 1505 2086 9 82953 12474 p 2 196 3364 40 43623 8172 p 2 1093 2491 16 73125 11865 p 2 263 3179 158 39378 8562 p 2 1788 1796 16 87302 13038 p 2 65 3379 156 35749 6757 p 2 1282 2314 4 110131 12690 p 2 84 3414 102 38130 6984 p 2 646 2928 26 107797 11338 p 2 92 3418 90 37364 7267 p 2 681 2894 25 110012 11291 p 2 101 3357 142 35163 7416 p 2 823 2750 27 104307 11277 p 2 87 3436 77 37131 6973 p 2 271 3300 29 95256 9686 p 2 190 3307 103 41427 7514 p 2 280 3296 24 90603 9774 p 2 183 3357 60 43246 7721 p 2 217 3352 31 87882 9217 p 2 122 3343 135 38210 7187 p 2 257 3159 184 65761 8321 i 2 3600 0 0 69245 13230 p 2 348 3247 5 68086 10306 p 2 123 3275 202 32179 7890 p 2 499 3069 32 77654 10419 p 2 191 3230 179 34920 7885 p 2 212 3374 14 61816 9058 p 2 299 3050 251 34954 8075 p 2 205 3387 8 67806 9352 p 2 141 3180 279 35282 7641 p 2 200 3174 226 36841 7899 p 2 198 3101 301 46849 8040 p 2 258 3006 336 34829 7813 p 2 184 2923 493 33555 7352 p 2 233 2945 422 40954 7637 p 2 278 2658 664 30665 7294 p 2 112 2733 755 30992 6974 i 2 3600 0 0 191824 15974 p 2 195 3405 0 139374 8415 p 2 179 3395 26 106778 7714 p 2 200 3380 20 104588 7526 p 2 167 3396 37 106266 7361 p 2 136 3446 18 107221 7413 p 2 69 3441 90 84015 6265 p 2 40 3513 47 77354 6218 p 2 15 3400 185 61377 5521 p 2 23 3186 391 57710 4972 p 2 8 3003 589 51288 4567 p 2 36 2940 624 63636 4778 p 2 38 3017 545 66461 4839 p 2 31 2930 639 67574 4739 p 2 22 2900 678 66403 4651 p 2 36 3043 521 65867 4881 p 2 20 2933 647 67240 4651 p 2 197 3300 103 85768 6299 p 2 31 3127 442 69346 5058 p 2 52 3402 146 78117 5681 p 2 34 3244 322 70345 5287 p 2 32 3113 455 68336 5012 p 2 35 3156 409 68168 5114 p 2 37 2951 612 67625 4861 p 2 28 3218 354 69769 5123 p 2 25 3120 455 69533 4984 p 2 17 3059 524 67139 4879 p 2 26 3087 487 65180 4981 p 2 25 2944 631 64735 4717 p 2 32 3385 183 67025 5543 p 2 66 2991 543 62878 5018 p 2 53 3380 167 68716 5596 p 2 57 3238 305 60606 5204 p 2 59 3127 414 58929 4944 p 2 56 3305 239 58504 5350 p 2 19 3113 468 51529 4786 p 2 24 3299 277 48401 4948 p 2 6 3070 524 44159 4466 p 2 5 2926 669 44515 4248 p 2 10 3092 498 42355 4509 p 2 8 2972 620 38464 4264 p 2 7 3356 237 45427 5022 p 2 7 2821 772 35174 4055 p 2 4 3441 155 54624 5102 p 2 1 3243 356 40625 4586 p 2 5 3113 482 37142 4346 i 2 3600 0 0 151043 15796 p 2 534 3066 0 175997 11050 p 2 207 3393 0 130828 9249 p 2 271 3329 0 118278 9262 p 2 300 3300 0 105185 8986 p 2 295 3305 0 99421 8984 p 2 143 3457 0 105909 8692 p 2 251 3349 0 113544 8851 p 2 341 3259 0 101826 9029 p 2 371 3229 0 94569 8885 p 2 310 3290 0 101835 8813 p 2 367 3233 0 104544 8682 p 2 379 3221 0 98925 8771 p 2 240 3360 0 107366 8838 p 2 404 3196 0 107496 8996 p 2 228 3372 0 111067 8896 p 2 339 3261 0 104482 8769 p 2 347 3253 0 101824 8971 p 2 309 3291 0 108510 9116 p 2 301 3299 0 115945 9224 p 2 306 3294 0 107894 9120 p 2 427 3173 0 96336 9340 p 2 282 3318 0 94118 8842 p 2 216 3384 0 104643 8862 p 2 349 3251 0 101213 8893 p 2 526 3074 0 101329 9430 p 2 255 3345 0 99168 9205 p 2 314 3286 0 101167 8970 i 2 3600 0 0 112608 14251 p 2 0 3576 24 41092 5627 p 2 0 3408 192 21199 4601 p 2 0 3550 50 30520 5285 p 2 0 3337 263 19603 4567 p 2 0 3370 230 21287 4522 p 2 0 2910 690 13473 3730 p 2 0 2562 1038 12734 3324 p 2 0 2944 656 15672 3811 p 2 0 2805 795 14299 3614 p 2 0 2828 772 13679 3597 p 2 0 2994 606 15595 3830 p 2 0 2806 794 14145 3601 p 2 0 3480 120 23138 4804 p 2 0 3322 278 18081 4425 p 2 0 3356 244 19306 4519 p 2 0 3289 311 18271 4376 p 2 7 3444 149 21313 4811 p 2 0 3200 400 16042 4204 p 2 0 3002 598 14786 3856 p 2 0 3033 567 17057 4054 p 2 0 3179 421 16757 4153 p 2 0 2860 740 13458 3686 p 2 2 3020 578 17056 3957 p 2 0 3032 568 14903 3959 p 2 0 3053 547 15540 4000 p 2 1 2752 847 14754 3611 p 2 0 3120 480 16035 4100 p 2 0 2860 740 14607 3748 p 2 2 3394 204 21875 4709 p 2 0 3132 468 16003 4111 p 2 0 3017 583 15363 3879 p 2 0 3108 492 17776 4090 p 2 0 3006 594 15551 3876 p 2 0 2807 793 13410 3596 p 2 3 2849 748 15437 3729 p 2 1 2991 608 15254 3897 p 2 0 3054 546 15809 4016 p 2 0 2679 921 13404 3469 p 2 0 3204 396 16860 4281 p 2 0 3065 535 15707 4012 p 2 4 3379 217 21363 4691 p 2 0 3099 501 15948 4080 p 2 0 2950 650 15469 3820 p 2 0 3122 478 16769 4098 p 2 0 3033 567 15810 3935 p 2 0 2823 777 13715 3641 p 2 1 3005 594 15113 3890 p 2 0 2846 754 14049 3667 p 2 0 2955 645 15491 3839 p 2 0 2697 903 12666 3463 p 2 0 3123 477 15003 4092 p 2 0 3110 490 15110 4109 p 2 0 3367 233 18736 4603 p 2 0 3001 599 14073 3934 p 2 0 2974 626 14108 3893 p 2 3 2938 659 14066 3876 p 2 0 2965 635 14582 3876 p 2 0 2675 925 12007 3456 p 2 0 2595 1005 12124 3379 p 2 0 2809 791 13315 3638 p 2 0 2610 990 11952 3399 p 2 0 2436 1164 12013 3200 p 2 24 2800 776 34475 4752 p 2 2155 1445 0 101001 14070 p 2 481 3113 6 68372 9389 p 2 256 3339 5 62472 8903 i 2 3600 0 0 86107 13705 p 2 1364 2236 0 125549 13371 p 2 251 3347 2 79137 8498 p 2 393 3114 93 93825 9122 p 2 537 2990 73 96236 9673 p 2 386 3054 160 77149 8674 p 2 152 3348 100 63706 7680 p 2 331 3061 208 58898 7822 p 2 179 3378 43 65044 7669 p 2 318 2935 347 59807 7317 p 2 182 3271 147 59951 6952 p 2 188 3117 295 44631 6138 p 2 164 2897 539 39049 5451 p 2 141 2600 859 29286 4583 p 2 0 2442 1158 12396 3131 p 2 0 3089 511 16335 3877 p 2 0 2689 911 11988 3315 p 2 0 2506 1094 10977 3092 p 2 0 3345 255 19248 4269 p 2 0 2787 813 12484 3430 p 2 1 3563 36 27815 5041 p 2 0 3424 176 19681 4490 p 2 0 3523 77 22911 4790 p 2 1 3278 321 17636 4207 p 2 11 3332 257 18076 4371 p 2 6 3395 199 19945 4446 p 2 8 3311 281 17427 4283 p 2 8 2965 627 13471 3720 p 2 5 3024 571 13945 3794 p 2 13 2878 709 12871 3645 p 2 9 2948 643 13040 3727 p 2 10 2541 1049 10024 3164 p 2 10 2875 715 11770 3558 p 2 9 2803 788 11992 3491 i 2 3600 0 0 143171 15827 p 2 0 3600 0 56010 6176 p 2 0 3599 1 57335 5726 p 2 0 3598 2 56536 5709 p 2 0 3600 0 63009 5563 p 2 0 3600 0 54294 5815 p 2 1 3599 0 59326 5884 p 2 0 3599 1 53672 5837 p 2 0 3600 0 56035 5571 p 2 0 3600 0 63585 5937 p 2 0 3600 0 61765 5959 p 2 0 3599 1 58465 5949 p 2 0 3600 0 56460 5634 p 2 0 3600 0 62873 5942 p 2 0 3600 0 69514 5889 p 2 0 3600 0 59658 5798 p 2 0 3599 1 56455 5695 p 2 0 3599 1 53068 5860 p 2 0 3599 1 68786 5979 p 2 0 3597 3 61163 5927 p 2 0 3600 0 57966 5654 p 2 0 3597 3 56060 5929 p 2 0 3599 1 59912 5962 p 2 0 3598 2 65819 5946 p 2 0 3600 0 59978 5644 p 2 0 3600 0 59082 5875 p 2 1 3597 2 55542 5857 p 2 0 3600 0 54749 5762 p 2 0 3600 0 57153 5595 p 2 0 3600 0 60450 5902 p 2 0 3599 1 66274 5930 p 2 0 3600 0 52956 5809 p 2 0 3598 2 53345 5668 p 2 0 3599 1 58175 5890 p 2 0 3599 1 68485 5980 p 2 0 3600 0 63258 5932 p 2 0 3599 1 52629 5575 p 2 0 3599 1 54043 5859 p 2 0 3600 0 60452 5825 p 2 0 3599 1 58238 5734 p 2 0 3599 1 60075 5633 p 2 0 3598 2 53349 5926 p 2 0 3598 2 60376 5889 p 2 0 3599 1 55825 5867 p 2 0 3598 2 58978 5718 p 2 0 3600 0 61404 5957 p 2 0 3600 0 60215 6014 p 2 0 3599 1 56812 5943 p 2 0 3599 1 54481 5547 p 2 0 3599 1 63068 5936 p 2 0 3600 0 66262 5880 p 2 0 3598 2 55529 5725 p 2 0 3599 1 53012 5627 p 2 0 3600 0 55094 5894 p 2 0 3598 2 68015 5914 p 2 0 3600 0 57360 5854 p 2 0 3600 0 54085 5658 p 2 0 3598 2 54478 5845 p 2 0 3599 1 59783 5924 p 2 0 3600 0 65689 5880 p 2 0 3599 1 58552 5600 p 2 0 3599 1 56391 5854 p 2 0 3600 0 54151 5785 p 2 0 3598 2 55182 5696 p 2 0 3600 0 57598 5537 p 2 0 3600 0 60254 5863 p 2 0 3599 1 58680 5773 p 2 0 3598 2 50667 5778 p 2 0 3598 2 52863 5531 p 2 0 3600 0 64375 6256 i 2 3600 0 0 120788 14429 p 2 0 2773 827 14818 3681 p 2 50 2428 1122 46315 4474 p 2 0 3052 548 13968 3919 p 2 5 3287 308 43465 5172 p 2 0 3129 471 14371 4096 p 2 9 2979 612 39990 4610 p 2 0 3150 450 15047 4097 p 2 0 2788 812 10822 3479 p 2 0 3365 235 16884 4405 p 2 0 3104 496 13335 3936 p 2 0 3043 557 12533 3831 p 2 0 3263 337 14361 4292 p 2 0 3130 470 13250 3997 p 2 0 3402 198 18538 4532 p 2 0 3241 359 14447 4153 p 2 0 3037 563 13013 3793 p 2 79 3155 366 54710 5681 p 2 0 2883 717 15071 3797 p 2 89 3165 346 50008 5620 p 2 0 3011 589 15256 3942 p 2 74 2979 547 49577 5192 p 2 0 3068 532 14894 3938 p 2 0 2648 952 10355 3339 p 2 0 3221 379 14600 4214 p 2 0 3463 137 20379 4761 p 2 0 3161 439 14213 4046 p 2 0 3113 487 13190 3884 p 2 0 3029 571 11967 3860 p 2 0 3069 531 12836 3853 p 2 0 2912 688 11234 3596 p 2 0 2666 934 9708 3262 p 2 0 2696 904 9217 3305 p 2 0 3029 571 11816 3748 p 2 0 2176 1424 7694 2705 p 2 76 2928 596 48552 5110 p 2 0 2944 656 12873 3760 p 2 0 2834 766 10809 3525 p 2 71 3279 250 54205 5723 p 2 0 3128 472 14043 4108 p 2 0 2959 641 12009 3781 p 2 28 3103 469 52740 5243 p 2 0 3091 509 14625 4024 p 2 0 2878 722 12992 3708 p 2 6 3052 542 44421 4857 p 2 0 3119 481 14806 4093 p 2 0 2215 1385 8825 2825 p 2 10 3077 513 45375 4862 p 2 0 3172 428 15657 4115 p 2 0 2816 784 11211 3553 p 2 0 3301 299 15384 4294 p 2 0 3133 467 12785 4028 p 2 0 2937 663 11037 3663 p 2 2 3104 494 13650 3907 p 2 0 2877 723 11178 3528 p 2 0 2540 1060 8623 3117 p 2 0 2665 935 10089 3301 p 2 0 2762 838 9848 3387 p 2 0 2740 860 9759 3385 p 2 0 2674 926 9712 3301 p 2 0 2988 612 12153 3704 i 2 3600 0 0 99328 14363 p 2 2 3490 108 22977 5460 p 2 0 2683 917 11907 3473 p 2 54 3289 257 65471 6120 p 2 21 3291 288 64908 5849 p 2 0 3097 503 16302 4110 p 2 0 2981 619 13881 3902 p 2 0 2838 762 12581 3663 p 2 128 2917 555 73054 5985 p 2 0 3048 552 16748 4098 p 2 0 2746 854 12305 3574 p 2 121 3131 348 75412 6428 p 2 0 3168 432 18141 4353 p 2 0 3268 332 15928 4407 p 2 0 2616 984 12708 3389 p 2 64 3045 491 68368 5871 p 2 0 3060 540 15772 4052 p 2 110 2951 539 75196 6014 p 2 0 2847 753 16590 3825 p 2 59 2987 554 77736 6018 p 2 0 2585 1015 13117 3416 p 2 58 3183 359 71143 5965 p 2 0 2657 943 15611 3560 p 2 42 3146 412 74132 6095 p 2 0 2880 720 17330 3855 p 2 48 3279 273 77325 6274 p 2 0 3114 486 18126 4209 p 2 139 2999 462 80980 6611 p 2 0 2920 680 14516 3952 p 2 114 2892 594 72460 6054 p 2 0 2908 692 16868 3914 p 2 200 2820 580 72665 6255 p 2 0 2528 1072 11106 3288 p 2 186 2899 515 68242 6261 p 2 0 2688 912 15531 3653 p 2 125 3058 417 70428 6204 p 2 0 2953 647 14553 3998 p 2 0 3164 436 13791 4221 p 2 0 2442 1158 11237 3154 p 2 52 3071 477 64783 5763 p 2 0 3093 507 17247 4211 p 2 26 2977 597 63236 5254 p 2 0 2848 752 14306 3743 p 2 0 2835 765 12731 3649 p 2 123 2800 677 72176 5746 p 2 0 2843 757 14865 3798 p 2 0 2647 953 11804 3384 p 2 119 3119 362 74584 6274 p 2 0 2637 963 11769 3502 p 2 0 2802 798 12532 3658 p 2 0 2521 1079 11996 3236 p 2 65 3030 505 68000 5795 p 2 0 2852 748 15034 3770 p 2 110 2841 649 74632 5874 p 2 0 2870 730 17172 3832 p 2 66 2858 676 75417 5857 p 2 47 3007 546 71228 5859 p 2 0 3442 158 33789 5273 i 2 3600 0 0 135211 15106 p 2 0 3600 0 62666 6411 p 2 0 3573 27 43038 5046 p 2 0 3588 12 43405 5050 p 2 0 3563 37 38708 4827 p 2 0 3569 31 44196 5034 p 2 0 3564 36 37521 4837 p 2 0 3580 20 38056 4747 p 2 0 3543 57 39117 4714 p 2 0 3576 24 38249 4698 p 2 0 3552 48 40708 4682 p 2 0 3570 30 36547 4655 p 2 0 3526 74 40309 4675 p 2 0 3573 27 44654 4856 p 2 0 3558 42 42236 4823 p 2 0 3580 20 44786 4933 p 2 0 3571 29 39387 4731 p 2 0 3571 29 46595 5031 p 2 0 3578 22 41839 4939 p 2 0 3576 24 41773 4853 p 2 0 3573 27 42082 4820 p 2 0 3578 22 42070 4869 p 2 0 3568 32 43198 4760 p 2 0 3587 13 39523 4711 p 2 0 3551 49 42418 4715 p 2 0 3564 36 43037 4807 p 2 0 3557 43 42395 4800 p 2 0 3565 35 45285 4868 p 2 0 3557 43 40307 4709 p 2 0 3550 50 46827 4920 p 2 0 3564 36 40854 4759 p 2 0 3572 28 43495 4753 p 2 0 3552 48 42511 4737 p 2 0 3577 23 43344 4740 p 2 0 3569 31 45127 4761 p 2 0 3571 29 40023 4684 p 2 0 3559 41 43658 4745 p 2 0 3563 37 46144 4856 p 2 0 3578 22 46214 4864 p 2 0 3589 11 46183 4885 p 2 0 3556 44 42110 4780 p 2 0 3569 31 46991 4816 p 2 0 3536 64 40337 4759 p 2 0 3561 39 42779 4735 p 2 0 3577 23 44065 4759 p 2 0 3564 36 42525 4657 i 2 3600 0 0 119450 15759 p 2 90 3387 123 24918 5369 p 2 0 3006 594 12554 3888 p 2 0 2955 645 13329 4017 p 2 31 3047 522 55242 5360 p 2 0 2358 1242 9025 3113 p 2 7 2270 1323 10971 3037 p 2 32 2764 804 47289 4615 p 2 30 2706 864 17406 3857 p 2 0 2587 1013 11162 3401 p 2 5 2480 1115 22767 3511 p 2 0 2630 970 12904 3478 p 2 0 2517 1083 9897 3266 p 2 2 2586 1012 23785 3597 p 2 3 2272 1325 9396 2970 p 2 0 2628 972 11622 3458 p 2 0 2583 1017 24415 3621 p 2 0 2828 772 12950 3826 p 2 0 2424 1176 8855 3121 p 2 1 2234 1365 22307 3127 p 2 0 2525 1075 10293 3226 p 2 0 2438 1162 9479 3133 p 2 0 2118 1482 6864 2671 p 2 1 2238 1361 7791 2826 p 2 0 1983 1617 6156 2512 p 2 0 2179 1421 6910 2712 p 2 0 1825 1775 5489 2310 p 2 0 2378 1222 8546 3060 p 2 0 2186 1414 7075 2773 p 2 0 2788 812 11582 3668 p 2 0 2417 1183 8534 3079 p 2 0 2231 1369 7484 2793 p 2 0 2209 1391 7424 2788 p 2 0 2277 1323 7264 2827 p 2 0 2273 1327 7400 2839 p 2 0 1842 1758 5471 2333 p 2 0 1960 1640 6055 2452 p 2 0 2103 1497 6580 2625 p 2 0 1932 1668 5836 2419 p 2 0 2332 1268 7558 2936 p 2 0 2799 801 11857 3684 p 2 0 2301 1299 7457 2915 p 2 0 2119 1481 6842 2687 p 2 0 2000 1600 6263 2512 i 2 3600 0 0 12057 10017 p 2 7 2419 1174 10578 3727 p 2 0 2158 1442 3865 2037 p 2 0 450 3150 1448 909 p 2 0 894 2706 2373 1321 p 2 0 1101 2499 3024 1627 p 2 0 849 2751 1750 1200 p 2 0 859 2741 2013 1294 p 2 0 898 2702 2289 1305 p 2 0 1087 2513 2008 1436 p 2 0 753 2847 1349 1095 p 2 0 735 2865 1960 1149 p 2 0 1390 2210 3561 1853 p 2 0 1436 2164 3312 1835 p 2 0 1538 2062 3349 1982 p 2 0 1421 2179 2660 1726 p 2 0 1609 1991 3122 1952 p 2 0 1422 2178 2436 1732 p 2 0 1749 1851 4164 2244 p 2 0 1587 2013 2673 1895 p 2 0 1344 2256 2488 1723 p 2 0 1540 2060 3418 1987 p 2 0 1582 2018 3042 1914 p 2 0 1436 2164 2892 1802 p 2 0 1808 1792 4388 2344 p 2 0 1694 1906 3184 2080 p 2 0 1571 2029 3047 2007 p 2 0 1605 1995 3016 1947 p 2 0 1764 1836 3211 2166 p 2 0 1661 1939 3129 2049 p 2 0 1661 1939 3044 1976 p 2 0 1635 1965 3651 2111 p 2 0 1795 1805 3635 2218 p 2 0 1784 1816 3556 2257 p 2 0 1947 1653 4079 2364 p 2 0 1733 1867 4334 2286 p 2 0 1655 1945 3256 2140 p 2 0 1754 1846 3439 2200 p 2 0 1905 1695 3788 2326 p 2 0 1793 1807 3839 2315 p 2 0 2069 1531 4294 2568 p 2 0 1702 1898 3498 2174 p 2 0 1917 1683 3308 2253 p 2 0 1659 1941 3827 2168 p 2 0 2038 1562 4037 2478 p 2 0 1773 1827 3681 2332 p 2 0 2296 1304 4952 2727 p 2 0 1772 1828 3802 2290 p 2 0 1933 1667 3606 2410 p 2 0 1852 1748 4013 2317 p 2 0 2069 1531 4089 2485 p 2 0 1780 1820 3859 2312 p 2 0 2159 1441 4476 2701 p 2 0 1924 1676 3930 2421 p 2 0 2167 1433 4693 2667 p 2 0 1857 1743 4292 2407 p 2 0 2173 1427 4706 2717 p 2 0 1929 1671 4285 2486 p 2 0 2180 1420 4355 2587 p 2 0 1849 1751 4591 2435 p 2 0 2109 1491 4440 2667 p 2 0 1824 1776 4038 2369 p 2 0 2091 1509 4193 2571 p 2 0 1812 1788 4140 2376 p 2 0 2168 1432 4767 2748 p 2 0 1855 1745 4030 2418 p 2 0 2146 1454 4831 2713 p 2 0 1907 1693 4452 2522 p 2 0 2173 1427 5301 2852 p 2 0 2110 1490 4914 2776 p 2 0 2366 1234 5540 2917 p 2 0 1920 1680 5235 2589 p 2 0 2106 1494 4924 2747 p 2 0 1888 1712 4492 2480 p 2 0 2045 1555 4365 2598 p 2 0 1876 1724 4363 2459 p 2 0 2243 1357 5901 2940 p 2 0 2117 1483 5613 2766 p 2 0 2188 1412 5146 2802 p 2 0 2084 1516 5417 2765 p 2 0 2047 1553 5293 2772 p 2 0 2179 1421 5313 2834 p 2 0 2096 1504 4518 2608 p 2 0 1814 1786 3953 2392 p 2 0 1975 1625 4637 2526 p 2 0 1882 1718 4217 2405 p 2 0 1878 1722 3982 2386 p 2 0 1807 1793 4323 2355 p 2 0 1989 1611 4931 2558 p 2 0 1818 1782 4454 2456 p 2 0 1856 1744 4139 2359 p 2 0 1877 1723 4835 2510 p 2 0 1797 1803 4147 2352 p 2 0 2126 1474 5283 2742 p 2 0 1917 1683 4435 2536 p 2 0 1897 1703 5308 2621 p 2 0 2065 1535 5833 2790 p 2 0 2323 1277 6962 3160 p 2 0 2004 1596 5530 2718 p 2 0 2205 1395 6816 3017 p 2 0 1981 1619 6301 2855 p 2 0 2342 1258 7653 3229 p 2 0 2028 1572 6498 2882 p 2 0 2353 1247 7582 3223 p 2 0 2078 1522 7455 3035 p 2 0 2399 1201 8152 3356 p 2 0 2153 1447 6789 3024 p 2 0 2336 1264 7914 3251 p 2 0 1966 1634 6760 2807 p 2 0 2334 1266 7803 3192 p 2 0 1994 1606 6931 2830 p 2 0 2315 1285 7581 3097 p 2 0 2078 1522 7806 3025 p 2 0 2293 1307 7683 3147 p 2 0 2052 1548 7309 2906 p 2 0 2309 1291 8453 3222 p 2 0 2084 1516 8651 2998 p 2 0 2320 1280 9637 3314 p 2 0 2068 1532 8298 2951 p 2 0 2324 1276 9806 3234 p 2 0 2000 1600 8452 2866 p 2 0 2253 1347 9153 3110 p 2 0 1958 1642 8671 2767 p 2 0 3442 158 17907 4852 p 2 6 3116 478 15784 4712 p 2 13 3238 349 17972 4894 p 2 0 3506 94 19770 5590 p 2 12 3461 127 22096 5659 p 2 11 3504 85 24521 6146 p 2 6 3451 143 24601 5959 p 2 1 3533 66 25486 6280 p 2 3 3500 97 29118 6358 p 2 0 3527 73 28528 6412 p 2 2 3501 97 29456 6382 p 2 4 3583 13 32494 6681 p 2 20 3506 74 37578 6831 p 2 22 3538 40 36016 7019 p 2 23 3513 64 39261 7062 p 2 20 3523 57 38825 6989 p 2 16 3538 46 41202 6808 p 2 19 3553 28 44329 7159 p 2 26 3554 20 44675 6976 p 2 29 3538 33 47335 7339 p 2 9 3534 57 46561 6885 p 2 10 3565 25 48179 7330 p 2 16 3559 25 48297 7032 p 2 5 3585 10 47872 7148 p 2 14 3571 15 55737 7260 p 2 3 3588 9 51065 7225 p 2 1 3572 27 54583 7154 p 2 0 3569 31 57899 7376 p 2 14 3553 33 59970 7319 p 2 6 3573 21 62384 7560 p 2 11 3558 31 57860 7122 p 2 16 3578 6 60364 7349 p 2 47 3534 19 67905 7367 p 2 48 3546 6 68127 7792 p 2 44 3534 22 71658 7583 p 2 43 3543 14 70085 7706 p 2 35 3537 28 70738 7466 p 2 16 3577 7 67050 7450 p 2 38 3539 23 68483 7423 p 2 39 3535 26 72545 7656 p 2 16 3571 13 72025 7360 p 2 25 3568 7 73482 7668 p 2 11 3567 22 68850 7161 p 2 12 3567 21 71403 7480 p 2 11 3568 21 74988 7252 p 2 2 3586 12 71503 7386 p 2 5 3578 17 76446 7333 p 2 4 3575 21 76154 7453 p 2 15 3569 16 82210 7565 p 2 11 3580 9 77317 7552 p 2 21 3559 20 77265 7380 p 2 19 3568 13 81006 7424 p 2 45 3533 22 90108 7588 p 2 71 3521 8 89408 7892 p 2 62 3512 26 85406 7507 p 2 42 3536 22 82418 7375 p 2 23 3539 38 79234 7137 p 2 16 3533 51 77581 7026 p 2 38 3505 57 82796 7233 p 2 57 3503 40 85027 7343 p 2 13 3542 45 80586 7008 p 2 18 3547 35 76828 6950 p 2 18 3535 47 73172 6976 p 2 7 3539 54 75016 6910 p 2 12 3553 35 78092 7201 p 2 10 3547 43 74803 7068 p 2 3 3573 24 71862 7035 p 2 1 3543 56 71971 6900 p 2 17 3530 53 78119 7246 p 2 7 3549 44 75376 7088 p 2 16 3552 32 76587 7193 p 2 19 3557 24 77247 7068 p 2 61 3505 34 83178 7309 p 2 60 3487 53 79484 7253 p 2 53 3509 38 81522 7294 p 2 34 3512 54 82039 7226 p 2 24 3548 28 79200 7116 p 2 16 3544 40 77723 6955 p 2 66 3497 37 77501 7283 p 2 52 3495 53 79673 7204 p 2 23 3534 43 77629 7043 p 2 21 3536 43 75019 6956 p 2 12 3544 44 75098 6989 p 2 8 3543 49 74919 6952 p 2 4 3547 49 76155 7039 p 2 4 3558 38 73319 6973 p 2 4 3551 45 71122 7007 p 2 5 3563 32 74331 7075 p 2 16 3562 22 80173 7428 p 2 9 3542 49 77766 7201 p 2 13 3552 35 73035 7094 p 2 18 3549 33 74314 7056 p 2 48 3506 46 79733 7128 p 2 55 3500 45 80303 7240 p 2 56 3518 26 83724 7378 p 2 44 3523 33 83296 7346 p 2 16 3538 46 76970 7033 p 2 14 3530 56 75285 6887 p 2 62 3502 36 78001 7187 p 2 45 3512 43 84490 7211 p 2 20 3546 34 83399 7197 p 2 899 2692 9 112615 10875 p 2 1355 2245 0 112938 12671 p 2 952 2643 5 111565 11747 p 2 456 3143 1 103320 10540 p 2 139 3460 1 92798 9017 p 2 32 3568 0 91253 8950 p 2 632 2965 3 120404 10598 p 2 1316 2284 0 171839 13790 i 2 3600 0 0 179302 16849 p 2 1987 1613 0 245125 16421 p 2 931 2668 1 235135 13403 p 2 827 2771 2 210622 12887 p 2 948 2650 2 178730 12918 p 2 1232 2363 5 157906 13588 i 2 3600 0 0 145158 13763 i 2 3600 0 0 52940 12082 i 2 3600 0 0 53224 12171 i 2 3600 0 0 40303 11905 p 2 1106 2331 163 48586 10086 p 2 548 2800 252 38510 8138 p 2 240 3069 291 34581 6847 p 2 747 2556 297 33140 8192 p 2 597 2876 127 35674 8388 p 2 261 3189 150 37494 7733 p 2 974 2512 114 36988 9456 i 2 3600 0 0 25219 10745 i 2 3600 0 0 37473 11038 i 2 3600 0 0 36815 11286 i 2 3600 0 0 47855 12189 i 2 3600 0 0 46235 12139 i 2 3600 0 0 30969 11130 p 2 211 1977 1412 34759 4426 p 2 40 2020 1540 30416 3349 p 2 25 1879 1696 30907 3100 p 2 15 1883 1702 22590 2882 p 2 7 2056 1537 24914 3231 p 2 135 1758 1707 24288 3279 p 2 352 1759 1489 36491 4637 i 2 3600 0 0 40610 11453 i 2 3600 0 0 53827 12159 i 2 3600 0 0 53982 12225 i 2 3600 0 0 39541 11364 p 2 296 1868 1436 34526 4633 p 2 32 1388 2180 33898 2839 p 2 18 1383 2199 33080 2654 p 2 24 1436 2140 30396 2760 p 2 19 1442 2139 28765 2676 p 2 31 1670 1899 27558 2949 p 2 36 1349 2215 26259 2617 p 2 7 1505 2088 19985 2405 p 2 47 1510 2043 24024 2601 p 2 218 1611 1771 29842 3409 p 2 433 1518 1649 39372 4389 p 2 651 1539 1410 52017 5814 i 2 3600 0 0 66384 12777 p 2 684 1611 1305 47759 6300 p 2 85 2002 1513 46531 4037 p 2 59 1978 1563 48702 3858 p 2 208 1831 1561 62322 4418 p 2 526 1797 1277 82501 6288 p 2 591 1853 1156 90266 7025 p 2 129 2711 760 70953 5924 p 2 93 2412 1095 67781 5211 p 2 52 2431 1117 64393 4946 p 2 32 2494 1074 62768 4643 p 2 31 2505 1064 60083 4620 p 2 43 2594 963 60961 4821 p 2 52 2694 854 57515 4812 p 2 62 2563 975 57365 4765 p 2 50 2741 809 54262 4870 p 2 40 2514 1046 54216 4631 p 2 42 2747 811 51633 4754 p 2 72 2465 1063 46111 4514 p 2 75 2767 758 47829 4942 p 2 19 2774 807 46626 4613 p 2 8 2630 962 40737 4064 p 2 419 2148 1033 85235 6363 p 2 307 2424 869 91547 6588 p 2 91 2612 897 83200 5721 p 2 82 2663 855 84563 5789 p 2 261 2419 920 96955 6786 p 2 151 2654 795 85406 6462 p 2 81 2512 1007 71492 5518 p 2 94 2799 707 69769 5675 p 2 340 2526 734 84046 6910 p 2 84 2751 765 69227 5773 p 2 17 2606 977 56421 4856 p 2 3 2521 1076 56587 4585 p 2 201 2138 1261 73408 5391 p 2 72 2081 1447 66999 4590 p 2 23 2264 1313 64063 4374 p 2 16 2319 1265 66271 4402 p 2 352 1844 1404 59056 5587 p 2 133 1871 1596 48514 4446 p 2 121 1720 1759 47151 4108 p 2 114 2100 1386 40652 4573 p 2 13 1596 1991 25782 3214 p 2 5 2102 1493 25785 3488 i 2 3600 0 0 47898 11113 p 2 630 2471 499 45316 7326 p 2 611 2267 722 41534 6533 p 2 617 2341 642 47226 7022 p 2 610 2898 92 57048 8353 i 2 3600 0 0 65439 12701 i 2 3600 0 0 65788 12676 i 2 3600 0 0 85895 13460 i 2 3600 0 0 117197 14453 i 2 3600 0 0 116924 14802 p 2 1970 1618 12 141764 13681 p 2 500 2894 206 140387 10104 p 2 467 3031 102 187180 10508 p 2 1336 2154 110 168097 13060 p 2 1097 2354 149 141008 11982 i 2 3600 0 0 109710 14101 p 2 943 2277 380 142447 10563 p 2 382 2910 308 126453 9103 p 2 625 2732 243 121508 9463 p 2 289 3019 292 114100 8455 i 2 3600 0 0 115559 13424 p 2 593 2089 918 117496 8123 p 2 403 1923 1274 104363 6822 p 2 59 2096 1445 61057 4447 p 2 47 2024 1529 88864 4732 p 2 364 1761 1475 88192 5499 i 2 3600 0 0 71497 12428 p 2 677 1667 1256 66089 6751 p 2 279 2002 1319 62473 5437 p 2 287 1945 1368 65976 5340 i 2 3600 0 0 96717 13695 i 2 3600 0 0 84298 12898 p 2 74 2406 1120 22177 3849 i 2 3600 0 0 80530 12715 i 2 3600 0 0 82073 12877 p 2 1292 1896 412 99356 10460 p 2 702 2491 407 129910 9540 p 2 1119 2139 342 126868 11012 p 2 1160 2004 436 106112 10190 p 2 198 2638 764 76067 6715 p 2 299 2468 833 79330 6750 p 2 154 2567 879 74198 5929 p 2 173 2327 1100 70257 5497 p 2 103 2529 968 71903 5531 p 2 121 2364 1115 63588 5343 p 2 700 2351 549 102060 7974 p 2 324 2499 777 98491 6845 p 2 232 2897 471 101572 7189 p 2 320 2699 581 97222 7215 p 2 27 2885 688 87215 5698 p 2 78 2715 807 89752 5570 p 2 80 2822 698 96926 5805 p 2 27 2784 789 79663 5178 p 2 34 2813 753 79962 5197 p 2 51 2663 886 79018 5069 p 2 51 2604 945 88495 5031 p 2 75 2517 1008 83790 5031 p 2 61 2531 1008 83398 4841 p 2 94 2373 1133 90231 5052 p 2 62 2424 1114 79052 4707 p 2 75 2330 1195 87203 4848 p 2 93 2353 1154 81155 4788 p 2 147 2314 1139 87042 5294 p 2 155 2312 1133 82944 5340 p 2 120 2332 1148 86206 5377 p 2 166 2295 1139 86100 5463 p 2 150 2183 1267 86809 5330 p 2 156 2235 1209 81300 5348 p 2 158 2144 1298 80331 5396 p 2 117 2452 1031 70627 5378 p 2 156 2315 1129 59119 5326 p 2 166 2331 1103 51913 5394 p 2 158 2319 1123 55757 5445 p 2 197 2274 1129 52794 5282 p 2 101 2244 1255 48993 4872 p 2 102 2035 1463 47863 4653 p 2 88 1737 1775 45375 4209 p 2 112 1957 1531 44711 4483 p 2 159 2005 1436 42891 4701 p 2 173 1972 1455 38416 4870 p 2 200 1875 1525 36819 4884 p 2 124 1963 1513 31235 4488 p 2 99 1668 1833 28188 3881 p 2 47 1699 1854 29531 3619 p 2 40 1528 2032 25099 3179 p 2 60 1709 1831 26404 3461 p 2 104 1747 1749 30621 3801 p 2 93 1768 1739 31631 4007 p 2 99 1607 1894 27695 3808 p 2 98 1570 1932 28076 3541 p 2 75 1487 2038 31231 3406 p 2 28 1556 2016 29617 3176 p 2 323 1732 1545 71201 5024 p 2 666 1767 1167 121536 7737 p 2 915 1673 1012 146029 9222 p 2 565 2091 944 140451 8483 p 2 656 2550 394 179387 9965 p 2 223 3030 347 145505 7976 p 2 234 2992 374 147400 8187 p 2 108 3138 354 146098 7551 p 2 118 3109 373 149103 7550 p 2 127 3111 362 140047 7605 p 2 58 3159 383 76665 6268 p 2 107 3211 282 78500 6726 p 2 90 3298 212 77998 6891 p 2 168 3297 135 87534 7313 p 2 157 3260 183 74459 6953 p 2 149 3367 84 82332 7255 p 2 288 3123 189 84183 7735 p 2 198 3026 376 71395 7082 p 2 169 2984 447 81849 7288 p 2 160 2806 634 57227 6449 p 2 78 3112 410 59502 6328 p 2 17 3203 380 40019 5554 p 2 63 2751 786 47502 4998 p 2 25 3063 512 29698 4616 p 2 103 2471 1026 52875 4632 p 2 41 3044 515 42420 4862 p 2 198 2604 798 69425 5450 p 2 92 2756 752 54300 4918 p 2 122 2768 710 72509 5584 p 2 58 2800 742 55628 5074 p 2 72 2614 914 60031 5006 p 2 43 2577 980 44092 4360 p 2 64 2448 1088 47804 4252 p 2 43 2227 1330 41098 3658 p 2 108 2230 1262 51925 4016 p 2 140 2227 1233 59277 4295 p 2 144 1984 1472 67004 4360 p 2 284 2455 861 82790 5785 p 2 320 2043 1237 82374 5564 p 2 267 2671 662 81412 6101 p 2 207 2655 738 67462 5620 p 2 199 2613 788 56905 5368 p 2 56 2526 1018 45101 4491 p 2 52 2769 779 54260 4845 p 2 126 2694 780 54868 5048 p 2 264 2552 784 74630 6005 p 2 371 2653 576 77686 6811 p 2 292 2821 487 66186 6587 p 2 275 2718 607 55294 6049 p 2 75 3194 331 57951 5762 p 2 112 2535 953 54065 4786 p 2 55 2723 822 53183 4815 p 2 34 2615 951 56608 4450 p 2 47 2455 1098 52830 4101 p 2 67 2007 1526 54631 3746 p 2 76 1884 1640 48806 3569 p 2 97 2424 1079 54220 4345 p 2 87 2568 945 55725 4344 p 2 100 2365 1135 50147 4183 p 2 78 2300 1222 53603 4088 p 2 138 2200 1262 60907 4465 p 2 203 2271 1126 62565 4930 p 2 256 2626 718 107912 6543 p 2 459 2646 495 120861 7910 p 2 385 2868 347 144941 8298 p 2 315 2985 300 158415 8322 p 2 278 2944 378 151390 7855 p 2 237 2951 412 156870 7730 p 2 208 2881 511 140992 7168 p 2 234 2849 517 139564 7319 p 2 307 2620 673 143321 7414 p 2 466 2696 438 166483 8654 p 2 412 2848 340 170358 8770 p 2 353 2994 253 187012 8944 p 2 482 2849 269 178326 9443 p 2 356 2975 269 156099 8995 p 2 117 3155 328 136524 7549 p 2 213 2957 430 142999 7486 p 2 237 2861 502 148460 7260 p 2 270 2883 447 162189 7489 p 2 265 2785 550 164675 7553 p 2 251 2999 350 157343 7584 p 2 272 2957 371 141918 7532 p 2 243 3132 225 124747 7446 p 2 160 3099 341 121873 7006 p 2 135 3145 320 122789 6831 p 2 230 2912 458 114564 6945 p 2 452 2872 276 130544 8189 p 2 301 2889 410 139805 8065 p 2 227 2913 460 141955 7567 p 2 315 2824 461 140454 7696 p 2 402 2939 259 145912 8507 p 2 353 3061 186 154636 8848 p 2 313 3110 177 152641 8542 p 2 287 3100 213 145068 8512 p 2 389 3068 143 161030 9174 p 2 417 2922 261 179451 9162 p 2 302 3072 226 174436 8759 p 2 231 2859 510 162432 7771 p 2 371 2810 419 139089 7920 p 2 177 2872 551 133837 7082 p 2 201 2815 584 136424 6808 p 2 229 2783 588 128743 6720 p 2 201 2830 569 113069 6309 p 2 125 2755 720 104582 5827 p 2 112 2854 634 98335 5721 p 2 59 2718 823 83477 5058 p 2 89 2733 778 83467 5041 p 2 88 2618 894 82706 4877 p 2 215 2766 619 110851 6029 p 2 280 2607 713 109220 6333 p 2 249 2651 700 94921 6253 p 2 237 2606 757 88946 5989 p 2 180 2530 890 85827 5607 p 2 184 2569 847 76154 5635 p 2 203 2602 795 83822 5707 p 2 152 2822 626 83115 5851 p 2 129 2838 633 87510 5889 p 2 131 2684 785 74755 5400 p 2 134 2903 563 81087 5609 p 2 211 2749 640 82632 5880 p 2 196 2993 411 74118 6173 p 2 263 2787 550 72214 6132 p 2 205 3142 253 80036 6589 p 2 144 3175 281 72620 6378 p 2 94 2944 562 70869 5792 p 2 187 2660 753 77852 5637 p 2 305 2554 741 80512 6038 p 2 183 2641 776 56962 5058 p 2 171 2649 780 73725 5242 p 2 233 2405 962 80690 5376 p 2 136 2438 1026 68307 4810 p 2 216 2161 1223 77115 5059 p 2 162 2636 802 73670 5327 p 2 143 2244 1213 73595 4681 p 2 122 2635 843 76164 5204 p 2 147 2634 819 71422 5189 p 2 243 2618 739 86712 5871 p 2 320 2457 823 95943 6245 p 2 255 2628 717 89035 6145 p 2 175 2764 661 86613 5972 p 2 173 2753 674 86681 5834 p 2 137 2679 784 85497 5589 p 2 159 2797 644 94239 5751 p 2 230 2803 567 106727 6459 p 2 227 3022 351 110079 6940 p 2 318 2798 484 108707 7198 p 2 382 2972 246 105177 7917 p 2 201 2948 451 97075 6911 p 2 174 2877 549 87991 6424 p 2 258 2754 588 81039 6471 p 2 481 2518 601 74144 6789 p 2 137 2706 757 70156 5687 p 2 98 2651 851 67003 4999 p 2 150 2484 966 65712 4854 p 2 544 2439 617 73541 6565 p 2 90 2619 891 64376 4933 p 2 37 2975 588 63691 5044 p 2 78 2441 1081 60201 4264 p 2 70 2701 829 65715 4748 p 2 94 2606 900 65196 4733 p 2 165 2498 937 66037 4956 p 2 227 2441 932 80321 5319 p 2 281 2362 957 83706 5634 p 2 259 2651 690 84030 6098 p 2 262 2655 683 91253 6469 p 2 206 2482 912 88184 5922 p 2 163 2709 728 77531 5785 p 2 190 2635 775 73339 5712 p 2 243 2873 484 75202 6413 p 2 343 2658 599 63687 6491 p 2 190 3095 315 69423 6715 p 2 163 3005 432 64260 6163 p 2 157 2807 636 66574 5719 p 2 186 2509 905 70519 5622 p 2 162 2440 998 61486 5168 p 2 53 2442 1105 45294 4209 p 2 70 2308 1222 47118 4029 p 2 90 2110 1400 47124 3789 p 2 86 2379 1135 47838 4014 p 2 52 2051 1497 47332 3565 p 2 59 2586 955 51065 4264 p 2 101 2147 1352 45819 3790 p 2 110 2599 891 53877 4567 p 2 109 2652 839 46078 4500 p 2 150 2520 930 44992 4621 p 2 140 2520 940 41017 4558 p 2 145 2264 1191 38590 4332 p 2 277 2512 811 46322 5218 p 2 306 2232 1062 43281 5038 p 2 305 2115 1180 59136 5305 p 2 371 2219 1010 63811 5773 p 2 395 2701 504 65241 6582 p 2 234 2980 386 102657 7074 p 2 251 2975 374 128294 7511 p 2 171 3116 313 114014 7180 p 2 120 3202 278 108428 6944 p 2 140 3162 298 100945 6678 p 2 192 3098 310 110814 7030 p 2 108 3282 210 118220 7454 p 2 134 3262 204 132627 7862 p 2 166 3267 167 137336 8280 p 2 227 3245 128 132252 8763 p 2 186 3349 65 118055 8701 p 2 78 3495 27 115596 8356 p 2 62 3487 51 115258 8413 p 2 61 3505 34 112433 8518 p 2 57 3472 71 105164 8541 p 2 54 3505 41 97418 8595 p 2 37 3541 22 99076 8502 p 2 23 3560 17 88920 8468 p 2 48 3527 25 83763 7780 p 2 21 3562 17 78987 7515 p 2 30 3549 21 71308 7088 p 2 9 3567 24 67631 6778 p 2 0 3583 17 62516 6599 p 2 7 3554 39 60727 6379 p 2 9 3585 6 64381 6832 p 2 10 3565 25 56909 6508 p 2 9 3536 55 55804 6478 p 2 9 3540 51 57377 6387 p 2 12 3551 37 62573 6419 p 2 0 3572 28 65165 6393 p 2 4 3568 28 66937 6368 p 2 40 3530 30 69175 6703 p 2 35 3549 16 73968 6812 p 2 59 3519 22 75865 6857 p 2 193 3391 16 76048 7368 p 2 2 3554 44 54362 6269 p 2 6 3563 31 57699 6486 p 2 3 3532 65 53914 6354 p 2 3 3579 18 58136 6642 p 2 4 3564 32 50370 6537 p 2 2 3538 60 52296 6547 p 2 0 3513 87 48752 6513 p 2 345 3227 28 74073 7809 p 2 12 3538 50 62571 6757 p 2 6 3533 61 61936 6496 p 2 5 3514 81 60723 6543 p 2 2 3546 52 61595 6678 p 2 64 3481 55 72437 7034 p 2 46 3541 13 77018 7227 p 2 86 3476 38 80878 7205 p 2 257 3322 21 87175 7780 p 2 4 3561 35 54691 6347 p 2 1 3538 61 55865 6208 p 2 1 3443 156 49478 6006 p 2 4 3375 221 53238 5873 p 2 418 3140 42 80955 7733 p 2 10 3530 60 70498 6430 p 2 5 3500 95 67593 6212 p 2 2 3506 92 62510 6199 p 2 2 3494 104 60533 6144 p 2 63 3503 34 75928 6909 p 2 60 3416 124 72516 6629 p 2 116 3451 33 84615 7048 p 2 412 3114 74 82783 7949 p 2 1 3522 77 53493 5911 p 2 1 3373 226 50103 5575 p 2 0 3246 354 49596 5368 p 2 605 2950 45 84945 8121 p 2 9 3522 69 54646 5902 p 2 4 3511 85 67337 6140 p 2 3 3535 62 65146 6191 p 2 1 3505 94 64632 6138 p 2 2 3559 39 66222 6400 p 2 129 3341 130 79671 7026 p 2 123 3430 47 85192 7227 p 2 174 3342 84 86811 7414 p 2 0 3468 132 47685 5901 p 2 347 3197 56 97001 8054 i 2 3600 0 0 162758 15948 p 2 403 3065 132 110006 8399 p 2 190 3305 105 116944 8170 p 2 6 3439 155 86287 7010 p 2 8 3483 109 82916 6776 p 2 1 3453 146 77066 6312 p 2 0 3514 86 49724 5786 p 2 4 3387 209 75000 6016 p 2 1 3538 61 79918 6259 p 2 0 3442 158 69382 5848 p 2 0 3354 246 71239 5711 p 2 173 3182 245 103242 7377 p 2 107 3155 338 104643 7064 p 2 0 3346 254 46675 5499 p 2 0 3307 293 44623 5282 p 2 0 3256 344 43153 5016 i 2 3600 0 0 145442 17451 p 2 2 3582 16 73170 6781 p 2 0 3578 22 70784 6335 p 2 0 3551 49 66633 6177 p 2 5 3561 34 68957 6293 p 2 18 3526 56 67759 6345 p 2 8 3554 38 71225 6424 p 2 75 3469 56 72119 6787 p 2 341 3198 61 76501 7520 p 2 0 3523 77 47146 6016 p 2 1 3503 96 47977 6017 p 2 3 3489 108 52394 6139 p 2 3 3442 155 55297 6211 p 2 1 3528 71 66700 6482 p 2 491 3088 21 94013 8471 p 2 5 3560 35 89703 7050 p 2 9 3562 29 85934 6878 p 2 4 3558 38 84353 6917 p 2 5 3567 28 80701 6975 p 2 74 3507 19 87711 7294 p 2 45 3493 62 83223 6955 p 2 91 3478 31 87457 7422 p 2 405 3149 46 102239 8449 p 2 3 3398 199 59182 6066 p 2 10 3348 242 57092 5863 p 2 12 3428 160 65936 5984 p 2 648 2927 25 103298 8723 p 2 24 3485 91 91900 6700 p 2 26 3522 52 92464 6831 p 2 18 3481 101 85840 6591 p 2 19 3470 111 88553 6572 p 2 115 3399 86 86411 7078 p 2 42 3406 152 80824 6740 p 2 130 3395 75 93089 7377 p 2 550 2983 67 104468 8678 p 2 8 3316 276 57978 5647 p 2 10 3417 173 61092 5960 p 2 5 3405 190 64004 5667 p 2 6 3376 218 59574 5740 p 2 925 2588 87 95874 9071 p 2 17 3479 104 95334 6723 p 2 12 3445 143 85140 6602 p 2 22 3405 173 87915 6557 p 2 22 3424 154 85661 6688 p 2 102 3266 232 92954 7125 p 2 82 3382 136 91086 7099 p 2 137 3326 137 99523 7734 p 2 431 3012 157 115135 8942 p 2 554 2968 78 126602 9662 p 2 483 3020 97 133460 9714 p 2 199 3347 54 129306 8895 p 2 20 3372 208 96093 7084 p 2 13 3523 64 93400 7272 p 2 48 3392 160 97024 7056 p 2 30 3322 248 96119 6830 p 2 44 3271 285 95044 6647 p 2 123 3022 455 96227 6830 p 2 17 3136 447 86418 6194 p 2 6 3105 489 77338 5805 p 2 5 3109 486 78592 5730 p 2 2 3173 425 79432 5729 p 2 7 3149 444 78257 5590 p 2 0 3505 95 79279 6043 p 2 0 3290 310 74838 5654 p 2 0 3541 59 80609 5994 p 2 0 3591 9 60682 6259 i 2 3600 0 0 116631 17484 p 2 1 3592 7 55660 6702 p 2 5 3555 40 65171 6342 p 2 8 3573 19 64557 6391 p 2 11 3557 32 69670 6382 p 2 10 3565 25 70074 6436 p 2 15 3567 18 71964 6605 p 2 23 3552 25 71742 6605 p 2 239 3352 9 81704 7588 p 2 8 3489 103 57931 6275 p 2 13 3475 112 61549 6294 p 2 9 3539 52 53246 6224 p 2 391 3170 39 78689 7647 p 2 17 3541 42 66883 6610 p 2 7 3539 54 71076 6525 p 2 12 3526 62 64558 6500 p 2 10 3527 63 68469 6581 p 2 18 3525 57 68456 6580 p 2 20 3524 56 69988 6629 p 2 54 3500 46 70504 6851 p 2 328 3250 22 82136 7921 p 2 9 3440 151 52415 6087 p 2 10 3436 154 57870 6138 p 2 11 3466 123 53868 6083 p 2 449 3106 45 78131 7752 p 2 13 3508 79 68950 6413 p 2 22 3436 142 70593 6335 p 2 22 3485 93 66372 6302 p 2 16 3494 90 70961 6316 p 2 34 3471 95 72507 6517 p 2 23 3507 70 73959 6530 p 2 90 3434 76 75801 6801 p 2 467 3107 26 84323 8054 p 2 14 3448 138 50042 5796 p 2 10 3444 146 53469 5785 p 2 15 3493 92 49816 5851 p 2 4 3443 153 51389 5673 p 2 15 3289 296 45068 5453 p 2 8 3220 372 49808 5276 p 2 650 2901 49 88825 8204 p 2 11 3480 109 72467 6352 p 2 5 3464 131 69213 6224 p 2 6 3445 149 65873 6223 p 2 9 3406 185 67809 6094 p 2 46 3484 70 77039 6787 p 2 34 3432 134 72087 6450 p 2 163 3388 49 80944 7307 p 2 389 3124 87 88623 7918 i 2 3600 0 0 176725 16795 p 2 299 3159 142 102297 7976 p 2 47 3252 301 91907 6799 p 2 21 3415 164 89587 6798 p 2 46 3284 270 92788 6834 p 2 35 3299 266 87355 6637 p 2 24 3182 394 87001 6443 p 2 18 3154 428 84482 6110 p 2 9 3432 159 89107 6724 p 2 1 3260 339 76637 5941 p 2 1 3487 112 81104 6284 p 2 0 3352 248 66529 5631 p 2 1 3259 340 73400 5617 p 2 0 3281 319 44835 5148 p 2 0 3056 544 39797 4721 p 2 0 3560 40 51102 5864 i 2 3600 0 0 134638 16825 p 2 4 3560 36 56599 6494 p 2 0 3547 53 52115 6083 p 2 0 3539 61 46787 5824 p 2 0 3557 43 49896 6045 p 2 21 3504 75 51671 6079 p 2 8 3534 58 56226 6206 p 2 83 3467 50 53744 6465 p 2 256 3291 53 56728 6961 p 2 4 3536 60 50431 5952 p 2 17 3437 146 57924 6003 p 2 15 3471 114 57049 6061 p 2 9 3430 161 50042 5870 p 2 418 3091 91 67361 7421 p 2 54 3468 78 72768 6757 p 2 27 3510 63 68189 6494 p 2 27 3497 76 66316 6426 p 2 26 3521 53 60800 6382 p 2 87 3477 36 69388 6930 p 2 69 3507 24 70126 6914 p 2 172 3390 38 75351 7409 p 2 379 3190 31 78557 7978 p 2 33 3453 114 43169 5948 p 2 14 3446 140 37490 5819 p 2 18 3462 120 43485 5942 p 2 9 3469 122 41915 5859 p 2 545 2991 64 67532 8032 p 2 53 3456 91 67275 6785 p 2 15 3527 58 59183 6580 p 2 9 3500 91 53077 6261 i 2 3600 0 0 108141 16135 p 2 104 3391 105 77140 7266 p 2 39 3463 98 71284 6845 p 2 50 3431 119 64454 6646 p 2 56 3386 158 58442 6442 p 2 146 3313 141 67475 7021 p 2 37 3412 151 67882 6674 p 2 245 3219 136 76467 7628 p 2 572 2880 148 88508 8696 p 2 548 2853 199 92468 8617 p 2 334 3203 63 93061 8357 p 2 57 3281 262 80093 6798 p 2 52 3490 58 89297 7218 p 2 16 3435 149 74189 6648 p 2 11 3419 170 72754 6382 p 2 80 3349 171 76024 6762 p 2 197 3068 335 92969 7341 p 2 145 3327 128 98678 7471 p 2 1056 2380 164 139966 10767 i 2 3600 0 0 146571 15657 p 2 1420 2167 13 161152 12925 p 2 326 3249 25 139208 9698 p 2 286 3271 43 139948 9571 p 2 362 3206 32 147025 9862 p 2 581 3002 17 150228 10640 p 2 1010 2564 26 157632 12036 p 2 632 2936 32 117461 10806 p 2 485 3050 65 87511 9583 p 2 9 3452 139 47565 7139 i 2 3600 0 0 132712 17742 p 2 18 3578 4 69098 7302 p 2 0 3565 35 65470 6526 p 2 0 3579 21 64350 6539 p 2 5 3544 51 69807 6400 p 2 57 3536 7 76224 7068 p 2 328 3249 23 83356 7789 p 2 81 3504 15 79382 7180 p 2 7 3542 51 64005 6459 p 2 12 3525 63 71259 6488 p 2 12 3536 52 67210 6631 p 2 116 3442 42 75402 7169 p 2 461 3109 30 89547 8276 p 2 161 3416 23 85311 7743 p 2 7 3538 55 67317 6792 p 2 9 3543 48 63693 6918 p 2 14 3533 53 64887 6927 p 2 159 3418 23 76980 7902 p 2 240 3287 73 78154 7733 p 2 383 3160 57 74647 8390 p 2 487 3057 56 70553 8205 p 2 29 3481 90 67422 7046 p 2 20 3456 124 64846 6682 p 2 13 3413 174 64637 6477 p 2 18 3464 118 68390 6530 p 2 240 3252 108 80350 7503 p 2 366 3123 111 90446 7995 p 2 365 3168 67 93768 8091 p 2 587 2948 65 104001 8922 p 2 612 2968 20 107086 9233 p 2 69 3408 123 94341 6959 p 2 20 3479 101 86226 6739 p 2 140 3327 133 91966 7376 p 2 22 3424 154 85278 6828 p 2 20 3409 171 78932 6583 p 2 12 3332 256 76506 6328 p 2 9 3422 169 80819 6363 p 2 85 3296 219 89995 7025 p 2 95 3213 292 94062 6927 p 2 60 3222 318 91265 6672 p 2 43 3183 374 93449 6696 p 2 11 3486 103 60047 6055 p 2 8 3305 287 51397 5569 p 2 0 3435 165 53049 5534 p 2 5 3233 362 47066 5213 p 2 10 3119 471 50863 5116 p 2 6 3259 335 49211 5357 p 2 0 3033 567 46239 5026 p 2 6 3219 375 48634 5311 p 2 7 3223 370 47482 5365 p 2 8 3172 420 46253 5377 p 2 0 3398 202 46760 5737 p 2 0 3343 257 45275 5625 p 2 0 3425 175 47007 5656 p 2 0 3045 555 42843 5223 p 2 0 3449 151 50492 5843 p 2 0 3365 235 46579 5611 p 2 0 3379 221 47465 5596 p 2 0 3251 349 45646 5365 p 2 0 3023 577 45669 5010 p 2 0 3217 383 46119 5178 p 2 0 2911 689 45706 4795 i 2 3600 0 0 136540 17693 p 2 19 3567 14 69146 6965 p 2 2 3560 38 65779 6396 p 2 13 3567 20 68112 6597 p 2 1 3560 39 63841 6340 p 2 5 3562 33 66021 6472 p 2 104 3464 32 70862 6909 p 2 334 3226 40 84361 7605 p 2 44 3516 40 80089 7075 p 2 17 3543 40 82231 7000 p 2 141 3422 37 80695 7486 p 2 4 3564 32 69361 6796 p 2 5 3534 61 69386 6868 p 2 180 3387 33 78208 7637 p 2 54 3510 36 74595 7283 p 2 444 3145 11 86235 8352 p 2 72 3497 31 85916 7481 p 2 165 3421 14 91306 8026 p 2 19 3532 49 74901 7092 p 2 9 3547 44 77102 6968 p 2 10 3496 94 74073 6836 p 2 224 3275 101 93287 7679 p 2 617 2882 101 97673 8602 p 2 64 3439 97 94843 7422 p 2 40 3430 130 94569 7231 p 2 132 3345 123 94635 7636 p 2 19 3415 166 83020 6760 p 2 20 3546 34 88244 7003 p 2 351 3153 96 98370 8107 p 2 83 3452 65 99395 7428 p 2 33 3443 124 86402 6939 p 2 41 3362 197 87463 6890 p 2 737 2705 158 104688 9172 p 2 319 3032 249 96666 7924 p 2 108 3330 162 97649 7486 p 2 89 3405 106 104287 7377 p 2 23 3435 142 83409 6767 p 2 12 3446 142 74289 6323 p 2 29 3427 144 72772 6245 p 2 9 3533 58 72660 6363 p 2 3 3312 285 65366 5865 p 2 10 3501 89 67515 6177 p 2 12 3270 318 40014 5148 p 2 1 3015 584 39556 4802 p 2 1 3054 545 37229 4832 p 2 0 2910 690 37247 4702 p 2 0 3059 541 36799 4863 p 2 0 3172 428 37115 5058 p 2 0 2966 634 35400 4892 p 2 0 3305 295 38287 5463 p 2 0 3230 370 36601 5254 p 2 0 3385 215 40821 5628 p 2 0 3305 295 37965 5460 p 2 0 3396 204 41433 5655 p 2 0 3358 242 41056 5464 p 2 0 3267 333 41107 5331 p 2 0 3125 475 38973 5040 p 2 2 3282 316 71033 6046 p 2 2 3361 237 68242 5952 p 2 0 3342 258 69094 5932 p 2 1 3275 324 66858 5778 p 2 0 3175 425 65331 5577 p 2 0 3028 572 41414 4826 p 2 0 2899 701 40649 4602 i 2 3600 0 0 115279 17823 p 2 5 3584 11 62442 7097 p 2 2 3572 26 58754 6379 p 2 1 3574 25 68891 6363 p 2 2 3568 30 66642 6407 p 2 27 3542 31 72604 6526 p 2 13 3551 36 71714 6487 p 2 0 3575 25 70459 6365 p 2 429 3152 19 89298 8048 p 2 20 3559 21 72166 6677 p 2 1 3561 38 69881 6451 p 2 1 3579 20 70059 6716 p 2 3 3538 59 69138 6613 p 2 66 3510 24 76862 7217 p 2 13 3543 44 71988 6875 p 2 412 3143 45 85481 7991 p 2 224 3338 38 86870 7777 p 2 20 3470 110 65494 6520 p 2 0 3501 99 65323 6363 p 2 14 3512 74 68396 6530 p 2 105 3383 112 75798 7021 p 2 38 3500 62 79950 6943 p 2 10 3522 68 74408 6585 p 2 351 3214 35 89132 7983 p 2 591 2902 107 78212 8016 p 2 14 3413 173 53802 5828 p 2 6 3458 136 69141 6283 p 2 6 3427 167 72690 6207 p 2 5 3435 160 71664 6246 p 2 8 3397 195 71171 6192 p 2 163 3302 135 84543 7088 p 2 63 3420 117 80868 6705 p 2 19 3437 144 76542 6295 p 2 2 3433 165 48199 5623 p 2 361 3106 133 86048 7745 i 2 3600 0 0 174785 18247 p 2 132 2988 480 91185 6768 p 2 25 3391 184 93370 6875 p 2 4 3403 193 82944 6271 p 2 175 3256 169 98836 7439 p 2 87 3307 206 97678 7221 p 2 5 3191 404 50254 5568 p 2 46 3324 230 90819 6673 p 2 28 3297 275 88920 6437 p 2 6 3255 339 83024 6073 p 2 2 3265 333 82702 6048 p 2 24 3230 346 82496 5992 p 2 2 3496 102 85522 6434 p 2 14 3295 291 75245 5914 p 2 0 3439 161 48292 5558 p 2 0 3268 332 42343 5195 p 2 0 3225 375 44239 5146 p 2 0 3346 254 44548 5342 p 2 0 3055 545 42312 4876 p 2 0 3224 376 44042 5133 p 2 0 3171 429 44302 5093 p 2 0 3050 550 43824 4903 p 2 0 3413 187 48580 5510 p 2 0 3345 255 47666 5312 p 2 0 3299 301 47270 5290 i 2 3600 0 0 140411 17207 p 2 11 3532 57 61577 6151 p 2 0 3506 94 57463 5564 p 2 0 3455 145 61128 5512 p 2 0 3514 86 59435 5728 p 2 19 3498 83 64999 5946 p 2 277 3259 64 74492 6814 p 2 110 3401 89 69690 6386 p 2 1 3446 153 61253 5762 p 2 2 3498 100 57941 5917 p 2 1 3458 141 57079 5893 p 2 48 3492 60 66993 6562 p 2 31 3434 135 63567 6506 p 2 531 3009 60 80699 8303 p 2 7 3519 74 57108 6345 p 2 3 3501 96 56889 6364 p 2 1 3417 182 53423 5962 p 2 1 3422 177 56751 6189 p 2 69 3360 171 66949 6632 p 2 381 3093 126 83473 7708 p 2 91 3331 178 83613 6669 p 2 16 3417 167 78268 6248 p 2 36 3378 186 82642 6266 p 2 36 3504 60 88171 6580 p 2 145 3301 154 94411 6957 p 2 62 3470 68 87310 6901 p 2 159 3298 143 90062 7152 p 2 514 2865 221 104269 8242 p 2 508 2970 122 105285 8441 p 2 25 3323 252 85211 6247 p 2 5 3434 161 79716 6113 p 2 10 3357 233 76591 5879 p 2 23 3308 269 78271 5865 p 2 24 3331 245 80055 6063 p 2 23 3308 269 82408 5885 p 2 11 3458 131 82506 6172 p 2 17 3255 328 79214 5840 p 2 109 3360 131 97852 6916 p 2 48 3296 256 83622 6392 p 2 3 3194 403 55978 5181 p 2 4 3195 401 48607 5186 p 2 2 3116 482 48091 4818 p 2 16 3278 306 72836 5687 p 2 33 3283 284 71784 5768 p 2 82 3206 312 76873 6071 p 2 103 3194 303 74395 6335 p 2 63 3165 372 72518 6058 p 2 76 3368 156 73026 6527 p 2 0 3190 410 45005 5421 p 2 0 3101 499 37012 5319 p 2 0 3189 411 36172 5257 p 2 0 3150 450 39337 5381 p 2 0 2802 798 35813 4813 i 2 3600 0 0 11955 10028 p 2 265 2866 469 14282 5057 p 2 0 2257 1343 3788 2595 p 2 0 431 3169 944 884 p 2 0 262 3338 839 686 p 2 0 297 3303 862 696 p 2 0 200 3400 899 651 p 2 0 255 3345 1094 706 p 2 0 264 3336 945 687 p 2 1303 2231 66 36124 8898 p 2 985 2611 4 48858 9556 p 2 916 2678 6 57687 9516 p 2 826 2773 1 67993 9701 p 2 715 2865 20 68557 9489 p 2 1 3419 180 25436 5344 p 2 0 2821 779 17737 3808 p 2 1 2823 776 18969 3836 p 2 2 2381 1217 17698 3247 p 2 3 2253 1344 17558 3101 p 2 1546 2054 0 116280 12074 p 2 8 3374 218 24351 5173 p 2 8 2966 626 20521 4008 p 2 8 2611 981 18156 3413 p 2 10 2271 1319 15797 3027 p 2 9 1759 1832 15160 2462 p 2 11 1990 1599 17055 2726 p 2 12 2112 1476 18251 2909 i 2 3600 0 0 98264 13858 p 2 6 3447 147 36127 5704 p 2 7 2951 642 23629 4166 p 2 4 2699 897 20107 3698 p 2 6 2845 749 21308 3957 p 2 7 3091 502 24782 4391 p 2 13 2690 897 21401 3806 p 2 1 1978 1621 18508 2805 p 2 1432 2168 0 111448 11717 p 2 2 3301 297 22266 4889 p 2 0 3152 448 18579 4369 p 2 0 2866 734 16688 3865 p 2 0 2674 926 14069 3557 p 2 0 2458 1142 12951 3240 p 2 1 2202 1397 11431 2909 p 2 0 2579 1021 14225 3406 p 2 1452 2148 0 131345 12115 p 2 0 3411 189 26670 5080 p 2 0 3069 531 18375 4149 p 2 0 2938 662 16138 3997 p 2 0 2777 823 14482 3712 p 2 0 2168 1432 10090 2917 p 2 0 2140 1460 9913 2832 p 2 0 1904 1696 8716 2563 p 2 1023 2576 1 131200 10414 p 2 0 3517 83 28490 5675 p 2 0 3221 379 19882 4425 p 2 0 3225 375 18837 4461 p 2 0 3272 328 23285 4601 p 2 0 2675 925 14407 3536 p 2 0 2782 818 15634 3639 p 2 0 1977 1623 9367 2625 p 2 0 1661 1939 8410 2276 p 2 0 2972 628 15886 3974 p 2 758 2841 1 101368 9358 p 2 0 3085 515 12062 3998 p 2 0 2745 855 9518 3438 p 2 0 2928 672 12678 3727 p 2 0 2139 1461 7239 2697 p 2 0 3152 448 12739 4047 p 2 0 2369 1231 7898 2932 p 2 0 2931 669 12415 3731 p 2 0 2099 1501 6901 2570 p 2 0 2134 1466 7041 2658 p 2 0 1696 1904 5619 2144 p 2 0 1102 2498 3577 1540 p 2 0 882 2718 3117 1333 p 2 0 646 2954 2452 1090 i 2 3600 0 0 92905 13008 p 2 30 3154 416 19407 4415 p 2 0 2926 674 11594 3301 p 2 0 2351 1249 12067 2999 p 2 0 2254 1346 9804 2806 p 2 0 2051 1549 8104 2515 p 2 0 1654 1946 5771 2057 p 2 0 1132 2468 4943 1558 p 2 0 1105 2495 3824 1525 p 2 0 2707 893 12724 3508 i 2 3600 0 0 76124 12217 p 2 0 2556 1044 8778 2943 p 2 0 2788 812 10890 3251 p 2 0 2444 1156 11445 3005 p 2 0 2232 1368 7996 2626 p 2 0 2222 1378 10605 2850 p 2 0 2045 1555 9316 2681 p 2 0 2493 1107 13749 3361 i 2 3600 0 0 54974 11756 p 2 0 1573 2027 4345 1987 p 2 0 2292 1308 6638 2578 p 2 0 1140 2460 3335 1494 p 2 0 1463 2137 3006 1750 p 2 0 1535 2065 4067 1845 p 2 0 1434 2166 3775 1812 p 2 0 2535 1065 12163 3213 i 2 3600 0 0 86123 13152 p 2 0 2744 856 20276 3671 p 2 0 2431 1169 9792 2903 p 2 0 2539 1061 10307 3134 p 2 0 2606 994 11161 3144 p 2 0 2016 1584 7042 2503 p 2 0 1876 1724 6448 2289 p 2 0 1659 1941 5845 2022 p 2 0 2800 800 12849 3600 i 2 3600 0 0 82955 12903 p 2 0 2393 1207 9199 2844 p 2 0 2498 1102 10260 3001 p 2 0 1778 1822 6260 2163 p 2 0 2507 1093 10227 3012 p 2 0 1582 2018 5340 1975 p 2 0 2445 1155 10144 2944 p 2 0 2724 876 12586 3359 i 2 3600 0 0 57363 11782 p 2 0 3270 330 15075 3979 p 2 0 2791 809 8269 3046 p 2 0 2665 935 9162 3057 p 2 0 2293 1307 6518 2600 p 2 0 2226 1374 6002 2486 p 2 0 1916 1684 5266 2224 p 2 0 2803 797 10484 3406 i 2 3600 0 0 44298 11429 p 2 0 2508 1092 9900 2935 p 2 0 2525 1075 7737 2737 p 2 0 2185 1415 9354 2533 p 2 0 2250 1350 9324 2576 p 2 0 2178 1422 8684 2510 p 2 0 2070 1530 7647 2326 p 2 0 2132 1468 7556 2366 p 2 0 1948 1652 7699 2243 p 2 0 1978 1622 4018 2183 p 2 0 1945 1655 4141 2163 p 2 0 1848 1752 3872 2081 p 2 0 1932 1668 3927 2162 i 2 3600 0 0 203385 19245 p 2 0 3257 343 74719 5421 p 2 0 3543 57 69407 5776 p 2 0 3371 229 68143 5393 p 2 0 2937 663 55136 4505 p 2 0 2518 1082 55632 4055 p 2 0 3337 263 65997 5210 p 2 0 3179 421 63110 4987 p 2 0 2816 784 56689 4350 p 2 0 2091 1509 51789 3493 p 2 0 3590 10 74600 6237 p 2 992 2608 0 203611 11849 p 2 0 3205 395 53659 4877 p 2 2 2691 907 48360 4177 p 2 0 3337 263 39667 4791 p 2 1 3041 558 50693 4477 p 2 2 2918 680 48704 4284 p 2 0 2695 905 39422 3822 p 2 0 3048 552 42864 4329 p 2 0 2249 1351 30566 3232 i 2 3600 0 0 20695 10551 p 2 143 2505 952 22913 4235 p 2 281 2385 934 22041 4682 p 2 290 1562 1748 25285 4227 p 2 251 1518 1831 25677 4249 p 2 214 1624 1762 25605 4426 p 2 162 1590 1848 28259 4037 p 2 104 1608 1888 29345 3637 p 2 59 1476 2065 28889 3212 p 2 124 1590 1886 29892 3475 p 2 188 1629 1783 28920 4051 p 2 207 1819 1574 34586 4507 p 2 252 1673 1675 35171 4498 p 2 225 1668 1707 39379 4282 p 2 334 1443 1823 37261 4304 p 2 219 1828 1553 41771 4637 p 2 213 1659 1728 43351 4498 p 2 141 1927 1532 48991 4540 p 2 173 2003 1424 52873 4923 p 2 268 1976 1356 59105 5420 p 2 195 2057 1348 55476 5441 p 2 256 2107 1237 53050 5655 p 2 149 2138 1313 56067 5415 p 2 128 2183 1289 58891 5452 p 2 147 2070 1383 59134 5428 p 2 120 2313 1167 60015 5544 p 2 203 2351 1046 62318 6132 p 2 235 2566 799 71161 6947 p 2 298 2607 695 76715 7315 p 2 239 2840 521 79239 7365 p 2 213 2882 505 78620 7168 p 2 151 3005 444 76682 6930 p 2 183 2876 541 78656 7017 p 2 277 2879 444 78993 7566 p 2 372 2751 477 84321 7905 p 2 296 2845 459 90552 7878 p 2 305 2690 605 91391 7578 p 2 345 2791 464 90888 7795 p 2 278 2790 532 97022 7595 p 2 181 2987 432 94896 7318 p 2 217 2888 495 99653 7228 p 2 220 2836 544 108066 7354 p 2 329 2808 463 125151 8170 p 2 375 2762 463 127903 8509 p 2 398 2785 417 134302 8704 p 2 318 2881 401 131566 8604 p 2 356 2831 413 135944 8628 p 2 420 2794 386 126685 8556 p 2 337 2745 518 116121 8041 p 2 355 2865 380 122711 8542 p 2 362 2700 538 127909 8259 p 2 358 2826 416 125249 8305 p 2 327 2720 553 119954 7967 p 2 282 2883 435 112091 7846 p 2 226 3007 367 108776 7592 p 2 240 3010 350 110190 7657 p 2 215 2965 420 113602 7480 p 2 208 2956 436 105017 7534 p 2 243 2884 473 103136 7384 p 2 243 3001 356 105564 7604 p 2 314 2689 597 106556 7642 p 2 250 2895 455 98737 7681 p 2 207 2912 481 93448 7404 p 2 418 2862 320 94020 8119 p 2 382 2677 541 88632 7822 p 2 285 2809 506 89041 7568 p 2 267 2729 604 89738 7263 p 2 198 2860 542 93950 7171 p 2 239 2682 679 92219 7036 p 2 142 2863 595 87009 6707 p 2 236 2934 430 93349 7302 p 2 168 3091 341 87915 7238 p 2 124 2928 548 75749 6463 p 2 110 3060 430 78143 6506 p 2 202 2864 534 85668 6719 p 2 352 2872 376 88016 7426 p 2 410 2509 681 92009 7480 p 2 316 2793 491 99914 7687 p 2 408 2625 567 101014 7746 p 2 374 2698 528 104487 7978 p 2 392 2632 576 113044 8165 p 2 227 2875 498 99890 7443 p 2 153 2924 523 98809 7158 p 2 177 2964 459 97090 6902 p 2 140 2841 619 90308 6508 p 2 146 2950 504 83541 6437 p 2 141 2827 632 77900 6155 p 2 175 2906 519 78410 6502 p 2 172 2664 764 76248 6187 p 2 121 2902 577 74427 6201 p 2 105 2864 631 70735 6022 p 2 138 2805 657 74080 5959 p 2 143 2678 779 77030 5979 p 2 140 2831 629 76062 6057 p 2 132 2788 680 75165 6012 p 2 138 2787 675 77875 6040 p 2 132 2718 750 78148 5962 p 2 121 2803 676 79746 5923 p 2 165 2638 797 80385 5967 p 2 181 2966 453 92105 6567 p 2 265 2653 682 96533 6671 p 2 271 2925 404 95635 7251 p 2 262 2989 349 98414 7522 p 2 287 2881 432 98691 7529 p 2 251 2807 542 106200 7415 p 2 236 2823 541 112496 7280 p 2 261 2894 445 127237 7703 p 2 319 2823 458 129368 8005 p 2 300 2732 568 127229 7849 p 2 233 2881 486 125774 7563 p 2 248 2737 615 116344 7418 p 2 242 2828 530 112361 7439 p 2 234 2607 759 107419 6897 p 2 234 2770 596 106140 7103 p 2 317 2661 622 110093 7262 p 2 266 2836 498 102813 7194 p 2 177 2793 630 94517 6819 p 2 160 2841 599 89458 6522 p 2 144 2895 561 95129 6490 p 2 164 2967 469 103750 6660 p 2 180 2862 558 111091 6811 p 2 183 2940 477 109177 7082 p 2 209 2862 529 112004 7030 p 2 247 2907 446 113949 7326 p 2 349 2680 571 117255 7676 p 2 346 2840 414 102919 7762 p 2 235 2973 392 98813 7663 p 2 275 2927 398 90823 7651 p 2 335 2822 443 98477 7833 p 2 275 2883 442 104124 7726 p 2 324 2923 353 112368 8275 p 2 215 3115 270 116972 8253 p 2 139 3138 323 110847 7982 p 2 168 3165 267 107675 7842 p 2 154 3181 265 111228 7710 p 2 127 3312 161 98999 7476 p 2 138 3056 406 87305 6840 p 2 124 3055 421 80695 6845 p 2 136 2880 584 85586 6583 p 2 152 2873 575 84816 6490 p 2 152 2774 674 78601 6343 p 2 124 2877 599 86730 6301 p 2 136 2739 725 88488 6266 p 2 166 2828 606 89041 6518 p 2 211 2643 746 92547 6600 p 2 166 2858 576 93117 6754 p 2 171 2743 686 94797 6733 p 2 143 2838 619 88867 6726 p 2 144 2611 845 85052 6277 p 2 149 2832 619 77117 6495 p 2 216 2798 586 74658 6792 p 2 281 2930 389 73786 7212 p 2 266 2846 488 74003 7374 p 2 272 2940 388 71766 7450 p 2 236 3056 308 76812 7766 p 2 263 3113 224 77626 7811 p 2 180 3106 314 75096 7356 p 2 156 3138 306 72613 7026 p 2 135 2999 466 69565 6604 p 2 117 3108 375 69239 6517 p 2 143 2668 789 67638 5942 p 2 145 2913 542 67224 6109 i 2 3600 0 0 288214 20762 i 2 3600 0 0 175822 18045 p 2 1257 2343 0 216890 13909 p 2 237 3363 0 218612 11073 p 2 132 3468 0 216807 11149 p 2 92 3508 0 193691 10773 p 2 99 3501 0 189770 10606 p 2 69 3530 1 178847 10208 p 2 76 3524 0 165776 9896 p 2 64 3536 0 167203 9894 p 2 50 3546 4 149805 9246 p 2 79 3517 4 147896 9234 p 2 44 3553 3 149275 9029 p 2 128 3467 5 150063 9490 p 2 95 3500 5 150729 9331 p 2 73 3518 9 139650 8984 p 2 77 3521 2 133928 8684 p 2 120 3466 14 146015 9042 p 2 95 3496 9 139549 8933 p 2 102 3477 21 141866 8701 p 2 72 3507 21 125476 8562 p 2 96 3488 16 137280 8438 p 2 82 3494 24 113341 7961 p 2 93 3489 18 126294 8262 p 2 91 3477 32 131107 8285 p 2 92 3449 59 116422 8028 p 2 44 3506 50 113475 7592 p 2 90 3436 74 121043 7690 p 2 112 3434 54 117075 7913 p 2 103 3446 51 120316 7912 p 2 105 3414 81 108264 7552 p 2 83 3413 104 107697 7286 p 2 112 3461 27 119250 7721 p 2 160 3397 43 121669 7972 p 2 168 3340 92 109071 7368 p 2 330 3221 49 124782 8331 p 2 244 3295 61 137610 8569 p 2 329 3207 64 127003 8580 p 2 341 3196 63 127162 8643 p 2 354 3108 138 124592 8396 p 2 365 3166 69 142729 8924 p 2 130 3292 178 120750 7591 p 2 98 3221 281 117704 7219 p 2 91 3258 251 112074 6919 p 2 82 3345 173 110904 6971 p 2 118 3325 157 114360 7242 p 2 104 3229 267 103238 7020 p 2 146 3221 233 108426 7226 p 2 126 3292 182 110728 7234 p 2 139 3175 286 101891 6840 p 2 100 3254 246 102666 6697 p 2 131 3139 330 105571 6920 p 2 121 3379 100 112113 7581 p 2 133 3365 102 122079 7890 p 2 87 3426 87 127660 8007 p 2 69 3425 106 118838 7891 p 2 100 3448 52 123564 8214 p 2 115 3420 65 126409 8272 p 2 47 3470 83 115662 7859 p 2 54 3435 111 103579 7554 p 2 85 3366 149 99712 7329 p 2 89 3313 198 103961 7359 p 2 67 3245 288 96176 7065 p 2 99 3225 276 99975 7070 p 2 94 3263 243 102570 7228 p 2 87 3233 280 95483 7177 p 2 72 3258 270 96463 7138 p 2 78 3277 245 102883 7115 p 2 126 3269 205 104133 7547 p 2 99 3343 158 103954 7477 p 2 69 3382 149 107747 7382 p 2 96 3379 125 115629 7665 p 2 95 3383 122 106507 7565 p 2 65 3398 137 112297 7402 p 2 47 3404 149 108922 7322 p 2 70 3376 154 126980 7875 p 2 84 3444 72 138532 7983 p 2 133 3434 33 151007 8358 p 2 134 3446 20 153772 8513 p 2 102 3467 31 152554 8288 p 2 102 3480 18 149388 8202 p 2 250 3330 20 152466 8820 p 2 282 3276 42 160491 8979 p 2 215 3361 24 161456 8530 p 2 119 3449 32 149060 8121 p 2 149 3414 37 147701 8154 p 2 209 3332 59 147586 8263 p 2 197 3292 111 130292 7629 p 2 138 3397 65 127384 7566 p 2 131 3354 115 128112 7232 p 2 136 3308 156 130946 7219 p 2 129 3375 96 130734 7290 p 2 149 3303 148 129772 7296 p 2 181 3339 80 145532 7690 p 2 159 3265 176 150944 7442 p 2 153 3368 79 141171 7315 p 2 152 3310 138 143237 7237 p 2 196 3258 146 144275 7393 p 2 191 3319 90 145403 7379 p 2 205 3224 171 150971 7326 p 2 179 3371 50 153315 7679 p 2 173 3317 110 146555 7465 p 2 129 3376 95 139092 7159 p 2 181 3223 196 140230 7287 p 2 217 3196 187 133933 7186 p 2 198 3228 174 140649 7323 p 2 158 3255 187 138941 7016 p 2 270 3140 190 148733 7846 p 2 469 3031 100 163365 8692 p 2 569 2987 44 170401 9888 p 2 139 3421 40 163043 8736 p 2 171 3403 26 171122 9138 p 2 84 3504 12 174268 8945 p 2 204 3393 3 175571 9560 p 2 224 3371 5 174121 9729 p 2 151 3434 15 176530 9554 p 2 162 3433 5 159662 9639 p 2 73 3517 10 150091 9247 p 2 111 3458 31 140592 9194 p 2 95 3388 117 114021 8641 p 2 121 3355 124 104977 8484 p 2 122 3219 259 97806 7986 p 2 103 3161 336 81448 7349 p 2 62 2768 770 72430 6453 p 2 82 2849 669 63470 6246 p 2 100 2439 1061 53494 5568 p 2 176 2655 769 48578 5672 p 2 152 2449 999 50835 5545 p 2 154 2495 951 53198 5566 p 2 182 2377 1041 57621 5502 p 2 204 2334 1062 56507 5663 i 2 3600 0 0 43996 11425 p 2 648 1588 1364 54290 5951 p 2 488 1839 1273 57765 5935 p 2 167 2055 1378 50775 4986 p 2 126 2153 1321 51645 5076 p 2 17 2222 1361 40541 4364 p 2 49 2166 1385 49940 4581 p 2 57 2208 1335 44549 4700 p 2 102 2108 1390 48603 4851 p 2 227 2150 1223 58833 5559 p 2 194 2159 1247 52540 5290 p 2 190 2257 1153 56989 5378 p 2 214 2309 1077 58684 5755 p 2 76 2411 1113 49870 5216 p 2 34 2272 1294 50821 4724 p 2 51 2276 1273 53673 4598 p 2 73 2021 1506 53853 4566 p 2 105 2185 1310 65016 5011 p 2 122 2180 1298 72021 5233 p 2 178 2260 1162 74486 5584 p 2 264 2235 1101 80245 6119 p 2 163 2422 1015 90111 6195 p 2 315 2400 885 106637 7313 p 2 130 2676 794 97978 6731 p 2 209 2806 585 97366 7176 p 2 345 2923 332 111972 8467 p 2 121 3166 313 106920 7748 p 2 112 3032 456 103787 7328 p 2 206 2886 508 117315 7841 i 2 3600 0 0 104029 13185 i 2 3600 0 0 70763 11938 p 2 564 1873 1163 56396 6180 p 2 215 2220 1165 50459 5492 p 2 172 2050 1378 52742 5212 p 2 97 2122 1381 50471 4888 p 2 85 2104 1411 46842 4619 p 2 115 2104 1381 45627 4616 p 2 117 2299 1184 52737 4870 p 2 129 2316 1155 56567 5027 p 2 166 2455 979 65047 5691 p 2 109 2401 1090 56035 5196 p 2 40 2461 1099 52399 4871 p 2 57 2353 1190 54509 4697 p 2 73 2395 1132 59248 4791 p 2 179 2465 956 62032 5484 p 2 270 2634 696 62842 5926 p 2 548 2337 715 82579 7046 p 2 197 2688 715 87798 6193 p 2 186 2704 710 93237 6395 p 2 122 2828 650 90710 6187 p 2 153 2823 624 100238 6593 p 2 416 2814 370 123018 8490 p 2 508 2698 394 128654 9073 p 2 237 2938 425 116760 7966 p 2 113 2844 643 106116 7072 p 2 665 2333 602 101458 8571 p 2 296 2610 694 76482 6970 p 2 203 2772 625 62308 6664 p 2 220 2730 650 58338 6399 p 2 235 2631 734 62504 6261 p 2 252 2615 733 63621 6205 p 2 124 2642 834 65239 5574 p 2 148 2263 1189 64069 5128 p 2 253 2438 909 69489 6060 p 2 406 2404 790 66076 6450 p 2 171 2537 892 63091 6102 p 2 49 2528 1023 57537 5110 p 2 171 2272 1157 60089 5114 p 2 141 2375 1084 67011 5101 p 2 146 2318 1136 68587 5037 p 2 112 2428 1060 65376 5172 p 2 162 2322 1116 67012 5151 p 2 174 2228 1198 67466 5164 p 2 136 2262 1202 60330 4832 p 2 117 2248 1235 61462 4730 p 2 304 2012 1284 72899 5559 p 2 168 1894 1538 69927 4898 p 2 160 2110 1330 74481 5080 p 2 208 2131 1261 79213 5517 i 2 3600 0 0 96210 12836 p 2 1081 1598 921 105635 8617 p 2 833 1928 839 116917 8751 p 2 723 2016 861 109465 8203 p 2 275 2233 1092 110983 6615 p 2 629 2025 946 123896 7924 p 2 631 2264 705 126816 8485 i 2 3600 0 0 83822 12835 i 2 3600 0 0 67400 11980 p 2 1203 1769 628 89369 9426 i 2 3600 0 0 108456 14393 p 2 993 2263 344 116016 10482 p 2 396 2626 578 89366 8069 p 2 167 2553 880 74394 6648 p 2 224 2359 1017 71929 6241 p 2 184 2380 1036 73761 5941 p 2 244 2192 1164 67162 5965 p 2 110 2317 1173 58794 5465 p 2 182 2271 1147 58205 5629 p 2 105 2320 1175 61397 5498 p 2 58 2422 1120 55511 5328 p 2 115 2393 1092 58319 5331 p 2 131 2548 921 62498 5586 p 2 256 2596 748 70777 6123 p 2 215 2807 578 79338 6543 p 2 198 2869 533 79790 6517 p 2 200 2710 690 83982 6566 p 2 156 2705 739 76362 6123 p 2 338 2486 776 82894 6735 p 2 622 2414 564 84855 8393 p 2 421 2497 682 70659 7107 p 2 50 2794 756 67714 5692 p 2 73 2317 1210 69140 5135 p 2 139 2360 1101 78716 5453 p 2 198 2584 818 96683 6526 p 2 226 2823 551 102894 6828 p 2 236 2711 653 105391 7048 p 2 143 2833 624 107132 7022 p 2 206 2714 680 100865 7266 p 2 125 2892 583 94813 7071 p 2 116 2788 696 93391 6788 p 2 116 2826 658 97832 6912 i 2 3600 0 0 88099 12361 p 2 302 2497 801 69809 6352 p 2 258 2563 779 62983 6149 p 2 385 2327 888 70094 6572 p 2 269 2430 901 73360 6406 p 2 124 2514 962 64620 5700 p 2 143 2483 974 62194 5507 p 2 138 2524 938 63934 5573 p 2 187 2518 895 63769 5791 p 2 159 2861 580 60528 5896 p 2 167 2618 815 66685 5571 p 2 297 2755 548 77538 6524 p 2 151 2883 566 76158 6256 p 2 43 2801 756 70063 5430 p 2 55 2393 1152 71375 4969 p 2 58 2182 1360 71549 4719 p 2 75 2481 1044 75805 5112 p 2 169 2453 978 88814 5728 p 2 185 2288 1127 81195 5606 p 2 107 2537 956 85017 5549 p 2 305 2474 821 104291 6809 p 2 270 2528 802 113557 7049 p 2 263 2420 917 121331 7156 p 2 541 2411 648 133686 8525 p 2 892 2152 556 154510 10155 p 2 614 2421 565 139005 9267 p 2 361 2566 673 126273 8176 p 2 314 2613 673 107990 7599 p 2 322 2535 743 86442 6874 p 2 132 2667 801 76060 5996 p 2 312 2495 793 81150 6428 p 2 165 2596 839 74970 5879 p 2 193 2683 724 70535 5953 p 2 86 2960 554 77638 5955 p 2 76 2684 840 74379 5410 p 2 217 2814 569 89303 6479 p 2 147 2794 659 79717 5925 p 2 392 2507 701 81510 6463 p 2 399 2621 580 87975 6832 p 2 397 2392 811 81615 6657 p 2 192 2616 792 88926 6375 i 2 3600 0 0 121853 13596 p 2 528 2139 933 87744 6826 i 2 3600 0 0 117834 13840 p 2 686 2434 480 82771 8205 p 2 220 2954 426 76581 7037 p 2 626 2439 535 91882 8457 p 2 560 2660 380 87979 8147 p 2 147 3075 378 104627 7596 i 2 3600 0 0 108754 13078 i 2 3600 0 0 117145 13467 i 2 3600 0 0 101593 12966 i 2 3600 0 0 99986 12739 p 2 754 2106 740 57055 6959 p 2 1022 1984 594 74188 8128 p 2 385 2509 706 72577 6506 p 2 460 2751 389 151098 8559 p 2 361 2776 463 173973 8735 p 2 369 2869 362 179574 9110 p 2 276 2975 349 154806 8760 p 2 287 2891 422 141078 8457 p 2 173 3051 376 120211 7854 p 2 183 2949 468 108795 7572 p 2 156 3045 399 96558 7340 p 2 148 3088 364 95894 7140 p 2 199 3017 384 96978 7308 p 2 105 3066 429 96876 6934 p 2 139 3111 350 89194 7133 p 2 91 2998 511 82550 6736 p 2 106 3026 468 82114 6703 p 2 82 2836 682 83106 6469 p 2 115 2951 534 76991 6664 p 2 194 2842 564 83869 7023 p 2 214 2868 518 96203 7643 p 2 182 2848 570 96754 7539 p 2 322 2815 463 90709 7915 i 2 3600 0 0 89312 13122 p 2 828 2362 410 113044 9709 p 2 307 2923 370 111992 8565 p 2 127 3105 368 105440 7818 p 2 516 2804 280 133730 9885 p 2 356 3060 184 141933 9821 p 2 170 3215 215 135141 9285 p 2 62 3272 266 110354 8253 p 2 25 3125 450 95485 7338 p 2 126 2944 530 103531 7501 p 2 205 2812 583 98274 7516 p 2 64 2921 615 89991 6938 p 2 115 2739 746 91274 6942 p 2 57 2796 747 89369 6490 p 2 228 2640 732 89256 7041 p 2 300 2652 648 89204 7196 i 2 3600 0 0 92374 12909 p 2 333 2499 768 93843 7089 p 2 117 2744 739 88626 6687 p 2 249 2726 625 96771 7500 p 2 546 2564 490 118454 8777 p 2 522 2666 412 118425 9119 i 2 3600 0 0 306554 19945 p 2 36 2943 621 21338 3736 p 2 0 3023 577 19671 3785 p 2 0 1566 2034 6134 2020 p 2 0 1920 1680 7753 2363 p 2 0 2809 791 17868 3428 p 2 0 1592 2008 6318 2004 p 2 0 2125 1475 9932 2527 i 2 3600 0 0 153489 17177 p 2 0 3252 348 22729 4440 p 2 0 2804 796 11757 3484 p 2 0 2231 1369 8417 2804 p 2 0 3306 294 20740 4406 p 2 0 3372 228 22454 4977 i 2 3600 0 0 195018 15427 p 2 0 3447 153 22621 4505 p 2 0 2853 747 10217 3509 p 2 0 3373 227 21479 4664 p 2 0 2901 699 13071 3696 p 2 0 2129 1471 6496 2646 i 2 3600 0 0 148641 13203 p 2 0 2612 988 13042 3106 p 2 0 3054 546 13083 3863 p 2 0 3083 517 20207 4019 p 2 0 3073 527 13313 3834 p 2 0 1717 1883 4887 2158 p 2 0 1792 1808 5017 2214 p 2 0 1922 1678 5568 2385 p 2 0 1242 2358 3314 1658 p 2 0 1743 1857 4671 2171 p 2 0 3564 36 29973 5652 i 2 3600 0 0 114309 13051 p 2 0 3483 117 23196 4364 p 2 0 3310 290 17325 3898 p 2 0 2801 799 12607 3398 p 2 0 2799 801 13021 3343 p 2 0 2615 985 11112 3079 p 2 0 2446 1154 9202 2863 p 2 0 3346 254 41729 4696 i 2 3600 0 0 61947 11862 p 2 0 2429 1171 7289 2862 p 2 0 2905 695 13667 3533 p 2 0 2229 1371 9337 2803 p 2 0 2294 1306 12231 2986 p 2 0 2243 1357 9313 2837 p 2 0 1826 1774 6477 2224 p 2 0 2841 759 12305 3616 i 2 3600 0 0 75262 12509 p 2 0 2586 1014 14109 3350 p 2 0 2753 847 11461 2965 p 2 0 1956 1644 7737 2481 p 2 0 2227 1373 8866 2572 p 2 0 1913 1687 6763 2325 p 2 0 1796 1804 5541 2091 p 2 0 2961 639 14955 3830 i 2 3600 0 0 95412 13305 p 2 0 2667 933 13735 3300 p 2 0 2336 1264 9016 2859 p 2 0 2081 1519 7501 2555 p 2 0 2507 1093 8675 2908 p 2 0 2311 1289 8327 2713 p 2 0 2028 1572 7661 2458 p 2 0 3060 540 18822 4011 i 2 3600 0 0 83418 14638 p 2 7 2901 692 18275 4184 p 2 227 2305 1068 36254 4578 p 2 17 1857 1726 14016 2721 p 2 361 2114 1125 57224 5310 p 2 8 1826 1766 12387 2540 p 2 391 1964 1245 57016 5337 p 2 7 2080 1513 13334 2959 p 2 387 1726 1487 56093 5171 p 2 0 1594 2006 8039 2300 p 2 702 1623 1275 110821 7545 p 2 17 2227 1356 22922 3406 p 2 439 2029 1132 108138 7018 p 2 2 2207 1391 20175 3415 p 2 143 2192 1265 96449 5644 p 2 14 2099 1487 21496 3265 p 2 168 2406 1026 103733 6067 p 2 17 2118 1465 22018 3289 p 2 54 2644 902 93399 5639 p 2 0 2395 1205 22644 3472 p 2 96 2460 1044 90308 5583 p 2 10 2240 1350 16446 3328 p 2 218 2213 1169 107748 6348 p 2 0 2352 1248 19932 3628 p 2 614 1940 1046 109709 7693 p 2 327 2212 1061 111673 7076 p 2 0 2116 1484 20142 3400 p 2 0 1995 1605 11289 2878 p 2 318 2219 1063 107492 6716 p 2 0 2148 1452 18481 3248 p 2 100 2572 928 93031 5764 p 2 260 2425 915 45644 5273 p 2 399 2431 770 118689 7366 p 2 570 2369 661 72539 7174 p 2 339 2601 660 133534 7733 p 2 16 2836 748 62745 5220 p 2 492 2567 541 151155 9062 p 2 0 2631 969 20429 4044 p 2 174 2627 799 107534 6611 p 2 0 2465 1135 18888 3690 p 2 177 2649 774 104486 6424 p 2 0 2301 1299 18228 3374 p 2 180 2590 830 107436 6547 p 2 1 2177 1422 12944 3134 p 2 146 2264 1190 108345 5875 p 2 296 2430 874 143025 7744 p 2 0 2424 1176 20339 3754 p 2 103 2603 894 133013 6720 p 2 0 2416 1184 23950 3653 p 2 46 2638 916 115439 6002 p 2 0 2529 1071 25168 3812 p 2 45 2687 868 119207 6146 p 2 0 2695 905 24846 3901 p 2 173 2471 956 90080 6017 p 2 0 2622 978 16340 3753 p 2 0 2229 1371 12219 2976 p 2 218 2480 902 92707 6207 p 2 239 2425 936 97670 6587 p 2 1 2010 1589 15280 3118 p 2 146 2750 704 114682 6775 p 2 0 2279 1321 17598 3409 p 2 115 2667 818 114176 6474 p 2 0 2576 1024 23569 3957 p 2 340 2524 736 137505 7876 p 2 0 2764 836 20367 4227 p 2 211 2616 773 125521 7353 p 2 3 2573 1024 17060 3896 p 2 217 2627 756 125043 7299 p 2 2 2646 952 21957 4083 p 2 7 2659 934 78040 4900 p 2 0 2323 1277 15002 3151 p 2 8 2456 1136 47701 4007 p 2 29 2550 1021 58335 4490 p 2 0 2130 1470 10822 2832 p 2 35 2324 1241 52610 4182 p 2 0 2252 1348 12063 3057 p 2 0 2447 1153 12267 3261 p 2 10 2430 1160 42915 3930 p 2 19 2588 993 51983 4281 p 2 16 2624 960 89756 5112 p 2 19 2591 990 89333 5163 p 2 46 2634 920 104188 5765 p 2 468 2256 876 133793 8275 i 2 3600 0 0 89480 14714 p 2 29 2683 888 22172 4246 p 2 0 2051 1549 7692 2736 p 2 0 2254 1346 36865 3498 p 2 0 2392 1208 14089 3216 i 2 3600 0 0 99360 14180 p 2 0 2952 648 13464 3757 p 2 0 2151 1449 7380 2652 p 2 0 2051 1549 11068 2577 p 2 0 2850 750 50119 4385 p 2 0 2393 1207 12302 3109 p 2 0 1887 1713 7109 2385 p 2 0 3142 458 17325 4284 i 2 3600 0 0 73288 12117 p 2 0 2786 814 10863 3234 p 2 0 3070 530 13540 3522 p 2 0 2216 1384 7426 2589 p 2 0 2481 1119 7815 2868 p 2 0 2379 1221 8342 2770 p 2 0 2547 1053 8474 2888 p 2 0 2891 709 14900 3696 i 2 3600 0 0 103452 13262 p 2 0 3051 549 20153 3848 p 2 0 2816 784 14571 3286 p 2 0 2583 1017 14125 3092 p 2 0 2676 924 13749 3153 p 2 0 2149 1451 9932 2558 p 2 0 1952 1648 7597 2351 p 2 4 3305 291 29260 4418 i 2 3600 0 0 92809 12859 p 2 0 2424 1176 10072 3005 p 2 0 2475 1125 10194 3042 p 2 0 2239 1361 8656 2772 p 2 0 2491 1109 8612 2913 p 2 0 2052 1548 6908 2425 p 2 0 1763 1837 6955 2068 p 2 2 3122 476 22705 4173 i 2 3600 0 0 100197 13156 p 2 2 3114 484 23763 4059 p 2 2 3040 558 20745 3701 p 2 1 2502 1097 15718 3065 p 2 1 2452 1147 14643 3088 p 2 0 2336 1264 14031 2768 p 2 0 2646 954 20484 3394 p 2 8 3470 122 35322 5092 i 2 3600 0 0 100513 14375 p 2 118 3042 440 75046 6291 p 2 50 2762 788 68977 5606 p 2 149 2727 724 82296 6437 p 2 212 2686 702 83314 6715 p 2 42 2612 946 76016 5667 p 2 56 2923 621 79392 6062 p 2 66 2853 681 77488 6084 p 2 47 2903 650 68980 5706 p 2 21 2706 873 60546 4959 p 2 6 3169 425 63213 5423 p 2 0 3015 585 25948 4192 p 2 65 2776 759 65509 5333 p 2 17 2978 605 57485 5126 p 2 0 2375 1225 15204 3315 p 2 9 2800 791 49941 4621 p 2 0 1920 1680 12787 2717 p 2 1 2396 1203 42471 3913 i 2 3600 0 0 196622 17816 i 2 3600 0 0 181737 16788 p 2 2206 1394 0 145028 13611 i 2 3600 0 0 164632 16660 i 2 3600 0 0 158327 16765 p 2 790 2730 80 101345 9566 p 2 686 2860 54 103389 9513 p 2 185 3153 262 79429 7105 p 2 117 2924 559 79893 6427 p 2 112 3156 332 78021 6623 p 2 163 3053 384 73113 6648 p 2 254 2872 474 76825 6813 i 2 3600 0 0 248015 18282 i 2 3600 0 0 220210 16860 p 2 1442 2158 0 170683 11726 i 2 3600 0 0 202579 17553 i 2 3600 0 0 167779 16718 p 2 966 2456 178 122444 10458 p 2 467 2925 208 121394 8719 p 2 214 3220 166 99911 7344 p 2 192 3079 329 98066 6990 p 2 182 3321 97 111463 7400 p 2 248 3191 161 97360 7224 p 2 259 3127 214 97945 7053 i 2 3600 0 0 159088 15697 p 2 116 3413 71 107616 7731 p 2 179 3401 20 134184 8972 p 2 273 3266 61 127705 9282 p 2 176 3347 77 121852 8852 p 2 147 3386 67 121390 8776 p 2 55 3423 122 117090 8110 p 2 154 3384 62 124433 8753 p 2 88 3399 113 118352 8270 p 2 102 3400 98 128686 8529 p 2 71 3425 104 124450 8357 p 2 50 3425 125 83923 7348 p 2 40 3396 164 80678 7249 p 2 57 3441 102 107840 7670 p 2 24 3501 75 78317 7125 p 2 62 3451 87 106832 7726 p 2 51 3470 79 79115 7232 p 2 41 3485 74 98472 7463 p 2 45 3465 90 79578 7145 p 2 30 3530 40 75199 7163 p 2 24 3486 90 90687 7403 p 2 14 3534 52 39088 6020 p 2 18 3505 77 92136 7456 p 2 21 3526 53 78738 7363 p 2 20 3489 91 63018 6311 p 2 18 3526 56 77805 7452 p 2 25 3562 13 78521 7445 p 2 11 3521 68 64532 6512 p 2 44 3512 44 81841 7607 p 2 22 3540 38 97871 7882 p 2 8 3465 127 35830 5873 p 2 48 3531 21 106412 8238 p 2 23 3487 90 75749 7314 p 2 12 3557 31 40026 6344 p 2 51 3507 42 99005 7853 p 2 48 3510 42 80077 7770 p 2 16 3546 38 61420 6663 p 2 63 3532 5 83996 7959 p 2 64 3515 21 95671 8139 p 2 6 3580 14 48088 6892 p 2 44 3534 22 71805 7475 p 2 36 3560 4 90782 7967 p 2 20 3532 48 37749 5947 p 2 83 3500 17 98207 8358 p 2 49 3537 14 76268 7491 p 2 14 3564 22 40706 6392 p 2 79 3509 12 94405 8110 p 2 12 3569 19 68969 7303 p 2 35 3530 35 88502 7807 p 2 15 3575 10 67232 7350 p 2 72 3516 12 70213 7029 p 2 32 3558 10 73924 7819 p 2 27 3539 34 41665 6188 p 2 27 3562 11 84105 7881 p 2 27 3537 36 72856 7522 p 2 34 3540 26 62843 6835 p 2 56 3506 38 73468 7471 p 2 2 3569 29 55895 6541 p 2 43 3515 42 76878 7528 p 2 38 3529 33 76400 7799 p 2 11 3527 62 54059 6413 p 2 28 3538 34 73813 7633 p 2 22 3473 105 56812 6392 p 2 31 3488 81 67916 7295 p 2 53 3461 86 78838 7538 p 2 8 3472 120 43024 5905 p 2 61 3450 89 65488 6958 p 2 49 3498 53 74390 7369 p 2 4 3362 234 31194 5470 p 2 37 3505 58 75020 7438 p 2 7 3557 36 37866 5904 p 2 24 3455 121 55104 6513 p 2 10 3513 77 59934 6692 p 2 0 3440 160 25958 5297 p 2 63 3480 57 58572 6861 p 2 2 3361 237 25979 5146 p 2 60 3463 77 57758 6884 p 2 37 3482 81 48158 6639 p 2 3 3388 209 22808 5069 p 2 36 3477 87 48858 6560 p 2 14 3404 182 43867 6276 p 2 5 3488 107 45073 6545 p 2 3 3448 149 25151 5380 p 2 2 3488 110 30392 5577 p 2 32 3450 118 42688 6388 p 2 1 3440 159 24704 5512 p 2 35 3451 114 43050 6453 p 2 0 3322 278 22767 5213 p 2 33 3444 123 42453 6437 p 2 0 3487 113 24931 5654 p 2 49 3412 139 38502 6509 p 2 0 3429 171 23858 5479 p 2 19 3332 249 34323 6095 p 2 4 3424 172 24961 5518 p 2 14 3359 227 33690 6211 p 2 0 3336 264 22981 5298 p 2 8 3354 238 30890 5877 p 2 1 3444 155 22276 5596 p 2 9 3435 156 30003 6057 p 2 0 3294 306 19098 5040 p 2 9 3378 213 27227 5697 p 2 0 3252 348 17732 4819 p 2 1 3085 514 17311 4217 p 2 2 3313 285 21466 5060 p 2 23 3173 404 16801 4788 p 2 0 3321 279 19977 5152 p 2 0 3021 579 15450 4289 p 2 0 2548 1052 11387 3285 p 2 0 2380 1220 9807 2962 p 2 0 2361 1239 10077 2798 p 2 0 2220 1380 9638 2710 p 2 0 1987 1613 7795 2402 p 2 0 2034 1566 9244 2411 p 2 0 1670 1930 7341 2052 p 2 0 1448 2152 7031 1804 p 2 0 1312 2288 6250 1678 p 2 0 1087 2513 4710 1480 p 2 0 937 2663 4553 1332 p 2 0 656 2944 3277 1089 p 2 0 628 2972 2812 1055 p 2 0 544 3056 2031 965 p 2 0 509 3091 2025 923 p 2 0 602 2998 2303 1031 i 2 3600 0 0 141006 15693 p 2 2 3598 0 49497 6560 p 2 0 3600 0 41759 5783 p 2 0 3600 0 41943 5749 p 2 1 3599 0 44823 5997 p 2 0 3600 0 38190 5541 p 2 0 3600 0 39379 5463 p 2 0 3600 0 41404 5632 p 2 0 3600 0 44472 5939 p 2 1 3599 0 42391 5662 p 2 1 3599 0 38165 5538 p 2 1 3599 0 42104 5765 p 2 0 3599 1 38799 5516 p 2 0 3600 0 40266 5469 p 2 1 3598 1 39925 5642 p 2 0 3600 0 47334 5915 p 2 0 3600 0 46143 5898 p 2 1 3599 0 39647 5771 p 2 0 3600 0 40588 5530 p 2 0 3600 0 44015 5747 p 2 0 3600 0 44559 5981 p 2 0 3600 0 41674 5787 p 2 0 3600 0 37470 5454 p 2 0 3600 0 43844 5650 p 2 0 3600 0 40538 5603 p 2 0 3600 0 39145 5447 p 2 1 3599 0 38454 5448 p 2 0 3600 0 43889 5816 p 2 0 3600 0 42652 6000 p 2 0 3600 0 37303 5534 p 2 0 3600 0 37499 5607 p 2 0 3600 0 40118 5666 p 2 0 3600 0 42291 5993 p 2 0 3600 0 39134 5689 p 2 0 3600 0 34951 5445 p 2 0 3598 2 38764 5585 p 2 0 3600 0 36190 5485 p 2 0 3599 1 36867 5424 p 2 0 3600 0 37434 5277 p 2 0 3599 1 42144 5701 p 2 0 3600 0 40713 5796 p 2 0 3600 0 35804 5633 p 2 0 3600 0 36419 5515 p 2 0 3600 0 39255 5734 p 2 0 3600 0 41884 6009 p 2 0 3599 1 38357 5680 p 2 0 3600 0 34141 5402 p 2 0 3600 0 38163 5485 p 2 0 3600 0 38087 5592 p 2 0 3600 0 37686 5500 p 2 0 3599 1 35362 5459 p 2 0 3600 0 40443 5846 p 2 1 3599 0 40839 5940 p 2 0 3600 0 36398 5671 p 2 0 3600 0 36164 5593 p 2 0 3599 1 38306 5735 p 2 0 3600 0 40035 5926 p 2 1 3599 0 37147 5660 p 2 0 3599 1 33954 5405 p 2 0 3599 1 36671 5518 p 2 0 3600 0 36562 5651 p 2 0 3599 1 37708 5478 p 2 0 3599 1 35864 5492 p 2 0 3600 0 40169 5884 p 2 0 3600 0 38910 5905 p 2 0 3600 0 34897 5652 p 2 0 3600 0 34372 5507 p 2 0 3600 0 35330 5719 p 2 0 3599 1 38161 5814 p 2 0 3599 1 36353 5521 p 2 0 3599 1 32747 5261 p 2 0 3600 0 35518 5422 p 2 1 3599 0 35090 5446 p 2 0 3599 1 34768 5321 p 2 0 3600 0 36020 5339 p 2 0 3600 0 40675 5707 p 2 0 3600 0 39038 5655 p 2 0 3600 0 35568 5445 p 2 0 3600 0 35200 5313 p 2 0 3600 0 37544 5537 p 2 1 3599 0 39676 5657 p 2 0 3600 0 37580 5452 p 2 0 3600 0 35412 5250 p 2 0 3600 0 37121 5382 p 2 0 3600 0 36494 5557 p 2 0 3597 3 35610 5280 p 2 0 3596 4 35647 5447 p 2 1 3599 0 44987 5665 p 2 1 3599 0 41746 5623 p 2 0 3600 0 38730 5427 p 2 0 3599 1 38879 5324 p 2 0 3600 0 40540 5588 p 2 0 3600 0 41909 5812 p 2 1 3599 0 40376 5629 p 2 0 3599 1 37009 5409 p 2 0 3599 1 42033 5483 p 2 0 3600 0 39877 5479 p 2 0 3599 1 39025 5305 p 2 0 3598 2 38938 5284 p 2 0 3600 0 43555 5634 p 2 0 3600 0 43643 5641 p 2 0 3600 0 39648 5553 p 2 0 3598 2 41444 5483 p 2 0 3600 0 42503 5516 p 2 0 3599 1 43408 5705 p 2 0 3600 0 41565 5467 p 2 2 3598 0 37793 5236 p 2 0 3600 0 40805 5458 p 2 0 3600 0 39738 5370 p 2 0 3600 0 39896 5280 p 2 0 3600 0 40227 5305 p 2 0 3600 0 45459 5693 p 2 1 3599 0 45669 5689 p 2 0 3600 0 40388 5423 p 2 0 3599 1 40176 5286 p 2 1 3598 1 42352 5516 p 2 0 3599 1 45300 5670 p 2 0 3599 1 42718 5493 p 2 0 3599 1 38723 5191 p 2 3 3596 1 42620 5435 p 2 0 3599 1 41750 5409 p 2 0 3600 0 42360 5315 p 2 1 3599 0 42265 5361 p 2 1 3599 0 49415 5695 p 2 1 3599 0 48518 5668 p 2 0 3599 1 45319 5408 p 2 1 3597 2 43631 5408 p 2 1 3599 0 45322 5572 p 2 0 3600 0 47595 5731 p 2 0 3600 0 44778 5528 p 2 0 3598 2 40976 5469 p 2 0 3599 1 45254 5685 p 2 0 3600 0 43030 5670 p 2 0 3599 1 42024 5497 p 2 0 3598 2 41070 5549 p 2 1 3598 1 47440 5752 p 2 0 3599 1 47307 5775 p 2 0 3599 1 40025 5495 p 2 0 3598 2 41674 5408 p 2 0 3599 1 43553 5508 p 2 0 3596 4 46013 5696 p 2 0 3597 3 42897 5468 p 2 0 3599 1 40371 5324 p 2 0 3599 1 44865 5563 p 2 2 3597 1 42160 5536 p 2 0 3600 0 40713 5354 p 2 0 3599 1 41458 5408 p 2 0 3595 5 53125 6046 i 2 3600 0 0 82309 13306 p 2 0 3353 247 12701 4220 p 2 0 3250 350 10293 3945 p 2 0 3080 520 9867 3691 p 2 0 2832 768 9204 3403 p 2 0 2092 1508 4867 2458 p 2 0 1843 1757 4293 2213 p 2 0 2446 1154 6097 2816 p 2 0 1419 2181 3347 1792 p 2 0 2945 655 9030 3484 p 2 0 2222 1378 6165 2653 p 2 0 2659 941 7426 3115 p 2 0 1739 1861 3968 2118 p 2 0 1832 1768 3939 2188 p 2 0 491 3109 1290 939 p 2 0 1565 2035 3226 1905 p 2 0 1767 1833 4196 2176 p 2 0 1246 2354 2481 1597 p 2 0 927 2673 2093 1344 p 2 0 558 3042 1291 989 p 2 0 790 2810 1748 1196 p 2 0 2464 1136 6983 2919 p 2 0 2448 1152 6844 2958 p 2 0 1829 1771 4219 2249 p 2 0 1836 1764 4016 2259 p 2 0 1411 2189 2600 1749 p 2 0 320 3280 1014 772 p 2 0 1024 2576 2091 1394 p 2 0 818 2782 1823 1244 p 2 0 1114 2486 2283 1515 p 2 0 816 2784 1697 1213 p 2 0 324 3276 863 761 p 2 0 1038 2562 2272 1463 p 2 0 1353 2247 3018 1761 p 2 0 1264 2336 2662 1695 p 2 0 1030 2570 2163 1441 p 2 0 1315 2285 2402 1692 p 2 0 880 2720 1640 1249 p 2 0 182 3418 693 630 p 2 0 573 3027 1277 986 p 2 0 589 3011 1345 1009 p 2 0 733 2867 1591 1149 p 2 0 696 2904 1541 1099 p 2 0 252 3348 783 690 p 2 0 1185 2415 2642 1596 i 2 3600 0 0 29452 11531 p 2 0 3528 72 16499 4859 p 2 0 3340 260 8264 4163 p 2 0 2896 704 6169 3501 p 2 0 2905 695 6843 3564 p 2 0 2720 880 5618 3214 p 2 0 2771 829 6012 3336 p 2 0 2796 804 6124 3332 p 2 0 2554 1046 5492 3085 p 2 0 2620 980 5638 3114 p 2 0 2413 1187 5001 2905 i 2 3600 0 0 59768 12842 p 2 0 3280 320 11854 4227 p 2 0 3068 532 9708 3906 p 2 0 3032 568 9532 3831 p 2 0 2649 951 7660 3251 p 2 0 2290 1310 6397 2815 p 2 0 2432 1168 6633 2956 p 2 0 2388 1212 6331 2910 p 2 0 2299 1301 6276 2818 p 2 0 2358 1242 6375 2852 p 2 0 2263 1337 6235 2777 p 2 0 2266 1334 6456 2793 i 2 3600 0 0 81320 12800 p 2 12 3588 0 41850 5675 p 2 0 3271 329 12362 4288 p 2 91 3509 0 49960 6765 p 2 168 3432 0 59151 8103 p 2 41 3559 0 46240 6248 p 2 20 3580 0 40091 6267 p 2 17 3583 0 41080 6187 p 2 7 3593 0 38656 5679 p 2 2 3598 0 33996 5379 p 2 0 3600 0 29852 4712 p 2 0 3598 2 30291 4984 p 2 0 3600 0 33123 4926 p 2 0 3600 0 33344 4981 p 2 0 3167 433 12019 4031 p 2 0 3097 503 11850 3931 p 2 0 3354 246 13878 4327 p 2 0 3209 391 11670 4052 p 2 0 2945 655 9077 3662 p 2 0 3088 512 10463 3872 p 2 0 2989 611 9725 3723 p 2 0 2989 611 9615 3712 p 2 0 2870 730 9125 3572 p 2 0 2900 700 9124 3615 p 2 0 2735 865 8328 3395 p 2 0 3001 599 10278 3744 p 2 0 2821 779 9134 3466 p 2 0 3119 481 11016 3840 p 2 0 2805 795 8525 3443 p 2 0 3006 594 9372 3697 p 2 0 2552 1048 7424 3148 p 2 0 2546 1054 7466 3123 p 2 0 2577 1023 7528 3174 p 2 0 1950 1650 5083 2410 p 2 0 2629 971 7674 3222 p 2 0 2609 991 7270 3173 p 2 0 2862 738 9081 3559 p 2 0 2611 989 7504 3235 p 2 0 3010 590 10503 3791 p 2 0 2748 852 8981 3421 p 2 0 2603 997 7435 3142 p 2 0 2721 879 7841 3329 p 2 0 2386 1214 6798 2948 p 2 0 2543 1057 7210 3116 p 2 0 2633 967 7887 3257 p 2 0 2590 1010 7214 3189 p 2 0 2566 1034 7184 3178 p 2 0 2741 859 7835 3364 p 2 0 2788 812 8459 3440 p 2 0 2813 787 7925 3409 p 2 0 2930 670 9550 3627 p 2 0 2691 909 8015 3311 p 2 0 2404 1196 6390 2907 p 2 0 2501 1099 6923 3045 p 2 0 2527 1073 6892 3087 p 2 0 2591 1009 6989 3150 p 2 0 2419 1181 6755 2985 p 2 0 2458 1142 6630 3020 p 2 0 2509 1091 6873 3081 p 2 0 2544 1056 7015 3108 p 2 0 2690 910 7815 3302 p 2 0 2499 1101 7166 3047 p 2 0 3076 524 11650 3906 p 2 0 2903 697 9813 3639 p 2 0 2604 996 7374 3147 p 2 0 2776 824 8633 3368 p 2 0 2531 1069 7248 3119 p 2 0 2435 1165 6920 2952 i 2 3600 0 0 142082 13526 p 2 0 3544 56 22988 4594 p 2 0 3086 514 11864 3695 p 2 0 3306 294 15259 4029 p 2 0 3365 235 17168 4185 p 2 0 3436 164 18841 4438 p 2 0 2999 601 15871 3651 p 2 0 3381 219 20364 4142 p 2 0 3260 340 18042 3990 p 2 0 3220 380 18440 3913 p 2 0 3009 591 15464 3613 p 2 0 2833 767 13797 3378 p 2 0 2908 692 14556 3456 p 2 0 3254 346 18337 3954 p 2 0 2799 801 14038 3390 p 2 0 3004 596 16312 3603 p 2 0 2733 867 12956 3220 p 2 0 3321 279 19326 4037 p 2 0 3164 436 17006 3901 p 2 0 3372 228 19833 4153 p 2 0 3032 568 16371 3612 p 2 0 3282 318 19596 4058 p 2 0 3267 333 18456 3988 p 2 0 2917 683 14242 3481 p 2 0 2718 882 13529 3207 p 2 0 3159 441 16815 3787 p 2 0 3127 473 16954 3808 p 2 0 2882 718 14518 3436 p 2 0 2576 1024 12799 3059 p 2 0 3224 376 14479 3976 p 2 0 2978 622 11590 3626 p 2 0 3471 129 20220 4438 p 2 0 3344 256 15529 4151 p 2 0 3350 250 16357 4191 p 2 0 2557 1043 9293 3024 p 2 0 3121 479 12882 3758 p 2 0 3301 299 14958 4033 p 2 0 3125 475 12323 3752 p 2 0 3244 356 13702 3921 p 2 0 3095 505 11900 3680 p 2 0 3091 509 11873 3723 p 2 0 3267 333 13919 3976 p 2 0 3048 552 11237 3723 p 2 0 3465 135 19469 4353 p 2 0 3315 285 14557 4059 p 2 0 3176 424 12980 3816 p 2 0 3283 317 15143 4001 p 2 0 3006 594 11812 3612 p 2 0 3298 302 14141 3991 p 2 0 3095 505 11984 3709 p 2 0 3113 487 12033 3740 p 2 0 3151 449 12379 3791 p 2 0 3021 579 11238 3616 p 2 0 3252 348 12988 3991 p 2 0 2893 707 10125 3492 p 2 0 3482 118 19716 4430 p 2 0 3323 277 14986 4089 p 2 0 3156 444 12590 3813 p 2 0 3261 339 13437 3951 p 2 0 3330 270 15926 4096 p 2 0 3245 355 14446 3971 p 2 0 3108 492 12411 3728 p 2 0 3037 563 11322 3630 p 2 0 3100 500 12527 3733 p 2 0 3236 364 13206 3990 p 2 0 2969 631 11087 3581 p 2 0 2786 814 10447 3296 p 2 0 3153 447 13983 3793 p 2 0 3236 364 13978 3918 p 2 0 3144 456 12646 3819 p 2 0 3221 379 13277 3948 p 2 0 2966 634 10663 3518 p 2 0 3256 344 15458 3939 p 2 0 2955 645 11211 3521 p 2 0 3079 521 11904 3666 p 2 0 3089 511 11742 3671 p 2 0 3212 388 13023 3970 p 2 0 2897 703 10064 3478 p 2 0 3457 143 19703 4373 p 2 0 3274 326 14388 4010 p 2 0 2973 627 10935 3566 p 2 0 3113 487 12152 3734 p 2 0 3259 341 14664 3949 p 2 0 3081 519 12414 3630 p 2 0 3256 344 14684 3968 p 2 0 2947 653 11343 3533 p 2 0 3118 482 12095 3740 p 2 0 3111 489 11976 3722 p 2 0 2953 647 10886 3543 p 2 0 3273 327 13268 4029 p 2 0 2793 807 9497 3359 p 2 0 3471 129 19824 4391 p 2 0 3308 292 14944 4079 p 2 0 3157 443 12927 3820 p 2 0 3203 397 13420 3909 p 2 0 3234 366 14184 3917 p 2 0 3255 345 13349 3950 p 2 0 3272 328 14814 3996 p 2 0 3030 570 11804 3619 p 2 0 2870 730 10339 3355 p 2 0 2640 960 9026 3118 p 2 0 3143 457 11951 3830 p 2 0 2950 650 10608 3575 p 2 0 3458 142 19742 4404 p 2 0 3325 275 14962 4092 p 2 0 3102 498 12236 3757 p 2 0 3177 423 12917 3841 p 2 0 2851 749 10295 3378 p 2 0 3165 435 12571 3764 p 2 0 3138 462 12271 3758 p 2 0 3199 401 13788 3913 p 2 0 3153 447 13142 3810 p 2 0 3028 572 11687 3643 p 2 0 3213 387 13615 3891 p 2 0 2964 636 11052 3506 p 2 0 3425 175 19003 4235 p 2 0 3247 353 14084 3984 p 2 0 3187 413 13139 3825 p 2 0 3179 421 12944 3815 p 2 0 3020 580 11500 3613 p 2 0 3189 411 12820 3825 p 2 0 3061 539 13650 3683 p 2 0 3063 537 14305 3707 p 2 0 3024 576 16289 3642 p 2 0 3039 561 15600 3671 p 2 0 3302 298 18223 4049 p 2 0 3013 587 15995 3663 p 2 0 3348 252 20115 4098 p 2 0 3244 356 18444 3902 p 2 0 3042 558 16393 3611 p 2 0 3042 558 16230 3616 p 2 0 2637 963 13041 3122 p 2 0 3063 537 15872 3645 p 2 0 2964 636 15432 3548 p 2 0 2910 690 15330 3480 p 2 0 2823 777 15167 3355 p 2 0 2578 1022 13535 3058 p 2 0 3185 415 17499 3891 p 2 0 2978 622 15182 3604 p 2 0 3343 257 21571 4180 p 2 0 3293 307 18971 3994 p 2 0 3256 344 18463 3986 p 2 0 3228 372 18114 3939 p 2 1 2884 715 13978 3443 p 2 3 3023 574 15014 3631 p 2 2 2941 657 13893 3580 p 2 0 2937 663 11155 3508 p 2 0 2982 618 11454 3550 p 2 0 3240 360 13863 3995 p 2 0 2979 621 11257 3559 p 2 0 3419 181 18033 4249 p 2 0 3284 316 14239 4054 p 2 0 2994 606 11155 3596 p 2 0 3088 512 11674 3682 p 2 0 3219 381 13825 3871 p 2 0 2981 619 11251 3511 p 2 0 2948 652 11087 3476 p 2 0 2950 650 10669 3473 p 2 0 2907 693 10841 3466 p 2 0 2989 611 10833 3536 p 2 0 3235 365 12913 3953 p 2 0 2827 773 9538 3406 p 2 0 3427 173 17929 4287 p 2 0 3254 346 13707 3968 p 2 0 2915 685 10644 3451 p 2 0 2706 894 9642 3217 p 2 0 3130 470 12737 3703 p 2 0 2917 683 10931 3423 p 2 0 3158 442 12933 3749 p 2 0 3065 535 11350 3650 p 2 0 2729 871 9313 3215 p 2 0 2871 729 10006 3359 p 2 0 3116 484 11571 3830 p 2 0 3169 431 12595 3900 p 2 0 3340 260 16233 4134 p 2 0 3098 502 12062 3785 p 2 0 2878 722 10342 3451 p 2 0 3002 598 11138 3613 p 2 0 3000 600 11122 3629 p 2 0 2769 831 9476 3289 p 2 0 3032 568 11498 3628 p 2 0 2912 688 10216 3471 p 2 0 2823 777 9640 3391 p 2 0 2929 671 10349 3475 p 2 0 3154 446 11890 3856 p 2 0 2794 806 9190 3337 p 2 0 3449 151 20026 4344 p 2 0 3222 378 13653 3951 p 2 0 2917 683 10696 3521 p 2 0 3059 541 11567 3668 p 2 0 3020 580 10913 3609 p 2 0 2873 727 9931 3415 p 2 0 3085 515 11958 3710 p 2 0 2904 696 10593 3468 p 2 0 2872 728 10391 3464 p 2 0 2940 660 10652 3528 p 2 0 3130 470 12518 3772 p 2 0 2808 792 9905 3303 p 2 0 3423 177 18347 4251 p 2 0 3302 298 15230 4060 p 2 0 2893 707 11021 3458 p 2 0 2640 960 9136 3116 p 2 0 2791 809 10093 3308 p 2 0 2664 936 9205 3154 p 2 0 3123 477 11858 3693 p 2 0 2947 653 10446 3503 p 2 0 2746 854 9533 3269 p 2 0 2930 670 10682 3467 p 2 0 3215 385 12649 3964 p 2 0 2889 711 9848 3497 p 2 0 3419 181 17704 4236 p 2 0 3251 349 13757 3900 p 2 0 3158 442 14396 3770 p 2 0 2901 699 11214 3439 p 2 0 2840 760 10252 3361 p 2 0 2788 812 9840 3319 p 2 0 2828 772 9839 3334 p 2 0 2726 874 9364 3208 p 2 0 2641 959 8946 3143 p 2 0 2896 704 10292 3394 p 2 0 3195 405 11862 3863 p 2 0 2793 807 9392 3361 p 2 0 3399 201 17901 4244 p 2 0 3223 377 13712 3877 p 2 0 3045 555 11870 3588 p 2 0 3247 353 14184 3964 p 2 0 3208 392 13330 3893 p 2 0 2829 771 9869 3364 p 2 0 2987 613 11142 3545 p 2 0 2817 783 10014 3344 p 2 0 2966 634 10854 3508 p 2 0 3049 551 11149 3598 p 2 0 3211 389 11987 3902 p 2 0 2838 762 9718 3423 p 2 0 3452 148 18029 4278 p 2 0 3240 360 13379 3922 p 2 0 3096 504 12349 3696 p 2 0 3093 507 11600 3663 p 2 0 3288 312 15875 3986 p 2 0 2987 613 12218 3552 p 2 0 3054 546 11760 3619 p 2 0 2920 680 10653 3471 p 2 0 2695 905 8969 3178 p 2 0 2920 680 10392 3438 p 2 0 3185 415 13491 3822 p 2 0 3080 520 11517 3752 p 2 0 3484 116 24875 4450 p 2 0 3385 215 17471 4165 p 2 0 3182 418 13821 3834 p 2 0 3215 385 13753 3901 p 2 0 3332 268 15749 4040 p 2 0 3300 300 16466 3987 p 2 0 3278 322 14967 3998 p 2 0 3198 402 13018 3824 p 2 0 3535 65 33157 5226 i 2 3600 0 0 117695 13841 p 2 0 2355 1245 6987 2899 p 2 2 3274 324 14785 4113 p 2 0 2733 867 10102 3360 p 2 0 3265 335 17069 4112 p 2 0 2689 911 9953 3312 p 2 0 2693 907 9741 3270 p 2 0 1644 1956 5021 2098 p 2 0 2355 1245 8455 2844 p 2 0 2322 1278 7502 2815 p 2 0 2004 1596 6959 2492 p 2 0 2235 1365 7664 2717 p 2 0 3166 434 13763 3948 p 2 0 2367 1233 7529 2918 p 2 0 3157 443 13685 3906 p 2 0 2918 682 11342 3519 p 2 0 3239 361 15190 3991 p 2 0 3068 532 12659 3774 p 2 0 3078 522 12265 3733 p 2 0 2986 614 11815 3633 p 2 0 2628 972 9083 3150 p 2 0 2922 678 11022 3547 p 2 0 2544 1056 9066 3062 p 2 2 2721 877 10188 3249 p 2 0 2769 831 9962 3331 p 2 0 2506 1094 8364 3033 p 2 0 3043 557 11613 3789 p 2 0 2705 895 9145 3308 p 2 0 3095 505 12840 3848 p 2 0 3009 591 12014 3673 p 2 0 2960 640 10532 3623 p 2 0 2893 707 10823 3521 p 2 2 2711 887 10175 3282 p 2 0 2618 982 8994 3122 p 2 0 2877 723 11216 3467 p 2 0 2635 965 9746 3220 p 2 0 2616 984 8920 3164 p 2 0 2537 1063 8607 3049 p 2 0 2596 1004 8731 3141 p 2 0 2838 762 9979 3502 p 2 0 3088 512 12401 3822 p 2 2 3000 598 11609 3714 p 2 0 2675 925 9018 3237 p 2 0 2742 858 9890 3315 p 2 0 2712 888 9979 3301 p 2 0 2432 1168 7829 2924 p 2 0 2475 1125 8761 2993 p 2 0 2511 1089 8233 3037 p 2 0 2442 1158 7936 2946 p 2 0 2371 1229 7443 2846 p 2 0 2701 899 9646 3300 p 2 0 2563 1037 8901 3088 p 2 0 3109 491 12740 3779 p 2 0 2901 699 10668 3587 p 2 0 2913 687 10605 3485 p 2 0 2789 811 10142 3353 p 2 0 2723 877 9748 3294 p 2 0 2666 934 8906 3251 p 2 0 2651 949 9170 3205 p 2 0 2743 857 9871 3332 p 2 0 2541 1059 8761 3085 p 2 0 2421 1179 7856 2930 p 2 0 2826 774 10912 3456 p 2 0 2498 1102 8043 3009 p 2 0 3047 553 12158 3732 p 2 0 2917 683 11311 3558 p 2 0 2687 913 9375 3226 p 2 0 2628 972 8677 3153 p 2 2 2590 1008 9078 3145 p 2 0 2521 1079 7850 3016 p 2 0 2539 1061 8084 3036 p 2 0 2562 1038 8724 3126 p 2 0 2831 769 10135 3390 p 2 0 2567 1033 8514 3112 p 2 0 2722 878 10024 3324 p 2 0 3272 328 16278 4101 p 2 0 2337 1263 7952 2806 p 2 0 2886 714 10997 3485 p 2 0 2749 851 9548 3284 p 2 0 2807 793 10033 3362 p 2 2 2790 808 10467 3374 p 2 0 2509 1091 7825 2986 p 2 0 2494 1106 8477 3031 p 2 0 2488 1112 8004 3012 p 2 0 2653 947 9246 3207 p 2 0 2512 1088 8195 3056 p 2 0 2842 758 10282 3525 p 2 0 2731 869 9338 3335 p 2 0 3140 460 13284 3884 p 2 0 2767 833 10259 3382 p 2 0 2971 629 10955 3637 p 2 0 2929 671 10836 3560 p 2 0 2803 797 10619 3369 p 2 0 2635 965 8707 3136 p 2 4 3217 379 47531 4909 p 2 0 3008 592 12895 3685 p 2 0 2230 1370 8944 2751 p 2 0 3074 526 46952 4748 p 2 0 3114 486 15412 3910 p 2 17 3245 338 46523 5182 p 2 0 3278 322 15947 4274 p 2 4 3286 310 45689 5126 p 2 0 2607 993 9649 3226 p 2 0 3117 483 13380 3889 p 2 1 3021 578 12815 3829 p 2 0 2925 675 11071 3598 p 2 0 2880 720 10447 3525 p 2 2 2893 705 11081 3579 p 2 0 2990 610 11378 3681 p 2 0 2746 854 9565 3379 p 2 1 3016 583 12094 3726 p 2 0 2965 635 11481 3621 p 2 0 3102 498 13909 3849 p 2 0 2886 714 11001 3530 p 2 0 2998 602 11336 3623 p 2 0 2067 1533 6236 2505 p 2 1 2766 833 10020 3323 p 2 0 2444 1156 7728 2936 p 2 1 2475 1124 8187 3027 p 2 0 2465 1135 8035 3016 p 2 0 2616 984 8803 3164 p 2 3 2864 733 10643 3594 p 2 0 2739 861 9537 3335 p 2 0 3298 302 16634 4226 p 2 0 2367 1233 8088 2888 p 2 1 2690 909 9899 3291 p 2 0 2876 724 11256 3475 p 2 0 1937 1663 6000 2360 p 2 2 2259 1339 7469 2712 p 2 0 2652 948 9046 3139 p 2 0 2588 1012 8479 3100 p 2 1 2730 869 9805 3256 p 2 0 2669 931 8984 3181 p 2 0 2528 1072 8255 3032 p 2 0 2689 911 9423 3266 p 2 0 2836 764 9758 3484 p 2 0 3126 474 12899 3871 p 2 0 3079 521 12458 3858 p 2 0 2633 967 9227 3192 p 2 0 2395 1205 7525 2908 p 2 2 2502 1096 8704 3059 p 2 0 2564 1036 8401 3101 p 2 0 2578 1022 8558 3126 p 2 1 2546 1053 8828 3106 p 2 0 2680 920 9142 3221 p 2 0 2383 1217 7712 2915 p 2 1 2876 723 10740 3535 p 2 0 2494 1106 8076 3027 p 2 0 3081 519 12210 3771 p 2 3 2802 795 10496 3442 p 2 0 2524 1076 8870 3037 p 2 0 2672 928 9044 3213 p 2 1 2705 894 9612 3271 p 2 0 2341 1259 7193 2801 p 2 3 2305 1292 7929 2840 p 2 0 2396 1204 7382 2893 p 2 0 2562 1038 8418 3104 p 2 0 2760 840 9936 3388 p 2 0 2525 1075 8243 3069 p 2 0 3188 412 14755 3973 p 2 0 2271 1329 7339 2753 p 2 1 2850 749 10680 3440 p 2 0 2931 669 11821 3524 p 2 0 2865 735 11379 3495 p 2 0 2746 854 10153 3322 p 2 0 2359 1241 8205 2898 i 2 3600 0 0 86910 13073 p 2 0 3543 57 20794 4978 p 2 0 2746 854 9205 3374 p 2 0 3121 479 12370 3969 p 2 0 3285 315 14012 4310 p 2 0 3077 523 11089 3893 p 2 0 3202 398 14020 4101 p 2 0 2944 656 10229 3707 p 2 0 2742 858 8870 3378 p 2 0 2939 661 10226 3665 p 2 0 2641 959 8694 3273 p 2 0 2629 971 8550 3268 p 2 1 2570 1029 8507 3179 p 2 0 2549 1051 8221 3134 p 2 0 1764 1836 5358 2236 p 2 0 2263 1337 7018 2828 p 2 0 2774 826 9527 3462 p 2 0 2439 1161 7672 3022 p 2 0 2787 813 9883 3446 p 2 0 2282 1318 6996 2812 p 2 0 2608 992 8785 3207 p 2 0 2484 1116 7379 3034 p 2 0 1572 2028 4415 2027 p 2 0 2199 1401 6677 2727 p 2 0 2322 1278 7218 2878 p 2 0 2253 1347 6573 2782 p 2 0 2228 1372 6664 2777 p 2 0 2202 1398 6658 2752 p 2 0 2464 1136 7384 3049 p 2 0 3042 558 11291 3842 p 2 0 2603 997 8178 3227 p 2 0 1569 2031 4693 2029 p 2 0 2356 1244 7085 2870 p 2 0 2363 1237 6947 2920 p 2 0 1968 1632 6075 2497 p 2 0 2666 934 8400 3269 p 2 0 1901 1699 5583 2414 p 2 0 2132 1468 6323 2662 p 2 0 1821 1779 5240 2298 p 2 0 1891 1709 5365 2365 i 2 3600 0 0 41127 11073 p 2 0 2828 772 12294 3525 p 2 1823 1605 172 74773 11656 p 2 241 3029 330 40687 6589 i 2 3600 0 0 96703 13700 p 2 219 3020 361 48751 6187 p 2 1361 2234 5 137381 13442 p 2 291 3211 98 64836 8073 p 2 1130 2468 2 134471 12865 p 2 248 3248 104 69560 8410 i 2 3600 0 0 86727 12750 p 2 387 3183 30 63448 8166 i 2 3600 0 0 73006 12054 p 2 168 3389 43 55282 7437 i 2 3600 0 0 77514 12316 p 2 412 3188 0 81466 9701 p 2 402 3198 0 102721 10773 p 2 304 3285 11 85725 9884 p 2 300 3300 0 108391 10757 p 2 527 3056 17 85555 10340 p 2 313 3284 3 111766 10469 p 2 302 3275 23 91270 10032 p 2 568 3032 0 99177 10789 p 2 423 3164 13 95291 10408 p 2 475 3125 0 102203 10565 p 2 424 3163 13 83383 10280 p 2 528 3071 1 97222 10445 p 2 343 3233 24 81213 9803 p 2 269 3330 1 94603 10350 p 2 300 3257 43 83132 9731 p 2 809 2791 0 114927 11771 p 2 494 3101 5 86130 10220 p 2 561 3039 0 111127 11255 p 2 404 3179 17 86583 10068 i 2 3600 0 0 140446 14626 p 2 1547 2053 0 116804 12140 i 2 3600 0 0 104185 14100 p 2 1973 1522 105 112950 13036 p 2 0 3497 103 30171 5263 p 2 1772 1700 128 91425 12202 p 2 243 3144 213 44499 6854 p 2 0 2690 910 10932 3445 p 2 1 2814 785 13633 3587 p 2 195 3101 304 40814 6360 p 2 0 2882 718 14582 3750 p 2 119 3100 381 41460 6013 p 2 0 3048 552 16752 4079 p 2 81 3056 463 36416 5478 p 2 1 3488 111 25487 4860 p 2 59 3212 329 34269 5451 p 2 0 3378 222 17203 4350 p 2 9 3378 213 27233 4883 p 2 0 3541 59 22191 4780 p 2 0 2814 786 9533 3414 p 2 1 3344 255 15433 4251 p 2 0 3336 264 14072 4177 p 2 0 3280 320 13382 4093 p 2 0 3182 418 12677 3950 p 2 0 3137 463 12236 3892 p 2 0 2968 632 10827 3628 p 2 0 3117 483 12044 3854 p 2 0 3187 413 13123 3894 p 2 0 3275 325 13184 4127 p 2 1 3187 412 12956 3956 p 2 0 3017 583 10805 3669 p 2 0 2754 846 8810 3326 p 2 1 2772 827 9421 3364 p 2 0 2766 834 8942 3337 p 2 0 2694 906 8629 3286 p 2 0 2758 842 8647 3333 p 2 0 2726 874 8566 3306 p 2 0 2878 722 9356 3492 p 2 1 3071 528 11489 3763 p 2 0 3321 279 13502 4132 p 2 0 2321 1279 6824 2769 p 2 1 2809 790 9046 3382 p 2 0 2938 662 10006 3536 p 2 0 2927 673 10100 3537 p 2 0 2745 855 8779 3249 p 2 0 2566 1034 7610 3064 p 2 0 2674 926 8497 3201 p 2 0 2694 906 8213 3224 p 2 0 2547 1053 7563 3051 p 2 0 2386 1214 7104 2875 p 2 1 2897 702 10033 3519 p 2 0 2839 761 9023 3517 p 2 0 3217 383 12310 4045 p 2 1 2778 821 9326 3361 p 2 0 2102 1498 6001 2535 p 2 0 2892 708 9667 3436 p 2 0 2687 913 8897 3207 p 2 0 2592 1008 7838 3121 p 2 0 2734 866 8575 3289 p 2 1 2484 1115 7677 2975 p 2 0 2639 961 8186 3146 p 2 0 2304 1296 6562 2799 p 2 0 2742 858 8877 3333 p 2 0 2615 985 8028 3154 p 2 0 3055 545 10878 3752 p 2 0 3087 513 10674 3804 p 2 0 2773 827 8490 3308 p 2 0 2703 897 8204 3208 p 2 0 2661 939 8555 3158 p 2 0 2537 1063 8009 2987 i 2 3600 0 0 84269 13680 p 2 0 3314 286 14213 4241 p 2 77 3514 9 40100 6067 p 2 55 3483 62 35990 5716 p 2 52 3497 51 33005 5608 p 2 40 3515 45 36904 5602 p 2 22 3511 67 36672 5691 p 2 27 3516 57 35078 5562 p 2 7 3558 35 31824 5332 p 2 16 3545 39 31009 5346 p 2 13 3539 48 32748 5399 p 2 11 3551 38 33041 5453 p 2 10 3553 37 34255 5464 p 2 17 3541 42 31402 5384 p 2 20 3539 41 33338 5502 p 2 16 3562 22 37214 5491 p 2 13 3548 39 31702 5453 p 2 13 3558 29 33776 5575 p 2 17 3529 54 35171 5525 p 2 15 3543 42 34706 5566 p 2 23 3517 60 31484 5360 i 2 3600 0 0 63137 12997 p 2 24 3488 88 34342 5958 p 2 12 3461 127 28821 5449 p 2 2 3459 139 27933 5255 p 2 41 3464 95 26700 5433 p 2 31 3400 169 27203 5280 p 2 41 3445 114 27757 5551 p 2 11 3448 141 27007 5364 p 2 78 3426 96 27461 5363 p 2 69 3370 161 26661 5477 p 2 59 3412 129 26944 5404 p 2 64 3439 97 25801 5458 p 2 60 3446 94 27605 5449 p 2 67 3387 146 27804 5573 p 2 50 3396 154 28202 5503 p 2 84 3380 136 28261 5714 p 2 18 3524 58 26791 5351 p 2 73 3357 170 27970 5588 p 2 38 3496 66 27342 5482 p 2 26 3481 93 26238 5451 p 2 16 3514 70 27053 5333 p 2 13 3421 166 26774 5411 p 2 8 3441 151 27251 5328 p 2 1 3474 125 25082 5323 i 2 3600 0 0 76916 13612 p 2 11 3547 42 40500 6189 p 2 10 3508 82 33610 5510 p 2 10 3466 124 34415 5361 p 2 14 3472 114 30810 5145 p 2 6 3474 120 32177 5208 p 2 27 3464 109 33556 5279 p 2 36 3458 106 30125 5421 p 2 32 3471 97 32747 5309 p 2 25 3483 92 33864 5466 p 2 62 3452 86 35467 5549 p 2 60 3464 76 32477 5540 p 2 63 3461 76 30914 5517 p 2 79 3445 76 34266 5616 p 2 86 3433 81 35075 5768 p 2 128 3437 35 33368 5842 p 2 121 3420 59 33020 5732 p 2 129 3414 57 36769 5926 p 2 123 3432 45 33070 5793 p 2 136 3440 24 30739 5743 p 2 102 3457 41 33373 5667 i 2 3600 0 0 66100 13597 p 2 106 3383 111 37272 6434 p 2 93 3376 131 28739 5508 p 2 89 3325 186 28666 5441 p 2 74 3387 139 29149 5474 p 2 66 3392 142 29168 5524 p 2 34 3414 152 27948 5278 p 2 49 3405 146 26208 5230 p 2 43 3395 162 28341 5296 p 2 35 3442 123 28877 5401 p 2 40 3426 134 27133 5297 p 2 19 3458 123 27676 5146 p 2 19 3425 156 30138 5337 p 2 15 3437 148 28419 5232 p 2 13 3452 135 25572 5069 p 2 33 3438 129 27256 5329 p 2 15 3399 186 27021 5166 p 2 15 3422 163 26322 5107 p 2 15 3387 198 28094 5207 p 2 13 3425 162 25819 5009 p 2 22 3368 210 28331 5131 p 2 60 3387 153 27434 5317 i 2 3600 0 0 77846 13750 p 2 44 3452 104 36363 5920 p 2 70 3397 133 33978 5614 p 2 58 3437 105 37678 5588 p 2 80 3442 78 35022 5630 p 2 65 3456 79 35620 5575 p 2 61 3427 112 37079 5568 p 2 43 3468 89 37366 5504 p 2 76 3452 72 36869 5775 p 2 80 3450 70 35465 5788 p 2 76 3447 77 36535 5718 p 2 75 3454 71 36994 5920 p 2 75 3461 64 35686 5856 p 2 65 3468 67 37674 5825 p 2 74 3436 90 37238 5829 p 2 63 3483 54 38297 5863 p 2 43 3480 77 37044 5653 p 2 60 3472 68 37909 5793 p 2 15 3494 91 36066 5614 p 2 4 3537 59 37029 5648 p 2 9 3519 72 38975 5586 p 2 3 3528 69 35688 5539 p 2 30 3494 76 36271 5680 p 2 37 3520 43 37699 5680 p 2 26 3506 68 34929 5582 i 2 3600 0 0 86290 14265 p 2 55 3504 41 34852 5929 p 2 51 3491 58 32863 5619 p 2 36 3520 44 28936 5382 p 2 52 3493 55 31159 5401 p 2 32 3494 74 30052 5387 p 2 20 3519 61 32944 5483 p 2 17 3543 40 30176 5342 p 2 24 3502 74 28936 5260 p 2 23 3515 62 30912 5361 p 2 30 3521 49 31046 5452 p 2 19 3526 55 29442 5380 p 2 30 3513 57 29562 5337 p 2 28 3519 53 30654 5478 p 2 49 3489 62 31864 5526 p 2 49 3516 35 28672 5384 p 2 44 3496 60 30545 5360 p 2 37 3521 42 31356 5511 p 2 41 3493 66 33249 5399 p 2 32 3514 54 31981 5447 p 2 40 3497 63 31005 5360 p 2 32 3516 52 32635 5409 p 2 46 3497 57 32588 5434 p 2 37 3520 43 32701 5499 p 2 32 3524 44 31312 5353 p 2 33 3528 39 33523 5544 p 2 22 3538 40 33464 5426 p 2 33 3534 33 29238 5302 p 2 22 3538 40 29930 5254 p 2 29 3532 39 28087 5320 p 2 30 3523 47 30441 5331 p 2 28 3535 37 28989 5371 p 2 19 3551 30 28186 5180 p 2 19 3550 31 31179 5341 p 2 18 3545 37 30257 5281 p 2 26 3545 29 30920 5478 p 2 20 3549 31 29256 5313 p 2 20 3551 29 30142 5457 p 2 25 3521 54 31473 5486 p 2 33 3505 62 28091 5435 p 2 27 3530 43 30117 5459 p 2 31 3534 35 29576 5501 p 2 29 3508 63 31912 5519 p 2 31 3523 46 29907 5517 p 2 23 3535 42 26749 5288 p 2 32 3529 39 31445 5488 p 2 29 3525 46 28816 5369 p 2 16 3530 54 29430 5448 p 2 12 3527 61 27619 5249 p 2 7 3546 47 29821 5349 p 2 12 3521 67 30378 5316 p 2 25 3525 50 27098 5157 p 2 6 3521 73 27672 5136 p 2 21 3523 56 28357 5265 p 2 6 3518 76 31111 5278 p 2 17 3523 60 30414 5415 p 2 63 3468 69 28044 5340 p 2 39 3504 57 30986 5311 p 2 30 3483 87 29613 5318 p 2 35 3509 56 31149 5438 p 2 35 3512 53 29623 5439 p 2 64 3489 47 32811 5739 p 2 39 3510 51 33225 5635 p 2 46 3525 29 29843 5535 p 2 49 3499 52 29135 5424 p 2 38 3520 42 30342 5548 p 2 43 3511 46 31333 5516 p 2 35 3523 42 31100 5579 p 2 20 3536 44 28507 5378 p 2 15 3540 45 32147 5476 p 2 8 3541 51 31754 5484 p 2 18 3546 36 31773 5528 p 2 23 3559 18 29912 5470 p 2 19 3545 36 32226 5623 p 2 28 3521 51 32519 5602 p 2 26 3538 36 29805 5540 p 2 26 3534 40 30863 5559 p 2 24 3535 41 30543 5544 p 2 33 3515 52 32721 5697 p 2 25 3550 25 33110 5678 p 2 51 3498 51 32746 5682 p 2 44 3526 30 34046 5785 p 2 42 3525 33 32085 5776 p 2 46 3524 30 35302 5800 p 2 60 3499 41 30938 5721 p 2 52 3524 24 35292 5918 p 2 50 3518 32 36717 5973 p 2 49 3524 27 32033 5766 p 2 39 3543 18 30671 5728 p 2 48 3518 34 31160 5731 p 2 48 3514 38 32131 5779 p 2 68 3506 26 32682 5834 p 2 121 3447 32 64574 7429 p 2 54 3517 29 33433 6014 p 2 119 3451 30 67616 7482 p 2 46 3528 26 32210 5811 p 2 41 3530 29 29541 5619 p 2 48 3513 39 34074 5788 p 2 55 3507 38 33816 5788 p 2 71 3493 36 31760 5807 p 2 50 3515 35 31816 5733 p 2 86 3481 33 32905 5924 p 2 50 3519 31 34289 5887 p 2 94 3474 32 34279 5920 p 2 70 3501 29 31282 5753 p 2 54 3518 28 34290 5766 p 2 56 3491 53 32448 5826 i 2 3600 0 0 106172 13519 p 2 0 3479 121 21356 4589 p 2 206 3297 97 76078 7329 p 2 0 3390 210 18117 4691 p 2 106 3330 164 67453 6539 p 2 0 3089 511 15342 4169 p 2 0 2519 1081 8933 3104 p 2 0 3078 522 12265 3874 p 2 96 3217 287 67767 6430 p 2 0 2644 956 10790 3360 p 2 0 3049 551 14308 3901 p 2 0 2920 680 11657 3647 p 2 0 3158 442 13461 4061 p 2 0 3068 532 11618 3888 p 2 0 3292 308 16792 4216 p 2 0 3027 573 12114 3730 p 2 0 3073 527 12304 3841 p 2 0 2983 617 11537 3726 p 2 0 2632 968 8895 3252 p 2 0 3027 573 11054 3724 p 2 0 2793 807 10063 3441 p 2 0 2981 619 11172 3675 p 2 0 2073 1527 6071 2527 p 2 0 2703 897 9117 3299 p 2 0 2964 636 11013 3654 p 2 0 3300 300 14753 4197 p 2 0 3072 528 12209 3812 p 2 0 2693 907 9144 3285 p 2 0 2637 963 8803 3200 p 2 0 2983 617 10887 3675 p 2 0 2707 893 9362 3307 p 2 0 2698 902 9162 3277 p 2 0 2576 1024 8454 3140 p 2 0 2563 1037 8624 3149 p 2 0 2550 1050 8491 3110 p 2 0 2429 1171 7728 2987 p 2 0 2579 1021 8420 3163 p 2 0 3447 153 23361 4949 i 2 3600 0 0 135072 13385 p 2 0 3311 289 15452 4145 p 2 0 2768 832 9678 3374 p 2 0 2986 614 10598 3595 p 2 0 3299 301 13943 4006 p 2 0 3367 233 14644 4094 p 2 0 2987 613 10421 3563 p 2 0 2960 640 10591 3485 p 2 0 3164 436 12417 3779 p 2 0 3349 251 14347 4220 p 2 0 3103 497 11609 3829 p 2 0 3519 81 20718 4581 p 2 0 3407 193 16175 4201 p 2 0 3091 509 12346 3634 p 2 0 3226 374 13210 3965 p 2 0 3266 334 13637 3981 p 2 0 3027 573 10808 3646 p 2 0 3316 284 14773 4085 p 2 0 3047 553 12029 3630 p 2 0 2949 651 10876 3460 p 2 0 2957 643 10576 3496 p 2 0 3204 396 11998 3921 p 2 0 2891 709 9687 3515 p 2 0 3452 148 17891 4382 p 2 0 3285 315 13732 4046 p 2 0 3149 451 12307 3802 p 2 0 3082 518 11481 3757 p 2 0 3228 372 13451 3888 p 2 0 2928 672 10490 3450 p 2 0 3228 372 13700 3870 p 2 0 2981 619 11316 3515 p 2 0 2914 686 10212 3397 p 2 0 2953 647 10395 3484 p 2 0 3194 406 13101 3849 p 2 0 2758 842 9424 3255 p 2 0 3499 101 24210 4487 p 2 0 3357 243 19416 4477 i 2 3600 0 0 74271 13135 p 2 0 3371 229 28680 5161 p 2 1 3195 404 26030 4629 p 2 0 2834 766 24123 4177 p 2 0 2930 670 24679 4193 p 2 0 2887 713 22480 4105 p 2 0 2822 778 20846 3875 p 2 0 2814 786 20462 3819 p 2 0 2674 926 18399 3565 p 2 0 2791 809 17307 3707 p 2 0 2484 1116 14183 3210 p 2 0 2669 931 18119 3565 p 2 0 2980 620 23451 4195 p 2 0 2988 612 26559 4469 p 2 8 3016 576 30538 4729 p 2 25 2943 632 29750 4715 p 2 1 2956 643 27987 4597 p 2 0 2904 696 24977 4114 p 2 0 2884 716 19750 3953 p 2 1 2832 767 22569 4040 p 2 1 2910 689 24033 4155 p 2 1 3024 575 23762 4270 p 2 0 2841 759 20555 3912 p 2 0 2894 706 19954 3878 p 2 5 2820 775 20010 3868 p 2 10 2758 832 20591 3811 p 2 0 2830 770 20519 3937 p 2 0 2817 783 20499 3811 p 2 0 2771 829 19416 3721 p 2 0 2849 751 20746 3950 p 2 0 2861 739 20434 3903 p 2 0 2778 822 18701 3717 p 2 0 2704 896 16222 3510 p 2 0 2707 893 16823 3527 p 2 0 2792 808 18675 3689 p 2 0 2922 678 19783 3899 p 2 0 2802 798 19446 3753 p 2 0 2714 886 18029 3548 p 2 0 2713 887 15683 3486 p 2 0 2679 921 15477 3402 p 2 0 2527 1073 14213 3259 p 2 0 2806 794 15292 3545 p 2 0 2595 1005 15426 3349 p 2 0 2608 992 15155 3298 p 2 0 2586 1014 16569 3365 p 2 0 2615 985 16648 3416 i 2 3600 0 0 109203 13642 p 2 1493 2106 1 115948 12101 p 2 115 3150 335 66995 6155 p 2 92 3168 340 55589 5586 p 2 93 3132 375 61296 6086 p 2 33 3177 390 53809 5419 p 2 13 3192 395 46085 5054 p 2 6 3206 388 43602 4774 p 2 0 3184 416 39574 4276 p 2 1 3199 400 40116 4426 p 2 0 3184 416 35893 4283 p 2 0 3182 418 47956 4015 p 2 0 2570 1030 10423 3030 p 2 0 2735 865 14469 3156 p 2 0 2452 1148 8915 2802 p 2 0 2670 930 14561 3098 p 2 0 2578 1022 11331 2992 p 2 0 2476 1124 9810 2870 p 2 0 2416 1184 9166 2812 p 2 0 2360 1240 8092 2744 p 2 0 2478 1122 9780 2868 p 2 0 2243 1357 8193 2634 p 2 0 2381 1219 9806 2774 i 2 3600 0 0 135772 13443 p 2 0 3522 78 23110 4834 p 2 0 2516 1084 8690 3076 p 2 121 3280 199 34266 5069 p 2 0 3349 251 15184 4111 p 2 0 2318 1282 7661 2817 p 2 77 2974 549 26862 4260 p 2 0 2853 747 10161 3432 p 2 91 2956 553 33515 4426 p 2 0 3094 506 12726 3726 p 2 0 3056 544 11766 3652 p 2 153 3193 254 32097 5052 p 2 0 3277 323 14793 4116 p 2 0 3509 91 20477 4551 p 2 0 2887 713 11061 3427 p 2 131 3073 396 25040 4678 p 2 0 3285 315 13730 4068 p 2 0 3132 468 12803 3764 p 2 60 3013 527 16781 4128 p 2 0 3105 495 11881 3794 p 2 0 3123 477 11928 3783 p 2 11 3026 563 12011 3793 p 2 0 3076 524 10966 3684 p 2 0 3047 553 11100 3679 p 2 0 3219 381 12793 3995 p 2 0 3518 82 21055 4565 p 2 0 2798 802 9900 3324 p 2 8 3152 440 19044 3958 p 2 0 3249 351 13505 3984 p 2 0 3213 387 12755 3925 p 2 7 3076 517 17915 3888 p 2 0 2972 628 10847 3549 p 2 54 3057 489 19825 4024 p 2 0 2871 729 10254 3398 p 2 0 2789 811 9592 3299 p 2 42 3158 400 21237 4264 p 2 0 2872 728 9913 3483 p 2 0 3450 150 17081 4337 p 2 0 2633 967 9162 3128 p 2 73 3087 440 22131 4294 p 2 0 3302 298 14374 4002 p 2 0 2349 1251 7732 2789 p 2 60 2913 627 22596 4003 p 2 0 3104 496 12702 3681 i 2 3600 0 0 43919 11767 p 2 17 3577 6 30850 7136 p 2 68 3504 28 42247 7699 p 2 11 3578 11 28234 6676 p 2 10 3578 12 25440 6423 p 2 21 3570 9 42574 7600 p 2 14 3573 13 25811 6610 p 2 20 3578 2 26137 6702 p 2 26 3561 13 44337 7482 p 2 6 3591 3 27335 6442 p 2 7 3580 13 26411 6466 p 2 78 3515 7 53059 8197 p 2 14 3579 7 28939 6542 p 2 15 3578 7 26799 6076 p 2 49 3544 7 54174 8094 p 2 10 3576 14 28451 6400 p 2 7 3584 9 28180 6255 p 2 67 3530 3 59655 8333 p 2 6 3590 4 28914 6444 p 2 9 3587 4 28643 6377 p 2 50 3545 5 54813 7782 p 2 5 3591 4 27673 6062 p 2 2 3582 16 25265 5956 p 2 38 3554 8 58748 7914 p 2 4 3577 19 26099 5907 p 2 4 3574 22 24174 5673 p 2 118 3442 40 63440 8282 p 2 1 3577 22 31451 6403 p 2 0 3576 24 23943 5777 p 2 67 3519 14 54775 7430 p 2 0 3546 54 25234 5530 p 2 0 3539 61 23002 5279 p 2 76 3476 48 55177 7381 p 2 0 3560 40 21213 5322 p 2 1 3361 238 19884 4679 p 2 165 3314 121 59450 7736 p 2 1 3310 289 14995 4785 p 2 1 3277 322 13306 4438 p 2 173 3286 141 59023 7591 p 2 0 3209 391 15644 4622 p 2 1 3243 356 12802 4285 p 2 260 3225 115 59725 7890 p 2 2 3251 347 14466 4675 p 2 1 2929 670 9626 3782 p 2 142 3269 189 56177 7135 p 2 0 3211 389 14723 4576 p 2 0 3051 549 11709 4011 p 2 154 3255 191 57767 7210 p 2 1 3164 435 14121 4513 p 2 2 2992 606 10985 3890 p 2 236 3094 270 61671 7600 p 2 1 3189 410 15882 4578 p 2 1 3185 414 12047 4161 p 2 84 3321 195 53547 6857 p 2 0 3154 446 13409 4506 p 2 0 3074 526 10614 3970 p 2 68 3385 147 55273 6994 p 2 0 3250 350 14361 4561 p 2 0 2967 633 11070 3860 p 2 168 3249 183 59804 7599 p 2 1 3075 524 14004 4340 p 2 0 2976 624 11317 3833 p 2 167 3119 314 57641 7291 p 2 0 3162 438 16171 4518 p 2 1 3129 470 11908 4080 p 2 260 3187 153 59457 7858 p 2 1 3200 399 14169 4565 p 2 2 2892 706 9732 3703 p 2 152 3275 173 56128 7134 p 2 0 3236 364 14180 4516 p 2 1 3016 583 10775 3894 p 2 161 3318 121 58125 7332 p 2 0 3083 517 13213 4372 p 2 1 2954 645 10919 3804 p 2 231 3120 249 62140 7657 p 2 1 3098 501 14498 4442 p 2 0 3188 412 12655 4213 p 2 78 3304 218 53079 6799 p 2 0 3200 400 13173 4510 p 2 0 2958 642 10067 3787 p 2 73 3345 182 54833 6901 p 2 1 3206 393 13880 4481 p 2 1 2895 704 10317 3768 p 2 156 3271 173 59959 7568 p 2 1 3108 491 14595 4458 p 2 0 2910 690 10533 3806 p 2 156 3195 249 57725 7340 p 2 0 3124 476 15582 4514 p 2 0 3135 465 11876 4075 i 2 3600 0 0 43835 12445 p 2 16 3584 0 39780 7200 p 2 62 3535 3 48906 8457 p 2 9 3575 16 34418 6460 p 2 20 3573 7 34242 6236 p 2 55 3536 9 49315 8223 p 2 18 3561 21 35819 6535 p 2 15 3580 5 36569 6477 p 2 39 3556 5 50025 8269 p 2 8 3585 7 34310 6658 p 2 14 3578 8 34163 6369 p 2 88 3509 3 53691 8595 p 2 13 3586 1 34860 6555 p 2 9 3587 4 32832 6276 p 2 57 3535 8 55036 8592 p 2 13 3581 6 35658 6637 p 2 16 3576 8 35091 6409 p 2 70 3527 3 57556 8579 p 2 22 3574 4 38771 6775 p 2 15 3578 7 37577 6517 p 2 58 3537 5 59685 8808 p 2 15 3581 4 37192 6653 p 2 18 3580 2 36333 6519 p 2 103 3492 5 58933 8913 p 2 6 3590 4 36269 6667 p 2 10 3581 9 33754 6400 p 2 93 3503 4 63650 8970 p 2 3 3590 7 36260 6542 p 2 10 3578 12 35716 6234 p 2 70 3524 6 61440 8864 p 2 6 3586 8 40560 6811 p 2 7 3588 5 36932 6429 p 2 74 3522 4 61397 8791 p 2 10 3576 14 35333 6605 p 2 6 3592 2 33801 6250 p 2 107 3489 4 62928 9087 p 2 10 3579 11 35244 6633 p 2 13 3582 5 32226 6472 p 2 112 3483 5 65078 8984 p 2 11 3576 13 33111 6348 p 2 10 3583 7 32246 6265 p 2 115 3483 2 65267 8927 p 2 9 3583 8 38822 6816 p 2 13 3578 9 35525 6473 p 2 75 3519 6 60507 8828 p 2 5 3586 9 34971 6546 p 2 7 3587 6 34447 6299 i 2 3600 0 0 129017 13283 p 2 0 3541 59 28041 4728 p 2 54 3403 143 30015 4914 p 2 0 3021 579 11818 3703 p 2 66 3424 110 29949 4918 p 2 0 3261 339 14125 3966 p 2 0 3318 282 14433 4139 p 2 74 3219 307 26826 4554 p 2 0 3289 311 14572 4058 p 2 0 3281 319 14039 3985 p 2 0 2443 1157 8261 2913 p 2 78 3062 460 26673 4367 p 2 0 3397 203 17123 4320 p 2 0 3244 356 14311 3961 p 2 0 3455 145 18745 4340 p 2 0 3100 500 12530 3726 p 2 0 3286 314 14734 3943 p 2 0 3098 502 12875 3685 p 2 0 2956 644 10873 3523 p 2 0 3187 413 12489 3742 p 2 0 2974 626 10613 3524 p 2 0 2095 1505 6208 2518 p 2 0 2951 649 10509 3517 p 2 0 2869 731 10107 3425 p 2 0 3201 399 12046 3939 p 2 0 3125 475 11018 3831 p 2 0 3409 191 16584 4188 p 2 0 3135 465 12818 3701 p 2 0 2964 636 11035 3488 p 2 0 2980 620 10932 3548 p 2 0 2772 828 9778 3322 p 2 0 2980 620 10483 3546 p 2 0 2857 743 9894 3403 p 2 0 2817 783 9661 3369 p 2 0 2837 763 9750 3384 p 2 0 2740 860 9264 3258 p 2 0 3157 443 11285 3865 p 2 0 2936 664 9796 3537 p 2 0 3409 191 18537 4305 p 2 0 3254 346 13824 3948 p 2 0 3216 384 13237 3914 p 2 0 2886 714 9962 3462 p 2 0 2821 779 9924 3369 p 2 0 2543 1057 8299 3035 p 2 0 2604 996 8482 3062 p 2 0 2796 804 9709 3305 p 2 0 2837 763 9595 3342 p 2 0 2571 1029 8146 3021 p 2 0 3032 568 10998 3604 p 2 0 2679 921 9068 3184 p 2 0 3354 246 16508 4106 p 2 0 2999 601 11639 3621 p 2 0 3212 388 13372 3858 p 2 0 3004 596 10725 3553 p 2 0 2791 809 9742 3311 p 2 0 2814 786 9398 3308 p 2 0 2810 790 9733 3328 p 2 0 2713 887 9079 3235 p 2 0 2731 869 9501 3241 p 2 0 2588 1012 8770 3087 p 2 0 3176 424 11809 3901 p 2 0 3494 106 19170 4478 p 2 0 3310 290 14271 4038 p 2 0 3193 407 13694 3836 p 2 0 3187 413 12591 3896 p 2 0 3086 514 11508 3731 p 2 0 3035 565 11495 3693 p 2 0 3075 525 11287 3709 p 2 0 3035 565 11099 3648 p 2 0 3116 484 11614 3723 p 2 0 2995 605 10995 3611 p 2 0 3141 459 11464 3819 p 2 0 3001 599 10478 3644 p 2 0 3426 174 17276 4320 p 2 0 3241 359 13075 3983 p 2 0 3217 383 13145 3838 p 2 0 3257 343 13478 3965 p 2 22 3204 374 24688 4278 p 2 0 2920 680 11642 3476 p 2 0 3072 528 11995 3658 p 2 21 2719 860 20241 3614 p 2 0 3107 493 12676 3737 p 2 0 2184 1416 7333 2630 p 2 18 2853 729 20088 3695 p 2 0 3156 444 12015 3877 p 2 0 3092 508 12605 3755 p 2 18 3269 313 23927 4276 p 2 0 3263 337 13930 3978 p 2 0 3259 341 14714 4004 p 2 0 2958 642 11210 3580 p 2 0 3089 511 11688 3738 p 2 0 3102 498 11447 3695 p 2 0 3011 589 10904 3599 p 2 0 2958 642 10490 3538 p 2 0 3118 482 11703 3747 p 2 0 2886 714 9924 3457 p 2 0 3226 374 13926 3933 p 2 0 2886 714 10589 3453 p 2 0 3313 287 15017 4068 p 2 0 3181 419 12636 3907 p 2 0 3052 548 11221 3698 p 2 0 3131 469 12468 3847 p 2 0 2976 624 10596 3620 p 2 0 2961 639 10414 3547 p 2 0 2903 697 9896 3494 p 2 0 2913 687 9997 3499 p 2 0 2815 785 9314 3353 p 2 0 3099 501 11467 3818 p 2 0 2899 701 10291 3474 p 2 0 3408 192 17447 4271 p 2 0 3225 375 13632 3911 p 2 0 2957 643 11002 3472 p 2 0 2923 677 10740 3447 p 2 0 2889 711 10068 3422 p 2 0 3005 595 11444 3573 p 2 0 2990 610 10718 3563 p 2 0 2802 798 9510 3306 p 2 0 3066 534 10975 3611 p 2 0 2867 733 9869 3396 p 2 0 3174 426 12002 3898 p 2 0 2778 822 9205 3359 p 2 0 3417 183 17312 4263 p 2 0 3303 297 14669 4000 p 2 0 3011 589 11487 3574 p 2 0 3177 423 12302 3838 p 2 0 3110 490 12460 3761 p 2 0 2826 774 10106 3334 p 2 0 3182 418 13746 3813 p 2 90 2918 592 23211 4154 p 2 0 2732 868 10095 3253 p 2 0 2588 1012 8903 3087 p 2 74 2565 961 21226 3685 p 2 0 3137 463 11955 3873 p 2 0 3120 480 12619 3785 p 2 53 3334 213 29701 4707 p 2 0 3117 483 12838 3801 p 2 0 3256 344 14376 4003 p 2 0 3003 597 11507 3620 p 2 0 3061 539 11768 3721 p 2 0 2982 618 10930 3583 p 2 0 3165 435 13176 3827 p 2 0 3045 555 11482 3711 p 2 0 2929 671 10545 3483 p 2 0 2616 984 8677 3088 p 2 0 3038 562 11989 3666 p 2 0 3039 561 12266 3629 p 2 0 3323 277 15654 4071 p 2 0 2969 631 11418 3570 p 2 0 2835 765 10244 3361 p 2 0 2627 973 8803 3110 p 2 0 2713 887 9147 3209 p 2 0 2862 738 9983 3389 p 2 0 2969 631 10902 3533 p 2 0 2901 699 10189 3466 p 2 0 2046 1554 6507 2479 p 2 79 2694 827 22715 3895 p 2 0 3150 450 12296 3907 p 2 0 3181 419 13796 3887 p 2 14 3190 396 25134 4191 p 2 0 3214 386 13706 3813 p 2 20 3002 578 22657 3963 p 2 0 2842 758 10957 3409 p 2 0 2022 1578 6539 2465 p 2 9 2857 734 20609 3680 p 2 0 2726 874 9952 3256 p 2 0 2864 736 10495 3427 p 2 0 3035 565 11939 3612 p 2 0 2827 773 10451 3370 p 2 0 3196 404 12465 3949 p 2 0 3097 503 12195 3748 p 2 1 3329 270 15746 4022 p 2 0 3114 486 12483 3666 p 2 0 3212 388 13060 3903 p 2 1 3153 446 13020 3807 p 2 0 2885 715 9934 3430 p 2 0 3069 531 11726 3658 p 2 0 2827 773 10084 3361 p 2 0 2694 906 9183 3217 p 2 0 2853 747 9665 3382 p 2 0 2987 613 11289 3593 p 2 0 3158 442 11579 3873 p 2 0 3055 545 11952 3668 p 2 1 3345 254 15491 4112 p 2 0 3159 441 13088 3788 p 2 0 3156 444 12227 3796 p 2 1 3193 406 13500 3852 p 2 0 2850 750 10360 3346 i 2 3600 0 0 47262 12104 p 2 661 2800 139 40400 7277 p 2 0 2742 858 8628 3442 p 2 763 2234 603 41236 7027 p 2 494 2592 514 48512 7143 p 2 22 3059 519 22038 4657 p 2 0 3029 571 17946 4151 p 2 0 3019 581 16951 3915 p 2 0 3108 492 15643 3952 p 2 0 3008 592 15349 3828 p 2 0 3060 540 16668 3818 p 2 0 2818 782 14102 3515 p 2 0 2905 695 16349 3640 p 2 0 2967 633 16175 3653 p 2 0 2930 670 15185 3629 p 2 0 2840 760 15529 3485 p 2 0 2849 751 15014 3472 p 2 0 2998 602 12566 3596 p 2 0 2750 850 12106 3329 p 2 0 2874 726 13922 3384 p 2 0 2900 700 13323 3451 p 2 0 2738 862 13889 3288 p 2 0 2792 808 10321 3267 p 2 0 2623 977 7778 2984 p 2 0 2116 1484 5491 2471 p 2 0 2089 1511 5381 2411 p 2 0 1702 1898 5442 2060 p 2 0 1758 1842 5301 2068 p 2 0 1438 2162 3590 1795 p 2 0 2288 1312 8085 2653 p 2 0 2088 1512 5952 2512 p 2 0 2569 1031 8698 2946 p 2 0 2417 1183 6647 2800 p 2 0 1956 1644 6047 2265 p 2 0 750 2850 2555 1146 p 2 0 1611 1989 4178 1939 p 2 0 1239 2361 3458 1602 p 2 0 1445 2155 4805 1797 p 2 0 1279 2321 3259 1646 p 2 0 2376 1224 8457 2979 i 2 3600 0 0 51023 12734 p 2 1631 1923 46 85319 12488 p 2 897 2701 2 99016 11731 p 2 531 3067 2 92940 10530 p 2 408 3189 3 101774 10230 p 2 197 3402 1 84424 9528 p 2 29 3569 2 62007 7493 p 2 1 3593 6 50449 6655 p 2 0 3591 9 54331 6116 p 2 0 3590 10 44500 5612 p 2 0 3586 14 48693 5500 p 2 0 3583 17 36871 5052 p 2 0 3575 25 47362 5381 p 2 0 3563 37 32913 4890 p 2 0 3575 25 42951 5402 p 2 0 3572 28 38351 5217 p 2 0 3586 14 44943 5348 p 2 0 3551 49 31845 4823 p 2 0 3579 21 42132 5247 p 2 0 3569 31 35136 5031 p 2 0 3571 29 44211 5256 p 2 0 3579 21 38101 5048 p 2 0 3573 27 45870 5222 p 2 0 3558 42 33654 4965 p 2 0 3554 46 41773 5201 p 2 0 3557 43 28396 4892 p 2 0 3557 43 37866 5222 p 2 0 3554 46 27478 4769 p 2 0 3552 48 38201 5117 p 2 0 3509 91 29853 4767 p 2 0 3548 52 39457 5212 p 2 0 3540 60 32453 4906 p 2 0 3534 66 41413 5302 p 2 0 3554 46 30637 4871 p 2 0 3564 36 37365 5087 p 2 0 3567 33 25519 4586 p 2 0 3570 30 38245 5059 p 2 0 3555 45 24322 4581 p 2 0 3553 47 37627 5210 p 2 0 3564 36 27007 4774 p 2 0 3586 14 40279 5279 p 2 0 3576 24 27481 4762 p 2 0 3536 64 38857 5250 p 2 0 3570 30 30233 4904 p 2 0 3565 35 41022 5220 p 2 0 3581 19 36686 4957 p 2 0 3573 27 43399 5190 p 2 0 3558 42 28747 4628 p 2 0 3568 32 45189 5204 p 2 0 3565 35 32521 4932 p 2 0 3580 20 42361 5370 p 2 0 3532 68 35764 5114 p 2 0 3532 68 43738 5237 i 2 3600 0 0 129495 13367 p 2 0 3598 2 41344 4811 p 2 0 3544 56 25016 4587 p 2 0 3507 93 24156 4490 p 2 0 3338 262 15756 4110 p 2 1 3202 397 22389 3978 p 2 0 3013 587 12070 3582 p 2 0 3238 362 17842 3921 p 2 0 3278 322 17334 4141 p 2 0 2838 762 14815 3530 p 2 0 3436 164 19088 4300 p 2 0 3320 280 21588 4127 p 2 0 3432 168 21142 4351 p 2 0 3284 316 15879 4067 p 2 0 2505 1095 8762 2980 p 2 0 3169 431 16971 3853 p 2 0 3178 422 13552 3843 p 2 0 3123 477 16076 3807 p 2 0 3100 500 12578 3726 p 2 0 3038 562 15128 3680 p 2 0 3203 397 13864 3892 p 2 0 3102 498 16491 3744 p 2 0 3338 262 15930 4121 p 2 2 3202 396 21257 4069 p 2 0 3179 421 17102 3931 p 2 0 2218 1382 7617 2667 p 2 0 2578 1022 13018 3146 p 2 0 3179 421 16896 3892 p 2 0 2863 737 11277 3451 p 2 0 2945 655 18221 3627 p 2 0 2938 662 11416 3515 p 2 0 3010 590 15439 3679 p 2 0 3167 433 12565 3900 p 2 0 2847 753 14148 3519 p 2 0 3478 122 19334 4381 p 2 0 3233 367 18466 3969 p 2 0 3179 421 13606 3813 p 2 0 3133 467 16349 3741 p 2 0 2796 804 10635 3306 p 2 0 3239 361 17774 3949 p 2 0 3005 595 11773 3581 p 2 0 2765 835 13903 3305 p 2 0 2541 1059 8882 2981 p 2 0 2489 1111 12421 3006 p 2 0 2852 748 14045 3413 p 2 0 3540 60 33335 5200 i 2 3600 0 0 110443 13650 p 2 62 3525 13 45699 5872 p 2 0 3411 189 24054 4438 p 2 0 3136 464 13653 3838 p 2 0 2606 994 9001 3091 p 2 3 3393 204 39336 4974 p 2 0 3202 398 17661 4019 p 2 0 3242 358 18379 4132 p 2 0 2822 778 24523 3862 p 2 0 3137 463 18722 3945 p 2 0 3224 376 15791 4102 p 2 1 3124 475 31991 4464 p 2 0 3250 350 17605 4169 p 2 0 3308 292 22254 4214 p 2 0 3135 465 13597 3873 p 2 0 3266 334 18717 4090 p 2 0 2871 729 10812 3394 p 2 0 3152 448 17096 3885 p 2 4 3211 385 35604 4647 p 2 0 2935 665 13307 3540 p 2 0 2245 1355 8604 2690 p 2 0 3074 526 17678 3732 p 2 0 3008 592 27970 4092 p 2 0 3073 527 18471 3854 p 2 0 3309 291 23920 4426 i 2 3600 0 0 39916 11332 p 2 0 3240 360 11164 3647 p 2 97 1206 2297 8986 2189 p 2 0 809 2791 2700 1287 p 2 183 947 2470 9210 2284 p 2 0 948 2652 3104 1493 p 2 225 921 2454 6170 2399 p 2 19 1276 2305 26402 2688 p 2 0 803 2797 3275 1310 p 2 16 1043 2541 26874 2423 p 2 0 852 2748 4835 1418 p 2 0 797 2803 3428 1304 p 2 0 674 2926 2502 1146 p 2 0 681 2919 2643 1161 p 2 0 565 3035 2033 1029 p 2 0 458 3142 1609 918 p 2 13 665 2922 14855 1570 i 2 3600 0 0 55747 12737 p 2 0 3504 96 18731 4546 p 2 53 3495 52 40152 6048 p 2 1092 2275 233 76142 10641 p 2 27 2943 630 34261 5452 p 2 805 2687 108 83850 10205 p 2 19 3058 523 33890 5842 p 2 618 2754 228 79591 9265 p 2 11 2878 711 31768 5253 p 2 448 2831 321 78179 8469 p 2 7 3052 541 33855 5657 p 2 632 2659 309 72837 9037 p 2 18 3002 580 32129 5347 p 2 1329 2152 119 74291 11182 p 2 11 3170 419 31261 5936 p 2 524 2915 161 68413 9038 p 2 13 3085 502 31328 5515 p 2 536 2912 152 67507 8934 p 2 18 3130 452 33240 5624 p 2 1041 2398 161 77849 10447 p 2 16 2907 677 28599 5113 i 2 3600 0 0 56164 12382 p 2 19 3060 521 32589 4711 i 2 3600 0 0 51926 12402 p 2 27 3188 385 35432 5240 i 2 3600 0 0 45914 12157 p 2 24 3215 361 36464 5223 p 2 598 2896 106 50552 8178 p 2 15 2929 656 29640 5173 p 2 435 2757 408 54675 7883 p 2 16 2967 617 30198 5222 p 2 319 2934 347 53270 7502 p 2 16 3091 493 29251 5138 p 2 230 3079 291 56191 7211 p 2 18 3259 323 32279 5585 p 2 251 3226 123 57778 7464 p 2 32 3163 405 28362 5065 p 2 6 2953 641 24476 4413 p 2 21 2903 676 27259 4505 p 2 5 2800 795 23411 4246 p 2 22 3281 297 17723 4228 p 2 6 2737 857 14974 3580 p 2 21 2584 995 15019 3476 p 2 0 1984 1616 6638 2582 p 2 0 2031 1569 7803 2569 p 2 0 2550 1050 8251 3080 p 2 0 2641 959 10364 3423 i 2 3600 0 0 92936 13336 p 2 290 2914 396 35351 5679 p 2 0 3063 537 10865 3831 p 2 305 2602 693 25774 4984 p 2 0 2024 1576 5620 2528 p 2 646 2603 351 36286 6681 p 2 0 2708 892 10326 3442 p 2 353 2840 407 35698 5955 p 2 0 2829 771 10351 3508 p 2 409 2561 630 23562 5210 p 2 0 3035 565 11693 3828 p 2 222 2709 669 18328 4579 p 2 0 2779 821 9425 3434 p 2 94 2638 868 15045 3844 p 2 0 2857 743 9579 3502 p 2 25 2851 724 11219 3643 p 2 0 2014 1586 5267 2447 p 2 0 2951 649 11017 3639 p 2 0 2678 922 7943 3180 p 2 0 2934 666 9856 3507 p 2 0 2439 1161 7296 2919 p 2 0 2679 921 7999 3185 p 2 0 2040 1560 5480 2499 p 2 0 2219 1381 5703 2686 p 2 354 2297 949 21957 4462 p 2 0 2412 1188 8406 3005 p 2 0 2084 1516 6008 2558 p 2 775 2219 606 43506 6937 p 2 0 2645 955 8402 3313 i 2 3600 0 0 73911 12778 p 2 1 3036 563 12244 3765 i 2 3600 0 0 74156 12797 p 2 0 2936 664 13512 3826 i 2 3600 0 0 75259 12711 p 2 0 2992 608 11185 3717 p 2 855 2242 503 47666 7327 p 2 413 2696 491 31871 5676 p 2 0 2937 663 11101 3658 p 2 0 2152 1448 5911 2635 p 2 257 2310 1033 20055 4111 p 2 0 2379 1221 7007 2919 p 2 49 2784 767 11799 3636 p 2 0 2730 870 8432 3273 p 2 0 3005 595 10241 3625 p 2 0 2479 1121 7296 2964 p 2 0 2656 944 8517 3180 p 2 0 2603 997 7245 3107 p 2 0 2418 1182 6371 2890 p 2 140 2412 1048 11328 3592 p 2 0 2487 1113 7031 3047 p 2 0 1895 1705 4954 2372 p 2 306 2149 1145 18999 4218 p 2 0 2383 1217 6780 2945 p 2 526 2354 720 33795 5756 p 2 0 2599 1001 9800 3258 p 2 641 2319 640 36742 6111 p 2 4 2912 684 12107 3733 p 2 291 2523 786 24879 4752 p 2 0 2878 722 10463 3533 p 2 157 2435 1008 16506 3979 p 2 0 2676 924 8431 3211 p 2 0 2653 947 8732 3194 p 2 0 2488 1112 7545 3013 p 2 0 2576 1024 7994 3133 p 2 75 2682 843 14340 3657 p 2 0 2531 1069 7906 3067 p 2 0 2624 976 7983 3170 p 2 478 2477 645 26965 5205 p 2 0 2723 877 9915 3371 i 2 3600 0 0 73388 12654 p 2 0 3089 511 11456 3809 i 2 3600 0 0 72097 12701 i 2 3600 0 0 84654 13073 p 2 9 3229 362 15204 4355 p 2 0 3344 256 20129 4743 i 2 3600 0 0 88780 13312 p 2 0 3002 598 10855 3656 p 2 1477 2115 8 94527 12185 p 2 0 3033 567 13850 4335 p 2 0 2747 853 11582 3638 p 2 680 2860 60 82616 9927 p 2 0 2726 874 10122 3751 p 2 0 2861 739 11477 3579 p 2 612 2903 85 82787 9791 p 2 0 3166 434 13814 4377 p 2 259 3233 108 77852 8675 p 2 0 3246 354 17576 4712 p 2 0 2907 693 12667 3796 p 2 220 3339 41 77696 8574 p 2 0 3188 412 15967 4561 p 2 0 3075 525 12481 4023 p 2 0 2485 1115 8487 3052 p 2 531 3015 54 80617 9397 p 2 0 3165 435 15261 4460 p 2 0 2746 854 9760 3384 p 2 595 2946 59 82912 9589 p 2 0 3214 386 15415 4563 p 2 0 2721 879 10468 3553 p 2 558 2962 80 85492 9596 p 2 0 3165 435 16871 4572 p 2 280 3284 36 85477 9118 p 2 0 3099 501 15925 4627 p 2 0 3084 516 11728 4112 p 2 0 2470 1130 9099 3199 p 2 675 2871 54 83831 10002 p 2 0 2798 802 11228 3909 p 2 0 2971 629 12187 3913 p 2 615 2917 68 83131 9842 p 2 0 3142 458 13405 4313 p 2 0 2849 751 11750 3588 p 2 588 2940 72 80920 9700 p 2 0 3228 372 17983 4709 p 2 222 3325 53 77765 8664 p 2 0 3136 464 14773 4466 p 2 0 3039 561 11673 3990 p 2 0 2383 1217 8258 3073 p 2 531 2993 76 80943 9452 p 2 0 2758 842 10621 3818 p 2 0 2899 701 11212 3629 p 2 581 2967 52 82290 9619 p 2 0 3140 460 14318 4435 p 2 0 2733 867 9665 3404 p 2 556 2968 76 85227 9630 p 2 0 3154 446 16402 4548 p 2 282 3268 50 85400 9087 p 2 0 3116 484 15978 4636 p 2 0 3050 550 11701 4236 p 2 0 2474 1126 8752 3198 p 2 679 2835 86 83573 9931 p 2 0 2837 763 10893 3918 p 2 0 2976 624 11921 3901 i 2 3600 0 0 89306 13328 p 2 0 2797 803 9571 3382 p 2 0 2542 1058 7853 3053 p 2 532 3002 66 80293 9434 p 2 0 3147 453 16397 4535 p 2 0 2725 875 10030 3420 p 2 515 3028 57 79340 9324 p 2 0 3230 370 15276 4591 p 2 0 2824 776 10618 3724 p 2 2 2794 804 10211 3497 p 2 0 2824 776 9878 3408 p 2 0 2447 1153 8781 3041 i 2 3600 0 0 93820 13639 p 2 0 2806 794 10736 3450 p 2 1196 2363 41 89041 11372 p 2 0 3270 330 16801 4804 p 2 0 2848 752 11606 3697 p 2 1120 2441 39 85900 11185 p 2 0 3251 349 17149 4826 p 2 0 3028 572 11736 4058 p 2 0 2340 1260 7635 2910 p 2 532 3013 55 80674 9421 p 2 0 2818 782 10913 3938 p 2 0 3061 539 14491 4090 i 2 3600 0 0 93856 13608 p 2 13 3291 296 23504 4627 p 2 6 3076 518 13409 3824 p 2 1741 1815 44 88509 12427 p 2 2 3274 324 18301 4878 p 2 1427 2163 10 94978 12299 p 2 0 3182 418 16083 4690 p 2 0 2937 663 11214 4081 p 2 0 2655 945 11809 3522 i 2 3600 0 0 85716 13293 p 2 0 2440 1160 7510 2987 p 2 0 2934 666 13063 3735 p 2 1758 1789 53 90779 12638 p 2 0 3294 306 19047 4673 p 2 0 2909 691 12210 3628 i 2 3600 0 0 81598 13201 p 2 0 3294 306 19216 4520 p 2 1770 1814 16 89350 12931 p 2 0 3214 386 15539 4690 p 2 0 2870 730 10074 3804 p 2 0 2629 971 9704 3297 i 2 3600 0 0 78575 13058 p 2 0 3005 595 11500 3740 p 2 0 2861 739 10634 3537 p 2 1729 1831 40 85444 12681 p 2 0 3008 592 12751 4026 p 2 0 2823 777 11387 3683 i 2 3600 0 0 78098 13086 p 2 0 3262 338 17071 4403 p 2 0 2863 737 9736 3464 p 2 1728 1845 27 85446 12901 p 2 0 3241 359 15483 4709 p 2 0 3150 450 13696 4303 i 2 3600 0 0 74435 12858 p 2 0 2902 698 11189 3606 p 2 0 2773 827 10691 3401 p 2 1667 1859 74 80086 12274 p 2 0 3242 358 17660 4615 i 2 3600 0 0 120407 13345 p 2 105 3284 211 39268 5530 p 2 0 3419 181 19765 4492 p 2 133 3231 236 37373 5335 p 2 111 3330 159 33763 5414 p 2 0 3535 65 24617 4625 p 2 0 2843 757 11205 3487 p 2 117 3018 465 29747 4811 p 2 0 2848 752 11238 3535 p 2 127 3186 287 34839 5231 p 2 0 2857 743 12166 3602 p 2 126 3003 471 33868 4954 p 2 0 3253 347 15595 4159 p 2 138 3084 378 30787 5017 p 2 0 3044 556 12980 3789 p 2 104 3004 492 28649 4685 p 2 125 3170 305 35197 5209 p 2 0 3440 160 17920 4439 p 2 0 2684 916 10271 3283 p 2 93 3205 302 35485 5126 p 2 0 2942 658 11686 3635 p 2 85 3117 398 32261 4804 p 2 0 3053 547 13720 3818 p 2 107 3009 484 29123 4695 p 2 0 3022 578 12689 3716 p 2 129 2814 657 32836 4744 p 2 0 2525 1075 10357 3185 p 2 118 2593 889 32333 4379 p 2 0 3246 354 13931 4117 p 2 120 2965 515 30764 4863 p 2 0 3423 177 17978 4402 p 2 120 3260 220 33546 5184 p 2 0 3310 290 15202 4219 p 2 140 3030 430 34285 5094 p 2 0 3156 444 15044 3966 p 2 125 3049 426 34399 5003 p 2 0 3168 432 14010 3991 p 2 109 3005 486 30720 4847 p 2 0 2873 727 11857 3580 p 2 87 2846 667 27829 4481 p 2 116 3114 370 34716 5164 p 2 0 3436 164 17576 4458 p 2 0 2436 1164 8902 3038 p 2 116 3118 366 35003 5099 p 2 0 3215 385 15187 4081 p 2 127 3046 427 31692 5009 p 2 0 2980 620 13196 3714 p 2 74 3161 365 31190 4822 p 2 0 3027 573 13138 3798 p 2 131 3053 416 34153 5106 p 2 0 2874 726 12532 3597 p 2 122 2941 537 33616 4850 i 2 3600 0 0 67194 12502 p 2 0 3397 203 18605 4618 p 2 2 3302 296 19026 4476 p 2 0 2814 786 9525 3479 p 2 17 2962 621 18999 4248 p 2 0 3098 502 12345 3828 p 2 29 2975 596 20518 4378 p 2 0 2861 739 9573 3450 p 2 0 2743 857 10083 3308 p 2 12 2919 669 19732 4261 p 2 0 2443 1157 7515 3081 p 2 0 3146 454 17458 4355 p 2 0 2602 998 8642 3253 p 2 0 2977 623 10938 3621 p 2 0 2285 1315 7133 2788 p 2 0 2892 708 16042 3908 p 2 0 2739 861 9503 3348 p 2 0 2197 1403 5987 2658 p 2 19 2948 633 19530 4297 p 2 0 2645 955 8044 3284 p 2 0 2950 650 16466 4043 p 2 0 3351 249 20533 4959 i 2 3600 0 0 89027 14205 p 2 275 3310 15 53930 9104 p 2 352 3133 115 53437 9103 p 2 346 2950 304 53483 8752 p 2 257 3133 210 53811 8743 p 2 256 3071 273 54998 8774 p 2 231 3071 298 51708 8419 p 2 483 3109 8 108334 11667 p 2 225 3327 48 61128 9233 p 2 1164 2429 7 95298 12965 p 2 204 3347 49 60936 9235 i 2 3600 0 0 26658 11346 p 2 45 3338 217 18191 4866 i 2 3600 0 0 37247 12181 p 2 31 2680 889 16619 3917 i 2 3600 0 0 98081 15692 p 2 103 3440 57 58932 7569 i 2 3600 0 0 109595 15895 p 2 149 3141 310 57685 7629 p 2 236 3348 16 103974 9938 p 2 137 3294 169 66435 8198 p 2 175 3415 10 95304 9652 p 2 142 3337 121 62843 8150 p 2 175 3416 9 103809 10009 p 2 236 3295 69 69379 8912 p 2 265 3318 17 106487 10479 p 2 276 3252 72 69459 9098 p 2 220 3369 11 98587 10400 p 2 295 3300 5 85312 10233 i 2 3600 0 0 129877 13741 p 2 122 2854 624 38901 5032 p 2 0 3150 450 16472 3977 p 2 203 3001 396 41652 5326 p 2 0 3067 533 13827 3739 p 2 188 2992 420 37669 5047 p 2 0 3021 579 15496 3757 p 2 164 2735 701 34931 4561 p 2 157 3087 356 29984 4967 p 2 0 2742 858 11188 3394 p 2 0 3104 496 13432 3770 p 2 104 3245 251 26980 4965 p 2 0 3112 488 14107 3861 p 2 99 2690 811 20322 4230 p 2 0 3506 94 21352 4645 p 2 125 3269 206 28184 5205 p 2 0 3375 225 16412 4288 p 2 128 3144 328 24311 4981 p 2 0 3359 241 16759 4351 p 2 120 3227 253 27177 5148 p 2 196 3243 161 31172 5608 p 2 0 3067 533 13650 3879 p 2 0 2913 687 10878 3529 p 2 226 3215 159 33319 5824 p 2 0 3072 528 12542 3848 p 2 305 2840 455 31352 5686 p 2 3 2778 819 10624 3457 p 2 139 2804 657 29920 4974 p 2 0 2727 873 9967 3386 p 2 87 2519 994 24784 4300 p 2 0 2976 624 12591 3731 p 2 69 3164 367 27126 4887 p 2 0 3050 550 13009 3803 p 2 86 3212 302 26153 5028 p 2 0 3174 426 13207 3970 p 2 0 3503 97 19652 4575 p 2 26 3316 258 25985 4683 p 2 0 3196 404 13866 3969 p 2 0 3342 258 15172 4160 p 2 47 2974 579 23825 4230 p 2 0 3108 492 12920 3763 p 2 27 2901 672 22384 4045 p 2 0 3024 576 12373 3650 p 2 0 3186 414 14453 3889 p 2 0 3016 584 11560 3639 p 2 26 3187 387 24951 4499 p 2 0 2902 698 11158 3563 p 2 0 3357 243 16894 4189 p 2 32 3258 310 25426 4506 p 2 0 3374 226 16889 4172 p 2 0 2465 1135 8728 2915 p 2 15 2962 623 18375 3776 p 2 0 2943 657 10886 3519 p 2 0 3130 470 13249 3741 p 2 8 2856 736 15630 3582 p 2 0 2886 714 10864 3438 p 2 0 2984 616 12044 3564 p 2 7 3131 462 17644 3982 p 2 0 3197 403 15937 3882 p 2 0 3242 358 16877 3964 p 2 2 3311 287 19839 4244 p 2 0 3316 284 15483 4063 p 2 0 3083 517 12722 3719 p 2 21 3063 516 15581 4067 i 2 3600 0 0 56664 12068 p 2 0 3099 501 12974 4133 p 2 1107 2274 219 48561 8691 p 2 0 3259 341 13154 4614 p 2 622 2764 214 46635 7745 p 2 409 3021 170 48840 7717 p 2 0 3215 385 14009 4711 p 2 42 3169 389 23091 5281 p 2 0 2769 831 9367 3803 p 2 263 2756 581 28258 5805 p 2 0 2948 652 11055 4122 p 2 4 2964 632 21919 4724 p 2 0 2664 936 8860 3618 p 2 4 2960 636 17961 4268 p 2 0 2649 951 8754 3359 p 2 3 2861 736 17631 4133 p 2 20 2900 680 19207 4430 p 2 0 2838 762 8672 3619 p 2 0 2089 1511 5607 2633 p 2 34 2786 780 19431 4365 p 2 0 2243 1357 7562 2923 p 2 46 2604 950 19407 4180 p 2 0 2736 864 9313 3529 p 2 53 2710 837 19308 4277 p 2 0 2626 974 9192 3380 i 2 3600 0 0 146779 13618 p 2 0 3562 38 25498 4771 p 2 0 3430 170 16325 4314 p 2 0 3337 263 15426 4104 p 2 0 3338 262 14395 4197 p 2 0 2739 861 9135 3320 p 2 0 3485 115 22670 4416 p 2 0 2971 629 11463 3563 p 2 0 2767 833 10259 3329 p 2 0 2813 787 10167 3386 p 2 0 2540 1060 8734 3021 p 2 0 3085 515 12595 3690 p 2 0 3340 260 14836 4126 p 2 0 3157 443 12481 3802 p 2 0 3077 523 12152 3657 p 2 0 3110 490 11845 3705 p 2 0 3296 304 14328 3983 p 2 0 3056 544 11738 3628 p 2 0 3409 191 18707 4226 p 2 0 2985 615 11440 3550 p 2 0 2763 837 9896 3289 p 2 0 2971 629 10882 3504 p 2 0 2798 802 9573 3293 p 2 0 3147 453 12501 3741 p 2 0 2930 670 10397 3465 p 2 0 2866 734 10060 3397 p 2 0 2744 856 9217 3214 p 2 0 2739 861 9471 3242 p 2 0 3196 404 12458 3950 p 2 0 2865 735 9795 3453 p 2 0 3426 174 17916 4228 p 2 0 3348 252 16298 4060 p 2 0 3317 283 14772 4057 p 2 0 3137 463 12319 3785 p 2 0 2942 658 11139 3529 p 2 0 3165 435 12679 3837 p 2 0 3149 451 12273 3774 p 2 0 3065 535 11680 3708 p 2 0 2843 757 10140 3352 p 2 0 2895 705 10412 3464 p 2 0 3187 413 12361 3925 p 2 0 2926 674 10308 3511 p 2 0 3427 173 17219 4242 p 2 0 3219 381 13146 3855 p 2 0 3353 247 15953 4155 p 2 0 3336 264 15589 4072 p 2 0 2987 613 11311 3564 p 2 0 3060 540 11453 3663 p 2 0 2895 705 10331 3449 p 2 0 3065 535 11705 3587 p 2 0 2938 662 10668 3428 p 2 0 2790 810 9747 3291 p 2 0 3140 460 11764 3855 p 2 0 2764 836 9412 3375 p 2 0 3406 194 17158 4199 p 2 0 3298 302 14777 4043 p 2 0 3256 344 13320 3969 p 2 0 3312 288 15228 4050 p 2 0 2945 655 11258 3486 p 2 0 3245 355 13846 3925 p 2 0 3159 441 12365 3798 p 2 0 3003 597 11080 3608 p 2 0 2728 872 9676 3234 p 2 0 2872 728 10138 3430 p 2 0 3256 344 13915 4051 p 2 0 3527 73 26885 4605 p 2 0 3422 178 23817 4777 i 2 3600 0 0 146385 14533 p 2 0 3102 498 11056 3661 p 2 0 3518 82 32457 4786 p 2 0 3400 200 18764 4203 p 2 0 3354 246 15847 4099 p 2 1 2836 763 23827 3784 p 2 0 3305 295 14797 4003 p 2 0 2261 1339 7641 2680 p 2 2 2752 846 23881 3730 p 2 0 3197 403 12300 3954 p 2 0 3256 344 15067 3943 p 2 0 3415 185 27840 4473 p 2 0 2926 674 11413 3483 p 2 1 3465 134 30244 4653 p 2 0 3329 271 15416 4031 p 2 0 3354 246 15779 4132 p 2 0 3183 417 13119 3821 p 2 0 3021 579 11122 3574 p 2 0 3347 253 15176 4069 p 2 0 3197 403 12717 3779 p 2 0 3380 220 16681 4077 p 2 0 3151 449 12957 3687 p 2 0 3395 205 18558 4329 i 2 3600 0 0 57965 13278 p 2 166 3417 17 48847 7421 p 2 261 2975 364 53231 7260 p 2 7 2897 696 28864 5053 p 2 10 2789 801 26578 4604 p 2 127 2932 541 39580 5619 p 2 3 2811 786 26314 4473 p 2 1 2764 835 23429 4201 p 2 77 2968 555 35211 5279 p 2 0 2727 873 22528 4291 p 2 2 2529 1069 22406 4048 p 2 285 2757 558 41457 6076 p 2 0 2542 1058 21912 4276 p 2 1 2522 1077 20510 4070 p 2 133 2745 722 33248 5411 p 2 3 2619 978 19186 4167 p 2 2 2356 1242 17993 3741 p 2 112 2892 596 32447 5254 p 2 4 2562 1034 21412 4022 p 2 1 2540 1059 18555 3737 p 2 63 2876 661 34163 5043 p 2 2 2680 918 19742 4136 p 2 1 2382 1217 18648 3680 p 2 247 2825 528 33653 5664 p 2 9 2432 1159 20690 3972 p 2 1 2542 1057 19380 3772 p 2 387 2638 575 38043 6285 p 2 6 2770 824 21117 4350 p 2 4 2483 1113 17802 3782 i 2 3600 0 0 48413 12371 p 2 7 2558 1035 22177 3762 p 2 3 2258 1339 18438 3261 p 2 469 2462 669 42228 6771 p 2 0 2624 976 21152 4340 p 2 0 2339 1261 18293 3566 p 2 454 2438 708 45009 6771 p 2 2 2606 992 21252 4330 p 2 1 2220 1379 18569 3512 p 2 740 2376 484 46499 7614 p 2 9 2818 773 20791 4450 p 2 1 2428 1171 16213 3662 p 2 660 2347 593 49051 7748 p 2 7 2885 708 21166 4682 p 2 5 2533 1062 17120 3845 p 2 823 2447 330 50848 8332 p 2 4 2974 622 18050 4473 p 2 3 2732 865 14395 3816 p 2 623 2627 350 46790 7604 p 2 12 2974 614 20588 4645 p 2 4 2573 1023 17330 3829 i 2 3600 0 0 56756 12759 p 2 9 2602 989 23834 4083 p 2 0 2406 1194 18166 3567 p 2 524 2504 572 57169 7293 p 2 2 2705 893 20222 4216 p 2 1 2571 1028 17864 3705 p 2 592 2592 416 63079 7996 p 2 3 2932 665 23217 4578 p 2 2 2673 925 20213 3897 p 2 796 2522 282 72039 8988 p 2 5 3041 554 27595 5098 p 2 1 2819 780 23198 4422 p 2 346 2988 266 71755 7964 p 2 3 3104 493 27835 4996 p 2 2 2892 706 25449 4443 p 2 412 2981 207 77777 8278 p 2 4 3087 509 30334 5114 p 2 6 3005 589 28089 4542 p 2 307 3075 218 74273 7835 p 2 3 3155 442 32114 5201 p 2 3 2928 669 27412 4494 p 2 250 3155 195 73032 7641 p 2 8 3045 547 31271 5164 p 2 5 2804 791 26310 4420 p 2 165 3309 126 67943 7295 p 2 8 3061 531 28520 5022 p 2 11 2671 918 26225 4186 p 2 115 3323 162 64529 6975 p 2 7 2838 755 24849 4544 p 2 7 2592 1001 21921 3820 p 2 176 3207 217 64116 7201 p 2 9 2998 593 22858 4585 p 2 11 2590 999 19938 3805 p 2 90 3312 198 55220 6491 p 2 7 2957 636 22237 4454 p 2 3 2584 1013 19457 3698 p 2 76 3247 277 55181 6402 p 2 2 2997 601 24345 4555 p 2 3 2418 1179 19436 3488 p 2 47 3278 275 52541 6158 p 2 1 2785 814 22351 4077 p 2 2 2249 1349 18258 3303 i 2 3600 0 0 64411 13129 p 2 3 2695 902 23626 4126 p 2 2 2555 1043 20584 3644 p 2 1319 2036 245 80053 10877 p 2 0 2943 657 26509 4806 p 2 0 2550 1050 21628 3817 i 2 3600 0 0 84011 14143 p 2 2 3259 339 33216 5148 p 2 1 3095 504 25850 4566 p 2 1407 1952 241 92890 11400 p 2 0 3212 388 28711 5011 p 2 0 2979 621 21269 4232 p 2 1685 1688 227 94224 12234 p 2 0 2683 917 12766 3701 p 2 0 2891 709 13613 3792 p 2 1056 2097 447 90241 10233 p 2 0 2978 622 17517 4253 p 2 633 2507 460 83159 8861 p 2 0 2789 811 17548 4297 p 2 0 2320 1280 10413 3320 p 2 0 2272 1328 9413 3053 p 2 480 2551 569 74143 7807 p 2 0 2807 793 15645 4075 p 2 0 2623 977 14221 3574 p 2 148 2699 753 60789 6024 p 2 0 2845 755 16683 4091 p 2 67 2653 880 56359 5399 p 2 0 2842 758 14863 4002 p 2 0 2452 1148 11626 3413 p 2 0 2402 1198 9972 3123 p 2 329 2302 969 56379 5957 p 2 0 2478 1122 13268 3350 p 2 0 2159 1441 8851 2891 p 2 425 2229 946 59097 6276 p 2 0 2240 1360 10029 3186 p 2 0 2346 1254 12137 3131 p 2 502 2034 1064 57923 6353 p 2 0 2440 1160 11588 3270 p 2 394 2113 1093 61423 6189 p 2 0 2298 1302 10663 3255 p 2 36 3073 491 20231 4543 p 2 921 2662 17 87374 10849 p 2 358 3206 36 53334 8454 p 2 403 3196 1 97284 10665 p 2 82 3500 18 53959 8034 p 2 70 3522 8 55077 7882 p 2 40 3493 67 48466 7125 p 2 22 3496 82 34613 6330 p 2 2 3425 173 28807 5571 p 2 3 3422 175 29115 5580 p 2 3 3186 411 26017 5115 i 2 3600 0 0 114465 13875 p 2 0 3187 413 14503 4081 p 2 0 3458 142 16536 4380 p 2 0 3382 218 13838 4159 p 2 0 3032 568 10497 3656 p 2 0 2927 673 9702 3508 p 2 0 3017 583 10282 3631 p 2 73 3063 464 18607 4131 p 2 0 2939 661 10459 3556 p 2 0 2198 1402 7473 2678 p 2 158 2807 635 25407 4398 p 2 0 3300 300 14210 4095 p 2 181 2792 627 31187 4643 p 2 0 3203 397 13445 4029 p 2 227 2837 536 36463 5070 p 2 270 3008 322 41963 5683 p 2 0 2615 985 10792 3279 p 2 0 2096 1504 6420 2559 p 2 160 2414 1026 32421 4305 p 2 0 2632 968 10984 3275 p 2 210 2542 848 38380 4843 p 2 0 2747 853 11124 3473 p 2 36 2663 901 32781 4210 p 2 0 3176 424 13122 3981 p 2 34 3054 512 33942 4721 p 2 0 3484 116 21541 4615 p 2 188 3196 216 42121 5720 p 2 0 2694 906 9542 3299 p 2 1 3187 412 24435 4323 p 2 0 2965 635 11917 3632 p 2 2 3215 383 23520 4301 p 2 24 2947 629 24956 4124 p 2 0 2899 701 11821 3507 p 2 0 2913 687 12792 3780 i 2 3600 0 0 83610 13386 p 2 4 3559 37 28018 5462 p 2 0 3322 278 13267 4349 p 2 15 3286 299 19103 4589 p 2 0 2978 622 9835 3795 p 2 10 3040 550 15407 4084 p 2 0 2882 718 9620 3670 p 2 10 2966 624 14885 3947 p 2 0 2821 779 9369 3567 p 2 5 2716 879 13070 3546 p 2 0 2636 964 7802 3265 p 2 15 2667 918 13587 3543 p 2 9 2789 802 14427 3746 p 2 0 2477 1123 7224 3110 p 2 0 2524 1076 7725 3112 p 2 9 2991 600 16314 3996 p 2 0 2453 1147 7476 3078 p 2 6 2634 960 13348 3450 p 2 0 2467 1133 7392 3060 p 2 14 2583 1003 13911 3427 i 2 3600 0 0 84306 13355 p 2 2037 1563 0 114274 14367 p 2 0 3382 218 17344 5049 p 2 1774 1826 0 147638 14457 p 2 1193 2407 0 139734 13103 p 2 390 3210 0 92215 9404 p 2 0 3428 172 19205 5464 p 2 0 2876 724 10830 4045 p 2 0 2279 1321 7379 2912 p 2 1 2145 1454 6804 2779 p 2 0 2060 1540 6353 2679 p 2 0 1837 1763 5797 2439 p 2 1 2133 1466 6813 2743 p 2 0 2337 1263 7648 2969 p 2 0 2225 1375 6992 2812 p 2 1 3208 391 13687 4156 p 2 0 2525 1075 7507 3163 p 2 0 3190 410 13628 4139 p 2 0 3166 434 12925 4086 p 2 0 3175 425 13294 4065 p 2 0 3064 536 11714 3884 p 2 1 2874 725 10578 3646 p 2 0 2826 774 9796 3546 p 2 0 2471 1129 7880 3071 p 2 0 2776 824 9589 3480 p 2 0 2675 925 8850 3343 p 2 0 2589 1011 8639 3263 p 2 0 2649 951 8696 3333 p 2 2 2966 632 10310 3758 p 2 0 2597 1003 8465 3245 p 2 0 2214 1386 6414 2756 p 2 0 2882 718 10031 3593 p 2 0 2524 1076 7828 3112 p 2 0 2385 1215 7644 2965 p 2 0 2578 1022 8755 3223 p 2 0 2087 1513 6750 2632 p 2 0 2339 1261 7394 2944 p 2 0 2282 1318 6996 2889 p 2 0 2347 1253 7128 2969 p 2 1 2490 1109 8036 3144 p 2 0 2201 1399 6826 2788 p 2 0 2785 815 9167 3485 p 2 0 2415 1185 7317 3027 p 2 0 2797 803 9896 3483 p 2 0 2388 1212 7511 2961 p 2 0 2305 1295 7316 2887 p 2 0 2636 964 8454 3286 p 2 1 2156 1443 6591 2704 p 2 0 2399 1201 7259 2972 p 2 0 2387 1213 7389 3007 p 2 0 2261 1339 7313 2856 p 2 23 2738 839 32351 4204 p 2 1 2813 786 10959 3580 p 2 27 2627 946 30978 4055 p 2 0 2303 1297 7561 2930 p 2 0 2739 861 10332 3473 p 2 0 2615 985 8815 3256 p 2 19 2645 936 29009 3995 p 2 0 2523 1077 9485 3221 p 2 0 2340 1260 7583 2920 p 2 5 2579 1016 13734 3426 p 2 0 2563 1037 8465 3214 p 2 0 2419 1181 7429 3016 p 2 9 2485 1106 13782 3338 p 2 0 2504 1096 8121 3127 p 2 0 2876 724 10130 3646 p 2 1 2502 1097 8338 3175 p 2 0 2813 787 10279 3541 p 2 0 2570 1030 8091 3192 p 2 1 2319 1280 7509 2899 p 2 0 2561 1039 8119 3160 p 2 1 2242 1357 7007 2794 p 2 0 2027 1573 5790 2553 p 2 0 2209 1391 6337 2780 p 2 0 2307 1293 6778 2893 p 2 0 2397 1203 7293 2990 p 2 0 2236 1364 6637 2817 p 2 0 2760 840 9292 3456 p 2 2 2377 1221 7470 2991 p 2 0 2732 868 9621 3396 p 2 0 2265 1335 7015 2821 p 2 2 2155 1443 6694 2720 p 2 0 2501 1099 7842 3085 p 2 0 2152 1448 6286 2672 p 2 2 2361 1237 7406 2925 p 2 0 2447 1153 7377 3045 p 2 0 2143 1457 6108 2683 p 2 2 2402 1196 7573 3042 p 2 0 2139 1461 6046 2701 p 2 0 2538 1062 7795 3138 p 2 2 2584 1014 8629 3242 p 2 0 2806 794 9730 3522 p 2 2 2671 927 9211 3331 p 2 0 2433 1167 7701 3025 p 2 0 1579 2021 4395 2054 p 2 1 1804 1795 5232 2300 p 2 0 2397 1203 7487 2975 p 2 0 2279 1321 6369 2839 p 2 0 2274 1326 6594 2842 p 2 1 2293 1306 7247 2892 p 2 3 2576 1021 8135 3209 p 2 0 2387 1213 7486 2965 p 2 0 2091 1509 6070 2596 p 2 1 2565 1034 8743 3207 p 2 0 1680 1920 4703 2160 p 2 1 2206 1393 6945 2745 p 2 0 2292 1308 6902 2856 p 2 0 1894 1706 5616 2401 p 2 1 1915 1684 5661 2422 p 2 0 1749 1851 5450 2305 p 2 0 2242 1358 6604 2800 p 2 0 2203 1397 6570 2769 p 2 0 2232 1368 6823 2803 i 2 3600 0 0 109424 14738 p 2 0 2714 886 10587 3529 p 2 802 2789 9 129203 12000 p 2 536 3058 6 124604 11114 i 2 3600 0 0 81094 13410 i 2 3600 0 0 74364 13119 i 2 3600 0 0 82409 13028 i 2 3600 0 0 86159 13384 p 2 1344 2256 0 122462 14098 p 2 1367 2233 0 112776 13814 p 2 1255 2345 0 106696 13107 p 2 483 3059 58 92560 10580 p 2 838 2645 117 107784 11964 p 2 663 2685 252 87614 10728 p 2 1004 2389 207 105121 12534 p 2 741 2566 293 94726 11347 p 2 995 2568 37 120926 12967 p 2 729 2749 122 103318 11453 p 2 820 2774 6 127466 12709 p 2 668 2887 45 110987 11974 p 2 1045 2544 11 143842 13922 p 2 781 2793 26 128830 12473 p 2 1091 2508 1 146200 13851 p 2 626 2973 1 124851 12395 i 2 3600 0 0 79675 14779 p 2 207 3289 104 54506 9674 p 2 158 3253 189 54327 9385 p 2 176 3267 157 64707 10103 p 2 200 3211 189 64323 9961 p 2 281 3147 172 64426 10216 p 2 203 3202 195 68424 10240 p 2 183 3257 160 66628 10327 p 2 196 3213 191 65246 10061 p 2 167 3223 210 66314 10195 p 2 223 3170 207 67164 10281 p 2 159 3250 191 61012 9542 p 2 202 3365 33 67182 10564 p 2 193 3301 106 61239 10185 p 2 221 3352 27 62663 10479 p 2 176 3361 63 61353 10068 p 2 225 3283 92 61707 10357 p 2 246 3302 52 68666 10784 p 2 238 3293 69 67069 10545 p 2 165 3369 66 64086 10080 p 2 179 3290 131 63563 9974 p 2 193 3297 110 65259 10291 p 2 223 3271 106 67330 10479 p 2 281 3203 116 67562 10658 p 2 237 3315 48 68087 10852 p 2 251 3263 86 63777 10559 p 2 221 3346 33 63713 10485 p 2 200 3333 67 63071 10420 p 2 222 3298 80 61166 10263 p 2 174 3316 110 58702 9859 p 2 166 3288 146 62589 10082 p 2 158 3357 85 64606 10327 p 2 208 3236 156 70331 10604 p 2 217 3263 120 66956 10544 p 2 310 3140 150 67820 10742 p 2 221 3198 181 63696 10283 p 2 236 3292 72 62797 10196 p 2 231 3239 130 62266 10409 p 2 178 3384 38 65354 10552 p 2 222 3334 44 70031 10897 p 2 167 3349 84 64641 10228 p 2 205 3304 91 68258 10667 p 2 217 3291 92 62050 10154 p 2 537 3039 24 82670 12381 p 2 354 3216 30 80230 11607 i 2 3600 0 0 80507 15106 p 2 1630 1954 16 87249 14173 p 2 969 2609 22 78628 12104 p 2 382 3187 31 66536 9743 p 2 253 3107 240 58923 8088 p 2 221 3047 332 48435 6718 p 2 90 2997 513 32745 5277 p 2 6 2925 669 15275 4082 p 2 0 2970 630 12380 3653 p 2 0 2623 977 8516 3214 p 2 0 2910 690 11786 3622 p 2 0 2613 987 8478 3210 p 2 0 2893 707 10530 3530 p 2 0 2769 831 9790 3361 p 2 0 3473 127 18464 4647 p 2 0 3266 334 14121 4103 p 2 0 3332 268 15426 4270 p 2 0 2674 926 9368 3197 p 2 0 3148 452 12630 3848 p 2 0 2846 754 9727 3436 p 2 0 3148 452 12443 3855 p 2 0 2851 749 9821 3429 p 2 0 2982 618 11198 3622 p 2 0 2981 619 10387 3635 p 2 0 2125 1475 6472 2589 p 2 0 2714 886 8716 3264 p 2 0 2880 720 9854 3519 p 2 0 2825 775 9757 3420 p 2 0 2409 1191 7570 2913 p 2 0 2875 725 10542 3505 p 2 0 2841 759 9705 3406 p 2 0 2922 678 10229 3523 p 2 0 2571 1029 8038 3070 p 2 0 2789 811 8967 3354 p 2 0 2601 999 8203 3180 p 2 0 2620 980 8075 3163 p 2 0 2716 884 9193 3289 p 2 0 2764 836 8810 3348 p 2 0 2943 657 10382 3600 p 2 0 2611 989 8115 3132 p 2 0 2286 1314 7106 2753 p 2 0 2866 734 10745 3493 p 2 0 2646 954 8569 3199 p 2 0 2880 720 10454 3488 p 2 0 2634 966 8604 3175 p 2 0 2525 1075 7905 3014 p 2 5 2578 1017 8655 3155 p 2 45 2683 872 28603 3921 p 2 0 2742 858 10836 3336 p 2 0 2758 842 9248 3374 p 2 15 2959 626 29408 4179 p 2 0 1995 1605 6298 2464 p 2 0 3139 461 12674 3904 p 2 0 2279 1321 7665 2763 p 2 9 2862 729 26901 3867 p 2 0 2873 727 10911 3509 p 2 0 2010 1590 6831 2483 p 2 18 2754 828 27290 3847 p 2 0 2811 789 10938 3439 p 2 0 2795 805 10271 3427 p 2 0 2660 940 9281 3252 p 2 0 2800 800 9950 3424 p 2 0 1854 1746 5463 2294 p 2 0 2750 850 10092 3365 p 2 0 3255 345 16225 4121 p 2 0 2375 1225 7970 2861 p 2 0 2927 673 11056 3565 p 2 0 2833 767 10288 3419 p 2 0 2754 846 9234 3294 p 2 0 2752 848 9631 3294 p 2 0 2643 957 8893 3175 p 2 0 2637 963 8820 3128 p 2 0 2661 939 9100 3165 p 2 0 2574 1026 8108 3077 p 2 0 2617 983 9134 3143 p 2 0 2985 615 10490 3701 p 2 0 3251 349 13717 4089 p 2 0 2953 647 11103 3615 p 2 0 2570 1030 8657 3143 p 2 0 2562 1038 8617 3058 p 2 0 2559 1041 8429 3065 p 2 0 2584 1016 8665 3077 p 2 0 2354 1246 7237 2826 p 2 0 2389 1211 7511 2908 p 2 0 2718 882 9048 3299 p 2 0 2504 1096 7859 3027 p 2 0 2909 691 11037 3565 p 2 0 2581 1019 8323 3118 p 2 0 3114 486 12194 3840 p 2 0 2160 1440 6833 2613 p 2 0 2629 971 8780 3168 p 2 0 2435 1165 7905 2942 p 2 0 2782 818 9777 3346 p 2 0 2677 923 8734 3231 p 2 0 2613 987 8281 3163 p 2 0 2659 941 8620 3250 p 2 0 2557 1043 8375 3138 p 2 0 2732 868 8664 3331 p 2 0 2839 761 9709 3435 p 2 0 2619 981 8415 3153 p 2 0 3042 558 11948 3730 p 2 0 2001 1599 6303 2442 p 2 0 2734 866 9331 3284 p 2 0 2580 1020 8543 3108 p 2 0 2569 1031 8299 3101 p 2 0 2657 943 8818 3180 p 2 0 2386 1214 7355 2880 p 2 0 2496 1104 7733 3026 p 2 0 2525 1075 7543 3035 p 2 0 2493 1107 7704 3010 p 2 0 2676 924 8717 3317 p 2 0 2521 1079 7708 3100 p 2 0 3344 256 18964 4291 p 2 0 2616 984 9531 3181 p 2 0 2749 851 10282 3358 p 2 0 3181 419 13247 3938 p 2 0 2241 1359 7277 2707 p 2 0 2925 675 10576 3531 p 2 0 2876 724 10000 3480 p 2 0 2766 834 9328 3343 p 2 0 3031 569 10948 3714 p 2 0 3415 185 25189 4953 i 2 3600 0 0 117505 12847 p 2 6 3556 38 39396 5064 p 2 0 3485 115 17992 4388 p 2 13 3419 168 30114 4536 p 2 0 3117 483 13953 3692 p 2 53 3063 484 28286 4280 p 2 0 2711 889 9086 3228 p 2 9 2651 940 23158 3407 p 2 0 2486 1114 7662 2911 p 2 3 2555 1042 21565 3272 p 2 0 2422 1178 9027 2849 p 2 88 2695 817 27544 3783 p 2 0 1872 1728 5946 2251 p 2 5 3096 499 25395 3940 p 2 0 2948 652 11510 3506 p 2 13 3328 259 30606 4296 p 2 0 2929 671 13672 3423 p 2 7 2715 878 24170 3496 p 2 0 2535 1065 9171 2957 p 2 8 2983 609 25728 3743 p 2 0 3004 596 12012 3522 p 2 7 2954 639 25610 3762 p 2 0 3130 470 13913 3656 p 2 0 3200 400 16513 4019 i 2 3600 0 0 139727 13623 p 2 41 3520 39 37090 5284 p 2 52 3085 463 27610 4350 p 2 48 3347 205 28719 4618 p 2 0 2943 657 11872 3506 p 2 80 2973 547 34107 4384 p 2 0 2868 732 12155 3440 p 2 82 2170 1348 23885 3304 p 2 23 2635 942 22927 3561 p 2 91 2478 1031 34266 3862 p 2 0 2542 1058 9598 3049 p 2 90 3024 486 35149 4507 p 2 1 3599 0 42588 4565 p 2 47 3553 0 57652 5226 p 2 0 3600 0 45133 4926 p 2 0 3600 0 43755 4908 p 2 0 3600 0 47544 4973 p 2 2 3597 1 51564 4857 p 2 0 3600 0 42527 4840 p 2 37 3561 2 61289 5097 p 2 0 3517 83 23963 4380 p 2 32 3359 209 29225 4591 p 2 0 3378 222 17410 4082 p 2 68 3169 363 33134 4506 p 2 45 3367 188 34241 4835 p 2 0 2898 702 11800 3531 p 2 0 3085 515 12533 3632 p 2 32 3447 121 30858 4639 p 2 0 3266 334 15231 3969 p 2 17 3211 372 26747 4267 p 2 0 3442 158 18412 4262 p 2 17 3180 403 22041 4108 p 2 2 3269 329 24896 4124 p 2 0 3277 323 15148 3946 p 2 0 2673 927 10099 3126 p 2 0 2939 661 17222 3508 p 2 0 3269 331 13615 4034 p 2 0 2902 698 10416 3503 p 2 0 3453 147 18810 4348 p 2 0 3309 291 14505 4087 p 2 0 3202 398 12744 3865 p 2 0 3151 449 12748 3827 p 2 0 3208 392 12966 3893 p 2 0 2882 718 10390 3409 p 2 0 3366 234 15572 4133 p 2 0 3199 401 12686 3849 p 2 0 3111 489 11861 3730 p 2 0 3144 456 12608 3797 p 2 0 3318 282 14880 4038 p 2 0 3061 539 12150 3613 p 2 0 3461 139 21227 4288 p 2 0 3329 271 15334 4114 p 2 0 3041 559 11626 3659 p 2 0 2744 856 9895 3251 i 2 3600 0 0 10777 9979 p 2 659 2493 448 12422 5669 i 2 3600 0 0 118575 14703 p 2 82 3518 0 36520 6057 p 2 0 3349 251 15327 4183 p 2 0 3340 260 16168 4216 p 2 0 3120 480 11240 3794 p 2 0 3244 356 13148 4071 p 2 0 3274 326 16415 4158 p 2 0 3246 354 13981 3976 p 2 0 3131 469 12881 3788 p 2 0 3031 569 10363 3669 p 2 0 3071 529 11225 3719 p 2 0 3033 567 10750 3680 p 2 0 3092 508 12337 3783 p 2 0 2998 602 10653 3659 p 2 0 2877 723 10063 3489 p 2 0 2704 896 8583 3233 p 2 0 2972 628 10537 3572 p 2 0 2901 699 10794 3462 p 2 0 3109 491 11945 3782 p 2 0 2986 614 11013 3595 p 2 0 2607 993 7887 3038 p 2 0 2676 924 8592 3148 p 2 0 2679 921 8728 3227 p 2 0 2771 829 9413 3288 p 2 0 2420 1180 7002 2852 p 2 0 2536 1064 7461 3005 p 2 0 2501 1099 7331 2940 p 2 0 2451 1149 6977 2895 p 2 0 2390 1210 6700 2846 p 2 0 2886 714 9063 3510 p 2 0 3247 353 17045 4088 p 2 0 3062 538 12599 3711 p 2 0 2682 918 8521 3158 p 2 0 2536 1064 7737 2964 p 2 0 2780 820 9215 3243 p 2 0 2751 849 9149 3185 p 2 0 2614 986 8564 3076 p 2 0 2732 868 9045 3182 p 2 0 2693 907 9547 3183 p 2 0 2709 891 8546 3217 p 2 0 3041 559 10791 3726 p 2 0 2610 990 7420 3169 p 2 0 3132 468 12336 3881 p 2 0 2950 650 11446 3539 p 2 0 2834 766 9253 3428 p 2 0 2865 735 9971 3428 p 2 0 2589 1011 7753 3006 p 2 0 2679 921 8415 3220 p 2 0 2756 844 8944 3243 p 2 0 2781 819 8407 3315 p 2 0 2634 966 7974 3158 p 2 0 2961 639 10014 3554 p 2 0 2644 956 8062 3194 p 2 0 2842 758 9539 3392 p 2 0 3229 371 18388 4046 p 2 0 3111 489 12536 3806 p 2 0 2814 786 9967 3335 i 2 3600 0 0 107580 13807 p 2 0 3567 33 21992 4882 p 2 0 3111 489 11741 3753 p 2 4 3427 169 16903 4380 p 2 0 3308 292 13230 4061 p 2 0 3301 299 13460 4054 p 2 0 2954 646 10075 3590 p 2 0 3356 244 13142 4213 p 2 4 2649 947 8946 3230 p 2 0 2439 1161 7011 2867 p 2 0 3125 475 11797 3833 p 2 0 2674 926 7515 3184 p 2 0 3089 511 10800 3786 p 2 0 3103 497 10659 3731 p 2 0 2831 769 8671 3383 p 2 0 3026 574 10116 3637 p 2 0 2722 878 7994 3242 p 2 0 2966 634 9456 3524 p 2 4 2870 726 9959 3466 p 2 0 3140 460 11295 3815 p 2 0 2767 833 9274 3330 p 2 0 3164 436 11137 3868 p 2 0 2962 638 9660 3532 p 2 0 2478 1122 6920 2900 p 2 4 2381 1215 7288 2853 p 2 0 2825 775 8983 3296 p 2 0 2644 956 7355 3097 p 2 0 2786 814 8836 3299 p 2 0 2681 919 7801 3162 p 2 0 2396 1204 6689 2807 p 2 0 2579 1021 8014 3043 p 2 0 2780 820 8611 3264 p 2 0 2728 872 8939 3256 p 2 0 3401 199 18201 4347 p 2 0 3269 331 13279 4062 p 2 0 2969 631 10357 3510 i 2 3600 0 0 115449 12776 p 2 0 3591 9 30728 4864 p 2 0 3542 58 22815 4479 p 2 0 3438 162 15265 4246 p 2 0 3016 584 10919 3562 p 2 0 3262 338 14608 3816 p 2 0 3227 373 13411 3799 p 2 0 3382 218 16081 4007 p 2 0 3329 271 13873 4130 p 2 0 2487 1113 7277 2981 p 2 0 3556 44 25194 4458 p 2 0 3493 107 19002 4404 p 2 0 3217 383 12772 3921 p 2 0 3385 215 15693 4136 p 2 0 3337 263 14098 4037 p 2 0 3250 350 12726 3866 p 2 0 3084 516 11559 3657 p 2 0 3205 395 12791 3805 p 2 0 3219 381 12944 3843 p 2 0 3131 469 12124 3717 p 2 0 3344 256 15230 4021 p 2 0 3170 430 13090 3743 p 2 0 3372 228 15639 4071 p 2 0 3357 243 14278 4116 p 2 0 3218 382 12009 3866 p 2 0 3243 357 12369 3840 p 2 0 3094 506 11341 3728 p 2 0 3121 479 11241 3713 p 2 0 2885 715 9635 3398 p 2 0 2982 618 10180 3539 p 2 0 3103 497 11091 3698 p 2 0 3232 368 11947 3918 p 2 0 2790 810 8769 3335 p 2 0 3517 83 19903 4444 p 2 0 3408 192 15036 4123 p 2 0 3323 277 13968 4010 p 2 0 3103 497 11463 3649 p 2 0 3020 580 10484 3496 p 2 0 2821 779 9471 3298 p 2 0 2929 671 9840 3416 p 2 0 2980 620 10543 3489 p 2 0 3087 513 10993 3597 p 2 0 2969 631 9944 3439 p 2 6 3275 319 17386 4085 p 2 0 2940 660 9721 3489 p 2 0 3483 117 18692 4355 p 2 0 2843 757 9791 3285 p 2 7 3302 291 20678 4063 p 2 0 3379 221 16264 4088 p 2 0 3169 431 12098 3783 p 2 3 3203 394 18558 3962 p 2 0 3161 439 11812 3749 p 2 7 3217 376 18870 4050 p 2 0 3126 474 11776 3700 p 2 0 3061 539 11151 3615 p 2 2 3293 305 18298 4139 p 2 0 2881 719 9545 3422 p 2 0 3467 133 18196 4311 p 2 0 2712 888 9108 3169 p 2 0 3117 483 16545 3842 p 2 0 3343 257 16167 4004 p 2 0 2482 1118 8443 2894 p 2 0 3194 406 18310 3849 p 2 0 3193 407 13254 3721 p 2 0 2984 616 15116 3560 p 2 0 3077 523 11070 3573 p 2 0 3012 588 10490 3511 p 2 1 3237 362 16543 3963 p 2 0 2993 607 9888 3564 p 2 0 3475 125 18474 4343 p 2 0 2686 914 8854 3148 p 2 16 3089 495 17683 3870 p 2 0 3378 222 15932 4046 p 2 0 2834 766 10259 3263 p 2 1 3265 334 18440 4055 p 2 0 3146 454 11793 3748 p 2 0 3027 573 10613 3567 p 2 1 2978 621 14956 3660 p 2 0 3099 501 11553 3678 p 2 0 3088 512 11410 3678 p 2 2 3222 376 16226 3967 p 2 0 3528 72 20205 4421 p 2 0 2786 814 9418 3249 p 2 0 3155 445 15998 3807 p 2 0 3300 300 13851 3944 p 2 0 2330 1270 7180 2727 p 2 1 3274 325 17802 4014 p 2 0 3126 474 12157 3746 p 2 1 3208 391 17096 3955 p 2 0 3093 507 11262 3645 p 2 0 3000 600 10693 3521 p 2 0 3293 307 17962 4056 p 2 0 3073 527 11033 3674 p 2 0 3425 175 16779 4204 p 2 0 2578 1022 8311 2994 p 2 2 3019 579 14373 3656 p 2 0 3221 379 12691 3835 p 2 0 2316 1284 6965 2702 p 2 3 3029 568 15483 3719 p 2 0 3257 343 13378 3936 p 2 0 3036 564 10883 3622 p 2 0 2992 608 11623 3548 p 2 0 2974 626 10250 3478 p 2 0 3277 323 16399 3985 p 2 0 2826 774 9618 3303 p 2 0 3474 126 18638 4287 p 2 0 2711 889 9048 3179 p 2 1 3141 458 15353 3787 p 2 0 3328 272 14202 4017 p 2 0 2456 1144 7473 2849 p 2 0 3164 436 15437 3824 p 2 0 3330 270 14627 4049 p 2 0 3190 410 12552 3832 p 2 0 3138 462 11647 3724 p 2 0 2952 648 10140 3456 p 2 0 3369 231 15728 4018 p 2 0 3213 387 13087 3699 p 2 0 3556 44 31868 5456 i 2 3600 0 0 125251 14734 p 2 0 3382 218 16506 4479 p 2 0 2803 797 9606 3524 p 2 0 3318 282 14901 4348 p 2 0 3159 441 13076 4046 p 2 0 3233 367 13358 4161 p 2 0 3151 449 12687 4010 p 2 0 2486 1114 7928 3040 p 2 0 2832 768 10747 3549 p 2 0 3163 437 13472 4193 p 2 0 2553 1047 8235 3179 p 2 0 2928 672 13163 3822 p 2 0 3216 384 19120 4435 p 2 0 3171 429 14239 4138 p 2 0 2967 633 12590 3886 p 2 0 3191 409 13153 4102 p 2 0 2943 657 12024 3784 p 2 0 3157 443 14468 4086 i 2 3600 0 0 121669 13179 p 2 0 3536 64 22775 4597 p 2 0 3525 75 17231 4588 p 2 0 3245 355 12624 4036 p 2 0 3277 323 12465 4129 p 2 0 2699 901 8235 3284 p 2 0 3464 136 17682 4392 p 2 0 2806 794 9244 3372 p 2 0 3031 569 10784 3705 p 2 0 2581 1019 7972 3099 p 2 0 1822 1778 5293 2266 p 2 0 3270 330 12798 3934 p 2 0 3113 487 11474 3754 p 2 0 2778 822 8598 3377 p 2 0 3042 558 11334 3677 p 2 0 2708 892 8792 3259 p 2 0 3013 587 10750 3623 p 2 0 3133 467 12337 3719 p 2 0 3214 386 12359 3892 p 2 0 3289 311 13098 4029 p 2 0 2922 678 10120 3471 p 2 0 2922 678 9717 3449 p 2 0 2568 1032 7823 3032 p 2 0 2970 630 9881 3519 p 2 0 2848 752 9215 3412 p 2 0 2711 889 8472 3244 p 2 0 2900 700 9427 3445 p 2 0 3092 508 11206 3751 p 2 0 2741 859 8913 3247 p 2 0 3375 225 15806 4151 p 2 0 3272 328 13618 3970 p 2 0 2812 788 9371 3322 p 2 0 2806 794 9186 3303 p 2 0 2986 614 9979 3566 p 2 0 2575 1025 7822 3068 p 2 0 3026 574 10364 3580 p 2 0 2757 843 8872 3253 p 2 0 2794 806 8908 3286 p 2 0 2827 773 9268 3344 p 2 0 2990 610 10589 3591 p 2 0 2469 1131 7889 2950 p 2 0 3312 288 14812 4091 p 2 0 3260 340 12996 3959 p 2 0 2866 734 9405 3413 p 2 0 2629 971 8232 3110 p 2 0 2970 630 10364 3486 p 2 0 2621 979 8265 3047 p 2 0 3000 600 10523 3499 p 2 0 2769 831 9057 3259 p 2 0 2772 828 9033 3263 p 2 0 2956 644 9859 3488 p 2 0 3054 546 10259 3695 p 2 0 3024 576 10401 3648 p 2 0 3386 214 15632 4230 p 2 0 3166 434 11971 3817 p 2 0 1892 1708 5620 2294 p 2 0 2802 798 9332 3288 p 2 0 2994 606 10846 3534 p 2 0 2500 1100 7827 2929 p 2 0 2725 875 9113 3194 i 2 3600 0 0 116575 13412 p 2 0 3545 55 23617 4734 p 2 0 3452 148 17770 4471 p 2 0 3407 193 15856 4421 p 2 0 3155 445 11658 3961 p 2 0 3456 144 19694 4383 p 2 0 3252 348 14035 4111 p 2 0 2825 775 9879 3487 p 2 0 2982 618 11233 3748 p 2 0 2965 635 10919 3693 p 2 0 2366 1234 7139 2897 p 2 0 3122 478 12067 3786 p 2 0 2964 636 10715 3604 p 2 0 3012 588 10893 3640 p 2 0 2955 645 10521 3567 p 2 0 3171 429 12985 3921 p 2 0 2935 665 11375 3554 p 2 0 3159 441 12748 3899 p 2 0 3027 573 12435 3694 p 2 0 2615 985 9127 3161 p 2 0 2611 989 8885 3133 p 2 0 2793 807 9636 3329 p 2 0 2680 920 8425 3205 p 2 0 2884 716 10062 3465 p 2 0 2708 892 8916 3228 p 2 0 2678 922 8820 3223 p 2 0 2837 763 9698 3414 p 2 0 2978 622 10688 3682 p 2 0 2804 796 9298 3375 p 2 0 3310 290 15141 4169 p 2 0 3161 439 12978 3914 p 2 0 2942 658 11213 3547 p 2 0 2729 871 9702 3294 p 2 0 2749 851 9558 3318 p 2 0 2586 1014 8448 3081 p 2 0 2986 614 10782 3588 p 2 0 2724 876 9088 3283 p 2 0 2627 973 8905 3141 p 2 0 2612 988 8617 3132 p 2 0 2898 702 10195 3497 p 2 0 2690 910 9419 3252 p 2 0 3350 250 19907 4339 p 2 0 3005 595 11067 3695 p 2 0 3064 536 11784 3667 p 2 0 2720 880 9979 3262 p 2 0 3472 128 23646 5131 i 2 3600 0 0 119557 13188 p 2 0 3495 105 17973 4473 p 2 0 3115 485 16772 3875 p 2 0 3315 285 14376 4087 p 2 0 2277 1323 7057 2711 p 2 0 2785 815 13439 3301 p 2 0 3199 401 12338 3932 p 2 0 3222 378 14258 3900 p 2 0 3416 184 24255 4345 p 2 0 3004 596 11644 3568 p 2 0 3486 114 22221 4449 p 2 0 3325 275 14820 4102 p 2 0 3296 304 13454 4046 p 2 0 3144 456 11464 3749 p 2 0 3180 420 15850 3890 p 2 0 3206 394 12475 3916 p 2 0 2962 638 10351 3547 p 2 0 2980 620 13917 3617 p 2 0 3381 219 16068 4200 p 2 0 3020 580 10906 3621 p 2 0 3318 282 14897 4013 p 2 0 3082 518 10976 3702 p 2 0 3126 474 11399 3776 p 2 0 3043 557 10644 3634 p 2 0 2815 785 9149 3359 p 2 0 2778 822 8715 3290 p 2 0 2796 804 9136 3330 p 2 0 2654 946 8535 3191 p 2 0 2717 883 8837 3267 p 2 0 2735 865 8722 3252 p 2 0 2956 644 10359 3565 p 2 0 2730 870 8857 3230 p 2 0 3256 344 14041 3920 p 2 0 2963 637 10749 3477 p 2 0 2957 643 10585 3470 p 2 0 2963 637 10059 3545 p 2 0 3137 463 12224 3736 p 2 0 2809 791 9201 3332 p 2 0 2658 942 8389 3158 p 2 0 2849 751 9501 3356 p 2 0 2755 845 9117 3248 p 2 0 2912 688 9811 3437 p 2 0 3104 496 10758 3815 p 2 0 2910 690 9324 3515 p 2 0 3353 247 14937 4110 p 2 0 3012 588 10594 3555 p 2 0 2844 756 9573 3343 p 2 0 2957 643 10368 3496 p 2 0 2905 695 10111 3434 p 2 0 3059 541 11644 3649 p 2 0 2808 792 9898 3331 p 2 0 2759 841 9020 3220 p 2 0 2857 743 9473 3357 p 2 0 2573 1027 7934 3053 p 2 0 3110 490 11158 3830 p 2 0 2699 901 8276 3292 p 2 0 3326 274 14134 4107 p 2 0 3041 559 11154 3650 p 2 0 2972 628 10154 3580 p 2 0 3033 567 10771 3612 p 2 0 2909 691 9818 3511 p 2 0 2859 741 9663 3388 p 2 0 2781 819 9848 3302 p 2 0 2518 1082 8116 2999 p 2 0 2531 1069 7769 2999 p 2 0 2791 809 9228 3263 p 2 0 2810 790 9359 3307 p 2 0 2788 812 9180 3282 p 2 0 3305 295 14542 4029 p 2 0 2727 873 9138 3244 p 2 0 2760 840 9136 3269 p 2 0 2762 838 9185 3279 p 2 0 3308 292 18074 4498 i 2 3600 0 0 118775 13491 p 2 0 3520 80 19593 4675 p 2 0 3386 214 16682 4337 p 2 0 3351 249 15171 4306 p 2 0 3386 214 16519 4474 p 2 0 2987 613 11736 3716 p 2 0 3322 278 16545 4238 p 2 0 2561 1039 8606 3082 p 2 0 2772 828 9532 3351 p 2 0 3133 467 12221 3804 p 2 0 3151 449 12512 3871 p 2 0 3096 504 12235 3781 p 2 0 3034 566 11295 3722 p 2 0 3030 570 11309 3721 p 2 0 2964 636 10917 3609 p 2 0 2873 727 9942 3498 p 2 0 2781 819 9196 3373 p 2 0 3142 458 12872 3868 p 2 0 2808 792 9587 3382 p 2 0 3189 411 13138 3963 p 2 0 3100 500 12573 3796 p 2 0 2773 827 9821 3327 p 2 0 2899 701 10146 3520 p 2 0 2803 797 9554 3330 p 2 0 2708 892 9059 3238 p 2 0 2626 974 8721 3162 p 2 0 2602 998 8406 3132 p 2 0 2814 786 9727 3423 p 2 0 2546 1054 8139 3091 p 2 0 2831 769 9700 3428 p 2 0 2485 1115 8117 3013 p 2 0 3276 324 15223 4086 p 2 0 3127 473 12783 3829 p 2 0 2857 743 10137 3406 p 2 0 2831 769 9922 3375 p 2 0 2837 763 10220 3379 p 2 0 2542 1058 8191 3037 p 2 0 2556 1044 8654 3103 p 2 0 2509 1091 8175 3039 p 2 0 2719 881 8853 3253 p 2 0 2937 663 10978 3564 p 2 0 2663 937 8894 3191 p 2 0 3382 218 19847 4334 p 2 0 2432 1168 8348 2956 p 2 0 3021 579 12393 3678 p 2 0 2929 671 10626 3462 p 2 0 2894 706 10511 3433 p 2 0 2816 784 10326 3330 p 2 0 2619 981 8676 3106 p 2 0 2689 911 8688 3235 p 2 0 2830 770 9824 3388 p 2 0 3396 204 20521 4875 i 2 3600 0 0 91454 14006 p 2 0 3592 8 26539 5158 p 2 752 2847 1 70603 9755 p 2 0 3597 3 31281 5554 p 2 438 3158 4 61405 8679 p 2 0 3597 3 28055 5455 p 2 125 3465 10 52140 7418 p 2 0 3591 9 31008 5533 p 2 125 3471 4 54796 7527 p 2 0 3598 2 28518 5342 p 2 0 3595 5 25582 5125 p 2 0 3589 11 26775 5168 p 2 0 3592 8 28117 5158 p 2 0 3597 3 27615 5151 p 2 2 3596 2 31591 5214 p 2 0 3594 6 31913 5348 p 2 0 3596 4 32610 5374 p 2 0 3593 7 29806 5333 p 2 0 3599 1 28868 5247 p 2 0 3597 3 29301 5211 p 2 0 3594 6 30697 5449 p 2 0 3592 8 27229 5192 p 2 0 3597 3 24723 4998 p 2 0 3598 2 27865 5424 i 2 3600 0 0 75202 13471 p 2 1 3591 8 32460 5837 p 2 3 3587 10 33997 6015 p 2 0 3584 16 34792 6080 p 2 1 3586 13 35393 6099 p 2 0 3584 16 35252 6169 p 2 2 3586 12 33874 6051 p 2 1 3581 18 33427 6045 p 2 2 3589 9 35594 6129 p 2 1 3591 8 34300 6032 p 2 3 3595 2 34128 6053 p 2 2 3590 8 32360 5945 p 2 0 3593 7 36430 6165 p 2 1 3595 4 34031 6003 p 2 3 3588 9 34128 6066 p 2 4 3591 5 33192 6060 p 2 2 3588 10 35888 6161 p 2 1 3577 22 34301 6110 p 2 0 3588 12 32683 6008 p 2 0 3592 8 33189 6022 p 2 1 3584 15 33395 6064 p 2 2 3589 9 33388 5987 p 2 0 3584 16 33783 5923 p 2 1 3595 4 37794 6620 i 2 3600 0 0 83878 13503 p 2 131 3350 119 45916 7146 p 2 115 3325 160 45604 6956 p 2 1173 2422 5 95294 12555 p 2 475 3109 16 62562 9718 p 2 1179 2418 3 93355 12326 p 2 307 3258 35 62547 8732 p 2 2234 1366 0 109654 15104 p 2 2406 1194 0 103965 15766 p 2 1528 2072 0 127060 15031 p 2 1186 2414 0 132895 14454 p 2 937 2663 0 126112 13505 p 2 453 3147 0 112685 11805 p 2 324 3276 0 91950 10509 p 2 369 3231 0 94801 10901 p 2 203 3396 1 78480 9505 p 2 309 3291 0 98455 10268 p 2 364 3235 1 96890 10624 p 2 353 3245 2 97466 10429 p 2 207 3393 0 96175 9807 p 2 387 3213 0 102560 10776 p 2 231 3368 1 96550 9954 p 2 356 3244 0 105756 10629 p 2 215 3385 0 96063 10023 p 2 402 3198 0 102311 10611 p 2 232 3368 0 91159 9531 p 2 349 3251 0 104020 10891 p 2 336 3264 0 92552 10084 p 2 382 3217 1 105394 10731 p 2 360 3239 1 107919 10746 p 2 516 3084 0 101806 10936 p 2 372 3226 2 97415 10343 p 2 279 3321 0 102153 10554 i 2 3600 0 0 97369 14110 p 2 267 3325 8 86820 9762 p 2 318 3247 35 90735 10300 p 2 182 3367 51 81564 9447 p 2 359 3212 29 89893 10218 p 2 211 3366 23 80136 9438 p 2 381 3195 24 88017 10387 p 2 122 3456 22 80001 9221 p 2 349 3242 9 97936 10550 p 2 188 3404 8 81804 9335 p 2 319 3265 16 95562 10176 p 2 109 3486 5 85045 9130 p 2 284 3314 2 101896 10281 p 2 159 3440 1 86625 9280 p 2 379 3219 2 105068 10794 p 2 140 3460 0 87867 9198 p 2 332 3264 4 99925 10336 p 2 133 3465 2 82751 9087 p 2 334 3264 2 100597 10277 p 2 215 3384 1 92113 9309 p 2 333 3267 0 109845 10629 p 2 344 3256 0 92849 9397 p 2 429 3168 3 105140 10600 p 2 244 3356 0 91190 9525 i 2 3600 0 0 109245 16719 p 2 782 2818 0 107586 13438 p 2 625 2973 2 112689 13023 p 2 596 3004 0 106410 12657 p 2 613 2986 1 101687 12468 p 2 427 3173 0 92383 11781 p 2 514 3085 1 96834 12283 p 2 307 3292 1 92992 11055 p 2 365 3235 0 101351 11604 p 2 281 3319 0 97053 10961 p 2 397 3200 3 101554 11484 p 2 388 3212 0 101192 11365 p 2 320 3260 20 107733 11122 p 2 377 3220 3 103839 11076 p 2 396 3190 14 114092 11605 p 2 325 3264 11 104370 11164 p 2 386 3209 5 103302 11315 p 2 314 3284 2 92976 10513 p 2 356 3235 9 102732 11095 p 2 310 3284 6 100865 10709 p 2 307 3292 1 115552 11028 p 2 365 3229 6 113062 11017 p 2 463 3135 2 113235 11583 p 2 411 3189 0 108472 11196 i 2 3600 0 0 121483 13356 p 2 667 2906 27 122434 9846 p 2 684 2861 55 118196 9876 p 2 551 2995 54 123766 9619 p 2 628 2966 6 117011 9920 p 2 570 2976 54 109077 9919 p 2 552 3011 37 114216 9832 p 2 366 3182 52 119533 9342 p 2 602 2945 53 124231 9882 p 2 789 2758 53 120635 10028 p 2 547 2997 56 129212 9716 p 2 506 3062 32 128315 9822 p 2 682 2869 49 122238 9843 p 2 513 3035 52 130651 9666 p 2 652 2907 41 125160 10035 p 2 686 2881 33 121349 9950 p 2 547 3025 28 120349 9781 p 2 544 3031 25 114348 9814 p 2 703 2866 31 114515 10082 p 2 647 2896 57 117309 9899 p 2 514 3058 28 121450 9978 p 2 605 2957 38 119059 9829 p 2 560 2982 58 121719 9744 p 2 574 2977 49 120981 9619 i 2 3600 0 0 135596 14994 p 2 17 3488 95 64383 6127 p 2 34 3502 64 58832 6038 p 2 15 3457 128 47915 5691 p 2 9 3533 58 45039 5868 p 2 351 3093 156 64529 7392 p 2 9 3394 197 35982 5359 p 2 197 3014 389 49892 5976 p 2 10 3097 493 34157 4825 p 2 0 3072 528 35323 4832 p 2 1 2926 673 31617 4528 p 2 5 3102 493 41824 5203 p 2 0 3026 574 32917 4650 p 2 2 2959 639 40429 4909 p 2 7 3249 344 35501 5085 p 2 2 3215 383 44081 5263 p 2 0 3436 164 36543 5362 p 2 7 3305 288 44401 5556 p 2 0 3411 189 33842 5195 p 2 4 3311 285 43309 5456 p 2 14 3366 220 32821 5246 p 2 4 3295 301 41842 5414 p 2 0 3214 386 30957 4854 p 2 186 3120 294 55468 6308 p 2 0 3182 418 34009 4909 p 2 0 3289 311 44911 5427 p 2 147 2999 454 56201 6010 p 2 10 3298 292 48516 5559 p 2 9 3237 354 38635 5236 p 2 415 2803 382 69748 7327 p 2 2 3469 129 39390 5546 p 2 265 3131 204 54981 6834 p 2 0 3363 237 29900 5102 p 2 0 3456 144 35375 5363 p 2 0 3231 369 28580 4810 p 2 0 3132 468 32014 4807 p 2 0 2910 690 27070 4347 i 2 3600 0 0 74460 14082 p 2 1588 2012 0 100869 13279 p 2 1556 2044 0 104333 13699 p 2 1052 2548 0 110942 12995 p 2 639 2956 5 102239 11726 p 2 236 3362 2 89503 10420 p 2 80 3512 8 52558 8086 p 2 87 3501 12 49978 7993 p 2 64 3525 11 47354 7856 p 2 155 3441 4 50074 7876 p 2 132 3458 10 48123 7888 p 2 148 3449 3 46903 7696 p 2 36 3549 15 45455 7261 p 2 67 3520 13 44573 7405 p 2 33 3553 14 44956 7087 p 2 119 3473 8 42920 7210 p 2 57 3537 6 46037 7251 p 2 105 3489 6 47339 7495 p 2 85 3510 5 48166 7570 p 2 88 3505 7 48804 7632 p 2 97 3486 17 45273 7554 p 2 54 3534 12 45281 7250 p 2 69 3512 19 45452 7213 p 2 67 3515 18 46147 7306 i 2 3600 0 0 93872 13412 p 2 677 2923 0 106561 10754 p 2 651 2945 4 105641 10660 p 2 734 2862 4 108763 10806 p 2 424 3171 5 111741 10475 p 2 485 3115 0 105485 10502 p 2 461 3138 1 113313 10587 p 2 459 3137 4 109168 10480 p 2 444 3155 1 118881 10510 p 2 448 3152 0 124436 10699 p 2 505 3094 1 123214 10724 p 2 638 2958 4 122741 11053 p 2 493 3106 1 122385 10736 p 2 562 3037 1 118660 10728 p 2 525 3075 0 123326 10823 p 2 593 3007 0 122040 10962 p 2 489 3111 0 118788 11112 p 2 577 3022 1 112962 11022 p 2 348 3251 1 124205 10655 p 2 562 3038 0 119460 11015 p 2 439 3161 0 119567 10856 p 2 591 3008 1 118557 11089 p 2 377 3223 0 120803 10788 p 2 454 3146 0 118558 10889 p 2 489 3111 0 117039 11046 p 2 540 3060 0 108507 10678 p 2 446 3153 1 115039 10659 i 2 3600 0 0 60022 12929 p 2 0 3315 285 14596 4411 p 2 239 3061 300 35071 6394 p 2 0 3069 531 12175 4020 p 2 0 2958 642 10763 3725 p 2 287 2862 451 39836 6567 p 2 0 2781 819 12380 3601 p 2 0 3058 542 15289 4060 p 2 206 2888 506 41574 6336 p 2 0 2897 703 13658 3843 p 2 0 2976 624 12633 3884 p 2 187 2900 513 41539 6330 p 2 0 3296 304 16416 4703 p 2 0 3375 225 16785 4668 p 2 179 3246 175 43001 6904 p 2 0 3314 286 16185 4545 p 2 0 3279 321 12917 4344 p 2 510 3088 2 66446 10576 p 2 205 3395 0 46099 9016 p 2 161 3437 2 43772 8826 p 2 177 3423 0 47809 9353 p 2 136 3460 4 44546 9025 p 2 149 3451 0 46164 9216 p 2 158 3441 1 45149 9219 p 2 155 3444 1 44117 9101 p 2 149 3451 0 46409 9485 p 2 178 3422 0 41572 9116 p 2 185 3415 0 42384 9246 p 2 178 3421 1 43111 9207 p 2 161 3439 0 42187 9212 p 2 125 3474 1 40253 8701 p 2 159 3441 0 42289 8921 p 2 0 3443 157 12958 5103 p 2 0 3383 217 11512 4333 i 2 3600 0 0 39386 11746 p 2 0 2470 1130 6604 2916 p 2 0 2838 762 7833 3259 p 2 637 2422 541 44368 7641 p 2 0 2826 774 12346 4044 p 2 53 2867 680 30626 5629 p 2 0 2673 927 10726 3570 p 2 0 2659 941 8283 3112 p 2 0 2285 1315 6058 2694 p 2 118 2765 717 34847 5550 p 2 0 2656 944 9455 3299 p 2 0 2493 1107 8141 3040 p 2 0 2229 1371 7024 2726 p 2 0 2604 996 7829 3096 p 2 0 2490 1110 7122 2938 p 2 0 2429 1171 5999 2781 p 2 0 2361 1239 7272 2802 p 2 0 2340 1260 6141 2730 p 2 0 2302 1298 6411 2685 p 2 0 2232 1368 5869 2564 p 2 0 2153 1447 5662 2498 p 2 0 2140 1460 5360 2502 p 2 0 2128 1472 5313 2489 p 2 0 1982 1618 5497 2363 p 2 0 1913 1687 5148 2292 p 2 0 1786 1814 4936 2181 p 2 0 2134 1466 5927 2505 p 2 0 2169 1431 5194 2527 p 2 0 2132 1468 5957 2538 p 2 0 2131 1469 5610 2476 p 2 0 2172 1428 5660 2540 p 2 0 2305 1295 5343 2607 p 2 0 1857 1743 4868 2242 p 2 0 2295 1305 5540 2554 p 2 0 1938 1662 5334 2297 p 2 0 1890 1710 4481 2265 p 2 0 1694 1906 4887 2092 p 2 0 1916 1684 4501 2274 p 2 0 2033 1567 5225 2358 p 2 0 2555 1045 6693 2900 p 2 0 1981 1619 4976 2373 p 2 0 1718 1882 5027 2112 p 2 0 2113 1487 5402 2474 p 2 0 2067 1533 4944 2417 p 2 0 1929 1671 5468 2295 p 2 0 2000 1600 4823 2303 p 2 0 1807 1793 5135 2150 p 2 0 1889 1711 5225 2247 p 2 0 1690 1910 4872 2060 p 2 0 1933 1667 4363 2273 p 2 0 1744 1856 4850 2130 p 2 0 2387 1213 6456 2745 p 2 0 2070 1530 5066 2419 p 2 0 1944 1656 5713 2316 p 2 0 2080 1520 5318 2418 p 2 0 1831 1769 4332 2156 p 2 0 1897 1703 4996 2231 p 2 0 2086 1514 4981 2355 p 2 0 1429 2171 3932 1806 p 2 0 1864 1736 4277 2176 p 2 0 1679 1921 4468 2048 p 2 0 1430 2170 3809 1814 p 2 0 1670 1930 4528 2051 p 2 0 2241 1359 6038 2560 p 2 0 1731 1869 4951 2129 p 2 0 1540 2060 3815 1905 p 2 0 2037 1563 4855 2319 p 2 0 3070 530 13815 4014 i 2 3600 0 0 113690 13427 p 2 0 3540 60 23130 4615 p 2 0 3334 266 14646 4187 p 2 0 3405 195 16541 4282 p 2 0 3234 366 13529 4006 p 2 0 3027 573 11197 3686 p 2 0 3123 477 11228 3883 p 2 0 3360 240 16723 4216 p 2 0 3108 492 11954 3835 p 2 0 2559 1041 8413 3129 p 2 0 3405 195 34049 4796 p 2 0 3120 480 13328 3816 p 2 0 3098 502 12073 3803 p 2 0 2948 652 10574 3591 p 2 0 3117 483 31702 4372 p 2 0 3086 514 13090 3802 p 2 0 2276 1324 8447 2798 p 2 0 3087 513 30764 4317 p 2 0 3084 516 14102 3840 p 2 0 3154 446 13468 3864 p 2 4 3216 380 35287 4590 p 2 0 3131 469 13132 3859 p 2 0 2993 607 11392 3633 p 2 0 2816 784 10035 3405 p 2 0 2815 785 9901 3418 p 2 0 2778 822 9465 3355 p 2 0 2788 812 9429 3373 p 2 0 2767 833 9324 3344 p 2 0 2729 871 9101 3287 p 2 0 2871 729 9966 3447 p 2 0 3105 495 11396 3891 p 2 0 2755 845 9210 3351 p 2 0 3218 382 14348 3950 p 2 0 2932 668 10519 3511 p 2 0 2876 724 9818 3423 p 2 0 2903 697 10676 3472 p 2 0 2568 1032 8235 3063 p 2 0 2822 778 9668 3342 p 2 0 2590 1010 8702 3101 p 2 0 2713 887 9283 3208 p 2 0 2503 1097 7843 2982 p 2 0 2621 979 8617 3114 p 2 0 2918 682 10135 3605 p 2 0 2742 858 8783 3363 p 2 0 3133 467 12868 3867 p 2 0 2591 1009 8628 3089 p 2 0 2919 681 10900 3527 p 2 0 2609 991 8536 3097 p 2 0 2631 969 8449 3120 p 2 0 2511 1089 8089 2992 p 2 0 2679 921 9118 3192 p 2 0 1732 1868 5068 2143 p 2 0 2531 1069 8015 3006 p 2 0 2314 1286 7230 2815 p 2 0 2736 864 9181 3283 p 2 0 2455 1145 8142 2951 p 2 88 3066 446 47295 5189 p 2 0 3028 572 12530 3774 p 2 82 3090 428 46864 5213 p 2 0 2775 825 11975 3503 p 2 0 2085 1515 6624 2576 p 2 146 2906 548 48119 5286 p 2 0 2978 622 12750 3791 p 2 0 2882 718 10777 3586 p 2 0 2102 1498 7476 2647 p 2 162 2789 649 50703 5320 p 2 0 3142 458 13914 4045 p 2 0 3470 130 20538 4631 p 2 0 2683 917 9496 3237 p 2 0 3046 554 12489 3744 p 2 0 3121 479 12524 3797 p 2 0 2822 778 9770 3388 p 2 0 2783 817 9559 3334 p 2 0 2645 955 8625 3161 p 2 0 2583 1017 8246 3100 p 2 0 2767 833 9174 3259 p 2 0 2483 1117 7751 2963 p 2 0 2622 978 8565 3132 p 2 0 2890 710 10151 3503 p 2 0 2592 1008 8373 3115 p 2 0 3051 549 12288 3685 p 2 0 2652 948 9258 3201 p 2 0 2895 705 10473 3523 p 2 0 2515 1085 7943 3036 p 2 0 2537 1063 8189 3076 p 2 0 2613 987 8410 3144 p 2 0 2632 968 8778 3178 p 2 0 2633 967 8438 3155 p 2 0 1755 1845 4973 2173 p 2 0 2324 1276 7260 2821 p 2 0 2864 736 9609 3452 p 2 0 2634 966 8408 3156 p 2 0 3109 491 12204 3746 p 2 0 3022 578 11569 3637 p 2 0 2872 728 10280 3447 p 2 0 2728 872 8998 3292 p 2 0 2749 851 9342 3285 p 2 0 2621 979 8276 3127 p 2 0 2590 1010 8324 3127 p 2 0 2571 1029 8044 3072 p 2 0 2520 1080 8204 3042 p 2 0 2459 1141 7766 2963 p 2 0 2871 729 9526 3529 p 2 0 2735 865 8979 3301 p 2 0 3060 540 11994 3691 p 2 0 2710 890 9289 3226 p 2 0 2926 674 10785 3471 p 2 0 2818 782 10443 3399 p 2 0 2540 1060 8322 3038 p 2 0 2735 865 9500 3279 i 2 3600 0 0 106493 13175 p 2 0 3571 29 25275 4997 p 2 0 3385 215 16674 4246 p 2 0 3181 419 12570 3898 p 2 0 3387 213 15486 4326 p 2 0 3472 128 20443 4588 p 2 0 3356 244 15263 4218 p 2 0 3133 467 11657 3885 p 2 0 3301 299 14955 4167 p 2 0 3090 510 11800 3824 p 2 0 3115 485 11886 3844 p 2 0 2871 729 9654 3457 p 2 0 2870 730 9746 3469 p 2 0 3046 554 11144 3686 p 2 0 3024 576 10989 3694 p 2 0 3132 468 12384 3823 p 2 0 2768 832 8967 3301 p 2 0 3240 360 12783 4002 p 2 0 3131 469 12380 3855 p 2 0 2779 821 9133 3317 p 2 0 2836 764 9949 3418 p 2 0 2918 682 9716 3499 p 2 0 2744 856 9163 3301 p 2 0 2593 1007 7765 3062 p 2 0 2531 1069 7559 3040 p 2 0 2600 1000 7976 3108 p 2 0 2727 873 8744 3268 p 2 0 2839 761 9478 3424 p 2 0 2620 980 8232 3144 p 2 0 3250 350 14374 4027 p 2 0 3031 569 11506 3690 p 2 0 2723 877 9266 3240 p 2 0 2704 896 8951 3224 p 2 0 2823 777 9331 3342 p 2 0 2819 781 10269 3369 p 2 0 2737 863 8946 3297 p 2 0 2449 1151 7643 2975 p 2 0 2603 997 8285 3078 p 2 0 2675 925 8659 3180 p 2 0 2527 1073 7938 3021 p 2 0 2963 637 9713 3613 p 2 0 2680 920 8197 3258 p 2 0 3215 385 13581 3927 p 2 0 2868 732 10122 3437 p 2 0 2750 850 9041 3268 p 2 0 2795 805 9396 3329 p 2 0 2822 778 9515 3319 p 2 0 2813 787 9483 3352 p 2 0 2657 943 8782 3183 p 2 0 2670 930 8527 3179 p 2 0 2791 809 9173 3345 p 2 0 2845 755 9696 3420 p 2 0 2679 921 8011 3238 p 2 0 3276 324 16336 4114 p 2 0 3211 389 13797 3976 p 2 0 2866 734 9502 3465 p 2 0 2446 1154 7590 2964 p 2 0 2878 722 9840 3371 p 2 0 3356 244 21145 4870 i 2 3600 0 0 133958 15613 p 2 0 3591 9 30020 5276 p 2 0 3310 290 15686 4229 p 2 0 3490 110 20352 4759 p 2 0 2918 682 11483 3612 p 2 0 3370 230 15475 4508 p 2 0 3124 476 13489 3956 p 2 0 3294 306 16831 4314 p 2 0 1769 1831 5778 2299 p 2 0 1319 2281 4328 1792 p 2 0 1031 2569 3226 1498 p 2 0 703 2897 2518 1166 p 2 0 3153 447 13608 4028 p 2 0 2227 1373 7005 2733 p 2 0 2636 964 9046 3236 p 2 0 551 3049 2367 1044 p 2 0 1203 2397 3694 1650 p 2 0 3225 375 14469 4147 p 2 0 2975 625 10763 3722 p 2 0 2018 1582 6054 2521 p 2 0 1046 2554 3681 1522 p 2 0 1265 2335 4192 1755 p 2 0 213 3387 1335 697 p 2 0 706 2894 2391 1159 p 2 0 602 2998 2055 1056 p 2 0 473 3127 1736 920 p 2 0 560 3040 2055 1011 p 2 0 140 3460 1098 616 p 2 0 500 3100 1839 964 p 2 0 722 2878 2242 1167 p 2 0 1698 1902 5007 2204 p 2 0 1131 2469 2955 1584 p 2 0 538 3062 2165 1023 p 2 0 656 2944 2364 1130 p 2 0 110 3490 854 578 p 2 0 398 3202 1592 853 p 2 0 356 3244 1324 806 p 2 0 316 3284 1288 768 p 2 0 272 3328 1135 720 p 2 0 196 3404 953 650 p 2 0 312 3288 1171 756 p 2 0 386 3214 1422 829 p 2 0 1319 2281 3695 1793 p 2 0 1269 2331 3583 1707 p 2 0 1284 2316 4062 1699 i 2 3600 0 0 45623 11735 p 2 15 3533 52 16988 5434 p 2 0 2961 639 7013 3579 p 2 330 3010 260 29408 6567 p 2 0 2940 660 7579 3644 p 2 0 2885 715 6763 3503 p 2 367 2773 460 28947 6293 p 2 0 3065 535 8555 4059 p 2 368 2703 529 32716 6097 p 2 0 2640 960 6139 3380 p 2 0 2902 698 7349 3560 p 2 0 2858 742 6614 3478 p 2 463 2502 635 29521 5614 p 2 0 2932 668 7885 3680 p 2 0 2596 1004 5899 3160 p 2 294 2647 659 16857 4747 p 2 0 2698 902 6094 3299 p 2 0 2648 952 5569 3178 p 2 84 2530 986 11364 3614 p 2 0 2883 717 6260 3450 p 2 21 2641 938 8049 3350 p 2 0 3068 532 6759 3686 p 2 0 2955 645 5925 3504 p 2 5 2677 918 5945 3270 p 2 0 2690 910 5409 3211 p 2 0 2562 1038 4729 2997 p 2 0 2593 1007 4922 3057 p 2 0 2535 1065 4861 2985 i 2 3600 0 0 75247 12856 p 2 0 3584 16 26330 5412 p 2 0 3267 333 10606 4051 p 2 0 3292 308 12214 4250 p 2 0 3336 264 11900 4258 p 2 0 3360 240 12696 4269 p 2 0 2962 638 9925 3638 p 2 0 2956 644 8980 3678 p 2 0 3067 533 9540 3874 p 2 0 3115 485 9873 3888 p 2 0 2745 855 7546 3361 p 2 0 2994 606 8716 3700 p 2 0 2863 737 8732 3556 p 2 0 2872 728 7981 3517 p 2 0 2107 1493 5368 2607 p 2 0 2653 947 7347 3263 p 2 0 2779 821 8274 3467 p 2 0 2701 899 7625 3284 p 2 0 2941 659 9235 3603 p 2 0 2582 1018 6971 3113 p 2 0 2674 926 7349 3226 p 2 0 2786 814 7423 3368 p 2 0 2370 1230 6141 2908 p 2 0 2648 952 7269 3232 p 2 0 2439 1161 6414 3012 p 2 0 2735 865 7465 3301 p 2 0 1882 1718 4799 2336 p 2 0 2101 1499 5329 2548 p 2 0 2724 876 7466 3304 p 2 0 2693 907 7899 3255 p 2 0 2493 1107 7443 3037 p 2 0 2709 891 7835 3294 p 2 0 2606 994 7403 3156 p 2 0 2505 1095 6892 3023 p 2 0 2339 1261 6117 2885 p 2 0 2805 795 7833 3408 p 2 0 2539 1061 6962 3108 p 2 0 2577 1023 7033 3139 p 2 0 2513 1087 6544 3060 p 2 0 2484 1116 6723 3057 p 2 0 2882 718 8331 3535 p 2 0 2537 1063 6874 3096 p 2 0 2909 691 8925 3545 p 2 0 2794 806 7805 3372 p 2 0 2529 1071 6502 3050 p 2 0 2616 984 6893 3155 p 2 0 2594 1006 6691 3162 p 2 0 2633 967 6811 3202 p 2 0 2473 1127 6695 3026 p 2 0 2499 1101 6567 3062 p 2 0 2455 1145 6181 3005 p 2 0 2477 1123 6142 3012 p 2 0 2680 920 7241 3255 p 2 0 2603 997 7408 3163 p 2 0 2765 835 8126 3355 p 2 0 2440 1160 6763 2940 p 2 0 2702 898 8059 3280 p 2 0 2718 882 7916 3324 p 2 0 2470 1130 6867 3035 p 2 0 2720 880 7248 3299 p 2 0 2405 1195 6456 2954 p 2 0 2699 901 7483 3313 p 2 0 2461 1139 6521 3005 p 2 0 2628 972 7403 3199 i 2 3600 0 0 64014 12324 p 2 2 3552 46 19594 5431 p 2 0 3370 230 11260 4441 p 2 0 3008 592 8549 3784 p 2 0 2994 606 8719 3752 p 2 0 3181 419 9523 3974 p 2 0 2992 608 8743 3715 p 2 0 3034 566 8546 3779 p 2 0 2818 782 7825 3518 p 2 0 2717 883 6950 3344 p 2 0 2694 906 7561 3372 p 2 0 2701 899 7334 3360 p 2 0 2960 640 8592 3698 p 2 0 2794 806 7536 3418 p 2 0 3099 501 9645 3908 p 2 0 2727 873 7259 3387 p 2 0 2713 887 7561 3366 p 2 0 2836 764 7848 3537 p 2 0 2823 777 7879 3500 p 2 0 2895 705 7478 3560 p 2 0 2765 835 7660 3429 p 2 0 2856 744 7737 3527 p 2 0 2519 1081 6357 3101 p 2 0 2683 917 7263 3297 p 2 0 2826 774 7960 3518 p 2 0 2823 777 7953 3469 p 2 0 3084 516 9067 3866 p 2 0 2784 816 7694 3463 p 2 0 2891 709 8176 3558 p 2 0 2889 711 7656 3530 p 2 0 2433 1167 6362 3008 p 2 0 2870 730 8126 3548 p 2 0 2723 877 7377 3394 p 2 0 2696 904 7565 3330 p 2 0 2798 802 7923 3506 p 2 0 2661 939 6968 3281 p 2 0 2851 749 8400 3590 p 2 0 2787 813 7678 3412 p 2 0 2776 824 7996 3441 p 2 0 2908 692 8058 3620 p 2 0 2846 754 8140 3523 p 2 0 2888 712 7750 3545 p 2 0 2517 1083 6616 3122 p 2 0 2828 772 7543 3473 p 2 0 2610 990 7098 3259 p 2 0 2706 894 7743 3394 p 2 0 2452 1148 6328 3057 p 2 0 2608 992 7230 3263 p 2 0 2909 691 8410 3631 p 2 0 2663 937 7214 3289 p 2 0 3018 582 9181 3816 p 2 0 2679 921 7005 3320 p 2 0 2706 894 7356 3344 p 2 0 2847 753 7873 3501 p 2 0 2701 899 7897 3399 p 2 0 2692 908 6898 3307 p 2 0 2637 963 7456 3314 p 2 0 2737 863 7650 3456 p 2 0 2528 1072 6671 3147 p 2 0 2530 1070 6893 3146 p 2 0 2785 815 7990 3484 p 2 0 2644 956 7535 3277 p 2 0 2912 688 8625 3621 p 2 0 2767 833 7497 3424 p 2 0 2743 857 7672 3406 p 2 0 2863 737 7528 3497 p 2 0 2351 1249 6011 2926 p 2 0 2686 914 7198 3312 p 2 0 2692 908 7429 3376 p 2 0 2731 869 7290 3389 p 2 0 2649 951 7297 3316 p 2 0 2474 1126 6398 3044 p 2 0 2742 858 7786 3428 p 2 0 2628 972 6999 3257 p 2 0 3003 597 8873 3780 p 2 0 2805 795 7524 3471 p 2 0 2890 710 7892 3591 p 2 0 2876 724 7598 3577 p 2 0 2526 1074 6357 3138 p 2 0 2769 831 7312 3423 p 2 0 2559 1041 6789 3196 p 2 0 2649 951 7410 3330 p 2 0 2782 818 7786 3480 p 2 0 2734 866 7206 3396 p 2 0 2905 695 8354 3625 p 2 0 2722 878 7351 3351 p 2 0 2804 796 7856 3461 p 2 0 2830 770 8024 3557 p 2 0 2728 872 7670 3397 p 2 0 2870 730 8209 3572 p 2 0 2441 1159 6185 3010 p 2 0 2763 837 7863 3427 p 2 0 2749 851 7864 3456 p 2 0 2724 876 7919 3401 p 2 0 2468 1132 6651 3051 p 2 0 2653 947 7450 3284 p 2 0 2677 923 7662 3341 p 2 0 2725 875 7878 3376 p 2 0 3074 526 9483 3879 p 2 0 2651 949 7343 3314 p 2 0 2866 734 8239 3559 p 2 0 2881 719 7986 3608 p 2 0 2520 1080 7027 3127 p 2 0 2799 801 7705 3454 p 2 0 2729 871 7805 3414 p 2 0 2820 780 8065 3507 p 2 0 2530 1070 6597 3158 p 2 0 2788 812 7938 3483 p 2 0 2946 654 8829 3697 p 2 0 2761 839 7952 3415 p 2 0 2821 779 8110 3519 p 2 0 2654 946 7392 3287 i 2 3600 0 0 76472 12879 p 2 0 3589 11 25836 5381 p 2 0 3298 302 10788 4127 p 2 0 3179 421 10514 3970 p 2 0 2500 1100 6511 3025 p 2 0 3004 596 9917 3671 p 2 0 2592 1008 7155 3153 p 2 0 2814 786 7966 3400 p 2 0 3050 550 10698 3845 p 2 0 2968 632 9188 3693 p 2 0 2967 633 9376 3677 p 2 0 2695 905 7938 3297 p 2 0 1994 1606 5142 2467 p 2 0 2907 693 8464 3536 p 2 0 2689 911 7434 3296 p 2 0 2748 852 7717 3346 p 2 0 2707 893 7527 3303 p 2 0 2712 888 7310 3271 p 2 0 2684 916 7454 3280 p 2 0 2555 1045 6552 3116 p 2 0 2897 703 8572 3553 p 2 0 2802 798 7442 3393 p 2 0 2946 654 9575 3681 p 2 0 2806 794 8593 3475 p 2 0 2649 951 7643 3230 p 2 0 2599 1001 6788 3137 p 2 0 2216 1384 5524 2715 p 2 0 2540 1060 6688 3083 p 2 0 2537 1063 6897 3109 p 2 0 2600 1000 6762 3155 p 2 0 2518 1082 6415 3056 p 2 0 2641 959 7317 3230 p 2 0 2621 979 6998 3175 p 2 0 3259 341 11330 4128 p 2 0 2314 1286 6262 2815 p 2 0 2473 1127 6929 3017 p 2 0 2230 1370 5704 2706 p 2 0 2699 901 7470 3250 p 2 0 2555 1045 6762 3072 p 2 0 2480 1120 6119 3003 p 2 0 2535 1065 6624 3093 p 2 0 2563 1037 6545 3103 p 2 0 2386 1214 6076 2927 p 2 0 2519 1081 6700 3068 p 2 0 2282 1318 5870 2843 p 2 0 2896 704 9175 3605 i 2 3600 0 0 59023 12432 p 2 1 3573 26 33810 5879 p 2 0 3518 82 24776 5080 p 2 0 3483 117 25067 4842 p 2 0 3503 97 27767 4861 p 2 0 3550 50 28168 4993 p 2 0 3502 98 24182 4844 p 2 0 3457 143 25388 4954 p 2 0 3500 100 26248 4818 p 2 0 3502 98 29595 5107 p 2 0 3486 114 26659 4970 p 2 0 3522 78 25801 4988 p 2 0 3490 110 25271 4932 p 2 0 3540 60 28839 5042 p 2 0 3509 91 29101 4914 p 2 0 3527 73 25013 4888 p 2 0 3494 106 24853 4793 p 2 0 3522 78 25148 4911 p 2 0 3512 88 27014 4907 p 2 0 3510 90 27654 5003 p 2 0 3473 127 25691 4829 p 2 0 3476 124 26384 5047 p 2 0 3530 70 26409 5046 p 2 0 3525 75 30464 5122 p 2 0 3503 97 27314 5007 p 2 0 3526 74 26913 5117 p 2 0 3499 101 25680 4894 p 2 0 3531 69 26454 4896 p 2 0 3475 125 30552 4894 p 2 0 3534 66 26296 5053 p 2 0 3487 113 24468 4908 p 2 0 3523 77 28369 5076 p 2 0 3451 149 29572 4904 p 2 0 3507 93 31055 5209 p 2 0 3508 92 26737 5057 p 2 0 3516 84 26966 5096 p 2 0 3546 54 28070 4977 p 2 0 3475 125 31652 5093 p 2 0 3539 61 28506 4865 p 2 0 3529 71 26261 4905 p 2 0 3514 86 28008 4878 p 2 0 3522 78 30690 5105 p 2 0 3520 80 29834 5105 p 2 0 3515 85 28035 5123 p 2 0 3507 93 26194 4900 p 2 0 3519 81 28283 5141 p 2 0 3523 77 29420 5023 p 2 0 3524 76 28688 5021 p 2 0 3512 88 25425 4971 p 2 0 3531 69 26990 5102 p 2 0 3491 109 26931 4831 p 2 0 3522 78 29400 4908 p 2 0 3469 131 26935 4851 p 2 0 3534 66 24527 4928 p 2 0 3512 88 26365 5000 p 2 0 3523 77 28333 5142 p 2 0 3496 104 28582 4912 p 2 0 3495 105 26133 5130 p 2 0 3548 52 24756 4970 p 2 0 3494 106 27157 4965 p 2 0 3523 77 28711 4934 p 2 0 3473 127 29034 5036 p 2 0 3503 97 25030 4866 p 2 0 3475 125 24164 4851 p 2 0 3511 89 28724 4926 p 2 0 3539 61 28947 4942 p 2 0 3532 68 25703 4900 p 2 0 3444 156 25240 4842 p 2 0 3489 111 25767 4780 p 2 0 3483 117 29750 5070 p 2 0 3534 66 28699 4957 p 2 0 3480 120 26396 4958 p 2 0 3523 77 25741 4956 p 2 0 3503 97 27507 5095 p 2 0 3515 85 30391 4879 p 2 0 3502 98 25483 4771 p 2 0 3461 139 26181 4759 p 2 0 3519 81 24522 4810 p 2 0 3490 110 26050 4804 p 2 0 3461 139 30604 4981 p 2 0 3440 160 25277 4780 p 2 0 3437 163 25599 5047 p 2 0 3480 120 25903 4843 p 2 0 3502 98 28021 4923 i 2 3600 0 0 69000 12820 p 2 146 3450 4 45227 7139 p 2 0 3535 65 31671 5213 p 2 0 3514 86 32264 4950 p 2 0 3516 84 29977 5013 p 2 0 3485 115 30494 5112 p 2 0 3497 103 31790 5090 p 2 0 3497 103 32779 5023 p 2 0 3527 73 30527 4969 p 2 0 3491 109 30113 5127 p 2 0 3483 117 30543 5079 p 2 0 3498 102 34251 5227 p 2 0 3498 102 32826 5026 p 2 0 3496 104 30815 4996 p 2 0 3495 105 29921 4782 p 2 0 3518 82 30813 4859 p 2 0 3457 143 33794 4861 p 2 0 3435 165 30301 4951 p 2 0 3454 146 30158 4879 p 2 0 3436 164 31249 4855 p 2 0 3447 153 32303 4783 p 2 0 3457 143 30300 4949 p 2 0 3471 129 29477 4957 p 2 0 3473 127 30084 4943 p 2 0 3464 136 32744 4924 p 2 0 3471 129 29965 4982 p 2 0 3489 111 27054 4705 p 2 0 3494 106 27887 4728 p 2 0 3474 126 30704 4745 p 2 0 3475 125 30046 4874 p 2 0 3493 107 26540 4779 p 2 0 3484 116 28267 4817 p 2 0 3505 95 29247 4805 p 2 0 3489 111 30447 4901 p 2 0 3506 94 27071 4766 p 2 0 3502 98 27929 4791 p 2 0 3550 50 29858 4952 p 2 0 3543 57 32312 5051 p 2 0 3507 93 26375 4763 p 2 0 3512 88 27072 4735 p 2 0 3491 109 28270 4700 p 2 0 3542 58 32111 4924 p 2 0 3529 71 27989 4896 p 2 0 3531 69 26999 4859 p 2 0 3472 128 28096 4820 p 2 0 3530 70 32213 5134 p 2 0 3573 27 29088 5034 p 2 0 3565 35 28829 5079 p 2 0 3559 41 28426 4978 p 2 0 3536 64 32569 5087 p 2 0 3563 37 30594 4966 p 2 0 3549 51 26886 4959 p 2 0 3544 56 29871 5061 p 2 0 3504 96 30678 5065 p 2 0 3543 57 32098 5058 p 2 0 3523 77 29037 5091 p 2 0 3566 34 28647 5018 p 2 0 3468 132 31780 5047 p 2 0 3561 39 34215 5129 p 2 0 3468 132 29182 5006 p 2 0 3552 48 30419 5040 p 2 0 3464 136 33007 5009 p 2 0 3548 52 34706 4855 p 2 0 3497 103 30103 4812 p 2 0 3540 60 29128 4843 p 2 0 3483 117 31406 4931 p 2 0 3537 63 33113 4996 p 2 0 3491 109 32564 4965 p 2 0 3547 53 28919 4934 p 2 0 3530 70 30589 5044 p 2 0 3518 82 32047 4920 p 2 0 3493 107 31431 4912 p 2 0 3517 83 29784 4907 p 2 0 3493 107 30574 4960 p 2 0 3526 74 31237 4787 p 2 0 3521 79 32432 4788 p 2 0 3510 90 28244 4802 p 2 0 3516 84 29291 4839 p 2 0 3499 101 31924 4869 p 2 0 3457 143 33814 4829 p 2 0 3492 108 28847 4742 p 2 0 3472 128 29506 5007 p 2 0 3511 89 30400 4818 p 2 0 3484 116 32628 4804 i 2 3600 0 0 71798 12788 p 2 7 3592 1 46578 6719 p 2 0 3562 38 27664 5160 p 2 0 3519 81 24997 4895 p 2 0 3574 26 28437 5059 p 2 0 3565 35 29369 5088 p 2 0 3539 61 28166 5023 p 2 0 3497 103 27544 5044 p 2 0 3521 79 26550 4973 p 2 0 3524 76 28907 5195 p 2 0 3534 66 30658 5091 p 2 0 3492 108 30032 5194 p 2 0 3517 83 27061 5060 p 2 0 3502 98 28880 5194 p 2 0 3532 68 29681 4909 p 2 0 3535 65 28247 4913 p 2 0 3511 89 27731 4904 p 2 0 3522 78 27199 5080 p 2 0 3502 98 27461 4976 p 2 0 3490 110 31179 4965 p 2 0 3483 117 28315 4893 p 2 0 3460 140 28053 5067 p 2 0 3500 100 26353 4994 p 2 0 3542 58 29232 5086 p 2 0 3516 84 32591 5030 p 2 0 3508 92 27835 5084 p 2 0 3508 92 25365 4799 p 2 0 3522 78 26412 4834 p 2 0 3504 96 29965 4849 p 2 0 3533 67 30730 5101 p 2 0 3553 47 27009 4985 p 2 0 3521 79 26313 4940 p 2 0 3529 71 28110 4887 p 2 0 3502 98 32020 5151 p 2 0 3540 60 28661 5053 p 2 0 3501 99 27435 5076 p 2 0 3514 86 26566 4965 p 2 0 3529 71 29911 5044 p 2 0 3552 48 30590 4908 p 2 0 3542 58 27347 5020 p 2 0 3540 60 27195 4998 p 2 0 3525 75 28425 5102 p 2 0 3563 37 31008 4947 p 2 0 3489 111 28644 4881 p 2 0 3544 56 27642 5009 p 2 0 3505 95 28938 5171 p 2 0 3547 53 28049 5006 p 2 0 3555 45 32880 5128 p 2 0 3556 44 28242 4977 p 2 0 3487 113 29098 5083 p 2 0 3516 84 27611 4810 p 2 0 3509 91 28191 4854 p 2 0 3536 64 32165 4998 p 2 0 3528 72 27654 5058 p 2 0 3549 51 25711 4879 p 2 0 3524 76 28834 4902 p 2 0 3490 110 30022 4804 p 2 0 3486 114 32071 5035 p 2 0 3525 75 26610 4845 p 2 0 3544 56 27437 5032 p 2 0 3509 91 29349 4954 p 2 0 3523 77 33017 5175 p 2 0 3536 64 28429 4747 p 2 0 3532 68 26266 4777 p 2 0 3530 70 27929 4813 p 2 0 3529 71 29916 4863 p 2 0 3538 62 30085 4885 p 2 0 3540 60 29020 4994 p 2 0 3548 52 27077 4837 p 2 0 3489 111 29311 5164 p 2 0 3559 41 32329 5023 p 2 0 3523 77 29410 5036 p 2 0 3529 71 28425 5037 p 2 0 3509 91 29178 5166 p 2 0 3498 102 29356 4793 p 2 0 3540 60 31988 4874 p 2 0 3532 68 28751 4913 p 2 0 3527 73 26184 4864 p 2 0 3491 109 27113 4833 p 2 0 3487 113 29968 4950 p 2 0 3514 86 30880 4943 p 2 0 3539 61 28854 5222 p 2 0 3527 73 26676 4948 p 2 0 3529 71 29555 4995 i 2 3600 0 0 77559 13010 p 2 0 2998 602 12156 3810 p 2 0 3570 30 28142 4843 p 2 0 3553 47 28214 4879 p 2 0 3585 15 31544 5081 p 2 0 3572 28 33098 5075 p 2 0 3549 51 30820 5002 p 2 0 3546 54 29682 5095 p 2 0 3554 46 30222 4960 p 2 0 3532 68 34247 5212 p 2 0 3558 42 32381 5167 p 2 0 3557 43 29548 5239 p 2 0 3564 36 30817 5147 p 2 0 3542 58 34002 5236 p 2 0 3562 38 34208 4992 p 2 0 3560 40 28318 4848 p 2 0 3551 49 29597 4956 p 2 0 3571 29 32160 5026 p 2 0 3558 42 33383 5011 p 2 0 3559 41 28776 4979 p 2 0 3543 57 29021 4860 p 2 0 3544 56 32251 5204 p 2 0 3566 34 34322 5093 p 2 0 3545 55 29952 4984 p 2 0 3561 39 29446 5107 p 2 0 3559 41 32005 5176 p 2 1 3568 31 32549 4923 p 2 0 3561 39 31427 4906 p 2 0 3574 26 28534 4885 p 2 0 3546 54 30655 5084 p 2 0 3569 31 33042 5071 p 2 0 3518 82 32765 4914 p 2 0 3562 38 28621 4977 p 2 0 3549 51 30621 5092 p 2 0 3576 24 32134 5114 p 2 1 3556 43 34428 5169 p 2 0 3581 19 30147 5147 p 2 0 3549 51 31260 5198 p 2 0 3583 17 31404 4925 p 2 0 3556 44 32691 4856 p 2 0 3579 21 30814 4974 p 2 0 3546 54 30206 5108 p 2 0 3570 30 32397 5056 p 2 0 3558 42 34747 5036 p 2 1 3578 21 31050 4985 p 2 0 3574 26 31498 5256 p 2 0 3568 32 31982 5162 p 2 0 3535 65 33092 5072 p 2 0 3568 32 34727 5165 p 2 0 3552 48 30760 5143 p 2 0 3585 15 31161 4797 p 2 0 3550 50 32464 4918 p 2 0 3571 29 33810 4901 p 2 0 3566 34 31446 5071 p 2 0 3573 27 31347 5012 p 2 0 3549 51 33315 5013 p 2 0 3541 59 34737 4997 p 2 0 3551 49 31089 5235 p 2 0 3567 33 31923 5122 p 2 0 3577 23 33865 5147 p 2 0 3568 32 36016 5068 p 2 0 3557 43 32610 5097 p 2 0 3576 24 29824 4802 p 2 0 3548 52 31329 4835 p 2 0 3541 59 34226 4879 p 2 0 3536 64 33432 5062 p 2 0 3529 71 31362 5002 p 2 0 3560 40 31787 4972 p 2 0 3549 51 34029 5032 p 2 0 3543 57 35537 5326 p 2 0 3579 21 31496 5225 p 2 0 3556 44 31922 5081 p 2 0 3553 47 34374 5034 p 2 0 3563 37 37459 5161 p 2 0 3561 39 30709 4806 p 2 0 3562 38 30313 4864 p 2 0 3569 31 34598 4974 p 2 0 3554 46 37303 5167 p 2 0 3547 53 31684 4997 p 2 0 3566 34 32404 5052 p 2 0 3545 55 33379 4997 p 2 0 3565 35 37378 5194 p 2 0 3583 17 33081 4961 p 2 0 3580 20 31210 5117 i 2 3600 0 0 82745 13173 p 2 0 3597 3 37372 5817 p 2 0 3560 40 26470 4798 p 2 0 3568 32 26447 4824 p 2 0 3564 36 30160 4936 p 2 0 3584 16 30886 4938 p 2 0 3559 41 25851 4831 p 2 0 3567 33 28270 5005 p 2 0 3546 54 25850 4710 p 2 0 3563 37 32505 5117 p 2 0 3524 76 29827 4854 p 2 0 3547 53 27247 5016 p 2 0 3527 73 26148 4900 p 2 0 3548 52 27920 4974 p 2 0 3549 51 29542 4919 p 2 0 3560 40 28968 4874 p 2 0 3561 39 24891 4803 p 2 0 3566 34 26606 4830 p 2 0 3571 29 26607 4957 p 2 0 3572 28 29889 4864 p 2 0 3569 31 24716 4730 p 2 0 3565 35 25076 5035 p 2 0 3567 33 26125 4758 p 2 0 3555 45 29153 4888 p 2 0 3552 48 27159 4932 p 2 0 3566 34 26499 5118 p 2 0 3587 13 25491 4963 p 2 0 3566 34 26945 4963 p 2 0 3571 29 30467 4938 p 2 0 3564 36 28138 5020 p 2 0 3584 16 27012 4976 p 2 0 3574 26 28335 4996 p 2 0 3559 41 29937 4858 p 2 0 3571 29 32413 5225 p 2 0 3584 16 27639 4996 p 2 0 3552 48 27575 4921 p 2 0 3567 33 27424 4977 p 2 0 3558 42 31688 5000 p 2 0 3565 35 30212 4728 p 2 0 3575 25 26202 4822 p 2 0 3555 45 27925 4910 p 2 0 3562 38 29229 5020 p 2 0 3556 44 30440 5008 p 2 0 3560 40 29539 5080 p 2 0 3541 59 26303 4847 p 2 0 3536 64 29155 5132 p 2 0 3570 30 29027 4926 p 2 0 3576 24 31562 5014 p 2 0 3557 43 26460 4894 p 2 0 3541 59 28235 5174 p 2 0 3549 51 27394 4797 p 2 0 3549 51 28487 4753 p 2 0 3553 47 28565 4894 p 2 0 3557 43 27119 5023 p 2 0 3569 31 25415 4809 p 2 0 3586 14 28438 4998 p 2 0 3573 27 29601 4873 p 2 0 3563 37 27728 5100 p 2 0 3590 10 25266 4817 p 2 0 3573 27 27270 5041 p 2 0 3553 47 30055 5091 p 2 0 3565 35 30161 5051 p 2 0 3582 18 26521 4891 p 2 0 3584 16 25945 4964 p 2 0 3559 41 27504 4867 p 2 0 3566 34 29667 5012 p 2 0 3556 44 28185 4965 p 2 0 3553 47 27147 5042 p 2 0 3533 67 26801 4903 p 2 0 3551 49 28963 5182 p 2 0 3573 27 30168 4955 p 2 0 3567 33 28106 5081 p 2 0 3559 41 25792 5055 p 2 0 3538 62 29098 5133 p 2 0 3561 39 29678 4915 p 2 0 3572 28 28643 4936 p 2 0 3568 32 27733 5074 p 2 0 3541 59 27066 4969 p 2 0 3562 38 26904 4864 p 2 0 3553 47 32236 5072 p 2 0 3561 39 27261 4895 p 2 0 3560 40 27886 5190 p 2 0 3565 35 25943 4906 p 2 0 3560 40 28933 5066 i 2 3600 0 0 93859 13744 p 2 43 3554 3 40308 6260 p 2 0 3555 45 31795 4943 p 2 1 3574 25 33684 4959 p 2 0 3573 27 37060 5022 p 2 0 3578 22 34685 5170 p 2 0 3566 34 33100 5096 p 2 0 3555 45 33422 5132 p 2 0 3577 23 36143 5111 p 2 0 3564 36 37402 5328 p 2 0 3568 32 32977 5178 p 2 0 3553 47 31839 4985 p 2 0 3578 22 36018 5138 p 2 0 3556 44 37552 5359 p 2 0 3566 34 30560 5005 p 2 0 3547 53 30506 5026 p 2 0 3540 60 33296 5018 p 2 0 3565 35 34381 5137 p 2 0 3572 28 28755 5024 p 2 0 3558 42 29833 4953 p 2 0 3561 39 30771 4935 p 2 0 3569 31 33441 5079 p 2 0 3580 20 28768 5084 p 2 0 3573 27 29210 5149 p 2 0 3574 26 31484 5149 p 2 0 3575 25 34896 5118 p 2 0 3587 13 30433 4785 p 2 0 3590 10 27388 4806 p 2 0 3580 20 32084 5091 p 2 0 3586 14 32456 5166 p 2 0 3573 27 31981 5002 p 2 0 3561 39 29555 5071 p 2 0 3579 21 30100 4952 p 2 1 3556 43 33532 5229 p 2 0 3569 31 33615 5137 p 2 0 3580 20 27368 4878 p 2 0 3584 16 32963 5149 p 2 0 3575 25 37220 5419 p 2 0 3586 14 36787 4925 p 2 0 3577 23 30977 4899 p 2 0 3580 20 30598 4904 p 2 0 3580 20 32261 5014 p 2 2 3579 19 35960 5011 p 2 0 3574 26 32653 4991 p 2 0 3574 26 32115 5019 p 2 0 3578 22 35202 5340 p 2 0 3588 12 35677 5117 p 2 0 3584 16 33981 4901 p 2 0 3586 14 33504 5143 p 2 0 3593 7 34939 5358 p 2 0 3591 9 34622 4950 p 2 0 3586 14 33449 4867 p 2 0 3593 7 31078 4932 p 2 0 3584 16 33241 5215 p 2 0 3595 5 34784 5124 p 2 0 3587 13 35432 4984 p 2 0 3584 16 29713 4968 p 2 0 3584 16 32347 5161 p 2 0 3589 11 32845 5175 p 2 0 3582 18 34912 5083 p 2 0 3587 13 33202 5193 p 2 0 3591 9 33059 5371 p 2 0 3588 12 31577 4929 p 2 0 3593 7 31671 4798 p 2 0 3588 12 33283 4968 p 2 0 3588 12 29995 5021 p 2 0 3593 7 33560 5169 p 2 0 3576 24 35222 5108 p 2 0 3587 13 32267 5008 p 2 0 3577 23 31737 5265 p 2 0 3592 8 33691 5219 p 2 0 3586 14 33031 5022 p 2 0 3592 8 36479 5245 p 2 0 3584 16 32403 5319 p 2 0 3588 12 30530 4849 p 2 0 3588 12 31836 4898 p 2 0 3587 13 35145 4925 p 2 0 3590 10 31283 5104 p 2 0 3595 5 30797 4973 p 2 0 3588 12 32388 4989 p 2 0 3594 6 33271 5042 p 2 0 3589 11 31857 5251 p 2 0 3587 13 31059 4999 p 2 0 3594 6 32146 5074 i 2 3600 0 0 88702 13504 p 2 0 3034 566 12979 3860 p 2 0 3544 56 26032 4637 p 2 0 3543 57 23943 4564 p 2 0 3573 27 26818 4857 p 2 0 3546 54 27560 5007 p 2 0 3529 71 27440 4907 p 2 0 3549 51 28793 4945 p 2 0 3526 74 24763 4730 p 2 0 3547 53 28575 5192 p 2 0 3547 53 26764 5026 p 2 0 3548 52 30333 5061 p 2 0 3529 71 28802 5071 p 2 0 3561 39 28513 5084 p 2 0 3544 56 25590 4790 p 2 0 3561 39 25966 4814 p 2 0 3561 39 29429 4802 p 2 0 3554 46 26954 5110 p 2 0 3566 34 26344 4914 p 2 0 3563 37 25872 4743 p 2 0 3561 39 27281 4812 p 2 0 3574 26 30433 5046 p 2 0 3588 12 26590 5062 p 2 0 3575 25 26159 5076 p 2 0 3572 28 28142 5134 p 2 0 3565 35 31983 5372 p 2 0 3577 23 28200 4932 p 2 0 3557 43 26663 4899 p 2 0 3566 34 27318 4853 p 2 0 3561 39 27920 5091 p 2 0 3565 35 30310 5031 p 2 0 3536 64 26997 4986 p 2 0 3573 27 25255 4901 p 2 0 3574 26 27850 5101 p 2 0 3567 33 29473 5084 p 2 0 3539 61 28195 5049 p 2 0 3560 40 27991 5147 p 2 0 3534 66 29230 5242 p 2 0 3553 47 27252 4893 p 2 0 3524 76 26741 4667 p 2 0 3561 39 27874 4916 p 2 0 3559 41 28433 5071 p 2 0 3544 56 25561 4860 p 2 0 3567 33 27290 4824 p 2 0 3557 43 27736 4772 p 2 0 3564 36 27577 5228 p 2 0 3582 18 27275 4975 p 2 0 3568 32 26823 5050 p 2 0 3564 36 29008 5136 p 2 0 3592 8 33627 5357 p 2 0 3565 35 25940 4900 p 2 0 3564 36 26006 4965 p 2 0 3568 32 27661 4863 p 2 0 3564 36 30495 5226 p 2 0 3593 7 29467 5061 p 2 0 3557 43 26019 4887 p 2 0 3548 52 26154 4891 p 2 0 3563 37 27843 5094 p 2 0 3555 45 29483 5012 p 2 0 3589 11 28011 4996 p 2 0 3568 32 28389 5170 p 2 0 3589 11 30012 5359 p 2 0 3590 10 29349 4992 p 2 0 3583 17 28295 4972 p 2 0 3566 34 27606 4875 p 2 0 3580 20 27374 5129 p 2 0 3582 18 27568 5031 p 2 0 3575 25 30181 5093 p 2 0 3574 26 26794 4944 p 2 0 3572 28 28702 5200 p 2 0 3575 25 26342 5062 p 2 0 3573 27 26835 5008 p 2 0 3581 19 30705 5086 p 2 0 3590 10 30333 5406 p 2 0 3586 14 24921 4801 p 2 0 3587 13 25894 4871 p 2 0 3573 27 28654 4832 p 2 0 3571 29 29800 5145 p 2 0 3569 31 27312 4844 p 2 0 3575 25 26093 4796 p 2 0 3583 17 28017 4883 p 2 0 3565 35 32403 5222 p 2 0 3593 7 28446 4844 p 2 0 3583 17 28885 5002 i 2 3600 0 0 117798 14628 p 2 0 3305 295 14983 4261 p 2 0 2400 1200 7298 2961 p 2 0 2931 669 10116 3635 p 2 0 1621 1979 4702 2101 p 2 0 2690 910 9104 3298 p 2 0 1790 1810 5348 2297 p 2 0 2422 1178 7468 2946 p 2 0 1731 1869 4988 2182 p 2 0 3092 508 11152 3959 p 2 0 1526 2074 4416 2009 p 2 0 3379 221 16042 4516 p 2 0 2943 657 10877 3704 p 2 0 1716 1884 5138 2193 p 2 0 1624 1976 4752 2068 p 2 0 2297 1303 6978 2810 p 2 0 1264 2336 3456 1697 p 2 0 1379 2221 4014 1831 p 2 0 1006 2594 2888 1444 p 2 0 1195 2405 3432 1638 p 2 0 762 2838 2341 1212 p 2 0 2647 953 8366 3242 p 2 0 1249 2351 3575 1726 p 2 0 1915 1685 5465 2391 p 2 0 2107 1493 6125 2601 p 2 0 935 2665 2684 1375 p 2 0 1189 2411 3428 1630 p 2 0 1700 1900 4831 2172 p 2 0 1183 2417 3307 1634 p 2 0 961 2639 2755 1412 p 2 0 878 2722 2558 1323 p 2 0 784 2816 2417 1247 p 2 0 644 2956 2061 1093 p 2 0 1655 1945 4448 2090 p 2 0 1052 2548 2861 1496 p 2 0 2420 1180 7010 2996 p 2 0 1762 1838 4894 2255 p 2 0 850 2750 2472 1300 p 2 0 941 2659 2679 1388 p 2 0 1044 2556 2981 1493 p 2 0 1096 2504 3045 1525 p 2 0 1083 2517 3064 1527 p 2 0 693 2907 2215 1144 p 2 0 814 2786 2259 1259 p 2 0 546 3054 1825 998 p 2 0 1481 2119 3981 1923 p 2 0 921 2679 2608 1368 p 2 0 1219 2381 3343 1666 p 2 0 1435 2165 3924 1874 p 2 0 631 2969 1916 1073 p 2 0 883 2717 2598 1340 p 2 0 1039 2561 3184 1492 p 2 0 938 2662 2657 1374 p 2 0 1004 2596 2875 1459 p 2 0 686 2914 1979 1127 p 2 0 741 2859 2039 1180 p 2 0 734 2866 2281 1179 p 2 0 962 2638 2706 1393 p 2 0 1222 2378 3190 1656 p 2 0 2160 1440 5961 2699 p 2 0 1635 1965 4446 2118 p 2 0 613 2987 1897 1066 p 2 0 807 2793 2337 1260 p 2 0 991 2609 2627 1443 p 2 0 549 3051 1747 1003 p 2 0 1118 2482 3080 1568 p 2 0 873 2727 2526 1321 p 2 0 681 2919 1860 1115 p 2 0 635 2965 1749 1074 p 2 0 869 2731 2415 1306 p 2 0 1235 2365 3157 1661 p 2 0 2153 1447 5880 2689 p 2 0 1621 1979 4410 2090 p 2 0 755 2845 2187 1190 p 2 0 784 2816 2209 1238 p 2 0 1020 2580 2696 1450 p 2 0 712 2888 2055 1156 p 2 0 701 2899 2233 1158 p 2 0 942 2658 2594 1377 p 2 0 951 2649 2527 1384 p 2 0 621 2979 1776 1065 p 2 0 954 2646 2563 1381 p 2 0 668 2932 2018 1117 p 2 0 3502 98 24654 5260 i 2 3600 0 0 77621 12632 p 2 9 3591 0 46433 6562 p 2 0 3505 95 29354 4784 p 2 0 3494 106 28988 4528 p 2 0 3467 133 30434 4571 p 2 0 3484 116 31027 4824 p 2 0 3456 144 29553 4737 p 2 0 3465 135 30379 4625 p 2 0 3457 143 30390 4627 p 2 0 3477 123 31464 4805 p 2 0 3472 128 29303 4673 p 2 0 3511 89 31414 4659 p 2 0 3453 147 31006 4637 p 2 0 3480 120 29731 4616 p 2 0 3432 168 29420 4363 p 2 0 3479 121 29857 4435 p 2 0 3451 149 30683 4492 p 2 0 3461 139 31392 4618 p 2 0 3414 186 29442 4587 p 2 0 3466 134 31032 4539 p 2 0 3412 188 30672 4503 p 2 0 3469 131 31827 4679 p 2 0 3435 165 31155 4596 p 2 0 3458 142 31567 4565 p 2 0 3415 185 31282 4608 p 2 0 3416 184 31170 4563 p 2 0 3433 167 29197 4415 p 2 0 3447 153 31804 4465 p 2 0 3413 187 31111 4431 p 2 0 3444 156 30974 4512 p 2 0 3435 165 30256 4581 p 2 0 3435 165 31910 4517 p 2 0 3410 190 31644 4472 p 2 0 3418 182 32177 4588 p 2 0 3405 195 31204 4601 p 2 0 3440 160 33352 4606 p 2 0 3394 206 31223 4566 p 2 0 3434 166 32193 4534 p 2 0 3415 185 30708 4389 p 2 0 3444 156 33008 4458 p 2 0 3412 188 33488 4487 p 2 0 3445 155 32548 4581 p 2 0 3382 218 32648 4560 p 2 0 3434 166 32563 4529 p 2 0 3367 233 33646 4536 p 2 0 3390 210 33956 4579 p 2 0 3432 168 33479 4567 p 2 0 3478 122 35753 4685 p 2 0 3405 195 36086 4886 p 2 0 3453 147 36454 5006 p 2 0 3441 159 35801 4917 p 2 0 3448 152 36800 4888 p 2 0 3402 198 37514 5040 p 2 0 3447 153 37040 4951 p 2 0 3401 199 36083 5116 p 2 0 3452 148 37357 5034 p 2 0 3384 216 36413 4983 p 2 0 3430 170 37436 5008 p 2 0 3394 206 35420 5057 p 2 0 3439 161 38772 5068 p 2 0 3392 208 36202 4999 p 2 0 3422 178 36996 5066 p 2 0 3407 193 34948 4991 p 2 0 3445 155 37950 4991 p 2 0 3356 244 36207 4915 p 2 0 3428 172 36614 4961 p 2 0 3421 179 35267 5080 p 2 0 3438 162 37919 5017 p 2 0 3359 241 37358 5032 p 2 0 3448 152 36054 5042 p 2 0 3442 158 36031 5040 p 2 0 3438 162 37392 5017 p 2 0 3371 229 34627 4990 p 2 0 3450 150 37281 5079 p 2 0 3422 178 33362 4873 p 2 0 3434 166 37041 4940 p 2 0 3344 256 36528 4968 p 2 0 3415 185 36382 5077 p 2 0 3412 188 35059 5033 p 2 0 3373 227 35746 4855 p 2 0 3368 232 36947 5013 p 2 0 3392 208 36876 5005 p 2 0 3342 258 35021 5032 p 2 0 3449 151 40093 5159 p 2 0 3385 215 36797 5093 p 2 0 3407 193 37457 5037 p 2 0 3415 185 35313 4928 p 2 0 3458 142 37209 4927 p 2 0 3383 217 37804 5017 p 2 0 3419 181 38879 5052 p 2 0 3348 252 36130 5031 p 2 0 3403 197 38908 4963 p 2 2 3328 270 38272 5048 p 2 0 3412 188 39216 5001 p 2 0 3371 229 35258 4951 p 2 0 3407 193 38922 4943 p 2 0 3337 263 36037 4768 p 2 0 3435 165 35423 4729 p 2 0 3367 233 33005 4545 p 2 0 3426 174 37652 4731 p 2 0 3314 286 35882 4646 p 2 2 3430 168 37804 4788 p 2 0 3383 217 33650 4722 p 2 0 3397 203 37412 4624 p 2 0 3332 268 36576 4630 p 2 0 3414 186 35979 4725 p 2 0 3408 192 36845 4718 p 2 0 3423 177 37154 4731 p 2 0 3309 291 35859 4713 p 2 0 3351 249 34963 4614 p 2 0 3379 221 35131 4498 p 2 0 3376 224 36256 4543 p 2 0 3328 272 37398 4570 p 2 0 3337 263 36547 4609 p 2 0 3334 266 35788 4597 p 2 0 3353 247 37313 4633 p 2 0 3289 311 38469 4646 p 2 0 3400 200 38354 4680 p 2 0 3321 279 36335 4679 p 2 0 3415 185 40906 4799 p 2 0 3301 299 37185 4621 p 2 0 3384 216 38183 4719 p 2 0 3307 293 36207 4513 p 2 0 3372 228 37923 4493 p 2 0 3341 259 39190 4580 p 2 0 3343 257 38340 4583 p 2 0 3327 273 36817 4578 p 2 0 3355 245 39853 4620 p 2 0 3270 330 39018 4577 p 2 0 3367 233 40026 4661 p 2 0 3335 265 37705 4600 p 2 1 3351 248 40671 4616 p 2 0 3310 290 39002 4595 p 2 0 3343 257 37474 4618 p 2 0 3348 252 39447 4495 p 2 0 3340 260 38491 4514 p 2 0 3283 317 39289 4501 p 2 0 3330 270 39300 4569 p 2 0 3327 273 37935 4529 p 2 0 3333 267 40591 4521 p 2 2 3273 325 40392 4531 p 2 0 3376 224 39155 4616 p 2 0 3309 291 37623 4476 p 2 2 3346 252 48977 5490 p 2 7 3289 304 47625 5598 p 2 3 3333 264 47383 5575 p 2 5 3338 257 45430 5534 p 2 5 3367 228 46933 5491 p 2 4 3227 369 48205 5534 p 2 4 3336 260 49211 5579 p 2 0 3296 304 44660 5462 p 2 9 3327 264 47594 5505 p 2 10 3247 343 47874 5617 p 2 1 3379 220 47298 5482 p 2 0 3250 350 44506 5493 p 2 8 3312 280 48680 5542 p 2 3 3306 291 45578 5480 p 2 3 3292 305 45801 5485 p 2 1 3350 249 43331 5352 p 2 4 3314 282 47563 5534 p 2 6 3256 338 45266 5391 p 2 2 3297 301 47161 5468 p 2 1 3290 309 42329 5411 p 2 5 3336 259 46740 5383 p 2 3 3262 335 45674 5398 p 2 3 3331 266 47403 5450 p 2 3 3247 350 42683 5276 p 2 10 3308 282 48388 5494 p 2 2 3256 342 44100 5331 p 2 8 3284 308 45077 5476 p 2 0 3303 297 43346 5214 p 2 4 3324 272 44478 5326 p 2 1 3274 325 45568 5351 p 2 1 3331 268 45683 5386 p 2 2 3272 326 41668 5275 p 2 11 3344 245 47115 5443 p 2 2 3215 383 44164 5220 p 2 5 3317 278 46786 5408 p 2 5 3256 339 42900 5263 p 2 5 3255 340 46563 5273 p 2 0 3255 345 44810 5280 p 2 0 3275 325 44708 5236 p 2 3 3289 308 44199 5265 p 2 2 3318 280 45654 5299 p 2 0 3229 371 45088 5236 p 2 1 3303 296 47110 5283 p 2 6 3233 361 42593 5148 p 2 8 3307 285 46361 5262 p 2 0 3205 395 45486 5230 p 2 10 3302 288 46139 5222 p 2 0 3205 395 36010 4391 p 2 0 3308 292 41197 4633 p 2 0 3163 437 37943 4433 p 2 0 3266 334 38282 4442 p 2 0 3210 390 36226 4242 p 2 0 3250 350 38646 4277 p 2 0 3191 409 39375 4341 p 2 0 3258 342 38984 4373 p 2 0 3219 381 38041 4278 p 2 0 3268 332 39909 4336 p 2 0 3204 396 40238 4337 p 2 0 3317 283 40257 4483 p 2 0 3197 403 37172 4291 p 2 0 3330 270 41863 4474 p 2 0 3178 422 39366 4344 p 2 0 3276 324 38675 4390 p 2 0 3238 362 38361 4259 p 2 0 3300 300 40516 4345 p 2 0 3167 433 41445 4299 p 2 0 3285 315 42946 4420 p 2 0 3208 392 38024 4286 p 2 0 3304 296 42462 4342 p 2 0 3114 486 42347 4281 p 2 0 3248 352 42875 4359 p 2 0 3188 412 39990 4223 p 2 1 3261 338 43723 4409 p 2 0 3131 469 41775 4335 p 2 0 3224 376 39924 4280 p 2 0 3240 360 39984 4183 p 2 0 3262 338 40869 4145 p 2 0 3185 415 41975 4183 p 2 0 3269 331 45274 4353 p 2 0 3147 453 39473 4163 p 2 0 3263 337 43685 4212 p 2 0 3139 461 43570 4164 p 2 0 3234 366 43493 4240 p 2 0 3139 461 40251 4124 p 2 0 3223 377 46230 4384 p 2 0 3110 490 42346 4156 p 2 0 3223 377 44208 4275 p 2 0 3173 427 40855 4104 p 2 0 3183 417 42733 4070 p 2 0 3109 491 43657 4099 p 2 2 3187 411 41305 4105 p 2 0 3194 406 42480 4128 p 2 0 3225 375 41411 4106 p 2 0 3068 532 43250 4133 p 2 0 3215 385 42489 4142 p 2 6 3172 422 44845 4238 p 2 4 3175 421 49925 4494 p 2 11 3116 473 48474 4371 p 2 0 3169 431 46958 4425 p 2 6 3189 405 48606 4338 p 2 1 3227 372 46134 4351 p 2 0 3139 461 49338 4374 p 2 1 3199 400 48307 4402 p 2 0 3109 491 47466 4339 p 2 0 3207 393 49533 4430 p 2 0 3099 501 49687 4293 p 2 0 3213 387 50270 4577 p 2 4 3114 482 48303 4393 p 2 2 3178 420 49076 4436 p 2 1 3097 502 49416 4346 p 2 0 3201 399 48041 4423 p 2 0 3177 423 47400 4426 p 2 0 3189 411 46656 4353 p 2 0 3099 501 49108 4387 p 2 0 3187 413 48237 4377 p 2 1 3145 454 47548 4353 p 2 2 3258 340 49441 4573 p 2 1 3067 532 49679 4297 p 2 0 3286 314 50071 4573 p 2 0 3114 486 44711 4235 p 2 0 3190 410 49591 4492 p 2 1 3099 500 46398 4278 p 2 0 3201 399 48268 4473 p 2 0 3179 421 46541 4388 p 2 0 3212 388 46465 4429 p 2 2 3104 494 49281 4361 p 2 2 3206 392 46032 4360 p 2 1 3129 470 47278 4331 p 2 1 3163 436 46168 4361 p 2 1 3074 525 49621 4321 p 2 0 3204 396 47975 4425 p 2 0 3108 492 45135 4301 p 2 1 3157 442 49806 4410 p 2 1 3054 545 45738 4243 p 2 0 3145 455 48493 4344 p 2 1 3135 464 48696 4289 p 2 0 3145 455 46277 4253 p 2 0 3064 536 50963 4300 p 2 0 3127 473 45714 4232 p 2 0 3062 538 45131 4217 p 2 0 3220 380 49262 4365 p 2 0 3022 578 48002 4176 p 2 0 3130 470 46694 4209 p 2 0 3059 541 40037 4014 p 2 0 3192 408 46843 4103 p 2 0 3014 586 41828 3975 p 2 0 3137 463 43591 4047 p 2 2 3058 540 45212 3995 p 2 0 3159 441 44010 3989 p 2 0 3044 556 46387 3956 p 2 0 3188 412 43038 4070 p 2 0 3100 500 40443 3941 p 2 0 3141 459 44275 3938 p 2 0 3028 572 44197 3920 p 2 0 3184 416 42935 3983 p 2 0 3033 567 38718 3870 p 2 1 3140 459 42707 3908 p 2 0 3008 592 40007 3884 p 2 0 3073 527 39157 3871 p 2 0 3149 451 43339 3886 p 2 0 3069 531 38379 3810 p 2 0 2947 653 44209 3794 p 2 0 3198 402 41117 4020 p 2 0 2970 630 35735 3800 p 2 0 3203 397 43764 3955 p 2 0 2968 632 41860 3853 p 2 0 3118 482 39099 3933 p 2 0 3079 521 38948 3908 p 2 0 3045 555 40085 3821 p 2 0 2995 605 39400 3824 p 2 0 3022 578 38210 3871 p 2 0 3033 567 41620 3820 p 2 0 3043 557 37842 3785 p 2 0 2971 629 43631 3759 p 2 0 3063 537 39238 3850 p 2 0 3025 575 37058 3792 p 2 0 3063 537 42531 3839 p 2 0 2950 650 40738 3734 p 2 0 3112 488 40036 3927 p 2 0 3057 543 40564 3854 p 2 0 3124 476 41869 3893 p 2 0 2980 620 41502 3822 p 2 0 3032 568 43439 3785 p 2 0 3066 534 41130 3740 p 2 0 2987 613 38628 3645 p 2 0 2939 661 39823 3641 p 2 1 2990 609 40321 3739 p 2 0 2989 611 40296 3705 p 2 0 3033 567 39733 3749 p 2 0 2944 656 40147 3714 p 2 0 3067 533 39296 3865 p 2 0 3040 560 42844 3903 p 2 2 3081 517 42589 3967 p 2 0 2940 660 41934 3875 p 2 0 3061 539 44805 3894 p 2 0 3060 540 45047 3927 p 2 0 3099 501 42826 3924 p 2 0 2968 632 45105 3848 p 2 0 3032 568 44912 3864 p 2 0 2979 621 44796 3881 p 2 0 3051 549 43591 3892 p 2 0 2911 689 40868 3800 p 2 0 3039 561 39255 3880 p 2 0 2860 740 37087 3777 p 2 0 3010 590 38647 3894 p 2 0 2857 743 37983 3761 p 2 0 2907 693 35979 3740 p 2 0 2997 603 35081 3746 p 2 0 2971 629 30990 3693 p 2 0 2858 742 34851 3646 p 2 0 3068 532 35967 3825 p 2 0 2934 666 34505 3717 p 2 0 2962 638 26894 3556 p 2 0 2825 775 32973 3546 p 2 0 3006 594 28551 3599 p 2 0 3072 528 23269 3636 p 2 0 3006 594 20686 3571 p 2 0 2837 763 23817 3481 p 2 0 2934 666 24318 3597 p 2 0 2920 680 24996 3537 p 2 0 2927 673 27625 3531 p 2 0 2784 816 33937 3515 p 2 0 2909 691 36802 3637 p 2 0 2950 650 33990 3709 p 2 0 2884 716 35577 3669 p 2 0 2723 877 34228 3544 p 2 0 2830 770 34665 3541 p 2 0 2872 728 35671 3610 p 2 0 2904 696 34747 3537 p 2 0 2686 914 32800 3427 p 2 0 2881 719 33616 3507 p 2 0 2808 792 32588 3450 p 2 0 2917 683 30685 3559 p 2 0 2668 932 29979 3379 p 2 0 2790 810 33334 3490 p 2 0 2728 872 31615 3433 p 2 0 2680 920 34155 3392 p 2 0 2529 1071 33925 3285 p 2 0 2563 1037 31554 3270 p 2 0 2581 1019 30195 3357 p 2 0 2496 1104 28335 3239 p 2 0 2416 1184 29845 3217 p 2 0 2328 1272 26136 2956 p 2 0 2253 1347 29235 2901 p 2 0 2456 1144 27936 3011 p 2 0 2102 1498 22164 2603 p 2 0 2273 1327 26393 2866 p 2 0 2326 1274 20979 2769 p 2 0 2234 1366 23660 2755 p 2 1 2084 1515 20328 2572 p 2 0 1984 1616 12341 2437 p 2 0 2195 1405 16717 2692 p 2 2 2071 1527 14146 2540 p 2 0 2083 1517 12552 2595 p 2 0 1968 1632 10491 2402 p 2 17 2197 1386 51136 3876 p 2 0 2112 1488 11134 2698 p 2 0 1771 1829 6709 2245 p 2 27 2089 1484 45047 3675 p 2 0 1939 1661 10513 2548 p 2 0 1901 1699 9280 2472 p 2 4 2073 1523 44622 3495 p 2 0 2083 1517 10304 2714 p 2 0 1878 1722 7921 2415 p 2 0 2126 1474 10275 2704 p 2 0 1923 1677 7791 2424 p 2 0 1784 1816 6059 2259 p 2 0 1604 1996 5325 2059 p 2 0 1513 2087 4572 1950 p 2 0 1338 2262 4040 1764 p 2 0 1488 2112 4826 1935 p 2 0 1323 2277 3763 1734 p 2 0 1106 2494 3267 1531 p 2 1 1194 2405 3752 1637 p 2 0 1161 2439 3314 1583 p 2 0 1670 1930 5529 2124 p 2 0 1458 2142 4756 1885 p 2 0 1689 1911 6733 2146 p 2 0 1713 1887 5887 2162 p 2 0 1539 2061 5250 1971 p 2 0 1402 2198 4192 1820 p 2 0 915 2685 2684 1337 p 2 1 1390 2209 4362 1822 p 2 0 1284 2316 3676 1704 p 2 0 1223 2377 3523 1654 p 2 1 1174 2425 3890 1601 p 2 0 1648 1952 5186 2084 p 2 0 1400 2200 4456 1839 p 2 0 1918 1682 7255 2407 p 2 0 1669 1931 5688 2116 p 2 0 1496 2104 4462 1926 p 2 0 1371 2229 4308 1806 p 2 0 1368 2232 3896 1789 p 2 0 1140 2460 3171 1554 p 2 1 1261 2338 3855 1697 p 2 0 1183 2417 3236 1607 p 2 0 1462 2138 8103 1880 p 2 0 1466 2134 8300 1904 p 2 0 1604 1996 4610 2038 p 2 1 1351 2248 4150 1789 p 2 0 1944 1656 7261 2413 p 2 0 1667 1933 5493 2101 p 2 0 1158 2442 3376 1564 p 2 0 1445 2155 4816 1850 p 2 0 1324 2276 3911 1742 p 2 0 1175 2425 3209 1576 p 2 0 1314 2286 4006 1744 p 2 0 1237 2363 3516 1653 p 2 0 1265 2335 4530 1665 p 2 0 1242 2358 3944 1673 p 2 0 1528 2072 4428 1941 p 2 0 1339 2261 4391 1795 p 2 0 1915 1685 7220 2386 p 2 0 1659 1941 5376 2103 p 2 0 1487 2113 4343 1910 p 2 0 1418 2182 4551 1860 p 2 0 1327 2273 3847 1748 p 2 0 1158 2442 3221 1575 p 2 1 1332 2267 4137 1773 p 2 0 1258 2342 3648 1682 p 2 0 1118 2482 3149 1546 p 2 0 1133 2467 3360 1554 p 2 0 1445 2155 4384 1872 p 2 0 1250 2350 3840 1672 p 2 0 1970 1630 7280 2442 p 2 0 1651 1949 5517 2099 p 2 0 1478 2122 4501 1902 p 2 1 1339 2260 4115 1773 p 2 0 1190 2410 3354 1607 p 2 0 1075 2525 2962 1484 p 2 0 1337 2263 4164 1751 i 2 3600 0 0 78974 12768 p 2 0 3489 111 27215 4616 p 2 0 2939 661 10744 3618 p 2 15 3057 528 32382 4579 p 2 0 3204 396 13838 4062 p 2 0 3096 504 12552 3834 p 2 9 3279 312 33909 4865 p 2 0 2986 614 12006 3731 p 2 0 2294 1306 7862 2815 p 2 4 3012 584 31210 4426 p 2 0 2639 961 10487 3313 p 2 0 3039 561 26836 4328 p 2 0 2759 841 11139 3498 p 2 0 2697 903 9910 3330 p 2 0 2183 1417 8158 2725 p 2 1 2736 863 26044 3941 p 2 0 3023 577 13170 3818 p 2 0 2804 796 11116 3475 p 2 3 3140 457 34651 4659 p 2 0 2877 723 11512 3605 p 2 0 2047 1553 7213 2548 p 2 2 2839 759 28212 4025 p 2 0 2595 1005 9922 3181 p 2 0 2672 928 9597 3256 p 2 2 2892 706 30005 4144 p 2 0 2896 704 11058 3574 p 2 0 2611 989 9363 3204 p 2 0 2665 935 9517 3267 p 2 0 2636 964 9274 3210 p 2 0 2999 601 11254 3720 p 2 0 2754 846 9942 3352 p 2 0 2447 1153 8882 2955 p 2 0 2617 983 9607 3165 p 2 5 2933 662 31390 4262 p 2 0 2591 1009 10917 3221 p 2 0 2585 1015 8685 3166 p 2 16 2740 844 28302 4033 p 2 0 2766 834 10763 3401 p 2 0 2044 1556 7414 2551 p 2 1 2716 883 26487 3841 p 2 0 2902 698 12338 3598 p 2 0 2789 811 10740 3414 p 2 11 2948 641 35225 4556 p 2 0 2645 955 10389 3286 p 2 0 2085 1515 7084 2581 p 2 14 2978 608 34086 4548 p 2 0 2468 1132 10771 3129 p 2 0 2611 989 9798 3196 p 2 14 2792 794 32334 4377 p 2 0 2724 876 10324 3380 p 2 0 1968 1632 7884 2478 p 2 6 2597 997 32463 4138 p 2 0 2925 675 12506 3685 p 2 0 2560 1040 9357 3169 p 2 0 2923 677 11165 3612 i 2 3600 0 0 82109 12824 p 2 0 3515 85 19114 4650 p 2 0 3045 555 10206 3720 p 2 0 3085 515 11399 3830 p 2 0 2944 656 9343 3592 p 2 0 2972 628 9645 3632 p 2 0 2796 804 8713 3420 p 2 0 2792 808 8219 3373 p 2 0 3054 546 10183 3832 p 2 0 2850 750 9090 3496 p 2 0 2541 1059 7766 3071 p 2 0 2803 797 9092 3388 p 2 0 2971 629 9777 3646 p 2 0 2876 724 9026 3540 p 2 0 2769 831 8630 3406 p 2 0 2795 805 9005 3478 p 2 0 2717 883 8278 3329 p 2 0 2717 883 8123 3306 p 2 0 2607 993 7637 3175 p 2 0 2572 1028 7113 3136 p 2 0 2573 1027 7552 3141 p 2 0 2919 681 9395 3573 p 2 0 3005 595 10593 3750 p 2 0 2379 1221 6630 2861 p 2 0 2421 1179 7114 2925 p 2 0 2345 1255 6650 2824 p 2 0 2481 1119 6953 3015 p 2 0 2374 1226 6580 2872 p 2 0 2441 1159 7209 2974 p 2 0 2530 1070 7042 3074 p 2 0 2435 1165 6924 2976 p 2 0 2557 1043 7225 3105 p 2 0 2371 1229 6652 2917 p 2 0 2667 933 8180 3265 p 2 0 2424 1176 6666 2931 p 2 0 3030 570 9840 3757 p 2 0 2832 768 8829 3443 p 2 0 2377 1223 6938 2884 p 2 0 2314 1286 6687 2826 p 2 0 2373 1227 6729 2884 p 2 0 2435 1165 6805 2952 p 2 0 2567 1033 7225 3127 p 2 0 2346 1254 6492 2887 p 2 0 2409 1191 6670 2930 p 2 0 2240 1360 6055 2739 p 2 0 2596 1004 7558 3134 p 2 0 2977 623 10055 3673 p 2 0 2178 1422 5772 2638 p 2 0 2560 1040 7640 3099 p 2 0 2455 1145 7101 2946 p 2 0 2281 1319 6400 2786 p 2 0 2382 1218 6924 2903 p 2 0 2368 1232 6901 2913 p 2 0 2369 1231 6475 2880 p 2 0 2395 1205 6801 2926 p 2 0 2528 1072 6962 3063 p 2 0 2634 966 7836 3202 p 2 0 2338 1262 6383 2813 p 2 0 2769 831 8571 3379 p 2 0 2076 1524 5728 2520 p 2 0 2402 1198 6717 2908 p 2 0 1790 1810 4752 2212 p 2 0 2490 1110 7106 3023 p 2 0 2297 1303 6477 2809 p 2 0 2245 1355 6433 2746 p 2 0 2404 1196 6925 2915 p 2 0 2341 1259 6664 2831 p 2 0 2301 1299 6391 2798 p 2 0 2241 1359 6024 2732 p 2 0 2547 1053 7528 3078 p 2 0 2885 715 9399 3552 p 2 0 2152 1448 6197 2619 p 2 0 2566 1034 7640 3105 p 2 0 2661 939 7691 3211 p 2 0 1831 1769 4858 2265 p 2 0 2318 1282 6750 2834 p 2 0 2419 1181 6754 2936 p 2 0 2468 1132 6853 2979 p 2 0 2345 1255 6538 2850 p 2 0 2615 985 7564 3154 p 2 0 2346 1254 6504 2873 p 2 0 2548 1052 7219 3097 p 2 0 2950 650 9891 3644 p 2 0 2085 1515 5662 2531 p 2 0 2603 997 7609 3142 p 2 0 2435 1165 6842 2948 p 2 0 2366 1234 6701 2896 p 2 0 2390 1210 6970 2910 p 2 0 2374 1226 6475 2888 p 2 0 2426 1174 6683 2974 p 2 0 2382 1218 6278 2890 p 2 0 2332 1268 6406 2839 p 2 0 2235 1365 5937 2727 p 2 0 2526 1074 7072 3055 p 2 0 2886 714 9437 3553 p 2 0 2095 1505 5581 2530 p 2 0 2387 1213 6708 2901 p 2 0 2692 908 7902 3242 p 2 0 1787 1813 4762 2228 p 2 0 2242 1358 6264 2719 p 2 0 2197 1403 5698 2670 p 2 0 2268 1332 6129 2782 p 2 0 2334 1266 6601 2870 p 2 0 2365 1235 6082 2838 p 2 0 2351 1249 6178 2864 p 2 0 2727 873 8068 3260 p 2 0 1899 1701 5049 2332 p 2 0 2922 678 9537 3562 p 2 0 2779 821 8434 3333 p 2 0 2239 1361 6324 2731 p 2 0 2480 1120 7405 3022 p 2 0 2402 1198 6812 2926 p 2 0 2439 1161 6846 2982 p 2 0 2357 1243 6439 2864 p 2 0 2219 1381 6019 2729 p 2 0 2398 1202 6718 2912 p 2 0 2602 998 7357 3149 p 2 0 2554 1046 7048 3070 p 2 0 2718 882 8438 3321 p 2 0 1956 1644 5018 2387 p 2 0 2531 1069 7457 3057 p 2 0 2272 1328 6597 2749 p 2 0 2221 1379 6188 2684 p 2 0 2322 1278 6745 2847 p 2 0 2271 1329 6606 2800 p 2 0 2340 1260 6370 2851 p 2 0 2365 1235 6515 2857 p 2 0 2213 1387 5753 2692 p 2 0 2465 1135 7159 2994 p 2 0 2291 1309 6414 2781 p 2 0 2937 663 10053 3621 p 2 0 2231 1369 6147 2701 p 2 0 2562 1038 7601 3107 p 2 0 2272 1328 6627 2772 p 2 0 2478 1122 7074 2987 p 2 0 2344 1256 6990 2856 p 2 0 2241 1359 6210 2742 p 2 0 2380 1220 6710 2894 p 2 0 2287 1313 6233 2806 p 2 0 2305 1295 6428 2821 p 2 0 2251 1349 6411 2758 p 2 0 2589 1011 7538 3154 p 2 0 2331 1269 6587 2823 p 2 0 2614 986 7572 3109 p 2 0 2439 1161 7203 2920 p 2 0 2544 1056 7273 3061 p 2 0 1692 1908 4348 2131 p 2 0 2322 1278 6113 2797 p 2 0 2228 1372 6136 2707 p 2 0 2370 1230 6557 2872 p 2 0 2242 1358 6270 2757 p 2 0 2368 1232 6527 2881 p 2 0 2197 1403 5823 2701 p 2 0 2545 1055 7540 3091 p 2 0 2240 1360 6408 2754 p 2 0 2923 677 9227 3570 p 2 0 2674 926 8105 3236 p 2 0 2338 1262 6677 2834 p 2 0 2265 1335 6404 2790 p 2 0 2344 1256 6863 2865 p 2 0 2398 1202 6951 2926 p 2 0 2444 1156 7076 2977 p 2 0 2326 1274 6383 2813 p 2 0 2239 1361 5958 2748 p 2 0 2488 1112 7352 3040 p 2 0 2380 1220 6749 2874 p 2 0 2817 783 9023 3445 p 2 0 2075 1525 5579 2534 p 2 0 2615 985 7816 3134 p 2 0 2412 1188 6915 2909 p 2 0 2007 1593 5533 2476 p 2 0 2226 1374 6038 2690 p 2 0 2231 1369 6201 2729 p 2 0 2600 1000 17763 3518 p 2 0 2474 1126 7705 3038 p 2 0 1996 1604 5646 2456 p 2 0 2602 998 17588 3489 p 2 0 2769 831 9628 3421 p 2 1 2633 966 17697 3525 p 2 0 2960 640 9861 3646 p 2 9 2848 743 21372 3930 p 2 0 2930 670 10116 3600 p 2 0 1944 1656 5503 2418 p 2 0 2486 1114 7366 3018 p 2 0 2466 1134 7009 3010 p 2 0 2568 1032 7286 3102 p 2 0 2430 1170 6892 2963 p 2 0 2577 1023 7267 3110 p 2 0 2361 1239 6450 2906 p 2 0 2630 970 8200 3209 p 2 0 2448 1152 6702 2966 p 2 0 2946 654 9882 3649 p 2 0 2803 797 8782 3406 p 2 0 2613 987 7949 3182 p 2 0 1913 1687 5050 2377 p 2 0 2479 1121 6731 3005 p 2 0 2386 1214 6555 2901 p 2 0 2400 1200 6457 2925 p 2 0 2410 1190 6657 2931 p 2 0 2351 1249 6503 2870 p 2 0 2215 1385 6032 2743 p 2 0 2550 1050 7555 3109 p 2 0 2518 1082 6817 3012 p 2 0 2715 885 7954 3244 p 2 0 2539 1061 7219 3071 p 2 0 2441 1159 6913 2933 p 2 0 2311 1289 6176 2796 p 2 0 2362 1238 6770 2887 p 2 0 2399 1201 6794 2921 p 2 0 2338 1262 6399 2859 p 2 0 2329 1271 6471 2866 p 2 0 2393 1207 6759 2928 p 2 0 2617 983 7596 3174 p 2 0 1788 1812 4578 2219 p 2 0 2855 745 9143 3474 p 2 0 2685 915 8031 3252 p 2 0 2341 1259 6352 2833 p 2 0 2176 1424 6062 2648 p 2 0 2302 1298 6401 2799 p 2 0 2312 1288 6201 2818 p 2 0 2405 1195 6971 2936 p 2 0 2372 1228 6436 2866 p 2 0 2276 1324 6230 2796 p 2 0 2444 1156 6434 2970 p 2 0 2632 968 7468 3188 p 2 0 2337 1263 6605 2841 p 2 0 2857 743 9066 3517 p 2 0 2612 988 7662 3182 p 2 0 2194 1406 6132 2674 p 2 0 2140 1460 5588 2602 p 2 0 2374 1226 6760 2900 p 2 0 2278 1322 6329 2785 p 2 0 2288 1312 6416 2831 p 2 0 2563 1037 6912 3097 p 2 0 2356 1244 6312 2879 p 2 0 2309 1291 6085 2795 p 2 0 2467 1133 7021 2987 p 2 0 1752 1848 4488 2170 p 2 0 2851 749 9382 3510 p 2 0 2032 1568 5374 2485 p 2 0 2435 1165 6621 2962 p 2 0 2685 915 7862 3256 p 2 0 2205 1395 6029 2735 p 2 0 2405 1195 6554 2928 p 2 0 2236 1364 6348 2768 p 2 0 2306 1294 6233 2804 p 2 0 2107 1493 5659 2579 p 2 0 2281 1319 5841 2751 p 2 0 2631 969 7537 3214 p 2 0 2327 1273 6397 2872 p 2 0 3019 581 12249 3753 p 2 0 3390 210 20625 4965 i 2 3600 0 0 70058 13757 p 2 359 3083 158 40485 7170 p 2 0 3424 176 15667 4982 p 2 245 2787 568 32052 5955 p 2 0 2702 898 9575 3577 p 2 169 2841 590 25512 5110 p 2 0 2917 683 11842 3845 p 2 39 3017 544 22665 4734 p 2 0 2365 1235 8369 3052 p 2 101 2756 743 19217 4557 p 2 0 3130 470 12651 4191 p 2 151 3436 13 58359 8510 p 2 0 3322 278 15626 4861 p 2 37 3536 27 47913 7390 p 2 0 3399 201 15639 5164 p 2 74 3504 22 50551 7645 p 2 0 3378 222 14249 4751 p 2 135 3461 4 57000 8536 p 2 0 3404 196 16119 5206 p 2 27 3553 20 46474 7464 p 2 8 3540 52 42462 6946 i 2 3600 0 0 68814 13708 p 2 0 2901 699 9753 3799 p 2 1 3592 7 33087 5921 p 2 3 3575 22 34752 5829 p 2 0 3584 16 29763 5489 p 2 1 3578 21 30200 5403 p 2 6 3568 26 30961 5500 p 2 2 3574 24 31640 5500 p 2 2 3590 8 31165 5458 p 2 4 3578 18 29478 5555 p 2 4 3581 15 29629 5734 p 2 3 3578 19 32183 5709 p 2 7 3577 16 31553 5803 p 2 3 3580 17 32542 5674 p 2 7 3575 18 32188 5662 p 2 7 3566 27 34571 5801 p 2 2 3592 6 30197 5452 p 2 3 3573 24 30267 5669 p 2 1 3587 12 32661 5615 p 2 3 3592 5 33625 5840 p 2 4 3584 12 34439 5875 p 2 4 3591 5 32965 5762 p 2 6 3588 6 33484 5924 p 2 1 3595 4 35234 5887 p 2 2 3595 3 33732 5875 p 2 3 3592 5 34176 5748 p 2 2 3586 12 34396 6010 p 2 3 3592 5 35940 6048 p 2 2 3589 9 31816 5811 p 2 3 3594 3 31054 5694 p 2 4 3589 7 33383 5868 p 2 3 3587 10 34287 5886 p 2 3 3594 3 32941 5862 p 2 0 3593 7 31209 5478 p 2 6 3586 8 32783 5805 p 2 2 3592 6 35868 5919 p 2 3 3589 8 31903 5566 p 2 0 3596 4 34300 5627 p 2 5 3591 4 33092 5893 p 2 3 3589 8 35013 5975 p 2 1 3594 5 30039 5516 p 2 2 3589 9 31612 5606 p 2 3 3596 1 32825 5887 p 2 2 3585 13 35024 5915 p 2 14 3580 6 35079 5957 p 2 4 3588 8 31296 5542 p 2 3 3588 9 32094 5808 p 2 2 3586 12 32423 5776 p 2 2 3592 6 31558 5843 p 2 0 3596 4 32638 5872 p 2 2 3595 3 34640 6002 p 2 7 3580 13 35155 5884 p 2 2 3585 13 30613 5537 p 2 3 3592 5 30486 5683 p 2 4 3589 7 32880 5727 p 2 2 3595 3 34004 5750 p 2 1 3598 1 33999 5798 p 2 0 3593 7 31735 5802 p 2 1 3593 6 31203 5760 p 2 0 3588 12 33143 5756 p 2 7 3581 12 30117 5867 p 2 5 3587 8 32238 5912 p 2 0 3584 16 32209 5964 p 2 4 3590 6 33342 5865 p 2 4 3585 11 30801 5754 p 2 5 3592 3 29050 5621 p 2 6 3587 7 32247 5982 p 2 2 3590 8 33679 6001 p 2 1 3596 3 32852 5957 p 2 2 3593 5 30782 5797 p 2 4 3591 5 32369 5864 p 2 3 3597 0 34710 5970 p 2 5 3593 2 30029 5715 p 2 4 3595 1 32549 5863 p 2 2 3597 1 32609 5833 p 2 4 3593 3 34236 5919 p 2 0 3593 7 29479 5654 p 2 2 3596 2 30244 5698 p 2 8 3589 3 33704 6048 p 2 2 3594 4 33383 6015 p 2 4 3594 2 31705 5701 p 2 1 3588 11 28812 5693 p 2 1 3593 6 31001 5833 p 2 2 3586 12 31690 5759 p 2 2 3588 10 31980 5853 p 2 1 3593 6 31366 5650 p 2 2 3588 10 34690 5868 p 2 2 3593 5 36415 5992 p 2 1 3594 5 31223 5775 p 2 1 3592 7 31147 5754 i 2 3600 0 0 108812 14535 p 2 2079 1521 0 109913 15440 p 2 1367 2233 0 102545 14088 p 2 173 3427 0 50035 8407 p 2 176 3424 0 54167 8602 p 2 102 3498 0 43536 7929 p 2 100 3500 0 38470 7479 p 2 35 3565 0 34817 6975 p 2 2 3598 0 26171 5673 p 2 0 3594 6 24901 5467 p 2 0 3599 1 21844 5295 p 2 0 3592 8 19997 4812 p 2 0 3596 4 20120 4739 p 2 0 3586 14 20051 4743 p 2 0 3592 8 18985 4590 p 2 0 3561 39 17459 4558 p 2 0 3597 3 17997 4509 p 2 0 3567 33 17061 4579 p 2 0 3597 3 20247 4885 p 2 0 3574 26 17351 4802 p 2 0 3581 19 16580 4687 p 2 0 3559 41 17333 4678 p 2 0 3569 31 15934 4639 p 2 0 3559 41 15552 4533 p 2 0 3538 62 14614 4423 p 2 0 3551 49 15350 4523 p 2 0 3550 50 15909 4566 p 2 0 3478 122 15209 4426 p 2 0 3473 127 14459 4332 p 2 0 3483 117 14182 4402 p 2 0 3474 126 14534 4407 p 2 0 3486 114 15484 4343 p 2 0 3449 151 14977 4297 p 2 0 3397 203 14648 4328 p 2 0 3440 160 15334 4350 p 2 0 3490 110 14790 4350 p 2 0 3394 206 13513 4067 p 2 0 3413 187 14318 4110 p 2 0 3379 221 14192 4161 p 2 0 3396 204 14788 4187 p 2 0 3372 228 13944 4070 p 2 0 3353 247 14593 4091 p 2 0 3337 263 14441 4145 p 2 0 3314 286 13464 3990 p 2 0 3328 272 14518 4048 p 2 0 3237 363 12722 4037 p 2 0 3375 225 13396 4173 p 2 0 3279 321 13204 4043 p 2 0 3145 455 11719 3853 p 2 0 3181 419 12486 3940 p 2 0 3110 490 12066 3886 p 2 0 3114 486 12739 3938 p 2 0 2917 683 10694 3717 p 2 0 2845 755 10274 3513 p 2 0 2906 694 11059 3815 p 2 0 3155 445 11589 3852 p 2 0 3113 487 12189 3940 p 2 0 2816 784 9690 3444 p 2 0 3152 448 12020 3871 p 2 0 2949 651 10034 3630 p 2 0 3054 546 11725 3775 p 2 0 2948 652 10174 3614 p 2 0 2876 724 9700 3480 p 2 0 3102 498 12216 4301 i 2 3600 0 0 36434 11073 p 2 0 3591 9 16583 5004 p 2 0 3360 240 10364 4252 p 2 0 3139 461 8560 3799 p 2 0 2993 607 8612 3623 p 2 0 3068 532 8205 3721 p 2 0 2922 678 8017 3537 p 2 0 2760 840 6787 3305 p 2 0 2841 759 7047 3425 p 2 0 2906 694 6756 3495 p 2 0 2686 914 6700 3292 p 2 0 3006 594 7559 3646 p 2 0 2596 1004 6484 3187 p 2 0 2945 655 7432 3585 p 2 0 2933 667 7945 3581 p 2 0 3115 485 8057 3822 p 2 0 3061 539 8693 3789 p 2 0 2996 604 7436 3649 p 2 0 3032 568 7929 3730 p 2 0 3081 519 7645 3772 p 2 0 2937 663 7818 3654 p 2 0 3108 492 7906 3837 p 2 0 2931 669 7480 3619 p 2 0 3068 532 7194 3682 p 2 0 2708 892 6420 3306 p 2 0 2877 723 6592 3475 p 2 0 2863 737 7338 3472 p 2 0 3050 550 7294 3722 p 2 0 3062 538 8352 3757 p 2 0 3094 506 8094 3878 p 2 0 2940 660 7784 3635 p 2 0 2876 724 6624 3466 p 2 0 2901 699 7381 3551 p 2 0 2914 686 6824 3530 p 2 0 2798 802 6862 3419 p 2 0 2939 661 7297 3613 p 2 0 2690 910 6390 3264 p 2 0 3070 530 8016 3802 p 2 0 2842 758 7405 3436 p 2 0 3117 483 7917 3879 i 2 3600 0 0 34200 11559 p 2 11 3528 61 18627 4915 p 2 8 3523 69 16617 4498 p 2 7 3525 68 15498 4386 p 2 10 3460 130 16423 4451 p 2 15 3484 101 18280 4769 p 2 12 3507 81 17873 4706 p 2 9 3518 73 17572 4763 p 2 13 3475 112 17460 4694 p 2 13 3477 110 16432 4730 p 2 7 3519 74 16495 4656 p 2 10 3522 68 16743 4696 p 2 15 3482 103 15914 4637 p 2 12 3511 77 16790 4720 p 2 13 3490 97 17560 4825 p 2 5 3532 63 16240 4643 p 2 0 3481 119 15867 4597 p 2 0 3546 54 17082 4781 p 2 2 3480 118 16587 4693 p 2 5 3507 88 16781 4755 p 2 12 3454 134 17369 4788 p 2 12 3514 74 17327 4793 p 2 12 3483 105 16142 4712 p 2 16 3502 82 18133 4995 p 2 14 3506 80 16405 4765 p 2 12 3512 76 17134 4791 p 2 15 3509 76 18180 4960 p 2 10 3544 46 16107 4675 p 2 3 3510 87 16221 4654 p 2 5 3550 45 17438 4875 p 2 3 3525 72 16118 4737 p 2 3 3521 76 15755 4691 p 2 5 3485 110 16269 4727 p 2 11 3502 87 16785 4777 p 2 14 3528 58 16485 4656 p 2 11 3538 51 16752 4790 p 2 10 3518 72 15688 4661 p 2 9 3521 70 16587 4685 p 2 8 3512 80 17386 4857 p 2 9 3532 59 15651 4642 p 2 7 3490 103 16626 4637 p 2 15 3522 63 17902 4920 p 2 8 3514 78 16731 4760 p 2 5 3527 68 16093 4790 p 2 6 3473 121 16208 4780 p 2 12 3510 78 16932 4825 p 2 13 3521 66 16757 4746 p 2 9 3537 54 17935 4911 p 2 9 3511 80 15516 4667 p 2 7 3498 95 16185 4700 p 2 7 3528 65 16731 4872 p 2 10 3527 63 15911 4634 p 2 16 3505 79 16058 4637 p 2 15 3511 74 17608 4850 p 2 13 3510 77 16900 4767 p 2 15 3525 60 16858 4794 p 2 11 3470 119 16264 4675 p 2 7 3501 92 17415 4732 p 2 13 3482 105 17073 4717 p 2 14 3545 41 19085 4994 p 2 10 3520 70 17211 4706 p 2 6 3515 79 17098 4745 p 2 6 3515 79 17532 4909 p 2 8 3520 72 16954 4702 p 2 11 3499 90 16710 4634 p 2 13 3508 79 18134 4862 p 2 7 3549 44 17529 4770 p 2 7 3522 71 17151 4783 p 2 9 3481 110 18163 4828 p 2 14 3519 67 18208 4845 p 2 14 3500 86 17869 4779 p 2 13 3520 67 20055 5083 p 2 14 3519 67 17893 4749 p 2 11 3519 70 17267 4725 p 2 15 3517 68 17905 4939 p 2 10 3522 68 16588 4730 p 2 11 3495 94 16667 4661 p 2 16 3504 80 18805 4887 p 2 12 3510 78 17836 4794 p 2 11 3501 88 17496 4778 p 2 4 3500 96 16947 4741 p 2 4 3532 64 17250 4757 p 2 3 3538 59 16813 4678 p 2 4 3520 76 18233 4806 p 2 11 3520 69 17508 4739 p 2 12 3501 87 17903 4775 p 2 9 3529 62 18122 4917 p 2 12 3532 56 16715 4683 p 2 14 3502 84 16949 4638 p 2 12 3516 72 18995 4937 p 2 15 3515 70 18116 4818 p 2 11 3523 66 17324 4778 p 2 3 3477 120 17022 4754 p 2 3 3526 71 17319 4715 p 2 0 3537 63 16002 4641 p 2 2 3550 48 17310 4811 p 2 2 3512 86 16088 4607 p 2 10 3539 51 17372 4741 p 2 7 3527 66 18318 4860 p 2 13 3539 48 16053 4615 p 2 8 3500 92 16672 4628 p 2 14 3540 46 17940 4891 p 2 8 3505 87 16899 4688 p 2 12 3506 82 16703 4716 p 2 15 3466 119 16665 4709 p 2 15 3519 66 17427 4769 p 2 6 3522 72 16638 4663 p 2 3 3523 74 16555 4692 p 2 10 3513 77 16356 4684 p 2 11 3512 77 16864 4736 p 2 10 3521 69 18138 4934 p 2 8 3545 47 16972 4752 p 2 8 3501 91 16126 4701 p 2 5 3544 51 17435 4858 p 2 8 3487 105 16725 4705 p 2 10 3525 65 16364 4729 p 2 10 3481 109 17280 4775 p 2 12 3513 75 17414 4791 p 2 13 3521 66 16485 4745 p 2 12 3534 54 17709 4821 p 2 10 3505 85 16603 4676 p 2 8 3517 75 17202 4740 p 2 14 3514 72 17869 4886 p 2 12 3545 43 16476 4613 p 2 6 3508 86 16468 4641 p 2 8 3530 62 17451 4845 p 2 5 3525 70 16279 4722 p 2 7 3511 82 16576 4713 p 2 14 3467 119 16610 4709 p 2 12 3536 52 17298 4736 p 2 11 3521 68 16503 4673 p 2 8 3509 83 16814 4727 p 2 9 3508 83 16789 4691 p 2 16 3490 94 17322 4745 p 2 19 3516 65 18105 4863 p 2 11 3534 55 16061 4599 p 2 10 3508 82 17139 4634 p 2 9 3535 56 17469 4812 p 2 12 3536 52 16198 4688 p 2 11 3515 74 15923 4663 p 2 8 3480 112 16578 4697 p 2 10 3518 72 16856 4695 p 2 12 3527 61 16740 4602 p 2 8 3541 51 17231 4728 p 2 4 3517 79 15724 4559 p 2 3 3541 56 16604 4633 p 2 3 3558 39 17227 4796 p 2 3 3538 59 16025 4512 p 2 10 3483 107 17271 4578 p 2 10 3525 65 18582 4818 p 2 10 3490 100 16604 4691 p 2 7 3497 96 16919 4648 p 2 8 3482 110 17561 4682 p 2 11 3508 81 18524 4774 p 2 18 3531 51 18349 4804 p 2 11 3527 62 18565 4800 p 2 5 3518 77 17067 4664 p 2 4 3504 92 17671 4661 p 2 2 3547 51 17234 4700 p 2 2 3539 59 17055 4569 p 2 4 3524 72 17594 4592 p 2 7 3531 62 18896 4799 p 2 14 3533 53 18602 4722 p 2 8 3529 63 18122 4711 p 2 7 3499 94 17569 4644 p 2 8 3520 72 18639 4664 p 2 8 3525 67 18344 4650 p 2 14 3510 76 18446 4661 p 2 12 3487 101 18294 4597 p 2 9 3533 58 18740 4705 p 2 7 3535 58 17811 4652 p 2 2 3529 69 17244 4520 p 2 7 3509 84 17754 4588 p 2 16 3515 69 19093 4722 p 2 15 3532 53 18843 4704 p 2 10 3514 76 19270 4690 p 2 6 3478 116 17908 4604 p 2 5 3537 58 19258 4682 p 2 5 3534 61 18645 4533 p 2 13 3511 76 18778 4585 p 2 9 3514 77 18828 4552 p 2 11 3495 94 19229 4653 p 2 12 3516 72 18791 4654 p 2 11 3517 72 18712 4596 p 2 4 3519 77 17892 4528 p 2 4 3533 63 18480 4659 p 2 4 3550 46 18449 4671 p 2 5 3510 85 18675 4626 p 2 4 3498 98 18080 4586 p 2 5 3515 80 18856 4642 p 2 1 3561 38 17848 4580 p 2 2 3531 67 18629 4617 p 2 5 3554 41 17695 4539 p 2 5 3538 57 18926 4627 p 2 5 3562 33 17530 4625 p 2 2 3550 48 17673 4591 p 2 6 3522 72 17687 4609 p 2 6 3504 90 18671 4700 p 2 12 3529 59 19087 4676 p 2 9 3519 72 18751 4662 p 2 6 3522 72 18163 4633 p 2 6 3534 60 18878 4661 p 2 4 3541 55 18040 4569 p 2 4 3542 54 18141 4593 p 2 5 3539 56 17460 4534 p 2 4 3525 71 18773 4619 p 2 6 3533 61 18272 4649 p 2 2 3542 56 17902 4587 p 2 0 3531 69 17154 4546 p 2 0 3532 68 18048 4705 p 2 2 3534 64 17928 4657 p 2 3 3534 63 18247 4695 p 2 2 3521 77 17881 4607 p 2 10 3512 78 19145 4690 p 2 11 3526 63 17594 4597 p 2 11 3527 62 18603 4760 p 2 11 3538 51 17480 4625 p 2 10 3516 74 18763 4723 p 2 7 3543 50 17324 4658 p 2 5 3541 54 17995 4680 p 2 0 3559 41 16681 4600 p 2 1 3516 83 17327 4657 p 2 0 3562 38 17148 4736 p 2 2 3525 73 16671 4691 p 2 2 3500 98 15980 4590 p 2 2 3520 78 17779 4711 p 2 2 3570 28 17278 4607 p 2 2 3530 68 16759 4614 p 2 1 3567 32 16257 4565 p 2 0 3524 76 17691 4686 p 2 3 3568 29 17065 4802 p 2 3 3548 49 16668 4630 p 2 2 3558 40 16454 4618 p 2 2 3529 69 17652 4747 p 2 2 3553 45 16919 4696 p 2 0 3513 87 16112 4698 p 2 0 3544 56 15765 4647 p 2 0 3529 71 17367 4701 p 2 0 3545 55 16117 4641 p 2 2 3542 56 17216 4739 p 2 0 3525 75 15101 4520 p 2 0 3540 60 16350 4655 p 2 2 3562 36 15347 4599 p 2 0 3538 62 15530 4595 p 2 0 3540 60 15607 4627 p 2 2 3539 59 16366 4685 p 2 0 3561 39 16089 4653 p 2 0 3523 77 16302 4685 p 2 0 3542 58 15090 4628 p 2 0 3524 76 15963 4718 p 2 0 3569 31 15781 4685 p 2 0 3541 59 16125 4627 p 2 0 3553 47 15631 4582 p 2 0 3531 69 16533 4667 p 2 0 3545 55 15651 4691 p 2 0 3530 70 15836 4643 p 2 0 3550 50 15213 4618 p 2 0 3562 38 15791 4752 p 2 0 3576 24 16556 4716 p 2 0 3528 72 15413 4667 p 2 0 3553 47 15928 4705 p 2 0 3539 61 16714 4705 p 2 0 3541 59 15465 4685 p 2 0 3560 40 16236 4734 p 2 0 3558 42 16112 4607 p 2 0 3545 55 17065 4764 p 2 0 3570 30 16345 4815 p 2 0 3533 67 16337 4603 i 2 3600 0 0 70391 11776 p 2 0 3385 215 11140 4093 p 2 17 3037 546 12673 3751 p 2 0 3050 550 9221 3636 p 2 0 2919 681 8113 3381 p 2 44 2724 832 13562 3535 p 2 0 3043 557 9212 3675 p 2 0 3227 373 10852 3905 p 2 52 3268 280 18571 4456 p 2 0 3023 577 9028 3600 p 2 0 3184 416 10698 3888 p 2 53 3191 356 18228 4404 p 2 0 2878 722 8365 3450 p 2 0 3083 517 9025 3680 p 2 0 2835 765 8099 3360 p 2 0 3154 446 9580 3766 p 2 0 2266 1334 5563 2676 p 2 0 2591 1009 6991 3037 p 2 0 3096 504 10366 3713 p 2 0 2907 693 8755 3426 p 2 0 3065 535 10079 3638 p 2 0 2808 792 8078 3293 p 2 0 2835 765 8734 3346 p 2 0 2631 969 6966 3113 p 2 0 2598 1002 7166 3086 p 2 0 2714 886 7097 3224 p 2 0 2710 890 7720 3203 p 2 0 2771 829 7292 3257 p 2 0 2497 1103 6702 2976 p 2 0 2693 907 7101 3187 p 2 0 2984 616 9629 3604 p 2 0 2940 660 8081 3442 p 2 0 3037 563 9955 3586 p 2 0 2891 709 8234 3387 p 2 0 2911 689 8735 3452 p 2 0 3048 552 8597 3587 p 2 0 2670 930 7585 3208 i 2 3600 0 0 80544 14546 p 2 10 3491 99 35144 6105 p 2 0 2999 601 12974 3929 p 2 1 3141 458 21874 4586 p 2 0 2987 613 20017 4272 p 2 0 3248 352 19897 4461 p 2 0 3124 476 19133 4276 p 2 0 3172 428 18321 4379 p 2 0 3084 516 16655 4151 p 2 0 3016 584 16572 4096 p 2 0 2954 646 16563 3948 p 2 0 2815 785 14504 3734 p 2 0 2762 838 15585 3755 p 2 0 2804 796 14237 3770 p 2 0 2752 848 15522 3783 p 2 0 2743 857 14862 3724 p 2 0 2733 867 15553 3724 i 2 3600 0 0 69818 13425 p 2 0 3593 7 31374 5989 p 2 4 3586 10 26755 5300 p 2 0 3590 10 25530 5191 p 2 0 3596 4 22537 4933 p 2 0 3594 6 22607 5027 p 2 0 3588 12 23825 5046 p 2 0 3598 2 25210 5129 p 2 0 3588 12 24156 5136 p 2 0 3596 4 22621 5018 p 2 0 3588 12 23340 5029 p 2 1 3588 11 25070 5152 p 2 0 3587 13 23833 4961 p 2 0 3598 2 23414 4905 p 2 1 3593 6 26285 5159 p 2 0 3594 6 25213 5137 p 2 0 3592 8 23634 5029 p 2 4 3587 9 24019 5100 p 2 0 3591 9 24341 5083 p 2 0 3594 6 26610 5316 p 2 0 3598 2 25290 5177 p 2 0 3595 5 24064 5057 p 2 0 3595 5 25034 5183 p 2 5 3589 6 26236 5322 p 2 0 3595 5 25547 5303 p 2 0 3598 2 26362 5354 p 2 0 3579 21 26658 5530 p 2 0 3595 5 27854 5528 p 2 0 3585 15 25307 5357 p 2 1 3593 6 25962 5409 p 2 1 3593 6 27947 5551 p 2 0 3597 3 28681 5645 p 2 2 3590 8 27901 5434 p 2 0 3591 9 25439 5333 p 2 0 3592 8 25294 5372 p 2 0 3598 2 27205 5569 p 2 0 3580 20 24045 5265 p 2 0 3597 3 24714 5372 p 2 0 3594 6 28168 5658 p 2 0 3597 3 27801 5482 p 2 0 3598 2 24616 5194 p 2 0 3599 1 23612 5211 p 2 0 3599 1 29697 5817 i 2 3600 0 0 71724 13523 p 2 4 3596 0 37755 6544 p 2 5 3595 0 30601 5942 p 2 0 3599 1 27477 5883 p 2 1 3596 3 29733 5858 p 2 2 3594 4 27973 5901 p 2 8 3591 1 30001 5822 p 2 1 3598 1 31172 6246 p 2 4 3596 0 29603 6188 p 2 2 3597 1 27274 5918 p 2 2 3598 0 26410 5590 p 2 0 3600 0 26929 5648 p 2 0 3600 0 30426 5936 p 2 0 3597 3 29651 5713 p 2 0 3600 0 28574 5583 p 2 2 3597 1 26871 5548 p 2 1 3599 0 28022 5591 p 2 1 3599 0 28409 5635 p 2 1 3599 0 29316 5443 p 2 0 3599 1 29143 6027 p 2 4 3596 0 28717 5742 p 2 2 3596 2 26833 5578 p 2 1 3598 1 26657 5549 p 2 0 3597 3 27286 5554 p 2 3 3597 0 28732 5793 p 2 2 3598 0 28417 5722 p 2 7 3591 2 26806 5607 p 2 3 3593 4 25782 5591 p 2 1 3599 0 28743 5689 p 2 2 3597 1 26031 5598 p 2 3 3596 1 26985 5603 p 2 3 3597 0 27705 5655 p 2 1 3596 3 28599 5692 p 2 0 3600 0 27624 5575 p 2 0 3600 0 27634 5604 p 2 2 3596 2 28728 5653 p 2 2 3598 0 28760 5872 p 2 1 3599 0 27959 5543 p 2 0 3600 0 27411 5431 p 2 4 3595 1 27370 5804 p 2 0 3600 0 27723 5476 p 2 3 3597 0 25573 5358 p 2 1 3598 1 25807 5374 p 2 1 3599 0 26480 5483 p 2 1 3599 0 25916 5446 p 2 0 3600 0 24606 5291 p 2 2 3598 0 24463 5317 p 2 4 3595 1 25680 5512 p 2 1 3598 1 25234 5366 p 2 4 3596 0 23374 5387 p 2 2 3598 0 22359 4945 p 2 5 3595 0 36037 6494 i 2 3600 0 0 116890 14595 p 2 0 3591 9 23780 5458 p 2 0 3562 38 25816 5057 p 2 0 3332 268 15899 4379 p 2 0 2602 998 9208 3256 p 2 0 3206 394 14325 4134 p 2 0 3018 582 12119 3819 p 2 0 3207 393 13544 4053 p 2 0 2840 760 10433 3530 p 2 0 3042 558 12085 3830 p 2 0 3173 427 12748 4020 p 2 0 3088 512 12241 3884 p 2 0 3302 298 14925 4279 p 2 0 3104 496 12596 3910 p 2 0 3484 116 20029 4751 p 2 0 3315 285 16056 4363 p 2 0 3120 480 13141 3926 p 2 0 3135 465 13454 3993 p 2 0 2817 783 10021 3510 p 2 0 2931 669 10728 3591 p 2 0 2694 906 9786 3332 p 2 0 2806 794 10329 3470 p 2 0 2754 846 9799 3383 p 2 0 2792 808 10643 3462 p 2 0 3203 397 13499 4200 p 2 0 2984 616 11918 3786 p 2 0 3372 228 16406 4438 p 2 0 3217 383 14927 4115 p 2 0 2733 867 10252 3356 p 2 0 3061 539 12664 3904 p 2 0 3171 429 13199 3997 p 2 0 2949 651 11840 3699 p 2 0 2886 714 10681 3565 p 2 0 2832 768 10950 3557 p 2 0 2742 858 9937 3406 p 2 0 2966 634 11159 3686 p 2 0 3124 476 12954 3990 p 2 0 3061 539 11785 3906 p 2 0 3401 199 19659 4634 p 2 0 3329 271 15472 4380 p 2 0 3142 458 13263 4017 p 2 0 2824 776 10536 3530 p 2 0 2964 636 11496 3694 p 2 0 2994 606 11806 3725 p 2 0 2904 696 10921 3569 p 2 0 2738 862 9863 3366 p 2 0 2435 1165 8564 3005 p 2 0 3439 161 22154 4948 i 2 3600 0 0 74590 13277 p 2 0 3586 14 24086 4968 p 2 0 3459 141 15288 4645 p 2 0 3278 322 12279 4245 p 2 0 2954 646 9598 3711 p 2 0 2455 1145 6828 2963 p 2 0 3087 513 10961 3899 p 2 0 3052 548 10742 3816 p 2 0 2934 666 9012 3625 p 2 0 2755 845 8114 3387 p 2 0 2965 635 9791 3686 p 2 0 2714 886 8021 3327 p 2 0 3048 552 10644 3837 p 2 0 2725 875 8302 3301 p 2 0 2230 1370 6066 2715 p 2 0 2896 704 9838 3563 p 2 0 2482 1118 7179 3042 p 2 0 1725 1875 4459 2150 p 2 0 2512 1088 7023 3036 p 2 0 2099 1501 5679 2597 p 2 0 2669 931 7792 3248 p 2 0 2456 1144 7097 3029 p 2 0 2293 1307 6257 2791 p 2 0 2494 1106 7130 3068 p 2 0 2806 794 8879 3440 p 2 0 2501 1099 7225 3043 p 2 0 3007 593 9494 3745 p 2 0 2763 837 8657 3401 p 2 0 2267 1333 6367 2758 p 2 0 2261 1339 6362 2744 p 2 0 2624 976 7875 3188 p 2 0 2493 1107 7075 3054 p 2 0 2493 1107 6973 3043 p 2 0 2306 1294 6311 2826 p 2 0 2411 1189 6711 2967 p 2 0 2388 1212 6590 2896 p 2 0 2571 1029 7440 3158 p 2 0 2623 977 7596 3181 p 2 0 2926 674 9731 3662 p 2 0 2757 843 8452 3395 p 2 0 1784 1816 4856 2225 p 2 0 2486 1114 7318 3025 p 2 0 2255 1345 6231 2774 p 2 0 1994 1606 5490 2485 p 2 0 2407 1193 6716 2934 p 2 0 2228 1372 6105 2741 p 2 0 2410 1190 6497 2944 p 2 0 2274 1326 6092 2798 p 2 0 2345 1255 6644 2897 p 2 0 2642 958 8034 3259 p 2 0 2396 1204 6756 2905 p 2 0 2677 923 8218 3265 p 2 0 2392 1208 6672 2891 p 2 0 1537 2063 4269 1952 p 2 0 2431 1169 6925 2947 p 2 0 2307 1293 6219 2811 p 2 0 2469 1131 7175 3016 p 2 0 2399 1201 6743 2943 p 2 0 2320 1280 6394 2854 p 2 0 2386 1214 6622 2920 p 2 0 2655 945 7747 3238 p 2 0 2334 1266 6330 2834 p 2 0 2935 665 9143 3638 p 2 0 2656 944 7823 3243 p 2 0 2170 1430 6018 2625 p 2 0 2110 1490 5715 2576 p 2 0 1798 1802 4733 2238 p 2 0 1847 1753 4598 2270 p 2 0 2228 1372 5909 2708 p 2 0 2453 1147 6651 2974 p 2 0 2219 1381 6092 2719 p 2 0 2219 1381 6069 2716 p 2 0 2518 1082 6816 3045 p 2 0 2438 1162 6932 2956 p 2 0 2782 818 8571 3431 p 2 0 2526 1074 7342 3076 p 2 0 2480 1120 6950 2953 p 2 0 1662 1938 4355 2062 p 2 0 2397 1203 6752 2905 p 2 0 2017 1583 5288 2495 p 2 0 2295 1305 6620 2799 p 2 0 2178 1422 5805 2647 p 2 0 2238 1362 6116 2747 p 2 0 2184 1416 5860 2676 p 2 0 2667 933 7867 3230 p 2 0 1628 1972 4311 2059 p 2 0 2811 789 8954 3472 p 2 0 2648 952 7735 3235 p 2 0 1620 1980 4357 2053 p 2 0 2084 1516 5726 2532 p 2 0 2012 1588 5476 2482 p 2 0 2198 1402 6063 2696 p 2 0 2231 1369 5804 2704 p 2 0 2230 1370 6214 2765 p 2 0 2380 1220 6906 2913 p 2 0 2291 1309 6178 2785 p 2 0 2673 927 7835 3250 p 2 0 2343 1257 6369 2863 p 2 0 2871 729 8808 3540 p 2 0 2629 971 7865 3200 p 2 0 2104 1496 5528 2571 p 2 0 1501 2099 3879 1917 p 2 0 2413 1187 6793 2944 p 2 0 2036 1564 5220 2477 p 2 0 2257 1343 6147 2731 p 2 0 2215 1385 5940 2707 p 2 0 2912 688 10247 3783 i 2 3600 0 0 43673 12087 p 2 0 3046 554 12146 3724 p 2 0 3224 376 14904 4279 p 2 2 2811 787 13031 3860 p 2 1 2863 736 13385 3846 p 2 0 2481 1119 7589 3064 p 2 0 2670 930 11960 3599 p 2 0 2509 1091 7676 3059 p 2 0 2189 1411 6074 2663 p 2 0 2399 1201 6490 2890 p 2 0 2310 1290 5540 2713 p 2 0 2190 1410 5371 2612 p 2 0 1966 1634 5208 2442 p 2 0 2261 1339 6322 2776 p 2 0 2245 1355 6004 2744 p 2 0 2404 1196 6568 2933 p 2 0 2360 1240 5908 2825 p 2 0 2135 1465 5763 2622 p 2 0 2386 1214 5941 2803 p 2 0 2334 1266 6233 2783 p 2 0 2095 1505 4896 2554 p 2 0 1992 1608 5139 2416 i 2 3600 0 0 50553 11282 p 2 0 3494 106 16412 4909 p 2 128 3260 212 16522 4868 p 2 0 3254 346 10893 4081 p 2 138 3001 461 14526 4423 p 2 0 2739 861 7311 3281 p 2 0 2815 785 7962 3341 p 2 0 2978 622 8188 3606 p 2 80 2841 679 15776 4303 p 2 0 2915 685 8784 3556 p 2 0 2640 960 7075 3197 p 2 0 2943 657 12002 3822 p 2 0 2757 843 8220 3391 p 2 0 2658 942 7299 3211 p 2 2 2754 844 12426 3727 p 2 0 2722 878 7628 3357 p 2 0 2964 636 8682 3608 p 2 0 2827 773 7630 3361 p 2 0 2990 610 8965 3625 p 2 0 2643 957 7248 3171 p 2 0 2845 755 7740 3413 p 2 0 2678 922 7470 3219 p 2 0 2701 899 7272 3261 p 2 0 2725 875 7493 3253 p 2 0 2582 1018 6646 3094 p 2 0 2543 1057 6544 3072 p 2 0 2507 1093 6588 3004 p 2 0 2706 894 7441 3231 p 2 0 2582 1018 6892 3065 p 2 0 3193 407 10712 3942 p 2 0 2988 612 8947 3605 p 2 0 2505 1095 7202 2977 p 2 0 2420 1180 6190 2873 p 2 0 3141 459 10980 4035 i 2 3600 0 0 71096 12261 p 2 12 3549 39 24074 5469 p 2 0 3368 232 13060 4321 p 2 30 3181 389 15301 4286 p 2 0 3184 416 11529 3975 p 2 30 3115 455 15287 4166 p 2 0 3314 286 12373 4269 p 2 0 3195 405 11816 3966 p 2 45 3284 271 18702 4551 p 2 0 3198 402 11424 3999 p 2 0 3152 448 10966 3924 p 2 39 3001 560 14555 4005 p 2 0 2954 646 9834 3610 p 2 42 3087 471 15611 4156 p 2 0 2935 665 9346 3595 p 2 0 2780 820 8244 3344 p 2 0 2143 1457 6609 2631 p 2 1 2669 930 11631 3390 p 2 0 3157 443 11979 3934 p 2 0 2891 709 9500 3476 p 2 2 3084 514 14407 3876 p 2 0 2906 694 9752 3504 p 2 0 2743 857 8235 3253 p 2 2 2719 879 11745 3348 p 2 0 2382 1218 7129 2847 p 2 0 2820 780 8463 3339 p 2 1 2541 1058 10754 3183 p 2 0 2616 984 7927 3137 p 2 0 2511 1089 7380 3041 p 2 0 2329 1271 6790 2784 p 2 0 2670 930 8035 3211 p 2 0 2769 831 8793 3324 p 2 0 2841 759 9402 3434 p 2 0 2025 1575 6027 2454 p 2 0 2862 738 9954 3435 p 2 0 2866 734 9332 3429 p 2 0 2490 1110 7700 2964 p 2 0 2704 896 8110 3233 p 2 0 2480 1120 7537 2982 p 2 0 2608 992 8150 3129 p 2 0 2572 1028 7344 3084 p 2 0 2299 1301 6683 2766 p 2 0 2721 879 8344 3280 p 2 0 2564 1036 7805 3039 p 2 0 2898 702 9853 3485 p 2 0 2629 971 8196 3154 p 2 0 2642 958 8029 3153 p 2 0 2799 801 8610 3334 p 2 0 2656 944 7536 3181 p 2 0 2508 1092 7172 2994 p 2 0 2251 1349 6241 2729 p 2 0 3243 357 14109 4288 i 2 3600 0 0 80313 12596 p 2 0 2990 610 10512 3758 p 2 3 3307 290 13786 4288 p 2 0 3294 306 12666 4349 p 2 0 3146 454 11351 4067 p 2 0 2988 612 10335 3784 p 2 0 2877 723 9124 3603 p 2 0 2951 649 9703 3671 p 2 2 2864 734 9639 3614 p 2 0 2805 795 8732 3480 p 2 0 2788 812 9316 3509 p 2 0 2758 842 9105 3410 p 2 0 2615 985 8201 3240 p 2 3 2804 793 9435 3515 p 2 0 2731 869 9143 3363 p 2 0 2202 1398 6642 2728 p 2 0 2204 1396 6915 2739 p 2 0 2455 1145 8231 3032 p 2 0 2502 1098 7555 3043 p 2 0 2507 1093 7638 3077 p 2 0 2168 1432 6532 2717 p 2 0 2214 1386 6478 2736 p 2 2 2315 1283 7217 2880 p 2 0 2190 1410 6175 2700 p 2 0 2059 1541 6107 2574 p 2 0 1967 1633 5557 2456 p 2 0 2539 1061 7769 3130 p 2 0 2324 1276 7247 2847 p 2 0 2705 895 9028 3363 p 2 3 2628 969 8468 3302 p 2 0 2552 1048 8053 3112 p 2 0 2474 1126 7417 3029 p 2 0 2240 1360 7039 2788 p 2 0 2553 1047 7648 3126 p 2 0 2316 1284 6860 2862 p 2 0 2186 1414 6512 2727 p 2 0 2133 1467 6433 2677 p 2 0 2119 1481 6058 2678 p 2 0 2576 1024 7838 3171 p 2 0 2216 1384 6652 2749 p 2 0 2774 826 9262 3455 p 2 3 2746 851 9439 3438 p 2 0 2292 1308 6823 2818 p 2 0 2363 1237 6913 2882 p 2 0 2245 1355 6675 2815 p 2 0 2364 1236 7086 2915 p 2 2 2074 1524 6408 2612 p 2 0 2101 1499 6487 2612 p 2 0 2158 1442 6295 2667 p 2 2 2436 1162 7688 3038 p 2 0 2348 1252 6783 2863 p 2 0 2743 857 8859 3379 p 2 0 1857 1743 5474 2316 p 2 0 2425 1175 7358 2998 p 2 0 2278 1322 6839 2796 p 2 0 2306 1294 6583 2800 p 2 0 2154 1446 6422 2700 p 2 0 2237 1363 6617 2771 p 2 0 2139 1461 5942 2670 p 2 0 2104 1496 5968 2600 p 2 0 2037 1563 6133 2555 p 2 0 2351 1249 6667 2886 p 2 0 2125 1475 5968 2623 p 2 0 2623 977 8122 3209 p 2 0 2486 1114 7801 3032 p 2 0 2305 1295 6524 2861 p 2 0 2144 1456 5965 2634 p 2 0 1926 1674 5619 2402 p 2 3 2051 1546 6547 2575 p 2 0 2196 1404 6617 2710 p 2 0 2234 1366 6849 2789 p 2 0 2366 1234 6854 2894 p 2 0 2136 1464 6570 2657 p 2 0 2389 1211 7638 2944 p 2 0 2177 1423 6479 2683 p 2 0 2824 776 9089 3483 p 2 0 1870 1730 5620 2340 p 2 3 2473 1124 7892 3081 p 2 0 2132 1468 6350 2657 p 2 0 2323 1277 6739 2839 p 2 0 2254 1346 6707 2800 p 2 0 2320 1280 6774 2862 p 2 2 2142 1456 6680 2691 p 2 0 2037 1563 5675 2536 p 2 0 2129 1471 6227 2656 p 2 0 2019 1581 5911 2539 p 2 0 2350 1250 6981 2913 p 2 0 2020 1580 6284 2546 p 2 0 2724 876 8580 3359 p 2 2 2338 1260 7302 2897 p 2 0 2285 1315 6925 2803 p 2 0 2105 1495 6118 2585 p 2 2 2195 1403 6712 2715 p 2 0 2304 1296 6949 2855 p 2 0 2147 1453 6318 2657 p 2 0 2205 1395 6657 2762 p 2 0 2117 1483 6090 2634 p 2 0 2220 1380 6299 2742 p 2 3 2436 1161 7874 3026 p 2 0 2231 1369 6493 2748 p 2 0 2685 915 8416 3326 p 2 0 2528 1072 7814 3169 p 2 0 2514 1086 7558 3053 p 2 0 2030 1570 5797 2505 p 2 2 2107 1491 6596 2641 p 2 0 2134 1466 6117 2644 p 2 0 1938 1662 5198 2419 p 2 0 2016 1584 6265 2524 p 2 0 1964 1636 5951 2465 p 2 0 2020 1580 5939 2538 p 2 2 2326 1272 7200 2899 p 2 0 2111 1489 6065 2644 p 2 0 2640 960 8284 3265 p 2 0 2580 1020 7680 3236 p 2 0 2472 1128 7295 3049 p 2 0 1611 1989 4429 2079 p 2 3 2099 1498 6431 2605 p 2 0 2283 1317 6597 2836 p 2 0 2136 1464 6320 2684 p 2 0 2046 1554 5940 2540 p 2 0 2133 1467 6754 2656 p 2 0 2040 1560 5953 2566 p 2 0 2381 1219 7369 2960 p 2 0 2248 1352 6656 2791 p 2 0 2498 1102 7381 3022 p 2 0 2120 1480 6183 2586 i 2 3600 0 0 78162 12270 p 2 0 3414 186 15721 4336 p 2 0 2678 922 7326 3254 p 2 0 3118 482 10466 3817 p 2 0 3033 567 9654 3690 p 2 0 2287 1313 6302 2720 p 2 0 2838 762 8955 3385 p 2 0 3041 559 9730 3731 p 2 0 3007 593 9263 3739 p 2 0 3434 166 15101 4552 p 2 0 3213 387 11381 4105 p 2 0 2945 655 9051 3611 p 2 0 3075 525 9878 3772 p 2 0 3027 573 9527 3716 p 2 0 2800 800 8012 3409 p 2 0 2914 686 8841 3567 p 2 0 2672 928 7571 3223 p 2 0 2647 953 7900 3192 p 2 0 2690 910 8221 3235 p 2 0 3041 559 10430 3722 p 2 0 2694 906 8495 3245 p 2 0 2989 611 9714 3677 p 2 0 2360 1240 7306 2811 p 2 0 2827 773 9385 3410 p 2 0 2500 1100 7511 3004 p 2 0 2576 1024 8242 3096 p 2 0 2256 1344 6383 2703 p 2 0 2624 976 8012 3123 p 2 0 2583 1017 7620 3098 p 2 0 2359 1241 7056 2826 p 2 0 2545 1055 7616 3039 p 2 0 2774 826 9103 3357 p 2 0 2514 1086 7222 3012 p 2 0 3072 528 10334 3775 p 2 0 2936 664 9798 3572 p 2 0 2857 743 9039 3418 p 2 0 2723 877 8692 3274 p 2 0 2546 1054 7672 3012 p 2 0 1987 1613 5402 2395 p 2 0 2757 843 8353 3290 p 2 0 2566 1034 7467 3084 p 2 0 2636 964 7831 3139 p 2 0 2588 1012 7735 3109 p 2 0 2422 1178 7105 2923 p 2 0 2688 912 7585 3219 p 2 0 2593 1007 7645 3080 p 2 0 3035 565 10905 3764 p 2 0 2711 889 8365 3260 p 2 0 2724 876 8994 3277 p 2 0 2667 933 8569 3219 p 2 0 2398 1202 7287 2854 p 2 0 2637 963 7857 3146 p 2 0 2362 1238 6326 2853 p 2 0 2412 1188 6989 2887 p 2 0 2492 1108 7601 3001 p 2 0 2793 807 8734 3368 p 2 0 2418 1182 6780 2916 p 2 0 2932 668 9986 3592 p 2 0 2855 745 9166 3428 p 2 0 2490 1110 7415 2980 p 2 0 2534 1066 7444 3013 p 2 0 2739 861 7955 3269 p 2 0 2273 1327 6138 2728 p 2 0 2627 973 7634 3134 p 2 0 2519 1081 7237 3016 p 2 0 2405 1195 7053 2893 p 2 0 2592 1008 7842 3127 p 2 0 2734 866 8614 3309 p 2 0 2468 1132 6962 2951 p 2 0 3015 585 10816 3701 p 2 0 2889 711 9187 3460 p 2 0 2366 1234 7307 2830 p 2 0 2391 1209 6702 2831 p 2 0 2644 956 7764 3153 p 2 0 2583 1017 8082 3128 p 2 0 2679 921 8055 3204 p 2 0 2583 1017 7505 3113 p 2 0 2285 1315 6269 2744 p 2 0 2516 1084 7170 3005 p 2 0 2698 902 7813 3221 p 2 0 2679 921 8649 3225 p 2 0 3021 579 10462 3715 p 2 0 2789 811 8846 3348 p 2 0 2436 1164 7812 2929 p 2 0 2532 1068 7914 3042 p 2 0 2579 1021 7979 3075 p 2 0 2420 1180 6923 2907 p 2 0 2880 720 8919 3478 p 2 0 2718 882 8010 3257 p 2 0 1878 1722 4777 2277 p 2 0 2476 1124 7333 2973 p 2 0 2708 892 7898 3293 p 2 0 2471 1129 7437 2972 p 2 0 2167 1433 6509 2611 p 2 0 2742 858 9333 3296 p 2 0 2544 1056 8084 3037 p 2 0 2522 1078 7740 3005 p 2 0 2669 931 7824 3166 p 2 0 2319 1281 6663 2807 p 2 0 2780 820 8924 3337 p 2 0 1865 1735 5456 2280 p 2 0 2056 1544 5819 2486 p 2 0 2590 1010 7674 3088 p 2 0 2649 951 7826 3179 p 2 0 2402 1198 7189 2890 p 2 0 3007 593 10566 3694 p 2 0 2222 1378 6717 2671 p 2 0 2592 1008 7910 3101 p 2 0 2439 1161 6989 2893 p 2 0 2556 1044 7658 3062 p 2 0 2251 1349 6469 2717 p 2 0 2273 1327 6585 2751 p 2 0 2483 1117 7543 2972 p 2 0 2254 1346 6166 2711 p 2 0 2441 1159 7094 2936 p 2 0 2635 965 7713 3160 p 2 0 2617 983 7951 3148 p 2 0 2981 619 10153 3651 p 2 0 2714 886 8533 3264 p 2 0 1923 1677 5138 2336 p 2 0 2547 1053 8046 3039 p 2 0 2535 1065 7275 3006 p 2 0 2366 1234 6867 2840 p 2 0 2766 834 8811 3302 p 2 0 2584 1016 7819 3100 p 2 0 2576 1024 7622 3072 p 2 0 2477 1123 7549 2969 p 2 0 2702 898 8420 3255 p 2 0 2473 1127 7235 2949 p 2 0 2839 761 9407 3466 p 2 0 2186 1414 6399 2608 p 2 0 2418 1182 7079 2917 p 2 0 2614 986 8236 3125 p 2 0 2709 891 7851 3195 p 2 0 2261 1339 6351 2729 p 2 0 2608 992 7552 3100 p 2 0 2364 1236 6321 2841 p 2 0 2416 1184 6894 2881 p 2 0 2092 1508 5941 2506 p 2 0 2413 1187 7269 2904 p 2 0 2712 888 8614 3269 p 2 0 2419 1181 6426 2902 p 2 0 2979 621 10375 3674 p 2 0 2667 933 8445 3204 p 2 0 2529 1071 7443 2995 p 2 0 2639 961 7708 3158 p 2 0 2401 1199 6959 2894 p 2 0 2579 1021 7883 3103 p 2 0 2570 1030 8039 3106 p 2 0 2461 1139 7292 2991 p 2 0 2475 1125 7419 2998 p 2 0 2671 929 7955 3217 p 2 0 2624 976 7551 3108 p 2 0 3016 584 10298 3673 p 2 0 2693 907 8552 3234 p 2 0 2411 1189 7679 2878 p 2 0 2331 1269 6865 2749 p 2 0 2955 645 10534 3750 i 2 3600 0 0 90631 12959 p 2 0 3333 267 17460 4452 p 2 12 3375 213 31344 5082 p 2 0 3238 362 15064 4228 p 2 0 2546 1054 8503 3111 p 2 17 3169 414 30508 4769 p 2 0 3264 336 14403 4297 p 2 0 3094 506 12601 3929 p 2 28 3321 251 33089 5263 p 2 0 3105 495 12014 3937 p 2 0 2355 1245 7417 2885 p 2 23 3231 346 31601 5044 p 2 0 2977 623 11686 3739 p 2 0 2943 657 11027 3705 p 2 0 2779 821 10017 3486 p 2 0 2943 657 10372 3627 p 2 0 2563 1037 8170 3150 p 2 0 2733 867 9712 3364 p 2 0 2957 643 11252 3724 p 2 0 2729 871 8791 3350 p 2 0 2955 645 11311 3656 p 2 0 2607 993 8251 3132 p 2 0 2736 864 9930 3369 p 2 0 2606 994 8059 3177 p 2 0 2361 1239 7333 2880 p 2 0 2299 1301 6592 2787 p 2 1 2545 1054 8690 3131 p 2 0 2377 1223 6825 2881 p 2 0 2212 1388 6403 2722 p 2 0 2210 1390 6860 2738 p 2 0 2709 891 8927 3325 p 2 0 2731 869 8709 3285 p 2 0 2887 713 10738 3554 p 2 0 2363 1237 7019 2840 p 2 0 2581 1019 8095 3100 p 2 0 2557 1043 8348 3122 p 2 0 2476 1124 7704 2985 p 2 0 2440 1160 7114 2965 p 2 0 2274 1326 6582 2780 p 2 0 2354 1246 6772 2850 p 2 0 2238 1362 6510 2740 p 2 0 2248 1352 7029 2770 p 2 0 2512 1088 7826 3068 p 2 0 2432 1168 7108 2939 p 2 0 2771 829 10476 3443 p 2 0 2485 1115 7641 3008 p 2 0 2630 970 9074 3218 p 2 0 2379 1221 7220 2875 p 2 0 2365 1235 7185 2836 p 2 0 2288 1312 7166 2794 p 2 0 2390 1210 7217 2910 p 2 0 2306 1294 6854 2803 p 2 0 2149 1451 6418 2637 p 2 0 2627 973 8115 3217 p 2 0 2306 1294 6836 2812 p 2 0 2048 1552 5546 2470 p 2 1 2602 997 9605 3216 p 2 0 2319 1281 7145 2835 p 2 0 2575 1025 8482 3120 p 2 0 2393 1207 6624 2852 p 2 0 2202 1398 6147 2633 p 2 0 2458 1142 8074 2999 p 2 0 2210 1390 6451 2722 p 2 0 2276 1324 6072 2721 p 2 0 1548 2052 4143 1969 p 2 1 2035 1564 6411 2528 p 2 0 2676 924 8600 3261 p 2 0 2416 1184 7052 2900 p 2 0 2675 925 9685 3279 p 2 0 2652 948 8457 3214 p 2 0 2442 1158 7356 2952 p 2 0 2399 1201 7719 2914 p 2 0 2316 1284 7202 2807 p 2 0 2363 1237 6809 2859 p 2 0 2185 1415 6722 2686 p 2 0 2205 1395 6438 2700 p 2 0 2153 1447 6442 2642 p 2 0 2240 1360 7036 2746 p 2 0 2495 1105 7614 3048 p 2 0 2543 1057 7701 3048 p 2 1 2627 972 9698 3220 p 2 0 2396 1204 7566 2881 p 2 0 2560 1040 9163 3136 p 2 0 2535 1065 7372 3042 p 2 0 2351 1249 6711 2821 p 2 0 2090 1510 5980 2539 p 2 1 2042 1557 6459 2535 p 2 0 2252 1348 6440 2729 p 2 0 2207 1393 6013 2661 p 2 0 2253 1347 6776 2736 p 2 0 2440 1160 7504 2948 i 2 3600 0 0 67946 11864 p 2 7 3578 15 28983 6024 p 2 47 3549 4 53786 7146 p 2 12 3511 77 30208 5611 p 2 253 3344 3 48221 7068 p 2 0 3544 56 23431 5303 p 2 23 3569 8 48968 6288 p 2 0 3589 11 24537 5196 p 2 6 3402 192 24578 4936 p 2 0 3324 276 12939 4172 p 2 5 3221 374 23082 4457 p 2 0 3337 263 14569 4388 p 2 3 3173 424 19335 4382 p 2 0 3370 230 14094 4376 p 2 0 3252 348 18058 4322 p 2 0 3182 418 17590 4215 p 2 0 2956 644 11251 3720 p 2 0 2911 689 9936 3622 p 2 0 2823 777 9231 3485 p 2 0 2659 941 8720 3266 p 2 0 2157 1443 6563 2649 p 2 0 2828 772 9096 3435 p 2 0 2880 720 9719 3552 p 2 0 2671 929 8798 3239 p 2 0 2957 643 10948 3683 p 2 0 2791 809 9664 3441 p 2 0 2540 1060 8023 3078 p 2 0 1950 1650 6002 2395 p 2 0 2577 1023 7843 3139 p 2 0 2310 1290 6712 2813 p 2 0 2463 1137 7617 2990 p 2 0 2391 1209 7480 2925 p 2 0 2457 1143 7460 3004 p 2 0 2387 1213 7211 2909 p 2 0 2333 1267 7218 2883 p 2 0 2728 872 8773 3340 p 2 0 2392 1208 7349 2907 p 2 0 2672 928 9187 3241 p 2 0 2640 960 8167 3205 p 2 0 2722 878 8551 3312 p 2 0 2325 1275 6715 2849 p 2 0 2228 1372 6480 2724 p 2 0 2264 1336 6862 2776 p 2 0 2334 1266 7047 2855 p 2 0 2572 1028 8063 3091 p 2 0 3108 492 13866 4143 i 2 3600 0 0 66383 12217 p 2 0 3367 233 13312 4350 p 2 0 3177 423 12150 4070 p 2 0 3276 324 13557 4172 p 2 0 3120 480 11780 3884 p 2 0 3083 517 11035 3799 p 2 0 2761 839 8890 3360 p 2 0 2812 788 8943 3423 p 2 0 2758 842 9457 3399 p 2 0 2800 800 9100 3413 p 2 0 2605 995 8405 3188 p 2 0 2507 1093 8157 3044 p 2 0 2721 879 9238 3307 p 2 0 2558 1042 8767 3103 p 2 0 2833 767 10039 3505 p 2 0 2702 898 8800 3259 p 2 0 2596 1004 8002 3167 p 2 0 2475 1125 8059 3008 p 2 0 2285 1315 7191 2794 p 2 0 2421 1179 7734 2942 p 2 0 2345 1255 7250 2878 p 2 0 2353 1247 7743 2871 p 2 0 2228 1372 7034 2734 p 2 0 2312 1288 7365 2833 p 2 0 2220 1380 6677 2706 p 2 0 2537 1063 8289 3096 p 2 0 2453 1147 8298 2979 p 2 0 2782 818 9301 3355 p 2 0 2502 1098 8014 3089 p 2 0 2599 1001 9093 3170 p 2 0 2250 1350 6963 2749 p 2 0 2223 1377 7193 2706 p 2 0 2231 1369 7024 2735 p 2 0 2264 1336 7237 2760 p 2 0 2220 1380 7307 2707 p 2 0 2315 1285 7113 2804 p 2 0 2575 1025 8305 3106 p 2 0 2333 1267 7409 2824 p 2 0 2700 900 9157 3321 p 2 0 2690 910 9131 3272 p 2 0 2286 1314 7768 2800 p 2 0 2597 1003 8382 3147 p 2 0 2196 1404 6704 2673 p 2 0 1761 1839 5567 2206 p 2 0 2293 1307 7537 2789 i 2 3600 0 0 26465 10778 p 2 0 3343 257 10719 3592 p 2 1470 2067 63 44210 9526 p 2 1497 2014 89 66262 10835 p 2 0 3269 331 13610 4055 p 2 0 2318 1282 6483 2871 p 2 1169 2389 42 66965 10785 p 2 0 3252 348 14862 4674 p 2 724 2789 87 68965 10181 p 2 0 3298 302 14653 4728 p 2 1345 2087 168 69181 11303 p 2 0 3052 548 10127 4360 p 2 25 2914 661 32764 5482 p 2 0 2752 848 10899 3663 p 2 18 3014 568 31400 5319 p 2 14 3064 522 32346 5382 p 2 0 2901 699 10826 3843 p 2 0 2645 955 8122 3205 p 2 123 3000 477 36011 5537 p 2 0 2499 1101 8454 3124 p 2 0 2504 1096 7583 3002 p 2 0 2709 891 8348 3293 p 2 0 2353 1247 6325 2840 p 2 0 2538 1062 7254 3042 p 2 0 2415 1185 6612 2893 p 2 0 2241 1359 6145 2730 p 2 0 2249 1351 5957 2690 p 2 0 2556 1044 7559 3070 p 2 0 2374 1226 6404 2826 p 2 0 2680 920 8119 3222 p 2 0 2476 1124 6599 2949 p 2 0 2208 1392 5755 2660 p 2 0 2436 1164 6333 2861 p 2 0 2254 1346 6006 2717 p 2 0 1917 1683 4647 2337 p 2 0 2219 1381 5893 2658 p 2 0 2177 1423 5218 2585 p 2 0 2149 1451 5257 2566 p 2 0 2161 1439 5208 2538 p 2 0 2212 1388 5871 2632 p 2 0 1837 1763 4792 2246 p 2 0 1947 1653 4510 2308 p 2 0 2295 1305 6544 2721 p 2 0 2071 1529 5246 2474 p 2 0 2237 1363 5221 2673 p 2 0 2134 1466 5277 2556 p 2 0 1838 1762 4402 2242 p 2 0 2102 1498 5225 2509 p 2 0 1945 1655 5134 2367 p 2 0 1917 1683 4693 2348 p 2 0 1827 1773 4283 2246 p 2 0 1979 1621 5087 2417 p 2 0 1831 1769 4412 2229 p 2 0 2586 1014 6589 2988 p 2 0 2217 1383 5679 2649 p 2 0 1917 1683 5002 2365 p 2 0 2237 1363 5227 2614 p 2 0 2068 1532 4979 2476 p 2 0 1908 1692 5039 2318 p 2 0 1987 1613 5134 2392 p 2 0 1878 1722 4587 2292 p 2 0 1965 1635 5144 2373 p 2 0 1788 1812 4251 2183 p 2 0 1968 1632 5281 2373 p 2 0 1978 1622 4461 2346 p 2 0 2232 1368 6297 2685 i 2 3600 0 0 58238 12174 p 2 0 2517 1083 9020 3113 p 2 0 2521 1079 7527 3062 p 2 0 2311 1289 7372 2874 p 2 1950 1547 103 63190 12084 p 2 0 2918 682 9185 3750 p 2 2274 1260 66 52584 12423 p 2 0 2975 625 11878 4167 p 2 890 2624 86 41659 9297 p 2 140 3154 306 27408 6370 p 2 0 2932 668 9362 3729 p 2 0 2803 797 5765 3140 p 2 222 2843 535 24362 5505 p 2 0 2743 857 6302 3160 p 2 16 3038 546 16206 4435 p 2 0 3029 571 7149 3603 p 2 97 2736 767 18681 4599 p 2 0 2735 865 5847 3325 p 2 270 2812 518 22105 5106 p 2 0 2955 645 7912 3453 p 2 162 2851 587 21138 4819 p 2 157 3052 391 21030 5134 p 2 0 2864 736 7261 3430 p 2 0 2925 675 6284 3296 p 2 0 2840 760 6200 3150 i 2 3600 0 0 57204 12554 p 2 0 3518 82 20089 5062 p 2 0 2579 1021 6633 3132 p 2 14 2782 804 9997 3575 p 2 0 2668 932 7796 3322 p 2 0 2547 1053 7680 3210 p 2 11 2511 1078 7354 3229 p 2 0 2469 1131 6702 3024 p 2 0 2360 1240 6689 2919 p 2 14 2663 923 9262 3343 p 2 0 2343 1257 7144 2914 p 2 0 2279 1321 6483 2822 p 2 3 2427 1170 7894 3066 p 2 0 2337 1263 6656 2914 p 2 0 2176 1424 6346 2740 p 2 4 2188 1408 7172 2831 p 2 0 2090 1510 6286 2632 p 2 3 2205 1392 6785 2847 p 2 0 1957 1643 5827 2480 p 2 0 2165 1435 6274 2686 p 2 3 2293 1304 7021 2886 p 2 0 2155 1445 6368 2683 p 2 0 2552 1048 7792 3201 p 2 0 1896 1704 5351 2378 p 2 14 2324 1262 7840 2960 p 2 0 2400 1200 6923 2967 p 2 0 1508 2092 4467 1989 p 2 3 2110 1487 6593 2719 p 2 0 2131 1469 5926 2659 p 2 0 2072 1528 5828 2569 p 2 4 2240 1356 6900 2855 p 2 0 2212 1388 6276 2750 p 2 0 2051 1549 5792 2598 p 2 11 2316 1273 6950 2961 p 2 0 2089 1511 5730 2596 p 2 0 2583 1017 7487 3175 p 2 14 2490 1096 8180 3141 p 2 0 2231 1369 6148 2795 p 2 0 2151 1449 6314 2721 p 2 3 2198 1399 6865 2814 i 2 3600 0 0 63229 12857 p 2 28 3293 279 19794 4820 p 2 0 2827 773 8890 3438 p 2 0 2159 1441 5866 2596 p 2 20 2438 1142 9979 3075 p 2 0 2511 1089 6992 3012 p 2 5 2248 1347 9006 2870 p 2 0 2584 1016 8007 3151 p 2 5 2622 973 10009 3283 p 2 0 1771 1829 5062 2211 p 2 0 2304 1296 6672 2819 p 2 0 2181 1419 5832 2687 p 2 0 2261 1339 6687 2785 p 2 0 2266 1334 6295 2756 p 2 0 2180 1420 5702 2639 p 2 0 1990 1610 4949 2413 i 2 3600 0 0 76912 12637 p 2 1 3578 21 29328 5279 p 2 0 3048 552 10660 3851 p 2 0 3553 47 21922 4600 p 2 0 3574 26 23599 4643 p 2 0 3575 25 22809 4614 p 2 0 3578 22 23594 4692 p 2 0 3582 18 23344 4669 p 2 0 3585 15 25195 4748 p 2 0 3583 17 24526 4744 p 2 0 3565 35 24325 4727 p 2 0 3584 16 23729 4621 p 2 0 3574 26 24659 4699 p 2 0 3578 22 24752 4796 p 2 0 3582 18 25628 4834 p 2 0 3588 12 25204 4824 p 2 0 3586 14 25815 4717 p 2 0 3585 15 23896 4730 p 2 0 3577 23 25120 4718 p 2 0 3579 21 24991 4672 p 2 0 3578 22 25372 4713 p 2 0 3584 16 25033 4687 p 2 0 3582 18 23662 4580 p 2 0 3590 10 23924 4622 p 2 0 3580 20 25270 4617 p 2 0 3579 21 24168 4675 p 2 0 3588 12 25570 4765 p 2 0 3582 18 26395 4855 p 2 0 3580 20 25829 4760 p 2 0 3582 18 26244 4843 p 2 0 3576 24 25577 4765 p 2 0 3580 20 25960 4713 p 2 0 3584 16 25986 4707 p 2 0 3591 9 25001 4691 p 2 0 3588 12 25596 4620 p 2 0 3593 7 25165 4676 p 2 0 3572 28 26019 4654 p 2 0 3586 14 26211 4761 p 2 0 3582 18 25947 4704 p 2 0 3587 13 25945 4803 p 2 0 3588 12 26767 4776 p 2 0 3584 16 24686 4670 p 2 0 3580 20 25314 4727 p 2 0 3583 17 24767 4611 p 2 0 3580 20 26821 4835 p 2 0 3583 17 25026 4794 p 2 0 3577 23 26391 4771 p 2 0 3589 11 26057 4718 p 2 0 3572 28 27114 4806 p 2 0 3581 19 26767 4874 p 2 0 3583 17 27782 4774 p 2 0 3582 18 27220 4835 p 2 0 3581 19 27635 4735 p 2 0 3578 22 25072 4616 p 2 0 3585 15 26168 4722 p 2 0 3582 18 25845 4673 p 2 0 3580 20 27347 4819 p 2 0 3576 24 27166 4808 p 2 0 3574 26 27075 4707 p 2 0 3587 13 27375 4658 p 2 0 3579 21 28246 4794 p 2 0 3589 11 26949 4859 p 2 0 3574 26 27847 4871 p 2 0 3588 12 27893 4928 p 2 0 3570 30 27985 4799 p 2 0 3579 21 28035 4851 p 2 0 3578 22 27842 4832 p 2 0 3575 25 28385 4785 p 2 0 3583 17 28455 4820 p 2 0 3584 16 26870 4761 p 2 0 3579 21 26991 4680 p 2 0 3582 18 27376 4684 p 2 0 3585 15 29381 4728 p 2 0 3582 18 27811 4685 p 2 0 3577 23 27424 4806 p 2 0 3585 15 28165 4888 p 2 0 3580 20 27938 4864 p 2 0 3581 19 25776 4828 p 2 0 3584 16 26697 4825 p 2 0 3588 12 25175 4750 p 2 0 3576 24 27373 4841 p 2 0 3590 10 23993 4693 p 2 0 3578 22 24913 4703 p 2 0 3591 9 25006 4732 p 2 0 3581 19 25289 4710 p 2 0 3584 16 25790 4870 p 2 0 3585 15 26279 4820 p 2 0 3585 15 25947 4912 p 2 0 3581 19 26053 4814 p 2 0 3587 13 24876 4802 p 2 1 3577 22 25715 4882 p 2 0 3585 15 26024 4796 p 2 0 3580 20 27095 4942 p 2 2 3582 16 26841 4962 p 2 0 3583 17 25356 4865 p 2 0 3591 9 25023 4748 p 2 1 3578 21 26276 4797 p 2 0 3592 8 26097 4906 p 2 0 3580 20 26934 4858 p 2 0 3594 6 28614 5057 p 2 0 3576 24 26846 4939 p 2 0 3581 19 27330 4928 p 2 0 3591 9 26314 4944 p 2 0 3580 20 26517 4819 p 2 0 3590 10 27113 4955 p 2 0 3587 13 25687 4913 p 2 0 3586 14 25535 4782 p 2 0 3593 7 25440 4751 p 2 1 3588 11 27585 4806 p 2 0 3583 17 25964 4751 p 2 0 3591 9 27018 4767 p 2 1 3594 5 28026 4950 p 2 0 3590 10 27295 4875 p 2 0 3591 9 25813 4759 p 2 1 3592 7 26511 4873 p 2 0 3595 5 25322 4726 p 2 0 3595 5 27860 4937 p 2 0 3590 10 26282 4872 p 2 0 3597 3 26593 4864 p 2 0 3596 4 26671 4758 p 2 1 3592 7 27123 4830 p 2 0 3592 8 27909 4994 p 2 0 3596 4 27122 4916 p 2 0 3593 7 28586 4961 p 2 0 3587 13 28757 4911 p 2 0 3590 10 26302 4746 p 2 0 3591 9 25980 4881 p 2 0 3589 11 27930 4881 p 2 0 3593 7 28913 5003 p 2 0 3593 7 28055 4961 p 2 0 3588 12 26091 4763 p 2 0 3594 6 26374 4674 p 2 0 3590 10 26908 4761 p 2 0 3592 8 27302 4919 p 2 0 3589 11 28549 4906 p 2 0 3596 4 28922 4941 p 2 0 3593 7 28907 4826 p 2 0 3593 7 27781 4846 p 2 2 3593 5 27765 4894 p 2 0 3580 20 28276 4756 p 2 0 3598 2 28436 4917 p 2 1 3588 11 27587 4854 p 2 0 3597 3 27708 4762 p 2 0 3581 19 27573 4756 p 2 0 3597 3 29216 4807 p 2 0 3592 8 27236 4803 p 2 0 3597 3 28502 4860 p 2 1 3597 2 29871 5014 p 2 0 3594 6 27995 4882 p 2 0 3596 4 28568 4850 p 2 1 3594 5 28859 4909 p 2 0 3589 11 27506 4717 p 2 0 3596 4 28609 4916 p 2 1 3594 5 26588 4833 p 2 0 3596 4 26820 4737 p 2 0 3597 3 26743 4765 p 2 0 3596 4 27026 4738 p 2 0 3593 7 28527 4799 p 2 0 3593 7 27763 4850 p 2 0 3591 9 29607 4904 p 2 0 3594 6 29340 4912 p 2 0 3598 2 27270 4844 p 2 0 3595 5 28070 4869 p 2 0 3595 5 27807 4804 p 2 0 3595 5 28046 4914 p 2 0 3595 5 27781 4963 p 2 0 3600 0 26121 4779 p 2 0 3598 2 26257 4709 p 2 2 3593 5 26986 4790 p 2 0 3596 4 27019 4893 p 2 0 3595 5 28048 4772 p 2 2 3594 4 28555 4951 p 2 0 3594 6 28416 4840 p 2 0 3589 11 25606 4797 p 2 0 3598 2 26816 4864 p 2 0 3592 8 26760 4815 p 2 0 3593 7 28134 4895 p 2 0 3594 6 25954 4840 p 2 0 3594 6 25429 4641 p 2 0 3592 8 25993 4664 p 2 1 3596 3 26822 4664 p 2 0 3594 6 24666 4679 p 2 0 3595 5 26601 4691 p 2 0 3598 2 27945 4875 p 2 0 3594 6 26831 4797 p 2 0 3596 4 26891 4706 p 2 0 3599 1 25843 4766 p 2 0 3594 6 26536 4677 p 2 0 3596 4 26932 4747 p 2 0 3598 2 25033 4704 p 2 0 3595 5 25487 4670 p 2 0 3599 1 25818 4755 p 2 0 3594 6 26692 4709 p 2 0 3594 6 28020 4785 i 2 3600 0 0 79814 12431 p 2 0 3434 166 15579 4584 p 2 0 3258 342 11388 4091 p 2 0 2988 612 9736 3692 p 2 0 3081 519 10577 3754 p 2 0 2834 766 8908 3379 p 2 0 2930 670 9654 3568 p 2 0 3101 499 10411 3801 p 2 1 2884 715 9316 3529 p 2 0 2844 756 8598 3410 p 2 0 3040 560 10317 3728 p 2 0 2883 717 9783 3496 p 2 0 3156 444 11756 3983 p 2 0 2286 1314 6851 2784 p 2 0 2987 613 10223 3639 p 2 0 2774 826 8737 3362 p 2 0 2581 1019 7887 3086 p 2 17 2207 1376 9382 2800 p 2 0 2660 940 8369 3214 p 2 0 2709 891 8352 3273 p 2 30 2469 1101 12464 3266 p 2 0 2562 1038 7861 3116 p 2 39 2866 695 16332 3882 p 2 0 2540 1060 8049 3104 p 2 0 3074 526 11057 3839 p 2 0 2235 1365 6546 2706 p 2 32 2589 979 16422 3509 p 2 0 2902 698 10147 3507 p 2 0 1997 1603 6209 2458 p 2 5 2417 1178 14226 3109 p 2 0 2334 1266 7069 2844 p 2 13 2604 983 14818 3405 p 2 0 2703 897 9286 3301 p 2 0 2739 861 8507 3318 p 2 0 2515 1085 7283 3059 p 2 44 2749 807 17770 3812 p 2 0 2527 1073 7906 3106 p 2 0 3089 511 11213 3853 p 2 47 2934 619 20384 4113 p 2 0 2801 799 9827 3413 p 2 0 1927 1673 5633 2381 p 2 32 2435 1133 18461 3363 p 2 0 2689 911 9206 3266 p 2 12 2453 1135 16534 3261 p 2 0 2400 1200 7767 2943 p 2 0 2751 849 8896 3332 p 2 48 2620 932 18488 3694 p 2 0 2477 1123 7744 3019 p 2 0 3014 586 10913 3755 p 2 0 2155 1445 6765 2620 p 2 61 2631 908 19143 3764 p 2 0 2575 1025 8006 3131 p 2 0 2409 1191 7568 2908 p 2 63 2466 1071 18691 3569 p 2 0 2474 1126 8146 3025 p 2 0 2593 1007 7792 3114 p 2 32 2551 1017 17642 3513 p 2 0 2531 1069 8278 3101 p 2 4 2813 783 16414 3686 p 2 0 2500 1100 8478 3065 p 2 0 3001 599 10629 3748 p 2 0 2184 1416 6594 2663 p 2 18 2556 1026 15889 3445 p 2 0 2600 1000 8388 3154 p 2 0 2311 1289 7012 2784 p 2 29 2418 1153 18493 3362 p 2 0 2518 1082 8149 3067 p 2 49 2541 1010 18814 3547 p 2 0 2441 1159 8380 2991 p 2 0 2501 1099 7708 3036 p 2 31 2731 838 19667 3785 p 2 0 2439 1161 8077 3004 p 2 0 3041 559 10803 3766 p 2 0 2159 1441 6936 2647 p 2 15 2654 931 22723 3668 p 2 0 2784 816 9695 3365 p 2 0 1934 1666 6105 2395 p 2 11 2551 1038 20040 3453 p 2 0 2457 1143 8031 2978 p 2 0 2749 851 8241 3300 p 2 9 2524 1067 19430 3392 p 2 0 2363 1237 7154 2888 p 2 0 2245 1355 7149 2768 p 2 5 2657 938 12304 3373 p 2 0 2654 946 8888 3241 p 2 0 3129 471 11071 3892 p 2 0 2931 669 9911 3583 p 2 0 2022 1578 5997 2461 p 2 0 2627 973 7900 3152 p 2 0 2606 994 8206 3136 p 2 0 2473 1127 7005 2986 p 2 0 2520 1080 7579 3074 p 2 0 2440 1160 7300 2984 p 2 0 2466 1134 7562 2990 p 2 0 2651 949 8487 3225 p 2 0 2508 1092 7635 3020 p 2 0 3079 521 12542 3886 p 2 0 2886 714 9885 3539 p 2 0 2445 1155 7564 2959 p 2 0 2666 934 8497 3224 p 2 0 2459 1141 7258 2950 p 2 0 1763 1837 4996 2171 p 2 0 2453 1147 7084 2937 p 2 0 2518 1082 7651 3004 p 2 0 2440 1160 7220 2936 p 2 0 2434 1166 6893 2930 p 2 0 2762 838 8563 3348 p 2 0 2450 1150 7382 2963 p 2 0 2958 642 10351 3658 p 2 0 2233 1367 6714 2689 p 2 0 2698 902 8721 3280 p 2 0 2376 1224 7614 2903 p 2 0 2580 1020 7793 3093 p 2 0 2485 1115 7251 2940 p 2 0 2383 1217 6841 2884 p 2 0 2631 969 7680 3165 p 2 0 2425 1175 6901 2955 p 2 0 2580 1020 7153 3119 p 2 0 2843 757 8827 3453 p 2 0 2496 1104 7628 3046 p 2 0 3032 568 10580 3759 p 2 0 2114 1486 6477 2582 p 2 0 2642 958 8696 3184 p 2 0 2459 1141 7869 2993 p 2 0 2445 1155 7405 2952 p 2 0 2508 1092 7878 2994 p 2 0 2381 1219 6931 2895 p 2 0 2462 1138 7014 2972 p 2 0 2403 1197 6863 2905 p 2 0 2436 1164 6889 2919 p 2 0 2221 1379 5790 2699 p 2 0 2682 918 7949 3240 p 2 0 2623 977 8142 3167 p 2 0 3067 533 10677 3791 p 2 0 2824 776 8957 3445 p 2 0 2762 838 9166 3335 p 2 0 2685 915 8880 3234 p 2 0 2326 1274 7141 2831 p 2 0 2375 1225 7096 2887 p 2 0 2481 1119 6982 2981 p 2 0 2490 1110 7167 2982 p 2 0 2546 1054 7474 3073 p 2 0 2766 834 8621 3375 p 2 0 1855 1745 5424 2290 p 2 0 2987 613 10301 3694 p 2 0 2144 1456 6577 2607 p 2 0 2431 1169 7481 2937 p 2 0 2444 1156 7325 2952 p 2 0 2391 1209 7289 2885 p 2 0 2027 1573 6148 2479 p 2 0 2457 1143 7176 2942 p 2 0 2591 1009 7409 3114 p 2 0 2338 1262 6815 2850 p 2 0 2628 972 7693 3146 p 2 0 2346 1254 6506 2836 p 2 0 2708 892 8621 3294 p 2 0 2409 1191 7133 2926 p 2 0 3058 542 10452 3793 p 2 0 2829 771 9327 3447 p 2 0 2498 1102 7515 3002 p 2 0 2682 918 8340 3228 p 2 0 2552 1048 7724 3058 p 2 0 2314 1286 6646 2797 p 2 0 2403 1197 7204 2937 p 2 0 2470 1130 7260 2991 p 2 0 2489 1111 7541 3016 p 2 0 2681 919 8123 3233 p 2 0 1868 1732 5592 2325 p 2 0 3042 558 11138 3769 p 2 0 2093 1507 6081 2526 p 2 0 2624 976 8197 3150 p 2 0 2538 1062 7863 3048 p 2 0 2477 1123 7521 2979 p 2 0 2600 1000 8486 3128 p 2 0 2494 1106 7266 3001 p 2 0 2561 1039 7796 3075 p 2 0 2552 1048 7578 3064 p 2 0 2521 1079 7387 3039 p 2 0 2755 845 8816 3365 p 2 0 2512 1088 7317 3022 p 2 0 2951 649 9948 3636 p 2 0 2108 1492 6234 2564 p 2 0 2430 1170 7502 2938 p 2 0 2489 1111 7981 3002 p 2 0 2601 999 7946 3103 p 2 0 2298 1302 7023 2765 p 2 0 2493 1107 7711 3001 p 2 0 2612 988 7580 3140 p 2 0 2408 1192 6911 2927 p 2 0 2547 1053 7225 3061 p 2 0 2799 801 8634 3400 p 2 0 2485 1115 7130 3003 p 2 0 3029 571 10865 3764 p 2 0 2088 1512 5900 2523 p 2 0 2627 973 8233 3156 p 2 0 2384 1216 6914 2858 p 2 0 2621 979 8081 3155 p 2 0 2488 1112 7554 2965 p 2 0 2485 1115 7942 3010 p 2 0 2458 1142 7377 2990 p 2 0 2430 1170 7134 2939 p 2 0 2365 1235 6607 2845 p 2 0 2230 1370 6474 2734 p 2 0 2614 986 7846 3190 p 2 0 2612 988 7866 3138 p 2 0 3053 547 10737 3777 p 2 0 2835 765 8959 3443 p 2 0 2625 975 8193 3138 p 2 0 2284 1316 6613 2754 p 2 0 1969 1631 5921 2403 p 2 0 2518 1082 7529 3023 p 2 0 2726 874 8567 3268 p 2 0 2499 1101 7767 3043 p 2 0 2417 1183 7245 2946 p 2 0 2475 1125 7124 3003 p 2 0 2741 859 8628 3355 p 2 0 2513 1087 7654 3051 p 2 0 2668 932 8628 3218 p 2 0 2530 1070 7598 3025 p 2 0 2503 1097 7576 2998 p 2 0 2534 1066 7678 3046 p 2 0 2328 1272 7126 2804 p 2 0 2226 1374 6285 2705 p 2 0 2409 1191 6756 2912 p 2 0 2504 1096 7581 3004 p 2 0 2560 1040 7348 3079 p 2 0 2348 1252 6497 2836 p 2 0 2633 967 8346 3197 p 2 0 2420 1180 7235 2943 p 2 0 3045 555 10751 3764 p 2 0 2801 799 9037 3407 p 2 0 2483 1117 7440 2985 p 2 0 2453 1147 7106 2938 p 2 0 2356 1244 7223 2820 p 2 0 2287 1313 6624 2778 p 2 0 2447 1153 7174 2970 p 2 0 2448 1152 7045 2958 p 2 0 2718 882 8287 3276 p 2 0 2638 962 8209 3219 p 2 0 2422 1178 7572 2923 p 2 0 2955 645 10432 3654 p 2 0 2114 1486 6246 2566 p 2 0 2682 918 8001 3203 p 2 0 2515 1085 7849 3033 p 2 0 2487 1113 7755 2985 p 2 0 2508 1092 7921 2998 p 2 0 2331 1269 6780 2828 p 2 0 2431 1169 7276 2966 p 2 0 2364 1236 6769 2886 p 2 0 2437 1163 7202 2960 p 2 0 2400 1200 7237 2924 p 2 0 2680 920 8204 3273 p 2 0 3110 490 11708 3877 p 2 0 2172 1428 6364 2622 p 2 0 2535 1065 7600 3060 p 2 0 2528 1072 7942 3042 p 2 0 2552 1048 8187 3071 p 2 0 2306 1294 6977 2776 p 2 0 2143 1457 6134 2595 p 2 0 2359 1241 6813 2852 p 2 0 2475 1125 7313 3006 p 2 0 2477 1123 7432 2968 p 2 0 2728 872 9091 3327 p 2 0 1874 1726 5535 2299 p 2 0 2968 632 10643 3667 p 2 0 2020 1580 6092 2475 i 2 3600 0 0 81601 13236 p 2 0 3592 8 27900 5265 p 2 0 3299 301 13992 4291 p 2 0 3556 44 26457 5107 p 2 1 3568 31 28596 5243 p 2 0 3565 35 28632 5204 p 2 0 3548 52 26976 5087 p 2 0 3544 56 27265 5078 p 2 0 3546 54 27896 5133 p 2 0 3562 38 29642 5304 p 2 0 3558 42 28879 5323 p 2 0 3578 22 27522 5164 p 2 0 3550 50 29086 5247 p 2 0 3539 61 26751 5099 p 2 0 3542 58 28228 5150 p 2 0 3521 79 28103 5103 p 2 0 3536 64 28924 5189 p 2 0 3522 78 27819 5075 p 2 0 3519 81 25605 4915 p 2 0 3507 93 26346 4966 p 2 0 3515 85 27909 4989 p 2 0 3545 55 27872 5024 p 2 0 3555 45 28606 5175 p 2 0 3558 42 26802 5128 p 2 0 3553 47 28644 5207 p 2 0 3545 55 27313 5188 p 2 0 3518 82 27357 5094 p 2 0 3480 120 27367 5070 p 2 0 3526 74 29448 5219 p 2 0 3518 82 28152 5120 p 2 0 3508 92 27442 5014 p 2 0 3504 96 27235 4999 p 2 1 3492 107 28145 5058 p 2 0 3536 64 27749 5109 p 2 0 3502 98 28078 5101 p 2 0 3530 70 28785 5012 p 2 0 3477 123 29796 5178 p 2 0 3461 139 26513 4937 p 2 0 3440 160 25930 4886 p 2 1 3447 152 26062 4979 p 2 0 3497 103 28579 5108 p 2 0 3472 128 27513 4973 p 2 1 3434 165 26459 4831 p 2 0 3442 158 26567 4909 p 2 0 3431 169 27121 4949 p 2 0 3521 79 26860 4972 p 2 0 3504 96 27572 5027 p 2 0 3494 106 27152 4965 p 2 0 3486 114 28935 5016 p 2 0 3451 149 25912 4781 p 2 0 3452 148 26233 4861 p 2 0 3435 165 26769 4861 p 2 0 3452 148 26605 4976 p 2 0 3443 157 25635 4853 p 2 0 3428 172 24901 4769 p 2 0 3375 225 26019 4747 p 2 0 3416 184 28039 4855 p 2 0 3483 117 27504 5010 p 2 0 3450 150 26871 4924 p 2 0 3495 105 25487 4931 p 2 0 3485 115 28114 5083 p 2 0 3487 113 26175 4905 p 2 1 3454 145 27067 4934 p 2 0 3386 214 26574 4870 p 2 0 3448 152 27673 4989 p 2 0 3420 180 27188 4931 p 2 0 3422 178 26989 4888 p 2 0 3430 170 26799 4832 p 2 1 3423 176 27726 4893 p 2 0 3375 225 27572 4866 p 2 0 3392 208 28026 4918 i 2 3600 0 0 37089 11783 p 2 1 3439 160 15656 4626 p 2 3 3171 426 9389 3990 p 2 0 3098 502 9231 3773 p 2 0 2802 798 7203 3312 p 2 0 2850 750 8145 3451 p 2 0 2748 852 6993 3277 p 2 0 2591 1009 6110 3002 p 2 3 2524 1073 7193 3096 p 2 0 2646 954 6868 3145 p 2 0 2679 921 7604 3297 p 2 0 2900 700 8080 3479 p 2 0 2672 928 6977 3179 p 2 0 2539 1061 6110 2964 p 2 2 2700 898 7203 3226 p 2 0 2743 857 6635 3158 p 2 0 2127 1473 5136 2555 p 2 0 2428 1172 6087 2904 p 2 0 2418 1182 5794 2816 p 2 0 2219 1381 5355 2620 p 2 0 2253 1347 5682 2672 p 2 0 2430 1170 5926 2858 p 2 0 2456 1144 6414 2943 p 2 0 2270 1330 4956 2585 p 2 0 2494 1106 6254 2916 p 2 0 2399 1201 5636 2834 p 2 0 2348 1252 5280 2768 p 2 0 2255 1345 5420 2647 p 2 0 1732 1868 3931 2097 p 2 3 2415 1182 6371 2897 p 2 0 2153 1447 5176 2519 p 2 0 1929 1671 4134 2275 p 2 0 2080 1520 5503 2521 p 2 0 2065 1535 4953 2475 p 2 0 2392 1208 5922 2806 p 2 0 2355 1245 6275 2856 p 2 0 2511 1089 6678 3019 p 2 0 2486 1114 6502 2957 p 2 3 2502 1095 7045 3044 p 2 0 2389 1211 5904 2845 p 2 0 2116 1484 5202 2512 p 2 0 2485 1115 6514 2928 p 2 0 2339 1261 5574 2715 p 2 0 2083 1517 5278 2480 p 2 2 2162 1436 5699 2608 p 2 0 2233 1367 5515 2635 p 2 0 2287 1313 6095 2759 p 2 0 2672 928 7131 3169 p 2 0 2508 1092 6376 2955 p 2 0 2328 1272 5545 2727 p 2 0 2496 1104 6044 2942 p 2 0 2380 1220 5573 2788 p 2 0 2185 1415 5005 2531 p 2 0 2280 1320 5584 2718 p 2 0 2027 1573 4667 2413 p 2 0 1787 1813 3926 2156 p 2 0 2060 1540 5826 2534 p 2 0 2255 1345 5559 2654 p 2 3 2283 1314 6008 2775 p 2 0 2577 1023 6489 3047 p 2 0 1978 1622 4630 2328 p 2 0 2320 1280 6062 2786 p 2 0 2499 1101 6292 2935 p 2 0 2451 1149 5981 2848 p 2 0 1971 1629 4670 2365 p 2 0 2266 1334 6095 2744 p 2 0 2103 1497 5176 2507 p 2 0 2227 1373 5206 2620 p 2 2 2040 1558 5638 2492 p 2 0 2228 1372 5661 2622 p 2 0 2275 1325 5988 2713 p 2 0 2518 1082 6438 2972 p 2 0 2386 1214 5869 2807 p 2 0 2284 1316 5408 2702 p 2 0 2455 1145 6810 2933 p 2 0 2340 1260 6126 2777 p 2 0 2037 1563 4975 2461 p 2 3 2241 1356 6239 2728 p 2 0 2263 1337 5566 2649 p 2 0 2237 1363 4888 2612 p 2 0 2098 1502 5780 2567 p 2 0 2193 1407 5366 2582 p 2 0 2370 1230 6053 2815 p 2 0 2518 1082 6535 3002 p 2 0 2446 1154 5921 2870 p 2 0 2282 1318 6357 2827 p 2 0 2248 1352 5631 2685 p 2 0 2185 1415 5105 2572 p 2 0 1750 1850 3787 2103 p 2 3 2259 1338 6040 2710 p 2 0 2103 1497 4772 2460 p 2 0 1823 1777 3981 2169 p 2 0 1967 1633 5061 2391 p 2 0 2236 1364 5260 2606 p 2 3 2256 1341 6204 2754 p 2 0 1967 1633 4643 2321 p 2 0 2282 1318 5710 2744 p 2 0 2148 1452 5305 2555 p 2 0 2489 1111 6516 2925 p 2 0 2375 1225 5562 2753 p 2 0 1980 1620 4521 2342 p 2 0 2290 1310 5824 2723 p 2 0 2119 1481 5186 2542 p 2 0 2190 1410 4998 2601 p 2 0 2082 1518 5709 2605 p 2 0 2299 1301 5366 2708 p 2 3 2200 1397 6509 2716 p 2 0 2598 1002 6694 3069 p 2 0 2422 1178 5946 2850 p 2 0 2155 1445 5358 2598 p 2 0 2330 1270 6041 2793 p 2 0 2324 1276 5600 2750 p 2 0 1942 1658 4679 2347 p 2 0 2174 1426 6163 2629 p 2 0 2039 1561 4806 2411 p 2 0 1863 1737 4229 2214 p 2 3 2024 1573 5750 2482 p 2 0 2287 1313 5687 2674 p 2 0 2331 1269 6462 2831 p 2 0 2574 1026 6622 3057 p 2 0 2341 1259 5630 2805 p 2 0 2180 1420 4642 2580 p 2 2 2503 1095 6637 2964 p 2 0 2340 1260 5682 2758 p 2 0 2115 1485 4841 2457 p 2 0 2163 1437 5778 2605 p 2 0 2136 1464 5337 2576 p 2 0 2116 1484 5090 2488 p 2 0 2043 1557 5388 2491 p 2 0 2110 1490 5114 2530 p 2 0 2184 1416 5579 2646 p 2 0 2457 1143 6032 2902 p 2 0 2388 1212 5942 2818 p 2 3 2408 1189 6678 2911 p 2 0 2391 1209 5739 2787 p 2 0 2210 1390 4904 2583 p 2 0 1735 1865 4117 2094 p 2 0 2260 1340 6341 2733 p 2 0 2104 1496 4995 2533 p 2 0 1949 1651 4953 2351 p 2 2 2011 1587 5425 2451 p 2 0 2003 1597 4499 2384 p 2 0 2157 1443 4926 2563 p 2 0 2419 1181 6275 2852 p 2 0 2244 1356 5873 2726 p 2 0 2273 1327 5302 2663 p 2 0 2374 1226 6117 2817 p 2 0 2303 1297 5588 2713 p 2 0 1994 1606 4620 2401 p 2 0 2187 1413 5425 2605 p 2 0 2172 1428 5097 2546 p 2 0 2128 1472 5081 2547 p 2 0 1903 1697 5099 2362 p 2 0 1970 1630 4783 2378 i 2 3600 0 0 93088 13108 p 2 0 3355 245 18245 4329 p 2 0 3086 514 12056 3828 p 2 0 3081 519 14606 3858 p 2 0 2820 780 10659 3435 p 2 0 2792 808 11341 3390 p 2 0 2620 980 9705 3135 p 2 0 2693 907 9684 3232 p 2 0 2630 970 9014 3158 p 2 0 2457 1143 8647 2944 p 2 0 2556 1044 8874 3099 p 2 0 2749 851 10089 3334 p 2 0 2520 1080 8823 3044 p 2 0 3164 436 14217 3932 p 2 0 3013 587 12437 3700 p 2 0 2775 825 10535 3352 p 2 0 2656 944 9464 3182 p 2 0 2552 1048 8813 3058 p 2 0 2463 1137 8555 2992 p 2 0 2485 1115 8266 2985 p 2 0 2390 1210 8262 2920 p 2 0 2462 1138 8627 3001 p 2 0 2425 1175 8429 2946 p 2 0 2706 894 9517 3261 p 2 0 2671 929 9377 3223 p 2 0 2957 643 11717 3619 p 2 0 2688 912 9604 3270 p 2 0 2323 1277 8081 2812 p 2 0 2362 1238 7871 2861 p 2 0 2484 1116 8835 2971 p 2 0 2368 1232 7949 2824 p 2 0 2306 1294 8216 2787 p 2 0 2267 1333 7529 2750 p 2 0 2320 1280 7656 2799 p 2 0 2206 1394 7017 2673 p 2 0 2517 1083 8093 3053 p 2 0 2307 1293 8004 2803 p 2 0 2837 763 10335 3449 p 2 0 2538 1062 9250 3063 i 2 3600 0 0 36096 11778 p 2 3 3515 82 23587 5599 p 2 0 2997 603 7835 3592 p 2 0 2998 602 16595 4444 p 2 1 3132 467 17985 4681 p 2 0 2998 602 9235 3702 p 2 0 3114 486 15840 4416 p 2 0 2905 695 8140 3497 p 2 0 3096 504 15965 4381 p 2 0 2898 702 8905 3530 p 2 23 3103 474 19985 5002 p 2 0 3128 472 9394 3850 p 2 26 3166 408 21324 5200 p 2 4 3129 467 19124 4774 p 2 0 2875 725 9362 3568 p 2 0 2624 976 7085 3107 p 2 0 3083 517 18019 4620 p 2 0 2666 934 7742 3192 p 2 0 2431 1169 6738 2905 p 2 1 2478 1121 6374 2899 p 2 0 2603 997 7787 3109 p 2 0 2477 1123 6217 2931 p 2 0 2105 1495 5340 2477 p 2 0 2465 1135 6174 2865 p 2 0 1939 1661 4615 2260 p 2 0 2095 1505 4818 2447 p 2 0 1888 1712 4570 2238 p 2 0 2076 1524 5281 2489 p 2 0 1637 1963 4112 2006 p 2 0 1665 1935 3737 2024 p 2 0 1382 2218 3331 1732 p 2 0 821 2779 2508 1236 p 2 0 1350 2250 3110 1734 p 2 1 2000 1599 4958 2400 p 2 0 2430 1170 5887 2873 p 2 0 1955 1645 4317 2284 p 2 0 2546 1054 6358 2984 p 2 0 2310 1290 5659 2729 p 2 0 1530 2070 3810 1890 p 2 0 1918 1682 4637 2278 p 2 0 1763 1837 4230 2151 p 2 0 2158 1442 5432 2571 p 2 0 1928 1672 4719 2312 p 2 0 2055 1545 4468 2412 p 2 0 1851 1749 4339 2238 p 2 0 2024 1576 4970 2413 p 2 0 1912 1688 4480 2275 p 2 0 2300 1300 5959 2733 p 2 0 2424 1176 6028 2846 p 2 0 2269 1331 5510 2667 p 2 0 2144 1456 5396 2521 p 2 0 1898 1702 4606 2270 p 2 0 1750 1850 3499 2081 p 2 0 1931 1669 4309 2292 p 2 1 1659 1940 4176 2039 p 2 0 1602 1998 3815 1936 p 2 2 2157 1441 5109 2536 p 2 0 2240 1360 5355 2611 p 2 0 2389 1211 5897 2837 p 2 0 1903 1697 4515 2248 p 2 0 1966 1634 4896 2344 p 2 0 1856 1744 4240 2227 p 2 0 1723 1877 4217 2098 p 2 0 2042 1558 5051 2445 p 2 0 2180 1420 5189 2575 p 2 0 2108 1492 5222 2470 p 2 0 1709 1891 3941 2102 p 2 0 1752 1848 3711 2106 p 2 0 1509 2091 3942 1892 p 2 0 2060 1540 4627 2436 p 2 0 2006 1594 4801 2394 p 2 0 2089 1511 5056 2487 p 2 0 1819 1781 4434 2183 p 2 0 1779 1821 4150 2150 p 2 0 1335 2265 3512 1698 p 2 0 1904 1696 4670 2327 p 2 0 2020 1580 4910 2379 p 2 0 1949 1651 4652 2307 p 2 0 1743 1857 4009 2081 p 2 0 1986 1614 4394 2312 p 2 1 1900 1699 4623 2284 p 2 0 1789 1811 4263 2165 p 2 0 2236 1364 5409 2684 p 2 0 1889 1711 4236 2271 p 2 0 1522 2078 3550 1881 p 2 0 1669 1931 3770 2044 p 2 0 1278 2322 2956 1635 p 2 2 1816 1782 4890 2232 p 2 0 1999 1601 4465 2355 p 2 0 1856 1744 4247 2222 p 2 0 1669 1931 4100 2053 p 2 0 1632 1968 3794 1970 p 2 0 1424 2176 3886 1830 p 2 0 2143 1457 4990 2488 p 2 0 2128 1472 5316 2524 p 2 0 2314 1286 6561 2770 p 2 0 2137 1463 5144 2520 p 2 0 1925 1675 4843 2318 p 2 0 1872 1728 4027 2210 p 2 0 1859 1741 4928 2313 i 2 3600 0 0 38157 11721 p 2 0 3207 393 11770 3972 p 2 10 3538 52 25769 5969 p 2 0 3229 371 11588 4076 p 2 13 3440 147 26868 6235 p 2 0 3239 361 11421 4092 p 2 8 3459 133 26145 6032 p 2 0 3244 356 10869 4142 p 2 7 3477 116 25087 5918 p 2 2 3454 144 24372 5899 p 2 0 2988 612 10739 4041 p 2 0 2937 663 8667 3505 p 2 162 3259 179 33779 7123 p 2 0 3247 353 11509 4169 p 2 1092 2420 88 50732 10585 p 2 0 3353 247 12626 4488 p 2 151 3295 154 38787 7742 p 2 0 3354 246 12423 4622 p 2 130 3174 296 38556 7631 p 2 0 3315 285 12233 4696 p 2 0 3098 502 9316 4207 p 2 0 3024 576 8819 3829 p 2 0 3006 594 8108 3572 p 2 0 2887 713 7574 3411 p 2 0 2710 890 6609 3181 p 2 0 2450 1150 6006 2844 p 2 0 2686 914 6569 3122 p 2 0 2720 880 7079 3146 p 2 0 2427 1173 6103 2824 p 2 0 2762 838 6817 3181 p 2 0 2864 736 7556 3369 p 2 0 2809 791 7214 3317 p 2 0 2507 1093 6028 2917 p 2 0 2534 1066 6401 2993 p 2 0 2579 1021 6307 3005 p 2 0 2461 1139 6512 2893 i 2 3600 0 0 81235 12065 p 2 0 3430 170 17698 4372 p 2 0 3236 364 13201 4022 p 2 0 2818 782 10766 3478 p 2 0 2935 665 11393 3696 p 2 0 2919 681 10997 3650 p 2 0 3384 216 17153 4492 p 2 0 3234 366 14136 4186 p 2 0 2973 627 11491 3716 p 2 0 3057 543 11622 3825 p 2 0 2825 775 10673 3530 p 2 0 2100 1500 7177 2592 p 2 0 2767 833 10305 3410 p 2 0 2722 878 9911 3360 p 2 0 2860 740 10522 3554 p 2 0 2705 895 9545 3304 p 2 0 2803 797 10674 3470 p 2 0 2642 958 10003 3219 p 2 0 2954 646 11361 3669 p 2 0 2817 783 10674 3459 p 2 0 1807 1793 6276 2264 p 2 0 2225 1375 7891 2724 p 2 0 2536 1064 9283 3109 p 2 0 2284 1316 8600 2829 p 2 0 2523 1077 9382 3084 p 2 0 2503 1097 8529 3061 p 2 0 2371 1229 7795 2908 p 2 0 2314 1286 7921 2827 p 2 0 2772 828 10248 3400 p 2 0 2478 1122 8731 3029 p 2 0 2924 676 11390 3615 p 2 0 2712 888 9959 3310 p 2 0 2689 911 10170 3283 p 2 0 2587 1013 9359 3188 p 2 0 2426 1174 8613 2970 p 2 0 2101 1499 7061 2573 p 2 0 2528 1072 9496 3087 p 2 0 2496 1104 8806 3048 p 2 0 2336 1264 8061 2880 p 2 0 2430 1170 8723 2978 p 2 0 2599 1001 9382 3164 p 2 0 2415 1185 8412 2946 p 2 0 2838 762 11106 3490 p 2 0 2643 957 9479 3236 p 2 0 2503 1097 9677 3067 p 2 0 2423 1177 8712 2947 p 2 0 2240 1360 8013 2770 p 2 0 2250 1350 7940 2774 p 2 0 2413 1187 8488 2955 p 2 0 2363 1237 8317 2887 p 2 0 2234 1366 8125 2748 p 2 0 2333 1267 8171 2864 p 2 0 2612 988 9323 3188 p 2 0 2384 1216 9118 2914 p 2 0 2894 706 11365 3558 p 2 0 2782 818 10520 3369 p 2 0 2425 1175 8788 2930 p 2 0 2180 1420 7975 2676 p 2 0 2465 1135 8996 3021 p 2 0 2493 1107 8763 3046 p 2 0 2524 1076 9175 3095 p 2 0 2513 1087 9141 3077 p 2 0 2423 1177 8443 2992 p 2 0 2543 1057 8849 3106 p 2 0 2686 914 9937 3286 p 2 0 2432 1168 8595 2973 p 2 0 2850 750 11118 3545 p 2 0 2690 910 10264 3317 p 2 0 2256 1344 8579 2770 p 2 0 2270 1330 8023 2781 p 2 0 2513 1087 9066 3077 p 2 0 2572 1028 9292 3107 p 2 0 2349 1251 8501 2890 p 2 0 2394 1206 8052 2914 p 2 0 2355 1245 8394 2885 p 2 0 2433 1167 8359 2985 p 2 0 2545 1055 9179 3120 p 2 0 2429 1171 11194 3002 p 2 0 2079 1521 7258 2553 p 2 0 2355 1245 8595 2842 p 2 0 2507 1093 10119 3034 p 2 0 2402 1198 11029 2979 p 2 0 2428 1172 9160 2945 p 2 0 2162 1438 7674 2643 p 2 1 2732 867 13401 3413 p 2 0 2598 1002 10100 3181 p 2 0 1901 1699 6866 2376 p 2 1 2616 983 12478 3256 p 2 0 2724 876 10355 3344 p 2 0 2454 1146 11263 3056 p 2 0 2832 768 11326 3504 p 2 0 2769 831 10648 3386 p 2 0 2355 1245 8366 2882 p 2 0 2198 1402 10057 2740 p 2 0 2359 1241 8546 2885 p 2 0 2393 1207 8592 2910 p 2 0 2451 1149 8993 2981 p 2 0 2133 1467 7812 2636 i 2 3600 0 0 62007 12802 p 2 0 3257 343 13754 4357 p 2 0 2908 692 8731 3713 p 2 0 2905 695 8656 3674 p 2 0 2642 958 7526 3338 p 2 0 2879 721 9335 3723 p 2 0 2524 1076 6809 3182 p 2 0 1686 1914 4483 2177 p 2 1 2511 1088 7308 3161 p 2 0 2200 1400 5867 2773 p 2 0 2444 1156 6753 3085 p 2 0 2545 1055 7019 3175 p 2 0 2429 1171 6444 3035 p 2 0 2293 1307 6246 2886 p 2 1 2299 1300 6083 2875 p 2 0 2447 1153 6376 3056 p 2 0 2345 1255 6172 2930 p 2 0 2693 907 8106 3404 p 2 0 2249 1351 5869 2817 p 2 0 2567 1033 7156 3225 p 2 0 2054 1546 5305 2598 p 2 0 1605 1995 3877 2065 p 2 0 2233 1367 5537 2768 p 2 1 2288 1311 6129 2884 p 2 0 2263 1337 5761 2863 p 2 0 1538 2062 3806 2015 p 2 0 2199 1401 6043 2783 p 2 0 2397 1203 6454 3014 p 2 0 2072 1528 5403 2596 p 2 0 2622 978 7525 3298 p 2 0 2398 1202 6312 2996 p 2 0 2257 1343 5876 2847 p 2 1 2342 1257 6307 2950 p 2 0 2190 1410 5618 2740 p 2 0 2010 1590 5312 2549 p 2 0 2145 1455 5323 2692 p 2 0 2062 1538 5310 2611 p 2 0 1434 2166 3487 1907 p 2 0 2064 1536 5273 2619 p 2 0 2364 1236 6346 2952 p 2 0 2050 1550 5177 2567 p 2 0 2546 1054 7298 3173 p 2 0 2133 1467 5528 2688 p 2 0 2458 1142 6757 3063 p 2 0 2113 1487 5288 2663 p 2 0 1480 2120 3736 1956 p 2 0 2087 1513 5458 2632 p 2 1 2282 1317 6139 2876 p 2 0 2216 1384 5650 2795 p 2 0 2087 1513 5127 2622 p 2 0 2234 1366 6152 2827 p 2 0 2344 1256 6081 2923 p 2 0 2084 1516 5346 2608 p 2 0 2533 1067 7217 3205 p 2 0 2135 1465 5489 2676 p 2 0 1583 2017 3861 2045 p 2 0 2167 1433 5957 2756 p 2 0 1806 1794 4480 2317 p 2 0 2204 1396 5709 2752 p 2 0 2212 1388 5918 2789 p 2 0 2136 1464 5370 2702 p 2 0 1485 2115 3615 1939 p 2 0 2161 1439 5670 2725 p 2 0 2299 1301 6157 2873 p 2 0 1981 1619 5061 2492 p 2 1 2572 1027 7331 3225 p 2 0 2112 1488 5447 2652 p 2 0 2323 1277 6491 2915 p 2 0 2163 1437 5507 2719 p 2 0 2157 1443 5444 2721 p 2 0 2023 1577 5141 2553 p 2 0 2024 1576 5379 2593 p 2 0 2197 1403 5882 2771 p 2 0 1388 2212 3424 1847 p 2 0 2089 1511 5505 2650 p 2 0 2471 1129 6289 3065 p 2 0 1955 1645 4701 2447 p 2 1 2317 1282 6376 2912 p 2 0 2007 1593 5318 2549 p 2 0 2221 1379 6028 2815 p 2 0 2300 1300 6128 2889 p 2 0 1977 1623 5186 2515 p 2 0 2248 1352 6140 2833 p 2 0 2185 1415 5717 2760 p 2 0 1930 1670 4810 2455 p 2 0 1444 2156 3680 1896 p 2 1 1951 1648 5222 2484 p 2 0 2224 1376 5779 2768 p 2 0 1953 1647 4939 2460 p 2 0 2522 1078 7320 3166 p 2 0 2159 1441 5526 2701 p 2 0 2304 1296 6112 2910 p 2 0 2215 1385 5945 2797 p 2 0 2274 1326 5808 2839 p 2 0 2214 1386 5531 2763 p 2 1 2061 1538 5486 2616 p 2 0 2247 1353 5992 2838 p 2 0 2216 1384 5749 2772 p 2 0 2192 1408 5985 2764 p 2 0 2285 1315 6055 2864 p 2 0 2099 1501 5424 2625 p 2 0 2509 1091 7189 3167 p 2 0 2102 1498 5093 2635 p 2 1 2356 1243 6189 2948 p 2 0 2114 1486 5310 2660 p 2 0 1430 2170 3547 1881 p 2 0 2031 1569 5124 2580 p 2 0 2181 1419 5506 2743 p 2 0 2012 1588 5049 2551 p 2 0 1581 2019 3988 2053 p 2 335 2244 1021 31057 5355 p 2 0 2648 952 8688 3430 p 2 0 2427 1173 7156 3083 p 2 129 2579 892 26687 4860 p 2 0 2511 1089 7517 3239 p 2 140 2616 844 26960 4919 p 2 0 2466 1134 8210 3188 p 2 0 1817 1783 4888 2344 p 2 0 2425 1175 6797 3085 p 2 188 2469 943 27633 5054 p 2 0 3492 108 16256 4510 p 2 0 3586 14 16659 4647 p 2 232 3360 8 36497 6518 p 2 0 3599 1 19235 4738 p 2 0 3595 5 20471 4590 p 2 67 3533 0 35133 6226 p 2 2 3596 2 21621 4987 p 2 1 3599 0 17011 4537 p 2 163 3435 2 33455 6360 p 2 3 3596 1 19958 4945 p 2 3 3591 6 19213 4811 p 2 139 3461 0 34577 6342 p 2 0 3594 6 18336 4761 p 2 0 3598 2 18271 4953 p 2 94 3506 0 35391 6521 p 2 0 3598 2 20599 5184 p 2 1 3596 3 20449 4866 p 2 80 3518 2 36836 6743 p 2 1 3592 7 20924 5411 p 2 1 3597 2 18362 4750 p 2 205 3392 3 35924 6631 p 2 0 3599 1 19944 4980 p 2 0 3597 3 19380 4786 p 2 295 3303 2 35754 6711 p 2 0 3599 1 17878 4703 p 2 0 3600 0 17919 4536 p 2 345 3255 0 36712 6736 p 2 0 3597 3 18422 4918 p 2 0 3586 14 18132 4704 p 2 523 3075 2 35271 7218 p 2 0 3585 15 18952 4770 p 2 0 3587 13 17080 4577 i 2 3600 0 0 61006 12783 p 2 0 2948 652 9414 3777 p 2 0 2936 664 8151 3662 p 2 455 2633 512 30184 6274 p 2 0 2891 709 9119 3787 p 2 0 2208 1392 5766 2790 p 2 421 2210 969 26456 5436 p 2 0 2907 693 9756 3852 p 2 0 2607 993 7222 3317 p 2 347 2411 842 22718 5179 p 2 0 2668 932 7814 3469 p 2 304 2451 845 18333 4812 p 2 0 2496 1104 7120 3174 p 2 0 1777 1823 4251 2280 p 2 0 2408 1192 6223 2999 p 2 280 2191 1129 15652 4225 p 2 0 2519 1081 7180 3195 p 2 0 2439 1161 6285 3069 p 2 103 2349 1148 10238 3558 p 2 0 2511 1089 6511 3175 p 2 32 2354 1214 8093 3186 p 2 0 2811 789 7757 3558 p 2 10 2708 882 7725 3512 p 2 0 2594 1006 7040 3297 p 2 0 2069 1531 5049 2615 p 2 0 2430 1170 6096 3066 p 2 0 2171 1429 5461 2751 p 2 0 2096 1504 5048 2643 p 2 0 2320 1280 5910 2927 p 2 0 2088 1512 5171 2639 p 2 0 2511 1089 6209 3130 p 2 0 2049 1551 4770 2556 p 2 0 2558 1042 6583 3242 p 2 0 2470 1130 6289 3122 p 2 0 2435 1165 5879 3027 p 2 0 2478 1122 6223 3112 p 2 0 2154 1446 5146 2690 p 2 0 2145 1455 5134 2695 p 2 0 2069 1531 4991 2599 p 2 0 2092 1508 4934 2641 p 2 0 2169 1431 5372 2728 p 2 0 2230 1370 5455 2800 p 2 0 2371 1229 5956 2941 p 2 0 1991 1609 4626 2503 p 2 0 2607 993 6956 3287 p 2 0 2386 1214 6191 3003 p 2 0 2333 1267 5983 2919 i 2 3600 0 0 92013 13250 p 2 0 3472 128 19166 4963 p 2 0 2932 668 10070 3617 p 2 41 3275 284 35729 5392 p 2 0 3201 399 14777 4114 p 2 3 3202 395 27704 4854 p 2 0 2896 704 11305 3653 p 2 0 2800 800 10808 3505 p 2 0 3224 376 27120 4907 p 2 0 3070 530 11530 3950 p 2 0 3204 396 12804 4149 p 2 0 3118 482 12065 3969 p 2 0 3012 588 10763 3790 p 2 0 2984 616 10657 3760 p 2 2 2950 648 10485 3722 p 2 0 2850 750 9574 3552 p 2 0 2713 887 8761 3365 p 2 3 2730 867 9393 3434 p 2 0 2506 1094 8344 3101 p 2 0 2860 740 10483 3524 i 2 3600 0 0 50636 12503 p 2 62 3473 65 23130 5677 p 2 0 3192 408 11511 4263 p 2 0 2637 963 8484 3234 p 2 0 2101 1499 6038 2542 p 2 0 2720 880 8236 3237 p 2 0 2213 1387 6076 2714 p 2 0 2625 975 7804 3117 p 2 0 2363 1237 6957 2854 p 2 0 2301 1299 6142 2723 p 2 0 2204 1396 6348 2690 p 2 0 2496 1104 7663 2996 p 2 0 2313 1287 7136 2785 p 2 0 2857 743 9209 3430 p 2 0 2510 1090 7837 3066 p 2 0 2142 1458 6073 2643 p 2 0 2446 1154 6744 2950 p 2 0 2473 1127 6941 2980 p 2 0 2392 1208 7098 2891 p 2 0 2200 1400 6657 2681 p 2 0 2300 1300 6719 2799 p 2 0 2340 1260 6717 2808 p 2 0 2029 1571 5400 2506 p 2 0 2054 1546 5926 2503 p 2 0 2203 1397 6410 2692 p 2 0 2785 815 8674 3346 p 2 0 2586 1014 7524 3095 p 2 0 2214 1386 6507 2667 p 2 0 2316 1284 6928 2870 p 2 0 2070 1530 6091 2494 p 2 0 2264 1336 6717 2765 p 2 0 2374 1226 6641 2808 p 2 0 2130 1470 5450 2596 p 2 0 2289 1311 6753 2743 p 2 0 2075 1525 5565 2541 p 2 0 2322 1278 6580 2814 p 2 0 2122 1478 6036 2537 p 2 0 2770 830 8090 3234 p 2 0 1806 1794 5482 2225 p 2 0 2246 1354 6738 2773 p 2 0 2216 1384 6930 2749 p 2 0 2316 1284 6404 2763 p 2 0 2285 1315 6719 2774 p 2 0 2320 1280 6417 2767 p 2 0 2221 1379 6572 2679 p 2 0 2164 1436 6222 2619 p 2 0 2059 1541 5697 2491 p 2 0 2423 1177 6468 2832 p 2 0 1940 1660 4993 2369 p 2 0 1986 1614 5382 2344 p 2 0 2380 1220 7197 2868 p 2 0 2107 1493 5827 2555 p 2 0 2329 1271 6896 2795 p 2 0 2279 1321 6662 2770 p 2 0 2176 1424 6036 2640 p 2 0 2164 1436 5496 2612 p 2 0 2153 1447 6120 2617 p 2 0 2147 1453 6106 2559 p 2 0 2118 1482 6546 2594 p 2 0 2340 1260 7189 2776 p 2 0 1533 2067 4726 1941 p 2 0 2706 894 8079 3209 p 2 0 2371 1229 7236 2878 p 2 0 2253 1347 6316 2752 p 2 0 2179 1421 6308 2654 p 2 0 1935 1665 5352 2350 p 2 0 2158 1442 6253 2652 p 2 0 2152 1448 6523 2623 p 2 0 1996 1604 6007 2486 p 2 0 2118 1482 5729 2556 p 2 0 1985 1615 5992 2448 p 2 0 2002 1598 5018 2415 p 2 0 2244 1356 6485 2704 p 2 0 2857 743 8452 3319 p 2 0 2418 1182 6955 2893 p 2 0 1674 1926 4550 2057 p 2 0 1799 1801 5009 2190 p 2 0 2071 1529 5771 2531 p 2 0 1938 1662 5576 2394 p 2 0 2197 1403 6283 2633 p 2 0 2134 1466 6087 2600 p 2 0 2020 1580 5406 2424 p 2 0 1914 1686 5529 2337 p 2 0 1852 1748 4792 2264 p 2 0 2155 1445 6561 2615 p 2 0 2689 911 7593 3174 p 2 0 2183 1417 6644 2692 p 2 0 2092 1508 5971 2512 p 2 0 2250 1350 6936 2711 p 2 0 2272 1328 6384 2717 p 2 0 1934 1666 5497 2368 p 2 0 2238 1362 5920 2668 p 2 0 2231 1369 5679 2676 p 2 0 2204 1396 5909 2628 p 2 0 2123 1477 6250 2588 p 2 0 2290 1310 6766 2760 p 2 0 2132 1468 5744 2558 p 2 0 2601 999 7713 3091 p 2 0 2414 1186 7502 2912 p 2 0 2271 1329 6182 2732 p 2 0 2295 1305 7028 2777 p 2 0 1930 1670 5293 2339 p 2 0 2235 1365 6668 2695 p 2 0 2145 1455 5322 2594 p 2 0 2044 1556 5738 2492 p 2 0 2093 1507 6170 2537 p 2 0 2177 1423 5849 2587 p 2 0 2028 1572 5877 2499 p 2 0 2115 1485 5506 2586 p 2 0 2139 1461 5767 2536 p 2 0 2436 1164 7773 2951 p 2 0 2112 1488 5480 2523 p 2 0 2249 1351 6220 2736 p 2 0 2247 1353 6700 2715 p 2 0 2031 1569 6289 2479 p 2 0 2185 1415 6110 2675 p 2 0 1991 1609 5744 2421 p 2 0 2158 1442 6215 2605 p 2 0 1953 1647 5099 2374 p 2 0 2266 1334 6702 2733 p 2 0 2060 1540 5904 2480 p 2 0 1942 1658 4769 2293 p 2 0 2268 1332 6977 2778 p 2 0 2141 1459 6485 2655 p 2 0 2011 1589 5189 2463 p 2 0 2976 624 10256 3890 i 2 3600 0 0 48727 11942 p 2 0 3328 272 14010 4031 p 2 0 2633 967 8536 3137 p 2 0 2233 1367 7353 2708 p 2 0 1964 1636 6026 2417 p 2 0 2146 1454 6578 2628 p 2 0 2081 1519 5827 2566 p 2 0 2388 1212 8267 2932 p 2 0 2204 1396 6391 2688 p 2 0 1729 1871 5289 2186 p 2 0 2248 1352 11196 3010 p 2 0 2157 1443 7621 2655 p 2 0 1528 2072 4667 1961 p 2 0 2179 1421 12256 2976 p 2 0 2096 1504 7258 2593 p 2 0 2162 1438 12656 2956 p 2 0 1936 1664 6321 2412 p 2 1 2114 1485 12003 2918 p 2 0 2041 1559 6994 2516 i 2 3600 0 0 50307 12515 p 2 87 3471 42 23834 5772 p 2 7 3200 393 20414 4789 p 2 0 2915 685 10277 3845 p 2 0 2218 1382 6393 2721 p 2 16 2760 824 18006 3985 p 2 0 2477 1123 8394 3115 p 2 0 2544 1056 8087 3104 p 2 124 2480 996 22854 4315 p 2 0 2591 1009 8312 3197 p 2 599 2214 787 28914 5991 p 2 12 2610 978 10222 3398 p 2 0 2296 1304 6832 2824 p 2 0 2544 1056 7682 3114 p 2 193 2597 810 24655 4851 p 2 0 2048 1552 6409 2697 p 2 0 2576 1024 7991 3192 p 2 21 2686 893 20992 4078 p 2 0 2479 1121 8775 3181 p 2 46 2537 1017 23411 4155 p 2 0 2424 1176 8721 3126 p 2 0 2539 1061 8720 3207 p 2 0 1864 1736 5416 2335 p 2 0 2663 937 8623 3210 p 2 0 1918 1682 5729 2357 p 2 0 2939 661 9127 3535 p 2 1 2683 916 8866 3300 p 2 0 2566 1034 8032 3146 p 2 0 1954 1646 5301 2337 p 2 0 2365 1235 7665 2899 p 2 0 2245 1355 6212 2749 p 2 0 2500 1100 6591 3013 p 2 0 2463 1137 7261 2989 p 2 0 2360 1240 6573 2862 p 2 0 2312 1288 6206 2807 p 2 0 2483 1117 7824 2993 p 2 0 2337 1263 6926 2840 p 2 0 2312 1288 6987 2763 p 2 1 2420 1179 7106 2924 p 2 0 2477 1123 6900 2997 p 2 0 2369 1231 6739 2868 p 2 0 2387 1213 6832 2902 p 2 0 2246 1354 6270 2744 p 2 0 2348 1252 7171 2894 p 2 0 2149 1451 5783 2612 p 2 0 2039 1561 5846 2506 p 2 0 2093 1507 5775 2568 p 2 0 2335 1265 7163 2853 p 2 0 2627 973 8142 3226 p 2 0 1963 1637 5762 2387 p 2 0 2395 1205 7473 2876 p 2 0 2415 1185 7121 2941 p 2 0 1599 2001 4344 2027 p 2 0 2182 1418 6867 2682 p 2 0 2252 1348 6558 2740 p 2 0 2281 1319 6968 2754 p 2 0 2070 1530 5631 2561 p 2 0 2174 1426 5931 2648 p 2 0 2107 1493 6125 2610 p 2 0 2428 1172 8009 2933 p 2 0 2137 1463 6545 2595 p 2 0 2723 877 8464 3229 p 2 0 2566 1034 8220 3092 i 2 3600 0 0 50117 12183 p 2 4 3489 107 22537 5081 p 2 0 2540 1060 7180 3152 p 2 88 2703 809 12836 4214 p 2 0 2634 966 7808 3158 p 2 0 2480 1120 7364 2956 p 2 159 2187 1254 13351 3639 p 2 0 2523 1077 7762 3068 p 2 52 2650 898 12559 3765 p 2 0 2350 1250 6604 2774 p 2 0 2436 1164 6869 2965 p 2 90 2549 961 11517 3758 p 2 0 2451 1149 7002 3033 p 2 0 2407 1193 6553 2840 p 2 0 2286 1314 6330 2720 p 2 0 2419 1181 6743 2852 p 2 0 2218 1382 6230 2640 p 2 0 2154 1446 5762 2595 p 2 0 1980 1620 5069 2402 p 2 0 2324 1276 6895 2741 p 2 0 2190 1410 5681 2627 p 2 0 2604 996 7368 3047 p 2 0 2403 1197 6654 2792 p 2 0 2118 1482 6305 2583 p 2 0 2386 1214 9150 2967 p 2 0 1977 1623 5744 2350 p 2 5 2088 1507 7875 2638 p 2 0 2301 1299 7855 2828 p 2 0 2136 1464 7821 2735 p 2 0 2147 1453 8048 2751 p 2 0 2165 1435 8125 2758 p 2 0 1942 1658 5459 2373 p 2 0 2084 1516 6439 2521 p 2 0 2588 1012 7610 3060 p 2 0 2333 1267 6278 2770 p 2 0 2012 1588 5792 2432 p 2 0 2434 1166 6514 2823 p 2 0 2231 1369 6733 2661 p 2 0 2058 1542 5742 2487 p 2 0 2045 1555 5743 2445 i 2 3600 0 0 80641 13275 p 2 9 3533 58 24102 5191 p 2 0 3304 296 13134 4194 p 2 0 2671 929 6610 3124 p 2 0 3118 482 11793 3835 p 2 0 2829 771 7533 3244 p 2 0 3158 442 12778 3926 p 2 0 2970 630 9154 3567 p 2 0 2831 769 8554 3367 p 2 0 3022 578 8327 3460 p 2 0 2437 1163 6153 2902 p 2 142 3045 413 34002 5356 p 2 0 2876 724 10847 3597 p 2 0 2376 1224 6320 2800 p 2 243 2406 951 24851 4571 p 2 0 2143 1457 5645 2617 p 2 220 2688 692 25580 4831 p 2 0 2928 672 10600 3550 p 2 22 2931 647 21762 4278 p 2 0 2903 697 10470 3516 p 2 10 2819 771 20111 3902 p 2 0 2881 719 9144 3496 p 2 2 2715 883 19327 3790 p 2 0 2753 847 8504 3295 p 2 2 2537 1061 17321 3500 p 2 0 2643 957 8481 3207 p 2 2 2615 983 17745 3564 p 2 0 3005 595 18310 4007 p 2 0 2710 890 9440 3325 p 2 0 2451 1149 6432 2887 p 2 1 2557 1042 17481 3498 p 2 0 2786 814 9670 3393 p 2 7 2666 927 17444 3568 p 2 0 2749 851 8752 3250 p 2 2 2282 1316 16019 3162 p 2 0 2788 812 8955 3315 p 2 5 2661 934 18104 3657 p 2 0 2658 942 8278 3174 p 2 3 2667 930 18035 3668 p 2 0 1988 1612 5400 2425 p 2 2 2693 905 17506 3621 i 2 3600 0 0 140873 13462 p 2 0 3523 77 21300 4411 p 2 0 3488 112 18035 4443 p 2 0 3291 309 13928 4077 p 2 0 3242 358 12923 3910 p 2 0 3093 507 11869 3752 p 2 0 3157 443 12209 3818 p 2 0 3123 477 11870 3741 p 2 0 3034 566 11078 3663 p 2 0 3115 485 11900 3747 p 2 0 2972 628 10572 3569 p 2 0 3243 357 12890 4018 p 2 0 3216 384 12600 3869 p 2 0 3506 94 19953 4403 p 2 0 3371 229 15124 4214 p 2 0 3259 341 15015 3951 p 2 0 2981 619 11585 3530 p 2 0 2786 814 10224 3270 p 2 0 3063 537 11546 3604 p 2 0 3178 422 12972 3774 p 2 0 2984 616 11310 3544 p 2 0 2945 655 10311 3479 p 2 0 3239 361 12527 3958 p 2 0 2895 705 9824 3493 p 2 0 3469 131 18204 4325 p 2 0 2700 900 9591 3176 p 2 0 3140 460 12362 3724 p 2 0 3332 268 15167 4041 p 2 0 2327 1273 7458 2735 p 2 0 2578 1022 8774 3020 p 2 0 3143 457 12469 3774 p 2 0 2999 601 11375 3604 p 2 0 2887 713 10559 3396 p 2 0 2898 702 10453 3433 p 2 0 3186 414 12042 3905 p 2 0 2795 805 9142 3387 p 2 0 3438 162 18084 4302 p 2 0 2672 928 9178 3116 p 2 0 3183 417 13158 3782 p 2 0 3109 491 12091 3749 p 2 0 3228 372 12574 3914 p 2 0 3054 546 11904 3639 p 2 0 2896 704 10371 3408 p 2 0 2713 887 9372 3221 p 2 0 2849 751 9946 3356 p 2 0 2870 730 9928 3347 p 2 0 2667 933 8749 3155 p 2 0 3144 456 11598 3835 p 2 0 2878 722 9841 3480 p 2 0 3455 145 18341 4347 p 2 0 3357 243 15313 4100 p 2 0 3221 379 13293 3905 p 2 0 3187 413 12963 3833 p 2 0 3194 406 14282 3823 p 2 0 2962 638 10954 3496 p 2 0 3043 557 11479 3605 p 2 0 2966 634 10682 3499 p 2 0 2987 613 10612 3520 p 2 0 2871 729 10265 3424 p 2 0 3150 450 11821 3872 p 2 0 2897 703 9876 3509 p 2 0 3459 141 18450 4331 p 2 0 3183 417 12608 3871 p 2 0 3229 371 12939 3895 p 2 0 3152 448 12639 3796 p 2 0 3056 544 11677 3641 p 2 0 3227 373 13722 3890 p 2 0 3070 530 11639 3691 p 2 0 3059 541 11591 3677 p 2 0 3152 448 12075 3768 p 2 0 2953 647 10723 3539 p 2 0 3221 379 13639 3878 p 2 0 2749 851 9856 3249 p 2 0 3374 226 16133 4152 p 2 0 3215 385 12989 3916 p 2 0 2950 650 10951 3567 p 2 0 3069 531 11612 3675 p 2 0 2988 612 10978 3600 p 2 0 2917 683 10209 3482 p 2 0 3115 485 12258 3772 p 2 0 2858 742 10010 3441 p 2 0 2963 637 10563 3530 p 2 0 3105 495 11406 3780 p 2 0 2999 601 11193 3602 p 2 0 3428 172 17936 4203 p 2 0 2594 1006 9236 3053 p 2 0 3240 360 13463 3922 p 2 0 2935 665 10993 3494 p 2 0 2874 726 10247 3365 p 2 0 2790 810 9924 3308 p 2 0 2853 747 9832 3364 p 2 0 2937 663 10538 3454 p 2 0 3097 503 12390 3691 p 2 0 3058 542 11583 3630 p 2 0 3196 404 12449 3913 p 2 0 2843 757 9629 3408 p 2 0 3446 154 18351 4295 p 2 0 2681 919 9629 3142 p 2 0 2939 661 11020 3473 p 2 0 3127 473 12257 3641 p 2 0 2913 687 10337 3433 p 2 0 3031 569 11607 3535 p 2 0 2739 861 9630 3224 p 2 0 2787 813 10103 3304 p 2 0 3040 560 11554 3557 p 2 0 2835 765 10160 3357 p 2 0 2833 767 9667 3322 p 2 0 3125 475 11686 3800 p 2 0 2808 792 9218 3387 p 2 0 3488 112 19040 4390 p 2 0 3291 309 14728 3989 p 2 0 3077 523 12162 3742 p 2 0 3262 338 14344 3915 p 2 0 3001 599 11740 3528 p 2 0 2975 625 10807 3503 p 2 0 2807 793 9979 3323 p 2 0 2887 713 10218 3404 p 2 0 3158 442 12857 3757 p 2 0 2879 721 10329 3434 p 2 0 3143 457 11831 3836 p 2 0 2813 787 9376 3378 p 2 0 3448 152 18838 4330 p 2 0 3337 263 15129 4097 p 2 0 3162 438 12451 3829 p 2 0 3195 405 13543 3827 p 2 0 3071 529 12128 3623 p 2 0 3026 574 11832 3559 p 2 0 2898 702 10625 3385 p 2 0 2916 684 10697 3418 p 2 0 2808 792 9734 3296 p 2 0 2917 683 10982 3426 p 2 0 3125 475 11760 3821 p 2 0 2714 886 9387 3272 p 2 0 3432 168 18628 4292 p 2 0 3174 426 12977 3860 p 2 0 3228 372 13235 3881 p 2 0 3065 535 11717 3648 p 2 0 3118 482 12261 3729 p 2 0 3098 502 12051 3704 p 2 0 3054 546 11676 3640 p 2 0 2976 624 10837 3527 p 2 0 2933 667 10382 3476 p 2 1 3274 325 20090 4033 p 2 0 2897 703 10916 3434 p 2 0 3303 297 15239 4030 p 2 0 2317 1283 7621 2754 p 2 1 2913 686 15004 3537 p 2 0 3153 447 12530 3779 p 2 0 2073 1527 6754 2507 p 2 2 2879 719 14352 3504 p 2 0 2910 690 10658 3481 p 2 0 2930 670 10493 3517 p 2 0 2733 867 9606 3284 p 2 0 2960 640 10606 3533 p 2 0 2732 868 9369 3270 p 2 0 3101 499 11843 3769 p 2 0 3152 448 13452 3769 p 2 0 3469 131 19669 4344 p 2 0 3265 335 14299 3967 p 2 0 3219 381 13486 3906 p 2 0 3160 440 12642 3810 p 2 0 3121 479 12230 3759 p 2 0 3076 524 11921 3682 p 2 0 2998 602 11020 3594 p 2 0 2976 624 10936 3566 p 2 0 2984 616 10987 3524 p 2 0 1984 1616 6069 2405 p 2 0 3143 457 12247 3819 p 2 0 3475 125 21537 4397 p 2 0 2759 841 10440 3262 p 2 0 3103 497 12937 3757 p 2 0 2920 680 10681 3426 p 2 0 3132 468 13295 3696 p 2 0 2954 646 11365 3440 p 2 0 2816 784 9750 3318 p 2 0 2844 756 10206 3394 p 2 0 2958 642 11260 3501 p 2 0 2910 690 10332 3419 p 2 0 3181 419 13443 3822 p 2 0 2952 648 11280 3484 p 2 0 3481 119 24453 4358 p 2 0 2888 712 12146 3415 p 2 0 3283 317 16238 3986 i 2 3600 0 0 111015 12989 p 2 0 3579 21 27279 4996 p 2 0 3120 480 12365 3794 p 2 2 3419 179 27529 4797 p 2 0 3136 464 13017 3915 p 2 0 3085 515 12447 3741 p 2 1 2984 615 20773 3972 p 2 0 3301 299 14414 4174 p 2 2 2791 807 19486 3760 p 2 0 2630 970 8841 3139 p 2 0 3160 440 13100 3897 p 2 0 3074 526 11696 3779 p 2 0 3246 354 13091 4082 p 2 0 3196 404 12259 3889 p 2 0 3110 490 11741 3841 p 2 0 3071 529 10953 3738 p 2 0 3130 470 11324 3802 p 2 0 3018 582 10521 3700 p 2 1 2959 640 10581 3580 p 2 0 3123 477 12042 3826 p 2 1 3032 567 12021 3713 p 2 0 3270 330 13919 4057 p 2 0 3102 498 12120 3781 p 2 0 2142 1458 6531 2570 p 2 1 2884 715 10967 3449 p 2 0 2858 742 9472 3431 p 2 0 2533 1067 7891 3064 p 2 0 2918 682 9973 3497 p 2 0 2823 777 9277 3390 p 2 0 2851 749 9595 3422 p 2 0 2751 849 8654 3274 p 2 0 3030 570 10082 3746 p 2 1 2766 833 9078 3343 p 2 0 3312 288 15744 4130 p 2 0 3133 467 12617 3826 p 2 0 2935 665 10656 3460 p 2 0 2991 609 11631 3558 p 2 0 2782 818 9384 3326 p 2 0 2767 833 9321 3287 p 2 0 2608 992 8336 3129 i 2 3600 0 0 47273 11885 p 2 92 3373 135 17784 5129 p 2 0 2408 1192 5553 2919 p 2 1003 1876 721 45893 7876 p 2 0 2460 1140 7964 3346 p 2 997 1816 787 41369 7612 p 2 0 2443 1157 9507 3615 p 2 0 2333 1267 6890 2950 p 2 5 2547 1048 21657 4075 p 2 0 2342 1258 7021 2932 p 2 0 1840 1760 5167 2334 p 2 0 2386 1214 15152 3272 p 2 0 2038 1562 6003 2526 p 2 0 1954 1646 5719 2414 p 2 1 2191 1408 15462 3174 p 2 0 2061 1539 6410 2565 p 2 0 2334 1266 15232 3227 p 2 0 2313 1287 6534 2851 p 2 0 1933 1667 4715 2379 p 2 0 2276 1324 13762 3099 p 2 0 1924 1676 5488 2413 p 2 0 1795 1805 4543 2216 p 2 0 1567 2033 4015 2013 p 2 0 1670 1930 4033 2095 p 2 0 1681 1919 3714 2094 p 2 0 1604 1996 3881 1988 p 2 0 1474 2126 3687 1874 p 2 0 1788 1812 4256 2186 p 2 0 1736 1864 4475 2178 p 2 0 1988 1612 5116 2433 p 2 0 1729 1871 4629 2127 i 2 3600 0 0 138451 13450 p 2 0 3593 7 39469 4899 p 2 0 3268 332 14495 3905 p 2 0 3205 395 13816 3829 p 2 0 3482 118 18990 4294 p 2 0 3361 239 15479 4101 p 2 0 3138 462 12746 3767 p 2 0 3151 449 12753 3727 p 2 0 2231 1369 7184 2649 p 2 0 3270 330 12940 4073 p 2 0 3486 114 20221 4357 p 2 0 2821 779 10271 3337 p 2 0 3247 353 13863 3949 p 2 0 3139 461 12183 3806 p 2 0 3233 367 13508 3949 p 2 0 3196 404 12466 3859 p 2 0 3175 425 13676 3874 p 2 0 3001 599 11518 3617 p 2 0 3006 594 11164 3566 p 2 0 3116 484 11944 3704 p 2 0 2951 649 10406 3532 p 2 0 3173 427 12995 3836 p 2 0 3152 448 13240 3777 p 2 0 3376 224 16032 4156 p 2 0 3292 308 14319 4034 p 2 0 3007 593 11112 3555 p 2 0 2868 732 10232 3393 p 2 0 2771 829 9516 3284 p 2 0 3029 571 11045 3607 p 2 0 3123 477 12586 3747 p 2 0 3016 584 11364 3589 p 2 0 2815 785 9821 3336 p 2 0 2730 870 9144 3252 p 2 0 3208 392 12513 3977 p 2 0 2816 784 9331 3427 p 2 0 3481 119 19729 4387 p 2 0 3244 356 14082 3933 p 2 0 3178 422 12745 3706 p 2 0 3038 562 11269 3585 p 2 0 2979 621 11361 3497 p 2 0 2813 787 9831 3310 p 2 0 2872 728 10439 3389 p 2 0 3180 420 13298 3779 p 2 0 2990 610 11361 3548 p 2 0 2897 703 10395 3441 p 2 0 3168 432 11856 3863 p 2 0 3491 109 19798 4398 p 2 0 2741 859 10061 3238 p 2 0 3177 423 13352 3793 p 2 0 3122 478 12510 3801 p 2 0 3256 344 13597 3973 p 2 0 2898 702 10819 3425 p 2 0 2983 617 11227 3507 p 2 0 2835 765 10076 3366 p 2 0 2859 741 9950 3354 p 2 0 2969 631 11055 3535 p 2 0 2702 898 9296 3219 p 2 0 3065 535 11226 3742 p 2 0 2949 651 10472 3576 p 2 0 3466 134 18802 4365 p 2 0 3153 447 12819 3774 p 2 0 3169 431 12710 3820 p 2 0 3220 380 13606 3874 p 2 0 3058 542 12039 3601 p 2 0 2882 718 10579 3396 p 2 0 2796 804 9888 3314 p 2 0 2843 757 9877 3360 p 2 0 2913 687 10288 3445 p 2 0 2970 630 10945 3504 p 2 0 3168 432 12294 3895 p 2 0 2689 911 9293 3254 p 2 0 3436 164 18774 4264 p 2 0 3256 344 13828 3954 p 2 0 3194 406 12805 3817 p 2 0 3138 462 12191 3760 p 2 0 3106 494 11985 3698 p 2 0 3060 540 11652 3654 p 2 0 3060 540 11883 3684 p 2 0 2997 603 11085 3559 p 2 0 3022 578 11274 3606 p 2 0 3259 341 15199 3969 p 2 0 2860 740 11217 3404 p 2 0 3254 346 14631 3959 p 2 0 3102 498 11663 3725 p 2 0 2708 892 9387 3212 p 2 0 2983 617 10960 3597 p 2 0 2997 603 11296 3595 p 2 0 2879 721 10106 3465 p 2 0 2955 645 10751 3540 p 2 0 2865 735 10108 3421 p 2 0 2887 713 10166 3465 p 2 0 2926 674 10356 3479 p 2 0 2724 876 8956 3245 p 2 0 3104 496 11553 3761 p 2 0 3136 464 12654 3760 p 2 0 3469 131 19327 4323 p 2 0 3363 237 14825 4187 p 2 0 3131 469 12441 3738 p 2 0 2896 704 10483 3422 p 2 0 2462 1138 8080 2911 p 2 0 2933 667 10668 3438 p 2 0 2920 680 10513 3429 p 2 0 2861 739 10024 3378 p 2 0 2864 736 9988 3356 p 2 0 3161 439 12319 3847 p 2 0 2940 660 10365 3518 p 2 0 3471 129 20372 4322 p 2 0 2754 846 10310 3247 p 2 0 3180 420 13139 3849 p 2 0 2923 677 11212 3451 p 2 0 2996 604 11281 3549 p 2 0 2988 612 11256 3487 p 2 0 2747 853 9548 3225 p 2 0 2923 677 10531 3434 p 2 0 2884 716 10038 3374 p 2 0 2869 731 9838 3373 p 2 0 2698 902 9243 3200 p 2 0 3143 457 11920 3832 p 2 0 3489 111 19436 4364 p 2 0 3310 290 15905 4003 p 2 0 2974 626 11805 3525 p 2 0 3175 425 12782 3841 p 2 0 3244 356 13805 3878 p 2 0 3090 510 11825 3701 p 2 0 3220 380 13264 3878 p 2 0 3088 512 12048 3707 p 2 0 3047 553 11188 3630 p 2 0 3037 563 11026 3620 p 2 0 2866 734 9846 3412 p 2 0 3184 416 12341 3880 p 2 0 2903 697 9839 3467 p 2 0 3439 161 18096 4312 p 2 0 3319 281 15336 4074 p 2 0 3179 421 12830 3843 p 2 0 3158 442 12499 3813 p 2 0 3159 441 12952 3749 p 2 0 3053 547 11977 3581 p 2 0 2952 648 10852 3439 p 2 0 2852 748 10629 3336 p 2 0 2835 765 10013 3330 p 2 0 3128 472 11665 3791 p 2 0 3031 569 11230 3641 p 2 0 3325 275 14936 4053 p 2 0 2484 1116 8262 2931 p 2 0 3144 456 12124 3782 p 2 0 3138 462 12604 3802 p 2 0 3006 594 11236 3590 p 2 0 2961 639 10639 3508 p 2 0 2888 712 10047 3398 p 2 0 2845 755 9874 3390 p 2 0 2916 684 10777 3500 p 2 0 2889 711 10097 3443 p 2 0 2967 633 10670 3544 p 2 0 3129 471 12639 3772 p 2 0 2950 650 10267 3548 p 2 0 3328 272 15648 4081 p 2 0 3046 554 11434 3681 p 2 0 3096 504 11690 3692 p 2 0 3231 369 13925 3914 p 2 0 2807 793 10029 3361 p 2 0 2989 611 11004 3561 p 2 0 2961 639 11048 3566 p 2 0 2877 723 10444 3469 p 2 0 3050 550 10938 3650 p 2 0 2839 761 9777 3395 p 2 0 3078 522 11880 3677 p 2 0 2769 831 9690 3271 p 2 0 3441 159 18693 4260 p 2 0 3317 283 14899 4058 p 2 0 3238 362 13660 3869 p 2 0 2423 1177 8051 2847 p 2 0 3018 582 11764 3599 p 2 0 3042 558 11743 3612 p 2 0 2836 764 10248 3371 p 2 0 2909 691 10490 3427 p 2 0 2933 667 10543 3455 p 2 0 3178 422 13424 3781 p 2 0 3100 500 11965 3743 p 2 0 3486 114 24624 4391 p 2 0 3506 94 31652 5081 i 2 3600 0 0 61615 12849 p 2 0 3261 339 11866 4163 p 2 302 2929 369 27772 5673 p 2 3 2491 1106 9972 3555 p 2 285 2462 853 30271 5097 p 2 0 2515 1085 9286 3327 p 2 0 2044 1556 6069 2641 p 2 0 1916 1684 5796 2370 p 2 5 2449 1146 19771 3665 p 2 0 2526 1074 8869 3248 p 2 0 2213 1387 7799 2828 p 2 32 2623 945 20273 3891 p 2 0 2020 1580 6602 2534 p 2 0 1904 1696 6230 2403 p 2 0 2142 1458 6453 2652 p 2 0 1945 1655 5355 2385 p 2 0 1727 1873 4870 2231 p 2 0 1779 1821 4903 2240 p 2 0 1751 1849 4812 2210 p 2 0 1846 1754 5000 2282 p 2 0 2021 1579 5813 2528 p 2 0 1892 1708 5108 2318 p 2 0 1502 2098 4058 1946 p 2 0 2053 1547 5912 2541 p 2 0 1969 1631 5443 2465 p 2 0 1865 1735 5448 2354 p 2 0 1543 2057 3928 1963 p 2 0 2417 1183 7542 2998 i 2 3600 0 0 86916 13398 p 2 0 3561 39 17139 4669 p 2 0 3339 261 11646 4189 p 2 0 2971 629 8654 3577 p 2 0 3213 387 10299 4002 p 2 0 3150 450 10070 3846 p 2 0 2546 1054 7242 3056 p 2 0 3170 430 10779 3833 p 2 0 2822 778 8494 3402 p 2 0 3086 514 9225 3659 p 2 0 2232 1368 5954 2687 p 2 146 2654 800 31102 4847 p 2 0 2895 705 11826 3639 p 2 235 2754 611 26293 4908 p 2 0 2889 711 10830 3619 p 2 224 2708 668 26011 4888 p 2 0 2159 1441 5932 2628 p 2 25 3045 530 22340 4374 p 2 0 2836 764 10198 3470 p 2 10 2972 618 20631 4056 p 2 0 2762 838 9989 3388 p 2 2 2873 725 20040 3852 p 2 0 2744 856 9536 3336 p 2 1 2792 807 17899 3665 p 2 0 2485 1115 7627 3042 p 2 1 2750 849 17682 3672 p 2 0 2715 885 8526 3286 p 2 2 2862 736 17245 3809 p 2 0 2500 1100 7840 3074 p 2 4 2901 695 18705 3926 p 2 0 2545 1055 8239 3126 p 2 6 2886 708 17928 3843 p 2 0 2579 1021 8590 3080 p 2 2 2661 937 17084 3526 p 2 0 2615 985 9110 3207 p 2 5 2685 910 18183 3582 p 2 0 2567 1033 8253 3069 p 2 3 2863 734 18098 3852 p 2 0 2530 1070 8186 3075 p 2 2 2916 682 18046 3844 p 2 0 1952 1648 5434 2402 p 2 48 2751 801 21802 4075 p 2 0 2562 1038 8631 3166 p 2 0 2873 727 14816 3658 p 2 0 2440 1160 7887 2959 p 2 0 2673 927 12680 3347 p 2 0 2617 983 8165 3103 p 2 0 2644 956 12877 3284 p 2 0 2368 1232 7300 2855 p 2 92 2537 971 20877 3974 p 2 0 2482 1118 7794 3046 p 2 97 2529 974 21503 3992 p 2 0 2416 1184 8112 3021 p 2 223 2801 576 24428 4859 p 2 0 2649 951 9156 3314 p 2 140 2774 686 22903 4453 p 2 0 2500 1100 8096 3059 p 2 95 2611 894 18472 3889 i 2 3600 0 0 106751 13014 p 2 1 3415 184 21699 4555 p 2 737 2830 33 74848 8177 p 2 0 3380 220 16550 4469 p 2 0 3099 501 13547 3866 p 2 498 2834 268 63966 7043 p 2 0 2584 1016 9411 3281 p 2 0 3342 258 17205 4293 p 2 526 2828 246 66433 7288 p 2 0 3494 106 18925 4724 p 2 0 3072 528 12467 3850 p 2 3 2960 637 11691 3680 p 2 0 3290 310 14682 4102 p 2 0 2917 683 10856 3560 p 2 8 3222 370 14839 4033 p 2 0 3095 505 12388 3833 p 2 0 2995 605 11110 3633 p 2 3 3058 539 12062 3785 p 2 0 3181 419 13239 3898 p 2 8 3043 549 13356 3752 p 2 0 3117 483 13055 3835 p 2 0 2959 641 11302 3577 p 2 0 2776 824 10123 3299 p 2 1 2768 831 10282 3325 p 2 0 2751 849 9387 3295 p 2 0 2386 1214 7554 2869 p 2 2 2919 679 10609 3512 p 2 0 2784 816 9893 3350 p 2 0 1855 1745 5415 2257 p 2 2 2570 1028 8892 3069 p 2 0 2905 695 10455 3450 p 2 3 2809 788 11332 3405 p 2 0 3374 226 22694 4458 p 2 0 3197 403 15474 4055 p 2 0 2860 740 10733 3407 p 2 0 2699 901 10172 3238 p 2 0 2230 1370 7173 2668 p 2 0 2398 1202 7821 3063 i 2 3600 0 0 144574 13627 p 2 0 3292 308 14932 4031 p 2 0 2916 684 11770 3560 p 2 0 3432 168 17023 4314 p 2 0 3492 108 21290 4587 p 2 0 3041 559 12795 3687 p 2 0 3120 480 13223 3721 p 2 0 3201 399 15319 3855 p 2 0 3134 466 13117 3757 p 2 0 2782 818 10172 3322 p 2 0 3450 150 17769 4361 p 2 0 3384 216 15041 4155 p 2 0 3299 301 13886 3991 p 2 0 3238 362 13363 3907 p 2 0 3152 448 12274 3800 p 2 0 3243 357 13292 3930 p 2 0 3084 516 11810 3727 p 2 0 3324 276 15703 4069 p 2 0 2948 652 11268 3513 p 2 0 3401 199 16451 4207 p 2 0 3235 365 14101 3974 p 2 0 3055 545 11393 3688 p 2 0 3094 506 11786 3732 p 2 0 3010 590 11164 3629 p 2 0 3031 569 10832 3632 p 2 0 2992 608 10806 3580 p 2 0 3025 575 11156 3595 p 2 0 3009 591 10885 3602 p 2 0 2734 866 9069 3278 p 2 0 3214 386 12479 3983 p 2 0 3027 573 10998 3645 p 2 0 3459 141 19230 4324 p 2 0 3349 251 14800 4186 p 2 0 3298 302 14654 4007 p 2 0 3036 564 11558 3617 p 2 0 3018 582 11475 3583 p 2 0 3008 592 11012 3573 p 2 0 2939 661 10413 3475 p 2 0 2919 681 10834 3479 p 2 0 2970 630 10793 3513 p 2 0 2948 652 10647 3505 p 2 0 3193 407 12265 3934 p 2 0 2858 742 9936 3455 p 2 0 3456 144 19216 4369 p 2 0 3238 362 13912 3913 p 2 0 3177 423 12966 3735 p 2 0 3195 405 13762 3797 p 2 0 2789 811 10270 3286 p 2 0 3089 511 11626 3624 p 2 0 2880 720 10224 3396 p 2 0 2850 750 10026 3358 p 2 0 2825 775 9950 3344 p 2 0 2597 1003 8403 3082 p 2 0 3138 462 11915 3818 p 2 0 2866 734 9407 3453 p 2 0 3472 128 18987 4407 p 2 0 3295 305 14593 4013 p 2 0 3167 433 12511 3837 p 2 0 3237 363 13620 3897 p 2 0 3185 415 12924 3869 p 2 0 3148 452 13035 3811 p 2 0 3053 547 11585 3691 p 2 0 3054 546 11698 3659 p 2 0 2985 615 10771 3528 p 2 0 2748 852 9282 3259 p 2 0 3131 469 11805 3829 p 2 0 3017 583 11034 3676 p 2 0 3446 154 18168 4317 p 2 0 3347 253 15719 4070 p 2 0 3250 350 13323 3928 p 2 0 3158 442 12024 3818 p 2 0 3219 381 14179 3835 p 2 0 2888 712 10693 3396 p 2 0 2858 742 10076 3385 p 2 0 2947 653 10961 3484 p 2 0 3092 508 11781 3663 p 2 0 2910 690 10449 3449 p 2 0 3167 433 12025 3878 p 2 0 2862 738 9385 3435 p 2 0 3464 136 18326 4319 p 2 0 3184 416 12978 3892 p 2 0 3188 412 12818 3818 p 2 0 3142 458 12667 3778 p 2 0 3041 559 11730 3664 p 2 0 3154 446 13238 3788 p 2 0 2959 641 11166 3555 p 2 0 2978 622 11204 3584 p 2 0 3139 461 12424 3799 p 2 0 2970 630 10914 3564 p 2 0 3212 388 13583 3863 p 2 0 2838 762 10301 3353 p 2 0 3382 218 16255 4155 p 2 0 3202 398 13091 3906 p 2 0 3017 583 10931 3635 p 2 0 3040 560 11268 3657 p 2 0 2916 684 10242 3489 p 2 0 2944 656 10896 3543 p 2 0 3229 371 13072 3929 p 2 0 2971 629 11277 3612 p 2 0 2958 642 10814 3561 p 2 0 3051 549 11624 3625 p 2 0 2922 678 10405 3466 p 2 0 3482 118 29223 4903 i 2 3600 0 0 113715 13051 p 2 0 3500 100 17504 4441 p 2 0 3379 221 15982 4242 p 2 0 3187 413 13227 3951 p 2 0 2796 804 9981 3379 p 2 0 3151 449 13099 3943 p 2 0 2658 942 9338 3216 p 2 0 3195 405 13610 3894 p 2 0 2961 639 11277 3574 p 2 0 3175 425 13117 4017 p 2 0 2819 781 10386 3481 p 2 0 3317 283 16740 4218 p 2 0 3175 425 14222 3905 p 2 0 2912 688 11253 3532 p 2 0 2996 604 12239 3708 p 2 0 2981 619 11493 3656 p 2 0 2743 857 9629 3330 p 2 0 2983 617 11221 3636 p 2 0 2657 943 8770 3209 p 2 0 2865 735 10337 3446 p 2 0 2882 718 10587 3513 p 2 0 2696 904 8975 3263 p 2 0 2965 635 11820 3596 p 2 147 2879 574 32240 5315 p 2 126 3054 420 34514 5763 p 2 152 2948 500 33602 5697 p 2 160 2867 573 33538 5782 p 2 189 2737 674 33022 5717 p 2 203 2618 779 33421 5855 p 2 228 2628 744 32048 5835 p 2 255 2484 861 30802 5810 p 2 235 2655 710 35035 6175 p 2 219 2531 850 33173 6262 p 2 234 2649 717 34556 6429 p 2 193 2892 515 34375 6672 p 2 200 2569 831 34480 6331 p 2 22 3200 378 33725 6086 p 2 87 2963 550 33344 5948 p 2 57 3114 429 31042 5877 p 2 33 2998 569 28836 5522 p 2 41 2850 709 26290 5226 p 2 16 3085 499 28660 5555 p 2 29 2843 728 26234 5149 p 2 66 2892 642 29013 5518 p 2 79 3247 274 61167 6811 p 2 3 3329 268 30915 5810 p 2 32 3178 390 27176 5598 p 2 133 3339 128 62124 7168 p 2 63 3270 267 28871 5982 p 2 97 3055 448 28796 5799 p 2 95 3363 142 60575 7071 p 2 32 3280 288 28890 5944 p 2 55 3121 424 27462 5535 p 2 104 3298 198 62842 7133 p 2 6 3208 386 28948 5578 p 2 12 3152 436 28055 5511 p 2 10 3114 476 25004 5128 p 2 16 3106 478 27781 5336 p 2 72 3229 299 29377 5782 p 2 63 3145 392 30082 5728 p 2 75 3200 325 29329 5715 p 2 76 3042 482 29267 5602 p 2 71 3039 490 30700 5702 p 2 39 3083 478 32269 5837 p 2 16 2874 710 25901 5115 p 2 13 2976 611 30329 5489 p 2 81 2836 683 26749 5337 p 2 52 2916 632 28325 5412 p 2 42 2660 898 24051 4859 p 2 78 2700 822 28012 5259 p 2 75 2917 608 26971 5393 p 2 44 2909 647 28185 5426 p 2 23 3253 324 26187 5375 p 2 24 3135 441 27614 5462 p 2 54 2798 748 24620 4920 p 2 20 2649 931 23321 4718 i 2 3600 0 0 104377 13056 p 2 0 3519 81 18824 4607 p 2 0 3189 411 13093 3938 p 2 0 3361 239 16616 4289 p 2 0 3253 347 14525 4072 p 2 0 3181 419 12868 3913 p 2 0 3105 495 11491 3879 p 2 0 2788 812 9256 3423 p 2 0 3382 218 18844 4455 p 2 0 3160 440 13027 3847 p 2 0 3266 334 14007 4085 p 2 0 3039 561 11171 3729 p 2 0 3104 496 11749 3825 p 2 0 2997 603 10572 3646 p 2 0 2816 784 9561 3413 p 2 0 3044 556 11214 3682 p 2 0 2973 627 10780 3596 p 2 0 2948 652 10613 3590 p 2 0 3140 460 12921 3861 p 2 0 2904 696 10387 3501 p 2 0 3250 350 15261 3987 p 2 0 3040 560 11298 3739 p 2 0 2741 859 9241 3323 p 2 0 2641 959 8502 3181 p 2 0 2689 911 8911 3251 p 2 0 2742 858 9109 3297 p 2 0 2612 988 8560 3150 p 2 0 2586 1014 7923 3121 p 2 0 2654 946 8456 3185 p 2 4 2559 1037 9141 3157 p 2 8 2925 667 11752 3626 p 2 0 2678 922 9700 3234 p 2 0 3141 459 12906 3826 p 2 0 3049 551 11423 3681 p 2 0 2771 829 9728 3330 p 2 0 2777 823 9553 3321 p 2 0 2646 954 8545 3177 p 2 0 2886 714 9646 3447 p 2 0 2747 853 9419 3316 p 2 0 2661 939 8626 3207 p 2 0 2544 1056 8003 3074 p 2 0 2309 1291 6978 2781 p 2 0 2858 742 9221 3497 p 2 0 2798 802 9193 3366 p 2 0 3026 574 11997 3672 p 2 0 2843 757 9938 3365 p 2 0 3051 549 11920 3641 p 2 0 2944 656 10557 3603 p 2 0 2685 915 8613 3201 p 2 0 2795 805 9354 3370 p 2 0 2614 986 8353 3168 p 2 0 1958 1642 5438 2369 p 2 0 2734 866 8893 3254 p 2 0 2753 847 9252 3278 p 2 0 2932 668 9782 3624 p 2 0 2597 1003 8027 3185 p 2 0 3136 464 13588 3855 p 2 0 2918 682 10180 3476 p 2 0 2826 774 9468 3367 p 2 0 3000 600 11644 3644 p 2 0 2687 913 9285 3236 p 2 0 2795 805 9564 3310 p 2 0 2701 899 9333 3218 p 2 0 2801 799 9530 3334 p 2 0 1808 1792 5042 2229 p 2 0 2405 1195 7461 2888 p 2 0 2858 742 9884 3461 p 2 0 2825 775 8490 3422 p 2 0 3206 394 13067 3965 p 2 0 2877 723 10168 3507 p 2 0 2975 625 10915 3604 p 2 0 2744 856 9071 3297 p 2 0 2532 1068 8363 3032 p 2 0 2440 1160 7797 2908 p 2 0 2623 977 8427 3107 p 2 0 2478 1122 7453 2914 p 2 0 2456 1144 7599 2925 p 2 0 2442 1158 7664 2931 p 2 0 2674 926 8269 3198 p 2 0 2607 993 8217 3091 p 2 0 2874 726 10503 3456 p 2 0 2872 728 10023 3469 p 2 0 2978 622 10371 3615 p 2 0 2808 792 9396 3377 p 2 0 2877 723 10581 3415 p 2 0 2781 819 9427 3328 p 2 0 2600 1000 8481 3117 p 2 0 2721 879 8619 3237 p 2 0 1795 1805 5086 2224 p 2 0 2625 975 8570 3116 p 2 0 2819 781 9356 3402 p 2 0 2491 1109 7888 2990 p 2 0 3138 462 12264 3819 p 2 0 2843 757 9511 3468 p 2 0 2746 854 8871 3280 p 2 0 2770 830 9737 3328 p 2 0 2504 1096 8047 2979 p 2 0 2824 776 9529 3396 p 2 0 2528 1072 8571 3071 p 2 0 1746 1854 5073 2154 p 2 0 2583 1017 8215 3100 p 2 0 2520 1080 8013 3040 p 2 0 2823 777 9690 3404 p 2 0 2525 1075 7910 3046 p 2 0 3053 547 11936 3660 p 2 0 2578 1022 8409 3058 p 2 0 2951 649 10813 3564 p 2 0 2592 1008 8260 3123 p 2 0 2670 930 8657 3211 p 2 0 2562 1038 7991 3078 p 2 0 2804 796 9762 3364 p 2 0 2702 898 8488 3255 p 2 0 2562 1038 8262 3097 p 2 0 2184 1416 6276 2622 p 2 0 2666 934 8830 3187 p 2 0 2524 1076 7975 3013 p 2 0 3010 590 12241 3621 p 2 0 2940 660 10934 3483 p 2 0 2797 803 9897 3330 p 2 0 2744 856 9124 3247 p 2 0 2780 820 9444 3307 p 2 0 2722 878 8899 3269 p 2 0 2617 983 8519 3157 p 2 0 2673 927 9170 3239 p 2 0 2616 984 8652 3161 p 2 0 2334 1266 7181 2796 p 2 0 2873 727 9639 3505 p 2 0 2611 989 8415 3152 p 2 0 3051 549 12361 3698 p 2 0 2829 771 9708 3354 p 2 0 2765 835 9306 3295 p 2 0 2778 822 9628 3335 p 2 0 2571 1029 8186 3044 p 2 0 2772 828 9079 3280 p 2 0 2530 1070 8261 3015 p 2 0 2717 883 9234 3165 p 2 0 2630 970 8844 3122 p 2 0 2242 1358 7166 2730 p 2 0 2806 794 9429 3373 p 2 0 2765 835 8751 3357 p 2 0 3102 498 12382 3781 p 2 0 2908 692 10274 3548 p 2 0 3011 589 11381 3665 p 2 0 2534 1066 7967 3006 p 2 0 2559 1041 8426 3049 p 2 0 2675 925 8950 3167 p 2 0 2569 1031 8540 3065 p 2 0 2792 808 9064 3304 p 2 0 1923 1677 5416 2327 p 2 0 2595 1005 8660 3118 p 2 0 2641 959 8705 3200 p 2 0 2411 1189 7440 2874 p 2 0 3122 478 12364 3848 p 2 0 2841 759 9916 3408 p 2 0 2894 706 9894 3509 p 2 0 2900 700 10121 3484 p 2 0 2391 1209 7870 2884 p 2 23 2725 852 11732 3412 p 2 50 2743 807 14901 3644 p 2 73 2599 928 15894 3629 p 2 44 2395 1161 14769 3263 p 2 0 2752 848 10373 3360 p 2 0 2897 703 10589 3504 p 2 1 2606 993 9147 3108 p 2 0 3036 564 11760 3670 p 2 0 2905 695 11094 3566 p 2 0 2890 710 10447 3483 p 2 1 2871 728 10535 3491 p 2 0 2623 977 8604 3146 p 2 0 2754 846 9623 3314 p 2 1 2759 840 9924 3328 p 2 0 2585 1015 8171 3116 p 2 0 1893 1707 5652 2324 p 2 1 2696 903 22600 3697 p 2 0 2924 676 12072 3567 p 2 2 2615 983 9748 3193 p 2 4 2981 615 22376 4066 p 2 0 2860 740 12023 3495 p 2 0 2691 909 9221 3221 p 2 3 2941 656 22533 3969 p 2 0 2719 881 10227 3339 p 2 0 2900 700 11189 3507 p 2 0 2789 811 21535 3847 p 2 1 2753 846 10934 3393 p 2 0 2679 921 9069 3255 p 2 0 2542 1058 8958 3085 p 2 0 3070 530 11211 3824 p 2 2 3057 541 12078 3750 p 2 0 3277 323 15999 4124 p 2 0 3078 522 12980 3789 p 2 0 2930 670 10537 3496 p 2 1 2880 719 10410 3450 p 2 0 2619 981 8681 3102 p 2 0 2889 711 11365 3479 p 2 0 2788 812 9472 3348 p 2 1 2730 869 9911 3296 p 2 0 2581 1019 8253 3086 p 2 0 2533 1067 8573 3069 p 2 0 2850 750 9184 3467 p 2 1 2771 828 9211 3360 p 2 0 3146 454 13204 3878 p 2 8 2867 725 15665 3582 p 2 64 3086 450 23745 4307 p 2 98 2983 519 28375 4510 p 2 119 2297 1184 25692 3766 p 2 92 2745 763 28927 4172 p 2 8 2716 876 13172 3379 p 2 0 2805 795 10200 3332 p 2 0 2505 1095 8083 3003 p 2 7 2711 882 12556 3344 p 2 0 2995 605 11152 3742 p 2 0 2956 644 11460 3611 p 2 8 3162 430 17905 3988 p 2 0 3121 479 12845 3847 p 2 0 3050 550 11790 3767 p 2 9 3057 534 15170 3815 p 2 0 2763 837 9731 3305 p 2 0 2951 649 11189 3532 p 2 8 2726 866 12714 3364 p 2 0 2839 761 10359 3393 p 2 0 2017 1583 6085 2445 p 2 9 2548 1043 11695 3119 p 2 0 3012 588 10821 3734 p 2 0 2848 752 9932 3505 p 2 8 3113 479 14847 3919 p 2 0 2974 626 11120 3663 p 2 0 2843 757 10146 3475 p 2 9 2801 790 12895 3524 p 2 0 2642 958 8491 3183 p 2 0 2867 733 9691 3463 p 2 8 2753 839 12318 3425 p 2 0 2704 896 9166 3294 p 2 0 2376 1224 7315 2875 p 2 6 2557 1037 11200 3174 p 2 13 2831 756 12815 3510 p 2 43 2675 882 16888 3510 p 2 71 2881 648 22864 3997 p 2 89 2853 658 25755 4101 p 2 30 3024 546 26564 4078 p 2 2 2901 697 11881 3577 p 2 0 2626 974 9431 3214 p 2 0 2798 802 9945 3378 p 2 1 2673 926 9348 3214 p 2 0 2765 835 9137 3267 p 2 0 2442 1158 7587 2919 p 2 0 2551 1049 8605 3048 p 2 0 2996 604 10421 3691 p 2 0 2993 607 11454 3651 p 2 2 3122 476 14756 3848 p 2 0 2887 713 11086 3482 p 2 0 2815 785 10309 3371 p 2 1 3064 535 13660 3743 p 2 0 2805 795 10210 3349 p 2 0 2844 756 10905 3411 p 2 2 2733 865 9990 3279 p 2 0 2645 955 9195 3137 p 2 0 2639 961 8659 3135 p 2 1 2529 1070 9121 3054 p 2 0 2980 620 11329 3711 p 2 0 2850 750 9997 3464 p 2 0 3142 458 13206 3879 p 2 0 2916 684 10302 3538 p 2 0 3008 592 11618 3672 p 2 0 2918 682 11415 3522 p 2 0 2660 940 9056 3163 p 2 2 2568 1030 8838 3086 p 2 0 2523 1077 8256 3063 p 2 0 2549 1051 8480 3098 p 2 0 1683 1917 4896 2113 p 2 1 2312 1287 7715 2809 p 2 0 2727 873 9251 3286 p 2 0 2841 759 10037 3390 p 2 2 3128 470 12741 3835 p 2 0 2970 630 10863 3618 p 2 1 2917 682 11029 3535 p 2 0 2632 968 9155 3138 p 2 0 2866 734 10365 3482 p 2 0 2849 751 10693 3481 p 2 0 2658 942 9440 3218 p 2 0 1761 1839 5134 2163 p 2 0 2631 969 8803 3155 p 2 2 2664 934 9437 3184 p 2 0 2830 770 10321 3425 p 2 0 2808 792 10227 3382 p 2 1 3051 548 12254 3746 p 2 0 2781 819 9477 3367 p 2 0 2956 644 10730 3589 p 2 0 2807 793 9955 3425 p 2 0 2645 955 8761 3208 p 2 0 2977 623 10988 3638 p 2 2 2743 855 9637 3367 p 2 0 2678 922 8922 3243 p 2 0 2818 782 9761 3416 p 2 0 2938 662 11218 3563 p 2 0 2639 961 8878 3170 p 2 0 2465 1135 7871 2947 p 2 11 3192 397 27175 4496 p 2 0 2796 804 10378 3437 p 2 0 1989 1611 6162 2440 p 2 5 3016 579 27170 4296 p 2 0 2756 844 10426 3394 p 2 0 2889 711 10670 3502 p 2 42 2920 638 32462 4547 p 2 0 2849 751 12375 3572 p 2 0 2720 880 9989 3329 p 2 2 2397 1201 8424 2925 p 2 0 2836 764 10359 3437 p 2 0 2725 875 9753 3289 p 2 1 3119 480 13753 3829 p 2 0 3152 448 12665 3858 p 2 2 2929 669 11608 3566 p 2 0 2779 821 9651 3307 p 2 0 2881 719 9929 3507 p 2 0 2871 729 9899 3459 p 2 0 2788 812 9750 3405 p 2 0 2947 653 11094 3612 p 2 0 2807 793 9711 3395 p 2 0 2467 1133 8165 2988 p 2 0 2862 738 10336 3481 p 2 0 3344 256 17737 4208 p 2 0 3123 477 13170 3805 p 2 0 2752 848 9925 3305 p 2 0 2795 805 9997 3332 p 2 1 2684 915 9106 3226 p 2 0 2766 834 9750 3306 p 2 0 2905 695 10775 3443 p 2 0 2724 876 9774 3254 p 2 0 2650 950 9175 3126 p 2 0 2642 958 9145 3123 p 2 2 2605 993 9151 3137 p 2 0 2947 653 10969 3670 p 2 0 2755 845 9348 3397 p 2 0 3210 390 14703 3969 p 2 0 2832 768 10409 3398 p 2 0 2776 824 10021 3310 p 2 1 2854 745 10672 3391 p 2 0 2639 961 8692 3152 p 2 0 2938 662 10958 3498 p 2 0 2721 879 9693 3232 p 2 0 2642 958 8900 3134 p 2 0 2453 1147 7827 2925 p 2 0 2755 845 9582 3317 p 2 0 2977 623 10652 3685 p 2 0 2720 880 8978 3295 p 2 2 3218 380 14761 4023 p 2 0 2987 613 11758 3674 p 2 1 2928 671 11147 3580 p 2 0 2753 847 9423 3260 p 2 0 2570 1030 8541 3070 p 2 0 2562 1038 8047 3067 p 2 2 2524 1074 8810 3077 p 2 0 2537 1063 8204 3077 p 2 0 2592 1008 8432 3109 p 2 0 2697 903 9797 3258 p 2 0 2825 775 10427 3442 p 2 0 2585 1015 8851 3089 p 2 1 3100 499 12993 3817 p 2 0 2820 780 9903 3430 p 2 1 2962 637 10847 3611 p 2 0 2582 1018 8422 3109 p 2 0 2639 961 8932 3171 p 2 0 2610 990 8398 3117 p 2 2 2453 1145 8130 2975 p 2 0 2614 986 8497 3119 p 2 0 2550 1050 8389 3049 p 2 0 2563 1037 8722 3083 i 2 3600 0 0 140241 13461 p 2 0 3503 97 19697 4442 p 2 0 2703 897 8876 3242 p 2 0 3372 228 16892 4191 p 2 0 3247 353 13058 3973 p 2 0 3219 381 13436 3879 p 2 0 3270 330 14878 3983 p 2 0 3258 342 13746 3956 p 2 0 3177 423 12725 3799 p 2 0 3135 465 12089 3781 p 2 0 3209 391 12996 3871 p 2 0 3079 521 11588 3703 p 2 0 3333 267 14071 4143 p 2 0 3330 270 14241 4136 p 2 0 3474 126 20266 4413 p 2 0 3320 280 14454 4088 p 2 0 3201 399 13220 3886 p 2 0 3328 272 14527 4070 p 2 0 3148 452 12762 3755 p 2 0 3131 469 12546 3738 p 2 0 2969 631 10954 3521 p 2 0 2948 652 10843 3459 p 2 0 2889 711 10333 3396 p 2 0 3124 476 12342 3731 p 2 0 3062 538 10951 3737 p 2 0 3471 129 18893 4413 p 2 0 2593 1007 8726 3080 p 2 0 2967 633 11560 3527 p 2 0 3244 356 13039 3922 p 2 0 3228 372 13818 3886 p 2 0 2913 687 10422 3485 p 2 0 3259 341 14354 3909 p 2 0 3131 469 12065 3754 p 2 0 2964 636 11011 3532 p 2 0 2930 670 10349 3482 p 2 0 3103 497 11726 3727 p 2 0 3199 401 12408 3918 p 2 0 3040 560 11705 3639 p 2 0 3388 212 17334 4165 p 2 0 3336 264 14744 4124 p 2 0 3129 471 12565 3792 p 2 0 3105 495 11905 3694 p 2 0 3108 492 11949 3764 p 2 0 3278 322 14571 3923 p 2 0 3039 561 11248 3620 p 2 0 3016 584 11068 3621 p 2 0 3105 495 11922 3719 p 2 0 2947 653 10724 3534 p 2 0 3131 469 11881 3820 p 2 0 2892 708 10067 3489 p 2 0 3464 136 18161 4333 p 2 0 3113 487 12829 3739 p 2 0 3080 520 12413 3654 p 2 0 2918 682 10449 3436 p 2 0 2848 752 10261 3375 p 2 0 2972 628 10773 3517 p 2 0 2801 799 9852 3321 p 2 0 2886 714 10275 3426 p 2 0 2916 684 10307 3452 p 2 0 3165 435 11955 3879 p 2 0 3061 539 11505 3720 p 2 0 3384 216 16373 4212 p 2 0 2501 1099 8350 2956 p 2 0 3011 589 11037 3596 p 2 0 3107 493 12413 3783 p 2 0 3186 414 13009 3867 p 2 0 2942 658 11265 3499 p 2 0 2912 688 10357 3444 p 2 0 2898 702 10443 3452 p 2 0 2842 758 9862 3360 p 2 0 2807 793 9503 3300 p 2 0 3094 506 11870 3703 p 2 0 2789 811 9825 3311 p 2 0 3448 152 18706 4254 p 2 0 2625 975 8983 3092 p 2 0 3088 512 11280 3696 p 2 0 3082 518 12013 3700 p 2 0 3210 390 13335 3821 p 2 0 3062 538 11756 3651 p 2 0 3022 578 11078 3560 p 2 0 2894 706 10083 3407 p 2 0 2863 737 10065 3391 p 2 0 2966 634 10696 3499 p 2 0 2751 849 9422 3275 p 2 0 3192 408 12257 3899 p 2 0 3007 593 11067 3596 p 2 0 3417 183 17586 4212 p 2 0 3249 351 13928 3887 p 2 0 3186 414 12763 3850 p 2 0 3141 459 11713 3735 p 2 0 3100 500 11971 3736 p 2 0 3065 535 11693 3689 p 2 0 3012 588 11747 3621 p 2 0 2965 635 10960 3563 p 2 0 3036 564 11437 3629 p 2 0 3273 327 13887 4016 p 2 0 3172 428 13220 3806 p 2 0 3510 90 24727 4449 p 2 0 3402 198 17269 4230 p 2 0 2923 677 11198 3467 i 2 3600 0 0 117135 13819 p 2 1 3565 34 24333 4785 p 2 0 3026 574 11221 3602 p 2 4 3385 211 15954 4338 p 2 0 2750 850 8898 3305 p 2 0 2931 669 10281 3514 p 2 2 2906 692 9752 3482 p 2 0 3241 359 12486 4078 p 2 3 2440 1157 7646 2986 p 2 0 3039 561 11916 3622 p 2 0 2933 667 10049 3530 p 2 0 2306 1294 6500 2802 p 2 0 2770 830 8649 3391 p 2 0 3005 595 10194 3636 p 2 0 2665 935 8070 3210 p 2 0 3063 537 11140 3769 p 2 0 2957 643 9581 3587 p 2 0 2700 900 8092 3258 p 2 0 2849 751 9162 3467 p 2 0 3053 547 11090 3691 p 2 4 2607 989 8198 3145 p 2 0 3100 500 10942 3808 p 2 0 2948 652 10002 3548 p 2 0 2345 1255 6918 2811 p 2 0 2340 1260 6781 2797 p 2 0 2684 916 7951 3177 p 2 0 2229 1371 6023 2657 p 2 0 2626 974 7951 3124 p 2 0 2448 1152 7172 2912 p 2 0 2316 1284 6545 2793 p 2 0 2266 1334 6364 2727 p 2 0 2605 995 7814 3126 p 2 0 2456 1144 7190 2945 p 2 0 3215 385 12898 3962 p 2 0 2855 745 9376 3439 p 2 0 2529 1071 7813 2979 p 2 0 2480 1120 7269 2944 p 2 0 2518 1082 7555 2984 p 2 0 2230 1370 6437 2670 p 2 0 2685 915 8394 3225 p 2 0 2478 1122 7065 2940 p 2 0 2497 1103 7373 2992 p 2 4 2507 1089 7651 3016 p 2 0 2952 648 9420 3609 p 2 0 2561 1039 7728 3107 p 2 0 3053 547 10490 3752 p 2 0 2840 760 9153 3419 p 2 0 2699 901 8278 3252 p 2 33 2949 618 18867 3909 p 2 0 2014 1586 5956 2490 p 2 166 2229 1205 31134 4328 p 2 48 2779 773 21549 4073 p 2 14 2569 1017 20282 3744 p 2 14 2779 807 22444 3906 p 2 18 2405 1177 21999 3561 p 2 24 2525 1051 20708 3629 p 2 13 2855 732 22675 4124 p 2 25 2618 957 17978 3737 p 2 52 3077 471 18704 4330 p 2 16 2939 645 16947 4034 p 2 0 2501 1099 12600 3310 p 2 0 2531 1069 7728 3074 p 2 0 1897 1703 5253 2354 p 2 3 2902 695 10976 3520 i 2 3600 0 0 101363 13738 p 2 1906 1694 0 111204 14062 i 2 3600 0 0 51022 12581 i 2 3600 0 0 32562 11911 i 2 3600 0 0 29876 11713 p 2 1577 2007 16 33965 10599 p 2 415 3123 62 36841 8448 p 2 2163 1437 0 106226 14031 p 2 0 3186 414 12968 3963 p 2 0 3005 595 10977 3764 p 2 0 2222 1378 6261 2757 p 2 0 2780 820 9209 3287 p 2 0 2361 1239 6838 2831 p 2 0 2482 1118 7048 2951 p 2 0 2731 869 8937 3292 p 2 0 3319 281 16816 4330 p 2 1 2818 781 9177 3463 p 2 0 2458 1142 7578 3013 p 2 0 3192 408 11581 4001 p 2 0 2830 770 8558 3495 p 2 0 2949 651 9301 3613 p 2 0 2935 665 9361 3591 p 2 0 2584 1016 7411 3146 p 2 0 2817 783 8627 3424 p 2 0 2801 799 8513 3401 p 2 0 1919 1681 5095 2343 p 2 1 2468 1131 7092 2988 p 2 0 2504 1096 6871 2999 p 2 0 2817 783 8810 3431 p 2 0 2425 1175 6829 2916 p 2 0 2825 775 8371 3452 p 2 0 2734 866 8458 3348 p 2 0 2339 1261 6341 2811 p 2 0 2449 1151 6527 2910 p 2 0 2025 1575 5579 2496 p 2 0 2362 1238 6613 2849 p 2 0 2212 1388 6082 2695 p 2 0 2177 1423 5930 2666 p 2 13 2498 1089 14529 3384 p 2 0 2602 998 8004 3164 p 2 0 2585 1015 13318 3399 p 2 0 2994 606 9963 3708 p 2 0 2666 934 7782 3223 p 2 0 2112 1488 5724 2560 p 2 2 2581 1017 13628 3337 p 2 0 2470 1130 7357 2981 p 2 0 2116 1484 5832 2600 p 2 1 3041 558 32903 4607 p 2 0 2765 835 9660 3451 p 2 0 2207 1393 6367 2683 p 2 50 2758 792 31609 4440 p 2 0 2889 711 10484 3628 p 2 42 2863 695 33581 4600 p 2 0 3227 373 13019 4151 p 2 0 2899 701 9182 3554 p 2 0 2374 1226 6765 2894 p 2 26 2822 752 31645 4442 p 2 0 2751 849 9965 3438 p 2 0 2324 1276 6831 2871 p 2 22 2944 634 30641 4547 p 2 0 2514 1086 7926 3137 p 2 0 2483 1117 6940 2994 p 2 0 2359 1241 6990 2869 p 2 0 2777 823 9186 3409 p 2 0 2487 1113 6972 2996 p 2 0 2828 772 8398 3455 p 2 0 1998 1602 5139 2426 p 2 9 2531 1060 8651 3136 p 2 0 2242 1358 6217 2711 p 2 51 2310 1239 12071 3180 p 2 0 1995 1605 5983 2496 p 2 342 2372 886 33704 5068 p 2 0 2562 1038 9253 3203 p 2 0 2273 1327 7740 2860 p 2 11 2484 1105 27692 3792 p 2 0 2849 751 11279 3576 p 2 14 2556 1030 28983 3887 p 2 0 3043 557 11980 3859 p 2 0 2917 683 9819 3566 p 2 108 2563 929 34999 4445 p 2 0 2544 1056 9678 3214 p 2 0 2388 1212 7477 2984 p 2 0 1784 1816 5519 2266 p 2 129 2471 1000 35509 4435 p 2 0 2274 1326 8822 2907 p 2 0 1944 1656 7186 2494 p 2 12 2372 1216 27343 3668 p 2 0 2681 919 10441 3390 p 2 11 2582 1007 28928 3879 p 2 0 3059 541 12152 3886 p 2 0 2681 919 8862 3294 p 2 0 2183 1417 6956 2716 p 2 113 2418 1069 34052 4261 p 2 0 2398 1202 9303 3067 p 2 0 2129 1471 6870 2643 p 2 125 2412 1063 35355 4313 p 2 0 2282 1318 8611 2897 p 2 0 2301 1299 7630 2849 p 2 11 2327 1262 27121 3604 p 2 0 2644 956 9741 3310 p 2 12 2324 1264 28069 3617 p 2 0 3094 506 13334 3916 p 2 0 2904 696 10728 3586 p 2 0 2418 1182 7896 2968 p 2 11 2482 1107 27503 3755 p 2 0 2680 920 9938 3366 p 2 0 2306 1294 7504 2845 p 2 16 2372 1212 26254 3648 p 2 0 2046 1554 6533 2600 p 2 0 2064 1536 7469 2599 p 2 126 1950 1524 33714 3835 p 2 0 2815 785 10170 3547 p 2 11 2151 1438 26142 3437 p 2 0 3217 383 19133 4195 i 2 3600 0 0 86598 12657 p 2 1770 1830 0 104521 14066 p 2 1557 2043 0 109865 13829 p 2 0 3594 6 28199 5835 p 2 793 2807 0 104827 10374 p 2 160 3440 0 70939 8143 p 2 92 3508 0 66541 7589 p 2 381 3219 0 105497 9993 p 2 111 3489 0 51478 7232 p 2 15 3585 0 42883 6137 p 2 345 3218 37 96847 9284 p 2 0 3051 549 12622 4654 p 2 0 3231 369 17283 4732 p 2 123 3177 300 83440 7464 p 2 0 3005 595 16582 4333 p 2 0 2641 959 13761 3360 p 2 69 3010 521 74040 6347 p 2 0 3110 490 23037 4414 p 2 0 2791 809 13978 3713 p 2 117 2948 535 76883 6523 p 2 0 3187 413 20156 4406 p 2 0 2912 688 14087 3695 p 2 603 2928 69 91881 9211 p 2 0 3211 389 13542 4465 p 2 0 3183 417 13393 4211 p 2 145 3313 142 75619 7185 p 2 0 3416 184 18618 4842 p 2 0 2778 822 10352 3501 p 2 130 3302 168 73726 6934 p 2 0 3428 172 19569 4802 p 2 0 3115 485 13168 3938 p 2 16 2930 654 11766 3729 p 2 0 2864 736 9773 3494 p 2 0 3118 482 11993 3891 p 2 0 2678 922 8418 3268 p 2 0 3226 374 12670 4065 p 2 0 2481 1119 8706 3080 p 2 732 2632 236 82269 8659 p 2 0 3229 371 14322 4410 p 2 0 2761 839 11587 3512 p 2 686 2672 242 85246 8678 p 2 0 3181 419 13983 4352 p 2 0 3149 451 14104 4029 p 2 474 2805 321 68094 7397 p 2 0 3092 508 14087 4145 p 2 0 3053 547 11212 3849 p 2 606 2767 227 69300 7876 p 2 0 3148 452 13416 4124 p 2 0 3243 357 14276 4165 p 2 264 3167 169 84668 7627 p 2 0 3302 298 15951 4560 p 2 0 2677 923 10585 3356 p 2 20 3306 274 68051 6251 p 2 0 3261 339 16844 4305 p 2 0 3082 518 12437 3869 p 2 167 3173 260 78963 6969 p 2 0 3115 485 15484 4210 p 2 3 3277 320 15769 4333 p 2 0 2997 603 10444 3780 p 2 0 3302 298 15424 4263 p 2 0 2677 923 10726 3347 p 2 647 2692 261 90250 8927 p 2 0 3257 343 14257 4441 p 2 0 2570 1030 8777 3226 p 2 159 3114 327 73095 6917 p 2 0 3213 387 15853 4401 p 2 30 3225 345 63815 6194 p 2 0 3327 273 19388 4633 p 2 0 3065 535 12784 4020 p 2 0 2734 866 8516 3363 p 2 9 3110 481 12036 4038 p 2 0 3044 556 10715 3793 p 2 0 2807 793 10263 3457 p 2 5 3006 589 12568 3744 p 2 0 3011 589 10575 3726 p 2 0 3006 594 10606 3686 p 2 9 2828 763 10513 3478 p 2 0 2632 968 8196 3172 p 2 0 2649 951 8150 3207 p 2 5 2467 1128 9159 3071 p 2 0 2510 1090 7852 3033 p 2 8 2671 921 9532 3341 p 2 0 2604 996 8196 3164 p 2 0 2995 605 10545 3688 p 2 0 2393 1207 9127 3010 p 2 718 2612 270 81705 8575 p 2 0 3048 552 12312 4124 p 2 0 2487 1113 9453 3138 p 2 688 2605 307 84815 8627 p 2 0 2898 702 11019 3909 p 2 0 2413 1187 7658 3018 p 2 474 2677 449 67352 7155 p 2 0 2789 811 11946 3712 p 2 601 2743 256 69571 7842 p 2 0 3137 463 14928 4098 p 2 0 3350 250 17121 4414 p 2 0 2681 919 9912 3352 p 2 301 2972 327 89088 7762 p 2 101 2922 577 35343 4937 p 2 186 2945 469 47766 5731 p 2 257 2970 373 96233 7736 p 2 58 3073 469 50915 5953 p 2 28 3135 437 42701 5587 p 2 53 3232 315 78628 6763 p 2 32 3250 318 43886 5643 p 2 24 3011 565 34172 5011 p 2 38 3224 338 39801 5518 p 2 23 2928 649 32301 4859 p 2 19 3369 212 38087 5544 p 2 517 2727 356 87599 8174 p 2 5 3053 542 33420 4849 p 2 1 2861 738 26779 4232 p 2 542 2567 491 83978 7770 p 2 0 3308 292 31309 4829 p 2 0 3359 241 31152 4752 p 2 355 2950 295 64542 6703 p 2 0 3023 577 13031 3826 p 2 454 2866 280 64842 7047 p 2 0 2943 657 12762 3753 p 2 0 2889 711 11925 3597 p 2 0 2486 1114 9516 3073 p 2 216 3079 305 76192 6801 p 2 0 3163 437 15121 4102 p 2 0 2933 667 12202 3711 p 2 110 3120 370 65711 6187 p 2 0 3101 499 13707 3965 p 2 0 2918 682 10787 3628 p 2 77 3033 490 61136 5720 p 2 0 2946 654 13537 3761 p 2 0 3140 460 14238 4013 p 2 0 3038 562 11371 3835 p 2 0 2717 883 10149 3345 p 2 0 3069 531 15663 3896 p 2 595 2663 342 75110 7569 p 2 0 3114 486 15648 4143 p 2 0 2672 928 12296 3397 p 2 544 2595 461 77029 7442 p 2 0 2926 674 13940 3763 p 2 0 2569 1031 10052 3206 p 2 352 2745 503 61896 6335 p 2 0 2838 762 13229 3626 p 2 458 2677 465 62777 6771 p 2 0 2532 1068 14367 3318 p 2 0 3196 404 15960 4218 i 2 3600 0 0 66033 12923 p 2 0 3132 468 13210 3836 p 2 0 2606 994 7322 3009 p 2 0 3052 548 13017 3785 p 2 0 2265 1335 7582 2757 i 2 3600 0 0 100656 14477 p 2 590 2898 112 77930 9531 p 2 0 2948 652 13486 3965 p 2 482 3036 82 98152 9910 p 2 1586 2014 0 143315 15049 p 2 497 3088 15 89856 9690 p 2 447 3011 142 97422 9616 p 2 496 3006 98 95963 9575 p 2 506 2943 151 85524 9288 p 2 403 3003 194 99477 9334 p 2 470 2772 358 96690 9097 p 2 504 2711 385 83056 8860 p 2 430 2685 485 93872 8949 p 2 504 2637 459 95486 8970 p 2 520 2641 439 83669 8732 p 2 438 2620 542 97990 8965 p 2 464 2541 595 96334 8738 p 2 518 2782 300 84793 9034 p 2 422 2720 458 95052 9017 p 2 489 3014 97 95735 9493 p 2 502 2893 205 85397 9113 p 2 431 2957 212 99576 9227 p 2 492 2686 422 96813 9025 p 2 522 2565 513 83009 8735 p 2 427 2622 551 93387 8771 p 2 503 2639 458 96027 8979 p 2 481 2640 479 84762 8679 p 2 400 2666 534 99243 8912 p 2 505 2518 577 96592 8844 p 2 524 2753 323 84170 8927 p 2 402 2723 475 95543 8872 p 2 495 2952 153 95624 9367 p 2 513 2763 324 84387 9000 p 2 415 2874 311 98381 9136 p 2 492 2786 322 97184 9236 p 2 527 2649 424 84149 8804 p 2 425 2633 542 93832 8818 p 2 485 2669 446 95931 9045 p 2 509 2667 424 84554 8779 p 2 407 2714 479 98105 8890 p 2 504 2553 543 96120 8845 p 2 488 2911 201 86121 9027 p 2 413 2675 512 95932 8921 p 2 477 3102 21 105664 10320 i 2 3600 0 0 100424 13186 p 2 0 2975 625 13718 3754 p 2 0 3223 377 16218 3964 p 2 0 3207 393 15588 3886 p 2 0 3086 514 13917 3751 p 2 0 2708 892 8797 3207 p 2 0 2794 806 10175 3301 p 2 0 2878 722 10543 3406 p 2 1 2509 1090 8005 2962 p 2 0 3231 369 15248 4069 p 2 0 3124 476 12877 3822 p 2 0 3334 266 18625 4331 p 2 0 3183 417 13126 3955 p 2 0 3196 404 12807 3979 p 2 0 3117 483 11526 3828 p 2 0 3066 534 10472 3752 p 2 0 2875 725 9556 3489 p 2 0 2589 1011 7967 3152 p 2 0 2942 658 9716 3566 p 2 0 2859 741 8978 3427 p 2 0 2932 668 9613 3541 p 2 0 3185 415 12343 3920 p 2 0 2740 860 9094 3290 p 2 0 3111 489 11903 3776 p 2 0 2649 951 8164 3144 p 2 0 2498 1102 7552 2975 p 2 0 2681 919 8679 3190 p 2 0 2465 1135 7148 2955 p 2 0 2787 813 8949 3349 p 2 0 2728 872 8139 3270 p 2 0 2419 1181 7104 2902 p 2 0 2195 1405 6156 2651 p 2 1 2140 1459 6203 2620 p 2 0 2795 805 9044 3359 p 2 0 2416 1184 6977 2894 p 2 0 2824 776 9941 3397 p 2 0 2359 1241 6930 2816 p 2 1 2748 851 8894 3277 p 2 0 2374 1226 7103 2831 p 2 0 1661 1939 4635 2068 p 2 0 2376 1224 6875 2852 p 2 1 2521 1078 7390 3008 p 2 0 2231 1369 6134 2704 p 2 0 2214 1386 5930 2664 p 2 0 2233 1367 6072 2702 p 2 0 2546 1054 6977 3024 p 2 0 2528 1072 7280 2986 p 2 0 2732 868 9111 3268 p 2 0 2428 1172 6940 2889 p 2 0 2496 1104 7644 2971 p 2 0 2331 1269 6962 2777 p 2 0 2372 1228 6945 2831 p 2 0 2203 1397 6111 2656 p 2 0 2549 1051 7612 3053 p 2 0 2447 1153 7091 2933 p 2 0 2322 1278 6247 2777 p 2 0 2244 1356 5972 2694 p 2 0 2722 878 8420 3270 p 2 0 2405 1195 6861 2845 p 2 1 2806 793 9487 3356 p 2 0 2463 1137 6717 2921 p 2 11 2289 1300 8119 2834 p 2 0 2495 1105 7640 2980 p 2 112 2152 1336 13707 3307 i 2 3600 0 0 120146 14325 p 2 0 2971 629 11819 3713 p 2 0 2195 1405 7414 2701 p 2 11 2509 1080 11370 3215 p 2 114 2886 600 43736 5250 p 2 8 3147 445 14794 4262 p 2 0 2901 699 10285 3633 p 2 139 3239 222 50119 6097 p 2 0 2966 634 12771 3830 p 2 10 2847 743 12988 3734 p 2 488 2681 431 49970 6668 p 2 8 2735 857 14297 3832 p 2 0 2677 923 9436 3319 p 2 540 2332 728 49068 6527 p 2 0 2614 986 11940 3576 p 2 12 2589 999 12507 3427 p 2 893 2048 659 31938 6602 p 2 5 2999 596 11335 3846 p 2 0 2801 799 8859 3424 p 2 0 3008 592 10414 3668 p 2 0 2713 887 8440 3271 p 2 0 2683 917 8221 3223 p 2 1 2558 1041 7903 3074 p 2 0 2169 1431 6068 2631 p 2 0 2570 1030 7496 3070 p 2 0 2720 880 8016 3258 p 2 0 2516 1084 7241 2979 p 2 0 2387 1213 6716 2862 p 2 0 2415 1185 7263 2915 p 2 0 2800 800 8759 3378 p 2 0 2417 1183 7135 2911 p 2 0 2879 721 9380 3457 p 2 0 2512 1088 7296 2992 p 2 0 2710 890 8120 3223 p 2 0 2323 1277 6490 2792 p 2 0 2198 1402 6107 2635 p 2 0 1907 1693 5183 2355 p 2 5 2793 802 39717 4482 p 2 0 2829 771 11087 3542 p 2 0 2280 1320 7913 2795 p 2 23 2783 794 34522 4411 p 2 0 3074 526 13113 3844 p 2 0 2824 776 10398 3471 p 2 8 2999 593 38165 4584 p 2 0 2793 807 10193 3476 p 2 121 2990 489 44116 5170 p 2 0 2790 810 11916 3499 p 2 0 2079 1521 6416 2584 p 2 0 2647 953 8418 3203 p 2 78 2775 747 35528 4575 p 2 0 2582 1018 9680 3287 p 2 0 2496 1104 8002 3081 p 2 24 2514 1062 29703 3878 p 2 0 2918 682 11531 3637 p 2 0 2623 977 9142 3212 p 2 49 3050 501 36009 4682 p 2 0 2837 763 10459 3455 p 2 0 2057 1543 5914 2510 p 2 99 2913 588 51467 5330 p 2 0 2679 921 10203 3494 p 2 0 2715 885 8845 3307 p 2 5 2937 658 41821 4644 p 2 0 2831 769 11041 3526 p 2 0 2405 1195 8520 2952 p 2 12 2794 794 39474 4449 p 2 0 2928 672 12571 3700 p 2 0 2818 782 9506 3416 p 2 0 3144 456 13735 3874 p 2 0 2766 834 9094 3278 p 2 0 2459 1141 7593 2944 p 2 1 2661 938 8265 3196 p 2 0 2323 1277 6767 2787 p 2 0 1857 1743 5064 2297 p 2 0 1978 1622 5499 2431 p 2 0 2516 1084 7358 2984 p 2 0 2328 1272 6139 2761 p 2 0 2395 1205 6745 2858 i 2 3600 0 0 93530 13502 p 2 0 2812 788 9387 3479 i 2 3600 0 0 99920 13754 p 2 1909 1687 4 118115 14277 p 2 1104 2494 2 126200 13509 p 2 196 3404 0 68969 7267 p 2 240 3358 2 100677 9407 p 2 36 3558 6 56589 7532 p 2 1 3581 18 36532 6040 p 2 178 3276 146 66044 7612 p 2 0 3362 238 23193 5294 p 2 0 3057 543 13837 4183 p 2 357 3181 62 66168 7988 p 2 0 3023 577 12550 4417 p 2 0 3292 308 17176 4808 p 2 523 2745 332 61796 7520 p 2 0 2923 677 15096 4032 p 2 0 2444 1156 10746 3245 p 2 366 2614 620 64812 6584 p 2 0 3160 440 18119 4361 p 2 0 2847 753 12080 3583 p 2 278 2721 601 67903 6466 p 2 0 3186 414 16967 4240 p 2 0 3198 402 14270 4017 p 2 550 2904 146 60240 7582 p 2 0 3236 364 13804 4424 p 2 0 3179 421 14124 4130 p 2 741 2584 275 59275 7703 p 2 0 3180 420 13586 4275 p 2 0 2748 852 11002 3580 i 2 3600 0 0 104192 14223 p 2 0 2935 665 10358 3668 p 2 723 2382 495 76000 8499 p 2 0 3216 384 19510 4589 p 2 0 3001 599 11994 3785 p 2 388 3036 176 75603 7859 p 2 0 3154 446 14090 4409 p 2 0 3216 384 12861 4167 p 2 0 2571 1029 9978 3231 p 2 505 2901 194 82559 8275 p 2 0 3346 254 19071 4700 p 2 0 2870 730 11987 3661 i 2 3600 0 0 100271 13992 p 2 0 3368 232 17881 4356 p 2 0 3201 399 13277 4078 p 2 792 2521 287 62201 8037 p 2 0 3249 351 14828 4446 p 2 0 3107 493 10886 3920 p 2 593 2811 196 61685 7637 p 2 0 3181 419 14158 4465 p 2 0 3188 412 12809 4096 p 2 651 2657 292 60940 7585 p 2 0 3125 475 12642 4211 p 2 0 2493 1107 8553 3116 p 2 367 2810 423 63797 6766 p 2 0 2948 652 11863 3933 p 2 0 2080 1520 6457 2592 p 2 282 2711 607 66795 6437 p 2 0 2850 750 12910 3842 p 2 545 2717 338 58270 7201 p 2 0 3051 549 12424 4159 p 2 0 3165 435 11442 4025 p 2 0 2386 1214 9393 3024 p 2 739 2449 412 57897 7512 p 2 0 2381 1219 8029 3164 p 2 0 2887 713 11278 3703 i 2 3600 0 0 103724 14244 p 2 0 3210 390 12643 4060 p 2 724 2442 434 76191 8547 p 2 0 3381 219 20966 4756 p 2 0 3178 422 13333 4037 p 2 379 3090 131 76215 7955 p 2 0 3122 478 13888 4218 p 2 0 3156 444 12019 4108 p 2 0 2632 968 9751 3292 p 2 515 2845 240 81879 8263 p 2 0 3239 361 16004 4456 p 2 0 2857 743 11650 3644 i 2 3600 0 0 101359 14002 p 2 0 3355 245 18367 4432 p 2 0 3144 456 13041 3976 p 2 800 2497 303 61757 8066 p 2 0 3145 455 13920 4343 p 2 604 2805 191 60300 7735 p 2 0 2838 762 10582 3860 p 2 0 3022 578 13090 3882 p 2 0 2431 1169 9159 3070 p 2 666 2382 552 58532 7276 p 2 0 2640 960 10559 3560 p 2 0 2203 1397 10004 2861 p 2 364 2406 830 62231 6282 p 2 0 2881 719 13454 3914 p 2 275 2712 613 67200 6456 p 2 0 2478 1122 14778 3459 p 2 0 3509 91 31106 5474 i 2 3600 0 0 66024 11317 p 2 1248 2352 0 149534 12833 p 2 1197 2403 0 139575 12958 p 2 1317 2283 0 133024 12856 p 2 673 2927 0 133560 12169 p 2 782 2818 0 130496 12030 p 2 599 3001 0 118555 11240 p 2 553 3047 0 123125 10761 p 2 565 3034 1 118372 10823 p 2 501 3099 0 114823 10240 p 2 554 3046 0 110531 9877 p 2 545 3055 0 112641 9932 p 2 482 3116 2 106442 9738 p 2 449 3148 3 112085 9795 p 2 630 2967 3 93278 9730 p 2 619 2973 8 95044 9556 p 2 286 3310 4 104505 9187 p 2 363 3228 9 102633 9210 p 2 577 3011 12 87447 9028 p 2 429 3154 17 100923 8927 p 2 418 3177 5 101095 8750 p 2 466 3125 9 100015 8946 p 2 259 3324 17 101182 8826 p 2 660 2926 14 134493 10973 p 2 519 2957 124 92869 8609 p 2 648 2857 95 82934 8499 p 2 396 3160 44 115175 9834 p 2 429 2972 199 82678 8381 p 2 318 2728 554 86797 7638 p 2 523 3016 61 123569 10252 p 2 418 2852 330 81006 7723 p 2 370 3041 189 83321 7876 i 2 3600 0 0 95333 12649 p 2 626 2552 422 102956 8551 p 2 606 2646 348 97578 8487 p 2 674 2901 25 153928 11684 p 2 318 3201 81 120718 9603 p 2 533 2910 157 104604 9270 p 2 750 2846 4 140038 11975 p 2 482 2958 160 109173 9751 p 2 466 2816 318 117726 9387 p 2 1438 2161 1 160450 13521 p 2 609 2826 165 108329 9399 p 2 600 2901 99 100790 9244 p 2 1336 2258 6 146040 12909 p 2 528 2824 248 108435 8979 p 2 592 2850 158 104569 8753 p 2 683 2917 0 151610 11281 p 2 490 3056 54 121130 9842 p 2 605 2931 64 106083 9370 p 2 623 2971 6 126184 10638 p 2 581 2890 129 102539 9382 p 2 453 2751 396 109399 8876 p 2 624 2975 1 137344 10917 p 2 280 3138 182 123553 9631 p 2 423 3037 140 112304 9785 i 2 3600 0 0 98021 12567 p 2 824 2547 229 103442 8955 p 2 693 2875 32 118554 9578 p 2 784 2632 184 105640 9060 p 2 572 2940 88 112526 9367 p 2 498 2959 143 106775 8976 p 2 580 2926 94 112660 9511 p 2 612 2982 6 111953 9660 i 2 3600 0 0 99366 13152 p 2 0 2526 1074 9815 3080 p 2 0 3145 455 15742 3863 p 2 0 2950 650 12970 3531 p 2 0 3156 444 17750 3888 p 2 1 2954 645 12600 3523 p 2 0 2886 714 11889 3432 p 2 0 2993 607 13185 3589 p 2 0 2723 877 10862 3240 p 2 0 3350 250 22947 4379 p 2 0 3054 546 12971 3745 p 2 1 3190 409 14658 3982 p 2 0 3423 177 15810 4400 p 2 0 3029 571 10277 3714 p 2 1 3345 254 15186 4195 p 2 0 3135 465 12312 3896 p 2 0 3116 484 11907 3840 p 2 0 2964 636 10182 3583 p 2 0 2980 620 10131 3647 p 2 0 2934 666 9702 3574 p 2 0 2693 907 8028 3228 p 2 0 3027 573 10722 3668 p 2 0 2905 695 10197 3519 p 2 0 3090 510 11937 3811 p 2 0 2799 801 8605 3412 p 2 0 2622 978 8043 3145 p 2 1 2661 938 8963 3177 p 2 0 2358 1242 6941 2811 p 2 0 2038 1562 5519 2486 p 2 0 2240 1360 6323 2708 p 2 0 2312 1288 6784 2791 p 2 0 2308 1292 6112 2757 p 2 0 2332 1268 6569 2795 p 2 0 2787 813 8860 3354 p 2 0 2424 1176 7058 2886 p 2 0 2967 633 10891 3597 p 2 0 2753 847 9025 3271 p 2 0 2426 1174 7318 2895 p 2 1 2497 1102 7151 2984 p 2 0 2138 1462 5888 2564 p 2 0 2388 1212 6842 2862 p 2 0 2485 1115 7354 2974 p 2 0 2224 1376 6323 2693 p 2 0 2181 1419 5962 2629 p 2 1 1900 1699 5298 2352 p 2 0 2623 977 8101 3129 p 2 0 2401 1199 6485 2851 p 2 0 2723 877 9187 3286 p 2 0 2527 1073 8001 3018 p 2 0 2381 1219 6877 2849 p 2 0 2417 1183 7037 2886 p 2 0 2389 1211 7004 2844 p 2 0 2276 1324 6403 2722 p 2 0 2227 1373 6148 2677 p 2 0 2177 1423 5935 2629 p 2 0 2174 1426 5891 2619 p 2 0 2071 1529 6172 2534 p 2 0 2466 1134 7616 2935 i 2 3600 0 0 91640 13325 p 2 25 3407 168 20502 4970 p 2 0 3169 431 11559 3885 p 2 0 2720 880 9102 3263 p 2 0 2608 992 8658 3116 p 2 0 2289 1311 6850 2769 p 2 0 2422 1178 8550 2934 p 2 0 2226 1374 6658 2688 p 2 0 2106 1494 6902 2590 p 2 0 2342 1258 7056 2792 p 2 0 2529 1071 8070 3033 p 2 0 2302 1298 6932 2740 p 2 0 2596 1004 9860 3175 p 2 0 2512 1088 9069 3039 p 2 0 2403 1197 7274 2887 p 2 0 2106 1494 6260 2558 p 2 0 2105 1495 6766 2566 p 2 0 2163 1437 6535 2599 p 2 0 2323 1277 6879 2751 p 2 0 2057 1543 6255 2504 p 2 0 2009 1591 6126 2441 p 2 0 2071 1529 6027 2524 p 2 0 2337 1263 7454 2796 p 2 0 2088 1512 6631 2532 p 2 0 2571 1029 8838 3112 p 2 0 2356 1244 7758 2856 p 2 0 2135 1465 7134 2613 p 2 0 2332 1268 7406 2809 p 2 0 1991 1609 5955 2421 p 2 0 1999 1601 5620 2415 p 2 0 2057 1543 5785 2489 p 2 0 1987 1613 6005 2441 p 2 0 1912 1688 6065 2367 p 2 0 1900 1700 5829 2354 p 2 0 1795 1805 5050 2232 p 2 0 2199 1401 6729 2655 p 2 0 1969 1631 6197 2428 p 2 0 2644 956 9245 3176 p 2 0 2335 1265 7006 2796 i 2 3600 0 0 141829 13458 p 2 0 3270 330 12816 3900 p 2 13 3565 22 34160 4839 p 2 0 3499 101 20423 4496 p 2 9 3237 354 21380 4194 p 2 0 3079 521 12337 3700 p 2 53 2930 617 23425 3999 p 2 27 3320 253 27544 4533 p 2 0 2512 1088 8712 3043 p 2 0 3340 260 17295 4024 p 2 0 2410 1190 8134 2868 p 2 9 2439 1152 10978 3006 p 2 4 2519 1077 11150 3066 p 2 0 2660 940 9490 3168 p 2 0 2343 1257 7739 2800 p 2 4 3249 347 17689 4046 p 2 0 3094 506 12747 3753 p 2 0 3138 462 12224 3755 p 2 0 3164 436 12750 3804 p 2 0 3377 223 17046 4161 p 2 7 3047 546 14509 3687 p 2 0 3372 228 15811 4160 p 2 0 3306 294 14326 4054 p 2 0 2985 615 11113 3603 p 2 2 2736 862 12436 3305 p 2 0 2824 776 9722 3316 p 2 0 2628 972 8817 3115 p 2 39 3018 543 26773 4052 p 2 0 3160 440 14049 3809 p 2 0 2983 617 11252 3579 p 2 73 2892 635 25615 4096 p 2 0 3234 366 13008 3996 p 2 39 2757 804 24758 3831 p 2 0 3481 119 19579 4426 p 2 0 3321 279 14927 4104 p 2 0 3135 465 12909 3715 p 2 55 2736 809 23574 3770 p 2 0 3053 547 12504 3619 p 2 0 2848 752 10006 3386 p 2 47 2981 572 28131 4107 p 2 0 2986 614 12269 3627 p 2 0 3101 499 13268 3784 p 2 41 3045 514 27275 4123 p 2 0 3253 347 13670 4043 p 2 44 2954 602 25542 4069 p 2 0 3460 140 18477 4345 p 2 0 3312 288 15578 4032 p 2 0 3136 464 12454 3800 p 2 73 3030 497 26588 4321 p 2 0 3183 417 13556 3885 p 2 0 3149 451 13739 3813 p 2 37 3060 503 27641 4157 p 2 0 2911 689 11497 3498 p 2 0 3026 574 11750 3636 p 2 56 3126 418 26970 4341 p 2 0 3267 333 14086 4025 p 2 51 2901 648 26562 4057 p 2 0 3445 155 18490 4390 p 2 0 3283 317 14121 4040 p 2 0 3196 404 13821 3842 p 2 42 3067 491 27226 4206 p 2 0 3210 390 13577 3926 p 2 0 2921 679 10736 3459 p 2 83 2928 589 25048 4147 p 2 0 2948 652 11695 3540 p 2 0 2142 1458 7287 2586 p 2 56 3122 422 25049 4210 p 2 0 2986 614 11447 3580 p 2 0 3183 417 12525 3897 p 2 81 2837 682 29888 4116 p 2 0 3464 136 19378 4363 p 2 63 3281 256 34566 4758 p 2 14 3287 299 20670 4269 p 2 0 2449 1151 9131 2944 p 2 14 2731 855 14812 3452 p 2 16 3119 465 24347 4057 p 2 12 2988 600 16554 3828 p 2 14 2840 746 15735 3663 p 2 9 3031 560 17542 3907 p 2 0 3011 589 12948 3685 p 2 0 3160 440 12923 3928 p 2 0 2789 811 10157 3384 p 2 0 3423 177 18281 4290 p 2 0 3170 430 13021 3841 p 2 0 3232 368 13362 3960 p 2 0 3188 412 13117 3873 p 2 0 2803 797 9954 3345 p 2 0 3036 564 11526 3622 p 2 0 2936 664 10682 3495 p 2 0 3052 548 11453 3657 p 2 0 3093 507 12119 3719 p 2 0 3334 266 16364 4114 p 2 0 3025 575 11739 3623 p 2 0 3447 153 21139 4325 p 2 0 3340 260 15811 4148 p 2 0 2718 882 10078 3266 p 2 0 3160 440 12897 3792 p 2 0 2921 679 10538 3462 p 2 0 2890 710 10768 3446 p 2 0 3061 539 11801 3663 p 2 0 2790 810 10107 3359 p 2 0 3120 480 15267 4036 i 2 3600 0 0 63982 12910 p 2 0 3271 329 13624 4295 p 2 72 3038 490 13087 4172 p 2 0 2870 730 10169 3702 p 2 0 2900 700 11771 3751 p 2 66 2721 813 10757 3823 p 2 0 2757 843 9502 3566 p 2 0 2028 1572 6244 2615 p 2 72 2588 940 11745 3634 p 2 0 2531 1069 9032 3251 p 2 0 2468 1132 7923 3118 p 2 21 2480 1099 9904 3354 p 2 0 2318 1282 7663 2975 p 2 0 2396 1204 7684 3041 p 2 31 2579 990 10613 3489 p 2 0 2439 1161 7849 3048 p 2 0 2437 1163 8334 3172 p 2 67 2549 984 9160 3566 p 2 0 2647 953 8528 3350 p 2 0 2594 1006 7810 3216 p 2 32 2197 1371 9131 2953 p 2 0 2493 1107 7746 3085 p 2 31 2411 1158 10215 3275 p 2 0 2308 1292 7348 2907 p 2 0 2151 1449 6953 2746 p 2 65 2508 1027 9060 3448 p 2 0 2304 1296 6845 2855 p 2 0 2159 1441 6378 2667 p 2 0 2108 1492 6376 2661 p 2 72 2346 1182 10497 3333 p 2 0 2591 1009 8163 3241 p 2 0 2432 1168 7778 3083 p 2 66 2368 1166 8744 3332 p 2 0 2400 1200 7277 2983 p 2 32 2363 1205 9704 3152 p 2 0 2225 1375 6767 2815 p 2 0 2138 1462 6699 2751 p 2 0 2259 1341 6387 2829 p 2 31 2295 1274 9834 3160 p 2 0 2251 1349 7125 2847 p 2 0 2333 1267 7535 2989 p 2 68 2452 1080 9134 3460 p 2 0 2579 1021 8044 3193 p 2 0 2446 1154 7310 3074 p 2 72 2453 1075 10053 3393 p 2 0 2380 1220 7336 2985 p 2 21 2335 1244 9828 3213 p 2 0 2409 1191 7812 3028 p 2 0 2095 1505 6580 2701 p 2 0 2074 1526 6482 2681 p 2 23 2201 1376 7782 3029 p 2 0 2296 1304 7360 2910 p 2 0 2332 1268 7760 2992 p 2 0 2370 1230 7703 3058 p 2 0 2455 1145 7846 3112 p 2 0 2324 1276 7349 2911 p 2 0 2349 1251 7146 2950 i 2 3600 0 0 154676 16467 p 2 0 3560 40 25910 4986 p 2 0 3061 539 11605 3863 p 2 0 3520 80 23700 4852 p 2 0 3416 184 15771 4575 p 2 0 2931 669 14565 3797 p 2 0 3489 111 20171 4762 p 2 0 3336 264 15230 4368 p 2 0 2646 954 8899 3299 p 2 0 3040 560 13554 3843 p 2 0 2870 730 10659 3510 p 2 0 2253 1347 7558 2800 p 2 0 2655 945 11321 3252 p 2 0 2388 1212 8360 2939 p 2 0 2661 939 9174 3261 p 2 0 3333 267 17749 4323 p 2 0 3482 118 18832 4772 p 2 0 3248 352 15766 4188 p 2 0 3343 257 15343 4396 p 2 0 3348 252 15278 4306 p 2 0 3124 476 13786 3959 p 2 0 3136 464 12443 3996 p 2 0 3118 482 13101 3935 p 2 0 2190 1410 7135 2730 p 2 0 2991 609 13519 3744 p 2 0 3083 517 11900 3885 p 2 0 2221 1379 7413 2768 p 2 0 3027 573 14313 3809 p 2 0 3259 341 13361 4219 p 2 0 3085 515 13799 3950 p 2 0 3496 104 20660 4797 p 2 0 3395 205 16866 4461 p 2 0 3080 520 12068 3809 p 2 0 3261 339 16135 4220 p 2 0 3248 352 13794 4160 p 2 0 2923 677 10769 3605 p 2 0 3259 341 17775 4198 p 2 0 3163 437 12974 3960 p 2 0 2368 1232 8151 2905 p 2 0 3199 401 15728 4066 p 2 0 3341 259 14807 4374 p 2 0 3141 459 15857 4069 p 2 0 3445 155 18943 4650 p 2 0 3358 242 15168 4351 p 2 0 3058 542 11546 3851 p 2 0 3061 539 13603 3874 p 2 0 3323 277 16036 4294 p 2 0 3086 514 12437 3853 p 2 0 3342 258 18307 4333 p 2 0 3258 342 15168 4175 p 2 0 3094 506 12604 3877 p 2 0 3174 426 16111 4026 p 2 0 2835 765 10605 3521 p 2 0 3258 342 13168 4208 p 2 0 2892 708 12733 3667 p 2 0 3460 140 19638 4699 p 2 0 3359 241 17611 4408 p 2 0 3332 268 15679 4298 p 2 0 3093 507 13036 3870 p 2 0 2341 1259 7753 2880 p 2 0 3122 478 14826 3947 p 2 0 3265 335 15146 4197 p 2 0 3142 458 12370 3968 p 2 0 3147 453 15914 3994 p 2 0 3275 325 15395 4225 p 2 0 3173 427 15754 4021 p 2 0 3519 81 27817 4978 p 2 0 3434 166 19585 4667 p 2 0 3207 393 13730 4050 p 2 0 3314 286 17910 4366 p 2 0 3323 277 15900 4340 p 2 0 2911 689 11125 3630 p 2 0 3251 349 17690 4165 i 2 3600 0 0 136030 15970 p 2 3 3581 16 36688 5763 p 2 0 3030 570 14835 3893 p 2 3 3364 233 48988 5357 p 2 0 3442 158 20109 4759 p 2 0 3409 191 19199 4617 p 2 3 3397 200 49533 5470 p 2 0 3056 544 13888 3975 p 2 0 2823 777 11308 3561 p 2 1 3367 232 51597 5479 p 2 0 2806 794 12431 3598 p 2 0 3086 514 13620 3952 p 2 0 3053 547 43264 4738 p 2 0 3411 189 20649 4631 p 2 0 2658 942 11968 3356 p 2 1 3260 339 40328 4860 p 2 0 3389 211 19792 4586 p 2 0 3242 358 16604 4255 p 2 0 3472 128 47658 5395 p 2 0 3325 275 17900 4464 p 2 0 3202 398 14980 4157 p 2 7 3231 362 51610 5340 p 2 0 3073 527 16023 4081 p 2 0 3248 352 15062 4219 p 2 4 3220 376 50533 5206 p 2 0 3229 371 16383 4278 p 2 0 2589 1011 11976 3336 p 2 0 3183 417 45891 4968 p 2 0 3079 521 13522 4047 p 2 0 3284 316 17316 4359 p 2 0 3412 188 40778 5207 p 2 0 3207 393 15418 4201 p 2 0 2606 994 10148 3267 p 2 0 3314 286 41189 4952 p 2 0 3130 470 15067 4083 p 2 0 3314 286 17465 4404 p 2 0 3303 297 38831 4802 p 2 0 3109 491 15358 4007 p 2 0 2741 859 11546 3462 p 2 3 3212 385 44519 4905 p 2 0 3391 209 18544 4609 p 2 0 3228 372 16050 4263 p 2 3 3311 286 47655 5263 p 2 0 3048 552 14663 4006 p 2 0 3294 306 15607 4316 p 2 1 3272 327 50413 5319 p 2 0 3041 559 14666 3962 p 2 0 3181 419 14344 4140 p 2 0 3071 529 43503 4728 p 2 0 3215 385 16715 4269 p 2 0 2473 1127 10956 3174 p 2 1 3112 487 39007 4635 p 2 0 3265 335 18705 4362 p 2 0 2928 672 13013 3736 p 2 0 3400 200 46455 5333 p 2 0 3007 593 14024 3913 p 2 8 3254 338 51597 5336 p 2 0 2908 692 14859 3805 p 2 0 2284 1316 8971 2918 p 2 0 3012 588 12970 3813 p 2 5 3041 554 48991 4960 p 2 0 3075 525 15541 4030 p 2 0 2243 1357 9893 2913 p 2 0 2821 779 43440 4500 p 2 0 3303 297 18203 4471 p 2 0 3095 505 14855 4016 p 2 0 3412 188 41059 5172 p 2 0 3112 488 15349 4033 p 2 0 3268 332 16374 4284 p 2 0 3300 300 41115 4908 p 2 0 3261 339 17769 4293 p 2 0 3223 377 15427 4190 p 2 0 3169 431 37927 4649 p 2 0 3170 430 15939 4140 p 2 0 2814 786 13341 3619 p 2 3 3014 583 42801 4659 p 2 0 3238 362 16542 4300 p 2 0 3281 319 17247 4323 p 2 2 3412 186 50329 5481 p 2 0 3233 367 16710 4232 p 2 0 2580 1020 10372 3265 p 2 1 3278 321 50804 5309 p 2 0 3038 562 14827 3966 p 2 0 3267 333 15324 4225 p 2 0 3125 475 43672 4834 p 2 0 3283 317 17274 4370 p 2 0 2513 1087 11138 3214 p 2 0 3135 465 39262 4632 p 2 0 3283 317 18232 4405 p 2 0 3250 350 16545 4247 p 2 0 3354 246 46240 5247 p 2 0 2962 638 13960 3845 p 2 6 3374 220 53557 5533 p 2 0 3110 490 15886 4112 p 2 0 2560 1040 10289 3230 p 2 0 3149 451 14922 4085 p 2 5 3128 467 50041 5150 p 2 0 3215 385 16814 4244 p 2 0 2425 1175 10964 3130 p 2 0 3004 596 44816 4735 p 2 0 3337 263 17692 4515 p 2 0 3142 458 15675 4104 p 2 0 3463 137 42034 5273 p 2 0 3346 254 19848 4503 p 2 0 3226 374 15108 4225 p 2 0 3253 347 40300 4850 p 2 0 2936 664 14532 3818 p 2 0 3228 372 15472 4220 p 2 0 3199 401 38289 4696 p 2 0 3128 472 15100 4109 p 2 0 2815 785 12539 3589 p 2 3 3015 582 43021 4668 p 2 0 3231 369 17830 4318 p 2 0 3265 335 16680 4257 p 2 3 3334 263 48181 5329 p 2 0 3129 471 14571 4065 p 2 0 2627 973 10516 3300 p 2 0 3213 387 15509 4183 p 2 0 2812 788 11209 3547 p 2 0 3025 575 12864 3810 p 2 0 2791 809 11309 3521 p 2 0 2965 635 12572 3759 p 2 0 2785 815 11015 3459 p 2 0 2711 889 10397 3364 p 2 0 3205 395 13474 4188 p 2 0 3435 165 20367 4703 p 2 0 3249 351 15708 4213 p 2 0 3036 564 12597 3806 p 2 0 2797 803 11193 3487 p 2 72 3268 260 55739 5878 p 2 0 3032 568 15075 3966 p 2 0 3123 477 14173 4026 p 2 56 2938 606 50306 5230 p 2 0 3124 476 15306 4111 p 2 0 2381 1219 10289 3064 p 2 70 2858 672 53323 5267 p 2 0 3297 303 17121 4453 p 2 0 3239 361 16365 4276 p 2 55 3389 156 58899 6011 p 2 0 3246 354 17022 4332 p 2 0 3273 327 17064 4340 p 2 0 3257 343 16589 4268 p 2 0 3091 509 13544 3963 p 2 0 3115 485 13201 3970 p 2 0 2992 608 12100 3769 p 2 0 2985 615 11832 3769 p 2 0 3009 591 12506 3778 p 2 0 3274 326 15262 4327 p 2 0 3145 455 13418 4067 p 2 0 3348 252 16594 4460 p 2 0 3139 461 14094 4010 p 2 0 2982 618 11450 3757 p 2 0 3031 569 12424 3813 p 2 0 2764 836 10685 3425 p 2 0 2902 698 11291 3566 p 2 0 2910 690 11353 3632 p 2 0 2660 940 10120 3300 p 2 0 2545 1055 8901 3134 p 2 0 2715 885 10049 3369 p 2 0 3126 474 13598 3978 p 2 0 2768 832 11175 3455 p 2 0 3412 188 21199 4649 p 2 0 3220 380 15703 4162 p 2 0 3028 572 12777 3824 p 2 0 2924 676 12268 3658 p 2 0 2259 1341 8990 2833 p 2 0 3157 443 14078 4273 i 2 3600 0 0 164215 16585 p 2 0 3566 34 29539 5088 p 2 6 3516 78 27141 4963 p 2 0 3550 50 25290 5106 p 2 3 3548 49 28040 5297 p 2 0 2944 656 11274 3755 p 2 0 3255 345 16130 4279 p 2 0 3425 175 21030 4685 p 2 4 3189 407 17685 4106 p 2 0 3291 309 15982 4205 p 2 0 2297 1303 7757 2833 p 2 4 2746 850 14233 3449 p 2 0 3525 75 21836 4942 p 2 0 3402 198 17770 4544 p 2 7 3262 331 18120 4302 p 2 0 3450 150 19061 4615 p 2 4 3439 157 22674 4713 p 2 0 3466 134 18776 4707 p 2 0 3358 242 15574 4448 p 2 0 2738 862 9946 3412 p 2 7 3319 274 18707 4383 p 2 0 3069 531 12249 3879 p 2 0 2891 709 10720 3569 p 2 3 2996 601 15075 3778 p 2 0 3001 599 11410 3723 p 2 10 3242 348 17316 4179 p 2 0 3021 579 12302 3799 p 2 0 2218 1382 7314 2728 p 2 1 2849 750 12822 3588 p 2 0 3313 287 14210 4389 p 2 0 3024 576 13756 3908 p 2 0 3488 112 21363 4815 p 2 0 3320 280 17383 4369 p 2 0 3435 165 19459 4560 p 2 0 3090 510 12237 3887 p 2 0 2216 1384 7277 2734 p 2 0 2825 775 11996 3509 p 2 0 2796 804 10368 3467 p 2 0 2920 680 12626 3658 p 2 0 3335 265 16269 4294 p 2 0 3108 492 13779 3911 p 2 0 3346 254 16019 4361 p 2 0 3533 67 29255 5061 p 2 0 3495 105 21162 4762 p 2 0 3330 270 15359 4301 i 2 3600 0 0 87428 13750 p 2 52 3499 49 33162 5495 p 2 0 2704 896 11925 3389 p 2 117 3223 260 74105 6094 p 2 0 2856 744 15293 3749 p 2 0 3284 316 20164 4140 p 2 127 2782 691 72565 5844 p 2 0 2862 738 14657 3735 p 2 21 2881 698 63154 5224 p 2 0 2969 631 14484 3745 p 2 0 2116 1484 8646 2776 p 2 0 2772 828 13045 3446 p 2 4 3034 562 55985 4982 p 2 0 3139 461 17099 4029 p 2 0 2430 1170 9385 3089 p 2 2 3222 376 54522 5104 p 2 0 2781 819 14460 3683 p 2 0 3037 563 14971 3826 p 2 0 2546 1054 11121 3252 p 2 0 3035 565 14826 3800 p 2 7 2443 1150 11100 3131 p 2 0 3064 536 13847 3762 p 2 0 2573 1027 10939 3179 p 2 0 2747 853 10826 3340 p 2 2 2134 1464 8760 2724 p 2 0 2550 1050 9596 3049 p 2 0 1895 1705 6333 2416 p 2 2 2519 1079 10278 3094 p 2 0 2008 1592 7549 2574 p 2 0 2389 1211 9067 2888 p 2 7 1880 1713 7268 2466 p 2 0 2770 830 11562 3315 p 2 6 2204 1390 8370 2820 p 2 0 3040 560 12939 3667 p 2 0 2349 1251 9032 2940 p 2 0 2573 1027 9674 3120 p 2 4 2064 1532 7886 2636 p 2 0 2479 1121 9893 2982 p 2 0 1646 1954 5045 2138 p 2 3 2520 1077 10183 3080 p 2 0 2020 1580 6985 2581 p 2 0 2482 1118 10076 2976 p 2 25 2704 871 66398 5296 p 2 0 3023 577 15926 4036 p 2 38 2713 849 64780 5308 p 2 0 2886 714 12776 3608 p 2 0 2475 1125 12096 3226 p 2 28 3160 412 61218 5536 p 2 0 2408 1192 13231 3431 p 2 0 2872 728 11970 3491 p 2 0 1989 1611 7486 2584 p 2 14 3171 415 61860 5559 p 2 0 2581 1019 13484 3456 p 2 0 2983 617 15222 3804 p 2 1 2539 1060 11967 3307 p 2 0 2933 667 13781 3647 p 2 1 2431 1168 10936 3127 p 2 0 3071 529 14615 3817 p 2 0 2537 1063 9907 3113 i 2 3600 0 0 81307 13545 p 2 0 3556 44 26245 5310 p 2 0 3314 286 12583 4280 p 2 0 2890 710 9595 3605 p 2 0 2929 671 9449 3689 p 2 0 2902 698 9117 3609 p 2 0 2954 646 9435 3656 p 2 0 2873 727 8814 3553 p 2 0 2658 942 7863 3292 p 2 0 3010 590 10060 3777 p 2 0 2782 818 8457 3439 p 2 0 3154 446 11699 3985 p 2 0 2913 687 9442 3653 p 2 0 2768 832 8715 3402 p 2 0 2612 988 7492 3232 p 2 0 2563 1037 7591 3132 p 2 0 2627 973 7736 3244 p 2 0 2571 1029 7135 3170 p 2 0 2514 1086 7122 3105 p 2 0 2624 976 7695 3268 p 2 0 2861 739 8691 3629 p 2 0 2663 937 7473 3366 p 2 0 3234 366 12751 4221 p 2 0 2921 679 9078 3685 p 2 0 2402 1198 7131 2989 p 2 0 1934 1666 5707 2466 p 2 0 2573 1027 7622 3181 p 2 0 2748 852 8661 3401 p 2 0 2482 1118 7006 3047 p 2 0 2643 957 7943 3273 p 2 0 2874 726 9306 3534 p 2 0 3273 327 15382 4572 i 2 3600 0 0 129433 15780 p 2 0 3565 35 29325 5322 p 2 4 3287 309 15520 4383 p 2 0 3318 282 17196 4400 p 2 0 3005 595 12507 3842 p 2 3 3324 273 16054 4362 p 2 0 2714 886 9879 3340 p 2 0 2200 1400 7833 2803 p 2 2 2360 1238 8412 2960 p 2 0 2140 1460 7346 2653 p 2 0 1920 1680 6387 2441 p 2 2 2980 618 11889 3737 p 2 0 3322 278 15259 4430 p 2 0 3201 399 14588 4167 p 2 0 3346 254 16377 4428 p 2 0 3298 302 15652 4307 p 2 0 2885 715 10785 3615 p 2 0 2662 938 9609 3298 p 2 0 2210 1390 7651 2766 p 2 0 2907 693 11346 3633 p 2 4 3034 562 12633 3853 p 2 0 2891 709 10755 3630 p 2 0 2791 809 10369 3471 p 2 3 2852 745 11109 3552 p 2 0 3173 427 12539 4102 p 2 2 2873 725 10675 3659 p 2 0 3333 267 15942 4437 p 2 0 3198 402 13869 4092 p 2 0 2712 888 9607 3355 p 2 0 2638 962 9474 3264 p 2 0 2920 680 11371 3657 p 2 0 3012 588 11762 3754 p 2 2 2891 707 11613 3634 p 2 0 2733 867 10192 3402 p 2 0 2620 980 9413 3252 p 2 0 2685 915 10361 3313 p 2 0 2994 606 11042 3831 p 2 0 3056 544 12028 3940 p 2 0 3195 405 13017 4130 p 2 0 3010 590 11403 3801 p 2 0 2683 917 9866 3384 p 2 2 2798 800 10520 3530 p 2 0 3010 590 11572 3794 p 2 0 2816 784 9827 3489 p 2 2 3159 439 14085 4027 p 2 0 2783 817 10450 3475 p 2 0 2698 902 9802 3363 p 2 0 2927 673 11868 3670 p 2 0 2578 1022 9361 3222 i 2 3600 0 0 157589 16545 p 2 0 3527 73 20715 4965 p 2 0 2886 714 10138 3594 p 2 0 3332 268 15521 4348 p 2 0 3456 144 17490 4582 p 2 0 2538 1062 8482 3120 p 2 0 3224 376 14502 4118 p 2 0 3461 139 17913 4559 p 2 0 3309 291 14357 4222 p 2 0 3111 489 13634 3959 p 2 0 3329 271 15236 4314 p 2 0 3421 179 17511 4610 p 2 0 3085 515 11712 3928 p 2 0 3524 76 22300 4969 p 2 0 3492 108 19547 4721 p 2 0 3280 320 13999 4230 p 2 0 3413 187 16939 4490 p 2 0 3161 439 12926 4027 p 2 0 3152 448 12771 4001 p 2 0 3239 361 13825 4146 p 2 0 3029 571 11662 3821 p 2 0 3086 514 11915 3863 p 2 0 3204 396 13498 4053 p 2 0 2859 741 10426 3570 p 2 0 3294 306 13462 4286 p 2 0 3214 386 12732 4106 p 2 0 3489 111 19515 4720 p 2 0 3323 277 15282 4275 p 2 0 3266 334 13864 4156 p 2 0 3364 236 15760 4343 p 2 0 3215 385 13251 4093 p 2 0 3145 455 12542 4028 p 2 0 3278 322 15065 4234 p 2 0 3228 372 13496 4118 p 2 0 3077 523 12055 3841 p 2 0 3321 279 14304 4341 p 2 0 3161 439 12825 4039 p 2 0 3460 140 18680 4652 p 2 0 3356 244 15374 4359 p 2 0 3042 558 11554 3845 p 2 0 3353 247 15498 4376 p 2 0 3176 424 13055 4006 p 2 0 3068 532 12123 3826 p 2 0 3105 495 12619 3872 p 2 0 3098 502 12346 3868 p 2 0 3246 354 14863 4069 p 2 0 3058 542 11915 3764 p 2 0 3365 235 15109 4432 p 2 0 3038 562 11246 3872 p 2 0 3424 176 17340 4623 p 2 0 2641 959 9051 3243 p 2 0 3086 514 13073 3874 p 2 0 3001 599 10932 3763 p 2 0 2943 657 10946 3659 p 2 0 2934 666 11921 3664 p 2 0 2830 770 10088 3506 p 2 0 3018 582 12432 3771 p 2 0 2882 718 10555 3581 p 2 0 3081 519 12602 3853 p 2 0 2763 837 9819 3440 p 2 0 3121 479 13621 3969 p 2 0 3524 76 22453 4861 p 2 0 3374 226 16192 4433 p 2 2 3263 335 16568 4243 p 2 0 3233 367 14352 4156 p 2 0 2184 1416 7215 2705 p 2 0 3132 468 14088 3991 p 2 0 3109 491 12406 3950 p 2 0 2978 622 12428 3761 p 2 0 2814 786 10249 3501 p 2 0 3155 445 13998 3994 p 2 0 3224 376 14269 4116 p 2 0 3389 211 15025 4416 p 2 0 3497 103 21424 4770 p 2 0 3402 198 16596 4467 p 2 0 3106 494 12550 3899 p 2 0 2723 877 9911 3407 p 2 0 3184 416 13249 3964 p 2 0 2598 1002 8963 3183 p 2 0 3056 544 11939 3788 p 2 0 2888 712 10636 3585 p 2 0 2821 779 9965 3439 p 2 0 2847 753 10486 3490 p 2 0 3312 288 14166 4309 p 2 0 2858 742 10133 3607 p 2 0 3458 142 20005 4702 p 2 0 3407 193 17485 4454 p 2 0 3176 424 13216 4035 p 2 0 3082 518 11958 3894 p 2 0 3252 348 13729 4180 p 2 0 3125 475 12769 3893 p 2 0 3043 557 11731 3776 p 2 0 2910 690 11053 3601 p 2 0 2782 818 9943 3392 p 2 0 2981 619 11169 3674 p 2 0 3239 361 14976 4172 p 2 0 3204 396 13308 4127 p 2 0 3491 109 20338 4777 p 2 0 2724 876 9715 3356 p 2 0 3249 351 15957 4130 p 2 0 3215 385 13493 4108 p 2 0 3346 254 15800 4304 p 2 0 3173 427 14937 4042 p 2 0 3059 541 12006 3817 p 2 0 3010 590 13729 3786 p 2 0 3050 550 11903 3804 p 2 0 3060 540 11934 3810 p 2 0 3286 314 13808 4243 p 2 0 3110 490 11925 3944 p 2 0 3533 67 24362 4943 p 2 0 3385 215 16739 4438 p 2 0 3114 486 12792 3914 p 2 0 3288 312 14829 4197 p 2 0 3256 344 14733 4163 p 2 0 3194 406 13343 4030 p 2 0 3204 396 12855 4087 p 2 0 2950 650 11287 3691 p 2 0 3002 598 11329 3693 p 2 0 2922 678 11157 3558 p 2 0 3280 320 13580 4224 p 2 0 3069 531 12025 3842 p 2 0 3417 183 18467 4556 p 2 0 3343 257 15832 4319 p 2 0 2821 779 10730 3499 p 2 0 3057 543 11768 3824 p 2 0 3256 344 14097 4162 p 2 0 3199 401 13201 4064 p 2 0 3033 567 11414 3765 p 2 0 3073 527 11784 3806 p 2 0 3036 564 11741 3804 p 2 0 3191 409 13101 4021 p 2 0 3326 274 15721 4319 p 2 0 3077 523 12630 3844 p 2 0 3491 109 22905 4817 p 2 0 3411 189 17920 4579 p 2 0 3343 257 16280 4429 p 2 0 3296 304 16024 4255 p 2 0 3521 79 29454 5357 i 2 3600 0 0 137088 16119 p 2 0 3451 149 20677 4684 p 2 617 2430 553 66747 8049 p 2 0 3374 226 18394 4718 p 2 0 3108 492 13800 3999 p 2 589 2587 424 66801 8043 p 2 0 3243 357 15015 4495 p 2 0 3418 182 18528 4706 p 2 804 2727 69 77020 9412 p 2 0 2834 766 12311 3869 p 2 0 2437 1163 8785 3081 p 2 166 3108 326 63028 6750 p 2 0 2894 706 14584 4047 p 2 0 3402 198 18021 4637 p 2 191 3073 336 65857 6859 p 2 0 3499 101 20727 5006 p 2 0 2846 754 11408 3680 p 2 8 3377 215 42997 5633 p 2 0 3440 160 18745 4856 p 2 0 3411 189 18083 4691 p 2 7 3518 75 48056 5929 p 2 0 3234 366 14494 4327 p 2 20 3431 149 51507 6126 p 2 0 3107 493 14798 4176 p 2 0 2492 1108 8530 3148 p 2 0 3105 495 12833 3972 p 2 35 3175 390 54740 5782 p 2 0 3247 353 16134 4469 p 2 0 2485 1115 9500 3237 p 2 76 2961 563 56515 5823 p 2 0 3403 197 17544 4770 p 2 0 3218 382 14347 4306 p 2 0 3390 210 18221 4581 p 2 0 3261 339 14536 4340 p 2 2 3213 385 14150 4192 p 2 0 3159 441 13298 4059 p 2 0 2944 656 11108 3716 p 2 0 2775 825 10115 3498 p 2 2 2818 780 10592 3503 p 2 0 2658 942 9027 3323 p 2 0 2378 1222 7479 2944 p 2 2 2550 1048 9378 3210 p 2 0 3104 496 11501 4021 p 2 0 3186 414 12659 4081 p 2 0 3175 425 13614 4130 p 2 0 2797 803 9864 3516 p 2 0 2907 693 10411 3657 p 2 0 3058 542 11087 3859 p 2 0 3070 530 11895 3924 p 2 0 3006 594 11878 3841 p 2 282 2890 428 66440 7007 p 2 0 3137 463 15026 4187 p 2 0 2536 1064 9603 3279 p 2 270 2881 449 64829 6912 p 2 0 3153 447 14534 4204 p 2 0 3296 304 15388 4405 p 2 281 3188 131 68646 7452 p 2 0 3162 438 14119 4203 p 2 0 2357 1243 8229 3017 p 2 303 2921 376 67104 7245 p 2 0 2672 928 11940 3644 p 2 0 3257 343 16242 4326 p 2 0 2917 683 12869 3806 p 2 0 3037 563 12312 3852 p 2 0 3074 526 12632 3899 p 2 1 2871 728 11253 3672 p 2 0 3305 295 14637 4404 p 2 0 3007 593 11021 3833 p 2 3 3377 220 18429 4556 p 2 0 2944 656 11441 3711 p 2 0 2919 681 10812 3633 p 2 0 3072 528 12435 3867 p 2 0 2681 919 9407 3302 p 2 0 3030 570 11457 3794 p 2 1 3078 521 12875 3911 p 2 0 2854 746 10416 3545 p 2 0 2778 822 10020 3423 p 2 3 2471 1126 9082 3089 p 2 0 2837 763 9990 3584 p 2 0 3174 426 14238 4066 p 2 1 3268 331 15476 4288 p 2 0 2753 847 9587 3426 p 2 3 2485 1112 8971 3094 p 2 0 1931 1669 6061 2487 p 2 0 2748 852 9920 3403 p 2 0 2900 700 10841 3615 p 2 0 2919 681 11079 3647 p 2 0 3573 27 34790 5727 i 2 3600 0 0 143034 16185 p 2 8 3589 3 67244 6957 p 2 0 3581 19 34824 5517 p 2 1 3441 158 42289 5451 p 2 0 3314 286 17469 4451 p 2 1 3236 363 39836 5080 p 2 0 3320 280 15659 4429 p 2 0 2869 731 11733 3655 p 2 0 2488 1112 9444 3111 p 2 0 2327 1273 8440 2962 p 2 1 2606 993 33275 4085 p 2 0 3015 585 15069 3873 p 2 0 2667 933 10401 3310 p 2 0 3485 115 39012 5408 p 2 0 3243 357 15138 4320 p 2 0 3378 222 17225 4628 p 2 0 2693 907 10385 3373 p 2 0 3416 184 38457 5223 p 2 0 3235 365 15622 4274 p 2 0 3272 328 15463 4287 p 2 0 3224 376 32515 4683 p 2 0 3005 595 12215 3836 p 2 0 2932 668 11414 3705 p 2 0 3108 492 32423 4527 p 2 0 2964 636 13723 3769 p 2 0 2728 872 10300 3411 p 2 0 3138 462 13007 4093 p 2 0 3457 143 19809 4768 p 2 0 3282 318 15663 4285 p 2 0 3186 414 12727 4047 p 2 0 3253 347 14145 4189 p 2 0 2842 758 11027 3536 p 2 0 2977 623 11917 3721 p 2 0 2920 680 11122 3644 p 2 0 2751 849 10034 3397 p 2 1 3076 523 38815 4710 p 2 0 2799 801 12117 3566 p 2 0 3023 577 13360 3844 p 2 1 3395 204 42440 5423 p 2 0 3133 467 14222 4113 p 2 0 3182 418 13381 4161 p 2 5 3192 403 39824 5018 p 2 0 3246 354 16104 4305 p 2 0 2432 1168 10495 3133 p 2 1 3147 452 40623 4992 p 2 0 3019 581 14445 3959 p 2 0 2875 725 11796 3670 p 2 0 3062 538 13212 3923 p 2 0 2884 716 11444 3641 p 2 1 3207 392 15551 4216 p 2 0 2701 899 10256 3385 p 2 0 3226 374 14301 4187 p 2 0 2351 1249 9282 2973 p 2 5 3204 391 40912 5059 p 2 0 3109 491 14322 4059 p 2 0 2226 1374 9685 2876 p 2 3 2856 741 36296 4432 p 2 0 2859 741 12908 3681 p 2 0 2789 811 11559 3526 p 2 55 2825 720 48829 5225 p 2 0 2799 801 13652 3687 p 2 0 2651 949 11358 3462 p 2 10 3244 346 46844 5475 p 2 0 3204 396 16445 4320 p 2 0 3410 190 17943 4633 p 2 2 3189 409 14659 4166 p 2 0 3128 472 12779 4010 p 2 0 3195 405 14445 4153 p 2 2 3043 555 13009 3884 p 2 0 2644 956 9486 3280 p 2 0 2587 1013 9795 3225 p 2 0 2613 987 9307 3252 p 2 0 2782 818 9782 3432 p 2 0 2397 1203 8501 3010 p 2 0 3079 521 12525 3984 p 2 0 2935 665 10572 3714 p 2 0 3440 160 20026 4725 p 2 1 3251 348 14960 4273 p 2 0 3194 406 13748 4129 p 2 0 3178 422 13972 4108 p 2 0 2926 674 11318 3667 p 2 0 2684 916 9860 3378 p 2 0 2656 944 9202 3297 p 2 2 2780 818 10513 3460 p 2 0 2648 952 9258 3238 p 2 0 2563 1037 8769 3161 p 2 0 3157 443 13206 4121 p 2 0 3023 577 11930 3868 p 2 0 3165 435 13644 4124 p 2 0 3056 544 12028 3901 p 2 0 2767 833 9860 3470 p 2 0 3024 576 11867 3824 p 2 0 2878 722 11261 3656 p 2 0 2875 725 10736 3613 p 2 3 2925 672 10996 3681 p 2 0 2747 853 9954 3408 p 2 0 2856 744 10598 3568 p 2 0 2594 1006 8958 3267 p 2 4 3121 475 13613 4041 p 2 0 2730 870 9828 3425 p 2 0 3156 444 13249 4039 p 2 2 3141 457 13484 4062 p 2 0 2874 726 10805 3603 p 2 0 2522 1078 8712 3150 p 2 2 2576 1022 9504 3230 p 2 0 2586 1014 8995 3204 p 2 0 2471 1129 9026 3104 p 2 0 2504 1096 8877 3128 p 2 0 2668 932 9118 3289 p 2 0 2235 1365 7616 2814 p 2 0 2999 601 11480 3844 p 2 0 2850 750 10401 3565 p 2 0 3303 297 16717 4391 p 2 1 3122 477 13108 4002 p 2 0 2822 778 10722 3536 p 2 0 2654 946 9619 3346 p 2 0 2284 1316 7665 2877 i 2 3600 0 0 35378 11623 p 2 2 3376 222 16008 4534 p 2 0 2665 935 7378 2944 p 2 375 2240 985 33092 5758 p 2 0 2162 1438 8093 2959 p 2 141 2433 1026 29147 4840 p 2 0 1907 1693 7364 2837 p 2 0 1949 1651 6321 2522 p 2 96 2489 1015 24487 4471 p 2 0 2346 1254 7946 3131 p 2 0 1729 1871 5683 2253 p 2 0 1527 2073 4662 1968 p 2 0 1733 1867 5235 2173 p 2 0 1832 1768 4861 2247 p 2 0 1635 1965 4577 2090 p 2 34 2523 1043 25139 4201 p 2 0 1877 1723 6661 2532 p 2 73 2333 1194 25497 4230 p 2 0 1697 1903 6568 2523 p 2 0 1874 1726 5573 2392 p 2 224 2423 953 30538 5057 p 2 0 2174 1426 8699 3101 p 2 0 1758 1842 5477 2286 p 2 0 2013 1587 5501 2382 p 2 133 2273 1194 26105 4591 p 2 0 2133 1467 7344 2856 p 2 0 1973 1627 6412 2483 p 2 133 2482 985 26561 4740 i 2 3600 0 0 157007 16530 p 2 0 3505 95 21168 4653 p 2 0 2448 1152 7959 3073 p 2 0 3286 314 14979 4301 p 2 0 2742 858 9584 3461 p 2 0 3006 594 11063 3825 p 2 0 3282 318 14037 4206 p 2 0 3354 246 14885 4361 p 2 0 3190 410 12949 4055 p 2 0 3061 539 12403 3833 p 2 0 3241 359 13493 4131 p 2 0 2273 1327 7234 2799 p 2 0 3043 557 12007 3824 p 2 0 3407 193 15027 4580 p 2 0 3542 58 24297 5057 p 2 0 3456 144 18221 4688 p 2 0 3069 531 11396 3888 p 2 0 2874 726 10181 3579 p 2 0 3061 539 12266 3779 p 2 0 3065 535 11881 3800 p 2 0 3127 473 12542 3888 p 2 0 2795 805 10145 3470 p 2 0 2961 639 11132 3676 p 2 0 3206 394 12698 4017 p 2 0 2892 708 10485 3584 p 2 0 3275 325 13533 4257 p 2 0 3490 110 20726 4808 p 2 0 3446 154 17702 4518 p 2 0 3116 484 12298 3945 p 2 0 2765 835 9936 3455 p 2 0 3000 600 11459 3735 p 2 0 2895 705 10659 3595 p 2 0 3229 371 14079 4072 p 2 0 3001 599 11129 3701 p 2 0 2971 629 10997 3645 p 2 0 2815 785 9851 3425 p 2 0 3226 374 12722 4118 p 2 0 3009 591 10943 3813 p 2 0 3477 123 19744 4723 p 2 0 3339 261 15617 4334 p 2 0 3012 588 11788 3730 p 2 0 3238 362 13261 4125 p 2 0 3161 439 12844 4019 p 2 0 3105 495 12591 3953 p 2 0 3106 494 12081 3890 p 2 0 3201 399 13636 4072 p 2 0 3067 533 12139 3843 p 2 0 2993 607 11586 3708 p 2 0 3321 279 14480 4347 p 2 0 3128 472 12515 4010 p 2 0 3441 159 19051 4649 p 2 0 3343 257 15372 4357 p 2 0 3207 393 13556 4077 p 2 0 3105 495 11666 3862 p 2 0 3262 338 15242 4206 p 2 0 3110 490 12381 3890 p 2 0 3113 487 13346 3895 p 2 0 2780 820 10167 3441 p 2 0 2884 716 11808 3583 p 2 0 3238 362 14449 4086 p 2 0 2998 602 11442 3736 p 2 0 3309 291 13870 4298 p 2 0 3497 103 20785 4778 p 2 0 3398 202 16294 4434 p 2 0 3164 436 12741 4013 p 2 0 3306 294 14929 4244 p 2 0 3050 550 11586 3791 p 2 0 2995 605 11482 3693 p 2 0 2825 775 10095 3509 p 2 0 2953 647 11090 3683 p 2 0 3098 502 12361 3853 p 2 0 3296 304 15072 4144 p 2 0 2998 602 11609 3734 p 2 0 3290 310 13767 4271 p 2 0 3462 138 19219 4700 p 2 0 3280 320 13785 4193 p 2 0 3158 442 12489 4013 p 2 0 3108 492 12497 3939 p 2 0 2771 829 9910 3418 p 2 0 3006 594 10919 3771 p 2 0 2920 680 10664 3655 p 2 0 2792 808 9839 3476 p 2 0 2817 783 9897 3520 p 2 0 2930 670 10698 3647 p 2 0 2913 687 10643 3620 p 2 0 3122 478 12547 3946 p 2 0 3538 62 23147 4877 p 2 0 3383 217 16326 4411 p 2 0 3069 531 12095 3882 p 2 0 3094 506 12055 3892 p 2 0 3194 406 12633 4002 p 2 0 3117 483 12610 3901 p 2 0 2977 623 11050 3681 p 2 0 2931 669 10908 3660 p 2 0 3125 475 11989 3927 p 2 0 2835 765 10126 3501 p 2 0 3066 534 13029 3828 p 2 0 3411 189 15992 4469 p 2 0 3299 301 15194 4239 p 2 0 3357 243 19003 4387 p 2 0 3156 444 13259 4011 p 2 0 3288 312 15929 4216 p 2 0 2924 676 11202 3609 p 2 0 3014 586 11468 3749 p 2 0 2825 775 10416 3493 p 2 0 2957 643 11117 3677 p 2 0 2902 698 10582 3587 p 2 0 3113 487 12088 3869 p 2 0 3278 322 13408 4227 p 2 0 3180 420 13066 4078 p 2 0 2896 704 11180 3568 p 2 0 3360 240 18349 4386 p 2 0 3017 583 12623 3741 p 2 0 3272 328 14228 4184 p 2 0 3213 387 14628 4089 p 2 0 3175 425 12611 4016 p 2 0 3059 541 11885 3840 p 2 0 2918 682 12123 3650 p 2 0 3066 534 12138 3784 p 2 0 2323 1277 7584 2840 p 2 2 2995 603 12555 3731 p 2 0 3255 345 13213 4182 p 2 0 3520 80 23046 4884 p 2 0 3310 290 15007 4276 p 2 0 3105 495 12909 3910 p 2 0 3195 405 12837 4008 p 2 0 3237 363 13832 4130 p 2 0 3067 533 12469 3788 p 2 0 2850 750 10488 3473 p 2 0 2978 622 11174 3672 p 2 0 2884 716 10646 3527 p 2 0 2965 635 11170 3642 p 2 0 3289 311 13813 4248 p 2 0 2980 620 11087 3782 p 2 0 3446 154 19156 4636 p 2 0 3405 195 17574 4483 p 2 0 3159 441 12786 3969 p 2 0 3227 373 14215 4094 p 2 0 2958 642 11668 3625 p 2 0 2972 628 11122 3660 p 2 0 2832 768 10271 3497 p 2 0 2910 690 10641 3617 p 2 0 3014 586 11777 3751 p 2 0 2178 1422 6984 2681 p 2 1 2604 995 10717 3223 p 2 0 3263 337 13283 4235 p 2 0 3136 464 12988 3953 p 2 0 3381 219 18845 4397 p 2 0 3321 279 16158 4271 p 2 0 3146 454 13147 3992 p 2 0 3150 450 14514 3964 p 2 0 3164 436 12753 3985 p 2 0 3156 444 12974 4020 p 2 0 3034 566 12894 3802 p 2 0 2944 656 11281 3646 p 2 0 2540 1060 8762 3100 p 2 0 2585 1015 10422 3175 p 2 0 3151 449 12290 4024 p 2 0 3253 347 14226 4169 p 2 0 3411 189 18484 4502 p 2 0 3261 339 14316 4133 p 2 0 3336 264 15584 4274 p 2 1 3223 376 15248 4103 p 2 0 3028 572 11975 3785 p 2 0 3187 413 13358 4032 p 2 0 3024 576 11533 3757 p 2 0 3250 350 13973 4116 p 2 0 3110 490 12471 3898 p 2 0 3376 224 16025 4460 p 2 0 3257 343 14818 4234 p 2 0 3284 316 14673 4295 p 2 0 3279 321 14070 4189 p 2 0 3036 564 11790 3839 p 2 0 3320 280 16540 4265 p 2 0 2896 704 11383 3595 p 2 0 3079 521 11784 3830 p 2 0 2964 636 11040 3669 p 2 0 2994 606 12749 3752 p 2 0 2989 611 11425 3737 p 2 0 2740 860 9611 3361 p 2 0 2720 880 11109 3371 p 2 0 3251 349 13782 4137 p 2 0 3098 502 13039 3865 p 2 0 3436 164 20013 4557 p 2 0 3228 372 14043 4129 p 2 0 3248 352 14996 4158 p 2 0 3223 377 14297 4104 p 2 0 3104 496 12449 3923 p 2 0 3211 389 14663 4075 p 2 0 3074 526 12243 3877 p 2 0 3112 488 12317 3900 p 2 0 2268 1332 7506 2782 p 2 0 2950 650 12599 3684 p 2 0 3264 336 13349 4241 p 2 0 3317 283 14839 4277 p 2 1 3380 219 18321 4456 p 2 0 3194 406 13768 4028 p 2 0 2935 665 11409 3634 p 2 0 2873 727 12261 3538 p 2 0 3158 442 14103 3970 p 2 0 3124 476 14283 3917 p 2 0 2891 709 10914 3580 p 2 0 2936 664 11251 3632 p 2 0 3011 589 11479 3707 p 2 0 3356 244 16174 4344 p 2 0 3103 497 13222 3903 p 2 0 3526 74 28049 5000 p 2 0 3468 132 20587 4744 p 2 0 3285 315 14892 4252 p 2 0 3263 337 14580 4200 p 2 0 2972 628 11670 3694 p 2 0 3238 362 14806 4465 i 2 3600 0 0 123214 14836 p 2 0 3509 91 29576 5186 p 2 937 2588 75 90737 10691 p 2 0 3566 34 27629 5631 p 2 620 2958 22 91652 10462 p 2 0 3189 411 14583 4562 p 2 0 2598 1002 10453 3484 p 2 0 3178 422 15968 4277 p 2 1030 2410 160 86022 10760 p 2 0 3148 452 14839 4430 p 2 0 2700 900 10427 3502 p 2 530 2730 340 80862 9114 p 2 0 3356 244 19026 4836 p 2 366 3097 137 86872 9222 p 2 0 3446 154 19336 5140 p 2 0 3322 278 14987 4504 p 2 0 3201 399 13209 4170 p 2 366 3158 76 82323 8979 p 2 0 3411 189 17551 4974 p 2 0 3406 194 15863 4656 p 2 50 3443 107 62676 6978 p 2 0 3404 196 16222 4714 p 2 0 2619 981 10404 3388 p 2 5 3392 203 54562 6203 p 2 0 3024 576 12355 4007 p 2 30 3417 153 55210 6498 p 2 0 3188 412 14176 4362 p 2 0 3099 501 13500 4051 p 2 0 3600 0 30560 5239 i 2 3600 0 0 108687 14660 p 2 12 3588 0 52798 6566 p 2 24 3575 1 56838 6969 p 2 300 3299 1 104449 10025 p 2 42 3558 0 58935 7115 p 2 38 3562 0 56138 7132 p 2 103 3495 2 85999 8627 p 2 23 3577 0 56548 6784 p 2 12 3588 0 47303 6228 p 2 105 3494 1 83606 8262 p 2 0 3437 163 20762 5169 p 2 1 3526 73 24181 5354 p 2 0 2976 624 10974 4004 p 2 0 2792 808 10314 3559 p 2 0 3051 549 12401 3900 p 2 2 2616 982 9211 3343 p 2 0 3061 539 12305 3906 p 2 0 2042 1558 5992 2591 p 2 4 2560 1036 9574 3206 p 2 0 3343 257 15244 4344 p 2 0 3175 425 12775 4102 p 2 4 3158 438 12925 4112 p 2 0 3200 400 13965 4139 p 2 0 3027 573 11431 3864 p 2 4 2959 637 11456 3822 p 2 0 3119 481 12133 3956 p 2 0 3251 349 14677 4280 p 2 1 3268 331 14492 4227 p 2 0 2683 917 9044 3324 p 2 0 3397 203 20327 5004 i 2 3600 0 0 85114 13980 p 2 0 3540 60 17482 5079 p 2 0 3187 413 11879 4207 p 2 0 3145 455 12295 4179 p 2 0 2889 711 10082 3738 p 2 0 3341 259 14555 4619 p 2 0 3040 560 10875 4026 p 2 0 3176 424 11739 4239 p 2 0 3069 531 10853 4022 p 2 0 2898 702 9487 3797 p 2 0 2978 622 9601 3856 p 2 145 3153 302 50207 6572 p 2 0 2927 673 12440 3909 p 2 0 3140 460 12122 4128 p 2 128 3054 418 48731 6345 p 2 0 3132 468 12479 4166 p 2 0 2333 1267 8128 3033 p 2 41 3008 551 40827 5562 p 2 0 3095 505 13948 4191 p 2 0 2801 799 9616 3614 p 2 39 3158 403 39618 5670 p 2 0 2943 657 11300 3873 p 2 0 2271 1329 6798 2881 p 2 32 3022 546 38556 5343 p 2 0 2766 834 10614 3611 p 2 0 2805 795 10203 3614 p 2 49 2950 601 40859 5501 p 2 0 2973 627 11685 3932 p 2 0 2727 873 9939 3563 p 2 0 2875 725 10431 3723 p 2 0 2833 767 9713 3651 p 2 0 3202 398 12005 4226 p 2 0 2939 661 9661 3744 p 2 0 2360 1240 7084 2988 p 2 630 2505 465 63483 8541 p 2 0 3048 552 12520 4365 p 2 0 2494 1106 7850 3268 p 2 338 2924 338 56580 7629 p 2 0 2749 851 11790 3735 p 2 266 2689 645 58555 7128 p 2 12 3581 7 41811 6949 p 2 375 3225 0 83584 10225 p 2 6 3580 14 40947 7305 p 2 62 3538 0 70042 8780 p 2 30 3558 12 46331 8038 p 2 124 3476 0 77237 9858 p 2 451 3133 16 58053 9074 p 2 428 3172 0 89093 11052 p 2 130 3467 3 60339 9088 p 2 224 3376 0 78593 10043 p 2 129 3469 2 61574 8882 p 2 158 3442 0 78590 9755 p 2 91 3505 4 57022 8978 p 2 189 3411 0 83792 10369 p 2 85 3478 37 50615 8569 p 2 159 3441 0 77923 9824 p 2 8 3567 25 38498 6979 p 2 27 3572 1 59150 7588 p 2 0 3562 38 36813 6504 p 2 13 3587 0 54704 6930 p 2 0 3433 167 18049 4789 p 2 0 3375 225 15898 4641 p 2 3 3057 540 13590 4126 p 2 0 3059 541 12731 4008 p 2 5 3325 270 16657 4654 p 2 0 3198 402 13762 4295 p 2 0 3383 217 15154 4757 p 2 1 3233 366 13824 4374 p 2 0 3298 302 14814 4507 p 2 0 3213 387 13140 4327 p 2 0 3172 428 12677 4228 p 2 0 3052 548 11889 3999 p 2 0 2966 634 11073 3890 p 2 0 2974 626 11304 3902 p 2 0 2812 788 10096 3646 p 2 0 2882 718 10281 3711 p 2 0 2729 871 9479 3532 p 2 0 2921 679 10574 3741 p 2 0 2831 769 10476 3634 p 2 0 3181 419 12446 4174 p 2 0 2861 739 9969 3672 i 2 3600 0 0 113395 14899 p 2 0 3546 54 31460 5502 p 2 0 3033 567 12577 3890 p 2 73 3325 202 61609 6886 p 2 0 3195 405 14512 4360 p 2 28 3472 100 59540 6771 p 2 0 3370 230 18305 4634 p 2 0 3295 305 14892 4371 p 2 26 3480 94 59216 6936 p 2 0 3341 259 16957 4636 p 2 0 3328 272 15655 4532 p 2 0 2893 707 10977 3679 p 2 40 3383 177 59406 6682 p 2 0 3412 188 19185 4783 p 2 0 2592 1008 9523 3304 p 2 0 3152 448 13541 4103 p 2 0 3134 466 12792 4039 p 2 0 3054 546 11767 3934 p 2 0 3089 511 12266 3981 p 2 0 3173 427 12450 4092 p 2 0 2929 671 10993 3720 p 2 1 3213 386 14969 4209 p 2 0 2877 723 10467 3610 p 2 0 3237 363 14173 4252 p 2 0 3174 426 13681 4065 p 2 0 2779 821 9965 3455 p 2 0 2836 764 10316 3599 p 2 0 2779 821 10415 3493 p 2 0 2606 994 8636 3219 p 2 0 2577 1023 8800 3245 p 2 0 2590 1010 8874 3234 p 2 0 2623 977 8799 3260 p 2 0 2335 1265 7642 2902 p 2 0 2873 727 10128 3593 p 2 0 2830 770 10081 3523 p 2 0 3179 421 13053 4088 p 2 3 2881 716 10949 3654 p 2 0 2710 890 9562 3365 p 2 0 2726 874 9723 3369 p 2 0 2493 1107 8753 3071 p 2 0 2868 732 11156 3611 p 2 0 2773 827 10518 3445 p 2 0 2643 957 8992 3282 p 2 0 2686 914 9002 3321 p 2 0 2535 1065 8724 3174 p 2 1 2910 689 10915 3662 p 2 0 2587 1013 8899 3241 p 2 0 3033 567 11683 3776 p 2 0 2849 751 11099 3544 p 2 0 2725 875 9878 3318 p 2 0 2708 892 9774 3366 p 2 0 2616 984 9754 3227 p 2 0 2587 1013 9086 3168 p 2 0 2569 1031 8911 3181 p 2 0 2593 1007 9011 3214 p 2 0 2798 802 9943 3490 p 2 0 2894 706 11310 3680 p 2 0 2570 1030 8908 3214 p 2 0 3050 550 12017 3875 p 2 0 2940 660 11307 3659 p 2 0 2526 1074 8311 3108 i 2 3600 0 0 110992 14887 p 2 0 3587 13 28543 5752 p 2 0 3180 420 14833 4187 p 2 2 3438 160 18556 4740 p 2 0 3143 457 14462 4138 p 2 0 3197 403 14245 4248 p 2 0 2999 601 12149 3862 p 2 0 3315 285 15459 4538 p 2 0 3277 323 15550 4410 p 2 0 3397 203 17282 4662 p 2 0 3270 330 15283 4401 p 2 0 2995 605 12391 3933 p 2 0 3127 473 13077 4105 p 2 0 3174 426 13348 4156 p 2 0 2804 796 11000 3636 p 2 0 3117 483 13343 4105 p 2 0 3005 595 12636 3945 p 2 0 2912 688 11628 3773 p 2 2 2840 758 11757 3700 p 2 0 3107 493 13221 4049 p 2 0 2928 672 12366 3777 p 2 0 3235 365 14367 4255 p 2 0 3091 509 13556 4024 p 2 0 2741 859 10445 3497 p 2 0 2741 859 10446 3474 p 2 0 2922 678 11739 3704 p 2 0 2557 1043 9498 3237 p 2 0 2574 1026 9637 3253 p 2 0 2568 1032 9236 3256 p 2 0 2685 915 9645 3365 p 2 2 2646 952 10246 3367 p 2 0 2876 724 11200 3682 p 2 0 2626 974 9544 3364 p 2 0 3202 398 13645 4217 p 2 0 3115 485 13045 4004 p 2 0 2638 962 9946 3333 p 2 2 2574 1024 10064 3295 p 2 0 2752 848 10389 3475 p 2 0 2396 1204 8594 3040 p 2 0 2855 745 11387 3622 p 2 0 2563 1037 9548 3295 p 2 0 2559 1041 9552 3286 p 2 0 2785 815 10850 3539 p 2 0 2851 749 11060 3670 p 2 2 2682 916 10547 3434 p 2 0 3163 437 13553 4143 p 2 0 2987 613 11596 3844 p 2 0 2559 1041 9369 3252 p 2 0 2649 951 10492 3382 p 2 0 2741 859 11035 3499 p 2 0 2444 1156 9530 3118 p 2 0 2795 805 11311 3570 p 2 0 2668 932 10123 3420 p 2 0 2588 1012 9369 3259 p 2 2 2803 795 25530 4007 p 2 0 2692 908 11997 3541 p 2 0 2861 739 12432 3723 p 2 4 2780 816 23479 4008 p 2 0 3158 442 13988 4169 p 2 0 2815 785 11196 3632 p 2 2 2842 756 23993 4047 p 2 0 2858 742 11785 3687 p 2 0 2664 936 10244 3416 p 2 4 2939 657 25053 4168 p 2 0 2728 872 11082 3511 p 2 0 2692 908 10201 3380 p 2 0 2675 925 10511 3391 p 2 0 3090 510 13344 3995 p 2 0 2666 934 10600 3443 p 2 0 3202 398 14554 4239 p 2 0 3043 557 12429 3923 p 2 0 2572 1028 9391 3260 p 2 0 2515 1085 9880 3206 p 2 0 2781 819 10668 3516 p 2 0 2371 1229 8766 3036 p 2 0 2756 844 10856 3560 p 2 0 2563 1037 9473 3261 p 2 0 2554 1046 9596 3276 p 2 0 2710 890 10714 3488 p 2 0 2737 863 10440 3508 p 2 1 2716 883 10607 3473 p 2 0 3182 418 14044 4191 p 2 0 3075 525 12389 4048 p 2 0 2653 947 9694 3369 p 2 0 2654 946 10077 3367 p 2 0 2753 847 10812 3509 p 2 0 2564 1036 9676 3226 p 2 1 2948 651 12030 3783 p 2 0 2658 942 9769 3390 p 2 0 2564 1036 9971 3268 p 2 2 2799 799 27141 4081 p 2 0 2913 687 12946 3785 p 2 4 2870 726 26000 4115 p 2 0 3304 296 17545 4454 p 2 0 3176 424 13353 4183 p 2 0 2861 739 10811 3692 p 2 38 3028 534 29231 4688 p 2 0 3136 464 13763 4152 p 2 0 2772 828 10993 3598 p 2 0 3070 530 28023 4433 p 2 0 2798 802 11590 3620 p 2 0 2767 833 11359 3561 p 2 2 2754 844 26893 4002 p 2 0 2981 619 13456 3912 p 2 0 2685 915 11327 3490 p 2 0 3270 330 16445 4373 p 2 0 3153 447 15557 4152 p 2 0 2906 694 12566 3761 p 2 0 2721 879 10922 3460 p 2 0 2731 869 10536 3462 p 2 0 2578 1022 9918 3254 p 2 0 2760 840 11348 3519 p 2 0 2743 857 10475 3495 p 2 0 2583 1017 9840 3281 p 2 0 2652 948 10652 3414 p 2 0 3086 514 12137 4023 p 2 0 2676 924 10152 3462 p 2 0 3139 461 14049 4187 p 2 0 3138 462 13054 4047 p 2 0 2804 796 11181 3585 p 2 0 2564 1036 9953 3279 p 2 0 2711 889 10475 3461 p 2 0 2695 905 10448 3401 p 2 0 2513 1087 9620 3164 i 2 3600 0 0 48006 13172 p 2 0 3177 423 11877 4116 p 2 3 3476 121 16811 5021 p 2 18 3315 267 18553 4985 p 2 3 3214 383 19034 4831 p 2 2 3112 486 12132 4286 p 2 7 3340 253 20322 5162 p 2 0 3376 224 18524 5040 p 2 1 3364 235 18552 5100 p 2 0 2947 653 9368 3786 p 2 38 3217 345 29708 6221 p 2 21 3265 314 28358 6240 p 2 2 3180 418 18854 5034 p 2 0 3275 325 17539 4773 p 2 1 3003 596 11669 4084 p 2 1 2994 605 11846 4124 p 2 0 3001 599 12207 4143 p 2 2 3262 336 21893 5128 p 2 0 3172 428 12634 4292 p 2 0 3185 415 14409 4456 p 2 10 3289 301 16645 4770 p 2 2 3241 357 14926 4529 p 2 0 3191 409 19254 4950 p 2 6 3253 341 21654 5301 p 2 4 3145 451 16771 4679 p 2 30 3273 297 29418 6376 p 2 23 3094 483 26392 5847 p 2 1 3108 491 16996 4759 p 2 5 3277 318 24186 5585 p 2 0 3196 404 17358 4724 p 2 4 3230 366 14011 4562 p 2 0 3308 292 14365 4582 p 2 1 3314 285 25411 5884 p 2 33 3263 304 26075 5907 p 2 0 3049 551 14303 4155 p 2 0 3230 370 12879 4383 p 2 3 3160 437 14624 4670 p 2 1 3148 451 17284 4753 p 2 0 3151 449 16759 4681 p 2 0 3162 438 12714 4435 p 2 6 3377 217 27928 6080 p 2 47 3225 328 30098 6276 p 2 3 3120 477 21416 5189 p 2 0 2984 616 11469 4060 i 2 3600 0 0 58745 12411 p 2 17 3014 569 16641 4309 p 2 50 2584 966 11478 3320 p 2 0 2739 861 10427 3186 p 2 43 2266 1291 8547 2971 p 2 0 2758 842 10925 3183 p 2 0 2043 1557 6678 2476 p 2 30 2572 998 12601 3200 p 2 0 2390 1210 8253 2808 p 2 0 2999 601 12710 3424 p 2 0 1837 1763 5514 2238 p 2 12 2392 1196 10728 2956 p 2 0 2293 1307 7306 2772 p 2 0 2466 1134 9653 2877 p 2 44 2019 1537 7274 2731 p 2 0 2483 1117 9943 2910 p 2 0 2198 1402 9038 2621 p 2 30 2293 1277 10314 2820 p 2 0 2094 1506 9181 2499 p 2 0 2212 1388 8897 2602 p 2 12 2230 1358 10801 2800 p 2 0 2862 738 12798 3336 p 2 0 1747 1853 5239 2152 p 2 14 2339 1247 11006 2903 p 2 0 1850 1750 7825 2255 p 2 0 2437 1163 9661 2827 p 2 21 2143 1436 9322 2687 p 2 0 2410 1190 9887 2827 p 2 0 1835 1765 5523 2249 p 2 0 1740 1860 6323 2215 p 2 0 1962 1638 7660 2363 p 2 0 1752 1848 5555 2185 p 2 0 2065 1535 8611 2503 p 2 0 2136 1464 7888 2505 p 2 0 2086 1514 6646 2549 p 2 0 1975 1625 8472 2389 i 2 3600 0 0 130787 15560 p 2 0 3563 37 26860 4932 p 2 0 3486 114 18917 4765 p 2 0 3448 152 15975 4632 p 2 0 3290 310 13129 4252 p 2 0 3439 161 17335 4546 p 2 0 3246 354 13415 4057 p 2 0 2817 783 10485 3500 p 2 0 3230 370 12685 4217 p 2 0 3462 138 18764 4632 p 2 0 3131 469 12795 4006 p 2 0 2566 1034 8805 3265 p 2 0 3020 580 11430 3857 p 2 0 2989 611 10778 3753 p 2 0 3056 544 11589 3855 p 2 0 3038 562 10894 3782 p 2 0 3119 481 12268 3966 p 2 0 3189 411 13291 4061 p 2 0 3051 549 11386 3808 p 2 0 3292 308 14706 4232 p 2 0 2909 691 10685 3606 p 2 0 3313 287 14199 4296 p 2 0 3250 350 14037 4181 p 2 0 2783 817 10229 3405 p 2 0 2690 910 9663 3311 p 2 0 2772 828 9605 3381 p 2 0 2745 855 9775 3404 p 2 0 2626 974 8871 3225 p 2 0 2704 896 8936 3290 p 2 0 2718 882 9203 3340 p 2 0 2998 602 11149 3677 p 2 0 2654 946 8842 3262 p 2 0 3139 461 11543 4016 p 2 0 3477 123 18948 4706 p 2 0 3255 345 14196 4175 p 2 0 2919 681 10490 3632 p 2 0 3162 438 12694 3946 p 2 0 2769 831 9764 3340 p 2 0 2947 653 10821 3602 p 2 0 2789 811 9977 3418 p 2 0 2716 884 9481 3315 p 2 0 2698 902 9399 3275 p 2 0 2788 812 9938 3407 p 2 0 2881 719 10293 3524 p 2 0 3074 526 11586 3920 p 2 0 3468 132 20528 4643 p 2 0 3557 43 36772 5801 i 2 3600 0 0 95756 13026 p 2 0 3087 513 9041 3735 p 2 0 3424 176 15100 4323 p 2 0 2982 618 8658 3564 p 2 0 3152 448 10497 3760 p 2 0 2775 825 7974 3258 p 2 0 3091 509 10639 3670 p 2 0 2185 1415 5364 2563 p 2 16 3133 451 14834 3942 p 2 0 3272 328 10863 3978 p 2 0 3029 571 10393 3614 p 2 164 3117 319 28819 4899 p 2 0 3108 492 10722 3716 p 2 0 2952 648 9435 3548 p 2 361 2898 341 36942 5756 p 2 0 3019 581 11657 3664 p 2 0 3024 576 10114 3546 p 2 569 2540 491 44136 6384 p 2 1 2962 637 10767 3608 p 2 0 2667 933 8653 3224 p 2 680 2216 704 45103 6484 p 2 0 3014 586 10828 3760 p 2 0 3024 576 12169 3788 p 2 645 2595 360 52096 7075 p 2 0 2542 1058 6982 3079 p 2 0 2597 1003 7362 3097 p 2 625 2551 424 58570 7133 p 2 0 3025 575 12221 3788 p 2 610 2708 282 60976 7403 p 2 0 2661 939 8240 3263 p 2 0 2985 615 10571 3634 p 2 0 2545 1055 7585 3071 p 2 632 2561 407 62760 7331 p 2 0 3195 405 12638 4067 p 2 0 3234 366 13132 4030 p 2 583 2818 199 63949 7581 p 2 0 3200 400 12839 4029 p 2 0 2562 1038 7547 3084 p 2 597 2694 309 59062 7254 p 2 0 3127 473 12673 3975 p 2 0 3147 453 12089 3911 p 2 629 2562 409 53828 7076 p 2 0 3254 346 14154 4178 p 2 0 3007 593 11117 3727 p 2 685 2649 266 75699 8263 p 2 0 3301 299 14061 4264 p 2 0 3271 329 13364 4059 p 2 448 2992 160 58700 7082 p 2 0 3244 356 14045 4115 p 2 0 3164 436 11466 3917 p 2 243 3001 356 44235 5716 p 2 0 3040 560 11613 3755 p 2 0 3237 363 11961 3989 p 2 46 3065 489 13682 4017 p 2 0 3094 506 10440 3756 p 2 0 3094 506 9956 3704 p 2 0 3225 375 12330 3935 p 2 0 2922 678 8504 3457 p 2 0 3119 481 10565 3759 p 2 0 3032 568 9892 3582 p 2 0 2895 705 8856 3398 p 2 0 2692 908 7438 3152 p 2 0 2680 920 7454 3135 p 2 0 2677 923 7223 3096 p 2 0 2478 1122 6470 2928 p 2 69 2832 699 37431 4711 p 2 0 2823 777 9101 3354 p 2 0 2579 1021 7714 3049 p 2 5 2652 943 30392 3947 p 2 0 2876 724 10874 3518 p 2 0 2975 625 10420 3548 p 2 1 3118 481 27423 4221 p 2 0 2404 1196 6921 2849 p 2 0 3009 591 10964 3652 p 2 2 3023 575 28807 4268 p 2 0 2772 828 8428 3319 p 2 0 2714 886 8352 3248 p 2 0 2681 919 8147 3180 p 2 0 2675 925 7759 3142 p 2 0 2565 1035 7090 3021 p 2 0 2921 679 9405 3479 p 2 0 2621 979 7404 3070 p 2 0 3011 589 9847 3603 p 2 0 2933 667 9353 3462 p 2 0 2554 1046 6894 2978 p 2 0 2490 1110 6701 2884 p 2 0 2631 969 7714 3078 p 2 0 2502 1098 6639 2898 p 2 0 2250 1350 5664 2649 p 2 0 2593 1007 6735 3027 p 2 0 2547 1053 6871 2993 p 2 0 2578 1022 6640 3007 p 2 0 2760 840 7619 3189 i 2 3600 0 0 43250 11613 p 2 0 3549 51 18683 5251 p 2 0 3279 321 9917 4050 p 2 0 3092 508 9264 3835 p 2 0 2961 639 7722 3555 p 2 0 2966 634 8065 3562 p 2 0 2757 843 7480 3331 p 2 0 2760 840 7596 3309 p 2 0 2688 912 7243 3243 p 2 0 2688 912 7206 3228 p 2 0 2541 1059 6465 3036 p 2 0 2724 876 7429 3242 p 2 0 2131 1469 5191 2537 p 2 0 2915 685 8199 3571 p 2 0 2866 734 7767 3485 p 2 0 2643 957 6708 3189 p 2 0 2791 809 7666 3396 p 2 0 2726 874 7202 3276 p 2 0 2459 1141 6269 2980 p 2 0 2566 1034 6422 3062 p 2 0 2586 1014 6648 3111 p 2 0 2439 1161 6146 2946 p 2 0 2375 1225 6147 2863 p 2 0 2655 945 6980 3185 p 2 0 2316 1284 6001 2789 p 2 0 2820 780 7826 3402 p 2 0 2661 939 7135 3235 p 2 0 2581 1019 6694 3103 p 2 0 2678 922 6569 3222 p 2 0 2656 944 7162 3181 p 2 0 2346 1254 5967 2853 p 2 0 2694 906 7024 3181 p 2 0 2410 1190 6253 2886 p 2 0 2401 1199 6137 2882 p 2 0 2363 1237 5945 2873 p 2 0 2476 1124 6309 2959 p 2 0 2389 1211 5670 2845 p 2 0 2883 717 7746 3473 p 2 0 2806 794 7436 3399 p 2 0 2542 1058 6521 3083 i 2 3600 0 0 73466 13034 p 2 0 3180 420 11473 3855 p 2 1 3428 171 17857 4490 p 2 0 2963 637 10139 3661 p 2 0 3087 513 14595 3880 p 2 0 2798 802 9632 3377 p 2 0 2793 807 12110 3467 p 2 0 2821 779 13867 3532 p 2 2 3085 513 28083 4487 p 2 0 2623 977 8884 3224 p 2 1 2991 608 14192 3706 p 2 0 2549 1051 8402 3083 p 2 2 2972 626 28885 4356 p 2 0 2903 697 10292 3576 p 2 0 2547 1053 11389 3203 p 2 3 2924 673 27561 4274 p 2 1 2821 778 15482 3641 p 2 0 2793 807 10999 3493 p 2 3 2895 702 29034 4316 p 2 0 2892 708 14230 3694 p 2 0 2670 930 9622 3259 p 2 0 2399 1201 7935 2878 p 2 0 2814 786 12433 3444 p 2 0 2774 826 9144 3335 p 2 0 2730 870 9549 3250 p 2 0 2485 1115 7715 2960 p 2 1 2374 1225 10688 2961 p 2 0 2423 1177 7633 2944 p 2 0 2336 1264 11305 2912 p 2 0 2306 1294 7312 2785 p 2 0 2402 1198 10384 2998 p 2 0 2548 1052 12256 3218 p 2 2 2862 736 25405 4147 p 2 0 2463 1137 8040 2990 p 2 1 2767 832 13159 3434 p 2 0 2430 1170 8044 2933 p 2 2 2797 801 30267 4254 p 2 0 2712 888 9954 3332 p 2 0 2469 1131 11147 3122 p 2 1 2755 844 26103 4122 p 2 0 2748 852 14877 3539 p 2 0 2590 1010 9637 3174 p 2 2 2703 895 28883 4082 p 2 0 2749 851 13577 3477 p 2 0 2595 1005 9227 3138 p 2 0 2393 1207 7539 2858 p 2 0 2643 957 11852 3247 p 2 0 2579 1021 8619 3135 p 2 0 2508 1092 8619 3013 p 2 0 2312 1288 7344 2771 p 2 1 2296 1303 10822 2902 p 2 0 2316 1284 7690 2818 p 2 0 2348 1252 10908 2961 p 2 0 2190 1410 7076 2667 p 2 0 2273 1327 10523 2852 p 2 0 2385 1215 7721 2873 p 2 0 2619 981 12847 3288 p 2 0 2355 1245 7918 2835 p 2 1 2672 927 12273 3312 p 2 0 2051 1549 6356 2495 p 2 0 2398 1202 10939 2950 p 2 0 2223 1377 7073 2672 p 2 0 2176 1424 10141 2761 p 2 0 2299 1301 7191 2774 p 2 0 2232 1368 11974 2850 p 2 0 2199 1401 7407 2669 p 2 0 2110 1490 9073 2678 p 2 0 2102 1498 6666 2565 p 2 0 2418 1182 10735 2963 p 2 0 2314 1286 7340 2802 p 2 0 2635 965 10889 3175 p 2 0 2421 1179 8246 2950 p 2 0 2415 1185 8611 2922 p 2 0 2226 1374 7013 2681 p 2 1 2135 1464 10759 2747 p 2 0 2157 1443 7153 2628 p 2 0 2280 1320 10473 2843 p 2 0 2074 1526 6596 2526 p 2 0 2253 1347 10550 2836 p 2 0 2465 1135 12262 3069 p 2 0 1910 1690 6284 2340 p 2 0 2627 973 8348 3120 p 2 0 3091 509 15116 4071 i 2 3600 0 0 55390 12543 p 2 0 2912 688 8234 3446 p 2 0 3041 559 8328 3590 p 2 0 2380 1220 6892 2882 p 2 0 2423 1177 6083 2845 p 2 0 2415 1185 6681 2833 p 2 0 2133 1467 5339 2568 p 2 0 2158 1442 5600 2596 p 2 0 2214 1386 6396 2700 p 2 0 2371 1229 6272 2880 p 2 0 1769 1831 5308 2239 p 2 0 2443 1157 7187 3012 p 2 0 2357 1243 5931 2821 p 2 0 2213 1387 5953 2728 p 2 0 2262 1338 5697 2747 p 2 0 2048 1552 5372 2510 p 2 0 2125 1475 5476 2594 p 2 0 1994 1606 5057 2467 p 2 0 2094 1506 5089 2523 p 2 0 2118 1482 5322 2551 p 2 0 2237 1363 5913 2704 p 2 0 1930 1670 4984 2377 p 2 0 1575 2025 4076 1990 p 2 0 2270 1330 5877 2733 p 2 0 2395 1205 5715 2830 p 2 0 2166 1434 5367 2619 p 2 0 1761 1839 4432 2187 p 2 0 1781 1819 4494 2228 p 2 0 1718 1882 4514 2176 p 2 0 1907 1693 4720 2369 p 2 0 1835 1765 4343 2280 p 2 0 1917 1683 4731 2351 p 2 0 1866 1734 4389 2278 p 2 0 1964 1636 4837 2405 p 2 0 1787 1813 4451 2228 p 2 0 2255 1345 6355 2733 p 2 0 1867 1733 4658 2315 p 2 0 3153 447 30836 5434 p 2 0 2533 1067 9323 3285 p 2 0 2060 1540 6247 2608 p 2 0 2572 1028 8027 3146 p 2 1 3117 482 30002 5283 p 2 0 2798 802 10111 3614 p 2 0 2419 1181 7806 2995 p 2 0 3120 480 30033 5379 p 2 0 2758 842 11003 3593 p 2 0 2554 1046 8989 3258 p 2 1 3138 461 30459 5381 p 2 0 2711 889 9974 3518 p 2 0 2196 1404 6305 2698 p 2 0 2562 1038 7575 3111 p 2 0 2376 1224 6782 2883 p 2 0 2380 1220 6689 2941 p 2 0 2218 1382 6233 2734 p 2 0 2099 1501 5574 2581 p 2 0 2067 1533 5852 2555 p 2 0 2468 1132 6939 3009 p 2 0 2160 1440 5607 2621 p 2 0 2399 1201 7084 2960 p 2 0 2252 1348 6101 2786 p 2 0 2228 1372 6159 2711 p 2 0 1974 1626 5562 2495 p 2 0 1936 1664 4941 2400 p 2 0 2398 1202 7036 3010 i 2 3600 0 0 50713 11731 p 2 0 3230 370 12332 3941 p 2 0 2857 743 10158 3348 p 2 0 2498 1102 6914 2950 p 2 0 2595 1005 7538 3069 p 2 0 2681 919 8608 3037 p 2 0 2257 1343 5724 2571 p 2 0 2690 910 7566 3108 p 2 0 2576 1024 9086 2986 p 2 0 2520 1080 8262 2915 p 2 0 2087 1513 7651 2520 p 2 0 2398 1202 7907 2769 p 2 0 2299 1301 7240 2679 p 2 0 1966 1634 6923 2244 p 2 0 2123 1477 6147 2430 p 2 0 2473 1127 7933 2765 p 2 0 2244 1356 7491 2612 p 2 0 2434 1166 8390 2802 p 2 0 2438 1162 8933 2951 p 2 0 2304 1296 6062 2740 p 2 0 1763 1837 4022 2104 p 2 0 2285 1315 5455 2665 p 2 0 2437 1163 7896 2806 p 2 0 2399 1201 5167 2737 p 2 0 1997 1603 4776 2392 p 2 0 2401 1199 7836 2727 p 2 0 2353 1247 7619 2683 p 2 0 2270 1330 5464 2603 p 2 0 2421 1179 7486 2761 p 2 0 2196 1404 6930 2527 p 2 0 2308 1292 6036 2716 p 2 0 2280 1320 7569 2696 p 2 0 2254 1346 6714 2610 p 2 0 2248 1352 7140 2642 p 2 0 2251 1349 5513 2615 p 2 179 2422 999 14966 3802 p 2 0 2354 1246 8922 2857 p 2 0 2475 1125 6613 2880 p 2 172 2483 945 13651 3906 p 2 0 2504 1096 8157 2966 p 2 122 2614 864 15973 3909 p 2 0 2485 1115 6822 3053 p 2 0 2532 1068 9088 3073 p 2 0 2289 1311 6131 2614 p 2 24 2589 987 15964 3514 p 2 0 2468 1132 8689 2961 p 2 0 2359 1241 7543 2849 p 2 3 2624 973 14730 3404 p 2 0 2168 1432 8183 2683 p 2 0 2732 868 8019 3066 p 2 82 2769 749 16177 3932 p 2 0 2409 1191 5901 2854 p 2 0 2451 1149 6658 2832 p 2 95 2703 802 16148 3836 p 2 0 2571 1029 7631 3047 p 2 0 2597 1003 6032 2968 p 2 224 2683 693 16833 4424 p 2 0 2614 986 7560 3149 p 2 0 2301 1299 5561 2616 p 2 182 2600 818 15343 4226 p 2 0 2530 1070 6691 2978 p 2 0 2806 794 6184 3083 p 2 210 2518 872 13258 4193 p 2 0 2904 696 6809 3259 p 2 0 2442 1158 5092 2786 p 2 117 2675 808 9319 3658 p 2 0 2462 1138 5529 2896 p 2 0 2792 808 4952 3036 p 2 4 2863 733 9649 3540 p 2 0 2581 1019 5283 2994 p 2 0 2350 1250 5062 2720 p 2 0 2614 986 8462 3188 p 2 0 2462 1138 5075 2763 p 2 37 2764 799 8508 3477 p 2 0 2069 1531 4641 2411 p 2 0 2491 1109 4172 2694 p 2 0 2497 1103 9048 3081 p 2 0 2458 1142 5105 2774 p 2 0 2153 1447 4462 2514 p 2 0 2475 1125 4584 2707 p 2 0 2313 1287 4177 2511 p 2 0 2270 1330 4543 2522 p 2 0 2251 1349 4745 2463 p 2 0 2155 1445 4190 2390 p 2 0 2051 1549 3789 2272 p 2 0 2237 1363 4249 2463 p 2 0 2135 1465 3897 2389 p 2 0 2435 1165 4454 2532 i 2 3600 0 0 156515 14956 p 2 10 3590 0 50683 6501 p 2 0 3060 540 14959 4034 p 2 0 3366 234 24999 4630 p 2 0 2973 627 21255 4016 p 2 0 3219 381 23842 4472 p 2 0 3042 558 21482 4142 p 2 0 2986 614 21867 4022 p 2 0 3198 402 24429 4362 p 2 0 3212 388 23940 4411 p 2 0 3119 481 22775 4253 p 2 0 3067 533 21791 4131 p 2 0 3150 450 24019 4251 p 2 0 3358 242 24880 4662 p 2 0 3175 425 23451 4390 p 2 0 3356 244 27635 4637 p 2 0 3164 436 24033 4290 p 2 0 3211 389 24591 4417 p 2 0 3142 458 24189 4322 p 2 0 3144 456 23859 4192 p 2 0 3084 516 23796 4132 p 2 0 3114 486 22358 4132 p 2 0 3035 565 22819 4027 p 2 0 3119 481 22344 4067 p 2 0 2920 680 21648 3857 p 2 0 3335 265 24154 4511 p 2 0 3063 537 22786 4097 p 2 0 3385 215 26495 4543 p 2 0 3186 414 23845 4267 p 2 0 3152 448 22221 4101 p 2 0 2967 633 21101 3896 p 2 0 3040 560 21248 3918 p 2 0 2957 643 22097 3882 p 2 0 3090 510 21646 3983 p 2 0 2808 792 20490 3688 p 2 0 2995 605 21111 3827 p 2 1 3022 577 22543 4017 p 2 5 3299 296 28235 4760 p 2 0 3471 129 31759 5057 p 2 1 3504 95 32413 5017 p 2 0 3477 123 32534 5197 p 2 0 3385 215 28512 4734 p 2 0 3271 329 28797 4830 p 2 0 3243 357 27580 4565 p 2 2 3338 260 30853 4999 p 2 0 3194 406 27463 4565 p 2 1 3349 250 29984 4987 p 2 3 3278 319 27602 4656 p 2 2 3340 258 29761 4906 p 2 0 3421 179 28937 5022 p 2 0 3483 117 31149 5270 p 2 1 3507 92 32982 5132 p 2 0 3415 185 29364 4919 p 2 0 3220 380 24772 4435 p 2 0 3343 257 27041 4722 p 2 2 3117 481 23866 4265 p 2 0 3202 398 24819 4372 p 2 0 3077 523 23530 4237 p 2 0 3135 465 23833 4335 p 2 0 3024 576 22275 4134 p 2 0 3035 565 23102 4141 p 2 0 3311 289 24445 4695 p 2 0 2797 803 21006 3857 p 2 0 3369 231 31656 4786 p 2 0 3217 383 25568 4399 p 2 0 3182 418 23575 4386 p 2 0 3175 425 23332 4370 p 2 0 3030 570 22919 4080 p 2 0 2982 618 21832 3966 p 2 0 2776 824 20700 3790 p 2 0 2940 660 22062 3973 p 2 216 3316 68 181634 7353 p 2 0 3259 341 30790 4520 p 2 0 3358 242 30530 4703 p 2 0 3271 329 27872 4529 p 2 0 2972 628 22238 3962 p 2 0 3341 259 33778 4624 p 2 0 3054 546 23289 4008 p 2 0 2794 806 21152 3664 p 2 0 2952 648 21331 3906 p 2 0 2634 966 20205 3429 p 2 0 2880 720 22968 3785 p 2 0 2504 1096 19519 3312 p 2 0 2405 1195 18410 3213 p 2 0 2966 634 25263 3903 p 2 0 2882 718 22443 3753 p 2 0 3278 322 25835 4485 p 2 0 3336 264 26663 4612 p 2 1 3331 268 30372 4571 p 2 0 3232 368 24783 4304 p 2 0 3308 292 26077 4464 p 2 0 3279 321 24334 4392 p 2 0 2945 655 21873 3843 p 2 0 3280 320 25031 4354 p 2 0 2990 610 21704 3937 p 2 0 3113 487 22875 4128 p 2 0 3060 540 22684 3963 p 2 0 3166 434 23664 4162 p 2 0 3260 340 23965 4395 p 2 0 3282 318 23863 4402 p 2 0 3318 282 27809 4490 p 2 0 3210 390 23473 4232 p 2 0 3161 439 22745 4161 p 2 0 3146 454 22197 4137 p 2 0 2876 724 20150 3691 p 2 0 3287 313 24380 4347 p 2 0 3097 503 21581 4051 p 2 0 3104 496 22155 4041 p 2 0 3075 525 21529 3955 p 2 0 3154 446 21634 4085 p 2 0 3197 403 21702 4260 p 2 0 3255 345 23181 4270 p 2 0 3273 327 26636 4347 p 2 0 3211 389 22346 4187 p 2 0 3085 515 21582 4009 p 2 0 3163 437 21811 4118 p 2 0 2880 720 19742 3680 p 2 0 3171 429 22032 4067 p 2 0 2788 812 19421 3637 p 2 0 3126 474 22435 4051 p 2 0 3037 563 21773 3888 p 2 0 3102 498 21783 3972 p 2 0 3111 489 22393 4079 p 2 0 2831 769 20065 3686 p 2 4 3484 112 32606 5034 p 2 1 3434 165 30775 4963 p 2 0 3453 147 31038 5132 p 2 0 3399 201 28100 4781 p 2 0 3328 272 29080 4911 p 2 0 3420 180 28919 4783 p 2 1 3269 330 28560 4875 p 2 1 3368 231 28954 4750 p 2 0 3416 184 28653 4963 p 2 2 3424 174 29143 4801 p 2 1 3508 91 30561 5281 p 2 0 3501 99 29963 5103 p 2 0 3512 88 36848 5215 p 2 0 3458 142 29722 4860 p 2 0 3411 189 27941 4866 p 2 0 3411 189 26816 4774 p 2 2 3239 359 24849 4431 p 2 0 3433 167 29354 4792 p 2 0 3277 323 24198 4496 p 2 0 3264 336 25412 4453 p 2 0 3304 296 26634 4483 p 2 0 3370 230 26941 4654 p 2 1 3344 255 25388 4669 p 2 0 3363 237 26092 4666 p 2 1 3425 174 32978 4836 p 2 0 3309 291 26939 4554 p 2 0 3252 348 24886 4458 p 2 0 3231 369 24151 4429 p 2 0 3040 560 22426 4026 p 2 1 3331 268 27740 4569 p 2 0 3291 309 25960 4458 p 2 0 3275 325 24823 4459 p 2 0 3148 452 24534 4216 p 2 0 3309 291 27921 4559 p 2 0 3313 287 25916 4575 p 2 0 3286 314 26751 4588 p 2 0 3395 205 32494 4763 p 2 0 3287 313 27068 4513 p 2 0 3296 304 25004 4511 p 2 0 3280 320 24381 4490 p 2 0 2935 665 21379 3886 p 2 0 3230 370 25137 4375 p 2 0 2937 663 21604 3938 p 2 0 3122 478 23772 4214 p 2 0 2923 677 21628 3892 p 2 0 3155 445 24233 4251 p 2 0 3265 335 24854 4507 p 2 0 3313 287 25601 4579 p 2 0 3342 258 31114 4641 p 2 0 3286 314 26072 4486 p 2 0 3193 407 24025 4333 p 2 0 3298 302 25359 4502 p 2 0 3030 570 22264 4033 p 2 0 3229 371 25313 4347 p 2 0 3035 565 22214 4020 i 2 3600 0 0 88078 13955 p 2 0 3564 36 24302 5143 p 2 0 3424 176 16681 4869 p 2 0 3531 69 18919 5171 p 2 0 3474 126 17206 5068 p 2 2 3449 149 16684 4833 p 2 0 3392 208 15255 4771 p 2 0 3447 153 16153 4914 p 2 0 3396 204 16728 4899 p 2 0 3241 359 13705 4514 p 2 0 3352 248 15091 4767 p 2 0 3367 233 16656 4765 p 2 0 3350 250 16134 4847 p 2 0 3235 365 13767 4430 p 2 0 3304 296 15792 4677 p 2 0 3400 200 16922 4865 p 2 0 3340 260 16376 4825 p 2 0 3367 233 15970 4687 p 2 0 3265 335 15534 4718 p 2 0 3302 298 15559 4675 p 2 2 3260 338 16124 4733 p 2 0 3157 443 13776 4399 p 2 0 3294 306 15171 4745 p 2 0 3312 288 16057 4825 p 2 0 3311 289 16732 4962 p 2 0 3125 475 14120 4452 p 2 0 3250 350 17133 5010 p 2 0 3391 209 17063 5208 p 2 0 3314 286 16844 5071 p 2 0 3316 284 17862 5028 p 2 1 3287 312 16763 4990 p 2 0 3194 406 15112 4571 p 2 0 3268 332 15521 4796 p 2 0 3154 446 12963 4318 p 2 0 3293 307 14450 4760 p 2 0 3275 325 14867 4671 p 2 0 3268 332 15122 4805 p 2 0 3246 354 15143 4601 p 2 0 3280 320 19254 5151 p 2 1 3256 343 21176 5159 p 2 2 3199 399 20318 5430 i 2 3600 0 0 95766 14397 p 2 0 3541 59 20824 5052 p 2 2 3450 148 20044 5066 p 2 0 3433 167 19061 4987 p 2 0 3272 328 16704 4593 p 2 2 3396 202 17992 4875 p 2 6 3424 170 20393 5128 p 2 0 3372 228 18975 4945 p 2 2 3254 344 17497 4751 p 2 4 3299 297 18628 4720 p 2 0 3455 145 21158 5232 p 2 0 3411 189 20754 5056 p 2 2 3432 166 20302 5075 p 2 4 3358 238 19318 4839 p 2 1 3413 186 20333 5089 p 2 0 3396 204 19334 4941 p 2 1 3239 360 17100 4697 p 2 0 3323 277 17661 4711 p 2 1 3242 357 18122 4840 p 2 0 3311 289 18169 4800 p 2 0 3142 458 16496 4610 p 2 0 3230 370 17526 4792 p 2 0 3345 255 19159 5070 p 2 0 3224 376 17787 4879 p 2 0 3353 247 19149 4862 p 2 0 3341 259 19001 4967 p 2 0 3336 264 20060 5112 p 2 0 3384 216 20256 5137 p 2 0 3221 379 16203 4682 p 2 0 3191 409 15858 4442 p 2 0 3212 388 15345 4641 p 2 0 3212 388 15557 4551 p 2 0 3076 524 14395 4359 p 2 0 3138 462 14127 4358 p 2 0 3323 277 17622 4908 p 2 0 3217 383 15879 4549 p 2 0 3328 272 16468 4764 p 2 0 3266 334 16349 4675 p 2 0 3305 295 20388 5191 p 2 4 3351 245 23887 5315 p 2 2 3331 267 23500 5539 p 2 0 3377 223 22885 5453 p 2 0 3309 291 22704 5627 p 2 1 3334 265 21616 5447 p 2 1 3206 393 18685 4977 p 2 6 3093 501 19388 4924 p 2 2 3340 258 20930 5180 p 2 2 3312 286 21692 5294 p 2 1 3380 219 18627 4943 p 2 1 3385 214 19185 5177 p 2 0 3361 239 19617 5104 p 2 0 3348 252 20152 5133 p 2 1 3198 401 17922 4842 p 2 10 3318 272 21929 5251 p 2 0 3198 402 21238 5194 p 2 5 3304 291 24118 5548 p 2 4 3160 436 22104 5205 p 2 15 3266 319 24625 5543 p 2 1 3359 240 22344 5427 p 2 6 3337 257 23344 5635 p 2 3 3414 183 25018 5661 p 2 14 3388 198 25150 5956 p 2 1 3393 206 27050 5924 p 2 1 3355 244 26144 5838 p 2 13 3202 385 24890 5514 p 2 14 3391 195 27138 6047 p 2 9 3270 321 23693 5466 p 2 6 3265 329 24945 5582 p 2 6 3188 406 23129 5156 p 2 35 3178 387 24682 5666 i 2 3600 0 0 97555 14529 p 2 1 3575 24 28138 5868 p 2 0 3357 243 18051 4830 p 2 0 3364 236 18577 4806 p 2 0 3354 246 19140 4923 p 2 0 3438 162 19967 5013 p 2 0 3249 351 17514 4681 p 2 0 3383 217 19627 4872 p 2 0 3370 230 20997 5098 p 2 0 3353 247 20327 4939 p 2 2 3211 387 18319 4681 p 2 1 3291 308 19117 4736 p 2 1 3391 208 20901 5074 p 2 0 3352 248 20645 4950 p 2 0 3343 257 18583 4837 p 2 0 3301 299 18478 4689 p 2 0 3319 281 19018 4920 p 2 1 3327 272 19304 4918 p 2 0 3182 418 18297 4715 p 2 0 3287 313 19113 4821 p 2 0 3315 285 20698 5081 p 2 0 3311 289 20561 5146 p 2 3 3240 357 17601 4845 p 2 1 3214 385 17950 4791 p 2 0 3348 252 20679 5099 p 2 0 3219 381 19142 4837 p 2 0 3362 238 20535 5139 p 2 0 3310 290 18517 4812 p 2 0 3354 246 17992 5009 p 2 0 3287 313 17038 4679 p 2 0 3091 509 13356 4299 p 2 0 3229 371 15766 4454 p 2 0 3242 358 15487 4606 p 2 0 3255 345 16174 4574 p 2 0 3157 443 15150 4565 p 2 0 2973 627 13757 4080 p 2 0 3274 326 18179 4912 p 2 0 3242 358 18078 4767 p 2 0 3417 183 22125 5463 p 2 8 3334 258 24139 5371 p 2 3 3345 252 25093 5753 p 2 0 3352 248 25120 5638 p 2 0 3299 301 21656 5383 p 2 1 3314 285 21759 5292 p 2 3 3245 352 20513 5048 p 2 8 3194 398 21346 5212 p 2 1 3123 476 18467 4728 p 2 2 3208 390 20240 5162 p 2 0 3384 216 20808 5245 p 2 3 3264 333 19143 5118 p 2 0 3433 167 21374 5267 p 2 0 3416 184 21301 5146 i 2 3600 0 0 146360 14184 p 2 1 3589 10 29556 5414 p 2 0 3360 240 16165 4302 p 2 0 3482 118 20927 4642 p 2 0 3273 327 14917 4183 p 2 0 3193 407 15049 4059 p 2 0 3187 413 15257 4048 p 2 3 3409 188 21783 4519 p 2 0 3419 181 19388 4593 p 2 0 3076 524 14764 3958 p 2 0 3438 162 19539 4498 p 2 0 3373 227 18188 4429 p 2 0 3404 196 19271 4584 p 2 1 3332 267 19593 4450 p 2 0 3247 353 15162 4151 p 2 0 3351 249 18958 4380 p 2 0 3280 320 21130 4364 p 2 0 3122 478 14871 3967 p 2 0 2910 690 14716 3686 p 2 0 3029 571 14999 3916 p 2 1 3365 234 19352 4612 p 2 1 3167 432 17643 4254 p 2 2 3368 230 19309 4533 p 2 0 3276 324 16387 4246 p 2 0 3181 419 15030 4130 p 2 0 3272 328 18899 4443 p 2 0 3035 565 14129 3946 p 2 0 3171 429 16992 4219 p 2 0 3109 491 17211 4099 p 2 1 3121 478 16690 4155 p 2 0 2967 633 13171 3820 p 2 0 3020 580 14328 3915 p 2 0 3271 329 19660 4397 p 2 0 3297 303 21119 4499 p 2 0 3361 239 19650 4519 p 2 0 3294 306 18961 4416 p 2 0 3167 433 18594 4263 p 2 3 3204 393 19638 4331 p 2 0 3068 532 19140 4275 p 2 2 3235 363 25069 4644 p 2 0 3195 405 20924 4557 p 2 0 3131 469 19129 4342 p 2 0 3068 532 18475 4312 p 2 0 3100 500 18567 4277 p 2 0 3315 285 21365 4713 p 2 1 3279 320 26740 5014 p 2 0 3452 148 24066 4792 p 2 0 3366 234 21065 4667 p 2 0 3400 200 19799 4697 p 2 0 3339 261 19392 4561 p 2 0 3150 450 16532 4227 p 2 0 3319 281 23116 4665 p 2 0 3259 341 23512 4668 p 2 0 3202 398 23325 4593 p 2 0 3101 499 17058 4126 p 2 0 3179 421 19012 4317 p 2 4 3368 228 24364 4897 p 2 0 3222 378 20255 4540 p 2 0 3392 208 19501 4557 p 2 0 3357 243 20715 4601 p 2 0 3329 271 21702 4645 p 2 0 3385 215 24177 4806 p 2 0 3092 508 17563 4124 p 2 0 3270 330 19529 4390 p 2 0 3221 379 19976 4373 p 2 0 3130 470 20662 4321 p 2 0 3011 589 16650 3981 p 2 0 3082 518 19245 4191 p 2 0 3343 257 20711 4616 p 2 0 3227 373 20381 4432 p 2 0 3373 227 21680 4584 p 2 0 3401 199 23813 4669 p 2 0 3351 249 23364 4676 p 2 0 3277 323 21712 4494 p 2 0 3107 493 17723 4114 p 2 1 3260 339 22909 4501 p 2 0 3209 391 19624 4277 p 2 0 3252 348 20790 4384 p 2 0 3101 499 18892 4086 p 2 0 3146 454 22673 4381 p 2 0 3336 264 24382 4705 p 2 1 3190 409 21663 4343 p 2 0 3413 187 23561 4611 p 2 0 3360 240 22222 4532 p 2 0 3396 204 22169 4548 p 2 0 3331 269 22067 4473 p 2 0 3157 443 17049 4092 p 2 0 3290 310 19704 4382 p 2 0 3229 371 18457 4250 p 2 0 3222 378 18872 4237 p 2 0 3154 446 17639 4155 p 2 0 3191 409 18101 4181 p 2 0 3361 239 22030 4634 p 2 0 3206 394 20557 4400 p 2 0 3394 206 23805 4655 p 2 0 3322 278 20029 4463 p 2 0 3345 255 21059 4504 p 2 0 3381 219 23256 4551 p 2 0 3182 418 17809 4129 p 2 0 3309 291 20954 4363 p 2 0 3313 287 22626 4530 p 2 0 3239 361 22163 4452 p 2 0 3152 448 19244 4231 p 2 0 3273 327 20255 4399 p 2 2 3352 246 27409 4819 p 2 0 3292 308 23049 4600 p 2 0 3447 153 25436 4685 p 2 1 3396 203 22953 4520 p 2 0 3359 241 20023 4433 i 2 3600 0 0 114390 15740 p 2 29 3547 24 34163 6040 p 2 0 3414 186 18474 4620 p 2 0 3169 431 14368 4149 p 2 0 3130 470 14692 4056 p 2 0 3046 554 12858 3901 p 2 0 3059 541 13279 4000 p 2 0 2859 741 11395 3664 p 2 0 3103 497 15290 4069 p 2 0 2908 692 11980 3737 p 2 0 2804 796 10837 3547 p 2 0 2806 794 10821 3560 p 2 0 2736 864 10200 3444 p 2 0 2698 902 9966 3408 p 2 0 2624 976 9215 3297 p 2 0 2426 1174 8481 3068 p 2 0 2614 986 9555 3279 p 2 0 2600 1000 9460 3258 p 2 0 2560 1040 8930 3197 p 2 0 2851 749 11265 3587 p 2 0 2980 620 13104 3809 p 2 0 2833 767 11887 3598 p 2 0 2582 1018 9054 3185 p 2 0 2288 1312 7978 2861 p 2 0 2401 1199 8358 3017 p 2 0 2695 905 9851 3355 p 2 0 2334 1266 8126 2975 p 2 0 2290 1310 7667 2901 p 2 0 2199 1401 7178 2791 p 2 0 2152 1448 7309 2753 p 2 0 2616 984 9478 3286 p 2 0 2538 1062 8445 3209 p 2 0 2432 1168 9187 3053 p 2 0 2787 813 12208 3538 p 2 0 2582 1018 9719 3252 p 2 0 2230 1370 7908 2832 p 2 0 2487 1113 8811 3115 p 2 0 2441 1159 8474 3061 p 2 0 2323 1277 7949 2930 p 2 0 2469 1131 8754 3094 p 2 0 3432 168 23758 4983 i 2 3600 0 0 105616 14327 p 2 0 2991 609 15200 3732 p 2 0 3212 388 17878 4183 p 2 0 3069 531 17002 3939 p 2 0 2694 906 12304 3387 p 2 0 2312 1288 10276 2880 p 2 0 2701 899 12448 3331 p 2 0 2197 1403 9262 2738 p 2 0 1820 1780 8333 2330 p 2 0 2316 1284 9375 2869 p 2 0 2524 1076 11440 3119 p 2 0 2391 1209 10459 2952 p 2 0 2408 1192 10054 2998 p 2 0 2827 773 12852 3528 p 2 0 2513 1087 11109 3123 p 2 0 2785 815 12864 3508 p 2 0 2828 772 13367 3461 p 2 0 2297 1303 8593 2819 p 2 0 2352 1248 10187 2879 p 2 0 2125 1475 9560 2658 p 2 0 2078 1522 9235 2621 p 2 0 2183 1417 8341 2669 p 2 0 2084 1516 8903 2619 p 2 0 2222 1378 8955 2745 p 2 0 2126 1474 8913 2638 p 2 0 2516 1084 10278 3113 p 2 0 2338 1262 10717 2905 p 2 0 2863 737 13188 3580 p 2 0 2680 920 11691 3287 p 2 0 2146 1454 9238 2656 p 2 0 2198 1402 9309 2732 p 2 0 2041 1559 8567 2547 p 2 0 1929 1671 8738 2451 p 2 0 2003 1597 7476 2511 p 2 0 2016 1584 8529 2543 p 2 0 2108 1492 8222 2617 p 2 0 2062 1538 8219 2577 p 2 0 2394 1206 10371 2976 p 2 0 2177 1423 9154 2696 p 2 0 2846 754 13356 3552 p 2 0 2575 1025 11068 3153 p 2 0 2112 1488 8561 2607 p 2 0 2302 1298 9452 2813 p 2 0 2038 1562 8329 2534 p 2 0 1972 1628 8316 2472 p 2 0 2163 1437 9206 2671 p 2 0 2045 1555 7996 2525 p 2 0 2136 1464 8755 2643 p 2 0 1889 1711 7632 2396 p 2 0 2405 1195 9978 2953 p 2 0 2103 1497 8125 2617 p 2 0 2644 956 11607 3302 p 2 0 2527 1073 10855 3114 p 2 0 2197 1403 8727 2695 p 2 0 2179 1421 8932 2662 p 2 0 2158 1442 8893 2682 p 2 0 1966 1634 7897 2446 p 2 0 1999 1601 7850 2483 p 2 0 2028 1572 7646 2532 p 2 0 2046 1554 8118 2520 p 2 0 1839 1761 7458 2337 p 2 0 2537 1063 9857 3083 p 2 0 2260 1340 8819 2774 p 2 0 2813 787 12360 3491 p 2 0 2494 1106 10916 3043 p 2 0 1960 1640 7822 2453 p 2 0 1928 1672 7832 2408 p 2 0 2133 1467 8790 2651 p 2 19 2419 1162 31579 3518 p 2 6 2868 726 27338 4063 p 2 2 2698 900 36325 4112 p 2 0 2160 1440 12571 2832 p 2 142 2480 978 59814 4871 p 2 108 2486 1006 35302 4492 p 2 60 2691 849 33717 4496 p 2 0 2671 929 30299 4242 p 2 104 2641 855 28619 4426 p 2 5 2656 939 20921 3810 p 2 1 2538 1061 14685 3295 p 2 0 2548 1052 11915 3237 p 2 1 2256 1343 12454 2890 p 2 0 2438 1162 11010 3044 p 2 3 2180 1417 10869 2753 p 2 0 1996 1604 8402 2517 p 2 1 2244 1355 12166 2816 p 2 0 1938 1662 7439 2432 p 2 4 2567 1029 12819 3242 p 2 1 2169 1430 9086 2717 p 2 1 2743 856 15474 3522 p 2 3 2360 1237 12431 2971 p 2 0 2447 1153 10004 3020 p 2 0 1731 1869 7467 2187 p 2 1 1850 1749 9199 2377 p 2 0 2131 1469 9424 2648 p 2 4 1797 1799 8446 2325 p 2 0 1960 1640 7567 2464 p 2 1 2110 1489 10334 2635 p 2 4 2486 1110 11126 3153 p 2 0 2221 1379 8283 2770 p 2 0 2057 1543 7179 2561 p 2 1 2606 993 12692 3264 p 2 0 2249 1351 7850 2779 p 2 2 2173 1425 9749 2720 p 2 0 2224 1376 9170 2722 p 2 0 2119 1481 8127 2627 p 2 0 2077 1523 7057 2581 p 2 258 1999 1343 15929 3739 p 2 0 2144 1456 10287 2838 p 2 0 2155 1445 8770 2730 p 2 0 1913 1687 6157 2451 p 2 0 2612 988 10322 3302 p 2 0 2940 660 14520 3797 p 2 0 2716 884 10333 3417 p 2 0 2531 1069 9415 3166 p 2 0 2438 1162 9830 3032 p 2 0 2244 1356 7710 2810 p 2 0 2130 1470 7108 2672 p 2 0 2121 1479 7537 2650 p 2 0 2018 1582 6624 2557 p 2 0 1880 1720 5869 2403 p 2 0 2028 1572 6509 2546 p 2 0 2526 1074 8922 3139 p 2 0 2298 1302 8646 2882 p 2 0 2845 755 11337 3607 p 2 0 2493 1107 8887 3111 p 2 0 2346 1254 9174 2920 p 2 0 2519 1081 9316 3144 p 2 0 2331 1269 8843 2905 p 2 0 2037 1563 7495 2552 p 2 0 1911 1689 6939 2419 p 2 0 2076 1524 7620 2586 p 2 0 2006 1594 6286 2526 p 2 0 1946 1654 6229 2453 p 2 0 2481 1119 10028 3101 p 2 0 2294 1306 8773 2882 p 2 0 2820 780 12890 3574 p 2 0 2446 1154 8397 3079 p 2 0 2281 1319 7891 2822 p 2 0 2486 1114 10102 3087 p 2 0 2157 1443 7366 2719 p 2 0 2359 1241 8952 2916 p 2 0 2152 1448 8070 2699 p 2 0 2033 1567 6649 2541 p 2 0 1926 1674 7327 2456 p 2 0 1945 1655 7135 2472 p 2 0 2504 1096 8984 3133 p 2 0 2178 1422 8576 2723 p 2 0 2895 705 12300 3682 p 2 0 2640 960 10584 3306 p 2 0 2242 1358 8336 2780 p 2 0 2535 1065 9263 3117 p 2 0 2425 1175 9961 2984 p 2 0 2103 1497 7087 2634 p 2 0 1955 1645 6258 2464 p 2 0 1916 1684 7144 2431 p 2 0 1982 1618 7504 2533 p 2 0 1908 1692 7212 2419 p 2 0 2361 1239 7857 2967 p 2 0 2351 1249 8395 2908 p 2 0 2884 716 12492 3636 p 2 0 2598 1002 10151 3241 p 2 62 2269 1269 19777 3421 p 2 1 2404 1195 11942 3092 p 2 0 2263 1337 9620 2866 p 2 0 1765 1835 6476 2267 p 2 0 2398 1202 9570 3021 p 2 0 2322 1278 8499 2891 p 2 0 2124 1476 7379 2645 p 2 0 2147 1453 9042 2658 p 2 0 2043 1557 7913 2568 p 2 0 2466 1134 9001 3115 p 2 0 2969 631 15376 3818 p 2 0 2644 956 10903 3345 p 2 0 2234 1366 8038 2802 p 2 0 2482 1118 10270 3124 p 2 0 2389 1211 10414 2957 p 2 0 1574 2026 5583 2091 p 2 97 2595 908 32678 4007 p 2 0 2453 1147 10125 3104 p 2 0 2202 1398 9085 2814 p 2 94 2232 1274 28658 3674 p 2 0 2639 961 10762 3351 p 2 91 2276 1233 33946 3829 p 2 0 2852 748 14228 3771 p 2 0 2736 864 11552 3475 p 2 0 2481 1119 10295 3152 p 2 3 2229 1368 16072 3027 p 2 0 2488 1112 11192 3133 p 2 0 1994 1606 8730 2577 p 2 1 2381 1218 12110 3037 p 2 2 2292 1306 10670 2963 p 2 1 2257 1342 12810 2908 p 2 2 2066 1532 11493 2727 p 2 2 2148 1450 13167 2848 p 2 2 2697 901 15901 3589 p 2 2 2597 1001 15894 3446 p 2 3 2712 885 17080 3579 p 2 4 2684 912 18579 3587 p 2 3 2596 1001 18055 3435 p 2 3 2364 1233 15509 3157 p 2 1 2080 1519 15250 2825 p 2 1 2387 1212 17036 3211 p 2 3 2347 1250 17846 3188 p 2 1 2388 1211 18265 3273 p 2 5 2199 1396 17263 3078 p 2 3 2288 1309 19722 3159 p 2 3 2734 863 21160 3754 p 2 3 2428 1169 19589 3320 p 2 1 2906 693 23354 4008 p 2 4 2740 856 22175 3787 p 2 5 2659 936 21934 3634 p 2 5 2764 831 23377 3794 p 2 6 2329 1265 20147 3260 p 2 3 2366 1231 20756 3303 p 2 3 2409 1188 20991 3362 p 2 0 2496 1104 21929 3463 p 2 3 2473 1124 21411 3438 p 2 4 2356 1240 21318 3317 p 2 2 2881 717 25651 4040 p 2 3 2701 896 25197 3818 p 2 5 2975 620 27504 4185 p 2 5 2706 889 24417 3801 p 2 3 2683 914 23879 3770 p 2 2 2857 741 27201 4006 p 2 6 2407 1187 22994 3398 p 2 1 2703 896 26809 3799 p 2 3 2700 897 26503 3788 p 2 5 2394 1201 23900 3425 p 2 5 2437 1158 24710 3467 p 2 11 2497 1092 24956 3597 p 2 6 2714 880 27033 3864 p 2 6 2494 1100 25667 3548 p 2 3 3019 578 30488 4282 p 2 7 2937 656 29747 4201 p 2 3 2905 692 27938 4105 p 2 4 2645 951 27669 3808 p 2 12 2591 997 26805 3755 p 2 4 2860 736 29509 4121 p 2 8 2768 824 28240 3988 p 2 4 2715 881 27232 3886 p 2 3 2644 953 26737 3769 p 2 6 2788 806 29249 4001 i 2 3600 0 0 130757 15452 p 2 0 3535 65 20887 5010 p 2 0 3482 118 19705 4772 p 2 0 3206 394 12898 4080 p 2 0 3297 303 15423 4288 p 2 0 3058 542 10856 3869 p 2 0 3076 524 11500 3924 p 2 0 3095 505 11548 3929 p 2 0 3080 520 11404 3914 p 2 0 2952 648 10706 3705 p 2 0 3020 580 11389 3851 p 2 0 3308 292 14258 4353 p 2 0 3059 541 11361 3927 p 2 0 2508 1092 8153 3108 p 2 0 3166 434 12815 4049 p 2 0 2882 718 10101 3616 p 2 0 3109 491 12365 3938 p 2 0 2749 851 9564 3402 p 2 0 2653 947 8777 3256 p 2 0 2633 967 8926 3244 p 2 0 2677 923 9017 3293 p 2 0 2484 1116 8075 3042 p 2 0 2192 1408 6971 2738 p 2 0 2800 800 10061 3507 p 2 0 2942 658 10361 3710 p 2 0 2349 1251 7552 2891 p 2 0 3120 480 12280 3985 p 2 0 2997 603 10650 3773 p 2 0 2939 661 10769 3667 p 2 0 2461 1139 8015 3001 p 2 0 2782 818 9379 3487 p 2 0 2724 876 8945 3396 p 2 0 2661 939 8855 3324 p 2 0 2661 939 8423 3333 p 2 0 2629 971 8333 3280 p 2 0 2804 796 9572 3503 p 2 0 2593 1007 8550 3213 p 2 0 3265 335 14807 4247 p 2 0 3004 596 11237 3846 p 2 0 2627 973 8660 3281 p 2 0 2960 640 10606 3689 p 2 0 2672 928 8783 3308 p 2 0 2732 868 9069 3436 p 2 0 2709 891 8909 3395 p 2 0 2823 777 9561 3528 p 2 0 2600 1000 8602 3245 p 2 0 2770 830 9121 3455 p 2 0 2952 648 10579 3695 p 2 0 2519 1081 8363 3116 p 2 0 2348 1252 7618 2881 p 2 0 3115 485 13528 3928 p 2 0 2897 703 10657 3591 p 2 0 2720 880 9250 3338 p 2 0 2521 1079 8056 3094 p 2 0 2500 1100 8120 3086 p 2 0 2665 935 8953 3284 p 2 0 2613 987 8483 3202 p 2 0 2487 1113 8004 3084 p 2 0 2459 1141 7662 3039 p 2 0 3061 539 10848 3882 p 2 0 2792 808 9468 3483 p 2 0 2381 1219 7860 2946 p 2 0 2931 669 10930 3616 p 2 0 2917 683 11186 3641 p 2 0 2721 879 9453 3364 p 2 0 2601 999 8951 3214 p 2 0 2666 934 9355 3269 p 2 0 2496 1104 8408 3094 p 2 0 2423 1177 8010 2998 p 2 0 2513 1087 8240 3104 p 2 0 2583 1017 8516 3180 p 2 0 2912 688 10063 3688 p 2 0 2807 793 9368 3565 p 2 0 2414 1186 7876 2965 p 2 0 2952 648 11359 3694 p 2 0 2641 959 9016 3234 p 2 0 2888 712 10756 3565 p 2 0 2728 872 10022 3409 p 2 0 2606 994 8961 3193 p 2 0 2570 1030 8501 3194 p 2 0 2399 1201 7824 2980 p 2 0 2671 929 8808 3248 p 2 1 2616 983 17810 3407 p 2 0 3047 553 11664 3908 p 2 0 2730 870 9031 3429 p 2 0 2466 1134 8342 3038 p 2 0 3061 539 18952 3958 p 2 0 2800 800 10640 3467 p 2 0 3047 553 11883 3844 p 2 0 3087 513 19228 4010 p 2 0 2556 1044 8883 3129 p 2 0 2674 926 9679 3285 p 2 0 2702 898 9585 3353 p 2 0 2696 904 9804 3355 p 2 1 2385 1214 7987 3002 p 2 0 2787 813 9808 3454 p 2 0 2800 800 9163 3525 p 2 0 2400 1200 7876 2968 p 2 0 3183 417 13053 4032 p 2 0 2905 695 10400 3620 p 2 0 2972 628 11427 3729 p 2 0 2861 739 11129 3580 p 2 0 2882 718 10357 3612 p 2 0 2817 783 10191 3508 p 2 1 2756 843 10040 3395 p 2 0 2573 1027 8766 3157 p 2 0 2246 1354 7463 2767 p 2 0 2389 1211 7760 2910 p 2 0 2834 766 9137 3531 p 2 0 2887 713 9743 3636 p 2 1 3222 377 13423 4147 p 2 0 2751 849 9132 3396 p 2 0 2867 733 10120 3617 p 2 0 2835 765 9908 3559 p 2 0 2948 652 10629 3700 p 2 0 2817 783 9495 3544 p 2 0 2645 955 8892 3285 p 2 0 2813 787 9816 3507 p 2 0 2792 808 9576 3474 p 2 0 2990 610 11070 3775 p 2 0 2652 948 8825 3266 p 2 0 2245 1355 7004 2759 p 2 1 2988 611 11402 3763 p 2 0 2785 815 9332 3468 p 2 0 2643 957 8808 3293 p 2 0 2611 989 9091 3245 p 2 0 2397 1203 7768 2975 p 2 0 2802 798 9623 3455 p 2 1 2588 1011 8701 3220 p 2 0 2456 1144 8068 3042 p 2 0 2557 1043 8377 3156 p 2 0 2846 754 10005 3557 p 2 0 2533 1067 8303 3123 p 2 0 2375 1225 7803 2913 p 2 0 2992 608 11853 3713 p 2 0 2625 975 8751 3195 p 2 0 2557 1043 8722 3150 p 2 1 2781 818 9592 3446 p 2 0 2688 912 9061 3279 p 2 0 2855 745 10815 3544 p 2 0 2691 909 9267 3338 p 2 0 2644 956 8699 3270 p 2 0 2540 1060 8533 3159 p 2 0 2954 646 10060 3747 p 2 0 2780 820 9458 3469 p 2 0 2408 1192 7861 2945 p 2 0 2897 703 11101 3579 p 2 0 2655 945 9232 3244 p 2 0 2706 894 9481 3328 p 2 1 2665 934 9184 3282 p 2 0 2562 1038 8639 3147 p 2 0 2434 1166 7818 2999 p 2 0 2660 940 9040 3276 p 2 0 2600 1000 8510 3202 p 2 0 2506 1094 8286 3098 p 2 0 3044 556 11131 3868 p 2 0 2711 889 8773 3407 p 2 0 2440 1160 8148 2993 p 2 0 3032 568 12417 3791 p 2 0 2691 909 9312 3315 p 2 0 2708 892 9414 3329 p 2 1 2767 832 10036 3420 p 2 0 2671 929 9333 3271 p 2 0 2621 979 8563 3240 p 2 0 2674 926 9164 3296 p 2 0 2711 889 9706 3327 p 2 0 2533 1067 8679 3151 p 2 0 3125 475 11768 3986 p 2 0 2769 831 9297 3482 p 2 0 2264 1336 7263 2823 p 2 1 2992 607 11827 3743 p 2 0 2865 735 10478 3612 p 2 0 2882 718 10668 3588 p 2 0 2558 1042 8391 3117 p 2 0 2466 1134 7900 3002 p 2 0 2597 1003 8445 3189 p 2 0 2396 1204 7667 2988 p 2 0 2372 1228 7494 2934 p 2 1 2593 1006 8733 3220 p 2 0 2739 861 9407 3409 p 2 0 2877 723 9527 3603 p 2 0 2325 1275 7271 2860 p 2 0 3047 553 12027 3868 p 2 0 2779 821 9655 3415 p 2 0 2877 723 9826 3581 p 2 1 2790 809 9976 3474 p 2 0 2728 872 9426 3411 p 2 0 2809 791 9529 3521 p 2 0 2639 961 8994 3313 p 2 0 2465 1135 7887 3025 p 2 0 2665 935 9435 3271 p 2 0 2836 764 10248 3547 p 2 0 2472 1128 8186 3051 p 2 0 2367 1233 7989 2920 p 2 0 2985 615 12456 3743 p 2 0 2937 663 10500 3682 p 2 0 2705 895 9454 3370 p 2 1 2811 788 9982 3492 p 2 0 2527 1073 8412 3146 p 2 0 2419 1181 7999 2997 p 2 0 2529 1071 8329 3139 p 2 0 2611 989 8485 3219 p 2 0 2494 1106 8171 3068 p 2 0 3033 567 11328 3882 p 2 0 2768 832 9489 3513 p 2 0 2254 1346 7187 2798 p 2 1 2932 667 11462 3675 p 2 0 2908 692 10271 3645 p 2 0 2917 683 10928 3617 p 2 0 2703 897 8827 3313 p 2 0 2405 1195 7908 2984 p 2 0 2410 1190 7408 2950 p 2 0 2528 1072 8043 3090 p 2 0 2332 1268 7342 2915 p 2 0 2325 1275 7479 2896 p 2 0 2781 819 9320 3446 p 2 0 2833 767 9723 3549 p 2 0 2262 1338 7232 2802 p 2 0 3036 564 11983 3851 p 2 0 2700 900 9177 3348 p 2 0 2851 749 9781 3562 p 2 0 2851 749 10374 3549 p 2 0 2597 1003 8856 3199 p 2 0 2658 942 8802 3303 p 2 0 2437 1163 7835 3032 p 2 0 2516 1084 8480 3094 p 2 0 2265 1335 7309 2795 p 2 0 2829 771 9458 3545 p 2 0 2851 749 9555 3589 p 2 0 2673 927 9375 3291 p 2 0 3253 347 14353 4191 p 2 0 2966 634 11060 3726 p 2 0 2994 606 11836 3805 p 2 0 2785 815 9863 3478 p 2 0 2880 720 10154 3615 p 2 0 2710 890 8958 3363 p 2 0 2552 1048 8582 3175 p 2 0 2717 883 9272 3390 p 2 0 2816 784 9950 3539 p 2 0 2964 636 10994 3733 p 2 0 2594 1006 8521 3196 p 2 0 2416 1184 8025 2953 p 2 0 2930 670 12112 3667 p 2 0 2582 1018 9344 3185 p 2 0 2931 669 10917 3635 p 2 0 2533 1067 8434 3140 p 2 0 2503 1097 8412 3092 p 2 0 2435 1165 8217 2998 p 2 0 2539 1061 8576 3116 p 2 0 2430 1170 7777 2987 p 2 0 2380 1220 7526 2936 p 2 0 3032 568 10852 3836 p 2 0 2796 804 9388 3470 p 2 0 2355 1245 7746 2888 p 2 0 2917 683 10927 3614 p 2 0 2992 608 11691 3715 p 2 0 2792 808 9919 3449 p 2 0 2598 1002 8879 3185 p 2 0 2698 902 9370 3348 p 2 0 2674 926 9189 3303 p 2 0 2553 1047 8363 3139 p 2 0 2542 1058 8333 3134 p 2 0 2278 1322 7023 2817 p 2 0 2644 956 9170 3238 p 2 0 2603 997 8877 3218 p 2 0 3560 40 31190 5504 i 2 3600 0 0 164045 16314 p 2 0 3484 116 17908 4562 p 2 0 3449 151 18308 4429 p 2 0 2848 752 10941 3504 p 2 0 3035 565 12628 3738 p 2 0 2573 1027 8644 3098 p 2 0 2963 637 12427 3661 p 2 0 2551 1049 8569 3094 p 2 0 2273 1327 7512 2729 p 2 1 3166 433 14714 4086 p 2 0 2414 1186 8358 2956 p 2 0 3111 489 17716 3961 p 2 0 3182 418 15658 4020 p 2 0 3040 560 12964 3801 p 2 0 3110 490 15858 3923 p 2 0 2361 1239 7939 2824 p 2 0 2782 818 10637 3389 p 2 0 2743 857 10040 3296 p 2 0 2653 947 9781 3222 p 2 0 2707 893 10516 3258 p 2 10 2967 623 58002 4900 p 2 0 2960 640 14814 3778 p 2 22 3007 571 56468 5075 p 2 0 3267 333 17824 4325 p 2 0 3071 529 13417 3878 p 2 12 3059 529 57016 5055 p 2 0 3036 564 15282 3943 p 2 0 3047 553 14394 3855 p 2 6 3066 528 58218 5067 p 2 0 3041 559 15306 3904 p 2 0 2934 666 13029 3717 p 2 0 2860 740 12190 3588 p 2 0 2795 805 11889 3464 p 2 0 3046 554 12832 3889 p 2 0 2813 787 10588 3526 p 2 0 3272 328 17926 4231 p 2 0 2985 615 12862 3726 p 2 0 2998 602 12938 3687 p 2 0 2836 764 10583 3513 p 2 0 2932 668 12026 3610 p 2 0 2957 643 12496 3637 i 2 3600 0 0 64124 12442 p 2 0 3568 32 23989 5770 p 2 0 3093 507 10052 3994 p 2 33 3380 187 26917 5295 p 2 0 2895 705 9800 3742 p 2 0 3398 202 14122 4734 p 2 36 3372 192 26163 5340 p 2 0 3276 324 12654 4395 p 2 0 3325 275 12581 4556 p 2 76 3326 198 26182 5430 p 2 0 3353 247 13601 4714 p 2 0 3118 482 11736 4167 p 2 36 3337 227 23757 5181 p 2 0 3372 228 15723 4795 p 2 0 3393 207 15428 4921 p 2 19 3337 244 21779 5009 p 2 0 2774 826 9137 3597 p 2 0 3245 355 13986 4446 p 2 17 3284 299 20417 4884 p 2 0 3169 431 11624 4189 p 2 0 3057 543 10900 4032 p 2 1 3038 561 11438 4063 p 2 0 3250 350 12985 4524 p 2 0 3065 535 10470 4073 p 2 1 3162 437 11400 4326 p 2 0 3181 419 11609 4340 p 2 0 3287 313 13787 4663 p 2 0 3227 373 12931 4458 p 2 0 3188 412 10308 4241 p 2 0 3255 345 12450 4481 p 2 0 3287 313 13727 4705 p 2 0 3069 531 11546 4200 p 2 0 3265 335 12103 4550 p 2 1 3107 492 11273 4224 p 2 0 3109 491 11289 4321 p 2 0 2900 700 11117 3970 p 2 1 3014 585 10838 4145 p 2 0 2911 689 10039 3921 p 2 0 3267 333 11525 4408 p 2 0 3359 241 15335 4723 p 2 0 3371 229 12412 4648 p 2 0 3399 201 14912 4805 p 2 0 3404 196 14411 4996 p 2 0 3306 294 13607 4578 p 2 0 3292 308 12652 4662 p 2 0 3298 302 13749 4639 p 2 1 3378 221 15781 5037 i 2 3600 0 0 100085 14514 p 2 0 3500 100 18030 4740 p 2 23 3192 385 18743 4405 p 2 0 3308 292 13620 4234 p 2 0 2396 1204 7104 2915 p 2 16 2900 684 16623 3886 p 2 0 3231 369 12089 4177 p 2 0 3043 557 10538 3803 p 2 30 3135 435 20337 4356 p 2 0 2591 1009 7790 3216 p 2 5 3226 369 19099 4377 p 2 0 2786 814 8902 3436 p 2 0 2935 665 9418 3643 p 2 0 2872 728 9179 3561 p 2 0 2849 751 15277 3751 p 2 0 2774 826 8524 3417 p 2 0 2426 1174 7213 2991 p 2 0 2677 923 13707 3500 p 2 3 2898 699 17583 3849 p 2 0 3267 333 12803 4179 p 2 1 3059 540 17410 4020 p 2 0 2729 871 8794 3335 p 2 0 2672 928 8322 3238 p 2 0 1789 1811 4892 2240 p 2 2 2580 1018 14232 3312 p 2 0 2562 1038 7714 3079 p 2 0 2430 1170 7122 2963 p 2 0 2518 1082 13778 3260 p 2 1 2489 1110 8126 3066 p 2 0 2740 860 8989 3382 p 2 0 2477 1123 7292 3026 p 2 0 2027 1573 5431 2508 p 2 0 2772 828 8777 3346 p 2 0 2433 1167 6905 2955 p 2 0 2486 1114 7080 3011 p 2 0 2585 1015 7912 3130 p 2 0 2324 1276 6377 2802 p 2 0 2300 1300 6345 2816 p 2 0 2344 1256 6349 2853 p 2 0 2351 1249 6500 2864 p 2 0 2376 1224 6531 2906 p 2 19 2679 902 9167 3376 p 2 40 2222 1338 8499 2946 p 2 0 2051 1549 5597 2541 p 2 71 2363 1166 13367 3340 p 2 99 2497 1004 19857 3805 p 2 115 2299 1186 23237 3767 p 2 138 2441 1021 25389 4096 p 2 132 2202 1266 24711 3786 p 2 117 2417 1066 25325 3985 p 2 81 2509 1010 26503 3954 p 2 37 2351 1212 24428 3480 p 2 2 2172 1426 14633 2927 p 2 0 2308 1292 8240 2875 p 2 0 2724 876 9386 3391 p 2 0 2835 765 8517 3559 p 2 0 3117 483 12282 3956 p 2 0 2497 1103 7388 3065 p 2 0 2676 924 8598 3281 p 2 0 1980 1620 5349 2478 p 2 0 2477 1123 7420 3023 p 2 0 2218 1382 6031 2741 p 2 0 2005 1595 5805 2494 p 2 0 2666 934 8437 3217 p 2 0 3023 577 13028 4095 i 2 3600 0 0 80691 13478 p 2 2223 1376 1 106988 14577 p 2 1981 1619 0 112818 14286 p 2 1688 1912 0 118471 13955 p 2 415 3185 0 64854 8636 p 2 196 3404 0 57487 7730 p 2 41 3558 1 39503 6626 p 2 0 3589 11 32428 6188 p 2 0 3580 20 30006 4988 p 2 2 3593 5 28305 4969 p 2 0 3589 11 29056 4924 p 2 0 3597 3 30190 5237 p 2 0 3586 14 31037 5048 p 2 0 3595 5 30546 5271 p 2 0 3595 5 31789 5198 p 2 0 3595 5 35501 5498 p 2 0 3593 7 31410 5234 p 2 1 3589 10 30978 5227 p 2 0 3595 5 33492 5105 p 2 0 3598 2 31136 5201 p 2 0 3595 5 31316 5182 p 2 0 3589 11 29083 5098 p 2 0 3591 9 28046 5005 p 2 0 3597 3 26460 4896 p 2 0 3594 6 29794 4897 p 2 0 3591 9 25308 4832 p 2 0 3592 8 23082 4760 p 2 0 3590 10 23585 4864 p 2 0 3591 9 25183 4830 p 2 0 3592 8 18957 4596 p 2 0 3590 10 24969 4723 p 2 0 3588 12 24246 4787 p 2 1 3588 11 29601 5058 p 2 0 3590 10 30601 5146 p 2 0 3583 17 30812 5169 p 2 2 3592 6 29829 5071 p 2 0 3589 11 33144 5198 p 2 0 3587 13 30675 5185 p 2 0 3591 9 32961 5395 p 2 0 3587 13 27487 5134 p 2 0 3574 26 30141 5283 p 2 0 3588 12 33279 5162 p 2 0 3580 20 27196 5180 p 2 0 3573 27 26777 4680 p 2 0 3575 25 24276 4728 p 2 0 3575 25 16398 4413 p 2 0 3574 26 19170 4488 p 2 0 3573 27 23208 4653 p 2 0 3568 32 26039 4879 p 2 0 3566 34 24567 4820 p 2 1 3512 87 25912 5008 p 2 0 3355 245 25518 4627 p 2 0 3280 320 22803 4263 i 2 3600 0 0 38014 11899 p 2 2173 1427 0 57137 13359 p 2 727 2862 11 66529 10164 p 2 37 3525 38 36008 6396 p 2 2 3578 20 27284 5958 p 2 11 3393 196 20098 5074 p 2 0 3278 322 15418 4639 p 2 0 3264 336 15628 4338 p 2 29 3176 395 17500 4439 p 2 0 3216 384 13920 4023 p 2 0 3091 509 14264 3908 p 2 0 3052 548 15271 3916 p 2 0 3002 598 11195 3725 p 2 0 3013 587 12395 3726 p 2 0 2909 691 12221 3598 p 2 0 3044 556 14102 3838 p 2 0 3035 565 14816 3825 p 2 24 3018 558 18206 4033 p 2 0 2950 650 14462 3738 p 2 0 2990 610 15409 3771 p 2 30 2975 595 16498 3938 p 2 0 3041 559 15335 3800 p 2 0 2702 898 8666 3306 p 2 77 2675 848 13203 3686 p 2 0 2827 773 10858 3506 p 2 0 2925 675 11362 3615 p 2 24 2477 1099 12156 3369 p 2 0 2810 790 11485 3485 p 2 0 2596 1004 12231 3305 p 2 28 2725 847 14266 3651 p 2 0 2609 991 12713 3331 p 2 0 2549 1051 7907 3096 p 2 25 2576 999 12644 3464 p 2 0 2797 803 11632 3510 p 2 0 2694 906 12018 3410 p 2 28 2797 775 12891 3685 p 2 0 2900 700 13531 3599 p 2 0 2978 622 12559 3599 p 2 38 2748 814 14556 3593 p 2 0 2934 666 12690 3549 p 2 0 2572 1028 7984 3070 p 2 28 2499 1073 9850 3254 p 2 0 2386 1214 9095 3010 p 2 0 2533 1067 9456 3119 p 2 75 2587 938 14968 3611 p 2 0 2601 999 11603 3218 p 2 0 2550 1050 12210 3172 p 2 56 2745 799 13146 3772 p 2 0 2857 743 12421 3596 p 2 0 2922 678 12045 3556 p 2 76 2569 955 15370 3566 p 2 0 2817 783 13373 3435 p 2 0 2398 1202 10926 3010 p 2 24 2354 1222 9927 3170 p 2 0 2665 935 10942 3277 p 2 29 2769 802 13987 3626 p 2 0 2596 1004 11535 3200 p 2 0 2328 1272 6558 2754 p 2 0 2599 1001 10097 3150 p 2 24 2682 894 13475 3579 p 2 0 2828 772 12141 3521 p 2 0 2889 711 12627 3546 p 2 28 2685 887 12637 3511 p 2 0 2614 986 10928 3309 i 2 3600 0 0 76295 13273 p 2 21 3571 8 34305 6223 p 2 143 3299 158 37120 5993 p 2 2 3404 194 32277 4972 p 2 1 3398 201 28411 5131 p 2 133 3264 203 41467 6073 p 2 1 3370 229 31289 5278 p 2 4 3351 245 31570 5294 p 2 112 3212 276 33900 5871 p 2 3 3306 291 28699 5463 p 2 1 3255 344 28405 5023 p 2 263 3023 314 42099 6235 p 2 5 3239 356 30137 5244 p 2 9 3260 331 30731 5155 p 2 34 3209 357 40801 5871 p 2 14 3262 324 33522 5402 p 2 8 3233 359 31373 5219 p 2 78 3207 315 35000 5597 p 2 6 3222 372 33204 5236 p 2 14 3280 306 30892 5118 p 2 147 3096 357 37320 5534 p 2 14 3282 304 30350 5148 p 2 2 3289 309 31204 5122 p 2 66 3236 298 40034 5795 p 2 9 3266 325 31753 5203 p 2 1 3313 286 31239 4984 p 2 33 3265 302 37663 5505 p 2 1 3318 281 33115 5162 p 2 5 3250 345 31641 5072 p 2 7 3279 314 34549 5150 p 2 2 3270 328 35251 5469 p 2 1 3318 281 32841 5368 p 2 2 3302 296 29955 5193 p 2 1 3295 304 32085 5305 p 2 2 3286 312 33041 5338 p 2 2 3315 283 33109 5403 p 2 4 3337 259 32143 5315 i 2 3600 0 0 99002 14847 p 2 87 3469 44 37524 6893 p 2 132 3347 121 38829 6510 p 2 145 3333 122 39017 6844 p 2 74 2921 605 28821 5527 p 2 103 3203 294 32886 6005 p 2 118 2950 532 29902 5642 p 2 89 3019 492 28900 5476 p 2 96 2836 668 29014 5346 p 2 113 2666 821 28300 5229 p 2 96 2915 589 32057 5665 p 2 108 2753 739 33193 5609 p 2 136 3009 455 29558 5821 p 2 82 2804 714 27586 5228 p 2 109 3001 490 30587 5634 p 2 114 3145 341 31782 5970 p 2 86 2982 532 28449 5488 p 2 89 3027 484 28058 5503 p 2 125 3002 473 31073 5761 p 2 111 2752 737 28913 5286 p 2 105 2834 661 28079 5341 p 2 122 2525 953 26667 5035 p 2 78 2926 596 27612 5378 p 2 101 2871 628 30330 5537 p 2 121 2812 667 31918 5618 p 2 97 2451 1052 26714 4813 p 2 88 2567 945 26591 4979 p 2 126 2959 515 31334 5831 p 2 77 3021 502 29022 5561 p 2 84 3123 393 30494 5747 p 2 128 2975 497 32829 5875 p 2 83 2891 626 26988 5296 p 2 106 2837 657 32361 5635 p 2 116 2473 1011 27276 5022 p 2 80 2818 702 27353 5181 p 2 101 2834 665 33080 5644 p 2 120 2830 650 31230 5583 p 2 80 2634 886 27017 5013 p 2 106 2788 706 32359 5531 p 2 107 2831 662 29151 5508 p 2 77 3111 412 31098 5838 p 2 84 3151 365 31458 5891 p 2 119 3012 469 30371 5769 p 2 88 2942 570 28766 5427 p 2 100 2982 518 29289 5611 p 2 127 2590 883 30629 5365 p 2 82 2791 727 27407 5174 p 2 89 2783 728 27490 5234 p 2 94 2824 682 27499 5260 p 2 97 2744 759 29952 5268 p 2 90 2798 712 28361 5284 p 2 132 3067 401 35552 6239 p 2 121 2983 496 32770 5964 p 2 92 3061 447 29843 5698 p 2 105 2771 724 29814 5434 p 2 91 2819 690 28521 5334 p 2 104 2568 928 27410 5048 p 2 118 2505 977 28197 5116 p 2 94 2912 594 28915 5423 p 2 90 2829 681 28875 5345 p 2 104 2623 873 27523 5098 p 2 76 2510 1014 26076 4815 p 2 85 2710 805 29981 5193 p 2 107 2986 507 29328 5679 p 2 72 2770 758 26617 5175 p 2 95 2867 638 27626 5344 p 2 112 2667 821 28247 5199 p 2 99 2840 661 30031 5432 p 2 95 2495 1010 27024 4916 p 2 115 2299 1186 26357 4784 p 2 93 2686 821 26945 5096 p 2 102 2703 795 31059 5370 p 2 104 2656 840 26773 5145 p 2 94 2405 1101 26726 4770 p 2 110 2664 826 32021 5434 p 2 109 2952 539 28364 5625 p 2 91 2965 544 27943 5478 p 2 89 3015 496 28517 5503 p 2 116 2922 562 28839 5537 p 2 92 2966 542 29985 5577 p 2 111 2944 545 29615 5529 p 2 120 2558 922 28456 5197 p 2 104 2655 841 31929 5430 p 2 106 2480 1014 27459 4978 p 2 134 2827 639 30868 5616 p 2 90 2577 933 26135 4977 p 2 115 2674 811 28290 5228 p 2 121 2909 570 29456 5590 p 2 98 3012 490 29109 5674 p 2 82 3135 383 30096 5673 p 2 107 2745 748 27929 5289 i 2 3600 0 0 62045 12329 p 2 76 3481 43 33215 5744 p 2 44 3352 204 26420 5197 p 2 2 3142 456 22673 4562 p 2 0 3324 276 24676 4940 p 2 0 3269 331 23641 4803 p 2 0 3218 382 18785 4629 p 2 0 3236 364 19711 4936 p 2 0 3430 170 23385 5434 p 2 48 3288 264 24384 5449 p 2 75 3297 228 31327 5778 p 2 84 3297 219 33325 6015 p 2 54 3373 173 33615 6173 p 2 74 3355 171 37592 6433 p 2 87 3314 199 40550 6557 p 2 66 3260 274 39896 6320 p 2 65 3349 186 42959 6927 p 2 39 3362 199 40281 6377 p 2 38 3301 261 41419 6230 p 2 83 3269 248 43617 6403 p 2 61 3353 186 45420 6444 p 2 31 3356 213 45878 6322 p 2 11 3359 230 41906 5793 p 2 25 3296 279 42231 5844 p 2 2 3455 143 42168 5955 p 2 1 3423 176 21024 5018 p 2 0 3353 247 18314 4736 p 2 1 3364 235 18536 4757 p 2 2 3318 280 17677 4688 p 2 0 3295 305 15431 4544 p 2 1 3217 382 14911 4417 p 2 2 3201 397 15266 4356 p 2 1 3411 188 25345 4963 p 2 5 3294 301 32584 4769 p 2 26 3377 197 38997 5183 p 2 25 3272 303 33214 4930 p 2 3 3398 199 32514 5179 p 2 0 3394 206 32921 5137 p 2 0 3299 301 21460 4911 p 2 0 3365 235 21489 5059 p 2 0 3302 298 21636 5183 p 2 0 3216 384 19079 4831 p 2 0 3196 404 18000 4756 p 2 0 3173 427 19395 4853 p 2 1 3475 124 22638 5380 p 2 1 3379 220 21790 5233 p 2 0 3451 149 22720 5227 p 2 3 3386 211 22675 5173 p 2 0 3295 305 20777 4974 p 2 1 3364 235 20962 5065 p 2 2 3087 511 18953 4534 p 2 10 3317 273 20834 5038 p 2 0 3372 228 21948 5134 p 2 2 3237 361 20687 4959 p 2 7 3239 354 21914 5048 p 2 0 3188 412 22212 5004 p 2 5 3287 308 24348 5238 p 2 4 3427 169 24490 5543 p 2 9 3346 245 22280 5267 p 2 1 3421 178 22901 5343 p 2 2 3378 220 22783 5249 p 2 0 3290 310 23219 5297 p 2 1 3142 457 24617 5099 p 2 0 3339 261 25210 5372 p 2 1 3309 290 25403 5321 p 2 6 3287 307 23189 5278 p 2 4 3003 593 20533 4516 p 2 3 3137 460 20310 4760 p 2 3 3345 252 20486 4954 p 2 1 3293 306 18645 4815 p 2 0 3339 261 18202 4695 p 2 0 3251 349 18029 4725 p 2 1 3341 258 19884 4859 p 2 0 3286 314 22005 4991 p 2 0 3102 498 18290 4551 p 2 0 3253 347 21301 4941 p 2 1 3169 430 20609 4771 p 2 8 3250 342 20341 4938 p 2 2 3254 344 19531 4783 p 2 0 3018 582 17784 4500 p 2 0 3446 154 23642 5368 p 2 0 3358 242 23068 5165 p 2 3 3349 248 23375 5009 p 2 5 3331 264 21914 5042 p 2 1 3137 462 21825 4735 p 2 1 3323 276 23517 5019 p 2 1 3091 508 17379 4419 p 2 0 3291 309 20506 4895 p 2 1 3206 393 20451 4689 p 2 1 3148 451 19560 4677 p 2 0 3110 490 18289 4434 p 2 0 3262 338 19936 4792 p 2 0 3371 229 21300 4844 p 2 0 3197 403 17258 4539 p 2 0 3343 257 18572 4600 p 2 0 3371 229 20319 4855 p 2 0 3305 295 17909 4646 p 2 0 3310 290 18564 4711 p 2 0 3095 505 15781 4222 p 2 0 3221 379 18255 4619 p 2 0 3195 405 18699 4549 p 2 1 3231 368 18904 4692 p 2 0 3153 447 16922 4395 p 2 1 3329 270 19991 4810 p 2 0 3401 199 22694 5028 p 2 0 3229 371 21046 4787 p 2 0 3393 207 21954 4847 p 2 0 3365 235 19873 4786 p 2 0 3259 341 24546 4650 p 2 6 3308 286 39299 4890 p 2 8 3194 398 48223 4750 p 2 26 3183 391 45194 4916 p 2 27 3190 383 40475 5076 p 2 12 3310 278 38581 5309 p 2 11 3201 388 35140 4926 p 2 0 3305 295 23751 4891 p 2 3 3480 117 28979 5330 p 2 0 3427 173 25643 5159 p 2 5 3450 145 28811 5295 p 2 0 3399 201 27903 5187 p 2 0 3372 228 26430 5160 p 2 7 3372 221 26111 5138 p 2 5 3196 399 22622 4613 p 2 0 3440 160 27228 5157 p 2 1 3400 199 27225 5174 p 2 0 3346 254 27424 5173 p 2 0 3333 267 26393 5044 p 2 0 3294 306 26562 5070 p 2 2 3463 135 31810 5549 p 2 0 3479 121 30711 5484 p 2 0 3441 159 30859 5384 p 2 0 3359 241 29528 5252 p 2 1 3312 287 30384 5186 p 2 0 3412 188 30653 5308 p 2 1 3337 262 26472 5118 p 2 0 3378 222 28009 5179 p 2 0 3348 252 27346 5154 p 2 0 3340 260 27243 5128 p 2 0 3294 306 28233 4982 p 2 0 3341 259 28455 5053 p 2 0 3477 123 31773 5406 p 2 2 3401 197 29985 5267 p 2 0 3519 81 30932 5407 p 2 0 3410 190 29861 5268 p 2 0 3459 141 31043 5428 p 2 2 3429 169 30203 5393 p 2 2 3284 314 28869 5125 p 2 0 3377 223 29509 5266 p 2 0 3272 328 25835 4985 p 2 0 3355 245 25097 5049 p 2 0 3340 260 28499 5218 p 2 0 3410 190 33631 5441 p 2 6 3425 169 35746 5843 p 2 2 3386 212 33277 5525 p 2 7 3480 113 34060 5612 p 2 1 3413 186 32214 5352 p 2 1 3402 197 30003 5339 p 2 3 3376 221 28647 5268 p 2 5 3259 336 25926 4935 p 2 2 3420 178 29018 5296 p 2 3 3343 254 31587 5378 p 2 1 3336 263 29307 5291 p 2 2 3287 311 27897 5038 p 2 3 3252 345 31297 5142 p 2 3 3409 188 31424 5392 p 2 6 3399 195 30025 5412 p 2 53 3438 109 36679 5889 p 2 0 3391 209 35078 5482 i 2 3600 0 0 123038 14151 p 2 0 3401 199 18611 4761 p 2 0 3022 578 10761 3741 p 2 0 3192 408 14175 4098 p 2 0 3219 381 12879 4089 p 2 0 3056 544 11532 3840 p 2 0 2797 803 9561 3425 p 2 0 2799 801 9592 3453 p 2 0 3195 405 12876 4141 p 2 0 3175 425 12919 4028 p 2 0 3237 363 14183 4111 p 2 0 3126 474 13004 3886 p 2 0 3193 407 13418 4064 p 2 0 3150 450 12484 3954 p 2 0 2696 904 9332 3285 p 2 0 2374 1226 7748 2854 p 2 0 2628 972 8548 3149 p 2 0 2813 787 9636 3379 p 2 0 2287 1313 7103 2762 p 2 0 2533 1067 8400 3052 p 2 0 3016 584 11488 3775 p 2 0 2993 607 10400 3748 p 2 0 3018 582 11630 3775 p 2 0 2682 918 8994 3278 p 2 0 3031 569 10511 3775 p 2 0 3194 406 13569 4066 p 2 0 2565 1035 8553 3120 p 2 0 2627 973 8593 3172 p 2 0 2509 1091 8158 3062 p 2 0 2526 1074 8084 3081 p 2 0 2375 1225 8002 2937 p 2 0 2472 1128 7738 3029 p 2 0 2921 679 10544 3642 p 2 0 2672 928 8973 3282 p 2 0 3029 571 12377 3759 p 2 0 2913 687 10446 3598 p 2 0 2681 919 9530 3316 p 2 0 2854 746 10280 3485 p 2 0 2506 1094 8416 3025 p 2 0 2627 973 9054 3186 p 2 0 2698 902 9083 3301 p 2 0 2695 905 9399 3293 p 2 0 2174 1426 6990 2673 p 2 0 2178 1422 6762 2679 p 2 0 2902 698 9692 3637 p 2 0 2965 635 10256 3696 p 2 0 3009 591 11747 3742 p 2 0 2911 689 10726 3538 p 2 0 2983 617 10381 3681 p 2 0 2807 793 9596 3475 p 2 0 2563 1037 8463 3161 p 2 0 2940 660 10522 3641 p 2 0 2759 841 9750 3436 p 2 0 2370 1230 7420 2883 p 2 1 2168 1431 6678 2653 p 2 0 2432 1168 7748 2946 p 2 0 2825 775 10206 3519 p 2 0 2965 635 10714 3680 p 2 0 2981 619 10970 3728 p 2 0 2821 779 9397 3452 p 2 0 2832 768 9989 3519 p 2 0 2956 644 10618 3664 p 2 0 2466 1134 8275 3029 p 2 0 2850 750 10298 3488 p 2 0 2608 992 8736 3192 p 2 0 2511 1089 8065 3065 p 2 0 2270 1330 7269 2777 p 2 0 2213 1387 6741 2712 p 2 0 2981 619 11835 3769 p 2 1 2625 974 8737 3230 p 2 0 2928 672 10838 3613 p 2 0 2729 871 9320 3366 p 2 0 2756 844 9352 3409 p 2 0 2958 642 11582 3661 p 2 0 2413 1187 8031 2956 p 2 0 2723 877 9467 3343 p 2 0 2873 727 10084 3537 p 2 0 2761 839 9168 3424 p 2 0 2379 1221 7549 2954 p 2 0 2634 966 8917 3262 p 2 0 2848 752 9984 3509 p 2 1 2548 1051 8443 3093 p 2 0 2983 617 12248 3727 p 2 0 2859 741 10314 3481 p 2 0 2853 747 10972 3516 p 2 0 2639 961 8627 3216 p 2 0 2174 1426 6617 2666 p 2 0 2665 935 8617 3228 p 2 0 2662 938 8779 3260 p 2 0 2981 619 11089 3696 p 2 0 2584 1016 8534 3143 p 2 0 2535 1065 7982 3076 p 2 0 3072 528 11154 3891 p 2 1 2703 896 9139 3324 p 2 0 2931 669 11333 3591 p 2 0 2879 721 10445 3510 p 2 0 2759 841 9648 3377 p 2 0 2881 719 10166 3484 p 2 0 2281 1319 7134 2749 p 2 0 2119 1481 6654 2589 p 2 0 2508 1092 8364 3054 p 2 0 2524 1076 8057 3065 p 2 0 2393 1207 7452 2904 p 2 0 1938 1662 5792 2391 p 2 0 3142 458 11628 3968 p 2 0 2906 694 10515 3624 p 2 0 2991 609 11363 3718 p 2 0 2755 845 9439 3316 p 2 1 2895 704 10268 3574 p 2 0 2851 749 10166 3477 p 2 0 2352 1248 7204 2858 p 2 0 2337 1263 7581 2843 p 2 0 2714 886 8988 3331 p 2 0 2397 1203 7455 2922 p 2 0 2727 873 9625 3294 p 2 0 2928 672 10973 3641 p 2 0 2628 972 8646 3200 p 2 0 2382 1218 7721 2887 p 2 0 2698 902 9469 3271 p 2 0 2938 662 10375 3578 p 2 0 2645 955 8825 3199 p 2 0 2826 774 10172 3482 p 2 0 2352 1248 7258 2837 p 2 1 2565 1034 8455 3106 p 2 1 2577 1022 8409 3133 p 2 1 2435 1164 7673 2973 p 2 0 2258 1342 7201 2787 p 2 0 2769 831 9894 3400 p 2 0 3051 549 11363 3858 p 2 0 2809 791 9742 3497 p 2 0 2943 657 10881 3638 p 2 0 2664 936 8899 3217 p 2 1 2858 741 10534 3492 p 2 1 2644 955 9397 3224 p 2 0 2253 1347 7238 2754 p 2 0 2550 1050 8325 3070 p 2 0 2324 1276 7517 2853 p 2 0 2739 861 9707 3358 p 2 1 2376 1223 7466 2902 p 2 0 1876 1724 5623 2332 p 2 0 2871 729 10576 3558 p 2 0 2753 847 9098 3420 p 2 0 2926 674 10992 3611 p 2 0 2766 834 9998 3346 p 2 0 2908 692 10465 3618 p 2 0 2822 778 9620 3492 p 2 0 2505 1095 8238 3094 p 2 0 2712 888 8980 3315 p 2 0 2765 835 9469 3394 p 2 0 2697 903 8727 3328 p 2 0 2323 1277 7196 2846 p 2 0 2395 1205 7413 2929 p 2 0 2899 701 10583 3583 p 2 0 3003 597 12426 3772 p 2 0 3078 522 13005 3837 p 2 0 3087 513 11682 3814 i 2 3600 0 0 79651 12195 p 2 0 3361 239 21317 4787 p 2 0 3361 239 19658 4596 p 2 0 3421 179 20276 4697 p 2 0 3265 335 19402 4499 p 2 1 3266 333 18282 4490 p 2 0 3256 344 18754 4474 p 2 0 3182 418 18340 4433 p 2 0 3511 89 20761 4879 p 2 0 3333 267 19037 4651 p 2 1 3507 92 20935 4816 p 2 0 3434 166 21248 4732 p 2 0 3364 236 20885 4540 p 2 0 3485 115 21609 4821 p 2 4 3311 285 20719 4532 p 2 1 3257 342 19740 4538 p 2 3 3199 398 20019 4456 p 2 1 3215 384 18937 4431 p 2 0 3258 342 20071 4589 p 2 0 3384 216 22967 4821 p 2 1 3514 85 22796 4955 p 2 0 3316 284 20614 4726 p 2 0 3450 150 22455 4879 p 2 0 3430 170 22907 4875 p 2 0 3436 164 21511 4786 p 2 0 3378 222 21956 4770 p 2 0 3280 320 19603 4527 p 2 1 3280 319 20026 4558 p 2 0 3297 303 20072 4640 p 2 0 3223 377 20720 4662 p 2 0 3381 219 22994 4858 p 2 0 3238 362 22768 4816 p 2 0 3483 117 23705 5071 p 2 1 3308 291 22654 4862 p 2 0 3452 148 23251 4927 p 2 12 3507 81 25490 5124 p 2 0 3374 226 23692 4863 p 2 6 3208 386 22122 4710 p 2 0 3238 362 22376 4691 p 2 0 3314 286 22920 4819 p 2 0 3470 130 24037 5091 p 2 0 3205 395 21932 4622 p 2 0 3188 412 20599 4584 p 2 0 3136 464 20828 4438 p 2 0 3413 187 22826 4939 p 2 0 3342 258 22209 4716 p 2 0 3489 111 24172 5075 p 2 0 3464 136 24277 4909 p 2 0 3409 191 22676 4729 p 2 1 3342 257 21696 4632 p 2 0 3296 304 22131 4569 p 2 0 3449 151 23632 4825 p 2 0 3365 235 23256 4673 p 2 1 3331 268 23299 4643 p 2 0 3329 271 22926 4794 p 2 0 3318 282 23003 4684 p 2 0 3533 67 23886 5149 p 2 0 3407 193 23205 4804 p 2 0 3454 146 23597 4894 p 2 0 3357 243 24699 4879 p 2 0 3409 191 23046 4856 p 2 0 3484 116 26580 5045 p 2 0 3421 179 23434 4875 p 2 0 3407 193 25753 4951 p 2 0 3384 216 23415 4963 p 2 0 3353 247 23027 4776 p 2 0 3344 256 22142 4863 p 2 0 3413 187 24471 4946 p 2 0 3475 125 24566 5031 p 2 0 3386 214 24748 4828 p 2 4 3459 137 24891 5022 p 2 0 3377 223 25199 4846 i 2 3600 0 0 81272 12388 p 2 0 3263 337 15569 4584 p 2 5 3001 594 10948 3800 p 2 0 2914 686 10028 3679 p 2 2 2776 822 9267 3491 p 2 0 2797 803 9164 3508 p 2 1 2658 941 9528 3272 p 2 0 2639 961 8476 3257 p 2 2 2957 641 10901 3667 p 2 0 2815 785 9491 3421 p 2 2 2974 624 12173 3726 p 2 0 3080 520 12470 3895 p 2 1 2779 820 9654 3410 p 2 0 2675 925 9461 3277 p 2 2 2279 1319 7396 2776 p 2 0 2631 969 8722 3199 p 2 3 2463 1134 8959 3105 p 2 0 2528 1072 7850 3105 p 2 1 2285 1314 7472 2837 p 2 0 2403 1197 7385 2942 p 2 2 2781 817 9654 3425 p 2 0 2546 1054 8590 3110 p 2 2 2870 728 10798 3537 p 2 0 2611 989 9047 3179 p 2 0 2606 994 8489 3168 p 2 0 2500 1100 7767 3031 p 2 0 2189 1411 6965 2672 p 2 0 2430 1170 7986 2918 p 2 168 2342 1090 13637 3733 p 2 258 2383 959 21558 4504 p 2 0 2541 1059 9145 3220 p 2 599 2066 935 31781 5844 p 2 0 2988 612 11483 3731 i 2 3600 0 0 89644 12747 p 2 0 3184 416 12499 4108 p 2 824 2475 301 52767 8074 p 2 0 2911 689 12179 3739 p 2 671 2263 666 42220 7047 p 2 0 2982 618 13993 3892 p 2 297 2754 549 40360 6095 p 2 0 3082 518 15113 4195 p 2 118 2915 567 36544 5403 p 2 0 2731 869 12695 3601 p 2 110 2799 691 36100 5244 p 2 0 3061 539 14225 4083 p 2 1 2896 703 11230 3715 p 2 0 3110 490 14244 4000 p 2 0 3063 537 12484 3782 p 2 2 2950 648 12630 3689 p 2 0 2602 998 9862 3242 p 2 0 2341 1259 8026 2873 p 2 0 2531 1069 9253 3119 p 2 0 2633 967 9293 3227 p 2 0 2522 1078 8295 3078 p 2 0 2491 1109 8954 3060 p 2 0 2496 1104 8617 3089 p 2 0 2812 788 10547 3474 p 2 0 2571 1029 8888 3149 p 2 0 2855 745 10404 3469 p 2 0 2696 904 9473 3244 p 2 1 2618 981 9476 3162 p 2 0 2363 1237 7978 2863 p 2 0 2571 1029 8707 3160 i 2 3600 0 0 68204 11407 p 2 67 3390 143 26660 6041 p 2 0 3187 413 11927 4262 p 2 0 3015 585 13933 4277 p 2 0 2885 715 10225 3638 p 2 0 3058 542 11941 3700 p 2 1 2966 633 12507 3926 p 2 0 3249 351 12667 3964 p 2 0 3086 514 10472 3726 p 2 2 2752 846 12593 3763 p 2 0 2844 756 9173 3439 p 2 0 2579 1021 8769 3126 p 2 1 3036 563 12582 4012 p 2 0 2707 893 9173 3331 p 2 0 2782 818 8764 3382 p 2 1 2940 659 12928 3869 p 2 0 2661 939 8416 3207 p 2 0 2992 608 10350 3585 p 2 0 2961 639 11610 3872 p 2 0 3074 526 11127 3753 p 2 0 2997 603 9820 3571 p 2 0 2558 1042 8791 3084 p 2 0 2612 988 7794 3121 p 2 0 2734 866 9187 3285 p 2 0 2758 842 15050 3279 p 2 0 2652 948 17524 3257 p 2 0 2370 1230 7287 2775 p 2 0 2562 1038 16657 3060 p 2 2 2802 796 17092 3433 p 2 13 2867 720 16494 3597 i 2 3600 0 0 72436 12513 p 2 1600 1967 33 75020 12075 p 2 1414 2089 97 76382 11515 p 2 914 2543 143 75270 10489 p 2 92 3442 66 44729 6992 p 2 38 3434 128 36261 6312 p 2 23 3352 225 22523 5265 p 2 0 3199 401 14797 4513 p 2 0 3131 469 13647 4148 p 2 0 3134 466 12975 3947 p 2 4 2834 762 14171 3577 p 2 0 3296 304 15604 4336 p 2 0 3081 519 12177 3942 p 2 1 3105 494 13774 4014 p 2 0 2929 671 11907 3701 p 2 0 2731 869 11395 3490 p 2 0 2920 680 11708 3688 p 2 0 2549 1051 9925 3181 p 2 0 2745 855 10371 3435 p 2 0 2704 896 10448 3424 p 2 0 2692 908 10670 3404 p 2 0 2426 1174 9174 3034 p 2 0 2508 1092 9641 3127 p 2 0 2850 750 11245 3551 p 2 0 2616 984 9997 3263 p 2 0 2909 691 12315 3642 p 2 0 2848 752 11989 3558 p 2 0 2706 894 11127 3355 p 2 0 2455 1145 9624 3001 p 2 0 2979 621 13975 3983 i 2 3600 0 0 139430 13358 p 2 0 3328 272 16945 4386 p 2 0 3428 172 24400 4858 p 2 330 3155 115 62947 6313 p 2 0 2815 785 11665 3491 p 2 0 3495 105 20759 4896 p 2 0 3050 550 13632 3911 p 2 0 3496 104 23053 4746 p 2 0 3044 556 13125 3834 p 2 318 2805 477 56165 5350 p 2 0 2974 626 14245 3755 p 2 0 2548 1052 9813 3137 p 2 0 2886 714 12631 3622 p 2 0 2836 764 12070 3537 p 2 0 2664 936 10282 3284 p 2 329 2968 303 58642 5900 p 2 0 2660 940 9769 3294 p 2 1 3394 205 19187 4572 p 2 0 3316 284 16380 4346 p 2 0 3390 210 18216 4487 p 2 0 3341 259 17913 4353 p 2 320 2928 352 58018 5600 p 2 0 3223 377 17164 4203 p 2 0 2987 613 12639 3725 p 2 0 3186 414 14363 4079 p 2 0 3022 578 13037 3826 p 2 0 3014 586 12610 3841 p 2 305 2985 310 60018 5898 p 2 0 3087 513 13645 3981 p 2 0 3309 291 16564 4452 p 2 0 2674 926 10691 3438 p 2 0 3351 249 17788 4375 p 2 0 3389 211 18205 4514 p 2 0 3286 314 15165 4277 p 2 0 3165 435 14330 4075 p 2 0 2875 725 11452 3567 p 2 0 3118 482 16899 4053 p 2 0 3107 493 14074 4013 p 2 0 3078 522 15249 4086 p 2 2 3034 564 17018 3952 p 2 1 3017 582 16071 4030 p 2 0 3332 268 18907 4438 p 2 2 3185 413 20882 4356 p 2 0 3323 277 17360 4472 p 2 0 3212 388 16296 4333 p 2 0 3298 302 21461 4541 p 2 0 3135 465 15903 4112 p 2 0 2921 679 13857 3832 p 2 0 3122 478 15449 4087 p 2 0 3087 513 14804 4084 p 2 0 3095 505 15205 4151 p 2 0 2974 626 13234 3863 p 2 0 3053 547 14830 4053 p 2 0 3279 321 16937 4473 p 2 0 3090 510 15465 4179 p 2 0 3365 235 19019 4554 p 2 0 3309 291 18291 4406 p 2 0 3072 528 16129 4026 p 2 0 3286 314 18870 4383 p 2 0 3005 595 13823 3905 p 2 0 3063 537 15110 3967 p 2 0 3113 487 16526 4125 p 2 0 2954 646 15359 3868 p 2 0 2869 731 13874 3698 p 2 0 2877 723 14425 3727 p 2 0 3312 288 17492 4444 p 2 0 3121 479 16648 4168 p 2 0 3341 259 19359 4447 p 2 0 3199 401 16887 4101 p 2 0 3255 345 17535 4314 p 2 0 3322 278 18447 4423 p 2 0 3180 420 17930 4210 p 2 0 3210 390 18012 4227 p 2 0 3076 524 15749 3995 p 2 0 3167 433 16803 4206 p 2 0 2987 613 13995 3833 p 2 0 2995 605 14713 3903 p 2 0 3272 328 16453 4394 p 2 0 3124 476 14667 4051 p 2 0 3362 238 18353 4462 p 2 0 3272 328 16904 4288 p 2 0 3261 339 16879 4303 p 2 0 3262 338 17250 4225 p 2 0 3066 534 14319 3831 p 2 0 3115 485 14845 3933 p 2 0 2852 748 13573 3648 p 2 0 3195 405 16835 4087 p 2 0 2792 808 12627 3490 p 2 0 2989 611 14320 3801 p 2 0 3268 332 16190 4283 p 2 0 3174 426 15209 4110 p 2 0 3363 237 19016 4467 p 2 0 3248 352 16449 4189 p 2 0 3191 409 16195 4128 p 2 0 3234 366 18920 4245 p 2 0 3048 552 14982 3902 p 2 0 3350 250 19513 4328 p 2 0 3289 311 17611 4316 p 2 0 3135 465 15312 4013 p 2 0 2937 663 12821 3655 p 2 0 2961 639 13818 3745 p 2 0 3323 277 18213 4427 p 2 1 3057 542 14574 3945 p 2 0 3341 259 18473 4410 p 2 0 3245 355 16815 4260 i 2 3600 0 0 99320 13173 p 2 0 3276 324 16330 4608 p 2 26 3075 499 29810 4761 p 2 0 3019 581 13871 3958 p 2 6 3048 546 25038 4471 p 2 0 2879 721 12750 3739 p 2 2 2950 648 21811 4154 p 2 0 2791 809 11479 3579 p 2 2 3209 389 21893 4507 p 2 0 2963 637 11609 3762 p 2 1 3114 485 13642 3966 p 2 0 2801 799 11894 3480 p 2 0 2907 693 11378 3571 p 2 0 2746 854 10442 3425 p 2 0 2320 1280 8204 2878 p 2 0 2598 1002 9712 3221 p 2 0 2532 1068 9330 3182 p 2 0 2672 928 10347 3342 p 2 0 2500 1100 9062 3102 p 2 0 2543 1057 9254 3128 p 2 0 2906 694 11451 3635 p 2 0 2696 904 10642 3344 p 2 0 2847 753 11383 3533 p 2 0 2577 1023 10095 3211 p 2 0 2753 847 10404 3367 p 2 0 2738 862 10794 3408 p 2 0 2202 1398 7723 2749 p 2 0 2578 1022 9397 3150 p 2 0 2318 1282 8595 2892 p 2 306 2564 730 37990 5544 p 2 0 2564 1036 10823 3325 p 2 201 2569 830 38776 5329 p 2 0 3027 573 14316 3909 p 2 201 2637 762 39682 5488 p 2 240 2804 556 41263 5974 p 2 0 2661 939 11820 3532 p 2 116 2708 776 36750 5189 p 2 0 2559 1041 11781 3350 p 2 160 2713 727 39397 5442 p 2 0 2742 858 12655 3588 p 2 0 2675 925 14328 3622 p 2 0 2201 1399 8275 2762 p 2 0 2379 1221 8969 2978 p 2 0 2581 1019 13062 3441 p 2 0 2881 719 12192 3635 p 2 0 2755 845 11049 3462 p 2 0 2955 645 13335 3720 p 2 0 2700 900 10454 3291 p 2 4 2769 827 11208 3424 p 2 0 2780 820 10462 3373 p 2 0 2387 1213 8053 2929 p 2 4 2659 937 10091 3299 p 2 0 2486 1114 8198 3016 p 2 0 2483 1117 8651 3049 p 2 0 2188 1412 7722 2734 p 2 0 2852 748 11624 3567 p 2 2 2592 1006 10087 3210 p 2 0 2901 699 11696 3640 p 2 0 2257 1343 7544 2768 p 2 0 2611 989 8986 3178 p 2 4 2609 987 9742 3196 p 2 0 2669 931 9975 3259 p 2 0 2187 1413 7621 2704 p 2 4 2120 1476 8239 2653 p 2 0 2418 1182 9017 2936 p 2 0 2465 1135 8306 3005 p 2 4 2283 1313 8391 2834 p 2 0 2049 1551 7466 2528 p 2 0 2578 1022 9742 3189 p 2 4 2431 1165 9619 3042 p 2 0 2858 742 12554 3559 p 2 0 2673 927 10920 3291 p 2 4 2692 904 11072 3326 p 2 0 2625 975 10190 3181 p 2 0 2248 1352 8092 2762 p 2 0 2512 1088 9675 3107 p 2 0 2325 1275 9027 2897 p 2 0 2410 1190 8389 2979 i 2 3600 0 0 109378 13386 p 2 6 3435 159 29233 5637 p 2 0 3380 220 18684 4703 p 2 381 3070 149 40149 6735 p 2 0 3410 190 21486 4805 p 2 0 3073 527 17017 4151 p 2 369 2951 280 37082 6385 p 2 0 3088 512 17071 4234 p 2 0 2837 763 15342 3845 p 2 335 2842 423 36687 6091 p 2 1 2844 755 15265 3852 p 2 0 2913 687 15969 3914 p 2 279 2700 621 36037 5619 p 2 1 2849 750 16181 3888 p 2 1 3232 367 18597 4448 p 2 5 3228 367 19232 4431 p 2 0 3230 370 18772 4341 p 2 0 3054 546 16929 4062 p 2 2 3097 501 17626 4147 p 2 1 3104 495 17234 4084 p 2 0 2749 851 14472 3595 p 2 4 2982 614 16423 3943 p 2 0 2807 793 15060 3690 p 2 1 2846 753 15243 3740 p 2 7 2716 877 15135 3592 p 2 3 2785 812 15428 3646 p 2 0 3157 443 17352 4287 p 2 4 2908 688 15743 3953 p 2 0 3164 436 17957 4259 p 2 0 3136 464 17383 4138 p 2 6 3064 530 16908 4140 p 2 0 3036 564 16356 4029 p 2 1 2759 840 14403 3631 p 2 0 2894 706 16374 3825 p 2 1 2821 778 14439 3725 p 2 1 2772 827 14860 3703 p 2 1 2566 1033 13592 3451 p 2 2 2599 999 14427 3537 p 2 0 3153 447 17357 4241 p 2 0 2909 691 15261 3861 p 2 1 3088 511 17078 4131 p 2 1 3073 526 17513 4198 p 2 7 3006 587 16724 4117 p 2 0 3020 580 16711 4041 p 2 1 2752 847 14767 3657 p 2 5 3048 547 16801 4150 p 2 1 2888 711 15847 3946 p 2 2 2874 724 15489 3879 p 2 7 2427 1166 13876 3336 p 2 0 2454 1146 13595 3348 p 2 0 3030 570 16164 4149 p 2 0 2941 659 16096 3935 p 2 0 2982 618 15721 3945 p 2 0 3016 584 16068 4059 p 2 1 3079 520 16526 4131 p 2 0 3003 597 15899 3972 p 2 0 2601 999 13697 3469 p 2 6 2771 823 15180 3726 p 2 0 2742 858 14298 3634 p 2 0 2819 781 14834 3761 p 2 4 2659 937 14008 3567 p 2 0 2758 842 14458 3685 p 2 0 3026 574 15741 4034 p 2 8 2855 737 15984 3872 p 2 1 2986 613 16160 3958 p 2 0 2951 649 15519 3967 p 2 0 2927 673 15546 3888 p 2 1 3107 492 26647 4191 p 2 1 2845 754 27917 3920 p 2 4 2926 670 29984 4092 p 2 18 2716 866 27580 3927 p 2 30 2818 752 29179 4254 p 2 201 2632 767 29049 4822 p 2 50 2747 803 17966 4024 p 2 58 3036 506 19497 4357 i 2 3600 0 0 80996 12308 p 2 67 3383 150 28510 5379 p 2 42 3380 178 23587 4982 p 2 19 3334 247 31481 4861 p 2 0 3368 232 19090 4628 p 2 0 3293 307 16528 4418 p 2 0 3286 314 14589 4397 p 2 0 3144 456 15128 4241 p 2 0 3165 435 14632 4283 p 2 0 3001 599 12937 3874 p 2 3 2807 790 13738 3828 p 2 1 3304 295 17132 4635 p 2 0 3312 288 18904 4723 p 2 0 3345 255 16488 4548 p 2 0 3279 321 18019 4582 p 2 0 3316 284 16522 4622 p 2 1 3173 426 17603 4474 p 2 0 2962 638 14704 3979 p 2 0 3146 454 16953 4301 p 2 0 2963 637 16254 4165 p 2 0 3173 427 16369 4358 p 2 0 2940 660 13658 3910 p 2 0 2953 647 13730 4033 p 2 1 3252 347 16825 4481 p 2 1 3282 317 18522 4536 p 2 0 3238 362 20544 4407 p 2 0 3238 362 20510 4475 p 2 1 3155 444 19153 4248 p 2 12 3193 395 19293 4466 p 2 16 2819 765 13438 3927 p 2 3 2948 649 21981 4020 p 2 5 3247 348 29607 4591 p 2 18 3043 539 31162 4460 p 2 18 2877 705 24236 4117 p 2 2 2906 692 23731 4173 p 2 0 3301 299 25293 4876 p 2 0 3285 315 19460 4797 p 2 0 3330 270 19062 4727 p 2 1 3335 264 21055 4983 p 2 0 3149 451 18854 4652 p 2 0 3334 266 21359 5190 p 2 0 3176 424 18395 4698 p 2 1 3251 348 18678 4841 p 2 0 3240 360 20030 4919 p 2 1 3148 451 18911 4760 p 2 0 3188 412 19922 4857 p 2 0 3136 464 19838 4707 p 2 2 3383 215 22279 5276 p 2 2 3437 161 21946 5264 p 2 1 3333 266 19899 4940 p 2 3 3346 251 21382 4982 p 2 10 3239 351 19618 4904 p 2 0 3260 340 20372 4905 p 2 1 3143 456 19425 4713 p 2 7 3223 370 22159 5041 p 2 0 3247 353 23228 5199 p 2 2 3345 253 25696 5283 p 2 3 3265 332 21484 5090 p 2 12 3294 294 22029 5167 p 2 3 3378 219 22987 5284 p 2 2 3345 253 22899 5227 p 2 0 3364 236 23137 5248 p 2 1 3258 341 25345 5282 p 2 0 3377 223 26911 5665 p 2 1 3354 245 25439 5416 p 2 10 3111 479 21108 4922 p 2 4 3149 447 22352 4710 p 2 3 3123 474 20001 4681 p 2 2 3223 375 19389 4710 p 2 0 3265 335 17197 4698 p 2 1 3141 458 17178 4494 p 2 0 3346 254 19854 5002 p 2 1 3215 384 19255 4683 p 2 0 3343 257 21776 5018 p 2 1 3339 260 20169 4916 p 2 0 3201 399 25092 4818 p 2 2 3227 371 25471 4774 p 2 4 3060 536 22800 4540 p 2 4 3199 397 25050 4803 p 2 8 3231 361 25545 5106 p 2 28 3136 436 22960 5068 p 2 18 3179 403 22702 4973 p 2 36 3186 378 26233 5134 p 2 52 3358 190 27177 5450 p 2 45 3268 287 26728 5160 p 2 45 3388 167 25894 5267 p 2 32 3359 209 23515 5145 p 2 0 3314 286 20603 4899 p 2 1 3195 404 21020 4705 p 2 1 3056 543 17834 4400 p 2 5 2960 635 19964 4182 p 2 0 3203 397 20279 4730 p 2 0 3102 498 19805 4489 p 2 0 3028 572 15322 4274 p 2 0 3214 386 18370 4495 p 2 0 3337 263 19694 4864 i 2 3600 0 0 116758 12820 p 2 0 3548 52 24486 4995 p 2 0 3283 317 13720 4131 p 2 0 3225 375 13196 4136 p 2 0 3226 374 13851 4057 p 2 0 3076 524 11290 3840 p 2 0 3152 448 12541 3974 p 2 0 3041 559 11306 3803 p 2 0 3108 492 13010 4028 p 2 0 2983 617 10628 3699 p 2 0 3108 492 12464 3963 p 2 0 3349 251 15058 4392 p 2 0 3146 454 12865 4075 p 2 0 3335 265 15119 4319 p 2 20 2919 661 19998 3778 p 2 111 2899 590 33932 4518 p 2 0 3270 330 15418 4214 p 2 0 2906 694 11306 3605 p 2 0 3108 492 14089 3907 p 2 0 3056 544 12137 3777 p 2 0 2836 764 11336 3507 p 2 99 2971 530 34056 4565 p 2 0 2749 851 11065 3473 p 2 0 3273 327 14719 4254 p 2 0 3229 371 16269 4280 p 2 0 3340 260 16438 4365 p 2 0 3257 343 15092 4261 p 2 103 3115 382 35328 4925 p 2 0 3210 390 15592 4217 p 2 0 2945 655 12295 3720 p 2 0 3094 506 13539 3914 p 2 0 3124 476 13808 3982 p 2 0 3103 497 12612 3987 p 2 91 3142 367 33829 4808 p 2 0 2715 885 9910 3372 p 2 0 3132 468 13121 4031 p 2 0 3047 553 14342 4023 p 2 0 3429 171 18699 4635 p 2 0 3260 340 18275 4412 p 2 106 3110 384 36186 4925 p 2 1 3212 387 19761 4445 p 2 0 3030 570 15080 3953 p 2 0 3179 421 16600 4333 p 2 0 3120 480 15950 4176 p 2 0 3165 435 15692 4297 p 2 0 3039 561 14888 4044 p 2 0 3131 469 15598 4167 p 2 0 3294 306 17541 4513 p 2 0 3184 416 15785 4257 p 2 0 3311 289 18301 4485 p 2 0 3288 312 17170 4403 p 2 2 3224 374 17143 4316 p 2 0 3267 333 16770 4351 p 2 0 3082 518 14219 4038 p 2 0 3156 444 15413 4174 p 2 0 3114 486 15493 4182 p 2 0 3052 548 15853 4118 p 2 0 2999 601 14796 3959 p 2 0 3092 508 15929 4162 p 2 0 3175 425 15866 4256 i 2 3600 0 0 106396 13535 p 2 5 3459 136 23949 5391 p 2 0 3302 298 17138 4438 p 2 3 3425 172 19337 4916 p 2 0 3329 271 17772 4677 p 2 0 3207 393 15125 4411 p 2 3 3220 377 16474 4467 p 2 0 3250 350 16594 4479 p 2 0 3217 383 16634 4519 p 2 2 3060 538 14737 4165 p 2 0 3082 518 14289 4257 p 2 0 3363 237 17479 4728 p 2 2 3310 288 16867 4744 p 2 0 3409 191 17791 4694 p 2 0 3301 299 16359 4484 p 2 3 3217 380 16970 4442 p 2 0 3176 424 15752 4409 p 2 2 3009 589 13950 4030 p 2 0 3163 437 15849 4369 p 2 0 3068 532 14609 4202 p 2 0 3255 345 17022 4579 p 2 0 3024 576 15916 4243 p 2 0 3050 550 15753 4429 p 2 1 3292 307 17836 4801 p 2 2 3224 374 17606 4651 p 2 0 3244 356 16844 4520 p 2 0 3136 464 14569 4309 p 2 0 3246 354 17159 4597 p 2 0 3360 240 17287 4776 p 2 0 3036 564 14056 4097 p 2 2 3119 479 13894 4215 p 2 0 3156 444 13713 4290 p 2 0 2972 628 12360 4015 p 2 3 2751 846 12113 3661 p 2 0 2754 846 11845 3808 p 2 0 3263 337 15106 4482 p 2 0 3105 495 14035 4268 p 2 0 3193 407 14233 4315 p 2 0 3294 306 16523 4712 p 2 0 3156 444 17426 4548 p 2 0 3289 311 19869 5000 p 2 0 3260 340 18042 4734 p 2 6 3259 335 18557 4914 p 2 0 3187 413 17794 4728 p 2 0 3157 443 15756 4627 p 2 0 3055 545 15632 4405 p 2 0 3109 491 16154 4415 p 2 0 3308 292 17350 4825 p 2 0 3198 402 16394 4552 p 2 1 3407 192 17597 4857 p 2 0 3338 262 18877 4871 p 2 7 3280 313 17411 4741 p 2 0 3250 350 15457 4669 p 2 0 3116 484 15536 4368 p 2 1 3278 321 17614 4722 p 2 0 3159 441 16422 4659 p 2 0 3252 348 18499 4805 p 2 3 3065 532 17564 4500 p 2 0 3254 346 17827 4837 p 2 0 3357 243 19800 5151 p 2 112 3281 207 36653 5911 p 2 0 3473 127 23192 5418 p 2 0 3405 195 22531 5204 p 2 0 3347 253 23761 5381 p 2 1 3334 265 22940 5259 p 2 0 3204 396 21310 5024 p 2 67 3379 154 39050 6020 p 2 4 3377 219 23648 5476 p 2 1 3290 309 22067 5068 p 2 99 3229 272 53042 6535 p 2 11 3169 420 21176 4820 p 2 15 3470 115 23474 5618 p 2 176 3293 131 67390 7321 p 2 7 3525 68 25939 5902 p 2 2 3454 144 24155 5324 p 2 0 3409 191 22651 5275 p 2 4 3421 175 26265 5474 p 2 0 3296 304 21651 5054 p 2 75 3412 113 36499 5903 p 2 0 3488 112 25119 5480 p 2 2 3381 217 24158 5278 p 2 1 3304 295 21627 4960 p 2 0 3148 452 18933 4593 p 2 0 3445 155 22903 5335 p 2 104 3360 136 36646 5935 p 2 0 3447 153 21485 5122 p 2 0 3452 148 22646 5266 p 2 206 3164 230 56487 6954 p 2 0 3299 301 21961 5031 p 2 0 3278 322 19659 4856 p 2 196 3196 208 58283 6923 p 2 7 3390 203 26129 5519 p 2 0 3457 143 24345 5252 p 2 788 2667 145 76627 8892 p 2 15 3449 136 34260 5868 p 2 18 3511 71 32655 5914 p 2 902 2474 224 79015 9231 p 2 4 3462 134 23103 5412 p 2 0 3295 305 20732 4801 p 2 0 3336 264 21971 5047 p 2 1 3401 198 23218 5153 p 2 2 3220 378 19919 4758 p 2 9 3258 333 23269 4921 p 2 4 3237 359 20272 4824 p 2 0 3312 288 21505 4970 p 2 69 3280 251 26625 5493 p 2 24 3236 340 23091 5065 p 2 0 3421 179 21854 4933 p 2 12 3296 292 21403 4856 p 2 0 3367 233 19127 4708 p 2 1 3349 250 20616 4848 p 2 6 3233 361 19621 4654 p 2 0 3238 362 20143 4703 p 2 0 3068 532 20241 4595 p 2 7 3219 374 20831 4768 p 2 0 3135 465 16749 4401 p 2 0 3215 385 21493 4812 p 2 3 3131 466 19479 4509 p 2 26 3159 415 24675 5140 p 2 20 3294 286 24437 5242 p 2 0 3142 458 20155 4576 p 2 0 3374 226 19391 4744 p 2 0 3362 238 20158 4734 p 2 10 3229 361 20217 4711 p 2 0 3174 426 20390 4689 p 2 4 3108 488 20544 4648 p 2 413 3041 146 68817 7837 p 2 0 3441 159 27968 5668 p 2 2 3281 317 25538 5227 p 2 149 3192 259 60703 6848 p 2 0 3324 276 27586 5285 p 2 0 3522 78 26340 5453 p 2 178 3311 111 64173 7180 p 2 0 3514 86 25279 5360 p 2 1 3352 247 23231 4982 p 2 28 3276 296 26622 5305 p 2 21 3353 226 26061 5326 p 2 0 3286 314 21555 4884 p 2 10 3336 254 25280 5212 p 2 1 3276 323 24871 5117 p 2 0 3187 413 24461 4915 p 2 7 3151 442 25305 4940 p 2 1 3246 353 26790 5146 p 2 3 3489 108 29441 5610 p 2 20 3348 232 28472 5412 p 2 1 3383 216 27824 5226 p 2 0 3326 274 26324 5124 i 2 3600 0 0 121363 13980 p 2 0 3501 99 22228 4817 p 2 0 3242 358 15568 4151 p 2 0 3116 484 13349 3947 p 2 0 2592 1008 9754 3210 p 2 0 2925 675 11360 3599 p 2 0 2733 867 9404 3322 p 2 0 2406 1194 8265 2959 p 2 0 3266 334 14231 4214 p 2 0 3200 400 13666 4091 p 2 0 3329 271 16218 4267 p 2 0 3074 526 13216 3770 p 2 0 3153 447 13208 3998 p 2 0 2993 607 11899 3764 p 2 0 2689 911 9835 3302 p 2 0 2988 612 11738 3712 p 2 0 2792 808 9935 3440 p 2 0 2802 798 10363 3514 p 2 0 2626 974 9438 3244 p 2 0 2766 834 10179 3411 p 2 0 2956 644 11454 3639 p 2 0 2678 922 9233 3245 p 2 0 3088 512 13860 3875 p 2 0 2952 648 11696 3713 p 2 0 2699 901 10261 3346 p 2 0 2706 894 9424 3308 p 2 0 2255 1345 7615 2785 p 2 0 2577 1023 9174 3147 p 2 0 2575 1025 9181 3174 p 2 0 2611 989 9209 3225 p 2 0 2331 1269 8159 2888 p 2 0 2438 1162 8158 2988 p 2 0 2836 764 10288 3495 p 2 0 2694 906 10572 3395 p 2 0 3002 598 13264 3748 p 2 0 2917 683 12016 3614 p 2 0 2634 966 9786 3205 p 2 0 2637 963 9587 3203 p 2 0 2562 1038 10424 3159 p 2 0 2669 931 9737 3268 p 2 0 2394 1206 8114 2935 p 2 0 2407 1193 8222 2975 p 2 0 2318 1282 8303 2875 p 2 0 2361 1239 7880 2907 p 2 0 3052 548 12071 3889 p 2 0 2674 926 9651 3338 p 2 0 2943 657 11625 3621 p 2 0 2879 721 11623 3536 p 2 0 2704 896 10275 3312 p 2 0 2728 872 10728 3405 p 2 0 2398 1202 8245 2930 p 2 0 2762 838 10209 3409 p 2 0 2457 1143 8481 3014 p 2 0 2336 1264 8092 2896 p 2 0 2434 1166 8773 3004 p 2 0 2376 1224 7912 2907 p 2 1 2726 873 10101 3351 p 2 0 2876 724 10334 3568 p 2 0 3056 544 13266 3816 p 2 0 2841 759 11010 3481 p 2 0 2954 646 12785 3673 p 2 0 2746 854 10714 3407 p 2 0 2428 1172 8471 2979 p 2 0 2728 872 10439 3363 p 2 0 2641 959 9018 3241 p 2 0 2574 1026 9813 3223 i 2 3600 0 0 93887 12789 p 2 0 3377 223 15331 4441 p 2 0 3503 97 22768 5202 p 2 0 3329 271 18273 4710 p 2 0 3389 211 20346 4712 p 2 0 3299 301 17313 4532 p 2 0 3368 232 16299 4676 p 2 0 3404 196 18276 4742 p 2 0 3222 378 15015 4394 p 2 0 3086 514 13573 4094 p 2 3 3348 249 18938 4740 p 2 2 3213 385 16964 4500 p 2 0 3104 496 16859 4378 p 2 0 3262 338 21626 4557 p 2 0 3406 194 28751 5067 p 2 1 3376 223 27498 5018 p 2 7 3417 176 28034 5122 p 2 44 3344 212 27544 5237 p 2 193 3176 231 32268 5850 p 2 44 3099 457 18889 4631 p 2 57 3217 326 19923 4666 p 2 69 3238 293 20170 4831 p 2 69 3118 413 18411 4653 p 2 43 3059 498 18410 4436 i 2 3600 0 0 86752 12742 p 2 2 3499 99 32379 5838 p 2 0 3568 32 25375 5237 p 2 0 3463 137 23592 4963 p 2 0 3552 48 24851 5088 p 2 0 3461 139 24733 4938 p 2 0 3419 181 22388 4727 p 2 0 3463 137 22982 4881 p 2 0 3415 185 23738 4766 p 2 0 3478 122 25528 4928 p 2 0 3337 263 23722 4741 p 2 0 3335 265 21525 4757 p 2 0 3386 214 22237 4752 p 2 0 3548 52 29570 5486 p 2 2 3551 47 29564 5425 p 2 1 3548 51 32041 5638 p 2 0 3572 28 32192 5581 p 2 0 3565 35 33906 5602 p 2 9 3569 22 31243 5486 p 2 35 3440 125 26852 5101 p 2 58 3390 152 25798 5143 p 2 56 3493 51 27677 5332 p 2 42 3456 102 26652 5206 p 2 26 3508 66 30176 5236 p 2 0 3394 206 22070 4750 p 2 0 3358 242 22615 4829 p 2 0 3546 54 24657 5172 p 2 0 3481 119 24441 5060 p 2 0 3533 67 26981 5111 p 2 0 3533 67 25612 5190 p 2 0 3446 154 23242 4940 p 2 0 3532 68 24792 5113 p 2 0 3380 220 22808 4772 p 2 0 3485 115 26298 4994 p 2 0 3490 110 25673 5077 p 2 0 3444 156 23043 4974 p 2 0 3412 188 23711 4846 p 2 0 3398 202 25570 4862 p 2 0 3412 188 24139 4815 p 2 0 3459 141 24728 5047 p 2 0 3563 37 26143 5219 p 2 0 3514 86 25516 5169 p 2 0 3393 207 22985 4791 p 2 0 3410 190 22904 4875 p 2 0 3410 190 21853 4835 p 2 0 3485 115 26041 5143 p 2 0 3326 274 25288 4747 p 2 0 3478 122 27394 4977 i 2 3600 0 0 98283 12630 p 2 0 2891 709 10469 3578 p 2 0 3530 70 19235 4961 p 2 0 3105 495 12332 4058 p 2 0 3203 397 13759 4185 p 2 0 3032 568 11555 3861 p 2 0 3186 414 12436 4082 p 2 0 3080 520 12105 3935 p 2 99 2911 590 38675 4553 p 2 0 2820 780 10704 3547 p 2 0 2291 1309 8305 2869 p 2 0 2639 961 9364 3283 p 2 0 2883 717 12158 3652 p 2 0 3017 583 12426 3849 p 2 0 3110 490 13512 3962 p 2 0 2897 703 11437 3637 p 2 184 3020 396 43628 4936 p 2 0 2804 796 11550 3504 p 2 0 2861 739 11268 3587 p 2 0 2848 752 10844 3555 p 2 0 2468 1132 8835 3071 p 2 0 2436 1164 8477 2986 p 2 0 2613 987 9106 3251 p 2 0 2719 881 10342 3416 i 2 3600 0 0 138762 14908 p 2 0 2261 1339 7479 2804 p 2 0 3389 211 17938 4582 p 2 0 2943 657 12778 3814 p 2 0 3379 221 18326 4468 p 2 0 3114 486 13286 3999 p 2 0 3190 410 13526 4106 p 2 0 2854 746 10997 3611 p 2 184 2865 551 42408 4799 p 2 0 2818 782 10685 3558 p 2 0 2887 713 10700 3595 p 2 0 2848 752 11046 3559 p 2 0 2978 622 11818 3734 p 2 0 3123 477 13128 3961 p 2 0 3266 334 14617 4258 p 2 0 3216 384 14687 4186 p 2 78 3334 188 51391 5330 p 2 0 3139 461 13854 4018 p 2 0 2970 630 11689 3730 p 2 0 3097 503 14107 3904 p 2 0 2780 820 10607 3413 p 2 0 3114 486 13228 3942 p 2 0 2927 673 10909 3612 p 2 0 3308 292 24499 4598 i 2 3600 0 0 75333 11897 p 2 0 2879 721 12873 3566 p 2 0 3136 464 16764 3961 p 2 80 2566 954 26650 4306 p 2 0 2757 843 13400 3521 p 2 81 2462 1057 25928 4154 p 2 0 2576 1024 12358 3341 p 2 0 2032 1568 6973 2581 p 2 136 2174 1290 31519 3726 p 2 120 2451 1029 28240 4411 p 2 0 2506 1094 9875 3175 p 2 0 2311 1289 9411 2924 p 2 177 2393 1030 26452 4452 p 2 153 2576 871 28772 4603 p 2 0 2402 1198 11496 3129 p 2 0 2317 1283 10619 2909 p 2 210 2445 945 48262 4777 p 2 0 2327 1273 10048 2950 p 2 11 2609 980 23842 3878 p 2 0 2277 1323 9930 2926 p 2 117 2219 1264 21403 3765 p 2 0 2256 1344 10410 2963 p 2 85 2140 1375 19206 3514 p 2 0 2308 1292 10773 3092 p 2 118 2344 1138 36472 3908 p 2 133 2260 1207 18686 3771 p 2 0 2414 1186 9722 3118 p 2 0 2137 1463 8777 2685 p 2 65 2218 1317 15375 3332 p 2 0 2268 1332 10028 3007 p 2 0 2230 1370 7510 2701 p 2 22 2103 1475 9719 2782 p 2 188 1974 1438 30530 3594 p 2 0 2127 1473 9787 2708 p 2 0 2309 1291 10220 2900 p 2 0 2121 1479 8308 2670 i 2 3600 0 0 106591 13040 p 2 0 3371 229 14990 4425 p 2 0 3479 121 18606 4742 p 2 0 3241 359 13189 4132 p 2 134 3232 234 34642 5187 p 2 0 3284 316 14541 4244 p 2 0 3084 516 11719 3864 p 2 0 2934 666 10775 3664 p 2 0 2704 896 9209 3339 p 2 0 2984 616 11259 3721 p 2 0 2614 986 8819 3207 p 2 0 2737 863 9728 3357 p 2 185 2980 435 42068 4847 p 2 0 2918 682 10722 3669 p 2 0 3323 277 15317 4261 p 2 0 3011 589 11408 3709 p 2 0 3135 465 12636 3893 p 2 0 2858 742 11027 3471 p 2 0 3061 539 11789 3742 p 2 0 2751 849 9542 3373 p 2 159 2509 932 35930 4239 p 2 18 3084 498 30607 4578 p 2 0 3044 556 13188 3848 p 2 0 2914 686 11773 3673 p 2 7 3120 473 28814 4491 p 2 0 3270 330 14836 4260 p 2 20 2993 587 28850 4412 p 2 0 2888 712 12113 3612 p 2 189 3167 244 51310 5276 p 2 0 3006 594 12954 3790 p 2 6 3266 328 29414 4720 p 2 0 3326 274 17768 4373 p 2 0 2791 809 10792 3435 p 2 0 2964 636 11245 3678 p 2 1 2758 841 9617 3377 p 2 0 2913 687 10882 3538 p 2 141 2932 527 36383 4696 p 2 0 2361 1239 8160 2913 p 2 0 3162 438 13011 4020 p 2 0 2959 641 11419 3702 p 2 0 3162 438 14640 3995 p 2 0 3111 489 13641 3912 p 2 0 3233 367 13728 4076 p 2 0 3190 410 14164 4004 p 2 216 2675 709 36034 4709 p 2 0 3084 516 14919 3979 p 2 0 2956 644 12566 3703 p 2 0 2919 681 11836 3668 p 2 0 2599 1001 9379 3200 p 2 0 2589 1011 8595 3194 p 2 0 3177 423 12406 4057 p 2 0 2824 776 9534 3546 p 2 131 3071 398 38236 4843 p 2 0 3058 542 13888 3936 p 2 0 2978 622 10896 3740 p 2 0 3173 427 13109 4072 p 2 0 3144 456 13492 4039 p 2 0 2906 694 10281 3608 p 2 0 2832 768 9543 3537 p 2 0 2248 1352 7603 2824 p 2 186 2796 618 43578 4614 p 2 0 2562 1038 9153 3197 p 2 0 2847 753 10299 3531 p 2 0 2883 717 10998 3605 p 2 0 3035 565 12516 3781 p 2 0 2944 656 11454 3653 p 2 0 2746 854 9475 3378 p 2 0 2146 1454 6883 2698 p 2 130 2529 941 33725 4086 p 2 0 3061 539 13134 3898 p 2 0 2777 823 10191 3436 p 2 0 2702 898 9594 3316 p 2 0 2944 656 10806 3646 p 2 0 3163 437 12839 4137 p 2 0 2823 777 9888 3508 p 2 0 2837 763 11135 3481 p 2 204 2874 522 38944 4834 p 2 0 3029 571 13410 3830 p 2 0 3278 322 13141 4160 p 2 0 3216 384 14093 4124 p 2 0 2659 941 9131 3268 p 2 0 3059 541 11621 3769 p 2 0 2881 719 10450 3520 p 2 0 2104 1496 7008 2652 p 2 118 2786 696 39107 4381 p 2 0 1994 1606 6628 2536 p 2 0 3022 578 12061 3783 p 2 0 2981 619 10951 3782 p 2 0 3186 414 14456 4049 p 2 0 3019 581 12597 3737 p 2 0 3106 494 12565 3888 p 2 0 3087 513 11763 3861 p 2 186 2653 761 48322 4467 p 2 0 2990 610 14006 3770 p 2 0 3138 462 14506 3940 p 2 0 2971 629 11987 3755 p 2 12 2792 796 25128 3991 p 2 2 3140 458 13070 4012 p 2 10 3041 549 24993 4333 p 2 0 2821 779 10514 3489 p 2 142 2885 573 35271 4615 p 2 0 3223 377 16287 4189 p 2 10 2937 653 25654 4150 p 2 0 3026 574 13181 3781 p 2 0 2615 985 9782 3235 p 2 12 2925 663 25162 4143 p 2 0 3101 499 13829 3902 p 2 0 2991 609 12556 3686 p 2 201 2807 592 43819 4819 p 2 0 2769 831 11796 3465 p 2 0 2779 821 12043 3480 i 2 3600 0 0 71262 11658 p 2 0 3393 207 15793 4240 p 2 0 3165 435 11789 3778 p 2 0 2826 774 8860 3439 p 2 0 2912 688 10492 3536 p 2 134 2663 803 30003 4196 p 2 0 2663 937 9700 3223 p 2 0 2680 920 8679 3214 p 2 0 2783 817 9303 3303 p 2 0 2848 752 10507 3405 p 2 0 2750 850 9788 3300 p 2 0 2848 752 11393 3509 p 2 0 2790 810 10050 3326 p 2 201 2818 581 34775 4478 p 2 0 2798 802 11809 3428 p 2 0 2575 1025 9195 3060 p 2 0 2800 800 11088 3458 p 2 0 2714 886 8266 3144 p 2 0 2581 1019 8775 3069 p 2 0 2704 896 8790 3176 p 2 0 2445 1155 7383 2866 p 2 141 2646 813 32497 4177 p 2 0 2701 899 10796 3329 p 2 1 2806 793 10783 3371 p 2 0 2671 929 9519 3200 p 2 0 2935 665 11233 3486 p 2 0 2861 739 10327 3418 p 2 0 2679 921 8796 3173 p 2 0 2401 1199 7791 2882 p 2 187 2593 820 41740 4161 p 2 0 2446 1154 8962 2992 p 2 0 2559 1041 8320 3050 p 2 0 2508 1092 8379 3044 p 2 0 2626 974 9603 3115 p 2 0 2471 1129 8634 3051 p 2 0 2680 920 9909 3268 p 2 0 2588 1012 8291 3056 p 2 136 2705 759 31474 4198 p 2 0 2794 806 11507 3432 p 2 0 2398 1202 8878 2956 p 2 0 2536 1064 8662 3029 p 2 0 2416 1184 7871 2808 p 2 0 2301 1299 7654 2800 p 2 0 2624 976 8996 3140 p 2 0 2691 909 8927 3231 p 2 212 2741 647 35394 4494 p 2 0 2792 808 11283 3450 p 2 0 2545 1055 8446 3043 p 2 0 2311 1289 7359 2752 p 2 0 2646 954 8411 3124 p 2 0 2698 902 8785 3225 p 2 0 2479 1121 8370 2858 p 2 0 2592 1008 8416 3074 p 2 110 2565 925 37696 3991 p 2 0 2650 950 9079 3219 p 2 0 2674 926 9553 3204 p 2 0 2458 1142 8674 2962 p 2 0 2520 1080 8600 2949 p 2 0 2240 1360 7318 2675 p 2 0 2568 1032 9386 3141 p 2 0 2616 984 9156 3081 p 2 188 2719 693 44167 4316 p 2 0 2452 1148 9388 2897 p 2 0 2587 1013 10627 3109 p 2 0 2447 1153 9558 2973 p 2 0 2433 1167 8665 2903 p 2 0 2452 1148 8404 2929 p 2 0 2407 1193 7559 2857 p 2 0 2447 1153 8262 2941 p 2 133 2672 795 36422 4203 p 2 0 2740 860 10175 3315 p 2 0 2551 1049 8263 3026 p 2 0 2380 1220 8208 2863 p 2 0 2895 705 11740 3528 i 2 3600 0 0 122419 13491 p 2 0 3396 204 20814 4640 p 2 0 2706 894 9651 3460 p 2 197 2999 404 41684 5024 p 2 0 3191 409 13378 4137 p 2 0 3075 525 11556 3936 p 2 0 3148 452 12248 4101 p 2 0 2989 611 10755 3794 p 2 0 3137 463 11696 4015 p 2 0 3339 261 13788 4435 p 2 0 3006 594 10820 3853 p 2 132 3217 251 38023 5257 p 2 0 3314 286 16803 4397 p 2 0 3260 340 14659 4297 p 2 0 3233 367 13619 4173 p 2 0 2921 679 11028 3669 p 2 0 3062 538 11940 3818 p 2 0 3013 587 11239 3796 p 2 0 2865 735 10218 3620 p 2 189 2854 557 40759 4738 p 2 0 2114 1486 7016 2705 p 2 0 3195 405 12425 4162 p 2 0 3027 573 10926 3879 p 2 0 3214 386 13563 4174 p 2 0 2795 805 10494 3508 p 2 0 2851 749 10353 3550 p 2 0 2863 737 10419 3566 p 2 131 2613 856 31575 4220 p 2 0 2919 681 11859 3714 p 2 0 3014 586 11326 3798 p 2 0 2823 777 10073 3508 p 2 0 2498 1102 8397 3081 p 2 0 2469 1131 8296 3073 p 2 0 2882 718 10459 3662 p 2 0 3010 590 11345 3836 p 2 187 2990 423 47609 5012 p 2 0 2866 734 12736 3716 p 2 0 3130 470 12938 3966 p 2 0 2960 640 11510 3754 p 2 0 2650 950 9071 3308 p 2 0 2958 642 11100 3765 p 2 0 2795 805 9397 3489 p 2 0 2882 718 9939 3640 p 2 129 2882 589 37266 4660 p 2 0 2283 1317 7850 2867 p 2 0 3233 367 14210 4322 p 2 0 2970 630 11425 3811 p 2 0 3135 465 13865 4025 p 2 0 3033 567 12554 3817 p 2 0 2929 671 11305 3616 p 2 0 3104 496 13759 3980 p 2 197 2747 656 44268 4745 p 2 0 2803 797 12930 3613 p 2 0 2905 695 12847 3719 p 2 0 2827 773 10125 3565 p 2 0 2640 960 8989 3305 p 2 0 2647 953 9088 3306 p 2 0 3126 474 12475 4090 p 2 0 2976 624 10557 3788 p 2 139 3138 323 37630 5147 p 2 0 3159 441 14634 4117 p 2 0 3116 484 12512 4008 p 2 0 3136 464 12520 4079 p 2 0 2913 687 11306 3737 p 2 0 2996 604 11685 3809 p 2 0 2912 688 10665 3650 p 2 0 2943 657 10657 3768 p 2 209 2925 466 40529 4973 p 2 0 2274 1326 7624 2905 p 2 0 3057 543 12426 3963 p 2 0 3073 527 11654 3899 p 2 0 3023 577 11832 3865 p 2 0 3213 387 12412 4152 p 2 0 2840 760 9905 3561 p 2 0 2642 958 8670 3270 p 2 138 2903 559 33248 4721 p 2 0 2959 641 11638 3821 p 2 0 2885 715 10457 3666 p 2 0 2769 831 9422 3496 p 2 0 2700 900 9240 3393 p 2 0 3131 469 11700 4048 p 2 0 2920 680 10652 3729 p 2 0 2776 824 10391 3494 p 2 188 3089 323 53655 5206 p 2 0 2998 602 12437 3839 p 2 0 2893 707 10397 3587 p 2 0 2877 723 11200 3600 p 2 0 2512 1088 8628 3103 p 2 0 3018 582 12006 3813 p 2 0 2762 838 10009 3484 p 2 0 2718 882 9743 3431 p 2 141 2840 619 32922 4614 p 2 0 3216 384 14385 4264 p 2 0 2823 777 10508 3562 p 2 0 3231 369 13685 4185 p 2 0 3122 478 12597 3978 p 2 0 2786 814 10037 3458 p 2 0 2824 776 9567 3505 p 2 0 2047 1553 7210 2631 p 2 188 2644 768 50682 4522 p 2 0 2720 880 10023 3452 p 2 0 3047 553 11986 3812 p 2 0 2819 781 10045 3568 p 2 0 2575 1025 8816 3222 p 2 0 2265 1335 7443 2833 p 2 0 2772 828 10352 3494 i 2 3600 0 0 113503 13348 p 2 141 3358 101 43071 5777 p 2 0 3409 191 17981 4466 p 2 182 3163 255 43583 5991 p 2 0 3289 311 16685 4315 p 2 0 2998 602 11998 3768 p 2 141 3143 316 41617 5709 p 2 0 3173 427 14110 4081 p 2 0 3200 400 14232 4098 p 2 518 2793 289 77533 7333 p 2 4 3532 64 36690 5149 p 2 7 3574 19 37053 5619 p 2 233 3223 144 61208 7244 p 2 6 3546 48 41106 6070 p 2 8 3490 102 39708 5927 p 2 130 3291 179 60357 6819 p 2 13 3378 209 40752 5828 p 2 130 3409 61 60036 6755 p 2 147 3432 21 66383 7480 p 2 1 3496 103 38134 5748 p 2 19 3486 95 34750 5357 p 2 333 3232 35 64956 7417 p 2 0 3331 269 17111 4712 p 2 1 2887 712 11278 3677 p 2 0 2903 697 12400 3641 p 2 207 2970 423 41136 4966 p 2 0 2997 603 12703 3814 p 2 0 2506 1094 8868 3118 p 2 0 3048 552 12174 3894 p 2 0 2689 911 9386 3343 p 2 0 3308 292 14590 4267 p 2 0 3158 442 12229 3968 p 2 0 3050 550 11133 3796 p 2 137 3166 297 35702 5012 p 2 0 2400 1200 7936 3000 p 2 0 3204 396 13942 4098 p 2 2 3183 415 13360 4021 p 2 0 3032 568 12479 3836 p 2 0 3179 421 12556 4035 p 2 0 2881 719 10729 3552 p 2 0 2679 921 8965 3258 p 2 189 2509 902 35899 4212 p 2 0 2986 614 13667 3801 p 2 0 2967 633 10644 3650 p 2 0 2822 778 10006 3511 p 2 0 2573 1027 8862 3206 p 2 0 2469 1131 7955 3038 p 2 0 3050 550 12043 3843 p 2 1 2784 815 10375 3466 p 2 139 2980 481 32990 4717 p 2 0 2998 602 12428 3816 p 2 0 2976 624 11182 3665 p 2 0 2923 677 10700 3621 p 2 0 2612 988 8692 3181 p 2 1 2914 685 10615 3615 p 2 0 2803 797 9347 3456 p 2 0 2784 816 9601 3423 p 2 235 2762 603 28812 4722 p 2 0 2156 1444 6858 2713 p 2 0 3231 369 14238 4099 i 2 3600 0 0 66836 12173 p 2 0 3275 325 17915 4689 p 2 2 3252 346 16045 4359 p 2 1 2910 689 14565 3878 p 2 0 3013 587 14659 4016 p 2 2 2635 963 11552 3456 p 2 2 2791 807 12621 3735 p 2 25 2809 766 16087 4023 p 2 57 2754 789 16870 4185 p 2 70 2688 842 18045 4239 p 2 59 2757 784 18286 4391 p 2 38 2959 603 18358 4594 p 2 11 2951 638 22902 4710 p 2 1 3070 529 24507 4827 p 2 0 2982 618 23815 4729 p 2 0 2807 793 21999 4476 p 2 1 2825 774 19645 4276 p 2 14 2782 804 32126 4303 p 2 1 2840 759 15014 3934 p 2 0 2929 671 14176 3971 p 2 0 2999 601 16407 4248 p 2 1 2704 895 13627 3794 p 2 0 2442 1158 11460 3337 p 2 0 2876 724 13287 3923 p 2 0 2884 716 13567 3932 p 2 0 2975 625 14214 4032 p 2 4 2854 742 13872 3989 p 2 8 2618 974 13310 3764 p 2 9 2841 750 15163 4109 p 2 7 2589 1004 12983 3758 p 2 5 2667 928 13429 3806 p 2 0 2579 1021 12424 3574 p 2 0 2639 961 12193 3602 p 2 1 2555 1044 11181 3390 p 2 0 2383 1217 11033 3210 p 2 1 2850 749 12785 3804 p 2 1 2842 757 13987 3952 p 2 1 2880 719 15203 4163 p 2 0 2870 730 15083 4126 p 2 0 2702 898 13653 3824 p 2 0 2716 884 13732 3897 p 2 0 2594 1006 12224 3576 p 2 0 2651 949 12120 3722 p 2 3 2652 945 13201 3834 p 2 2 2895 703 16921 4374 p 2 1 2846 753 15778 4206 p 2 3 2639 958 13366 3791 p 2 9 2963 628 14990 4329 p 2 14 2725 861 19346 4122 p 2 21 2895 684 21483 4353 p 2 6 3006 588 22165 4641 p 2 9 2827 764 22254 4426 p 2 8 2855 737 19174 4179 p 2 29 2610 961 15751 4083 p 2 2 2639 959 25154 4019 p 2 9 2817 774 35295 4587 p 2 22 2694 884 29129 4489 p 2 27 2604 969 27526 4451 p 2 6 2453 1141 26209 4089 p 2 0 2867 733 27955 4470 p 2 2 2818 780 16842 4213 p 2 4 2887 709 16118 4205 p 2 0 2970 630 16315 4264 p 2 1 2804 795 14515 3980 p 2 0 2758 842 14014 3886 p 2 5 2570 1025 13550 3697 p 2 3 2661 936 13013 3787 p 2 1 2602 997 13455 3697 p 2 0 2661 939 13606 3760 p 2 0 2615 985 13482 3683 p 2 1 2663 936 13429 3763 p 2 1 2938 661 15024 4193 p 2 6 2690 904 13464 3949 p 2 4 2827 769 16249 4220 p 2 6 2785 809 15756 4196 p 2 16 2627 957 15983 4139 p 2 18 2683 899 16619 4331 p 2 7 2559 1034 14643 3950 p 2 7 2794 799 16484 4271 p 2 0 2702 898 14113 3930 p 2 3 2592 1005 13521 3778 p 2 1 2492 1107 12082 3595 p 2 0 2545 1055 12278 3625 p 2 2 2825 773 13897 4023 p 2 0 2709 891 13864 3855 p 2 0 2828 772 14012 3959 p 2 1 2750 849 13280 3879 p 2 1 2632 967 13938 3832 p 2 0 2717 883 13993 4019 p 2 0 2664 936 13210 3819 p 2 0 2846 754 16302 4194 p 2 1 2710 889 14772 4003 p 2 0 2688 912 12733 3759 p 2 0 2608 992 12690 3623 p 2 1 2634 965 12975 3689 p 2 0 2875 725 12581 3897 p 2 1 2834 765 13088 3875 p 2 1 2963 636 15018 4105 p 2 1 2849 750 13111 3899 p 2 5 2695 900 13912 3872 p 2 4 2629 967 13395 3838 p 2 7 2471 1122 11781 3597 p 2 4 2677 919 13421 3832 p 2 0 2732 868 13691 3775 p 2 0 2653 947 12303 3680 p 2 0 2476 1124 11384 3429 p 2 1 2529 1070 12047 3501 p 2 1 2881 718 14184 3977 p 2 0 2702 898 13486 3791 p 2 0 2816 784 14122 3891 p 2 0 2709 891 12862 3773 p 2 0 2722 878 13361 3835 p 2 0 2714 886 13415 3861 p 2 0 2506 1094 13073 3593 p 2 2 2754 844 14885 4007 p 2 0 2642 958 13172 3879 p 2 1 2591 1008 13451 3738 p 2 2 2502 1096 13078 3555 p 2 0 2526 1074 12531 3573 p 2 1 2861 738 15219 4140 p 2 8 2717 875 14661 4092 p 2 14 2873 713 23439 4429 p 2 16 2972 612 25810 4775 p 2 28 2838 734 26616 4643 p 2 0 2818 782 23723 4364 p 2 11 2697 892 21684 4267 p 2 27 2772 801 18185 4518 p 2 19 2897 684 17125 4367 p 2 39 2970 591 20526 4690 p 2 46 2802 752 19658 4529 p 2 42 2744 814 18382 4341 p 2 43 3002 555 20215 4846 p 2 34 2912 654 23680 4727 p 2 10 2865 725 17424 4463 p 2 5 2681 914 16622 4285 p 2 0 2660 940 16078 4106 p 2 0 2776 824 15767 4177 p 2 1 2942 657 17943 4503 i 2 3600 0 0 125964 13116 p 2 0 3267 333 14878 4301 p 2 0 3350 250 15407 4390 p 2 0 3127 473 12535 3967 p 2 0 3070 530 12341 3909 p 2 0 3424 176 14996 4649 p 2 0 2751 849 10208 3497 p 2 0 3370 230 16730 4417 p 2 0 3092 508 12827 3948 p 2 0 3147 453 13596 4046 p 2 0 3185 415 13779 4124 p 2 0 3077 523 12584 3942 p 2 395 2969 236 45809 6059 p 2 0 3245 355 15725 4294 p 2 0 3208 392 15219 4304 p 2 0 3212 388 15273 4173 p 2 0 3139 461 13665 4072 p 2 0 3300 300 16115 4340 p 2 391 2933 276 47689 5902 p 2 0 3288 312 15146 4365 p 2 0 3192 408 14775 4206 p 2 0 3031 569 12240 3915 p 2 0 3118 482 14585 4089 p 2 0 3051 549 12277 3952 p 2 393 2893 314 44934 5991 p 2 0 3208 392 16194 4296 p 2 0 3106 494 14453 4086 p 2 0 3036 564 13527 3934 p 2 0 2852 748 11664 3634 p 2 0 3261 339 16355 4342 p 2 395 2809 396 47705 5732 p 2 0 3347 253 18239 4534 p 2 0 3332 268 15441 4446 p 2 0 3031 569 12220 3866 p 2 0 3095 505 13256 3994 p 2 0 2984 616 12732 3832 p 2 394 2767 439 44414 5779 p 2 0 3183 417 15506 4242 p 2 0 3098 502 16641 4176 p 2 0 3056 544 14577 3978 p 2 1 3214 385 18485 4417 p 2 0 3352 248 19223 4653 p 2 0 3170 430 17112 4384 p 2 0 3202 398 16891 4320 p 2 0 3244 356 16964 4449 p 2 0 3265 335 17625 4484 p 2 0 3234 366 17470 4396 p 2 0 2985 615 14172 3956 p 2 0 3121 479 16477 4129 p 2 1 3098 501 15489 4115 p 2 0 3093 507 15544 4125 p 2 0 2981 619 13864 3906 p 2 0 2856 744 12812 3709 p 2 0 3256 344 17054 4474 p 2 0 2996 604 14701 4071 p 2 0 3318 282 18009 4546 p 2 0 3185 415 17565 4287 p 2 0 3265 335 18500 4510 p 2 0 3231 369 18525 4357 p 2 0 2961 639 13488 3918 p 2 0 3246 354 17091 4318 p 2 0 3174 426 17730 4298 p 2 0 3137 463 17240 4264 p 2 0 2942 658 14600 3916 p 2 0 3024 576 14702 3989 p 2 0 3256 344 17190 4425 p 2 0 3248 352 18871 4440 p 2 0 3306 294 18579 4515 p 2 0 3241 359 17136 4366 p 2 0 3201 399 17084 4315 p 2 0 3142 458 16852 4198 p 2 0 2970 630 15053 3923 p 2 0 3128 472 16324 4131 p 2 0 3124 476 16332 4131 p 2 0 3097 503 16360 4140 p 2 0 3018 582 13468 3901 p 2 0 3110 490 15560 4135 p 2 0 3255 345 16230 4298 p 2 0 3189 411 14828 4248 p 2 0 3425 175 19955 4702 p 2 0 3233 367 16661 4266 p 2 0 3161 439 16132 4141 p 2 0 3186 414 16472 4185 p 2 0 2997 603 13216 3805 p 2 0 3118 482 14805 4022 p 2 0 3102 498 15047 4052 p 2 0 3132 468 15390 4072 p 2 0 3025 575 13421 3887 p 2 0 2722 878 11605 3459 p 2 0 3152 448 15202 4111 i 2 3600 0 0 114674 14262 p 2 0 3463 137 20531 4751 p 2 0 3177 423 13717 4144 p 2 0 2728 872 9966 3438 p 2 0 3054 546 12279 3812 p 2 0 2635 965 9097 3261 p 2 0 2974 626 11091 3694 p 2 0 2806 794 10108 3508 p 2 0 2802 798 10542 3515 p 2 0 2368 1232 7708 2908 p 2 0 1937 1663 6391 2436 p 2 0 3110 490 12057 3987 p 2 0 2886 714 9937 3648 p 2 0 3107 493 12338 3971 p 2 0 3006 594 12346 3760 p 2 0 3009 591 11059 3788 p 2 0 2894 706 10589 3617 p 2 0 2436 1164 8156 3023 p 2 0 2778 822 10414 3447 p 2 0 2704 896 9618 3344 p 2 0 2554 1046 8776 3157 p 2 0 2299 1301 7723 2862 p 2 0 2313 1287 7786 2885 p 2 0 2798 802 9945 3499 p 2 0 2915 685 11005 3747 p 2 0 3107 493 12483 3986 p 2 0 2982 618 11185 3745 p 2 0 3071 529 11749 3892 p 2 0 2942 658 11428 3708 p 2 0 2390 1210 7979 2953 p 2 0 2452 1148 8472 3045 p 2 0 2376 1224 8047 2955 p 2 0 2621 979 9274 3270 p 2 25 2515 1060 15429 3452 p 2 0 2762 838 11872 3582 p 2 0 3010 590 11782 3822 p 2 9 2640 951 15524 3529 p 2 0 2893 707 11190 3622 p 2 0 2833 767 10034 3579 p 2 11 2786 803 15757 3712 p 2 0 2827 773 11446 3533 p 2 0 2461 1139 8511 3071 p 2 1 2812 787 11226 3573 p 2 0 2767 833 9786 3469 p 2 0 2573 1027 9008 3218 p 2 0 2358 1242 7770 2936 p 2 0 1929 1671 6329 2456 p 2 0 2924 676 10715 3643 p 2 0 2590 1010 8993 3224 p 2 0 2846 754 10661 3535 p 2 0 2843 757 11996 3632 p 2 0 2944 656 10774 3739 p 2 0 2847 753 10648 3628 p 2 0 2683 917 9434 3356 p 2 1 2708 891 9770 3406 p 2 0 2712 888 9172 3407 p 2 0 2754 846 9676 3484 p 2 0 2343 1257 8039 2949 p 2 0 2113 1487 7085 2687 p 2 0 2951 649 11767 3716 p 2 1 2811 788 11311 3646 p 2 0 2959 641 12217 3725 p 2 0 2938 662 12150 3694 p 2 0 2835 765 11012 3517 p 2 0 2606 994 9008 3225 p 2 0 2407 1193 8048 2972 p 2 0 2797 803 10905 3524 p 2 0 2818 782 10792 3518 p 2 0 2630 970 9466 3284 p 2 0 2349 1251 8033 2929 p 2 0 2546 1054 8692 3159 p 2 0 3080 520 11643 3999 p 2 0 2665 935 9294 3334 p 2 0 2835 765 11058 3534 p 2 0 2766 834 10186 3404 p 2 3 2857 740 16000 3679 p 2 0 2853 747 11175 3588 p 2 0 2542 1058 12705 3248 p 2 0 2828 772 11152 3494 p 2 2 2806 792 14080 3615 p 2 0 2449 1151 8568 3043 p 2 2 2714 884 13302 3467 p 2 0 2329 1271 8467 2971 p 2 0 3052 548 11232 3880 p 2 0 3027 573 12918 3974 p 2 0 3005 595 11618 3780 p 2 0 2744 856 10193 3381 p 2 0 2834 766 10015 3568 p 2 0 2992 608 11471 3759 p 2 0 2436 1164 8091 2989 p 2 0 2649 951 9137 3223 p 2 0 2790 810 10488 3448 p 2 0 2774 826 12064 3588 p 2 0 2182 1418 6774 2693 p 2 0 2088 1512 6801 2637 p 2 0 2622 978 8856 3251 p 2 0 2723 877 9508 3380 p 2 0 2935 665 11030 3682 p 2 0 2945 655 11295 3739 p 2 0 2861 739 9735 3581 p 2 0 2978 622 12762 3831 p 2 0 2303 1297 7426 2844 p 2 0 2597 1003 8944 3183 p 2 0 2772 828 9325 3434 p 2 0 2763 837 10164 3440 p 2 0 2260 1340 7502 2823 p 2 0 2025 1575 6385 2531 p 2 0 2717 883 9842 3360 i 2 3600 0 0 90654 13173 p 2 3 3556 41 32418 5866 p 2 0 3508 92 25637 5392 p 2 0 3296 304 20483 4738 p 2 0 3344 256 20255 4681 p 2 2 3391 207 22163 4936 p 2 1 3432 167 24567 5025 p 2 0 3385 215 23982 4931 p 2 0 3396 204 24281 5001 p 2 0 3489 111 24559 5085 p 2 0 3393 207 25188 5055 p 2 0 3506 94 26384 5217 p 2 0 3397 203 25257 4939 p 2 0 3502 98 26503 5180 p 2 0 3454 146 26208 5017 p 2 0 3404 196 22227 4820 p 2 0 3487 113 22235 4954 p 2 0 3478 122 23440 4964 p 2 0 3500 100 25903 5023 p 2 0 3435 165 24664 4914 p 2 0 3348 252 23671 4740 p 2 0 3424 176 24547 4927 p 2 0 3387 213 26071 4932 p 2 0 3410 190 25117 5050 p 2 0 3410 190 24513 5063 p 2 0 3445 155 26622 5084 p 2 1 3507 92 28740 5296 p 2 0 3464 136 25458 5049 p 2 0 3424 176 23844 4951 p 2 0 3333 267 22547 4718 p 2 0 3399 201 24236 4912 p 2 0 3376 224 21517 4778 p 2 0 3467 133 20901 4918 p 2 0 3366 234 22503 4706 p 2 0 3498 102 27111 5037 p 2 0 3491 109 26122 5022 p 2 0 3429 171 24939 5014 p 2 0 3474 126 25654 5099 p 2 0 3388 212 27023 5128 p 2 0 3390 210 23932 5051 p 2 0 3382 218 24998 5049 p 2 0 3321 279 24730 4897 p 2 0 3503 97 28131 5286 p 2 0 3462 138 25989 5110 p 2 0 3398 202 24160 4912 p 2 0 3354 246 22269 4705 p 2 0 3331 269 22483 4692 p 2 1 3463 136 20647 4817 p 2 0 3432 168 20724 4740 p 2 0 3463 137 24888 4924 p 2 0 3463 137 26108 4890 p 2 0 3372 228 22808 4776 p 2 0 3429 171 25854 4937 p 2 0 3402 198 24174 4957 p 2 0 3418 182 25411 5104 p 2 0 3366 234 24410 4922 p 2 0 3322 278 24062 4764 p 2 0 3276 324 24480 4686 p 2 0 3257 343 23339 4678 p 2 0 3487 113 24222 4993 p 2 0 3454 146 22847 4901 p 2 0 3464 136 21449 4819 p 2 0 3462 138 21606 4797 p 2 0 3425 175 22452 4794 p 2 0 3469 131 25114 4989 p 2 0 3403 197 25013 4769 p 2 0 3404 196 24545 4977 p 2 0 3342 258 24329 4906 p 2 0 3353 247 22571 4807 p 2 0 3365 235 22308 4713 p 2 0 3310 290 24368 4749 p 2 0 3446 154 25529 4912 p 2 0 3384 216 23777 4852 p 2 0 3484 116 23016 4904 p 2 0 3398 202 20627 4665 p 2 0 3424 176 21382 4740 p 2 0 3378 222 22968 4751 p 2 0 3350 250 22772 4661 p 2 0 3368 232 24281 4813 p 2 0 3333 267 23032 4791 p 2 0 3440 160 24954 5017 p 2 0 3416 184 24096 4859 p 2 0 3282 318 22897 4608 p 2 0 3412 188 22118 4628 p 2 0 3287 313 19549 4415 p 2 0 3472 128 20180 4592 p 2 0 3436 164 18980 4596 p 2 0 3231 369 18573 4268 p 2 0 3273 327 21269 4498 p 2 0 3248 352 20220 4405 p 2 0 3282 318 21417 4612 p 2 0 3379 221 24688 4818 p 2 63 3275 262 38075 5666 p 2 0 3150 450 21777 4467 p 2 0 3103 497 20264 4242 p 2 0 3182 418 16841 4289 p 2 34 3231 335 33362 5291 p 2 0 3140 460 15649 4155 p 2 0 3002 598 12816 3809 p 2 44 3051 505 30583 4889 p 2 0 2934 666 12986 3815 p 2 0 2759 841 11215 3479 p 2 30 2963 607 29702 4710 p 2 0 2838 762 11869 3648 p 2 0 2728 872 11376 3484 p 2 0 2455 1145 9012 3108 p 2 0 2316 1284 8678 2963 p 2 0 3088 512 13499 4031 p 2 1 3021 578 12602 3940 p 2 0 2994 606 12915 3881 p 2 0 2845 755 11612 3560 p 2 0 2799 801 11764 3549 p 2 0 2595 1005 11111 3332 p 2 0 2721 879 10857 3537 i 2 3600 0 0 84177 12839 p 2 0 3328 272 15806 4472 p 2 0 3121 479 13048 4095 p 2 0 3168 432 14130 4166 p 2 0 3153 447 13014 4126 p 2 0 3302 298 15692 4403 p 2 0 3043 557 12586 3891 p 2 0 3223 377 14500 4148 p 2 0 3088 512 12733 3956 p 2 0 3195 405 14345 4153 p 2 0 3222 378 14137 4221 p 2 0 2993 607 11585 3812 p 2 0 2760 840 10143 3429 p 2 0 3043 557 12125 3873 p 2 0 3098 502 13560 4089 p 2 0 2835 765 10905 3569 p 2 0 2451 1149 8762 3071 p 2 0 3056 544 12989 3929 p 2 0 2769 831 10634 3531 p 2 0 3006 594 11881 3781 p 2 0 2989 611 12615 3803 p 2 0 2726 874 10404 3422 p 2 0 2885 715 11671 3681 p 2 0 2748 852 10400 3431 p 2 0 2663 937 10084 3384 p 2 0 2929 671 11764 3692 p 2 0 2789 811 10628 3589 p 2 0 2611 989 9826 3288 p 2 0 2574 1026 9552 3269 p 2 0 2885 715 11191 3647 p 2 0 3060 540 13584 3977 p 2 0 2916 684 11134 3656 p 2 0 2878 722 11537 3627 p 2 0 2780 820 10535 3471 p 2 0 2705 895 10011 3388 p 2 0 2609 991 10163 3262 p 2 0 2866 734 12098 3717 p 2 0 2733 867 10555 3473 p 2 0 2754 846 10733 3535 p 2 0 2618 982 9867 3304 p 2 0 2466 1134 10027 3185 p 2 0 3029 571 13691 3922 p 2 0 2837 763 11246 3628 p 2 0 2896 704 11549 3651 p 2 0 2787 813 10647 3506 p 2 0 2695 905 9979 3357 p 2 0 2963 637 13616 3934 p 2 0 2540 1060 9048 3185 p 2 0 2729 871 10416 3446 p 2 0 2702 898 10512 3460 p 2 0 2680 920 9899 3402 p 2 0 2565 1035 9455 3216 p 2 0 2767 833 10539 3542 p 2 0 2897 703 12078 3731 p 2 0 2704 896 10094 3435 p 2 0 2906 694 11258 3662 p 2 0 2675 925 9728 3343 p 2 0 2745 855 11691 3536 p 2 0 2844 756 11590 3665 p 2 0 2631 969 9808 3290 p 2 0 2568 1032 9111 3265 p 2 0 2877 723 11580 3688 p 2 0 2669 931 10830 3465 p 2 0 2674 926 10337 3384 p 2 0 2372 1228 8714 3051 p 2 0 2839 761 11385 3654 p 2 0 2844 756 11649 3669 p 2 0 2896 704 11925 3681 p 2 0 2712 888 10966 3496 p 2 0 2798 802 10530 3514 p 2 0 2685 915 9944 3379 p 2 0 2859 741 11878 3763 i 2 3600 0 0 103823 13483 p 2 0 3419 181 17980 4592 p 2 0 3281 319 14764 4244 p 2 37 3146 417 31376 5011 p 2 0 3316 284 16629 4546 p 2 41 3098 461 30025 4927 p 2 0 2800 800 11308 3598 p 2 0 3183 417 15530 4222 p 2 0 2956 644 12091 3816 p 2 2 2934 664 24528 4311 p 2 0 2984 616 13436 3884 p 2 0 2727 873 10777 3440 p 2 1 3054 545 25505 4491 p 2 0 2887 713 12463 3704 p 2 0 2928 672 12709 3793 p 2 2 3096 502 25671 4564 p 2 0 2335 1265 9106 2950 p 2 0 3079 521 15111 4015 p 2 6 2956 638 24750 4347 p 2 0 2948 652 12781 3792 p 2 0 2740 860 10981 3458 p 2 0 2552 1048 9944 3192 p 2 0 2831 769 12108 3574 p 2 0 2509 1091 10014 3136 p 2 0 2787 813 11402 3521 p 2 1 2743 856 10908 3454 p 2 0 2416 1184 9303 3031 p 2 0 2275 1325 8441 2828 p 2 0 2523 1077 9750 3185 p 2 0 2744 856 10715 3457 p 2 0 2649 951 10601 3334 p 2 0 2720 880 11142 3417 p 2 0 2757 843 11240 3452 p 2 0 2705 895 11247 3399 p 2 0 2485 1115 9076 3091 p 2 0 2181 1419 8289 2729 p 2 0 2473 1127 9310 3111 p 2 0 2375 1225 8879 2979 p 2 0 2327 1273 8997 2913 p 2 0 2495 1105 16664 3205 p 2 3 2547 1050 19818 3404 p 2 17 2951 632 24499 4180 p 2 61 2702 837 27399 4261 p 2 80 2912 608 31093 4728 p 2 121 2810 669 29863 4860 p 2 0 2570 1030 9771 3252 p 2 50 2744 806 14250 3772 p 2 57 2299 1244 11933 3186 p 2 74 2542 984 13975 3588 p 2 67 2449 1084 13715 3455 p 2 42 2738 820 14629 3684 p 2 8 2326 1266 9787 2973 p 2 0 1983 1617 7090 2507 p 2 0 2820 780 11727 3548 p 2 0 2523 1077 9698 3158 p 2 0 2809 791 11609 3544 p 2 0 2615 985 9576 3255 p 2 0 2378 1222 8347 2942 p 2 0 2510 1090 9172 3102 p 2 0 3002 598 12668 3934 i 2 3600 0 0 84901 12349 p 2 0 3469 131 25060 5136 p 2 0 3355 245 20559 4872 p 2 0 3219 381 16563 4435 p 2 0 2968 632 15234 3939 p 2 0 3413 187 18525 4830 p 2 1 3460 139 18135 4962 p 2 12 3447 141 31027 4959 p 2 0 3378 222 18036 4684 p 2 0 3280 320 15944 4409 p 2 2 3260 338 17889 4592 p 2 1 3249 350 16657 4415 p 2 1 3300 299 18679 4693 p 2 0 3277 323 17320 4654 p 2 0 3247 353 17914 4620 p 2 0 3169 431 14780 4330 p 2 1 3152 447 17443 4376 p 2 0 3359 241 18003 4687 p 2 0 3256 344 17702 4544 p 2 0 3416 184 20668 4870 p 2 0 3287 313 16560 4493 p 2 1 3144 455 15559 4262 p 2 0 3317 283 16063 4555 p 2 1 2879 720 13569 3856 p 2 1 3007 592 12975 4082 p 2 0 2962 638 13595 4038 p 2 0 3076 524 15328 4285 p 2 2 3034 564 13252 4025 p 2 2 2909 689 12442 3911 p 2 0 3234 366 14681 4438 p 2 2 3059 539 15089 4220 p 2 2 3244 354 14405 4336 p 2 0 3317 283 16591 4535 p 2 0 3059 541 12877 4091 p 2 1 3240 359 16617 4550 p 2 0 3105 495 14374 4223 p 2 0 3249 351 17645 4614 p 2 0 3193 407 17810 4519 p 2 0 3352 248 25095 5027 p 2 1 3211 388 23706 4668 p 2 0 3169 431 24174 4825 p 2 0 3416 184 25444 5215 p 2 8 3321 271 22840 5188 p 2 36 3401 163 22627 5370 p 2 1 3350 249 20045 5036 p 2 13 3356 231 33612 5311 p 2 23 3280 297 42325 5404 p 2 36 3267 297 56480 5451 p 2 59 3305 236 67617 5741 p 2 97 3247 256 69670 5967 p 2 2 3290 308 25277 4950 p 2 10 3177 413 20136 4806 p 2 0 3157 443 20148 4789 p 2 4 3423 173 23660 5350 p 2 8 3449 143 25738 5596 p 2 1 3485 114 25902 5501 p 2 2 3455 143 26627 5430 p 2 3 3461 136 26654 5652 p 2 8 3416 176 24054 5398 p 2 2 3341 257 22377 5110 p 2 2 3436 162 24030 5259 p 2 0 3374 226 23912 5259 p 2 2 3427 171 27726 5593 p 2 0 3364 236 25090 5380 p 2 0 3336 264 25443 5229 p 2 8 3487 105 25557 5643 p 2 2 3281 317 23100 5006 p 2 3 3421 176 22385 5121 p 2 3 3363 234 20314 4877 p 2 0 3415 185 20125 5048 p 2 0 3451 149 21803 5069 p 2 0 3270 330 17585 4718 p 2 2 3415 183 21779 4962 p 2 0 3386 214 23010 5090 p 2 1 3342 257 21380 4996 p 2 0 3363 237 22092 5047 p 2 2 3213 385 19829 4689 p 2 10 3431 159 22416 5261 p 2 1 3296 303 20809 4945 p 2 1 3423 176 22375 5198 p 2 0 3376 224 21747 5082 p 2 1 3346 253 23909 5144 p 2 3 3200 397 24018 4925 p 2 3 3322 275 22661 4958 p 2 3 3278 319 23244 4913 p 2 2 3233 365 23066 4877 p 2 2 3388 210 21560 5048 p 2 0 3182 418 19222 4658 p 2 1 3169 430 19983 4556 p 2 1 3441 158 22362 5156 p 2 0 3275 325 21124 4843 p 2 0 3460 140 21621 4995 p 2 0 3412 188 21706 4904 p 2 0 3428 172 20740 4970 p 2 0 3334 266 19758 4751 p 2 0 3218 382 18381 4568 p 2 1 3337 262 18845 4669 p 2 0 3368 232 19739 4875 p 2 0 3309 291 18853 4709 p 2 0 3169 431 16754 4424 p 2 0 3286 314 19156 4641 p 2 1 3438 161 21004 5013 p 2 1 3409 190 21173 4928 p 2 0 3427 173 21420 4954 p 2 0 3346 254 21564 4809 p 2 0 3293 307 22025 4866 p 2 0 3304 296 21985 4791 p 2 0 3204 396 17812 4485 p 2 0 3390 210 23317 4892 p 2 0 3286 314 21179 4824 p 2 0 3255 345 20423 4735 p 2 0 3141 459 18573 4454 p 2 2 3234 364 20577 4668 p 2 0 3462 138 25831 5168 p 2 8 3310 282 22324 4835 p 2 0 3427 173 23515 4969 p 2 3 3432 165 26739 5088 p 2 0 3399 201 24940 5019 p 2 6 3428 166 29610 5363 p 2 0 3314 286 26098 4975 p 2 0 3355 245 26120 5045 p 2 7 3427 166 28046 5253 p 2 7 3362 231 25369 5045 p 2 0 3277 323 23863 4829 p 2 0 3386 214 25813 5032 p 2 1 3471 128 28377 5397 p 2 0 3367 233 27494 5203 p 2 0 3481 119 28265 5348 p 2 2 3458 140 31113 5363 p 2 0 3469 131 29740 5393 p 2 0 3388 212 31560 5372 p 2 0 3281 319 29015 5151 p 2 0 3363 237 31346 5206 p 2 0 3319 281 29592 5149 p 2 1 3437 162 28823 5328 p 2 0 3366 234 27673 5074 p 2 0 3333 267 26037 5028 p 2 0 3482 118 27690 5319 p 2 1 3378 221 29451 5238 p 2 0 3489 111 31160 5312 p 2 0 3458 142 30789 5234 p 2 2 3407 191 29683 5209 p 2 0 3256 344 27090 4952 p 2 0 3327 273 27094 4973 p 2 0 3390 210 29575 5243 p 2 2 3400 198 29895 5383 p 2 2 3276 322 29781 5214 p 2 0 3358 242 29682 5245 p 2 0 3317 283 25110 4957 p 2 0 3473 127 25246 5239 p 2 0 3453 147 29862 5429 p 2 0 3466 134 34939 5498 p 2 5 3392 203 35009 5676 p 2 0 3293 307 32275 5339 p 2 4 3308 288 32739 5353 p 2 1 3180 419 29381 4955 p 2 1 3479 120 30891 5412 p 2 3 3404 193 29797 5377 p 2 5 3259 336 28234 5055 p 2 3 3248 349 26946 4969 p 2 5 3326 269 31546 5304 p 2 1 3484 115 31871 5675 p 2 3 3366 231 30873 5370 p 2 6 3483 111 34738 5568 p 2 5 3456 139 32913 5400 p 2 6 3420 174 30969 5401 p 2 53 3243 304 34634 5551 p 2 0 3352 248 34412 5354 p 2 56 3363 181 33312 5556 p 2 8 3297 295 31485 5202 p 2 0 3330 270 28950 5225 p 2 1 3361 238 24684 4973 p 2 1 3454 145 29252 5388 p 2 0 3482 118 28838 5344 p 2 0 3296 304 21084 4776 p 2 1 3435 164 23703 5018 p 2 0 3388 212 21402 4886 p 2 2 3305 293 22697 4840 p 2 2 3319 279 23059 4863 p 2 0 3185 415 21858 4578 p 2 0 3281 319 25576 4914 p 2 0 3220 380 27852 5002 p 2 2 3182 416 22724 4693 p 2 2 3290 308 24666 4818 p 2 1 3170 429 22420 4601 p 2 0 3436 164 27611 5262 p 2 1 3267 332 28558 5097 p 2 0 3481 119 28849 5224 p 2 0 3455 145 28858 5167 p 2 0 3378 222 27801 5068 p 2 0 3401 199 27581 5190 p 2 0 3204 396 23132 4665 p 2 0 3362 238 26509 4945 p 2 0 3328 272 23643 4941 p 2 0 3313 287 25273 5030 p 2 2 3208 390 23049 4635 p 2 0 3203 397 22536 4616 p 2 0 3402 198 23183 5060 p 2 0 3412 188 22163 5001 p 2 0 3481 119 21907 5038 p 2 0 3415 185 20024 4792 p 2 0 3418 182 20983 4902 p 2 0 3385 215 21608 4813 p 2 0 3238 362 18145 4437 p 2 1 3323 276 19671 4735 p 2 0 3361 239 21982 4813 p 2 0 3344 256 24040 4841 p 2 0 3263 337 20393 4620 p 2 0 3124 476 18359 4357 p 2 0 3441 159 23564 5043 p 2 1 3354 245 23700 4963 p 2 0 3503 97 26529 5107 p 2 1 3392 207 23989 4913 p 2 0 3372 228 22204 4902 p 2 0 3363 237 22649 4833 p 2 2 3236 362 19494 4570 p 2 2 3287 311 17980 4502 p 2 1 3336 263 18820 4666 p 2 0 3309 291 18508 4639 p 2 0 3183 417 16574 4283 p 2 0 3278 322 16467 4470 p 2 0 3453 147 21038 4936 p 2 3 3353 244 19654 4798 p 2 0 3409 191 19709 4745 p 2 0 3388 212 21147 4741 p 2 0 3331 269 19160 4753 p 2 0 3289 311 19943 4738 p 2 0 3092 508 16430 4184 p 2 0 3256 344 17957 4497 p 2 0 3286 314 19859 4626 p 2 0 3278 322 17663 4562 p 2 0 3172 428 16769 4285 p 2 0 2947 653 14462 3971 p 2 0 3355 245 20914 4745 p 2 1 3243 356 19159 4506 p 2 1 3424 175 20860 4845 p 2 15 3427 158 27979 5300 p 2 6 3326 268 27519 5028 p 2 3 3245 352 30018 5136 p 2 0 3167 433 25012 4797 p 2 0 3192 408 26149 4837 p 2 0 3089 511 26186 4765 p 2 9 3332 259 28121 5123 p 2 1 3160 439 25324 4848 p 2 0 3184 416 23642 4690 p 2 0 3401 199 26651 5139 p 2 1 3412 187 29627 5308 p 2 2 3512 86 30477 5390 p 2 0 3492 108 31694 5436 p 2 2 3422 176 29457 5266 p 2 7 3420 173 28450 5181 p 2 2 3196 402 26281 4676 p 2 0 3333 267 24554 4763 p 2 0 3232 368 21586 4601 p 2 0 3315 285 25121 4804 i 2 3600 0 0 127656 14432 p 2 0 3468 132 35062 5607 p 2 0 3562 38 30159 5461 p 2 0 3526 74 28104 5326 p 2 0 3565 35 30487 5445 p 2 0 3486 114 28471 5313 p 2 0 3498 102 26118 5137 p 2 0 3406 194 25012 4936 p 2 0 3331 269 25174 4779 p 2 0 3377 223 27679 4908 p 2 0 3294 306 24399 4632 p 2 0 3283 317 22371 4427 p 2 0 3309 291 22944 4507 p 2 0 3276 324 23177 4410 p 2 0 3553 47 24470 4850 p 2 0 3504 96 24032 4938 p 2 0 3553 47 26226 5017 p 2 0 3489 111 25630 4955 p 2 0 3435 165 24877 4767 p 2 0 3462 138 26172 4855 p 2 0 3540 60 29129 5077 p 2 0 3518 82 30369 5335 p 2 0 3491 109 28370 5129 p 2 0 3491 109 27604 5069 p 2 0 3422 178 26646 4987 p 2 0 3410 190 28383 5049 p 2 0 3530 70 27175 5154 p 2 0 3519 81 30042 5375 p 2 0 3565 35 31054 5380 p 2 0 3473 127 30487 5343 p 2 0 3486 114 27592 5059 p 2 0 3419 181 26609 4900 p 2 0 3429 171 26566 4907 p 2 0 3507 93 29095 5112 p 2 0 3432 168 25279 4829 p 2 0 3461 139 22266 4724 p 2 0 3429 171 22408 4705 p 2 0 3432 168 25636 4836 p 2 0 3552 48 28626 5221 p 2 0 3471 129 27542 5067 p 2 0 3559 41 29946 5312 p 2 0 3516 84 29560 5209 p 2 0 3517 83 26830 5087 p 2 0 3517 83 27562 5116 p 2 0 3459 141 25924 4967 p 2 0 3546 54 30585 5279 p 2 1 3518 81 28798 5208 p 2 0 3476 124 25049 4924 p 2 0 3418 182 23853 4787 p 2 0 3413 187 22713 4694 p 2 0 3558 42 23197 4952 p 2 0 3481 119 24420 4920 p 2 0 3544 56 28762 5126 p 2 0 3496 104 28812 5104 p 2 0 3469 131 25483 4943 p 2 0 3477 123 26181 5004 p 2 0 3441 159 25495 4929 p 2 1 3477 122 28899 5151 p 2 0 3489 111 25578 4950 p 2 0 3426 174 21472 4658 p 2 0 3411 189 20726 4609 p 2 0 3480 120 26756 4991 p 2 0 3540 60 26936 5098 p 2 0 3478 122 25043 4946 p 2 0 3527 73 27018 5056 p 2 0 3508 92 26032 5028 p 2 0 3497 103 20667 4750 p 2 0 3487 113 23360 4848 p 2 0 3392 208 22847 4657 p 2 0 3455 145 24547 4862 p 2 0 3451 149 25391 4887 p 2 0 3499 101 19890 4641 p 2 0 3462 138 23368 4776 p 2 0 3387 213 34222 4729 p 2 0 3550 50 39976 5142 p 2 0 3402 198 32561 4485 p 2 1 3525 74 35405 4813 p 2 22 3318 260 30692 4672 p 2 118 3128 354 19647 4754 p 2 17 3209 374 15677 4222 p 2 31 2769 800 12523 3562 p 2 46 2834 720 13572 3757 p 2 45 2517 1038 12772 3390 p 2 42 2686 872 12354 3589 p 2 34 2644 922 11710 3455 p 2 0 2512 1088 8381 3103 p 2 0 3023 577 11295 3775 p 2 0 2695 905 8726 3311 p 2 0 2825 775 9898 3494 p 2 0 2807 793 9443 3421 p 2 4 2471 1125 11029 3052 p 2 0 2640 960 8946 3217 p 2 0 2162 1438 6706 2636 p 2 0 2413 1187 7528 2932 p 2 0 2429 1171 7900 3003 p 2 0 2260 1340 6820 2784 p 2 0 2069 1531 6394 2556 p 2 0 2325 1275 7096 2855 p 2 0 2650 950 8793 3280 p 2 0 2481 1119 7972 3056 p 2 0 2767 833 9663 3404 p 2 0 2545 1055 8390 3082 p 2 0 2560 1040 8294 3096 p 2 0 2475 1125 7930 3005 p 2 0 2061 1539 6367 2539 p 2 0 2417 1183 7578 2952 p 2 0 2251 1349 7205 2794 p 2 0 2205 1395 6890 2751 p 2 0 2010 1590 5999 2496 p 2 0 2301 1299 7263 2830 p 2 0 2410 1190 8109 3024 i 2 3600 0 0 131513 13380 p 2 0 3425 175 16954 4670 p 2 0 3301 299 14853 4284 p 2 0 3238 362 13321 4130 p 2 0 3259 341 14221 4171 p 2 0 3039 561 11083 3779 p 2 0 3135 465 12510 3920 p 2 0 3082 518 11781 3843 p 2 0 3142 458 13291 4061 p 2 0 2993 607 11078 3727 p 2 0 3178 422 12879 4037 p 2 0 3365 235 16522 4396 p 2 262 3124 214 60216 6082 p 2 0 3390 210 18939 4608 p 2 0 3373 227 17037 4446 p 2 0 3245 355 14366 4183 p 2 0 3344 256 17039 4397 p 2 0 3027 573 12614 3814 p 2 236 3023 341 58435 5585 p 2 0 3166 434 14676 4031 p 2 0 3052 548 13022 3898 p 2 0 2908 692 11378 3636 p 2 0 2883 717 12008 3630 p 2 0 3273 327 14913 4232 p 2 282 3053 265 60343 6017 p 2 0 3335 265 19278 4436 p 2 0 3357 243 19067 4563 p 2 0 3250 350 15861 4281 p 2 0 3184 416 14817 4178 p 2 0 3102 498 14304 4039 p 2 231 3021 348 58154 5561 p 2 0 3285 315 16129 4327 p 2 1 3141 458 13350 4080 p 2 0 3036 564 12279 3832 p 2 0 3022 578 11735 3833 p 2 0 3231 369 14167 4224 p 2 252 3067 281 60852 6055 p 2 0 3433 167 21184 4783 p 2 0 3379 221 21139 4638 p 2 0 3245 355 16174 4209 p 2 1 3385 214 21056 4748 p 2 0 3109 491 15813 4030 p 2 0 3159 441 16968 4247 p 2 0 3167 433 17042 4254 p 2 0 3127 473 15669 4161 p 2 0 2899 701 13621 3829 p 2 0 2981 619 14687 3976 p 2 1 3320 279 17872 4634 p 2 0 3091 509 15698 4176 p 2 0 3398 202 19105 4640 p 2 0 3346 254 17866 4516 p 2 0 3263 337 16559 4425 p 2 0 3340 260 18050 4501 p 2 0 3049 551 14248 3966 p 2 0 3241 359 17239 4293 p 2 0 3183 417 16052 4180 p 2 0 3167 433 16546 4292 p 2 0 3039 561 15048 4034 p 2 0 3100 500 15369 4123 p 2 0 3287 313 16465 4486 p 2 0 3053 547 14414 4044 p 2 0 3362 238 19441 4613 p 2 0 3260 340 17619 4359 p 2 0 3144 456 16422 4222 p 2 0 3119 481 15912 4121 p 2 0 3076 524 14832 4062 p 2 0 3134 466 17346 4142 p 2 0 3156 444 17054 4173 p 2 0 3064 536 15514 4009 p 2 0 3020 580 14578 3933 p 2 0 3098 502 15553 4052 p 2 0 3343 257 18356 4562 p 2 0 3250 350 17399 4374 p 2 0 3322 278 18121 4416 p 2 0 3298 302 17525 4392 p 2 0 3334 266 18385 4482 p 2 0 3238 362 17527 4338 p 2 0 2923 677 12560 3736 p 2 0 3040 560 13580 3875 p 2 0 3056 544 14449 3976 p 2 0 3075 525 15180 4019 p 2 0 2953 647 12888 3760 p 2 0 3066 534 14093 3936 p 2 0 3307 293 17549 4362 p 2 0 3092 508 14985 3977 p 2 0 3412 188 20882 4549 p 2 0 3416 184 21160 4573 i 2 3600 0 0 140767 14523 p 2 0 3552 48 30442 5038 p 2 0 3274 326 17202 4212 p 2 0 3302 298 23545 4385 p 2 0 2909 691 12138 3577 p 2 0 2960 640 12340 3608 p 2 0 3070 530 20101 4001 p 2 0 2931 669 11963 3574 p 2 0 3105 495 12506 3891 p 2 0 2555 1045 16672 3391 p 2 0 3327 273 18276 4251 p 2 0 3318 282 17086 4255 p 2 0 3283 317 21645 4308 p 2 0 3297 303 17366 4148 p 2 0 3033 567 13330 3747 p 2 0 3085 515 14751 3866 p 2 0 3016 584 13124 3711 p 2 0 2828 772 11176 3441 p 2 4 2671 925 10707 3289 p 2 0 2529 1071 9393 3058 p 2 0 3022 578 11896 3772 p 2 0 2722 878 9470 3353 p 2 0 3187 413 14785 3993 p 2 0 3066 534 12712 3768 p 2 4 2962 634 12090 3669 p 2 0 2960 640 11460 3632 p 2 0 2600 1000 9550 3185 p 2 0 2942 658 11981 3617 p 2 0 2706 894 10102 3333 p 2 0 2810 790 10188 3426 p 2 0 2669 931 9978 3250 p 2 0 2784 816 10238 3394 p 2 0 3009 591 12866 3752 p 2 2 3024 574 26316 4306 p 2 0 3122 478 13770 3918 p 2 0 2953 647 11639 3654 p 2 9 3011 580 25069 4293 p 2 0 2907 693 12296 3650 p 2 0 2643 957 9706 3255 p 2 21 3046 533 28791 4426 p 2 0 2926 674 12741 3681 p 2 0 2746 854 11276 3407 p 2 19 2636 945 25167 3825 p 2 0 2251 1349 8902 2796 p 2 0 3028 572 13149 3766 p 2 25 2741 834 24988 3947 p 2 0 3162 438 15483 3994 p 2 0 2979 621 12502 3688 p 2 5 2658 937 10271 3293 p 2 0 2747 853 10721 3355 p 2 0 2468 1132 9090 3031 p 2 2 2771 827 10862 3408 p 2 0 2823 777 11506 3461 p 2 0 2629 971 9707 3215 p 2 2 2446 1152 9301 2989 p 2 0 2521 1079 9105 3081 p 2 0 2958 642 11529 3712 p 2 1 2882 717 11493 3565 p 2 0 2992 608 13143 3691 p 2 0 2919 681 11966 3537 p 2 0 2744 856 10804 3352 p 2 0 2599 1001 9384 3160 p 2 0 2261 1339 8021 2792 p 2 2 2697 901 10645 3296 p 2 0 2562 1038 9568 3121 p 2 0 2740 860 10586 3367 p 2 4 2504 1092 9318 3110 p 2 0 2148 1452 7456 2638 p 2 0 2943 657 11149 3671 p 2 2 2598 1000 9883 3242 p 2 0 3128 472 14163 3904 p 2 0 2760 840 10756 3334 p 2 1 2714 885 10731 3305 p 2 0 2739 861 10243 3316 p 2 0 2336 1264 8233 2841 p 2 0 2559 1041 9459 3105 p 2 0 2280 1320 8031 2774 p 2 0 2402 1198 8212 2903 p 2 0 2677 923 9837 3276 p 2 0 2409 1191 8640 2957 p 2 0 2854 746 11530 3509 i 2 3600 0 0 91811 12760 p 2 0 3460 140 23162 4852 p 2 0 3440 160 21853 4495 p 2 0 3456 144 20251 4474 p 2 0 3529 71 20619 4607 p 2 0 3447 153 18600 4327 p 2 0 3449 151 21642 4483 p 2 0 3445 155 20460 4390 p 2 0 3382 218 17788 4202 p 2 0 3374 226 20015 4258 p 2 0 3341 259 19560 4240 p 2 0 3479 121 20090 4509 p 2 0 3331 269 19294 4272 p 2 0 3526 74 21694 4561 p 2 0 3448 152 19438 4324 p 2 0 3417 183 19798 4287 p 2 0 3457 143 19448 4329 p 2 0 3360 240 18209 4113 p 2 0 3412 188 19610 4289 p 2 0 3395 205 18408 4149 p 2 0 3353 247 18051 4163 p 2 0 3324 276 18929 4101 p 2 0 3358 242 21141 4154 p 2 0 3456 144 20354 4357 p 2 0 3414 186 19616 4321 p 2 0 3521 79 23483 4516 p 2 0 3434 166 22481 4447 p 2 0 3424 176 20721 4343 p 2 0 3481 119 21836 4475 p 2 0 3376 224 19771 4196 p 2 0 3408 192 22204 4320 p 2 0 3343 257 20422 4150 p 2 0 3392 208 19793 4193 p 2 0 3352 248 19523 4136 p 2 0 3353 247 20173 4179 p 2 0 3517 83 22597 4556 p 2 0 3391 209 20158 4315 p 2 0 3497 103 23573 4484 p 2 0 3398 202 20701 4267 p 2 0 3310 290 19103 4108 p 2 0 3479 121 20856 4381 p 2 0 3280 320 18450 4115 p 2 0 3366 234 21441 4320 p 2 0 3346 254 20493 4289 p 2 0 3278 322 19310 4152 p 2 0 3350 250 21183 4283 p 2 0 3320 280 20922 4194 p 2 0 3419 181 21324 4365 p 2 0 3441 159 21558 4410 p 2 0 3513 87 24314 4543 p 2 0 3473 127 23330 4412 p 2 0 3438 162 21462 4334 p 2 0 3376 224 21460 4285 p 2 0 3251 349 20527 4083 p 2 0 3416 184 22888 4315 p 2 0 3362 238 21588 4229 p 2 0 3327 273 20241 4172 p 2 0 3335 265 20400 4198 p 2 0 3274 326 21201 4143 p 2 0 3435 165 21979 4416 p 2 0 3395 205 22954 4346 p 2 6 3552 42 29974 4812 p 2 0 3457 143 24909 4481 p 2 0 3508 92 23492 4500 p 2 0 3468 132 22600 4426 p 2 0 3331 269 21208 4252 p 2 0 3341 259 23968 4339 p 2 1 3338 261 22058 4345 p 2 0 3342 258 20520 4286 p 2 0 3286 314 21472 4249 p 2 0 3325 275 23091 4322 p 2 0 3511 89 24132 4640 p 2 0 3419 181 22945 4449 p 2 0 3541 59 27727 4757 p 2 0 3438 162 25391 4554 p 2 0 3345 255 21796 4363 p 2 0 3511 89 25610 4613 p 2 0 3378 222 22935 4403 p 2 0 3536 64 27864 4636 p 2 0 3413 187 24715 4465 p 2 0 3343 257 22025 4273 p 2 0 3219 381 22832 4150 p 2 0 3195 405 22587 4103 p 2 0 3496 104 25227 4628 p 2 0 3429 171 24044 4460 p 2 0 3524 76 28321 4776 p 2 0 3424 176 27206 4497 p 2 1 3358 241 24228 4336 p 2 0 3338 262 23549 4355 p 2 0 3361 239 23658 4379 p 2 0 3426 174 26495 4538 p 2 0 3392 208 25068 4448 p 2 0 3326 274 23243 4344 p 2 0 3288 312 23256 4339 p 2 0 3346 254 25099 4360 p 2 0 3493 107 24833 4622 p 2 0 3462 138 24928 4553 p 2 0 3544 56 29025 4816 p 2 0 3414 186 26092 4564 p 2 0 3522 78 24864 4653 p 2 0 3395 205 23798 4404 p 2 0 3244 356 23810 4256 p 2 0 3447 153 28838 4628 p 2 4 3336 260 25071 4499 p 2 0 3295 305 22649 4389 i 2 3600 0 0 129896 14593 p 2 0 2583 1017 8400 3168 p 2 0 3476 124 19446 4681 p 2 0 2945 655 11898 3718 p 2 0 3460 140 18922 4722 p 2 0 3219 381 14211 4110 p 2 0 3312 288 14830 4278 p 2 0 2911 689 10663 3660 p 2 0 2855 745 10320 3512 p 2 0 2414 1186 7909 2981 p 2 0 2760 840 9871 3429 p 2 0 2032 1568 6095 2475 p 2 0 2488 1112 8294 3030 p 2 0 2709 891 9185 3325 p 2 0 3186 414 13709 4044 p 2 0 2854 746 10599 3552 p 2 0 2974 626 11955 3685 p 2 0 2893 707 10840 3527 p 2 0 3018 582 11304 3769 p 2 0 2975 625 11096 3703 p 2 0 2800 800 10176 3451 p 2 0 2877 723 10489 3555 p 2 0 2761 839 9731 3418 p 2 0 2780 820 9435 3435 p 2 0 2469 1131 8385 3041 p 2 0 2593 1007 8699 3205 p 2 0 2928 672 11091 3675 p 2 0 2670 930 9712 3301 p 2 0 3083 517 13681 3872 p 2 0 3074 526 12805 3838 p 2 0 2918 682 10970 3623 p 2 0 3063 537 12319 3865 p 2 0 2610 990 9837 3234 p 2 0 2803 797 11209 3480 p 2 0 2562 1038 9483 3133 p 2 0 2530 1070 8916 3055 p 2 0 2139 1461 6974 2630 p 2 0 2591 1009 9052 3168 p 2 0 3067 533 11847 3900 p 2 0 2766 834 9880 3451 p 2 0 3038 562 12526 3837 p 2 0 2821 779 10122 3471 p 2 0 2956 644 10694 3685 p 2 0 3041 559 11794 3784 p 2 0 2387 1213 7971 2908 p 2 0 2860 740 10801 3485 p 2 0 2704 896 9771 3321 p 2 0 2611 989 8967 3217 p 2 0 2397 1203 8497 2946 p 2 0 2417 1183 7920 2973 p 2 0 2950 650 10671 3646 p 2 0 2644 956 9268 3271 p 2 0 3003 597 11992 3741 p 2 0 2771 829 10039 3440 p 2 0 2728 872 9575 3391 p 2 0 2863 737 10491 3557 p 2 0 2326 1274 7441 2866 p 2 0 2711 889 9219 3320 p 2 0 2793 807 9956 3468 p 2 0 2599 1001 8728 3222 p 2 0 2351 1249 7970 2922 p 2 0 2515 1085 8535 3107 p 2 0 2818 782 10311 3504 p 2 0 2751 849 10303 3394 p 2 0 2890 710 11201 3568 p 2 0 2897 703 10242 3568 p 2 1 2637 962 9426 3244 p 2 0 2423 1177 8510 2995 p 2 0 2081 1519 7063 2606 p 2 0 2528 1072 8544 3102 p 2 0 2626 974 9283 3241 p 2 0 2779 821 10440 3450 p 2 0 2429 1171 8404 2994 p 2 0 2431 1169 8217 3002 p 2 0 2873 727 10810 3598 p 2 0 2534 1066 8838 3133 p 2 0 2993 607 12824 3727 p 2 0 2887 713 11348 3549 p 2 0 2815 785 10549 3428 p 2 0 2912 688 10916 3596 p 2 0 2359 1241 7714 2898 p 2 0 2506 1094 8576 3070 p 2 0 2443 1157 8108 2994 p 2 0 2427 1173 8043 2964 p 2 0 2658 942 9301 3275 p 2 0 2490 1110 8375 3083 p 2 0 3040 560 11238 3849 p 2 0 2719 881 9557 3410 p 2 0 3086 514 13217 3886 p 2 0 2854 746 10704 3473 p 2 0 2697 903 9741 3299 p 2 0 2778 822 10417 3410 p 2 0 2269 1331 7327 2756 p 2 0 2711 889 9703 3292 p 2 0 2619 981 8700 3184 p 2 0 2440 1160 8155 2991 p 2 0 2290 1310 7817 2800 p 2 0 2114 1486 6843 2604 p 2 0 2840 760 10127 3575 p 2 0 2787 813 9518 3453 p 2 0 3071 529 12624 3866 p 2 0 2748 852 10043 3374 p 2 0 2822 778 9797 3499 p 2 0 2867 733 10573 3514 p 2 0 2356 1244 7684 2868 p 2 0 2729 871 9681 3333 p 2 0 2699 901 9523 3282 p 2 0 2528 1072 8391 3070 p 2 0 2057 1543 6544 2553 p 2 0 2491 1109 8550 3047 p 2 0 2834 766 9991 3496 p 2 0 2915 685 10097 3669 p 2 0 3005 595 11820 3750 p 2 0 2801 799 9674 3455 p 2 0 2894 706 10414 3615 p 2 0 2917 683 10721 3654 p 2 0 2402 1198 7832 2939 p 2 0 2618 982 8943 3185 p 2 0 2468 1132 8229 3009 p 2 0 2523 1077 8431 3066 p 2 0 2290 1310 7379 2806 p 2 0 2388 1212 7877 2909 p 2 0 2985 615 11735 3722 p 2 0 2549 1051 8964 3153 p 2 0 2992 608 12299 3747 p 2 0 2865 735 10570 3570 p 2 0 2788 812 10222 3487 p 2 0 2937 663 11607 3684 p 2 0 2421 1179 8397 3000 p 2 0 2729 871 9327 3323 p 2 0 2612 988 8874 3197 p 2 0 2587 1013 8659 3187 p 2 0 2462 1138 8313 3043 p 2 0 2516 1084 8409 3124 p 2 0 2925 675 11248 3650 p 2 0 2820 780 11198 3534 p 2 0 3045 555 13617 3811 p 2 0 2905 695 20288 3687 p 2 0 2940 660 24130 3811 p 2 0 2897 703 24721 3834 p 2 12 2630 958 22730 3615 p 2 41 2865 694 25609 4196 p 2 184 2620 796 25814 4651 p 2 48 2656 896 13062 3711 p 2 57 2384 1159 11781 3294 p 2 68 2023 1509 10604 2894 p 2 69 2858 673 14672 3987 p 2 42 2753 805 12335 3669 p 2 1 3263 336 16389 4251 p 2 0 3043 557 11632 3797 p 2 0 3094 506 11419 3855 p 2 0 3108 492 12095 3866 p 2 0 2411 1189 7758 2933 p 2 0 2647 953 8823 3245 p 2 0 2492 1108 7893 3050 p 2 0 2610 990 8584 3211 p 2 0 2330 1270 7137 2831 p 2 0 2455 1145 7609 2972 p 2 0 2813 787 9786 3417 i 2 3600 0 0 82412 12374 p 2 0 3454 146 20273 4878 p 2 0 3415 185 19337 4820 p 2 0 3169 431 17381 4439 p 2 0 3072 528 15341 4245 p 2 0 3211 389 14435 4284 p 2 17 2984 599 25194 4123 p 2 0 3253 347 15886 4374 p 2 0 3175 425 16566 4407 p 2 0 3066 534 14521 4086 p 2 0 3008 592 14842 4158 p 2 0 3418 182 19210 4881 p 2 1 3230 369 15148 4387 p 2 0 3257 343 15588 4349 p 2 0 3263 337 15980 4403 p 2 2 3131 467 15214 4237 p 2 0 3267 333 15091 4421 p 2 0 2937 663 11992 3812 p 2 1 3121 478 14511 4188 p 2 1 3150 449 15889 4241 p 2 1 3071 528 16378 4338 p 2 6 3144 450 15642 4382 p 2 0 3076 524 15634 4309 p 2 3 3200 397 16376 4541 p 2 1 3286 313 18929 4818 p 2 0 3328 272 16907 4627 p 2 0 3170 430 17354 4398 p 2 1 3378 221 19317 4834 p 2 0 3279 321 17123 4637 p 2 0 2894 706 15679 3994 p 2 0 3043 557 17024 4273 p 2 1 2956 643 16822 4196 p 2 1 3298 301 16951 4635 p 2 0 3059 541 14887 4161 p 2 0 2985 615 13949 4074 p 2 1 3221 378 16933 4548 p 2 4 3163 433 23776 4766 p 2 2 3345 253 25041 4885 p 2 2 3266 332 25477 5070 p 2 1 3233 366 24920 4970 p 2 24 3206 370 24665 5309 p 2 27 3084 489 19244 4896 p 2 1 3324 275 19881 5115 p 2 10 3360 230 29458 5329 p 2 20 3226 354 35091 5123 p 2 32 3202 366 32142 5074 p 2 36 3217 347 34247 5206 p 2 36 3356 208 34169 5429 p 2 6 3368 226 22472 5143 p 2 1 3368 231 19213 4970 p 2 4 3319 277 19404 4864 p 2 8 3139 453 18246 4726 p 2 2 3337 261 19088 4922 p 2 4 3331 265 19285 4810 p 2 5 3302 293 19428 4939 p 2 4 3194 402 19696 4856 p 2 5 3200 395 19928 4850 p 2 4 3057 539 19831 4756 p 2 2 3190 408 21775 4945 p 2 0 3359 241 21840 5284 p 2 6 3341 253 22900 5269 p 2 1 3422 177 24343 5357 p 2 4 3417 179 24740 5357 p 2 2 3345 253 24376 5437 p 2 9 3417 174 25235 5553 p 2 6 3230 364 22142 5164 p 2 0 3315 285 24012 5298 p 2 5 3200 395 22950 5069 p 2 9 3223 368 22375 5000 p 2 5 3322 273 21646 5079 p 2 2 3236 362 22061 4948 p 2 1 3377 222 25271 5324 p 2 3 3223 374 24905 5118 p 2 6 3413 181 27167 5442 p 2 0 3389 211 21792 4978 p 2 1 3342 257 20431 5052 p 2 3 3327 270 20769 4995 p 2 0 3128 472 17598 4594 p 2 1 3311 288 18667 4745 p 2 10 3204 386 19506 4863 p 2 0 3362 238 22029 4998 p 2 0 3231 369 19478 4744 p 2 2 3200 398 19460 4652 p 2 1 3444 155 21762 5123 p 2 0 3222 378 19500 4671 p 2 2 3387 211 19978 4963 p 2 1 3331 268 19843 4894 p 2 0 3181 419 19236 4720 p 2 1 3197 402 21592 4778 p 2 0 3016 584 19376 4423 p 2 1 3321 278 22188 4951 p 2 2 3334 264 24714 5168 p 2 0 3243 357 22532 4908 p 2 6 3179 415 22799 4860 p 2 0 3163 437 23418 4872 p 2 9 3351 240 27719 5326 p 2 2 3405 193 23082 5139 p 2 1 3448 151 21994 5061 p 2 5 3371 224 23113 4978 p 2 1 3289 310 21827 4882 p 2 0 3162 438 20669 4627 p 2 0 3177 423 21342 4547 p 2 0 3290 310 23526 4793 p 2 2 3182 416 23135 4766 p 2 0 3286 314 21618 4808 p 2 6 3113 481 26989 4776 p 2 0 3362 238 25308 5007 p 2 0 3377 223 22852 4991 p 2 1 3321 278 22374 4840 p 2 1 3447 152 20946 4937 p 2 1 3348 251 20880 4832 p 2 0 3386 214 22600 4983 p 2 0 3423 177 23540 5055 p 2 0 3380 220 25289 5098 i 2 3600 0 0 97927 13311 p 2 0 3449 151 18972 4936 p 2 0 3192 408 13148 4220 p 2 0 3302 298 14315 4374 p 2 10 3261 329 22475 4550 p 2 0 3456 144 25457 4693 p 2 0 2919 681 21770 3797 p 2 0 3263 337 25199 4266 p 2 0 2997 603 22340 3807 p 2 0 2641 959 10332 3349 p 2 0 3300 300 15625 4406 p 2 0 2935 665 11904 3754 p 2 0 3122 478 12534 3992 p 2 0 3193 407 13681 4190 p 2 0 3034 566 12444 3993 p 2 0 2870 730 10760 3612 p 2 0 2946 654 11309 3748 p 2 0 3110 490 12880 3983 p 2 0 3062 538 12224 3891 p 2 0 3181 419 13932 4083 p 2 0 2829 771 10851 3543 p 2 0 2891 709 11425 3651 p 2 0 2867 733 11373 3649 p 2 0 2633 967 9622 3315 p 2 0 2937 663 11655 3692 p 2 0 2853 747 10249 3579 p 2 0 2738 862 10438 3492 p 2 0 2524 1076 9082 3200 p 2 0 2774 826 10151 3506 p 2 0 3119 481 12445 4037 p 2 0 2767 833 10455 3558 p 2 0 3141 459 14230 4095 p 2 0 2997 603 11550 3756 p 2 0 2790 810 10052 3471 p 2 0 2862 738 11084 3615 p 2 0 2605 995 9318 3268 p 2 0 2770 830 10384 3490 p 2 0 2796 804 9860 3539 p 2 0 2927 673 11250 3711 p 2 0 2677 923 9449 3367 p 2 0 2831 769 11809 3690 p 2 0 3207 393 13173 4248 p 2 0 2941 659 11381 3804 p 2 0 3060 540 13104 3937 p 2 0 2917 683 11279 3687 p 2 0 2819 781 11109 3571 p 2 0 2930 670 12034 3726 p 2 0 2462 1138 8886 3082 p 2 0 2806 794 11173 3562 p 2 0 2902 698 11453 3733 p 2 0 2630 970 9779 3343 p 2 0 2617 983 9783 3311 p 2 0 2506 1094 8832 3204 p 2 0 2914 686 11765 3750 p 2 0 2901 699 11338 3692 p 2 0 3063 537 12982 3953 p 2 0 3120 480 12422 3971 p 2 0 3046 554 12477 4011 p 2 0 2983 617 12107 3864 p 2 0 2568 1032 9185 3260 p 2 0 2676 924 9513 3416 p 2 0 2917 683 11899 3831 p 2 0 2762 838 10443 3593 p 2 0 2581 1019 9311 3281 p 2 0 2501 1099 8883 3222 p 2 0 3022 578 12132 3969 p 2 0 2989 611 11844 3902 p 2 0 3238 362 16126 4322 p 2 0 3075 525 12179 3968 p 2 0 2822 778 10668 3617 p 2 0 2896 704 11417 3718 p 2 0 2663 937 10200 3417 p 2 0 2855 745 11583 3705 p 2 0 2830 770 11399 3725 p 2 0 2902 698 11653 3817 p 2 0 2763 837 10518 3535 p 2 0 2894 706 11071 3764 p 2 0 3166 434 14208 4264 p 2 0 2920 680 11668 3739 p 2 0 3040 560 12953 3909 p 2 0 3078 522 13215 4067 p 2 0 2704 896 10726 3493 p 2 0 2964 636 11775 3826 p 2 0 2756 844 11707 3557 p 2 0 2921 679 11742 3748 p 2 0 2914 686 11391 3783 p 2 0 2781 819 10747 3607 p 2 0 2721 879 10225 3485 p 2 0 2772 828 10549 3591 p 2 0 3072 528 13144 4037 p 2 0 2828 772 10935 3668 p 2 0 2961 639 12712 3850 p 2 0 3010 590 13058 3866 p 2 0 3153 447 13893 4246 p 2 0 2952 648 11770 3895 p 2 0 2722 878 10424 3517 p 2 0 2857 743 11022 3692 p 2 0 2827 773 11521 3697 p 2 0 3046 554 11700 3950 p 2 0 2734 866 10483 3501 p 2 0 2727 873 9922 3499 p 2 0 3109 491 13232 4035 p 2 0 2966 634 12321 3841 p 2 0 3169 431 14311 4106 p 2 0 3231 369 14616 4327 p 2 0 3125 475 15299 4209 p 2 0 2793 807 11555 3645 p 2 0 3029 571 12952 4030 i 2 3600 0 0 134732 14421 p 2 0 3436 164 17074 4604 p 2 0 3319 281 15083 4352 p 2 0 2758 842 9850 3447 p 2 3 3325 272 37510 5152 p 2 0 2978 622 11340 3775 p 2 0 2669 931 9374 3282 p 2 0 3027 573 12912 3742 p 2 0 2989 611 29566 4233 p 2 0 3119 481 12280 3841 p 2 0 3306 294 16038 4233 p 2 0 3256 344 31755 4706 p 2 0 3153 447 13861 3995 p 2 0 3065 535 12421 3853 p 2 0 2891 709 10842 3641 p 2 0 2824 776 10056 3448 p 2 0 2809 791 10040 3494 p 2 0 3275 325 14792 4212 p 2 0 2930 670 10625 3601 p 2 0 3061 539 12284 3787 p 2 0 3019 581 11360 3756 p 2 0 2572 1028 8402 3154 p 2 0 2875 725 10658 3585 p 2 0 3152 448 13727 4239 i 2 3600 0 0 104149 13154 p 2 0 2928 672 10703 3774 p 2 0 2963 637 10464 3740 p 2 0 2975 625 10727 3795 p 2 0 2960 640 10452 3766 p 2 0 3290 310 13332 4371 p 2 0 3127 473 12298 4108 p 2 0 3269 331 14635 4242 p 2 0 3161 439 12752 4042 p 2 0 3210 390 12689 4106 p 2 0 3010 590 11005 3809 p 2 0 2801 799 9547 3458 p 2 0 3061 539 11543 3820 p 2 0 2915 685 10192 3644 p 2 0 3019 581 10802 3788 p 2 0 2786 814 9495 3441 p 2 0 2896 704 9754 3628 p 2 0 3179 421 12073 4014 p 2 0 2766 834 9821 3424 p 2 0 2914 686 10872 3621 p 2 0 2771 829 9949 3441 p 2 1 2814 785 9485 3446 p 2 0 2796 804 9887 3426 p 2 0 2377 1223 7615 2906 p 2 0 2636 964 9425 3270 p 2 0 2859 741 9520 3571 p 2 0 2577 1023 8146 3210 p 2 0 2374 1226 7620 2934 p 2 0 2394 1206 7457 2963 p 2 0 2890 710 10083 3589 p 2 0 2772 828 9374 3409 p 2 0 2855 745 10390 3549 p 2 0 2769 831 9616 3394 i 2 3600 0 0 99257 12721 p 2 0 3230 370 14485 4219 p 2 0 3027 573 10780 3802 p 2 0 2969 631 9817 3658 p 2 0 2848 752 9443 3510 p 2 0 2601 999 8282 3213 p 2 0 2476 1124 7541 3037 p 2 0 2090 1510 5851 2569 p 2 0 3067 533 10933 3901 p 2 0 2826 774 9298 3490 p 2 0 2971 629 11700 3708 p 2 0 2603 997 8864 3187 p 2 0 2818 782 9568 3431 p 2 0 2776 824 9328 3425 p 2 0 2340 1260 6901 2852 p 2 0 2584 1016 8306 3168 p 2 0 2626 974 8433 3229 p 2 0 2734 866 9129 3358 p 2 0 2596 1004 8716 3213 p 2 0 2530 1070 7542 3086 p 2 0 2919 681 10101 3604 p 2 0 2619 981 8517 3200 p 2 0 2735 865 9589 3342 p 2 0 2522 1078 8230 3091 p 2 0 2804 796 9591 3422 p 2 0 2716 884 8944 3309 p 2 0 2255 1345 7153 2734 p 2 0 2511 1089 8330 3056 p 2 0 2145 1455 7138 2684 p 2 0 2595 1005 8252 3205 p 2 0 2318 1282 7063 2848 p 2 0 1941 1659 5575 2409 p 2 1 2785 814 9292 3419 p 2 0 2478 1122 7723 3063 p 2 0 2694 906 9701 3319 p 2 0 2645 955 8710 3228 p 2 0 2345 1255 7363 2852 p 2 0 2409 1191 7417 2933 p 2 0 2697 903 8663 3475 i 2 3600 0 0 134969 14179 p 2 0 3490 110 19915 4738 p 2 0 3197 403 13117 4053 p 2 0 2972 628 11648 3709 p 2 0 3101 499 12398 3895 p 2 0 3327 273 14217 4368 p 2 0 2506 1094 8678 3166 p 2 0 3249 351 16536 4150 p 2 0 3293 307 14250 4159 p 2 0 3019 581 12121 3783 p 2 0 3034 566 11925 3781 p 2 0 2698 902 9337 3284 p 2 23 2967 610 18354 4083 p 2 0 2923 677 11126 3623 p 2 0 2917 683 10671 3620 p 2 2 2855 743 15293 3766 p 2 0 3118 482 12944 3948 p 2 1 2826 773 15726 3723 p 2 0 2457 1143 8190 2999 p 2 0 2852 748 10906 3502 p 2 0 2890 710 10712 3570 p 2 0 2520 1080 8950 3076 p 2 0 2477 1123 8338 3038 p 2 0 2334 1266 7582 2866 p 2 0 2612 988 9253 3198 p 2 0 2553 1047 8498 3119 p 2 0 2524 1076 8138 3092 p 2 5 2675 920 15100 3552 p 2 0 3046 554 12516 3800 p 2 0 2661 939 13361 3473 p 2 0 2584 1016 8956 3145 p 2 0 3009 591 12447 3725 p 2 0 2228 1372 7315 2720 p 2 0 2788 812 14473 3580 p 2 0 2730 870 9742 3310 p 2 0 2367 1233 7927 2899 p 2 0 2761 839 10476 3393 p 2 0 2588 1012 8727 3158 p 2 0 2620 980 8810 3238 p 2 0 2463 1137 8605 3025 p 2 0 2518 1082 8434 3082 p 2 1 2922 677 10692 3656 p 2 0 2830 770 11123 3511 p 2 1 3017 582 12732 3753 p 2 0 2898 702 11092 3556 p 2 0 2704 896 10152 3315 p 2 0 2645 955 9441 3258 p 2 0 2395 1205 7889 2912 p 2 0 2546 1054 8702 3121 p 2 1 2563 1036 8565 3114 p 2 1 2312 1287 7682 2862 p 2 0 2408 1192 7984 2935 p 2 0 2379 1221 7858 2924 p 2 0 2960 640 10665 3700 p 2 0 2821 779 10452 3502 p 2 0 3121 479 15005 3927 p 2 0 2891 709 11703 3571 p 2 0 2634 966 9767 3211 p 2 0 2684 916 9915 3271 p 2 0 2384 1216 8297 2925 p 2 0 2683 917 9812 3299 p 2 0 2581 1019 8860 3162 p 2 0 2490 1110 8635 3043 i 2 3600 0 0 105762 13023 p 2 0 3297 303 13112 4196 p 2 0 3449 151 16982 4706 p 2 1 3245 354 13949 4281 p 2 0 3305 295 15168 4187 p 2 0 3150 450 13693 4013 p 2 0 3043 557 12985 3869 p 2 0 3032 568 12065 3830 p 2 0 2797 803 10868 3522 p 2 0 2869 731 11092 3569 p 2 0 2570 1030 9394 3172 p 2 0 2621 979 9583 3236 p 2 1 2772 827 10739 3460 p 2 0 2685 915 9618 3318 p 2 0 3216 384 13598 4091 p 2 0 2830 770 11132 3544 p 2 0 2867 733 11470 3577 p 2 0 2862 738 11453 3545 p 2 0 2684 916 10555 3306 p 2 0 2810 790 11389 3444 p 2 0 2434 1166 9139 2967 p 2 1 2723 876 10484 3321 p 2 0 2619 981 9291 3241 p 2 0 2732 868 10576 3380 p 2 0 2202 1398 8123 2744 p 2 0 1944 1656 7420 2451 p 2 0 2637 963 9951 3247 p 2 0 2696 904 10462 3331 p 2 0 2840 760 11749 3543 p 2 0 2786 814 11228 3459 p 2 0 2826 774 11891 3512 p 2 0 2852 748 11778 3543 p 2 0 2417 1183 9347 3017 p 2 1 2704 895 10735 3330 p 2 0 2543 1057 9712 3150 p 2 0 2559 1041 9824 3141 p 2 0 2219 1381 7996 2754 p 2 0 2509 1091 9535 3071 p 2 0 2887 713 10817 3575 p 2 0 2652 948 10466 3285 p 2 0 2755 845 10915 3387 p 2 0 2683 917 10322 3297 p 2 0 2701 899 10002 3321 p 2 0 2818 782 11520 3460 p 2 0 2326 1274 8783 2873 p 2 0 2836 764 11085 3494 p 2 0 2515 1085 9072 3064 p 2 0 2646 954 11970 3377 i 2 3600 0 0 105632 13351 p 2 1 3418 181 21627 5063 p 2 1 3356 243 18660 4734 p 2 1 3174 425 15658 4350 p 2 3 3302 295 19036 4559 p 2 0 3131 469 15732 4190 p 2 0 3106 494 16217 4237 p 2 0 3121 479 15334 4176 p 2 0 2891 709 15583 3863 p 2 0 2975 625 14367 3952 p 2 0 2861 739 15246 3873 p 2 0 2883 717 14227 3879 p 2 0 2706 894 13914 3639 p 2 0 2607 993 12396 3377 p 2 1 2953 646 15124 3919 p 2 2 2976 622 14626 3894 p 2 2 2914 684 15328 3935 p 2 0 2980 620 14588 3908 p 2 0 2814 786 14973 3732 p 2 0 2828 772 14009 3707 p 2 2 2588 1010 12909 3420 p 2 1 2914 685 14797 3827 p 2 0 2702 898 13748 3609 p 2 1 2615 984 12312 3434 p 2 7 2316 1277 12026 3209 p 2 0 2313 1287 10898 3032 p 2 0 2929 671 14644 3903 p 2 0 2650 950 12984 3481 p 2 0 2919 681 15627 3890 p 2 0 2760 840 13057 3588 p 2 3 2808 789 14794 3723 p 2 0 2804 796 13408 3664 p 2 1 2424 1175 12358 3222 p 2 0 2514 1086 11710 3259 p 2 1 2549 1050 13389 3440 p 2 0 2567 1033 12511 3410 p 2 0 2464 1136 11853 3325 p 2 0 2495 1105 11925 3265 p 2 1 2901 698 15014 3914 p 2 1 2635 964 12172 3449 p 2 1 2954 645 15617 3949 p 2 0 2896 704 13953 3845 i 2 3600 0 0 133533 14394 p 2 0 3407 193 21244 4874 p 2 0 3099 501 12254 3948 p 2 0 3220 380 14109 4115 p 2 0 3280 320 14844 4224 p 2 0 3090 510 12181 3926 p 2 0 2841 759 9836 3505 p 2 0 2837 763 9961 3501 p 2 0 3224 376 12763 4154 p 2 0 2972 628 10855 3747 p 2 0 3247 353 15268 4161 p 2 0 3081 519 12981 3840 p 2 0 3216 384 13198 4096 p 2 0 3120 480 12286 3874 p 2 0 2555 1045 8559 3103 p 2 0 2970 630 10815 3679 p 2 0 2785 815 9595 3446 p 2 0 2848 752 10537 3496 p 2 0 2458 1142 7917 2998 p 2 0 2622 978 8442 3190 p 2 0 3090 510 11393 3936 p 2 0 2770 830 9360 3441 p 2 0 3174 426 13441 4012 p 2 0 2944 656 11030 3620 p 2 0 3096 504 11902 3913 p 2 0 3043 557 11353 3770 p 2 0 2496 1104 8451 3051 p 2 0 2705 895 9294 3292 p 2 0 2456 1144 7967 2996 p 2 0 2531 1069 8215 3066 p 2 0 2578 1022 8690 3157 p 2 0 2557 1043 8326 3096 p 2 0 3034 566 11359 3780 p 2 0 2711 889 9090 3340 p 2 0 3031 569 12927 3754 p 2 0 2948 652 10791 3668 p 2 0 2879 721 9948 3560 p 2 0 2859 741 10165 3548 p 2 0 2458 1142 8078 3044 p 2 0 2760 840 9591 3403 p 2 0 2752 848 9445 3416 p 2 0 2616 984 8443 3245 p 2 0 2524 1076 8375 3090 p 2 0 2765 835 9483 3429 p 2 0 2891 709 11074 3610 i 2 3600 0 0 85906 12223 p 2 0 3527 73 20654 5261 p 2 0 3214 386 14125 4145 p 2 104 3098 398 17805 4628 p 2 0 3042 558 12517 3896 p 2 0 2820 780 9897 3493 p 2 69 2842 689 18260 4267 p 2 0 2902 698 11116 3660 p 2 0 2828 772 9993 3570 p 2 0 2685 915 8972 3328 p 2 0 2869 731 10507 3627 p 2 0 3068 532 12592 3973 p 2 192 2786 622 14405 4620 p 2 0 3082 518 12729 4033 p 2 0 2946 654 11186 3736 p 2 0 2960 640 10952 3780 p 2 0 2790 810 10905 3607 p 2 0 2714 886 9763 3472 p 2 0 2671 929 9678 3463 p 2 0 2786 814 9920 3597 p 2 0 2811 789 11173 3717 p 2 187 2584 829 17378 4359 p 2 0 2578 1022 9176 3264 p 2 0 3050 550 11502 3848 p 2 192 2645 763 13260 4311 p 2 0 2881 719 11151 3644 p 2 0 3002 598 10669 3679 p 2 187 2503 910 16199 4167 p 2 0 2903 697 10809 3630 p 2 0 2624 976 9116 3303 p 2 70 2757 773 16945 4145 p 2 0 2868 732 10665 3776 p 2 0 2830 770 10346 3660 p 2 72 2648 880 16952 4088 p 2 0 2717 883 10462 3581 p 2 0 2900 700 10893 3758 p 2 189 2946 465 16143 4905 p 2 0 3080 520 12470 3971 p 2 1 2877 722 10587 3707 p 2 185 2831 584 19166 4693 p 2 0 2992 608 12752 4016 p 2 1 2735 864 10300 3538 p 2 191 2859 550 15141 4705 p 2 0 2862 738 10859 3735 p 2 0 2790 810 10664 3596 p 2 105 2646 849 15899 4051 p 2 0 2809 791 10695 3617 p 2 0 2976 624 11672 3886 p 2 71 2800 729 18498 4312 p 2 0 3178 422 13976 4165 p 2 0 3000 600 11555 3817 p 2 70 2803 727 17485 4264 p 2 0 3011 589 13114 4042 p 2 1 2734 865 11348 3636 p 2 113 2575 912 14111 4045 p 2 0 2837 763 11561 3764 p 2 0 2893 707 13257 3885 p 2 0 2691 909 11693 3722 p 2 8 2809 783 12646 3960 p 2 0 3091 509 13595 4142 i 2 3600 0 0 106607 12693 p 2 13 3401 186 19464 4701 p 2 0 3038 562 13480 3787 p 2 9 2650 941 11423 3271 p 2 0 2636 964 11131 3154 p 2 0 2283 1317 8796 2751 p 2 2 2358 1240 10212 2935 p 2 0 2490 1110 9787 3003 p 2 0 2394 1206 8670 2926 p 2 11 2289 1300 10233 2854 p 2 0 2266 1334 8704 2768 p 2 0 2752 848 11708 3345 p 2 9 2415 1176 10343 2992 p 2 0 2819 781 12528 3390 p 2 0 2548 1052 10612 3080 p 2 12 2373 1215 10978 2960 p 2 0 2332 1268 9111 2810 p 2 0 2240 1360 8214 2667 p 2 9 2103 1488 8981 2665 p 2 0 2362 1238 8731 2860 p 2 0 2163 1437 7552 2634 p 2 11 2080 1509 8817 2632 p 2 0 1957 1643 6616 2422 p 2 0 2618 982 10761 3134 p 2 8 2436 1156 11714 3059 p 2 0 2877 723 14161 3486 p 2 0 2551 1049 10061 3098 p 2 2 2611 987 11567 3178 p 2 0 2286 1314 10075 2793 p 2 0 2280 1320 8933 2733 p 2 0 2139 1461 8262 2631 p 2 0 1905 1695 6925 2352 p 2 0 2301 1299 8073 2749 i 2 3600 0 0 159462 13974 p 2 203 3288 109 88230 8284 p 2 237 3322 41 87290 8412 p 2 126 3314 160 82954 7903 p 2 205 3382 13 86510 8207 p 2 161 3321 118 84510 7799 p 2 157 3251 192 80347 7681 p 2 192 3273 135 77594 7519 p 2 137 3252 211 80733 7521 p 2 90 3255 255 80239 7198 p 2 105 3197 298 79429 7135 p 2 66 3228 306 81074 7164 p 2 168 3169 263 82121 7215 p 2 121 3166 313 86021 7058 p 2 124 3449 27 86788 7566 p 2 172 3250 178 83570 7443 p 2 132 3453 15 85824 7792 p 2 61 3398 141 87578 7509 p 2 137 3290 173 84134 7422 p 2 84 3334 182 83464 7288 p 2 154 3234 212 83803 7313 p 2 109 3285 206 82644 7212 p 2 165 3166 269 82458 7129 p 2 109 3220 271 76644 6827 p 2 99 3288 213 81979 7005 p 2 114 3228 258 80146 7041 p 2 106 3475 19 83914 7344 p 2 69 3401 130 82911 7195 p 2 216 3340 44 82323 7554 p 2 38 3419 143 81442 7022 p 2 101 3278 221 79372 6895 p 2 195 3257 148 82348 7217 p 2 152 3254 194 81231 7031 p 2 120 3349 131 85502 7022 p 2 114 3224 262 80358 6700 p 2 101 3193 306 76576 6647 p 2 110 3255 235 58888 6352 p 2 198 3098 304 53777 6333 p 2 72 3372 156 55558 6593 p 2 411 2852 337 91558 8289 p 2 121 3418 61 58539 6762 p 2 95 3171 334 52285 6011 p 2 161 3088 351 90478 7262 p 2 128 3229 243 59675 6462 p 2 140 3057 403 52565 5968 p 2 304 3179 117 99089 8084 p 2 136 3099 365 53566 6315 p 2 95 3168 337 56698 6263 p 2 140 3265 195 74731 7003 p 2 84 3334 182 57819 6460 p 2 134 3396 70 71544 7029 p 2 112 3166 322 57103 6279 p 2 98 3428 74 60344 6721 p 2 90 3285 225 81201 7019 p 2 207 3042 351 51887 6348 p 2 142 3326 132 61752 6850 p 2 119 3175 306 54873 6486 p 2 104 3186 310 53691 6226 p 2 94 3314 192 53822 6417 p 2 124 3234 242 60855 6550 p 2 320 3023 257 98994 7936 p 2 147 3170 283 58874 6372 p 2 126 3311 163 56383 6621 p 2 150 3067 383 94243 7377 p 2 138 3375 87 58480 6745 p 2 210 3121 269 55574 6434 p 2 107 3188 305 89223 7151 p 2 66 3190 344 54206 6248 p 2 126 3024 450 47542 5948 p 2 126 3223 251 86129 7216 p 2 114 2928 558 49599 5987 p 2 170 3106 324 58942 6466 p 2 192 3108 300 80330 7079 p 2 102 3146 352 59149 6411 p 2 154 3275 171 54191 6590 p 2 150 3057 393 83453 7020 p 2 129 3370 101 55233 6547 p 2 152 3116 332 56263 6313 p 2 129 3208 263 80056 6929 p 2 143 3172 285 53373 6397 p 2 111 3076 413 48152 6130 p 2 127 3229 244 87865 7260 p 2 74 3010 516 48221 5809 p 2 74 3091 435 53353 5973 p 2 178 3203 219 82257 7038 p 2 106 3170 324 58573 6318 p 2 102 3339 159 53193 6483 p 2 165 3070 365 83495 7055 p 2 106 3395 99 55389 6680 p 2 58 3215 327 56386 6166 p 2 391 2909 300 96118 8131 p 2 101 3177 322 55793 6307 p 2 216 3046 338 85872 7138 p 2 101 3228 271 56532 6458 p 2 205 2899 496 87404 6970 p 2 97 3054 449 55396 6205 p 2 101 3232 267 55086 6311 p 2 504 2876 220 88908 8367 p 2 101 3343 156 55600 6624 p 2 108 3020 472 55443 6185 p 2 497 3069 34 83439 8555 p 2 69 3345 186 63770 6828 p 2 266 3033 301 84930 7645 p 2 179 3035 386 62415 6865 p 2 193 2980 427 53020 6538 p 2 153 3127 320 80431 7172 p 2 116 2927 557 55430 6205 p 2 121 2893 586 57854 6249 p 2 139 3225 236 70469 7005 p 2 214 3204 182 60432 6920 p 2 92 3397 111 57088 6952 p 2 153 3096 351 72942 7035 p 2 140 3334 126 57460 6764 p 2 122 3142 336 55328 6261 i 2 3600 0 0 145343 13361 p 2 0 3582 18 40659 5496 p 2 0 3434 166 19385 4561 p 2 1 3484 115 24647 4687 p 2 0 3277 323 15678 4311 p 2 0 3268 332 15733 4224 p 2 0 3269 331 21126 4303 p 2 0 3478 122 41162 4714 p 2 1 3499 100 33506 5045 p 2 0 3345 255 40066 4712 p 2 0 3510 90 43213 5152 p 2 0 3401 199 33995 4833 p 2 0 3437 163 42014 4992 p 2 0 3425 175 44036 4996 p 2 0 3235 365 36797 4768 p 2 0 3362 238 37933 4819 p 2 4 3198 398 42290 4722 p 2 0 3283 317 38254 4734 p 2 0 3250 350 45019 4741 p 2 0 3336 264 39004 4838 p 2 0 3390 210 28608 5056 p 2 0 3369 231 34059 4984 p 2 0 3483 117 46855 5294 p 2 0 3248 352 40691 4803 p 2 0 3477 123 43792 5254 p 2 0 3358 242 41055 4884 p 2 0 3302 298 47196 4939 p 2 0 3306 294 46887 5007 p 2 0 3188 412 44538 4789 p 2 0 3286 314 34041 4762 p 2 0 3155 445 35911 4730 p 2 0 3314 286 34159 4866 p 2 0 3342 258 36391 4952 p 2 0 3443 157 50277 5099 p 2 5 3480 115 62267 5301 p 2 0 3380 220 63722 4967 p 2 0 3469 131 63858 5277 p 2 3 3410 187 60080 5101 p 2 2 3250 348 56179 4866 p 2 1 3331 268 53374 4866 p 2 2 3178 420 45880 5087 p 2 0 3300 300 44194 4756 p 2 1 3307 292 45002 4969 p 2 2 3284 314 51106 4967 p 2 5 3414 181 45205 5230 p 2 13 3376 211 43752 5169 p 2 7 3447 146 42256 5224 p 2 1 3428 171 32697 5125 p 2 3 3402 195 29499 5057 p 2 0 3428 172 29121 5070 p 2 10 3244 346 29521 4708 p 2 0 3105 495 31691 4412 p 2 0 3099 501 28308 4353 p 2 68 3011 521 23152 4368 p 2 1 3183 416 16448 4316 p 2 0 3055 545 14366 4045 p 2 0 3262 338 17593 4432 p 2 1 3301 298 21551 4883 p 2 0 3330 270 18761 4610 p 2 0 3300 300 17464 4566 p 2 0 3153 447 15531 4176 p 2 0 3216 384 18863 4477 p 2 0 3003 597 16361 4043 p 2 0 3165 435 17138 4243 p 2 0 3148 452 16063 4131 p 2 0 3079 521 16104 4122 p 2 0 2939 661 14752 3856 p 2 0 2970 630 15271 3970 p 2 0 3188 412 15917 4303 p 2 0 3218 382 15894 4352 p 2 0 3263 337 16724 4319 p 2 0 3244 356 16882 4369 p 2 0 3299 301 18688 4504 p 2 0 3239 361 20240 4583 p 2 0 2980 620 15624 3979 p 2 0 3152 448 17023 4253 p 2 0 3131 469 18568 4280 p 2 0 3092 508 17249 4195 p 2 0 2927 673 14596 3823 p 2 0 3129 471 16921 4170 p 2 0 3190 410 19365 4244 i 2 3600 0 0 65014 13005 p 2 31 3556 13 46454 7035 p 2 23 3538 39 37760 6477 p 2 172 3399 29 47905 7335 p 2 12 3566 22 38397 6329 p 2 20 3555 25 37495 6416 p 2 32 3534 34 48127 7225 p 2 18 3561 21 38135 6425 p 2 10 3572 18 37394 6313 p 2 97 3472 31 48440 7420 p 2 12 3567 21 37484 6348 p 2 13 3577 10 35543 6157 p 2 204 3376 20 48903 7406 p 2 10 3583 7 37199 6405 p 2 10 3572 18 34511 6225 p 2 139 3437 24 45122 7307 p 2 6 3580 14 35516 6183 p 2 9 3573 18 33193 6111 p 2 166 3426 8 44308 7070 p 2 7 3580 13 33827 5976 p 2 8 3584 8 31699 5863 p 2 29 3555 16 41891 6774 p 2 16 3566 18 30798 5883 p 2 14 3581 5 30370 5906 p 2 110 3481 9 42612 6946 p 2 15 3561 24 32690 6007 p 2 7 3586 7 30301 5898 p 2 215 3374 11 38851 6830 p 2 2 3590 8 31028 5904 p 2 6 3590 4 29519 5791 p 2 98 3480 22 39175 6795 p 2 6 3578 16 28798 5721 p 2 7 3589 4 26870 5569 p 2 175 3415 10 35442 6435 p 2 7 3586 7 27654 5582 p 2 3 3586 11 25487 5519 p 2 8 3584 8 30850 5939 p 2 7 3590 3 27350 5482 p 2 8 3589 3 27667 5723 p 2 66 3531 3 31186 5930 p 2 2 3588 10 26119 5382 p 2 0 3597 3 26833 5595 p 2 49 3545 6 32194 5974 p 2 3 3596 1 26607 5509 p 2 1 3591 8 24823 5324 p 2 0 3598 2 27306 5561 p 2 0 3593 7 25541 5591 p 2 0 3598 2 24643 5282 p 2 0 3594 6 24689 5365 p 2 1 3599 0 29125 5767 i 2 3600 0 0 57538 13153 p 2 0 3580 20 21148 5065 p 2 0 3562 38 17690 4728 p 2 0 3557 43 17448 4540 p 2 0 3552 48 17136 4687 p 2 0 3573 27 17723 4727 p 2 0 3558 42 16514 4698 p 2 0 3574 26 15941 4555 p 2 0 3545 55 17995 4730 p 2 0 3579 21 17231 4744 p 2 0 3572 28 19183 4795 p 2 0 3561 39 16260 4544 p 2 0 3552 48 19292 4684 p 2 0 3565 35 16418 4619 p 2 0 3543 57 17680 4690 p 2 0 3576 24 16939 4606 p 2 0 3540 60 17954 4704 p 2 0 3563 37 17163 4679 p 2 0 3562 38 16641 4691 p 2 0 3578 22 16197 4521 p 2 0 3545 55 17004 4676 p 2 0 3581 19 17358 4495 p 2 0 3566 34 15963 4560 p 2 0 3580 20 17514 4398 p 2 0 3544 56 15586 4496 p 2 0 3546 54 17690 4397 p 2 0 3544 56 15771 4582 p 2 0 3537 63 16870 4447 p 2 0 3540 60 16699 4625 p 2 0 3565 35 17284 4638 p 2 0 3551 49 16862 4664 p 2 0 3544 56 15542 4447 p 2 0 3558 42 16740 4636 p 2 0 3573 27 16962 4534 p 2 0 3548 52 17260 4577 p 2 0 3558 42 15646 4434 p 2 0 3569 31 18006 4477 p 2 0 3560 40 15333 4391 p 2 0 3530 70 17258 4591 p 2 0 3549 51 16722 4518 p 2 0 3563 37 17728 4570 p 2 0 3560 40 16766 4624 p 2 0 3563 37 17277 4668 p 2 0 3538 62 16047 4467 p 2 0 3541 59 16701 4651 p 2 0 3559 41 17089 4546 p 2 0 3570 30 16623 4522 p 2 0 3556 44 16270 4371 p 2 0 3570 30 15837 4493 p 2 0 3538 62 17131 4392 p 2 0 3546 54 16222 4604 p 2 0 3560 40 17607 4489 p 2 0 3536 64 16908 4676 p 2 0 3574 26 17953 4651 p 2 0 3569 31 16846 4745 p 2 0 3549 51 15609 4444 p 2 0 3533 67 16694 4610 p 2 0 3573 27 17355 4530 p 2 0 3555 45 17634 4565 p 2 0 3543 57 15895 4348 p 2 0 3543 57 17158 4498 p 2 0 3560 40 15714 4371 p 2 0 3499 101 16620 4535 p 2 0 3540 60 16191 4513 p 2 0 3544 56 18325 4562 p 2 0 3556 44 17020 4605 p 2 0 3546 54 17876 4651 p 2 0 3562 38 16233 4509 p 2 0 3549 51 17305 4634 p 2 0 3514 86 16659 4496 p 2 0 3548 52 16230 4500 p 2 0 3558 42 16619 4402 p 2 0 3563 37 15991 4501 p 2 0 3538 62 16834 4380 p 2 0 3490 110 15822 4524 p 2 0 3517 83 16986 4422 p 2 0 3552 48 16005 4488 p 2 0 3538 62 17227 4454 p 2 0 3564 36 16173 4435 p 2 0 3547 53 15750 4374 p 2 0 3555 45 16592 4562 p 2 0 3532 68 16544 4493 p 2 0 3541 59 16776 4623 p 2 0 3545 55 16444 4373 p 2 0 3543 57 17042 4550 p 2 0 3508 92 16541 4480 p 2 0 3548 52 17945 4491 p 2 0 3544 56 18490 4968 i 2 3600 0 0 88828 13791 p 2 0 3080 520 11397 3790 p 2 0 3353 247 14306 4463 p 2 0 3074 526 11011 3889 p 2 0 3142 458 11950 4081 p 2 0 3049 551 10607 3908 p 2 0 2776 824 9728 3451 p 2 0 3232 368 13645 4233 p 2 0 3087 513 11486 3915 p 2 0 3104 496 11082 3908 p 2 0 2816 784 8846 3499 p 2 0 2808 792 9092 3493 p 2 0 2654 946 8494 3291 p 2 0 2703 897 8412 3340 p 2 0 2823 777 9400 3509 p 2 0 2844 756 9344 3502 p 2 0 2861 739 10119 3573 p 2 0 2691 909 8584 3285 p 2 0 2935 665 10724 3712 p 2 0 2848 752 9796 3561 p 2 0 2314 1286 7086 2840 p 2 0 2647 953 8143 3240 p 2 0 2252 1348 7107 2807 p 2 0 2490 1110 7441 3045 p 2 0 2365 1235 7082 2933 p 2 0 2384 1216 7216 2963 p 2 0 2315 1285 6921 2879 p 2 0 2461 1139 7173 3024 p 2 0 2294 1306 6661 2824 p 2 0 2666 934 8293 3262 p 2 0 2320 1280 6916 2862 p 2 0 2701 899 8959 3310 p 2 0 2637 963 8834 3266 p 2 0 2509 1091 7934 3096 p 2 0 2375 1225 7606 2935 p 2 0 2365 1235 7118 2909 p 2 0 2272 1328 6876 2819 p 2 0 2271 1329 6350 2806 p 2 0 2302 1298 6761 2836 p 2 0 2437 1163 7036 2989 p 2 0 2469 1131 7934 3054 p 2 0 2365 1235 7144 2920 p 2 0 2808 792 10042 3538 p 2 0 2612 988 8194 3249 p 2 0 2289 1311 6912 2799 i 2 3600 0 0 74885 12521 p 2 33 3356 211 19178 5141 p 2 0 3194 406 11575 4250 p 2 0 3141 459 10395 4135 p 2 0 3078 522 9837 3939 p 2 0 3076 524 9929 3894 p 2 0 2853 747 8704 3527 p 2 0 2674 926 7870 3327 p 2 0 3005 595 10144 3744 p 2 0 2781 819 9008 3412 p 2 0 3081 519 11565 3886 p 2 0 2917 683 9800 3607 p 2 0 3047 553 10212 3869 p 2 0 2930 670 9060 3685 p 2 0 2813 787 8557 3483 p 2 0 2694 906 7932 3313 p 2 0 2776 824 8392 3407 p 2 0 2641 959 7702 3256 p 2 0 2723 877 8463 3386 p 2 0 2586 1014 7665 3207 p 2 0 2958 642 9957 3657 p 2 0 3099 501 10406 3868 p 2 0 2965 635 9574 3635 p 2 0 2490 1110 7125 3036 p 2 0 2745 855 8576 3378 p 2 0 2679 921 7763 3280 p 2 0 2419 1181 6808 2970 p 2 0 2497 1103 7326 3043 p 2 0 2433 1167 7088 3014 p 2 0 2510 1090 7152 3066 p 2 0 2502 1098 7266 3068 p 2 0 2668 932 7867 3258 p 2 0 2671 929 7646 3237 p 2 0 3021 579 10203 3742 p 2 0 2724 876 8025 3310 p 2 0 2396 1204 7031 2911 p 2 0 2534 1066 7575 3078 p 2 0 2555 1045 7737 3118 p 2 0 2623 977 7806 3197 p 2 0 2650 950 7835 3254 p 2 0 2618 982 7875 3217 p 2 0 2513 1087 7655 3079 p 2 0 2567 1033 7422 3153 p 2 0 2787 813 8282 3408 p 2 0 2419 1181 6984 2961 p 2 0 2793 807 9046 3446 p 2 0 2711 889 8140 3301 p 2 0 2428 1172 6710 2941 p 2 0 2586 1014 7563 3120 p 2 0 2553 1047 7363 3112 p 2 0 2408 1192 7030 2978 p 2 0 2603 997 7257 3176 p 2 0 2340 1260 6864 2888 p 2 0 2348 1252 7007 2901 p 2 0 2451 1149 7171 3007 p 2 0 2614 986 8098 3204 p 2 0 2378 1222 7109 2905 p 2 0 2965 635 9869 3657 p 2 0 2814 786 8968 3431 p 2 0 2394 1206 7121 2901 p 2 0 2545 1055 7263 3086 p 2 0 2438 1162 6800 2982 p 2 0 2286 1314 6377 2826 p 2 0 2747 853 8325 3345 p 2 0 2484 1116 7168 3058 p 2 0 2469 1131 7109 3013 p 2 0 2423 1177 6726 2960 p 2 0 2300 1300 6234 2818 p 2 0 2556 1044 7369 3095 p 2 0 2493 1107 7546 3027 p 2 0 2620 980 8345 3196 p 2 0 2468 1132 7385 2978 p 2 0 2499 1101 7598 3036 p 2 0 2552 1048 7462 3101 p 2 0 2412 1188 6708 2956 p 2 0 2518 1082 7234 3079 p 2 0 2363 1237 6742 2930 p 2 0 2453 1147 7001 3030 p 2 0 2400 1200 6766 2940 p 2 0 2664 936 8376 3268 p 2 0 2432 1168 7265 2976 p 2 0 2750 850 8776 3362 p 2 0 2639 961 8093 3233 p 2 0 2414 1186 6768 2940 p 2 0 2499 1101 7370 3036 p 2 0 2571 1029 7239 3117 p 2 0 2528 1072 7557 3067 p 2 0 2335 1265 6907 2840 i 2 3600 0 0 93194 12713 p 2 0 3427 173 18098 4553 p 2 0 3286 314 13548 4206 p 2 0 3279 321 13446 4278 p 2 0 3128 472 10825 3990 p 2 0 3281 319 13185 4246 p 2 0 3182 418 11520 4019 p 2 0 2785 815 9195 3467 p 2 0 2825 775 8905 3497 p 2 0 2956 644 10211 3678 p 2 0 2826 774 9225 3540 p 2 0 2799 801 9238 3467 p 2 0 2775 825 9006 3464 p 2 0 2751 849 8536 3367 p 2 0 2621 979 8085 3239 p 2 0 2802 798 8875 3402 p 2 0 2857 743 9728 3489 p 2 0 3088 512 11254 3853 p 2 0 2858 742 9568 3488 p 2 0 2619 981 8474 3164 p 2 0 2660 940 8783 3216 p 2 0 2673 927 9016 3241 p 2 0 2617 983 8470 3171 p 2 0 2477 1123 7612 3008 p 2 0 2470 1130 7391 3025 p 2 0 2592 1008 8133 3169 p 2 0 2675 925 8740 3288 p 2 0 2842 758 9619 3508 p 2 0 2615 985 8319 3173 p 2 0 2921 679 10581 3620 p 2 0 2885 715 9889 3546 p 2 0 2496 1104 8066 3075 p 2 0 2694 906 8899 3264 p 2 0 2753 847 9270 3326 p 2 0 2575 1025 8096 3093 p 2 0 2556 1044 7919 3101 p 2 0 2603 997 8429 3158 p 2 0 2557 1043 8051 3123 p 2 0 2376 1224 7503 2930 p 2 0 2982 618 9695 3727 p 2 0 2149 1451 6430 2708 p 2 0 2832 768 9975 3473 p 2 0 3047 553 10255 3792 p 2 0 2702 898 8415 3364 p 2 0 2988 612 10597 3662 p 2 0 2453 1147 7831 2963 i 2 3600 0 0 53691 12669 p 2 0 3581 19 22283 5501 p 2 0 3584 16 21467 5200 p 2 0 3410 190 11390 4353 p 2 0 3543 57 17947 4822 p 2 0 3537 63 20133 4963 p 2 0 3581 19 18190 4828 p 2 0 3578 22 17941 4873 p 2 0 3580 20 18929 4836 p 2 0 3580 20 17830 4857 p 2 0 3578 22 18096 4897 p 2 0 3567 33 17994 4792 p 2 0 3566 34 17756 4748 p 2 0 3579 21 19661 4945 p 2 0 3573 27 18149 4887 p 2 0 3561 39 18023 4922 p 2 0 3565 35 18244 4849 p 2 0 3576 24 18268 4890 p 2 0 3578 22 19063 4891 p 2 0 3578 22 18055 4842 p 2 0 3589 11 18103 4837 p 2 0 3582 18 19380 4863 p 2 0 3585 15 17346 4809 p 2 0 3582 18 17871 4790 p 2 0 3580 20 17840 4809 p 2 0 3590 10 18076 4865 p 2 0 3573 27 19589 4920 p 2 0 3580 20 17935 5000 p 2 0 3567 33 18041 4876 p 2 0 3577 23 19667 4941 p 2 0 3583 17 17833 4861 p 2 0 3590 10 18354 4793 p 2 0 3587 13 17602 4744 p 2 0 3561 39 17594 4743 p 2 0 3584 16 18870 4822 p 2 0 3585 15 17524 4864 p 2 0 3573 27 17920 4806 p 2 0 3581 19 18624 4871 p 2 0 3595 5 17965 4939 p 2 0 3582 18 19573 5017 p 2 0 3582 18 17919 4918 p 2 0 3564 36 19514 5051 p 2 0 3586 14 19241 4954 p 2 0 3576 24 17705 4899 p 2 0 3560 40 18551 4876 p 2 0 3587 13 18128 4861 p 2 0 3542 58 17835 4896 p 2 0 3586 14 19563 4929 p 2 0 3559 41 17840 4849 p 2 0 3580 20 18376 4950 p 2 0 3565 35 19141 4965 p 2 0 3569 31 17992 4913 p 2 0 3557 43 18562 4956 p 2 0 3579 21 19162 5004 p 2 0 3579 21 18623 5000 p 2 0 3579 21 19930 4914 p 2 0 3578 22 18315 4913 p 2 0 3577 23 20230 5134 p 2 0 3573 27 18474 4964 p 2 0 3574 26 18693 5034 p 2 0 3573 27 20422 5065 p 2 0 3580 20 19230 5134 p 2 0 3581 19 20312 5199 p 2 0 3567 33 20439 5232 p 2 0 3562 38 18845 5047 p 2 0 3584 16 21037 5157 p 2 0 3584 16 19718 5123 p 2 0 3582 18 19334 4998 p 2 0 3578 22 19751 5013 p 2 0 3585 15 18720 4977 p 2 0 3572 28 19113 4923 p 2 0 3585 15 19026 5041 p 2 0 3585 15 19205 4993 p 2 0 3575 25 20558 5065 p 2 0 3585 15 20141 5126 p 2 0 3582 18 20222 5131 p 2 0 3561 39 19887 5009 p 2 0 3588 12 20320 5108 p 2 0 3583 17 20703 5008 p 2 0 3581 19 19064 4911 p 2 0 3580 20 19454 5051 p 2 0 3589 11 21641 4982 p 2 0 3585 15 18631 5020 p 2 0 3589 11 20293 4964 p 2 0 3572 28 18724 4979 p 2 0 3584 16 19341 5000 p 2 0 3576 24 21310 5062 p 2 0 3576 24 19410 5034 p 2 0 3567 33 19115 5021 p 2 0 3575 25 20767 5064 p 2 0 3581 19 19322 4998 p 2 0 3573 27 20825 5050 p 2 0 3572 28 18901 4927 p 2 0 3581 19 19726 5004 p 2 0 3575 25 21100 5003 p 2 0 3568 32 18788 5025 p 2 0 3559 41 19687 4930 p 2 0 3567 33 21355 4996 p 2 0 3578 22 20068 5101 p 2 0 3571 29 21349 5059 p 2 0 3563 37 19874 5096 p 2 0 3570 30 21013 5036 p 2 0 3569 31 20485 5202 p 2 0 3567 33 20219 4972 p 2 0 3567 33 19632 4934 p 2 1 3569 30 21237 5384 p 2 0 3565 35 19635 5021 i 2 3600 0 0 66530 12904 p 2 1 3524 75 20940 5381 p 2 0 3311 289 12020 4353 p 2 0 3137 463 10480 4024 p 2 0 2854 746 8409 3593 p 2 0 2977 623 9184 3773 p 2 0 2999 601 9498 3828 p 2 0 2720 880 7936 3412 p 2 0 3041 559 9584 3910 p 2 0 2828 772 8313 3534 p 2 0 2656 944 7370 3322 p 2 0 2437 1163 6548 3039 p 2 0 2508 1092 6829 3136 p 2 0 2604 996 7171 3267 p 2 0 2337 1263 6065 2914 p 2 0 2442 1158 6479 3044 p 2 0 1672 1928 3896 2139 p 2 0 2269 1331 5885 2827 p 2 0 2526 1074 6813 3144 p 2 0 2334 1266 6153 2889 p 2 0 2853 747 8637 3613 p 2 0 2784 816 7864 3540 p 2 0 2571 1029 6783 3196 p 2 0 2545 1055 6671 3158 p 2 0 2083 1517 5447 2651 p 2 0 1640 1960 3949 2106 p 2 0 2304 1296 5985 2867 p 2 0 2421 1179 6509 3030 p 2 0 2205 1395 5682 2768 p 2 0 2275 1325 5961 2836 p 2 0 2570 1030 7070 3252 p 2 0 2372 1228 6290 2977 p 2 0 1978 1622 5159 2476 p 2 0 2647 953 7638 3326 p 2 0 2760 840 7439 3432 p 2 0 2480 1120 6907 3098 p 2 0 2890 710 9107 3753 i 2 3600 0 0 80593 13719 p 2 0 3440 160 16058 4779 p 2 0 3167 433 11306 4111 p 2 0 3200 400 12398 4131 p 2 0 3015 585 10489 3824 p 2 0 3174 426 11734 4174 p 2 0 2940 660 9599 3797 p 2 0 2394 1206 6974 2984 p 2 0 3023 577 10484 3895 p 2 0 2743 857 8606 3465 p 2 0 2805 795 9018 3551 p 2 0 2480 1120 7293 3117 p 2 0 2621 979 7640 3304 p 2 0 2582 1018 7424 3217 p 2 0 2503 1097 7409 3161 p 2 0 2473 1127 7198 3131 p 2 0 2490 1110 7395 3158 p 2 0 2584 1016 7783 3227 p 2 0 2478 1122 7216 3060 p 2 0 2885 715 9174 3600 p 2 0 2511 1089 7773 3117 p 2 0 2345 1255 6405 2919 p 2 0 2503 1097 7450 3113 p 2 0 1961 1639 5450 2479 p 2 0 2291 1309 6471 2834 p 2 0 2267 1333 6355 2834 p 2 0 2326 1274 6874 2907 p 2 0 2350 1250 7072 2943 p 2 0 2155 1445 6083 2697 p 2 0 2295 1305 6334 2831 p 2 0 2617 983 7844 3235 p 2 0 2249 1351 6421 2797 p 2 0 2600 1000 7995 3201 i 2 3600 0 0 36127 11203 p 2 23 3566 11 23542 5744 p 2 0 3257 343 7377 3827 p 2 0 3124 476 7468 3604 p 2 0 2957 643 6477 3378 p 2 0 2781 819 6098 3251 p 2 0 2815 785 5784 3180 p 2 0 2579 1021 5390 2977 p 2 0 2737 863 5378 3038 p 2 0 2835 765 6334 3228 p 2 0 2888 712 5946 3243 p 2 0 2644 956 6225 3112 p 2 0 2925 675 6061 3316 p 2 0 2556 1044 5706 3005 p 2 0 2573 1027 5369 2910 p 2 0 2292 1308 5000 2707 p 2 0 2665 935 5341 2978 p 2 0 2439 1161 5170 2857 p 2 0 2692 908 5363 3011 p 2 0 2405 1195 5132 2798 p 2 0 2706 894 5392 3012 p 2 0 2572 1028 5457 2961 p 2 0 2769 831 6511 3246 p 2 0 2473 1127 5879 2936 p 2 0 2835 765 6095 3208 p 2 0 2482 1118 5276 2864 p 2 0 2497 1103 4678 2788 p 2 0 2105 1495 4706 2509 p 2 0 2587 1013 5263 2910 p 2 0 2366 1234 5009 2756 p 2 0 2508 1092 4927 2839 p 2 0 2242 1358 4722 2626 p 2 0 2574 1026 5099 2867 p 2 0 2175 1425 4931 2592 p 2 0 2801 799 6816 3253 p 2 0 2636 964 6211 3062 p 2 0 2887 713 5649 3172 p 2 0 2344 1256 4818 2742 p 2 0 2476 1124 4764 2756 p 2 0 2278 1322 5131 2644 i 2 3600 0 0 83158 14466 p 2 3 3515 82 28971 6016 p 2 0 3209 391 11927 4176 p 2 0 3252 348 15296 4487 p 2 0 3098 502 13253 4177 p 2 0 3343 257 15391 4709 p 2 0 3295 305 14767 4680 p 2 0 3272 328 13267 4504 p 2 0 3191 409 13258 4379 p 2 0 3196 404 13631 4426 p 2 0 3202 398 13284 4365 p 2 1 2985 614 11695 3995 p 2 1 3043 556 12363 4153 p 2 0 3146 454 13130 4386 p 2 0 3095 505 13677 4462 p 2 2 2949 649 11471 4009 p 2 0 2995 605 12039 4204 p 2 3 3202 395 14319 4553 p 2 1 3117 482 13740 4452 p 2 1 3141 458 13432 4351 p 2 0 3142 458 13886 4407 p 2 1 3090 509 13608 4375 p 2 0 3102 498 13996 4408 p 2 0 2967 633 12161 4065 p 2 0 2981 619 11783 4108 p 2 0 3003 597 12207 4154 p 2 0 3060 540 13414 4357 p 2 0 2865 735 11792 3938 p 2 0 2920 680 11224 4048 p 2 0 3082 518 12644 4247 p 2 0 3088 512 13542 4323 p 2 0 3065 535 11949 4118 p 2 0 3090 510 11991 4182 p 2 0 3022 578 11607 4103 p 2 1 3083 516 12733 4326 p 2 0 2885 715 12003 3990 p 2 0 2920 680 11746 4092 p 2 0 2820 780 11033 3925 p 2 0 3145 455 14327 4547 p 2 0 3024 576 13339 4251 p 2 0 3191 409 17300 4810 p 2 0 3265 335 16081 4799 p 2 0 3098 502 14454 4608 p 2 0 3255 345 14659 4617 p 2 0 3136 464 13630 4432 p 2 0 3140 460 14547 4501 p 2 0 2945 655 13889 4254 i 2 3600 0 0 25582 11218 p 2 223 3361 16 23353 6561 p 2 0 2521 1079 6642 3279 p 2 0 2191 1409 6144 2724 p 2 0 1825 1775 4881 2288 p 2 0 1969 1631 5110 2408 p 2 0 1850 1750 4881 2294 p 2 0 1916 1684 4745 2308 p 2 0 1582 2018 4808 2083 p 2 0 1830 1770 5183 2299 p 2 0 1948 1652 5451 2406 p 2 0 1777 1823 4403 2151 p 2 0 1419 2181 3645 1833 p 2 0 1870 1730 5043 2322 p 2 0 1553 2047 4151 1964 p 2 0 1770 1830 4982 2254 p 2 0 1466 2134 4161 1933 p 2 0 1691 1909 4137 2053 p 2 0 1664 1936 4508 2080 p 2 0 1781 1819 4561 2215 p 2 0 1496 2104 4593 1979 p 2 0 1755 1845 5104 2258 p 2 0 1711 1889 4330 2074 p 2 0 1829 1771 4302 2158 p 2 0 1448 2152 4074 1923 p 2 0 1714 1886 4077 2063 p 2 0 1664 1936 5153 2147 p 2 0 1770 1830 4508 2195 p 2 0 1444 2156 3852 1877 p 2 0 1666 1934 4045 2058 p 2 0 1599 2001 4790 2074 p 2 0 1725 1875 4147 2134 p 2 0 1544 2056 4536 2058 p 2 0 1642 1958 4307 2064 p 2 0 1795 1805 4953 2240 p 2 0 1829 1771 4130 2172 p 2 0 1525 2075 3779 1914 p 2 0 1840 1760 4637 2203 p 2 0 1607 1993 4828 2096 p 2 0 1753 1847 4218 2115 p 2 0 1467 2133 4160 1934 p 2 0 1728 1872 4698 2161 i 2 3600 0 0 39719 12071 p 2 15 3337 248 19403 4959 p 2 0 3075 525 9762 3772 p 2 0 2859 741 8103 3428 p 2 0 2804 796 8229 3385 p 2 0 2595 1005 7137 3105 p 2 0 2685 915 7836 3197 p 2 0 2837 763 7781 3333 p 2 0 2772 828 7598 3275 p 2 0 2596 1004 6895 3058 p 2 1 2552 1047 7014 3045 p 2 0 2593 1007 7278 3081 p 2 0 2625 975 7387 3102 p 2 0 2413 1187 6339 2789 p 2 0 2746 854 8171 3256 p 2 0 2590 1010 6994 3029 p 2 0 2634 966 6622 3125 p 2 0 2618 982 7747 3104 p 2 0 2586 1014 7067 3057 p 2 0 2527 1073 6759 2955 p 2 0 2441 1159 6661 2876 p 2 0 2520 1080 7100 2978 p 2 0 2499 1101 6640 2954 p 2 0 2576 1024 7032 2983 p 2 0 2464 1136 6299 2890 p 2 0 2252 1348 5692 2625 p 2 0 2583 1017 6628 3071 p 2 0 2469 1131 6462 2923 p 2 0 2542 1058 6168 2964 p 2 0 2373 1227 5866 2790 p 2 0 2379 1221 6100 2809 p 2 0 2397 1203 6282 2837 p 2 0 2428 1172 6459 2872 p 2 0 2477 1123 6427 2874 p 2 0 2285 1315 5850 2676 p 2 0 2289 1311 6360 2708 p 2 0 2440 1160 6369 2870 p 2 0 2217 1383 5749 2580 p 2 0 2517 1083 6851 2917 i 2 3600 0 0 33116 12006 p 2 29 3532 39 17824 5306 p 2 0 3269 331 8459 3818 p 2 201 2924 475 15569 4728 p 2 378 2865 357 21419 5748 p 2 572 2721 307 24717 6604 p 2 706 2637 257 26851 7309 p 2 803 2593 204 29141 7950 p 2 447 2915 238 30675 7606 p 2 189 3133 278 32492 7512 p 2 188 2938 474 32272 7575 p 2 164 3029 407 33529 7621 p 2 169 2954 477 32258 7414 p 2 176 3085 339 30639 7393 p 2 226 3172 202 36119 8034 p 2 320 3094 186 36595 8229 p 2 243 3224 133 37238 8449 p 2 191 3298 111 36934 8246 p 2 212 3295 93 36405 8357 p 2 242 3242 116 36949 8576 p 2 240 3273 87 36572 8694 p 2 218 3283 99 35190 8713 p 2 248 3178 174 31854 8318 p 2 221 3221 158 29779 7694 p 2 155 3195 250 27433 7239 p 2 225 3184 191 27833 7306 p 2 239 3196 165 32225 7756 p 2 301 3099 200 35107 7920 p 2 247 3206 147 36780 8062 p 2 261 3218 121 36942 8127 p 2 202 3338 60 38040 8482 p 2 189 3349 62 37775 8618 p 2 222 3204 174 36360 8391 p 2 218 3298 84 36277 8718 p 2 189 3288 123 34166 8146 p 2 167 3276 157 32574 7803 p 2 197 3227 176 30415 7604 p 2 199 3150 251 29562 7415 p 2 230 3183 187 33607 7818 p 2 235 3182 183 33998 7773 p 2 192 3241 167 34839 7795 i 2 3600 0 0 72542 13378 p 2 0 3361 239 17915 4592 p 2 1 3382 217 29770 5291 p 2 0 3357 243 27796 5222 p 2 0 2916 684 12088 3802 p 2 0 2483 1117 8121 3099 p 2 1 3201 398 27939 5045 p 2 0 2743 857 10809 3531 p 2 0 3189 411 28376 4989 p 2 0 3048 552 12846 3965 p 2 0 2695 905 9310 3383 p 2 0 2752 848 9766 3471 p 2 0 2714 886 8990 3397 p 2 0 2496 1104 7721 3090 p 2 0 2576 1024 8602 3207 p 2 0 2704 896 9274 3392 p 2 0 2532 1068 7989 3134 p 2 0 2224 1376 6642 2734 p 2 0 2643 957 9045 3265 p 2 0 2586 1014 7782 3215 p 2 0 2393 1207 7375 2967 p 2 0 2434 1166 7349 3003 p 2 0 2395 1205 7010 2955 p 2 0 2215 1385 6480 2764 p 2 0 2285 1315 6600 2836 p 2 0 2166 1434 6052 2693 p 2 0 2055 1545 6005 2572 p 2 0 1947 1653 5594 2442 i 2 3600 0 0 67005 12558 p 2 0 3499 101 21411 5147 p 2 0 3248 352 13907 4305 p 2 0 3185 415 13416 4213 p 2 0 3163 437 13364 4140 p 2 0 3099 501 13259 4027 p 2 0 2978 622 11416 3853 p 2 0 3100 500 13683 3988 p 2 0 3102 498 13298 4146 p 2 0 3091 509 13348 4125 p 2 0 2930 670 12502 3863 p 2 0 2723 877 11448 3482 p 2 0 3201 399 13628 4291 p 2 0 3066 534 13061 4047 p 2 0 3122 478 12288 4084 p 2 0 3116 484 12483 4113 p 2 0 3052 548 11803 4042 p 2 0 2914 686 12184 3849 p 2 0 2859 741 10876 3746 p 2 0 2946 654 12357 3881 p 2 0 3061 539 12692 4079 p 2 0 2950 650 12453 4004 p 2 0 3053 547 13025 4130 p 2 0 2873 727 10730 3682 p 2 0 3102 498 12742 4100 p 2 0 2938 662 12612 3878 p 2 0 3128 472 12790 4118 p 2 0 2793 807 11082 3598 i 2 3600 0 0 54265 12512 p 2 0 3542 58 20357 5419 p 2 2 3117 481 9433 3895 p 2 0 3091 509 9189 3841 p 2 0 2779 821 7782 3450 p 2 0 2705 895 7595 3358 p 2 0 2627 973 7312 3246 p 2 0 2796 804 8395 3458 p 2 0 2489 1111 6713 3048 p 2 0 2321 1279 5924 2827 p 2 0 2418 1182 6706 2962 p 2 0 2652 948 7297 3302 p 2 0 2694 906 7307 3316 p 2 0 2807 793 7518 3405 p 2 0 2542 1058 7110 3142 p 2 0 2511 1089 6505 3069 p 2 0 2350 1250 6250 2907 p 2 2 2399 1199 6459 2973 p 2 0 2433 1167 6264 2980 p 2 0 2445 1155 6980 3044 p 2 0 2267 1333 5967 2764 p 2 0 2779 821 8017 3434 p 2 0 2013 1587 5078 2484 p 2 2 2489 1109 6739 3092 p 2 0 2588 1012 6805 3183 p 2 0 2569 1031 6833 3154 p 2 0 2447 1153 6323 3005 p 2 0 2426 1174 6399 2991 p 2 0 2308 1292 5883 2829 p 2 0 2285 1315 6001 2848 p 2 0 2344 1256 6018 2899 p 2 0 2342 1258 6250 2877 p 2 0 1739 1861 4296 2171 p 2 0 2985 615 10101 3913 i 2 3600 0 0 63362 13554 p 2 75 3512 13 52711 7689 p 2 0 3399 201 15781 4885 p 2 27 3427 146 42692 6852 p 2 20 3463 117 46245 7020 p 2 0 3330 270 17420 5167 p 2 20 3476 104 45713 6960 p 2 0 3359 241 17703 5214 p 2 0 2972 628 12441 3844 p 2 1 3422 177 33730 5900 p 2 0 3430 170 16924 4917 p 2 2 3453 145 31908 5754 p 2 0 3372 228 15576 4698 p 2 3 3485 112 31803 5870 p 2 0 3455 145 31174 5801 p 2 0 3172 428 14259 4251 p 2 5 3420 175 31144 5624 p 2 0 3144 456 13629 4220 p 2 2 3420 178 30499 5556 p 2 0 3209 391 13726 4266 p 2 0 2830 770 10739 3639 p 2 1 3320 279 30365 5477 p 2 0 3327 273 15520 4688 p 2 1 3352 247 32101 5594 p 2 0 3393 207 16795 4863 i 2 3600 0 0 41854 12691 p 2 0 3439 161 15126 5011 p 2 0 2956 644 9455 3745 p 2 937 2229 434 30331 7374 i 2 3600 0 0 55971 12953 p 2 0 3275 325 16080 4346 p 2 476 3044 80 53090 8033 p 2 46 3426 128 46357 6789 p 2 155 3317 128 61362 8282 p 2 741 2796 63 73939 10808 p 2 1389 2205 6 84606 12760 p 2 1378 2216 6 85040 12940 p 2 0 3205 395 17933 5171 i 2 3600 0 0 50149 12877 p 2 9 3427 164 19092 5138 i 2 3600 0 0 43965 12417 p 2 95 3424 81 25174 5864 i 2 3600 0 0 60188 12959 p 2 28 3372 200 22759 5137 i 2 3600 0 0 82929 13915 i 2 3600 0 0 74757 14282 p 2 847 2751 2 76931 10733 p 2 12 3552 36 38308 7163 p 2 705 2895 0 77125 10460 p 2 25 3564 11 41409 7391 p 2 599 3001 0 71878 10409 p 2 24 3559 17 36336 7206 p 2 147 3453 0 64899 9152 p 2 10 3580 10 39761 7739 p 2 64 3536 0 57432 8369 p 2 4 3591 5 35881 7639 p 2 13 3587 0 49413 8140 p 2 2 3595 3 35752 7545 p 2 4 3596 0 43525 7602 p 2 16 3573 11 33120 7204 p 2 20 3580 0 41968 7469 p 2 16 3579 5 33942 7498 p 2 23 3575 2 41502 7696 p 2 12 3577 11 33670 7184 p 2 0 3583 17 32029 6888 p 2 0 3599 1 43065 6786 p 2 0 3594 6 28462 6392 p 2 1 3550 49 21086 5817 p 2 1 3521 78 17791 5469 p 2 0 3482 118 18893 5433 i 2 3600 0 0 36953 11875 p 2 216 3302 82 25775 6203 i 2 3600 0 0 46028 12275 p 2 0 3248 352 16348 4436 i 2 3600 0 0 51020 12482 p 2 1043 2533 24 55801 10316 p 2 9 3444 147 26289 5572 p 2 32 3289 279 31160 5827 p 2 5 3198 397 23197 4874 p 2 1 3418 181 27142 5387 p 2 1 3100 499 19565 4549 p 2 5 3186 409 26521 5224 p 2 1 3332 267 18665 4450 p 2 12 3177 411 23934 5007 p 2 0 2886 714 14544 3965 p 2 0 3070 530 13317 3974 p 2 0 3008 592 13550 3733 p 2 0 2913 687 16201 3661 p 2 0 2499 1101 7810 2996 p 2 0 2532 1068 7527 2993 p 2 0 2372 1228 6403 2838 p 2 0 2432 1168 6797 2845 p 2 0 2231 1369 5957 2641 p 2 0 2512 1088 7983 2942 p 2 0 2266 1334 5633 2724 p 2 0 2165 1435 6661 2549 p 2 0 2269 1331 6558 2713 p 2 0 2136 1464 5029 2492 i 2 3600 0 0 65064 12978 p 2 0 3543 57 19764 5376 p 2 0 3309 291 12815 4605 p 2 0 3232 368 12252 4428 p 2 0 3236 364 12514 4484 p 2 1 3230 369 11583 4443 p 2 1 3102 497 11112 4197 p 2 0 2816 784 9467 3701 p 2 0 3222 378 12493 4503 p 2 0 3280 320 13392 4492 p 2 0 3165 435 11909 4306 p 2 0 3042 558 11693 4088 p 2 0 3081 519 11142 4157 p 2 0 3120 480 11595 4234 p 2 0 2803 797 9721 3822 p 2 0 2919 681 10156 3942 p 2 0 3009 591 10534 4138 p 2 0 2994 606 10273 4057 p 2 0 2763 837 8800 3683 p 2 0 2495 1105 8005 3301 p 2 0 2881 719 9954 3904 p 2 0 2896 704 9808 3885 p 2 0 2993 607 10487 4024 p 2 0 3021 579 10306 4085 p 2 0 3063 537 10962 4115 p 2 0 3000 600 10836 4039 p 2 0 2814 786 9095 3784 p 2 0 2901 699 10137 3914 p 2 0 2899 701 9578 3949 p 2 0 2944 656 9875 3952 p 2 0 2902 698 8782 3921 p 2 0 2562 1038 7387 3348 p 2 0 2953 647 8907 3930 p 2 0 2806 794 8633 3676 p 2 0 2970 630 9325 3962 p 2 0 2972 628 9801 3979 p 2 0 2995 605 9681 4047 p 2 0 2875 725 9746 3853 p 2 0 2931 669 10420 4083 p 2 0 3082 518 11965 4224 p 2 0 3139 461 13130 4604 p 2 0 3123 477 12983 4476 p 2 0 2986 614 10827 4248 p 2 0 3022 578 11238 4262 p 2 0 3182 418 11868 4472 p 2 0 3032 568 11222 4317 p 2 0 3097 503 11319 4250 p 2 0 3197 403 11899 4540 p 2 0 3060 540 10647 4228 p 2 0 3060 540 10807 4297 p 2 0 2874 726 10573 4003 p 2 0 3014 586 11047 4187 i 2 3600 0 0 84596 13662 p 2 0 3548 52 22836 5127 p 2 125 3310 165 35145 5747 p 2 0 3187 413 12736 4115 p 2 135 2895 570 30339 5104 p 2 0 3223 377 13027 4206 p 2 0 3065 535 11246 4005 p 2 0 2741 859 9439 3497 p 2 516 2586 498 41017 6543 p 2 0 3027 573 12088 3922 p 2 0 2677 923 8692 3384 p 2 437 2606 557 36238 5961 p 2 0 2894 706 11183 3686 p 2 0 2855 745 11102 3699 p 2 767 2355 478 47654 7400 p 2 0 3185 415 12805 4145 p 2 661 2486 453 52820 7694 p 2 0 3215 385 13815 4221 p 2 0 3029 571 11218 3834 p 2 720 2344 536 56756 7920 p 2 0 3015 585 14671 3909 p 2 0 2955 645 11093 3743 p 2 0 2122 1478 6694 2662 p 2 0 2799 801 10259 3503 p 2 0 2800 800 9643 3487 p 2 0 2715 885 9320 3370 p 2 0 2792 808 9729 3499 p 2 0 2910 690 10411 3637 p 2 2 2674 924 9274 3330 p 2 0 3217 383 13455 4109 p 2 0 3029 571 11345 3752 p 2 0 2571 1029 8483 3142 p 2 0 2526 1074 8728 3116 p 2 0 2740 860 9009 3368 p 2 0 2674 926 9191 3335 p 2 0 2648 952 8745 3264 p 2 0 2592 1008 8469 3214 p 2 0 1794 1806 5876 2282 p 2 0 2419 1181 8014 3000 p 2 0 2678 922 9242 3294 i 2 3600 0 0 67398 13298 p 2 0 2903 697 9826 3586 p 2 0 3506 94 18044 4566 p 2 8 3232 360 16960 4185 p 2 0 3358 242 15298 4161 p 2 0 3331 269 14532 4162 p 2 8 3128 464 15181 3955 p 2 0 3258 342 15294 4114 p 2 0 3227 373 15206 4092 p 2 6 3170 424 16634 4105 p 2 0 3208 392 14197 3999 p 2 0 3127 473 14416 3948 p 2 0 3248 352 16232 4186 p 2 0 3097 503 13407 3869 p 2 0 3248 352 15086 4075 p 2 1 3180 419 15390 4089 p 2 0 3236 364 15151 3982 p 2 0 3246 354 14030 3986 p 2 5 3048 547 14401 3884 p 2 0 3239 361 14191 3999 p 2 0 3174 426 14789 4021 p 2 5 3113 482 15649 4000 p 2 0 3134 466 14164 3888 p 2 0 3117 483 14384 3932 p 2 0 3183 417 16159 4033 p 2 0 3118 482 14186 3862 p 2 0 3194 406 14145 3992 p 2 4 3155 441 15144 4053 p 2 0 3211 389 15162 4000 p 2 0 3233 367 13612 4030 p 2 8 3125 467 14994 3943 p 2 0 3143 457 14742 3966 p 2 0 3108 492 14824 3973 p 2 6 3067 527 14933 3978 p 2 0 3083 517 13949 3851 p 2 0 3069 531 13795 3888 p 2 5 3195 400 15472 4117 p 2 0 3133 467 15916 3910 p 2 0 3250 350 14686 4059 p 2 2 3188 410 15256 4121 p 2 0 3169 431 15623 3979 p 2 0 3257 343 13526 4042 p 2 4 3142 454 15107 3940 p 2 0 3177 423 14594 3991 p 2 0 3129 471 14846 3967 p 2 1 3202 397 14602 4001 p 2 0 3089 511 14203 3854 p 2 0 3135 465 14427 3970 p 2 0 3216 384 15744 4100 p 2 0 3169 431 14591 3906 p 2 0 3206 394 15419 4041 p 2 3 3202 395 15226 4115 p 2 0 3157 443 15440 3935 p 2 0 3212 388 14466 3990 p 2 6 2986 608 14767 3820 p 2 0 3193 407 13828 3895 p 2 0 3045 555 13397 3788 p 2 4 3072 524 15225 3970 p 2 0 3007 593 13765 3827 p 2 0 3003 597 14010 3835 p 2 5 3132 463 14815 4120 p 2 0 3178 422 13197 3938 p 2 0 3216 384 15063 4113 p 2 4 3124 472 13881 3891 p 2 0 3282 318 15561 4133 p 2 0 3063 537 14096 3795 i 2 3600 0 0 47566 12404 p 2 859 2738 3 55783 10968 p 2 123 3472 5 49237 8685 p 2 93 3505 2 43890 8167 p 2 61 3533 6 47528 8130 p 2 80 3516 4 43819 7551 p 2 78 3518 4 48866 8152 p 2 34 3563 3 40798 7635 p 2 107 3490 3 50176 8344 p 2 54 3546 0 48691 7739 p 2 62 3536 2 55128 8460 p 2 34 3566 0 48704 7612 p 2 85 3513 2 57544 8540 p 2 43 3557 0 50207 7775 p 2 42 3556 2 60275 8656 p 2 25 3574 1 42629 7268 p 2 26 3573 1 53668 8413 p 2 4 3594 2 34344 7053 p 2 16 3584 0 43144 7607 p 2 5 3595 0 32539 6783 p 2 5 3594 1 43729 7506 p 2 0 3589 11 28879 6175 p 2 22 3564 14 42900 7112 p 2 1 3507 92 18128 5223 p 2 25 3388 187 36264 6408 p 2 0 3388 212 14935 4868 p 2 70 3309 221 40300 6831 p 2 0 3287 313 14080 4665 p 2 54 3307 239 39659 6523 p 2 1 3162 437 13785 4485 p 2 73 3345 182 39508 6674 p 2 0 3175 425 13362 4604 p 2 81 3377 142 41363 6815 p 2 0 3140 460 12889 4402 p 2 88 3335 177 38568 6540 p 2 0 3118 482 12297 4408 p 2 56 3253 291 38792 6317 p 2 0 3147 453 12704 4391 p 2 11 3244 345 33138 5801 p 2 0 3056 544 12566 4059 p 2 47 3135 418 34549 5798 p 2 2 2878 720 10924 3774 p 2 0 3095 505 10906 4044 p 2 0 2961 639 9580 3767 p 2 0 3003 597 9709 3758 p 2 0 2776 824 8301 3469 p 2 1 2849 750 8759 3545 p 2 0 2367 1233 6667 2984 p 2 0 2616 984 7659 3249 p 2 0 2522 1078 7228 3160 p 2 0 2459 1141 7091 3078 p 2 0 3200 400 13381 4523 i 2 3600 0 0 27190 11274 p 2 0 3238 362 9304 3628 p 2 0 3213 387 7719 3547 p 2 0 2753 847 6354 3121 p 2 0 2682 918 6320 3030 p 2 0 2755 845 6081 3083 p 2 0 2407 1193 5515 2738 p 2 23 2726 851 10107 3546 p 2 2 2503 1095 9191 3208 p 2 0 2582 1018 6642 3042 p 2 1 2493 1106 9283 3154 p 2 0 2563 1037 6513 2985 p 2 137 2527 936 13730 4045 p 2 0 2571 1029 6948 3121 p 2 55 2701 844 12038 3858 p 2 0 2896 704 7705 3474 p 2 0 2204 1396 5670 2649 p 2 46 2642 912 11546 3795 p 2 2 2691 907 10224 3602 p 2 0 2568 1032 6567 3064 p 2 2 2609 989 9209 3415 p 2 0 2560 1040 6488 3074 p 2 19 2696 885 11047 3750 p 2 0 2724 876 6931 3200 p 2 13 2724 863 11430 3745 p 2 0 2603 997 6944 3161 p 2 0 2638 962 10075 3534 p 2 0 2943 657 7576 3490 p 2 0 2416 1184 4984 2768 p 2 0 2817 783 10449 3671 p 2 0 2704 896 6809 3226 p 2 0 2488 1112 6043 2959 p 2 611 2784 205 33779 8120 p 2 530 2950 120 39566 8824 p 2 0 3204 396 12242 4381 p 2 0 2885 715 8684 3634 p 2 635 2899 66 42790 9324 p 2 0 3068 532 9864 4297 p 2 222 3323 55 43041 8838 p 2 0 3368 232 13915 5264 p 2 709 2880 11 52017 10779 p 2 0 3478 122 15736 5754 p 2 71 3499 30 40413 8506 p 2 0 3497 103 14033 5480 p 2 106 3402 92 43028 8152 p 2 0 3407 193 12515 5106 i 2 3600 0 0 30927 11168 p 2 0 3099 501 15750 4142 i 2 3600 0 0 26059 10913 p 2 0 1859 1741 4721 2360 p 2 1055 1452 1093 29135 6963 p 2 0 2156 1444 9802 3203 p 2 1215 1284 1101 26934 7474 p 2 0 2229 1371 9711 3293 p 2 971 1549 1080 36377 7691 p 2 0 2338 1262 11629 3707 p 2 711 2019 870 40433 7491 p 2 0 2324 1276 10920 4037 i 2 3600 0 0 29575 11227 p 2 0 2730 870 11544 3532 i 2 3600 0 0 32601 11473 p 2 0 2602 998 9527 3224 p 2 1119 2178 303 39328 9012 p 2 0 3046 554 11628 4132 p 2 804 2655 141 38525 8739 p 2 0 3178 422 11356 4445 p 2 593 2970 37 41548 8624 p 2 0 3213 387 11594 4407 p 2 312 3096 192 41446 7896 p 2 0 3156 444 8462 4093 p 2 213 3105 282 38308 7399 p 2 0 2844 756 9782 3982 p 2 164 3064 372 34657 7043 p 2 0 2595 1005 7091 3486 p 2 944 2512 144 48457 9962 p 2 0 3252 348 13448 4738 i 2 3600 0 0 54341 13334 p 2 1 3310 289 16448 4852 i 2 3600 0 0 48945 12677 p 2 800 2770 30 60155 10711 p 2 618 2907 75 61909 10247 p 2 0 3446 154 19647 5518 p 2 961 2574 65 66297 11181 p 2 0 3513 87 19877 5790 p 2 532 2960 108 59195 9714 p 2 0 3253 347 12922 4765 p 2 658 2900 42 68489 10690 p 2 0 3433 167 21026 5736 i 2 3600 0 0 51737 12950 p 2 0 3458 142 19403 5007 i 2 3600 0 0 54115 12746 p 2 0 3462 138 19864 4981 i 2 3600 0 0 55041 12705 p 2 2 3442 156 22848 5045 i 2 3600 0 0 37986 11973 p 2 4 3350 246 16019 4655 i 2 3600 0 0 24424 11172 p 2 2 3163 435 13818 4126 i 2 3600 0 0 21804 10833 p 2 0 3181 419 14915 3883 p 2 1048 2040 512 22809 7094 p 2 0 2840 760 12876 3545 i 2 3600 0 0 24413 11144 p 2 0 3438 162 13408 4185 p 2 491 3044 65 28546 6653 p 2 0 3468 132 14511 4281 p 2 499 3077 24 31417 6901 p 2 0 3481 119 14475 4326 p 2 517 3038 45 35208 7189 p 2 0 3510 90 14582 4434 p 2 691 2885 24 36768 7651 p 2 0 3551 49 17070 4582 p 2 832 2753 15 35557 7798 p 2 0 3498 102 17260 4713 p 2 742 2842 16 34379 7624 p 2 0 3506 94 16293 4682 p 2 741 2801 58 34855 7842 p 2 0 3551 49 17844 4793 p 2 759 2809 32 34848 7750 p 2 0 3498 102 16865 4651 p 2 721 2830 49 30850 7273 p 2 0 3534 66 17315 4512 p 2 431 3134 35 31345 6702 p 2 0 3516 84 16220 4513 p 2 287 3260 53 29229 6105 p 2 0 3505 95 15757 4591 p 2 256 3301 43 28558 5894 p 2 0 3485 115 14412 4431 p 2 280 3260 60 28956 6012 p 2 0 3504 96 16232 4570 p 2 305 3212 83 29032 6048 p 2 0 3310 290 11048 4139 p 2 0 3495 105 14884 4802 i 2 3600 0 0 51754 12481 p 2 5 3477 118 32652 5744 p 2 32 3298 270 35570 6136 p 2 1 3335 264 30444 5517 p 2 20 3258 322 33510 6002 p 2 0 3375 225 23497 5012 p 2 0 3123 477 22547 4753 p 2 0 3287 313 21356 4666 p 2 1 3059 540 19270 4196 p 2 0 3202 398 19706 4243 p 2 0 3155 445 16046 3866 p 2 0 2762 838 9411 3290 p 2 0 1979 1621 5732 2396 p 2 0 2392 1208 7596 2899 p 2 0 2302 1298 6676 2782 p 2 0 3322 278 19017 4591 i 2 3600 0 0 70515 13648 p 2 0 3564 36 31260 5641 p 2 0 3553 47 32437 5352 p 2 0 3463 137 27116 5185 p 2 0 3474 126 27952 4918 p 2 0 3433 167 25716 4870 p 2 0 3452 148 25788 4732 p 2 0 3390 210 21157 4388 p 2 0 3243 357 22197 4231 p 2 0 3305 295 19797 4209 p 2 0 3190 410 21682 4142 p 2 0 2894 706 12614 3606 p 2 0 2762 838 9586 3384 p 2 0 2664 936 10472 3250 p 2 0 2132 1468 7137 2608 i 2 3600 0 0 66900 13313 p 2 47 3517 36 39049 6390 p 2 17 3550 33 35901 6177 p 2 0 3002 598 12557 4063 p 2 2 3497 101 32679 5993 p 2 5 3496 99 33301 5853 p 2 1 3514 85 29748 5617 p 2 0 3488 112 28065 5236 p 2 0 3481 119 21404 4807 p 2 0 3366 234 23010 4706 p 2 0 3426 174 21061 4546 p 2 0 3391 209 19973 4378 p 2 0 3224 376 20823 4133 p 2 0 2860 740 10639 3557 p 2 0 2433 1167 8282 3014 p 2 0 2653 947 11468 3361 p 2 0 3251 349 16979 4588 i 2 3600 0 0 96145 14498 p 2 0 3489 111 26496 5145 p 2 7 3376 217 21384 4684 p 2 0 3296 304 18157 4566 p 2 0 2964 636 11617 3789 p 2 0 3068 532 12945 4010 p 2 0 2936 664 11741 3776 p 2 0 2472 1128 9204 3132 p 2 3 2724 873 10779 3490 p 2 0 2768 832 10208 3489 p 2 0 2753 847 10249 3469 p 2 3 2687 910 10251 3427 p 2 0 2750 850 11012 3489 p 2 5 2699 896 10445 3423 p 2 0 2987 613 12374 3866 p 2 0 2863 737 11115 3646 p 2 3 2645 952 10499 3339 p 2 0 2582 1018 9926 3242 p 2 0 2146 1454 7047 2697 p 2 0 2519 1081 9155 3171 p 2 0 2225 1375 7423 2803 p 2 0 2326 1274 8116 2924 p 2 0 1745 1855 5626 2226 p 2 2 2383 1215 8868 3020 p 2 0 2712 888 10042 3407 p 2 5 2428 1167 9622 3072 p 2 0 2892 708 11258 3665 p 2 0 2860 740 11496 3603 p 2 0 2644 956 10200 3290 p 2 3 2390 1207 9413 3032 p 2 0 2411 1189 9026 2993 p 2 3 2636 961 10168 3359 p 2 0 2412 1188 8641 3035 p 2 0 2375 1225 8295 2961 p 2 0 1638 1962 5496 2148 p 2 5 2395 1200 8916 3001 p 2 0 2668 932 9860 3348 p 2 3 2393 1204 8605 3034 p 2 0 2837 763 10826 3616 p 2 0 2617 983 9370 3295 p 2 0 2325 1275 8140 2914 p 2 0 2186 1414 7923 2772 p 2 0 2306 1294 7733 2880 p 2 0 2048 1552 7174 2586 p 2 3 2110 1487 7476 2693 p 2 0 2163 1437 7552 2693 p 2 0 2163 1437 7286 2683 p 2 0 2109 1491 7818 2715 p 2 0 2342 1258 8423 2951 p 2 2 2199 1399 8143 2823 p 2 0 3202 398 19120 4277 p 2 0 2896 704 12731 3719 p 2 0 2891 709 12083 3661 p 2 0 2155 1445 8189 2747 p 2 0 3479 121 27436 5329 i 2 3600 0 0 125094 14976 p 2 602 2998 0 98306 10214 p 2 714 2886 0 107772 10756 p 2 708 2884 8 102471 11179 p 2 1133 2459 8 110356 12344 p 2 865 2734 1 110711 12589 p 2 590 3006 4 111043 12033 p 2 637 2955 8 106815 11938 p 2 1927 1672 1 107022 14597 p 2 2212 1388 0 106001 14560 p 2 1752 1848 0 93240 13331 i 2 3600 0 0 86746 14125 p 2 2525 1075 0 105744 14748 p 2 1823 1767 10 83991 13492 p 2 2235 1364 1 93708 14342 p 2 1611 1988 1 93137 13497 p 2 1378 2221 1 98959 12945 p 2 1728 1872 0 92958 13766 p 2 1405 2193 2 95165 13745 p 2 785 2812 3 85360 11999 p 2 1475 2125 0 104267 13624 p 2 1626 1974 0 111484 13598 p 2 1707 1893 0 101645 13546 p 2 1757 1824 19 103228 13548 p 2 1201 2397 2 104431 12818 p 2 1517 2083 0 109383 13637 p 2 1621 1979 0 126669 13671 p 2 1688 1912 0 118798 14027 i 2 3600 0 0 117293 14501 p 2 1507 2093 0 99859 13561 p 2 1767 1833 0 108468 13572 p 2 1186 2414 0 96307 12957 p 2 1626 1974 0 101863 13969 p 2 1403 2197 0 87763 13341 p 2 898 2700 2 78517 11920 p 2 1181 2417 2 91633 12986 p 2 915 2685 0 95838 12275 p 2 917 2682 1 84800 12285 p 2 1128 2471 1 84478 12601 p 2 779 2819 2 74343 11433 p 2 923 2675 2 97568 12183 p 2 1544 2056 0 90157 13688 p 2 759 2839 2 81570 11856 p 2 968 2631 1 76306 12268 p 2 1271 2329 0 74896 12377 p 2 1199 2398 3 80759 12502 p 2 2468 1132 0 306229 15899 i 2 3600 0 0 217147 14195 p 2 815 2785 0 230143 11500 i 2 3600 0 0 171547 14047 i 2 3600 0 0 135669 13857 p 2 153 3278 169 117523 7136 i 2 3600 0 0 117457 13518 p 2 141 3445 14 84160 7835 i 2 3600 0 0 135047 14638 p 2 165 3406 29 97247 7958 i 2 3600 0 0 182097 14841 p 2 2015 1585 0 241292 15541 p 2 685 2869 46 205828 10353 p 2 1297 2303 0 268151 14462 p 2 585 3011 4 220393 11022 p 2 644 2956 0 255619 12521 p 2 673 2926 1 228356 11410 p 2 688 2912 0 266698 12677 p 2 482 3118 0 214851 10871 p 2 418 3178 4 221995 10538 i 2 3600 0 0 138115 14115 i 2 3600 0 0 135738 14041 p 2 35 3554 11 72873 6879 i 2 3600 0 0 124798 13899 p 2 203 3318 79 71636 6885 i 2 3600 0 0 122407 13716 p 2 181 3418 1 107318 8730 i 2 3600 0 0 132722 14261 p 2 260 3328 12 102156 8391 p 2 2018 1582 0 157456 14713 p 2 1135 2465 0 150139 13145 p 2 246 3342 12 119503 8927 i 2 3600 0 0 102539 13332 p 2 239 3346 15 81716 8130 i 2 3600 0 0 96033 13208 i 2 3600 0 0 81999 13154 p 2 981 2596 23 72743 10549 p 2 1303 2297 0 95360 12914 p 2 512 3088 0 76664 10604 p 2 625 2975 0 88633 11950 p 2 310 3290 0 74680 10445 p 2 489 3111 0 91252 11770 p 2 213 3386 1 61290 10122 p 2 1338 2262 0 77884 13081 p 2 384 3216 0 51003 10142 p 2 739 2861 0 66605 11758 p 2 238 3361 1 47507 9944 p 2 642 2958 0 58332 11469 p 2 321 3278 1 47063 10365 p 2 566 3034 0 55311 11736 p 2 156 3442 2 40411 9641 p 2 166 3409 25 37803 9200 p 2 290 3310 0 47038 10432 p 2 85 3455 60 35480 8550 p 2 183 3416 1 41199 9921 p 2 113 3451 36 35391 8589 p 2 109 3490 1 38427 9592 p 2 137 3395 68 32644 8547 p 2 52 3546 2 29042 8319 p 2 56 3510 34 30447 8176 p 2 50 3539 11 28943 8254 p 2 76 3463 61 29077 8017 p 2 21 3577 2 26051 7982 p 2 39 3478 83 27289 7442 p 2 3 3578 19 26257 7599 p 2 111 3440 49 26362 7352 p 2 31 3568 1 24559 7578 p 2 59 3497 44 26528 6965 p 2 8 3585 7 23562 7116 p 2 224 3333 43 22990 7086 p 2 3 3539 58 22008 6894 p 2 4 3516 80 19396 5907 p 2 0 3576 24 19675 6817 p 2 1 3516 83 16396 5411 p 2 0 3587 13 16951 6575 p 2 0 3462 138 13500 5173 p 2 0 3583 17 13423 6080 p 2 0 3404 196 12095 4919 p 2 0 3596 4 11306 5718 p 2 0 3376 224 9922 4559 p 2 0 3382 218 7880 4847 p 2 0 3249 351 7724 4221 p 2 0 3342 258 6459 4371 p 2 0 2703 897 4531 3472 p 2 0 3054 546 5230 3534 p 2 0 2445 1155 3618 2740 p 2 0 2829 771 4419 2915 p 2 0 2197 1403 3534 2354 p 2 0 2493 1107 3900 2494 p 2 0 1836 1764 3102 1977 p 2 0 2163 1437 3243 2171 p 2 0 1236 2364 2208 1506 p 2 0 1406 2194 2789 1656 p 2 0 828 2772 1991 1196 p 2 0 925 2675 1827 1264 p 2 0 482 3118 1285 898 p 2 0 513 3087 1373 925 p 2 0 237 3363 821 679 p 2 0 234 3366 1085 677 p 2 0 138 3462 646 584 p 2 0 128 3472 670 577 p 2 0 72 3528 558 524 p 2 0 65 3535 592 519 p 2 0 41 3559 507 496 p 2 0 41 3559 555 495 p 2 0 58 3542 540 512 p 2 0 36 3564 535 491 p 2 0 47 3553 522 501 p 2 0 30 3570 527 485 p 2 0 15 3585 494 471 p 2 0 27 3573 500 482 p 2 0 28 3572 489 483 p 2 0 34 3566 508 488 p 2 0 16 3584 493 472 p 2 0 28 3572 486 483 p 2 0 18 3582 474 474 p 2 0 16 3584 487 472 p 2 0 39 3561 512 495 p 2 0 18 3582 501 474 p 2 0 42 3558 510 497 p 2 0 13 3587 468 468 p 2 0 14 3586 494 471 p 2 0 15 3585 473 471 p 2 0 20 3580 476 476 p 2 0 16 3584 473 472 p 2 0 18 3582 497 474 p 2 0 19 3581 475 475 p 2 0 12 3588 468 468 p 2 0 10 3590 467 467 p 2 0 34 3566 508 490 p 2 0 17 3583 496 473 p 2 0 34 3566 502 490 p 2 0 11 3589 470 467 p 2 0 10 3590 488 467 p 2 0 12 3588 470 468 p 2 0 6 3594 465 463 p 2 0 11 3589 472 467 p 2 0 9 3591 465 465 p 2 0 13 3587 490 469 p 2 0 13 3587 469 469 p 2 0 5 3595 461 461 p 2 0 34 3566 509 490 p 2 0 11 3589 471 467 p 2 0 36 3564 508 492 p 2 0 8 3592 488 465 p 2 0 11 3589 490 468 p 2 0 8 3592 464 464 p 2 0 1 3599 458 458 p 2 0 10 3590 470 466 p 2 0 7 3593 463 463 p 2 0 15 3585 492 471 p 2 0 9 3591 465 465 p 2 0 7 3593 485 464 p 2 0 29 3571 504 486 p 2 0 2839 761 6402 3030 i 2 3600 0 0 78699 13666 p 2 2 3598 0 39597 6454 p 2 0 3600 0 31374 5993 p 2 0 3600 0 34284 6483 p 2 0 3600 0 31916 5913 p 2 0 3600 0 32239 6118 p 2 0 3600 0 30766 5997 p 2 13 3587 0 29785 6035 p 2 1 3599 0 26009 5737 p 2 0 3600 0 28835 5781 p 2 1 3598 1 25375 5745 p 2 2 3593 5 27047 5778 p 2 15 3582 3 26022 5859 p 2 95 3502 3 31599 6387 p 2 6 3589 5 23542 5698 p 2 3 3577 20 23503 5783 p 2 3 3572 25 25062 5675 p 2 3 3582 15 21792 5352 p 2 4 3540 56 23446 5622 p 2 2 3397 201 17455 4906 p 2 25 3407 168 22084 5355 p 2 4 3550 46 26899 5797 p 2 16 3516 68 23419 5827 p 2 0 3540 60 20112 5361 p 2 0 3576 24 20504 5322 p 2 11 3571 18 27940 5997 p 2 0 3567 33 21703 5744 p 2 1 3599 0 25974 6126 p 2 3 3595 2 25063 5907 p 2 2 3598 0 27707 5904 p 2 1 3575 24 21723 5334 p 2 0 3580 20 22964 5703 p 2 0 3531 69 22084 5725 p 2 7 3556 37 24672 6118 p 2 5 3546 49 21863 5821 p 2 17 3520 63 23947 5890 p 2 6 3560 34 25384 5890 p 2 46 3537 17 30568 6518 p 2 17 3559 24 26949 6263 p 2 104 3492 4 39375 7610 i 2 3600 0 0 91564 14023 p 2 0 3422 178 16244 4616 p 2 174 2920 506 30770 5274 p 2 172 2978 450 32859 5378 p 2 0 3397 203 15628 4603 p 2 350 2851 399 36345 6163 p 2 0 3351 249 15493 4476 p 2 0 3152 448 12262 4076 p 2 390 2758 452 38496 6151 p 2 0 3149 451 12896 4086 p 2 0 2825 775 10501 3573 p 2 0 2115 1485 6497 2644 p 2 0 2937 663 10768 3662 p 2 0 2885 715 9989 3666 p 2 0 2844 756 9592 3537 p 2 0 2842 758 10156 3523 p 2 0 2910 690 10297 3642 p 2 0 2775 825 9981 3440 p 2 0 2272 1328 6983 2830 p 2 0 2841 759 10157 3505 p 2 0 2568 1032 8580 3141 p 2 0 2595 1005 8820 3175 p 2 0 2543 1057 8462 3125 p 2 0 2830 770 9419 3495 p 2 0 2574 1026 8306 3178 p 2 0 2684 916 9036 3301 p 2 0 1746 1854 5635 2236 p 2 0 2503 1097 7890 3066 p 2 0 2798 802 9520 3463 p 2 0 2377 1223 7659 2939 p 2 0 2993 607 10777 3769 p 2 0 2791 809 9291 3453 p 2 0 2525 1075 8332 3097 p 2 0 2521 1079 8523 3108 p 2 0 1903 1697 6173 2418 p 2 529 2389 682 53295 7148 p 2 0 2728 872 10408 3431 p 2 254 2745 601 47668 6385 p 2 0 2827 773 11975 3568 p 2 0 2764 836 9551 3463 p 2 194 3002 404 50495 6598 p 2 0 2879 721 12391 3729 p 2 0 3099 501 11402 3948 p 2 0 2265 1335 6571 2773 p 2 0 2713 887 9283 3335 p 2 0 2453 1147 7789 3005 p 2 0 2711 889 9124 3307 p 2 0 2525 1075 8146 3066 p 2 0 2524 1076 8103 3095 p 2 1 2523 1076 7965 3131 p 2 0 2434 1166 7476 2982 p 2 0 2494 1106 7629 3091 p 2 5 2655 940 8861 3300 p 2 0 2410 1190 7141 2920 p 2 0 2992 608 10858 3725 p 2 0 2517 1083 8287 3136 p 2 0 2017 1583 6162 2507 p 2 0 2592 1008 8341 3153 p 2 0 1705 1895 4650 2149 p 2 0 2441 1159 8163 2992 p 2 0 2278 1322 6858 2807 p 2 0 2348 1252 7412 2913 p 2 0 2292 1308 6801 2831 p 2 0 2408 1192 7421 2967 p 2 0 2443 1157 7714 2981 p 2 0 2261 1339 6950 2768 p 2 0 2740 860 9749 3401 i 2 3600 0 0 46273 12419 p 2 237 3131 232 30065 6551 p 2 0 3305 295 10412 4652 p 2 0 2824 776 7247 3537 p 2 474 2604 522 28021 6468 p 2 759 2588 253 28411 7717 p 2 0 2967 633 9422 3892 p 2 694 2571 335 27862 7508 p 2 619 2654 327 33618 8046 p 2 5 3192 403 19386 5533 p 2 0 2639 961 8848 3799 p 2 0 2447 1153 7288 3307 p 2 4 2918 678 14906 4304 p 2 5 2908 687 15397 4370 p 2 0 2808 792 9607 3799 p 2 0 2892 708 7851 3669 i 2 3600 0 0 29257 11210 p 2 0 2717 883 8456 3257 p 2 0 1600 2000 3603 2027 p 2 0 1389 2211 2979 1802 p 2 0 1330 2270 2972 1725 p 2 0 1161 2439 2627 1603 p 2 0 1477 2123 3331 1908 p 2 0 1419 2181 3103 1853 p 2 0 1429 2171 3618 1908 p 2 0 1267 2333 2726 1670 p 2 0 1342 2258 3020 1770 p 2 0 1281 2319 2669 1665 p 2 0 1246 2354 2809 1683 p 2 0 1145 2455 2496 1585 p 2 0 1246 2354 2882 1691 p 2 0 1196 2404 2464 1600 p 2 0 1094 2506 2327 1485 p 2 0 1074 2526 2271 1488 p 2 0 1297 2303 2968 1739 p 2 0 1554 2046 3831 2030 p 2 0 1418 2182 2938 1838 p 2 0 1222 2378 2948 1686 p 2 0 1355 2245 2840 1761 p 2 0 1217 2383 2538 1602 p 2 0 1213 2387 2460 1608 p 2 0 1187 2413 2555 1578 p 2 0 1240 2360 2692 1626 p 2 0 1179 2421 2549 1593 p 2 0 1126 2474 2300 1508 p 2 0 1068 2532 2226 1480 p 2 0 1261 2339 2717 1695 p 2 0 1472 2128 3550 1936 p 2 0 1318 2282 2917 1750 p 2 0 1349 2251 2895 1776 p 2 0 1219 2381 2568 1637 p 2 0 1221 2379 2429 1609 p 2 0 1223 2377 2705 1622 p 2 0 1222 2378 2486 1615 p 2 0 1229 2371 2407 1619 p 2 0 1213 2387 2412 1596 p 2 0 1138 2462 2327 1524 p 2 0 1338 2262 2856 1742 p 2 0 1069 2531 2041 1408 p 2 0 1449 2151 3390 1873 p 2 0 1293 2307 2771 1716 p 2 0 1282 2318 2644 1667 p 2 0 1262 2338 2523 1645 p 2 0 1181 2419 2514 1581 p 2 0 1275 2325 2649 1664 p 2 0 1186 2414 2530 1580 p 2 0 1143 2457 2268 1531 p 2 0 1113 2487 2387 1534 p 2 0 1093 2507 2323 1492 p 2 0 1265 2335 2574 1674 p 2 0 1210 2390 2544 1627 p 2 0 1384 2216 3217 1828 p 2 0 1283 2317 2876 1705 p 2 0 986 2614 2139 1351 p 2 0 1234 2366 2709 1646 p 2 0 1165 2435 2496 1582 p 2 0 1177 2423 2488 1569 p 2 0 1148 2452 2534 1551 p 2 0 1129 2471 2429 1528 p 2 0 1178 2422 2177 1527 p 2 0 1032 2568 2071 1408 p 2 0 1274 2326 2802 1674 p 2 0 931 2669 1918 1300 p 2 0 1386 2214 3206 1817 p 2 0 1250 2350 2807 1681 p 2 0 1187 2413 2560 1627 p 2 0 1341 2259 2730 1737 p 2 0 1287 2313 2671 1704 p 2 0 1165 2435 2337 1576 p 2 0 1152 2448 2341 1535 p 2 0 1158 2442 2519 1555 p 2 0 2841 759 9446 3404 i 2 3600 0 0 124527 13546 p 2 1 3591 8 34204 5978 p 2 0 3426 174 19490 4664 p 2 1 3371 228 18784 4578 p 2 1 3376 223 18395 4512 p 2 1 3195 404 15919 4190 p 2 2 3273 325 18903 4413 p 2 0 2980 620 17023 3912 p 2 0 2703 897 13930 3476 p 2 0 2897 703 15464 3776 p 2 2 2601 997 14097 3402 p 2 4 2584 1012 13793 3304 p 2 1 3078 521 16891 4071 p 2 3 2766 831 15708 3644 p 2 1 3392 207 20620 4697 p 2 1 3295 304 21064 4476 p 2 0 3314 286 22513 4479 p 2 0 3307 293 20105 4386 p 2 1 3150 449 19797 4177 p 2 3 3207 390 19227 4327 p 2 0 3001 599 17690 3946 p 2 0 3240 360 20401 4336 p 2 2 3072 526 19038 4131 p 2 0 3099 501 18826 4103 p 2 1 3013 586 17267 3988 p 2 0 3100 500 20392 4220 p 2 1 3342 257 21817 4669 p 2 1 3192 407 20989 4398 p 2 0 3381 219 24070 4739 p 2 3 3268 329 21954 4450 p 2 2 3305 293 21640 4590 p 2 2 3321 277 22484 4583 p 2 0 2953 647 19479 3982 p 2 0 3312 288 23955 4672 p 2 3 3125 472 21305 4366 p 2 1 3088 511 21890 4303 p 2 1 2922 677 20732 4110 p 2 2 3059 539 22431 4299 p 2 0 3248 352 25896 4781 p 2 5 3258 337 27842 4900 p 2 1 3386 213 25976 4983 p 2 0 3305 295 24676 4726 p 2 2 3308 290 25192 4864 p 2 0 3308 292 24480 4720 p 2 0 3141 459 21998 4451 p 2 3 3302 295 29808 4989 p 2 0 3302 298 26316 4802 p 2 1 3197 402 22989 4548 p 2 1 2978 621 19971 4130 p 2 1 3010 589 21778 4263 p 2 2 3269 329 24269 4726 p 2 2 3277 321 27783 4892 p 2 4 3387 209 27277 4982 p 2 3 3297 300 27621 4777 p 2 0 3304 296 24925 4716 p 2 4 3301 295 26355 4771 p 2 3 3146 451 25797 4523 p 2 4 3264 332 26137 4734 p 2 2 3178 420 24506 4516 p 2 0 3209 391 25782 4622 p 2 3 3024 573 22678 4230 p 2 4 3166 430 26005 4515 p 2 4 3299 297 25869 4783 p 2 3 3212 385 24656 4662 p 2 2 3361 237 26430 4841 p 2 1 3277 322 26713 4767 p 2 1 3303 296 26054 4711 p 2 5 3203 392 25849 4682 p 2 3 3023 574 22293 4203 p 2 4 3246 350 26745 4647 p 2 1 3120 479 24220 4374 p 2 1 3149 450 25643 4430 p 2 1 3109 490 24547 4345 p 2 2 3209 389 26565 4561 p 2 4 3104 492 25143 4306 p 2 2 3104 494 26689 4411 i 2 3600 0 0 40922 11947 p 2 665 2935 0 44719 9499 p 2 1 3538 61 25573 6489 p 2 1079 2516 5 55616 10676 p 2 5 3582 13 28954 6701 p 2 898 2701 1 63821 10809 p 2 0 3538 62 28070 6596 p 2 320 3277 3 61266 9428 p 2 0 3496 104 24525 6525 p 2 186 3399 15 60151 8987 p 2 0 3483 117 22394 5880 p 2 0 3381 219 15015 4538 p 2 0 3113 487 10884 4030 p 2 0 3186 414 11379 4173 p 2 0 3221 379 11138 4210 p 2 0 3226 374 11103 4194 p 2 2 3081 517 11664 4093 p 2 0 3076 524 9781 3914 p 2 0 2433 1167 7005 3010 p 2 0 2965 635 8910 3696 p 2 0 2872 728 9007 3632 p 2 0 3207 393 10478 4079 p 2 2 2721 877 9985 3549 p 2 0 2831 769 8630 3553 p 2 0 2624 976 7679 3306 p 2 0 2615 985 7550 3314 p 2 0 2470 1130 6973 3120 p 2 0 2398 1202 6712 2994 p 2 0 2728 872 8014 3447 p 2 0 2615 985 7620 3285 p 2 0 2710 890 8106 3400 p 2 0 3227 373 13930 4547 i 2 3600 0 0 94353 13649 p 2 5 3568 27 41407 6510 p 2 3 3513 84 36582 5852 p 2 7 3517 76 36298 5927 p 2 5 3456 139 32717 5674 p 2 112 3226 262 37517 6009 p 2 6 3372 222 31055 5398 p 2 5 3342 253 31891 5370 p 2 3 3171 426 29086 4973 p 2 11 3182 407 29736 5068 p 2 7 3005 588 28820 4788 p 2 104 2979 517 36119 5573 p 2 6 3053 541 28942 4869 p 2 14 2968 618 29219 4757 p 2 5 3357 238 32329 5434 p 2 6 3398 196 33398 5610 p 2 7 3397 196 32160 5523 p 2 110 3261 229 39906 6064 p 2 11 3326 263 32257 5403 p 2 9 3338 253 31749 5324 p 2 10 3205 385 29991 5030 p 2 8 3333 259 33324 5307 p 2 7 3298 295 32622 5274 p 2 102 3201 297 39545 5953 p 2 6 3226 368 30648 5108 p 2 8 3217 375 31839 5114 p 2 8 3283 309 31751 5313 p 2 4 3341 255 34140 5356 p 2 10 3456 134 33764 5696 p 2 114 3233 253 39690 6142 p 2 5 3411 184 34094 5577 p 2 10 3346 244 32912 5495 p 2 6 3193 401 30230 5070 p 2 8 3319 273 33240 5396 p 2 5 3236 359 31813 5229 p 2 108 3237 255 41375 6097 p 2 4 3242 354 31165 5228 p 2 8 3299 293 33692 5264 p 2 10 3418 172 34994 5649 p 2 2 3396 202 34477 5505 p 2 5 3383 212 34714 5515 p 2 110 3331 159 41956 6341 p 2 4 3324 272 32952 5340 p 2 6 3309 285 33031 5341 p 2 3 3235 362 31867 5178 p 2 9 3108 483 31126 4891 p 2 5 3232 363 32165 5117 p 2 100 3202 298 40448 5950 p 2 7 3077 516 30939 4979 p 2 7 3193 400 32210 5140 p 2 8 3390 202 33842 5575 p 2 5 3364 231 33545 5444 p 2 8 3422 170 33551 5509 p 2 115 3294 191 41886 6237 p 2 6 3329 265 32386 5355 p 2 11 3297 292 32624 5344 p 2 6 3224 370 31100 5142 p 2 8 3319 273 32967 5312 p 2 3 3306 291 32753 5295 p 2 107 3213 280 39380 6002 p 2 4 3193 403 30576 5067 p 2 11 3205 384 32035 5110 p 2 8 3321 271 33347 5408 p 2 16 3434 150 36586 5709 p 2 4 3435 161 35359 5727 p 2 111 3184 305 41192 6017 p 2 6 3418 176 36137 5617 p 2 7 3376 217 35124 5620 p 2 3 3250 347 32612 5226 p 2 10 3331 259 33458 5475 p 2 7 3168 425 31537 5133 p 2 102 3212 286 41190 5993 p 2 5 3135 460 30850 5010 p 2 11 3276 313 34384 5322 p 2 10 3434 156 35985 5741 p 2 7 3321 272 33858 5451 p 2 3 3414 183 33907 5490 p 2 113 3262 225 41365 6176 p 2 5 3421 174 35583 5545 p 2 6 3376 218 33775 5357 p 2 6 3152 442 30996 4993 p 2 9 3337 254 35208 5387 i 2 3600 0 0 73956 13778 p 2 24 3576 0 42183 7024 p 2 19 3577 4 33803 6256 p 2 16 3579 5 34552 6306 p 2 30 3568 2 34339 6180 p 2 18 3582 0 33821 6004 p 2 15 3584 1 34487 6020 p 2 16 3584 0 33700 6050 p 2 19 3580 1 32001 5943 p 2 23 3577 0 32499 5955 p 2 22 3577 1 33166 5924 p 2 18 3581 1 34190 6095 p 2 15 3583 2 33842 6007 p 2 21 3576 3 33430 6086 p 2 19 3581 0 33189 6149 p 2 11 3589 0 33232 6069 p 2 16 3581 3 32526 6066 p 2 13 3587 0 31863 6046 p 2 27 3571 2 33008 6143 p 2 14 3585 1 34858 6313 p 2 16 3582 2 32847 6113 p 2 19 3581 0 31646 6060 p 2 20 3580 0 31627 5977 p 2 31 3568 1 31205 6065 p 2 16 3581 3 30469 5945 p 2 32 3567 1 30236 5977 p 2 17 3582 1 29817 5927 p 2 19 3580 1 31552 6024 p 2 15 3584 1 29770 5894 p 2 26 3573 1 30616 5886 p 2 20 3580 0 30556 5883 p 2 16 3584 0 30234 5865 p 2 19 3580 1 29190 5738 p 2 8 3592 0 29593 5712 p 2 13 3584 3 30380 5769 p 2 18 3582 0 31310 5811 p 2 30 3570 0 32377 6036 p 2 30 3565 5 32809 6178 p 2 22 3576 2 33673 6366 p 2 22 3576 2 34566 6450 p 2 14 3584 2 34059 6537 p 2 22 3577 1 33445 6407 p 2 25 3573 2 32210 6349 p 2 25 3573 2 32058 6279 p 2 21 3574 5 31756 6168 p 2 31 3568 1 31739 6159 p 2 15 3582 3 32833 6147 p 2 15 3584 1 30756 6046 p 2 21 3576 3 31515 6167 p 2 22 3577 1 31629 6187 p 2 13 3584 3 31795 6189 p 2 25 3574 1 33079 6242 p 2 17 3583 0 33153 6250 p 2 19 3579 2 32569 6250 p 2 11 3587 2 32748 6201 p 2 17 3578 5 35114 6507 p 2 12 3586 2 33765 6371 p 2 17 3581 2 34190 6385 i 2 3600 0 0 138130 16372 p 2 0 3599 1 55465 6369 p 2 0 3593 7 44695 5652 p 2 0 3596 4 46515 5689 p 2 0 3591 9 42881 5575 p 2 0 3598 2 47389 5733 p 2 0 3598 2 42575 5682 p 2 0 3587 13 43463 5544 p 2 0 3595 5 45312 5608 p 2 0 3588 12 43530 5508 p 2 0 3593 7 44382 5427 p 2 0 3590 10 41398 5398 p 2 0 3583 17 43753 5465 p 2 0 3592 8 46589 5589 p 2 0 3594 6 46028 5563 p 2 0 3594 6 45505 5578 p 2 0 3599 1 44017 5582 p 2 0 3595 5 49974 5785 p 2 0 3585 15 43268 5646 p 2 0 3593 7 44135 5531 p 2 0 3599 1 49409 5712 p 2 0 3600 0 46959 5584 p 2 0 3595 5 48153 5540 p 2 0 3593 7 42343 5417 p 2 0 3588 12 46294 5500 p 2 0 3594 6 46251 5553 p 2 0 3593 7 45308 5547 p 2 0 3595 5 48355 5640 i 2 3600 0 0 124688 14165 i 2 3600 0 0 107673 14609 p 2 1645 1955 0 131883 14301 p 2 176 3423 1 86652 8582 p 2 23 3573 4 61798 7206 p 2 0 3575 25 47065 5556 p 2 0 3576 24 42394 5324 p 2 0 3557 43 42468 5325 p 2 0 3570 30 43813 5293 p 2 0 3566 34 44703 5421 p 2 0 3568 32 43314 5246 p 2 0 3566 34 44770 5267 p 2 0 3569 31 41988 5205 p 2 0 3571 29 43788 5261 p 2 0 3590 10 41498 5310 p 2 0 3576 24 46072 5414 p 2 0 3584 16 46025 5528 p 2 0 3577 23 45448 5381 p 2 0 3571 29 44584 5385 p 2 0 3577 23 43055 5289 p 2 0 3572 28 45679 5381 p 2 0 3582 18 44988 5392 p 2 0 3573 27 44039 5283 p 2 0 3579 21 45924 5332 p 2 0 3573 27 42504 5243 p 2 0 3578 22 47374 5350 p 2 0 3585 15 42152 5226 p 2 0 3575 25 44790 5340 p 2 0 3560 40 46190 5369 p 2 0 3575 25 45867 5401 p 2 0 3577 23 45525 5409 p 2 0 3570 30 41314 5275 p 2 0 3569 31 43873 5228 p 2 0 3563 37 46219 5253 p 2 0 3579 21 44853 5248 i 2 3600 0 0 119203 16104 p 2 32 3568 0 65709 7344 p 2 21 3578 1 62932 7154 p 2 23 3577 0 61192 7117 p 2 21 3579 0 63435 7176 p 2 19 3581 0 64430 6898 p 2 19 3580 1 65296 7118 p 2 24 3576 0 61800 6772 p 2 14 3586 0 62487 6716 p 2 19 3581 0 68434 6777 p 2 13 3587 0 71377 7095 p 2 4 3596 0 70695 6595 p 2 8 3592 0 68767 6922 p 2 19 3581 0 69132 6638 p 2 15 3585 0 73493 6980 p 2 21 3579 0 69407 6624 p 2 9 3590 1 73501 6650 p 2 6 3594 0 76370 6689 p 2 4 3596 0 75488 6641 p 2 11 3589 0 71226 6517 p 2 6 3594 0 69144 6495 p 2 5 3595 0 77558 6558 p 2 15 3585 0 79063 6589 p 2 23 3577 0 77514 6539 p 2 13 3587 0 76014 6522 p 2 6 3594 0 75187 6504 p 2 5 3594 1 78571 6519 p 2 5 3595 0 71406 6478 p 2 3 3597 0 77100 6524 p 2 0 3600 0 79705 6550 p 2 2 3598 0 75098 6527 i 2 3600 0 0 144232 15093 p 2 2 3475 123 24476 5044 p 2 325 3146 129 78338 7540 p 2 0 3397 203 20244 4576 p 2 354 2968 278 73190 7277 p 2 0 3173 427 15023 4152 p 2 0 2753 847 11117 3376 p 2 470 2981 149 77219 8027 p 2 0 2847 753 11765 3748 p 2 0 3016 584 19168 3925 p 2 0 2773 827 11522 3431 p 2 384 2910 306 73862 7397 p 2 0 3281 319 19386 4207 p 2 0 2838 762 11725 3519 p 2 139 3065 396 63496 6250 p 2 0 3353 247 22886 4522 p 2 132 3291 177 63989 6684 p 2 0 3263 337 18039 4384 p 2 0 3118 482 13122 3867 p 2 410 2973 217 73642 7781 p 2 0 3247 353 15567 4421 p 2 0 3260 340 14709 4258 p 2 0 2524 1076 8983 3189 p 2 770 2447 383 72463 8360 p 2 0 3258 342 17467 4455 p 2 0 2750 850 11334 3521 p 2 651 2561 388 67027 7894 p 2 0 2889 711 11593 3872 p 2 527 2577 496 59427 7347 p 2 0 3036 564 14600 4185 p 2 0 2564 1036 8969 3247 p 2 523 2796 281 62019 7467 p 2 0 2964 636 13902 4098 p 2 0 3241 359 15970 4252 p 2 0 2652 948 9873 3310 p 2 398 2850 352 61272 7052 p 2 0 3246 354 18376 4531 p 2 0 2889 711 11520 3621 p 2 303 3051 246 64272 7033 p 2 0 3154 446 16398 4300 p 2 552 2712 336 68948 7731 p 2 0 2940 660 13617 3980 p 2 0 2895 705 11068 3660 p 2 461 2827 312 63477 7405 p 2 0 3030 570 14055 4168 p 2 0 3287 313 15463 4327 p 2 0 2609 991 9516 3271 i 2 3600 0 0 133681 14716 p 2 0 3248 352 14307 4139 p 2 0 2587 1013 8380 3165 p 2 602 2629 369 49649 7001 p 2 0 3221 379 16645 4211 p 2 609 2581 410 43489 6692 p 2 0 3129 471 15357 4152 p 2 0 3075 525 11388 3794 p 2 471 2787 342 39257 6208 p 2 1 3055 544 13079 4002 p 2 0 3202 398 15419 4131 p 2 0 2606 994 8002 3159 p 2 421 2791 388 24684 5378 p 2 0 3029 571 11122 3782 p 2 0 3105 495 11491 3764 p 2 0 3008 592 10822 3636 p 2 0 2971 629 10924 3579 p 2 0 2740 860 9119 3268 p 2 0 2842 758 9697 3413 p 2 0 2840 760 9001 3378 p 2 1 2713 886 9378 3273 p 2 0 2424 1176 6966 2911 p 2 0 2953 647 13888 3712 i 2 3600 0 0 59445 11299 p 2 0 3446 154 14705 4581 p 2 3 3483 114 20298 5037 p 2 0 3237 363 11492 4141 p 2 0 3281 319 12207 4309 p 2 0 3261 339 16420 4484 p 2 0 3189 411 10662 4056 p 2 0 2899 701 9211 3684 p 2 0 2405 1195 6798 2982 p 2 0 3059 541 14015 4061 p 2 0 3151 449 11306 4028 p 2 0 2852 748 8759 3575 p 2 0 3264 336 15289 4258 p 2 0 3036 564 10089 3800 p 2 0 3163 437 14440 4146 p 2 0 2942 658 9260 3665 p 2 0 2887 713 8663 3611 p 2 0 2729 871 7951 3363 p 2 0 2497 1103 7013 3099 p 2 0 2569 1031 6868 3146 p 2 0 2521 1079 6817 3096 p 2 0 2628 972 7505 3231 p 2 0 2565 1035 7195 3158 p 2 0 2886 714 8984 3582 p 2 0 2783 817 7901 3462 p 2 0 2369 1231 6264 2918 p 2 0 2667 933 7814 3307 p 2 0 2322 1278 6315 2855 p 2 0 2511 1089 6969 3082 p 2 0 2459 1141 6577 3011 p 2 0 2432 1168 6691 2989 p 2 0 2404 1196 6472 2949 p 2 0 2290 1310 5863 2801 p 2 0 2555 1045 6882 3151 p 2 0 2364 1236 6189 2892 p 2 0 1930 1670 4916 2395 p 2 0 2654 946 7512 3246 p 2 0 2528 1072 6700 3092 p 2 30 2767 803 22444 4100 p 2 0 2622 978 8559 3289 p 2 0 2649 951 7685 3303 p 2 43 2621 936 22110 4040 p 2 0 2751 849 8975 3461 p 2 0 2712 888 8060 3346 p 2 26 2677 897 19072 3852 p 2 0 2679 921 8754 3349 p 2 0 2336 1264 6892 2893 p 2 0 2098 1502 5720 2599 p 2 24 2393 1183 18079 3510 p 2 0 2704 896 9074 3392 p 2 127 2712 761 25378 4592 p 2 0 2489 1111 8583 3183 p 2 0 2714 886 8094 3363 p 2 142 2628 830 24816 4589 p 2 0 2672 928 9345 3408 p 2 0 2572 1028 7863 3206 p 2 0 1922 1678 5389 2419 p 2 241 2414 945 25472 4762 p 2 0 2688 912 9292 3406 p 2 0 2670 930 8473 3324 p 2 228 2635 737 25745 4886 p 2 0 2724 876 8935 3424 p 2 255 2533 812 24943 4897 p 2 0 2689 911 9017 3442 p 2 0 2688 912 7950 3352 p 2 379 2467 754 28639 5298 p 2 0 2778 822 9967 3551 p 2 0 2731 869 7970 3424 p 2 268 2528 804 29957 5269 p 2 0 2781 819 9957 3628 p 2 0 2647 953 7968 3303 p 2 0 2282 1318 6979 2849 p 2 257 2363 980 28844 4903 p 2 0 2696 904 9771 3466 p 2 380 2491 729 27527 5384 p 2 0 2856 744 10066 3631 p 2 0 2781 819 8487 3484 p 2 263 2603 734 26098 5114 p 2 0 2927 673 10029 3697 p 2 0 2683 917 7953 3334 p 2 0 1998 1602 5443 2515 p 2 311 2404 885 24563 4983 i 2 3600 0 0 47892 11827 p 2 0 3328 272 16495 4392 p 2 142 2634 824 13346 3812 p 2 0 2176 1424 6233 2641 p 2 80 2298 1222 13798 3424 p 2 0 2140 1460 5744 2621 p 2 0 2197 1403 6135 2593 p 2 103 2180 1317 11209 3343 p 2 0 2122 1478 6142 2670 p 2 0 2077 1523 5447 2450 p 2 0 1303 2297 3365 1699 p 2 107 1799 1694 8441 2851 p 2 0 1965 1635 5420 2475 p 2 0 2421 1179 5591 2736 p 2 219 2129 1252 13293 3502 p 2 0 1959 1641 4591 2292 p 2 99 1953 1548 10977 3084 p 2 0 1826 1774 5004 2388 p 2 0 2126 1474 5441 2517 p 2 108 1862 1630 8195 2943 p 2 0 1580 2020 4253 2001 p 2 0 3162 438 13699 4193 i 2 3600 0 0 109225 13295 p 2 0 3465 135 15709 4455 p 2 0 3442 158 13510 4499 p 2 0 3528 72 19312 4740 p 2 0 3285 315 12303 4111 p 2 0 2821 779 7336 3386 p 2 0 2971 629 7985 3615 p 2 0 2778 822 7195 3293 p 2 0 2412 1188 6041 2868 p 2 0 2520 1080 6018 2970 p 2 0 2074 1526 5081 2496 p 2 0 2343 1257 5641 2760 p 2 0 3097 503 10489 3764 p 2 0 2428 1172 5823 2918 p 2 0 3189 411 10678 3971 p 2 0 3352 248 14517 4252 p 2 0 3181 419 11889 3907 p 2 0 2770 830 8530 3309 p 2 0 2684 916 7314 3177 p 2 0 2831 769 8780 3362 p 2 0 2764 836 8126 3276 p 2 0 2743 857 7989 3244 p 2 0 2757 843 7954 3256 p 2 0 2589 1011 7240 3059 p 2 0 2663 937 7396 3167 p 2 0 2955 645 9030 3565 p 2 0 2578 1022 6744 3082 p 2 0 3214 386 11036 3968 p 2 0 3145 455 10843 3803 p 2 0 3004 596 9365 3714 p 2 0 2931 669 8891 3527 p 2 0 2045 1555 4911 2472 p 2 0 2841 759 7938 3441 p 2 0 2685 915 7186 3250 p 2 0 2714 886 7203 3296 p 2 0 2752 848 7134 3307 p 2 0 2758 842 7227 3321 p 2 0 2973 627 8423 3595 p 2 0 2760 840 7774 3320 p 2 0 2361 1239 6005 2813 p 2 0 3032 568 9398 3713 p 2 0 2679 921 7339 3180 p 2 0 2918 682 9178 3518 p 2 0 2742 858 7769 3269 p 2 0 2527 1073 6557 2990 p 2 0 2428 1172 5874 2886 p 2 0 2343 1257 5830 2824 p 2 0 2369 1231 5925 2858 p 2 0 2561 1039 6756 3071 p 2 0 2296 1304 5674 2783 p 2 0 2946 654 8533 3635 p 2 0 3278 322 12480 4154 p 2 0 2974 626 9217 3609 p 2 0 2674 926 7117 3174 p 2 0 2837 763 8583 3380 p 2 0 2556 1044 6820 3039 p 2 0 2561 1039 6822 3020 p 2 0 2628 972 6755 3131 p 2 0 2459 1141 6268 2952 p 2 0 2508 1092 6486 3000 p 2 0 2586 1014 6833 3083 p 2 0 2864 736 8262 3439 p 2 0 2719 881 7202 3315 p 2 0 3193 407 10831 3963 p 2 0 3064 536 9533 3699 p 2 0 2742 858 7325 3288 p 2 0 2867 733 8210 3412 p 2 0 2225 1375 5721 2637 p 2 0 2638 962 7335 3121 p 2 0 2687 913 6797 3182 p 2 0 2372 1228 5966 2871 p 2 0 2508 1092 6475 2978 p 2 0 2421 1179 6305 2909 p 2 0 2811 789 7581 3360 p 2 0 2549 1051 6545 3042 p 2 0 3313 287 13169 4131 p 2 0 3035 565 9442 3637 p 2 0 2639 961 7564 3128 p 2 0 2628 972 7296 3117 p 2 0 2735 865 7251 3262 p 2 0 2549 1051 7179 3026 p 2 0 2909 691 9442 3450 p 2 0 2637 963 7646 3119 p 2 0 2478 1122 6806 2916 p 2 0 2570 1030 6927 3049 p 2 0 3038 562 9059 3732 p 2 0 2729 871 7420 3342 p 2 0 3136 464 10825 3912 p 2 0 3004 596 9291 3614 p 2 0 2591 1009 6936 3072 p 2 0 2737 863 7963 3266 p 2 0 2471 1129 6625 2934 p 2 0 2589 1011 6682 3045 p 2 0 2678 922 7027 3188 p 2 0 2411 1189 6154 2894 p 2 0 2673 927 7295 3172 p 2 0 2668 932 7195 3180 p 2 0 2426 1174 5909 2903 p 2 0 2870 730 8517 3471 p 2 0 3203 397 11423 3957 p 2 0 3100 500 9675 3783 p 2 0 2730 870 7596 3261 p 2 0 2523 1077 6312 2964 p 2 0 2340 1260 6108 2764 p 2 0 2472 1128 6494 2957 p 2 0 2832 768 8156 3383 p 2 0 2596 1004 6718 3112 p 2 0 2625 975 6827 3137 p 2 0 2534 1066 6487 3049 p 2 0 2840 760 7885 3411 p 2 0 2677 923 7256 3205 p 2 0 3127 473 10611 3840 p 2 0 2239 1361 5769 2662 p 2 0 2491 1109 6696 2990 p 2 0 2566 1034 6879 3047 p 2 0 2466 1134 6150 2924 p 2 0 2528 1072 6703 2992 p 2 0 2316 1284 5751 2786 p 2 0 2542 1058 6927 3050 p 2 0 2631 969 6754 3134 p 2 0 2561 1039 6534 3086 p 2 0 2826 774 7911 3376 p 2 0 2533 1067 6715 3015 p 2 0 3102 498 10685 3803 p 2 0 2262 1338 5790 2679 p 2 0 2637 963 7085 3143 p 2 0 2655 945 7076 3159 p 2 0 2620 980 7113 3099 p 2 0 2499 1101 6305 2968 p 2 0 2465 1135 6052 2969 p 2 0 2361 1239 5820 2856 p 2 0 2860 740 8210 3399 p 2 0 2638 962 6974 3160 p 2 0 2903 697 9140 3493 p 2 0 2713 887 7742 3237 p 2 0 3373 227 18090 4281 p 2 0 3272 328 12505 4003 p 2 0 2724 876 7962 3222 i 2 3600 0 0 84836 13047 p 2 0 3360 240 16535 4436 p 2 0 2511 1089 7428 3072 p 2 323 3024 253 65362 7168 p 2 0 3128 472 14658 4269 p 2 0 3208 392 14599 4055 p 2 334 3074 192 66782 7292 p 2 0 3377 223 16937 4695 p 2 356 2753 491 67024 7073 p 2 0 3241 359 14916 4337 p 2 0 2889 711 11604 3576 p 2 138 3185 277 61948 6400 p 2 0 3252 348 16357 4301 p 2 0 2911 689 11365 3615 p 2 126 3209 265 63007 6355 p 2 0 3180 420 14922 4074 p 2 0 2493 1107 9443 3081 p 2 0 3042 558 12053 3777 p 2 0 3073 527 12588 3834 p 2 0 3124 476 13349 3933 p 2 0 2879 721 11618 3539 p 2 0 3179 421 13055 3953 p 2 0 3057 543 12117 3775 p 2 0 2748 852 9483 3321 p 2 0 2717 883 8897 3238 p 2 0 2757 843 9706 3330 p 2 0 2715 885 9638 3254 i 2 3600 0 0 66021 11686 p 2 0 3507 93 18900 5039 p 2 0 3439 161 13902 4590 p 2 0 3119 481 11013 3957 p 2 0 3212 388 12326 4155 p 2 0 2983 617 9970 3703 p 2 0 3140 460 11363 4017 p 2 0 2893 707 9691 3614 p 2 0 2534 1066 7368 3073 p 2 0 2909 691 9186 3575 p 2 0 2554 1046 7609 3139 p 2 0 1905 1695 4836 2346 p 2 0 2554 1046 7178 3087 p 2 0 2654 946 7639 3235 p 2 0 2635 965 7288 3192 p 2 0 2568 1032 7166 3105 p 2 0 2780 820 8165 3410 p 2 0 2676 924 8162 3254 p 2 0 2804 796 9055 3482 p 2 0 2585 1015 7716 3179 p 2 0 1763 1837 4880 2192 p 2 0 2297 1303 6569 2803 p 2 0 2316 1284 6497 2841 p 2 0 2553 1047 7325 3094 p 2 0 2498 1102 7330 3053 p 2 0 2424 1176 6885 2961 p 2 0 2403 1197 6698 2938 p 2 0 2340 1260 6352 2858 p 2 0 2467 1133 6573 3007 p 2 0 2244 1356 5910 2724 p 2 0 2941 659 10266 3656 p 2 0 2700 900 8381 3368 p 2 0 2361 1239 6573 2857 p 2 0 2224 1376 6172 2695 p 2 0 2302 1298 6481 2812 p 2 8 2945 647 24198 4324 p 2 0 2661 939 8846 3318 p 2 2 2765 833 20725 3852 p 2 0 2545 1055 8713 3197 p 2 2 2736 862 22584 3888 p 2 0 2781 819 9779 3477 p 2 263 2493 844 39096 5294 p 2 0 3058 542 11562 4035 p 2 0 2414 1186 7429 2984 p 2 296 2709 595 50861 5956 p 2 272 2734 594 57231 6358 p 2 0 2490 1110 10833 3363 p 2 242 2458 900 61919 5945 p 2 0 2471 1129 12305 3372 p 2 464 2344 792 66792 6859 p 2 1 2898 701 14070 4164 p 2 0 2403 1197 9033 3233 p 2 597 2396 607 75023 7540 p 2 545 2678 377 80434 8136 p 2 0 3325 275 17580 4861 p 2 0 2618 982 9421 3439 p 2 366 3004 230 76852 7655 p 2 183 3185 232 80804 7458 p 2 0 2878 722 15444 4085 p 2 19 3076 505 49030 5342 p 2 0 2884 716 14310 3713 p 2 18 3071 511 45408 5117 p 2 0 3117 483 15060 4035 p 2 0 2492 1108 9939 3121 p 2 77 3028 495 55694 5637 p 2 25 3269 306 56820 5793 p 2 0 3296 304 16149 4378 p 2 51 3243 306 58959 5782 p 2 0 3199 401 17706 4208 p 2 136 3148 316 57524 6096 p 2 0 2892 708 15229 3791 p 2 0 2463 1137 8701 3072 p 2 90 2920 590 53620 5453 p 2 0 2816 784 13496 3616 p 2 134 3076 390 52463 5696 p 2 2 2966 632 17925 3886 p 2 44 3163 393 47498 5157 p 2 0 3153 447 15972 4080 p 2 9 3121 470 42521 4868 p 2 4 3290 306 43380 5014 p 2 0 3278 322 19479 4301 p 2 2 3328 270 41519 4967 p 2 0 3092 508 13680 3890 p 2 0 2229 1371 7254 2740 p 2 0 2826 774 10939 3435 p 2 0 2880 720 10496 3522 p 2 0 2615 985 9123 3216 p 2 2 2862 736 10652 3509 p 2 0 3000 600 12038 3758 p 2 0 2660 940 9424 3256 p 2 0 3076 524 12776 3867 p 2 0 2886 714 10597 3529 p 2 0 2826 774 10208 3521 p 2 0 2911 689 10979 3599 p 2 0 2550 1050 9337 3137 p 2 0 1818 1782 5758 2278 p 2 0 2484 1116 8716 3050 p 2 0 2377 1223 7777 2921 p 2 0 2420 1180 7832 2952 p 2 2 2375 1223 7708 2911 p 2 0 2632 968 8750 3236 p 2 0 2562 1038 8876 3114 p 2 0 2986 614 11841 3716 p 2 0 2735 865 9966 3345 p 2 0 2422 1178 7784 2932 p 2 0 2522 1078 8619 3062 p 2 0 2522 1078 8485 3070 p 2 0 2601 999 9206 3156 p 2 0 2297 1303 7639 2805 i 2 3600 0 0 63869 12651 p 2 4 3421 175 21808 5042 p 2 191 3089 320 34835 6191 p 2 0 2554 1046 10605 3657 p 2 373 2497 730 42831 6204 p 2 0 2919 681 12005 3950 p 2 0 2156 1444 7208 2813 p 2 18 2728 854 27715 4341 p 2 0 2658 942 20997 4030 p 2 0 2518 1082 9697 3116 p 2 0 2018 1582 6380 2481 p 2 0 2723 877 20358 3921 p 2 0 2577 1023 9015 3120 p 2 0 2244 1356 6792 2745 p 2 0 2056 1544 6123 2548 p 2 0 2160 1440 6958 2632 p 2 0 1848 1752 4817 2208 p 2 0 2921 679 10470 3537 i 2 3600 0 0 11855 10227 p 2 85 3396 119 17203 4965 i 2 3600 0 0 28166 11567 p 2 814 2786 0 22637 8030 p 2 0 2942 658 7271 3798 p 2 1 2922 677 10987 4285 p 2 7 2966 627 14755 4814 p 2 1 2850 749 12172 4299 p 2 3 2820 777 9626 3955 p 2 0 2921 679 8726 3901 i 2 3600 0 0 31173 11959 p 2 0 3089 511 13421 4631 p 2 3 3065 532 17415 5258 p 2 0 2976 624 11127 4153 p 2 0 3037 563 14424 4855 p 2 11 3017 572 11562 4627 p 2 0 3053 547 17826 5405 p 2 71 3002 527 21442 6114 p 2 1180 2021 399 45711 10700 p 2 0 3103 497 16973 5037 p 2 0 3119 481 20132 5829 p 2 0 3147 453 12302 4662 p 2 6 3086 508 20431 5692 p 2 0 3088 512 12936 4763 p 2 3 3033 564 15679 4885 p 2 69 3062 469 27445 6750 i 2 3600 0 0 50602 12543 p 2 3 3166 431 19743 5594 p 2 0 3082 518 12288 4482 p 2 1 3139 460 18312 5232 p 2 0 2971 629 12505 4410 p 2 1 3044 555 12024 4359 p 2 8 3040 552 21486 5303 p 2 1 3000 599 17703 4737 i 2 3600 0 0 26384 11779 p 2 79 3037 484 22386 6269 p 2 40 3059 501 17964 5698 p 2 113 2937 550 19154 6061 p 2 16 2996 588 14302 5198 p 2 38 2997 565 16424 5480 p 2 9 2912 679 13556 4802 p 2 90 2936 574 19271 5835 i 2 3600 0 0 11241 9991 p 2 1236 1732 632 12350 7087 i 2 3600 0 0 63518 12624 p 2 12 3031 557 17673 4254 p 2 0 2934 666 10981 3555 p 2 0 2339 1261 7299 2842 p 2 0 2387 1213 7350 2848 p 2 0 1918 1682 5231 2326 p 2 0 1946 1654 5479 2355 p 2 0 2011 1589 5631 2402 p 2 0 1359 2241 3838 1761 p 2 0 1895 1705 4798 2300 p 2 0 1706 1894 4695 2118 p 2 0 1711 1889 4788 2128 p 2 0 1533 2067 4530 1974 p 2 0 1874 1726 5097 2328 p 2 0 1771 1829 5051 2187 p 2 0 1704 1896 4233 2077 p 2 0 2173 1427 6143 2607 p 2 0 1960 1640 5586 2368 p 2 0 2053 1547 5696 2466 p 2 0 1944 1656 5378 2386 p 2 0 1837 1763 5470 2275 p 2 0 1911 1689 5228 2328 p 2 325 2764 511 66031 7374 p 2 0 2671 929 12921 3872 p 2 0 2231 1369 8212 2878 p 2 296 2990 314 65230 7406 p 2 0 2830 770 13715 4045 p 2 0 2782 818 8987 3586 p 2 0 2123 1477 6960 2715 p 2 268 2931 401 63703 7136 p 2 0 2554 1046 9110 3504 p 2 0 2679 921 9131 3370 p 2 75 3092 433 47384 5948 p 2 0 2887 713 12109 3802 p 2 13 3217 370 42814 5945 p 2 0 2958 642 12678 4037 p 2 0 2498 1102 8580 3149 p 2 0 2616 984 7817 3241 p 2 0 2613 987 8118 3230 p 2 0 2571 1029 7003 3069 p 2 0 2260 1340 6889 2782 p 2 0 2298 1302 6158 2814 p 2 0 2220 1380 6012 2710 p 2 0 2090 1510 5183 2535 p 2 0 2171 1429 5481 2625 p 2 0 2100 1500 5234 2545 p 2 0 1600 2000 3565 1980 p 2 0 2097 1503 5144 2498 p 2 0 1809 1791 4352 2218 p 2 0 2085 1515 5421 2531 p 2 0 1866 1734 5012 2288 p 2 0 2717 883 7240 3145 p 2 0 2229 1371 5652 2699 p 2 0 1844 1756 4663 2304 p 2 0 2165 1435 5010 2574 p 2 0 2012 1588 4984 2452 p 2 0 1983 1617 4849 2417 p 2 0 1952 1648 4593 2373 p 2 0 1874 1726 4350 2302 p 2 0 1896 1704 4495 2290 p 2 0 1647 1953 4245 2060 p 2 0 1662 1938 3971 2084 i 2 3600 0 0 108417 13324 p 2 0 3424 176 22685 4685 p 2 0 3202 398 10664 3969 p 2 0 3296 304 18763 4223 p 2 0 3203 397 16554 4003 p 2 0 2875 725 8516 3450 p 2 0 2908 692 8561 3500 p 2 0 2901 699 8416 3476 p 2 9 2824 767 16693 3645 p 2 0 2971 629 9460 3592 p 2 0 2209 1391 5724 2665 p 2 35 2631 934 16196 3542 p 2 0 3095 505 10581 3808 p 2 0 2920 680 9202 3492 p 2 5 3267 328 20263 4220 p 2 0 3180 420 11816 3862 p 2 0 2944 656 9061 3522 p 2 12 2945 643 16547 3733 p 2 0 2855 745 8878 3421 p 2 0 2826 774 8205 3362 p 2 2 2733 865 12995 3420 p 2 0 2635 965 7390 3179 p 2 0 2445 1155 6578 2922 p 2 3 2539 1058 12705 3193 p 2 0 2921 679 8493 3608 p 2 0 3054 546 9671 3721 p 2 24 3012 564 16769 3875 p 2 0 3056 544 10445 3802 p 2 5 3000 595 15496 3794 p 2 0 2764 836 8438 3299 p 2 0 2946 654 8645 3602 p 2 0 2897 703 8309 3491 p 2 9 2589 1002 14014 3320 p 2 0 2552 1048 7346 3065 p 2 0 2136 1464 5473 2581 p 2 8 2432 1160 13932 3137 p 2 0 2912 688 9014 3623 p 2 0 2985 615 9426 3640 p 2 17 2824 759 16807 3642 p 2 0 2800 800 9096 3395 p 2 0 3010 590 8769 3671 p 2 7 3090 503 17945 4021 p 2 0 2775 825 8221 3327 p 2 15 2762 823 17571 3593 p 2 0 2537 1063 7295 3070 p 2 0 2522 1078 6975 3056 p 2 0 1883 1717 4702 2309 p 2 0 2454 1146 11644 3049 p 2 0 2960 640 9563 3606 p 2 0 2811 789 8359 3370 p 2 0 2687 913 10819 3223 i 2 3600 0 0 84568 13050 p 2 0 3511 89 22511 4666 p 2 0 2921 679 13053 3527 p 2 0 3061 539 12397 3715 p 2 0 2808 792 10971 3361 p 2 0 2184 1416 7669 2644 p 2 0 2679 921 9616 3213 p 2 0 2192 1408 7679 2610 p 2 0 2869 731 10817 3493 p 2 0 2530 1070 9386 3009 p 2 0 2307 1293 7715 2754 p 2 0 2675 925 9374 3196 p 2 0 1915 1685 6253 2313 p 2 0 2040 1560 7177 2434 p 2 0 808 2792 3103 1245 p 2 0 1701 1899 5634 2087 p 2 0 1889 1711 5492 2307 p 2 0 1555 2045 5005 1923 p 2 0 1581 2019 5510 1997 p 2 0 2361 1239 8546 2846 p 2 0 2906 694 11545 3517 p 2 0 2875 725 11331 3407 p 2 0 2932 668 11524 3568 p 2 0 2950 650 11389 3520 p 2 0 2754 846 9218 3218 p 2 0 2640 960 9861 3140 p 2 0 2751 849 9727 3262 p 2 0 2683 917 9839 3175 p 2 0 2855 745 10439 3403 p 2 0 2844 756 9631 3375 p 2 0 2656 944 9527 3179 p 2 0 2771 829 9793 3295 p 2 0 2969 631 11806 3592 p 2 0 2739 861 9987 3254 p 2 0 2940 660 11464 3542 p 2 0 2296 1304 7609 2717 p 2 0 2789 811 10314 3284 p 2 0 2102 1498 6499 2485 p 2 0 2845 755 10603 3396 p 2 1 2802 797 9930 3369 p 2 0 2701 899 9090 3221 p 2 0 2652 948 9675 3170 p 2 0 2483 1117 8571 2976 p 2 0 2590 1010 9310 3073 p 2 0 2772 828 10132 3313 p 2 0 2738 862 10084 3266 p 2 0 2919 681 10990 3517 p 2 0 2852 748 10599 3408 p 2 0 2743 857 9489 3221 p 2 0 2763 837 9644 3275 p 2 0 1966 1634 6210 2376 p 2 0 2591 1009 9080 3078 p 2 0 2572 1028 8493 3057 p 2 1 2879 720 10993 3424 p 2 0 2716 884 9097 3220 p 2 0 2666 934 8991 3144 p 2 0 2633 967 9021 3097 p 2 0 2892 708 10510 3466 p 2 0 2552 1048 9101 3069 p 2 0 2878 722 11322 3426 p 2 0 2594 1006 9276 3065 p 2 0 2598 1002 9150 3071 p 2 0 2680 920 8919 3144 p 2 0 2552 1048 9041 3014 p 2 0 2524 1076 7993 2974 p 2 0 2807 793 9916 3293 p 2 0 2664 936 9273 3198 p 2 0 2760 840 9665 3266 p 2 0 2882 718 10835 3409 p 2 0 2646 954 9382 3111 p 2 0 3081 519 15265 3947 i 2 3600 0 0 88096 13489 p 2 0 3330 270 15524 4351 p 2 0 3247 353 12732 4064 p 2 0 2899 701 10816 3583 p 2 0 2182 1418 6630 2679 p 2 0 2853 747 10468 3506 p 2 0 2775 825 9937 3408 p 2 0 2798 802 10408 3453 p 2 0 2685 915 9957 3345 p 2 0 2663 937 9177 3265 p 2 0 2845 755 10525 3591 p 2 0 2695 905 9739 3289 p 2 0 2842 758 11831 3528 p 2 0 2773 827 10166 3435 p 2 0 2604 996 9882 3221 p 2 0 2575 1025 9318 3156 p 2 0 2524 1076 9207 3097 p 2 0 2507 1093 8409 3036 p 2 0 2409 1191 7667 2946 p 2 0 1768 1832 5661 2219 p 2 0 2291 1309 7674 2824 p 2 0 2642 958 9163 3231 p 2 0 2320 1280 8039 2866 p 2 0 2779 821 10305 3420 p 2 0 2627 973 9493 3207 p 2 0 2320 1280 7775 2852 p 2 0 2303 1297 7927 2826 p 2 0 2445 1155 7916 2974 p 2 0 2325 1275 7626 2841 p 2 0 2289 1311 7235 2809 p 2 0 2101 1499 6668 2596 p 2 0 2212 1388 6925 2687 p 2 0 2177 1423 7171 2687 p 2 0 2501 1099 8147 3063 p 2 0 2155 1445 6916 2659 p 2 0 2800 800 10742 3461 p 2 0 2591 1009 9273 3173 p 2 0 2057 1543 6768 2553 p 2 0 2153 1447 7139 2654 p 2 0 2269 1331 7415 2774 p 2 0 2307 1293 8046 2866 p 2 0 2331 1269 7691 2861 p 2 0 2146 1454 6954 2651 p 2 0 1475 2125 4674 1909 p 2 0 2239 1361 7055 2721 p 2 0 2375 1225 7976 2900 p 2 0 2160 1440 7201 2682 p 2 0 2667 933 9490 3298 p 2 0 2496 1104 8244 3028 p 2 0 2200 1400 7459 2726 p 2 0 2206 1394 7046 2713 p 2 0 1926 1674 5910 2397 p 2 0 2253 1347 7791 2765 p 2 0 2262 1338 7147 2764 p 2 0 2224 1376 6739 2718 p 2 0 1532 2068 4790 1973 p 2 0 2160 1440 7173 2666 p 2 0 2412 1188 8147 2947 p 2 0 2211 1389 7597 2747 p 2 0 2250 1350 6952 2712 p 2 0 2544 1056 9554 3140 p 2 0 2211 1389 7841 2723 p 2 0 2310 1290 8010 2818 p 2 0 2292 1308 7678 2825 p 2 0 1634 1966 5169 2068 p 2 0 2317 1283 7897 2826 p 2 0 1944 1656 6014 2419 p 2 0 1969 1631 5459 2428 p 2 0 2182 1418 6821 2643 p 2 0 2378 1222 7773 2920 p 2 0 2188 1412 7136 2683 p 2 0 2642 958 9591 3242 p 2 0 2297 1303 7682 2829 p 2 0 2006 1594 6279 2471 p 2 0 2141 1459 7034 2609 p 2 0 2203 1397 7424 2699 p 2 0 2415 1185 8296 2924 p 2 0 2022 1578 6595 2496 i 2 3600 0 0 105472 13766 p 2 0 3534 66 26286 5087 p 2 0 3319 281 17644 4322 p 2 2 3472 126 32761 5023 p 2 0 3196 404 13410 4061 p 2 0 3338 262 17207 4386 p 2 0 2583 1017 9712 3137 p 2 7 3354 239 34391 4812 p 2 0 3250 350 14944 4154 p 2 0 2939 661 12416 3613 p 2 15 3234 351 38312 4861 p 2 0 3181 419 14027 4019 p 2 9 3205 386 38426 4857 p 2 0 3104 496 14680 3946 p 2 0 3017 583 12603 3757 p 2 0 2814 786 10568 3476 p 2 7 3180 413 31398 4588 p 2 0 3403 197 18845 4442 p 2 0 2485 1115 10032 3039 p 2 8 3194 398 32119 4614 p 2 0 2900 700 11876 3565 p 2 0 2733 867 10405 3322 p 2 0 3217 383 16236 3956 p 2 0 2860 740 11742 3460 i 2 3600 0 0 66305 12396 p 2 0 3165 435 11194 4046 p 2 1102 2496 2 113021 13069 p 2 599 3001 0 131115 12310 p 2 180 3420 0 125238 9599 p 2 21 3579 0 116003 8802 p 2 9 3588 3 101492 8210 p 2 8 3588 4 89915 7181 p 2 0 3581 19 72738 6343 p 2 0 3574 26 56171 5631 p 2 0 3291 309 21251 4410 p 2 0 3363 237 21556 4482 p 2 0 3144 456 16171 4029 p 2 0 3290 310 18479 4259 p 2 0 2991 609 14554 3766 p 2 0 3457 143 23449 4735 p 2 0 3179 421 16168 4120 p 2 0 3457 143 26793 4731 p 2 0 3498 102 26947 4880 p 2 0 3325 275 19071 4421 p 2 0 3405 195 20785 4601 p 2 0 3308 292 17721 4332 p 2 0 3317 283 19800 4384 i 2 3600 0 0 114785 13432 p 2 1 3575 24 33536 5047 p 2 0 3220 380 13709 3987 p 2 0 3229 371 15538 3996 p 2 1 3124 475 13212 3863 p 2 0 3252 348 12592 4069 p 2 0 2781 819 11729 3474 p 2 2 3329 269 17954 4235 p 2 0 3219 381 13068 4014 p 2 1 3017 582 12162 3758 p 2 0 2358 1242 7896 2899 p 2 0 2220 1380 7298 2653 p 2 1 3158 441 14471 3963 p 2 0 2968 632 11266 3656 p 2 0 2979 621 12448 3727 p 2 0 2757 843 9591 3357 p 2 0 2932 668 11703 3640 p 2 0 3130 470 13047 3905 p 2 1 2810 789 11696 3472 p 2 0 2961 639 11278 3614 p 2 1 2883 716 11718 3527 p 2 0 2764 836 10060 3330 p 2 1 2674 925 10660 3295 p 2 0 2203 1397 7065 2705 p 2 1 2630 969 10672 3222 p 2 0 2597 1003 8743 3160 p 2 0 2617 983 9795 3230 p 2 0 2365 1235 7493 2868 p 2 1 2468 1131 8989 3041 p 2 0 2900 700 12000 3586 p 2 0 3309 291 15907 4170 p 2 0 2384 1216 8230 2892 p 2 1 3028 571 13299 3734 p 2 0 2728 872 9913 3298 p 2 1 2855 744 11394 3487 p 2 0 2328 1272 7561 2811 p 2 1 2734 865 10592 3323 p 2 0 2976 624 11202 3599 p 2 1 2752 847 10767 3384 p 2 0 2415 1185 7897 2936 p 2 1 2501 1098 9344 3068 p 2 453 2654 493 51156 6188 p 2 0 3297 303 17258 4265 p 2 0 3124 476 12641 3924 p 2 247 2903 450 46787 5774 p 2 0 2996 604 12846 3777 p 2 0 2773 827 9727 3380 p 2 109 2947 544 40149 5014 p 2 0 2903 697 11961 3652 p 2 0 3005 595 12210 3710 p 2 0 2257 1343 7859 2750 p 2 16 2921 663 32080 4316 p 2 0 3150 450 12952 3975 p 2 21 2926 653 30436 4373 p 2 0 3281 319 15336 4148 p 2 0 3159 441 13479 3893 p 2 0 2803 797 10377 3379 p 2 10 2803 787 28027 3973 p 2 0 2892 708 11733 3529 p 2 8 3020 572 27821 4194 p 2 0 2754 846 10958 3378 p 2 0 2723 877 9814 3278 p 2 0 2101 1499 7146 2562 p 2 10 2883 707 27725 4060 p 2 0 3176 424 13202 3985 p 2 9 2940 651 27106 4195 p 2 0 3232 368 13449 4069 p 2 0 2972 628 10525 3642 p 2 17 2957 626 32317 4430 p 2 0 3004 596 13085 3738 p 2 0 2677 923 9715 3225 p 2 18 2947 635 31631 4335 p 2 0 2835 765 10841 3454 p 2 0 2646 954 9059 3172 p 2 0 1689 1911 5748 2150 p 2 13 2948 639 28426 4152 p 2 0 2888 712 11924 3564 p 2 6 2771 823 26217 3896 p 2 0 3237 363 17198 4072 p 2 0 3094 506 12740 3853 p 2 15 2943 642 31441 4301 p 2 0 2863 737 12362 3483 p 2 0 3147 453 16273 4250 i 2 3600 0 0 96334 13345 p 2 0 3479 121 22135 4599 p 2 0 3194 406 12576 3929 p 2 0 3110 490 15713 3961 p 2 0 2324 1276 7642 2826 p 2 3 2786 811 12075 3457 p 2 0 2910 690 12075 3635 p 2 0 2886 714 11197 3502 p 2 1 2922 677 12637 3675 p 2 0 2683 917 9183 3261 p 2 3 2858 739 11209 3551 p 2 0 2634 966 8355 3167 p 2 0 2747 853 9588 3318 p 2 1 2717 882 9989 3309 p 2 0 2685 915 9355 3285 p 2 0 2608 992 8589 3133 p 2 3 2548 1049 9142 3136 p 2 0 2952 648 10746 3593 p 2 0 2468 1132 8223 2976 p 2 0 2269 1331 7157 2731 p 2 0 2789 811 10381 3340 p 2 0 2416 1184 7654 2881 p 2 0 2529 1071 9389 3070 p 2 0 2420 1180 7720 2904 p 2 0 2190 1410 7071 2660 p 2 0 2419 1181 7972 2908 p 2 0 2142 1458 6284 2588 p 2 0 2053 1547 6277 2489 p 2 0 1541 2059 4224 1932 p 2 1 1985 1614 6091 2437 p 2 0 2406 1194 7610 2915 p 2 0 2574 1026 8722 3098 p 2 3 2584 1013 9709 3124 p 2 0 2204 1396 6755 2641 p 2 0 2306 1294 7163 2766 p 2 1 2334 1265 7983 2833 p 2 0 2268 1332 7103 2714 p 2 0 2283 1317 7135 2738 p 2 3 2034 1563 6982 2529 p 2 0 2046 1554 6128 2490 p 2 0 1654 1946 4733 2071 p 2 0 1812 1788 5944 2263 i 2 3600 0 0 73618 12786 p 2 0 3070 530 10673 3763 p 2 1174 2416 10 89094 11308 p 2 788 2808 4 89669 10726 p 2 53 3543 4 45405 6941 p 2 51 3541 8 32698 6042 p 2 354 3240 6 75930 8558 p 2 355 3240 5 68841 9067 p 2 192 3408 0 62409 8303 p 2 685 2915 0 82441 10205 p 2 382 3218 0 73561 9444 p 2 229 3371 0 59630 8103 p 2 539 3057 4 85905 9848 p 2 385 3215 0 81300 9616 p 2 119 3475 6 72442 8543 p 2 458 3138 4 97807 10054 p 2 581 3011 8 96922 10384 p 2 453 3145 2 88269 9693 p 2 363 3232 5 92228 10216 p 2 455 3145 0 80182 10347 p 2 232 3366 2 79031 9611 p 2 185 3412 3 72308 9244 p 2 182 3412 6 70952 9337 p 2 719 2879 2 62136 11286 p 2 897 2703 0 52960 12152 p 2 520 3080 0 47988 11938 p 2 145 3455 0 44166 11476 p 2 404 3196 0 46251 11978 p 2 229 3371 0 41248 11165 p 2 49 3548 3 35551 9474 p 2 17 3582 1 33884 9042 p 2 39 3558 3 32871 8738 p 2 102 3495 3 34190 8818 p 2 327 3270 3 34790 8864 p 2 263 3336 1 49450 8592 p 2 223 3375 2 55047 8481 p 2 287 3311 2 61539 8710 p 2 395 3197 8 63289 9342 p 2 385 3212 3 68160 10132 p 2 542 3049 9 72041 10586 p 2 246 3347 7 71805 8938 p 2 0 3528 72 20523 5350 p 2 0 3354 246 10351 4426 p 2 0 3294 306 10447 4161 p 2 0 2928 672 7681 3515 p 2 0 3300 300 11452 4134 p 2 0 3212 388 9367 3955 p 2 0 3137 463 9214 3838 p 2 0 3023 577 7976 3650 p 2 0 3212 388 10124 3967 i 2 3600 0 0 64352 12740 p 2 0 3309 291 16214 4242 p 2 184 3278 138 63208 7395 p 2 0 3252 348 18994 4662 p 2 0 2930 670 11597 3614 p 2 45 3347 208 49698 6325 p 2 0 3064 536 13767 3979 p 2 0 2885 715 11854 3629 p 2 37 3310 253 42060 5874 p 2 0 3059 541 13245 3975 p 2 57 3301 242 45484 6097 p 2 0 3189 411 12841 4274 p 2 0 2997 603 10708 3753 p 2 0 2710 890 9775 3382 p 2 0 2666 934 8634 3254 p 2 0 2629 971 7877 3164 p 2 0 1885 1715 5243 2343 p 2 0 2499 1101 7788 3048 p 2 0 2275 1325 6851 2801 p 2 0 2244 1356 6417 2721 p 2 0 2264 1336 6971 2774 p 2 0 2567 1033 8182 3102 p 2 0 2465 1135 8253 3030 p 2 0 2705 895 9102 3323 p 2 0 2634 966 8022 3178 p 2 0 2449 1151 8008 3058 p 2 0 2369 1231 6792 2895 p 2 0 2072 1528 6026 2565 p 2 0 1647 1953 4462 2076 p 2 0 2361 1239 7416 2852 p 2 0 2149 1451 6188 2633 p 2 0 2075 1525 5679 2520 p 2 0 2254 1346 6831 2743 p 2 0 2342 1258 7020 2845 p 2 0 2243 1357 7221 2752 p 2 0 2038 1562 5887 2462 p 2 0 2491 1109 7916 3020 p 2 0 2309 1291 7538 2876 p 2 0 2231 1369 6912 2750 p 2 0 2112 1488 6248 2601 p 2 0 2138 1462 7084 2672 p 2 0 1695 1905 4550 2090 p 2 0 1759 1841 4756 2175 p 2 0 1698 1902 4734 2109 p 2 0 2121 1479 6415 2593 p 2 0 2272 1328 6622 2759 p 2 0 2091 1509 6479 2571 p 2 0 2559 1041 8546 3107 p 2 0 2388 1212 7310 2892 p 2 0 2017 1583 5735 2495 p 2 0 2308 1292 7061 2805 p 2 0 2248 1352 6451 2743 p 2 0 1942 1658 5460 2385 p 2 0 2155 1445 6798 2677 p 2 0 1876 1724 5518 2370 p 2 0 1891 1709 5159 2351 p 2 6 2028 1566 8440 2559 p 2 376 2765 459 33504 6127 p 2 287 2705 608 26206 5680 p 2 0 2371 1229 7722 2969 p 2 5 2414 1181 12965 3266 p 2 1 2541 1058 10651 3303 p 2 0 2472 1128 9328 3121 p 2 3 2491 1106 9653 3161 p 2 0 2124 1476 8938 2762 p 2 0 2383 1217 9576 3063 p 2 0 2249 1351 9179 2947 p 2 0 2378 1222 7213 2927 p 2 0 2116 1484 6081 2623 p 2 0 2327 1273 7041 2873 p 2 0 2178 1422 6605 2675 p 2 0 2550 1050 8684 3155 p 2 0 2487 1113 7950 3078 p 2 0 2031 1569 5948 2538 p 2 0 2063 1537 6441 2576 p 2 0 2017 1583 6187 2523 p 2 0 1896 1704 5512 2393 p 2 0 2065 1535 5722 2520 p 2 0 1823 1777 5211 2311 p 2 0 2228 1372 6743 2734 p 2 0 2115 1485 6552 2629 i 2 3600 0 0 126671 14499 p 2 0 3483 117 22158 4988 p 2 0 2439 1161 6822 2987 p 2 0 2440 1160 6964 3006 p 2 0 1995 1605 5838 2479 p 2 0 1444 2156 3857 1880 p 2 0 1769 1831 4865 2199 p 2 0 1786 1814 4873 2215 p 2 0 1351 2249 3640 1769 p 2 0 738 2862 2027 1197 p 2 0 849 2751 2261 1281 p 2 0 1598 2002 4071 2047 p 2 0 2418 1182 6762 2911 p 2 0 744 2856 2124 1199 p 2 0 2067 1533 5666 2509 p 2 0 2252 1348 6724 2719 p 2 0 770 2830 2086 1216 p 2 0 968 2632 2638 1404 p 2 0 1124 2476 3155 1549 p 2 0 790 2810 2197 1243 p 2 0 629 2971 1818 1069 p 2 0 529 3071 1799 991 p 2 0 455 3145 1610 908 p 2 0 411 3189 1428 859 p 2 0 973 2627 2708 1404 p 2 0 371 3229 1227 822 p 2 0 2209 1391 5758 2706 p 2 0 1402 2198 3419 1839 p 2 0 454 3146 1565 910 p 2 0 467 3133 1424 915 p 2 0 623 2977 1762 1065 p 2 0 516 3084 1638 971 p 2 0 390 3210 1346 840 p 2 0 289 3311 1058 747 p 2 0 313 3287 1210 771 p 2 0 256 3344 1016 711 p 2 0 1234 2366 3248 1633 p 2 0 422 3178 1449 870 p 2 0 3052 548 13747 3768 p 2 0 2537 1063 8323 3038 i 2 3600 0 0 114426 14210 p 2 0 3574 26 23893 5140 p 2 0 2927 673 9158 3568 p 2 0 3379 221 16118 4412 p 2 0 3091 509 11079 3823 p 2 0 3085 515 10185 3812 p 2 0 3229 371 12116 4029 p 2 0 3329 271 14142 4262 p 2 0 3170 430 11113 3944 p 2 0 3340 260 14594 4411 p 2 0 3221 379 11918 4155 p 2 0 3285 315 14617 4238 p 2 0 3321 279 14312 4212 p 2 0 3262 338 12093 4119 p 2 0 3199 401 12054 4011 p 2 0 3089 511 11570 3813 p 2 0 3015 585 10098 3658 p 2 0 2958 642 9670 3562 p 2 0 2898 702 9848 3539 p 2 0 2716 884 7898 3265 p 2 0 2454 1146 6831 3001 p 2 0 2940 660 10149 3654 p 2 0 3020 580 9432 3661 p 2 0 3229 371 12503 4063 p 2 0 3022 578 10386 3756 p 2 0 3085 515 10761 3837 p 2 0 3043 557 9902 3753 p 2 0 2862 738 9895 3544 p 2 0 2888 712 8980 3559 p 2 0 2993 607 10336 3697 p 2 0 2772 828 8457 3392 p 2 0 2805 795 8435 3446 p 2 0 3091 509 11467 3874 p 2 0 2950 650 9481 3593 p 2 0 3125 475 11101 3925 p 2 0 2445 1155 6725 2932 p 2 0 3016 584 11084 3784 p 2 0 2735 865 8318 3316 p 2 0 2795 805 8255 3385 p 2 0 2877 723 9529 3543 p 2 0 2927 673 9009 3559 p 2 0 2799 801 9018 3425 p 2 0 2669 931 7566 3231 p 2 0 2858 742 8469 3467 p 2 0 3102 498 11361 3848 p 2 0 2836 764 8579 3439 p 2 0 3270 330 14152 4192 p 2 0 3271 329 14724 4168 p 2 0 3038 562 10100 3708 p 2 0 2871 729 8798 3485 p 2 0 1918 1682 4835 2353 p 2 0 2760 840 9148 3364 p 2 0 2937 663 9001 3564 p 2 0 2813 787 9054 3458 p 2 0 2755 845 8095 3336 p 2 0 2715 885 7858 3263 p 2 0 3054 546 10827 3822 p 2 0 3068 532 10755 3782 p 2 0 3359 241 19233 4404 p 2 0 3240 360 12793 4105 p 2 0 3125 475 11771 3835 i 2 3600 0 0 103767 13362 p 2 0 3566 34 22245 5033 p 2 0 2871 729 9351 3573 p 2 0 3368 232 14931 4365 p 2 0 3085 515 11066 3880 p 2 0 3189 411 12061 4040 p 2 0 2735 865 9195 3395 p 2 0 2854 746 9570 3454 p 2 0 3130 470 11692 3998 p 2 2 2695 903 8759 3345 p 2 0 3221 379 13514 4112 p 2 1 2998 601 10769 3670 p 2 0 3222 378 12354 4068 p 2 0 3013 587 10523 3821 p 2 0 3009 591 10477 3795 p 2 0 2955 645 9867 3685 p 2 0 2831 769 8830 3492 p 2 0 1886 1714 5002 2338 p 2 2 2789 809 9309 3446 p 2 0 3045 555 11261 3817 p 2 1 2667 932 8654 3288 p 2 0 3153 447 11492 3969 p 2 0 2996 604 10220 3692 p 2 0 2553 1047 7814 3117 p 2 0 2836 764 8984 3457 p 2 0 2660 940 8184 3246 p 2 0 2577 1023 8115 3133 p 2 0 2644 956 7781 3203 p 2 0 2596 1004 7663 3142 p 2 0 2447 1153 7090 2980 p 2 0 2368 1232 6653 2873 i 2 3600 0 0 95820 13103 p 2 0 3435 165 15218 4425 p 2 0 2539 1061 6998 3135 p 2 0 3142 458 10289 3997 p 2 0 2939 661 8720 3616 p 2 0 2921 679 8628 3632 p 2 0 2964 636 9249 3700 p 2 0 3014 586 10059 3734 p 2 0 2705 895 7889 3313 p 2 0 2666 934 7741 3262 p 2 0 2797 803 8160 3419 p 2 0 2796 804 8456 3399 p 2 0 3006 594 10041 3724 p 2 0 2045 1555 5442 2515 p 2 0 2579 1021 7659 3126 p 2 0 3015 585 10154 3664 p 2 0 2656 944 7563 3194 p 2 0 2946 654 9248 3559 p 2 0 2588 1012 7481 3136 p 2 0 2459 1141 7083 2958 p 2 0 2465 1135 7056 2976 p 2 0 2512 1088 6890 3038 p 2 0 2483 1117 6673 3020 p 2 0 2346 1254 6224 2861 p 2 0 2931 669 9004 3567 p 2 0 1765 1835 4579 2216 p 2 0 2257 1343 6061 2727 p 2 0 2784 816 9176 3365 p 2 0 2494 1106 7129 3009 p 2 0 2692 908 8137 3268 p 2 0 2345 1255 6695 2846 p 2 0 2378 1222 6731 2862 p 2 0 2312 1288 6362 2826 p 2 0 2740 860 7920 3330 p 2 0 2503 1097 6984 3026 p 2 0 2461 1139 6388 2977 p 2 0 2680 920 7486 3270 p 2 0 2564 1036 7357 3113 p 2 0 3041 559 10163 3737 p 2 0 2732 868 8168 3322 p 2 0 2484 1116 7065 3030 p 2 0 2538 1062 7270 3062 p 2 0 2531 1069 7288 3055 p 2 0 2829 771 8169 3424 p 2 0 2570 1030 7288 3128 p 2 0 2618 982 7386 3173 p 2 0 2474 1126 6694 2992 p 2 0 2331 1269 6428 2836 p 2 0 2833 767 8316 3454 p 2 0 2525 1075 7045 3036 p 2 0 2124 1476 5862 2603 p 2 0 2798 802 8646 3390 p 2 0 2509 1091 6904 3015 p 2 0 2714 886 8217 3278 p 2 0 2493 1107 6851 3009 p 2 0 2328 1272 6433 2805 p 2 0 2235 1365 5783 2705 p 2 0 2344 1256 6213 2839 p 2 0 2537 1063 7269 3054 p 2 0 2415 1185 6674 2949 p 2 0 2871 729 8628 3492 p 2 0 2495 1105 6709 3020 p 2 0 1979 1621 5290 2438 p 2 0 2726 874 8448 3291 p 2 0 2481 1119 7097 3000 p 2 0 2627 973 7769 3171 p 2 0 2310 1290 6477 2795 p 2 0 2335 1265 6630 2839 p 2 0 2460 1140 6910 2971 p 2 0 2346 1254 6404 2873 p 2 0 2357 1243 6275 2875 p 2 0 2500 1100 6555 3038 p 2 0 2612 988 7438 3179 p 2 0 2320 1280 6517 2828 p 2 0 2128 1472 5869 2603 p 2 0 2659 941 8088 3231 p 2 0 2572 1028 7307 3094 p 2 0 2540 1060 7360 3068 p 2 0 2499 1101 6893 3005 p 2 0 2514 1086 6985 3006 p 2 0 2350 1250 6302 2835 p 2 0 2317 1283 6214 2812 p 2 0 2360 1240 6446 2863 p 2 0 2536 1064 7096 3082 p 2 0 2686 914 7831 3289 p 2 0 2380 1220 6855 2897 p 2 0 2163 1437 5792 2634 p 2 0 2829 771 8831 3406 p 2 0 2423 1177 6770 2936 p 2 0 2721 879 7987 3262 p 2 0 2404 1196 6629 2908 p 2 0 2255 1345 6334 2701 p 2 0 2201 1399 5975 2681 p 2 0 2379 1221 6420 2868 p 2 0 2349 1251 6277 2849 p 2 0 2381 1219 6658 2898 p 2 0 2778 822 8681 3392 p 2 0 2436 1164 6845 2967 p 2 0 2058 1542 5344 2520 p 2 0 2602 998 8019 3145 p 2 0 2336 1264 6482 2856 i 2 3600 0 0 107860 13793 p 2 0 3542 58 21992 4980 p 2 0 2818 782 9184 3427 p 2 2 3159 439 12385 3969 p 2 0 3097 503 11654 3854 p 2 0 3044 556 10611 3737 p 2 2 3026 572 11058 3735 p 2 0 3134 466 11262 3904 p 2 1 3023 576 11456 3790 p 2 0 3316 284 14539 4197 p 2 0 3099 501 11153 3889 p 2 1 2979 620 10625 3670 p 2 0 2958 642 9821 3591 p 2 0 2601 999 7721 3157 p 2 1 2799 800 9515 3420 p 2 0 2850 750 9321 3493 p 2 0 2754 846 8678 3365 p 2 0 2003 1597 5481 2455 p 2 2 2596 1002 8508 3171 p 2 0 2916 684 9420 3523 p 2 0 2742 858 9159 3327 p 2 0 3200 400 11904 3950 p 2 0 2851 749 9109 3452 p 2 0 2510 1090 8120 3030 p 2 0 2577 1023 8427 3115 p 2 0 2456 1144 7334 2947 p 2 1 2524 1075 8266 3057 p 2 0 2292 1308 6490 2772 p 2 0 2434 1166 6824 2918 p 2 0 1639 1961 4263 2066 p 2 1 2268 1331 6973 2777 p 2 0 2696 904 8472 3254 p 2 0 2476 1124 7280 2978 p 2 0 2978 622 10327 3616 p 2 0 2915 685 10844 3551 p 2 0 2686 914 8403 3248 p 2 0 2511 1089 7867 3033 p 2 0 2572 1028 8005 3090 p 2 0 2374 1226 6992 2864 p 2 0 2388 1212 6903 2850 p 2 0 2370 1230 6957 2894 p 2 0 2496 1104 7948 3007 p 2 19 2909 672 41109 4762 p 2 0 2889 711 12260 3645 p 2 16 2770 814 33913 4418 p 2 0 3194 406 12430 4047 p 2 0 3018 582 10350 3760 p 2 0 2861 739 9934 3484 p 2 59 2835 706 38740 4838 p 2 0 2773 827 9892 3474 p 2 0 2558 1042 8472 3136 p 2 61 2943 596 34396 4877 p 2 0 2721 879 9506 3437 p 2 0 2647 953 8709 3220 p 2 8 2769 823 26519 4137 p 2 0 2812 788 10786 3539 p 2 3 2886 711 26684 4180 p 2 0 3112 488 11425 3889 p 2 0 2814 786 9356 3429 p 2 0 2484 1116 7869 3005 p 2 0 2758 842 9475 3323 p 2 0 2807 793 9280 3391 p 2 0 2607 993 7876 3130 p 2 0 2419 1181 6646 2930 p 2 0 2521 1079 7453 3057 p 2 0 2459 1141 7148 2970 p 2 0 2311 1289 6432 2804 p 2 0 2132 1468 5764 2597 i 2 3600 0 0 114668 15716 p 2 0 3478 122 20710 5184 p 2 0 3303 297 14280 4409 p 2 0 3077 523 12034 3998 p 2 0 3241 359 13901 4298 p 2 0 3023 577 11478 3919 p 2 0 2976 624 10554 3808 p 2 0 2896 704 10255 3699 p 2 0 3005 595 10992 3861 p 2 0 2891 709 10337 3704 p 2 0 2608 992 8856 3303 p 2 0 2723 877 9099 3455 p 2 0 3132 468 12521 4036 p 2 0 2834 766 10175 3614 p 2 0 3098 502 13418 4004 p 2 0 2822 778 10364 3576 p 2 0 2968 632 11226 3743 p 2 0 2913 687 10773 3667 p 2 0 2591 1009 8919 3263 p 2 0 2602 998 8946 3284 p 2 0 2752 848 9643 3428 p 2 0 2586 1014 8593 3237 p 2 0 2470 1130 8632 3130 p 2 0 2782 818 9399 3492 p 2 0 2764 836 9860 3480 p 2 0 2330 1270 7694 2927 p 2 0 2987 613 11363 3868 p 2 0 2709 891 9503 3370 p 2 0 2639 961 8677 3309 p 2 0 2699 901 9233 3403 p 2 0 2638 962 9217 3307 p 2 0 2640 960 9181 3329 p 2 0 2784 816 9638 3503 p 2 0 2706 894 8980 3409 p 2 0 2804 796 10083 3558 p 2 0 2943 657 10372 3744 p 2 0 2683 917 9332 3360 p 2 0 2326 1274 7214 2885 p 2 0 2883 717 10954 3620 p 2 0 1978 1622 6256 2518 p 2 0 2800 800 10323 3494 p 2 0 2043 1557 6711 2623 p 2 0 2320 1280 6945 2895 p 2 0 2602 998 8651 3283 p 2 0 2608 992 8462 3273 p 2 0 2588 1012 8306 3220 p 2 0 2616 984 8765 3306 p 2 0 2518 1082 7987 3172 p 2 0 2954 646 11231 3758 p 2 0 2742 858 9303 3456 p 2 0 2964 636 12008 3760 p 2 0 1707 1893 5540 2253 p 2 0 2870 730 10600 3596 p 2 0 2265 1335 7356 2820 p 2 0 1879 1721 5841 2394 p 2 0 2512 1088 8533 3167 p 2 0 2118 1482 6428 2674 p 2 0 2045 1555 6323 2622 p 2 0 2525 1075 8407 3172 p 2 0 2723 877 9491 3438 p 2 0 2873 727 10521 3611 p 2 0 2363 1237 7733 2946 p 2 0 2842 758 10235 3565 p 2 0 2555 1045 8940 3201 p 2 0 2694 906 9238 3353 p 2 0 2653 947 9568 3349 p 2 0 2412 1188 7831 3042 p 2 0 2480 1120 8242 3079 i 2 3600 0 0 87713 13326 p 2 0 3518 82 19080 4970 p 2 7 3356 237 13874 4294 p 2 0 3183 417 12061 3953 p 2 3 2978 619 10788 3632 p 2 0 3122 478 11182 3794 p 2 0 3047 553 10660 3695 p 2 0 2714 886 7785 3240 p 2 7 2671 922 7919 3237 p 2 0 2776 824 7707 3310 p 2 11 2547 1042 8580 3148 p 2 0 2539 1061 6790 3022 p 2 0 1801 1799 4365 2220 p 2 0 2189 1411 5643 2613 p 2 7 2504 1089 7390 3062 p 2 0 2669 931 8247 3239 p 2 11 2415 1174 7555 2949 p 2 0 3063 537 9807 3681 p 2 0 2934 666 8812 3480 p 2 0 2342 1258 7141 2853 i 2 3600 0 0 104454 13373 p 2 0 3570 30 21314 4952 p 2 0 2910 690 8680 3584 p 2 0 3340 260 12872 4279 p 2 0 3299 301 12446 4210 p 2 0 3245 355 11424 4106 p 2 0 3302 298 12941 4236 p 2 0 3335 265 12416 4328 p 2 0 3237 363 10973 4098 p 2 0 3409 191 14180 4489 p 2 0 3223 377 11398 4095 p 2 0 3032 568 9767 3725 p 2 0 3164 436 10306 3956 p 2 0 3158 442 10171 3929 p 2 0 3130 470 10409 3882 p 2 0 3070 530 10158 3819 p 2 0 2989 611 9312 3706 p 2 0 2185 1415 5537 2677 p 2 0 2902 698 8805 3563 p 2 0 3003 597 9554 3754 p 2 0 3032 568 10420 3784 p 2 0 3031 569 10082 3721 p 2 0 3259 341 12135 4061 p 2 0 3107 493 9898 3870 p 2 0 3115 485 10097 3874 p 2 0 3024 576 9324 3699 p 2 0 2452 1148 6556 2998 p 2 0 2897 703 8481 3509 p 2 0 2744 856 7768 3315 p 2 0 2903 697 8862 3510 p 2 0 2925 675 8993 3587 p 2 0 3161 439 11676 3930 i 2 3600 0 0 61321 12508 p 2 0 3408 192 14017 4553 p 2 0 2679 921 7567 3119 p 2 15 2830 755 12281 3668 p 2 0 2868 732 9073 3440 p 2 0 2100 1500 5112 2517 p 2 4 2670 926 12195 3367 p 2 0 2634 966 6785 3110 p 2 6 2401 1193 10918 3100 p 2 0 2409 1191 6905 2862 p 2 0 2334 1266 7047 2817 p 2 11 2601 988 11456 3292 p 2 0 2484 1116 7709 2998 p 2 0 2910 690 9634 3445 p 2 0 2228 1372 6465 2657 p 2 26 2513 1061 12669 3391 p 2 0 2682 918 8572 3239 p 2 0 1965 1635 5892 2389 p 2 24 2622 954 12906 3490 p 2 0 2657 943 7857 3162 p 2 15 2492 1093 10903 3237 p 2 0 2495 1105 7386 2974 p 2 0 2274 1326 6295 2721 p 2 4 2556 1040 11080 3227 p 2 0 2365 1235 7059 2794 p 2 0 2257 1343 6553 2667 p 2 0 2223 1377 6117 2674 p 2 22 2539 1039 12328 3364 p 2 0 2439 1161 7128 2886 p 2 0 2250 1350 5774 2644 p 2 15 2188 1397 9205 2823 p 2 0 2283 1317 6591 2713 p 2 4 2245 1351 10536 2908 p 2 0 2245 1355 6827 2714 p 2 0 1995 1605 5066 2442 p 2 7 2523 1070 11296 3190 p 2 0 2208 1392 5233 2621 p 2 0 2612 988 7687 3097 p 2 0 1912 1688 5994 2317 p 2 4 2433 1163 11216 3126 p 2 0 2450 1150 7313 2946 p 2 0 2416 1184 6480 2893 p 2 7 2546 1047 11364 3254 p 2 0 2354 1246 6898 2821 p 2 10 2443 1147 9886 3145 p 2 0 2307 1293 6847 2805 p 2 0 2230 1370 6921 2682 p 2 26 2522 1052 12698 3300 p 2 0 2267 1333 7189 2734 p 2 0 2829 771 7509 3301 p 2 0 2001 1599 5540 2420 p 2 6 2586 1008 11616 3291 p 2 0 2528 1072 7372 3037 p 2 0 1808 1792 5619 2209 p 2 4 2517 1079 11577 3234 p 2 0 2442 1158 7352 2903 p 2 22 2459 1119 12231 3301 p 2 0 2416 1184 6784 2918 p 2 0 2226 1374 6522 2672 p 2 0 2220 1380 6008 2635 p 2 25 2273 1302 11972 3113 p 2 0 2275 1325 5913 2736 p 2 0 2442 1158 7700 2903 p 2 6 2318 1276 11014 2972 i 2 3600 0 0 76503 13655 p 2 0 3012 588 10911 3748 p 2 0 3321 279 19705 4452 p 2 0 3120 480 18736 4088 i 2 3600 0 0 67081 13187 p 2 100 3410 90 66560 8167 p 2 647 2740 213 84631 9823 p 2 126 3413 61 77887 8647 p 2 67 3354 179 63978 7876 p 2 0 3434 166 24693 5537 p 2 0 3339 261 21271 5027 p 2 6 3462 132 37667 5813 p 2 0 3470 130 27755 4958 p 2 0 3424 176 23773 4808 p 2 6 3303 291 36292 5420 p 2 0 3105 495 12241 3932 p 2 0 2759 841 13361 3524 p 2 16 3237 347 41552 5359 p 2 0 2916 684 15977 3928 p 2 0 3025 575 17652 3948 p 2 12 3360 228 37431 5574 p 2 0 3269 331 19039 4504 p 2 0 2943 657 18685 3974 p 2 8 3353 239 37241 5383 p 2 0 3100 500 18407 4073 i 2 3600 0 0 131834 14403 p 2 15 3527 58 60582 6063 p 2 0 3098 502 16184 4007 p 2 31 3190 379 50451 5156 p 2 0 2808 792 11654 3531 p 2 0 2340 1260 9998 2960 p 2 1 3025 574 47209 4706 p 2 0 3218 382 14595 4168 p 2 7 2873 720 49575 4632 p 2 0 3346 254 18226 4377 p 2 0 3282 318 15099 4252 p 2 0 3226 374 14410 4072 p 2 0 2880 720 10961 3571 p 2 0 2354 1246 7711 2877 p 2 0 2981 619 11984 3690 p 2 0 2823 777 10184 3472 p 2 0 3015 585 11510 3766 p 2 0 3005 595 11308 3706 p 2 0 2881 719 10457 3566 p 2 0 3188 412 14044 4041 p 2 0 3296 304 16134 4233 p 2 0 3108 492 13565 3871 p 2 0 2918 682 10118 3620 p 2 0 2719 881 9340 3327 p 2 0 2686 914 9363 3253 p 2 0 2274 1326 7249 2775 p 2 0 2904 696 10926 3524 p 2 0 2786 814 9816 3416 p 2 0 2577 1023 8316 3142 p 2 0 2734 866 9402 3330 p 2 0 3023 577 11645 3708 p 2 0 2712 888 9835 3319 p 2 0 3250 350 17910 4162 p 2 0 3112 488 13926 3884 p 2 0 2700 900 9797 3290 p 2 0 2930 670 11204 3579 p 2 0 2674 926 9578 3239 p 2 0 2811 789 10486 3410 p 2 0 2764 836 10342 3343 p 2 0 2643 957 9027 3217 p 2 0 3229 371 21008 4528 i 2 3600 0 0 63004 12367 p 2 0 3587 13 31112 5643 p 2 0 3549 51 21253 4679 p 2 0 3557 43 20348 4481 p 2 0 3550 50 19892 4324 p 2 0 3551 49 20643 4409 p 2 0 3564 36 19219 4298 p 2 0 3561 39 21721 4469 p 2 0 3570 30 20547 4342 p 2 0 3561 39 21951 4479 p 2 0 3578 22 21794 4470 p 2 0 3573 27 21333 4484 p 2 0 3571 29 20052 4299 p 2 0 3553 47 21173 4464 p 2 0 3562 38 20397 4358 p 2 0 3571 29 20144 4310 p 2 0 3571 29 19839 4309 p 2 1 3565 34 20697 4382 p 2 0 3575 25 19667 4284 p 2 0 3568 32 19800 4240 p 2 0 3558 42 19766 4197 p 2 0 3578 22 19565 4249 p 2 0 3570 30 19804 4236 p 2 1 3560 39 20766 4317 p 2 0 3568 32 19358 4258 p 2 0 3563 37 20923 4320 p 2 0 3583 17 20827 4271 p 2 0 3583 17 20470 4310 p 2 0 3568 32 20331 4260 p 2 0 3571 29 20830 4285 p 2 0 3583 17 20073 4304 p 2 0 3579 21 20821 4319 p 2 0 3568 32 19531 4189 p 2 0 3567 33 20142 4281 p 2 0 3567 33 19407 4213 p 2 1 3555 44 20064 4243 p 2 0 3576 24 19320 4168 p 2 0 3560 40 18615 4190 p 2 0 3575 25 19230 4284 p 2 0 3578 22 20566 4334 p 2 0 3560 40 18629 4218 p 2 0 3568 32 20314 4294 p 2 0 3569 31 19050 4208 p 2 0 3581 19 19406 4207 p 2 0 3583 17 19402 4149 p 2 0 3564 36 19587 4236 p 2 0 3576 24 19986 4189 p 2 0 3549 51 19574 4147 p 2 0 3569 31 20270 4147 p 2 0 3576 24 19626 4181 p 2 0 3576 24 19629 4151 p 2 0 3585 15 19921 4268 p 2 0 3579 21 20250 4279 p 2 0 3568 32 19640 4291 p 2 0 3568 32 19514 4183 p 2 0 3575 25 18036 4153 p 2 1 3574 25 18621 4128 p 2 0 3568 32 18141 4144 p 2 0 3570 30 17575 4102 p 2 0 3569 31 18905 4169 p 2 0 3577 23 17514 4122 p 2 0 3571 29 19268 4259 p 2 0 3576 24 19458 4260 p 2 0 3585 15 17599 4186 p 2 0 3577 23 17461 4167 p 2 1 3576 23 18020 4207 p 2 0 3578 22 17129 4130 p 2 0 3578 22 18400 4183 p 2 0 3568 32 17863 4088 p 2 0 3577 23 19802 4220 p 2 0 3578 22 18348 4185 p 2 0 3566 34 17556 4125 p 2 0 3574 26 17154 4065 p 2 0 3566 34 17249 4169 p 2 0 3585 15 18227 4117 p 2 0 3564 36 18202 4094 p 2 0 3573 27 18396 4151 p 2 1 3574 25 18885 4233 p 2 0 3574 26 17090 4111 p 2 0 3574 26 17005 4054 p 2 0 3577 23 18222 4062 p 2 0 3578 22 19358 4158 p 2 0 3577 23 18587 4150 p 2 0 3565 35 17288 4152 p 2 0 3568 32 17443 4077 p 2 0 3575 25 18140 4176 p 2 0 3582 18 19342 4261 p 2 0 3585 15 18713 4285 p 2 0 3563 37 19314 4321 p 2 0 3563 37 19803 4311 p 2 0 3563 37 19614 4211 p 2 0 3584 16 18353 4192 p 2 0 3572 28 17874 4166 p 2 0 3574 26 18712 4219 p 2 0 3584 16 19703 4212 p 2 0 3571 29 19183 4224 p 2 0 3573 27 17129 4131 p 2 0 3562 38 18561 4223 p 2 1 3576 23 19568 4276 p 2 0 3572 28 17860 4184 p 2 0 3565 35 18356 4251 p 2 0 3576 24 19453 4319 p 2 0 3556 44 18623 4230 p 2 0 3576 24 18513 4246 p 2 0 3580 20 18130 4168 p 2 0 3570 30 20000 4233 p 2 0 3570 30 18838 4269 p 2 0 3553 47 18340 4253 p 2 0 3586 14 18200 4139 p 2 0 3577 23 18179 4262 p 2 0 3588 12 18535 4231 p 2 0 3573 27 18527 4227 p 2 0 3576 24 18451 4301 p 2 0 3585 15 19243 4301 p 2 0 3573 27 17880 4244 p 2 0 3569 31 17790 4176 p 2 0 3571 29 19248 4216 p 2 0 3559 41 18202 4287 p 2 0 3564 36 18669 4320 p 2 0 3553 47 18501 4281 p 2 0 3576 24 17632 4234 p 2 0 3551 49 19254 4366 p 2 0 3577 23 18689 4334 p 2 0 3570 30 18861 4333 p 2 0 3558 42 18132 4325 p 2 0 3557 43 19150 4372 p 2 0 3549 51 18860 4311 p 2 0 3570 30 17593 4257 p 2 0 3555 45 18322 4223 p 2 0 3583 17 17954 4263 p 2 0 3578 22 18050 4223 p 2 0 3559 41 18187 4186 p 2 0 3565 35 17447 4208 p 2 0 3544 56 18294 4288 p 2 0 3574 26 18171 4306 p 2 0 3574 26 16577 4215 p 2 0 3578 22 19071 4273 p 2 0 3555 45 18345 4221 p 2 0 3562 38 17522 4187 p 2 0 3584 16 18782 4201 p 2 0 3547 53 17186 4103 p 2 0 3574 26 17863 4158 p 2 0 3538 62 17063 4179 p 2 0 3545 55 17342 4189 p 2 0 3565 35 17366 4105 p 2 0 3516 84 16768 4144 p 2 0 3576 24 16233 4117 p 2 0 3537 63 16441 4076 p 2 0 3542 58 16431 4070 p 2 0 3542 58 17537 4170 p 2 0 3544 56 16330 4093 p 2 0 3559 41 15488 4010 p 2 0 3523 77 14892 3978 p 2 0 3545 55 14761 4031 p 2 0 3547 53 14996 4036 p 2 0 3488 112 14127 3918 p 2 0 3522 78 14634 3952 p 2 0 3503 97 14019 3908 p 2 0 3548 52 14554 3973 p 2 0 3509 91 15042 3994 p 2 0 3510 90 16632 3945 p 2 0 3513 87 18317 4112 p 2 0 3468 132 16413 4094 p 2 0 3533 67 17034 4155 p 2 1 3452 147 16050 3996 p 2 0 3541 59 17074 4215 p 2 0 3450 150 16715 4128 p 2 1 3445 154 17923 4112 p 2 0 3462 138 16431 4039 p 2 0 3481 119 17895 4182 p 2 0 3501 99 17958 4218 p 2 0 3478 122 18175 4189 p 2 0 3480 120 18289 4173 p 2 0 3398 202 17704 4100 p 2 0 3498 102 17894 4069 p 2 0 3499 101 17809 4084 p 2 0 3332 268 17922 3883 p 2 0 3509 91 18723 4165 p 2 0 3423 177 17718 4086 p 2 0 3340 260 18595 4030 p 2 0 3445 155 17301 3961 p 2 0 3358 242 17180 4000 p 2 0 3393 207 18477 4037 p 2 0 3341 259 16134 3908 p 2 0 3187 413 15846 3925 p 2 0 3209 391 16805 3924 p 2 0 3142 458 13905 3803 p 2 0 3123 477 14250 3871 p 2 0 3025 575 14992 3756 p 2 0 2750 850 9347 3256 p 2 0 2450 1150 8512 2955 p 2 0 2575 1025 7672 3085 p 2 0 2614 986 6752 3072 p 2 0 2300 1300 5925 2760 p 2 0 2576 1024 7695 3084 p 2 0 3125 475 10731 3764 p 2 0 2157 1443 5688 2588 p 2 0 2239 1361 6304 2705 p 2 0 2124 1476 5373 2548 p 2 0 2572 1028 6736 3029 p 2 0 2340 1260 6343 2820 p 2 0 2407 1193 5918 2859 p 2 0 2127 1473 5609 2586 p 2 0 2258 1342 5779 2715 p 2 0 2053 1547 5045 2487 p 2 0 1958 1642 4902 2401 p 2 0 2545 1055 6993 3033 p 2 0 2432 1168 6757 2915 p 2 0 2223 1377 5901 2640 p 2 0 2127 1473 5236 2543 p 2 0 2381 1219 6085 2823 p 2 0 2499 1101 6500 2967 p 2 0 2187 1413 5999 2643 p 2 0 2353 1247 5906 2799 p 2 0 2222 1378 5611 2679 p 2 0 2470 1130 6139 2896 p 2 0 2291 1309 6081 2745 p 2 0 2367 1233 6761 2843 p 2 0 2329 1271 6007 2779 p 2 0 2912 688 8975 3499 p 2 0 1988 1612 5035 2408 p 2 0 2498 1102 6691 3007 p 2 0 2339 1261 5638 2774 p 2 0 2396 1204 6147 2849 p 2 0 2203 1397 5791 2653 p 2 0 2279 1321 5781 2726 p 2 0 2205 1395 5745 2671 p 2 0 2205 1395 5820 2680 p 2 0 2045 1555 5001 2496 p 2 279 2574 747 55887 5998 p 2 0 2781 819 9871 3606 p 2 0 2934 666 8969 3625 p 2 0 2088 1512 6160 2601 p 2 138 2698 764 54220 5426 p 2 0 2393 1207 7478 3118 p 2 0 2596 1004 8660 3150 p 2 46 2777 777 47140 4864 p 2 0 2616 984 9588 3258 p 2 50 2725 825 49203 4798 p 2 0 2796 804 10269 3452 p 2 0 2631 969 7734 3181 p 2 0 2710 890 8543 3248 p 2 0 2626 974 9101 3264 p 2 0 2578 1022 6912 3099 p 2 0 3093 507 12009 3734 p 2 0 2760 840 8536 3322 p 2 0 2456 1144 6479 2893 p 2 0 2762 838 8701 3283 p 2 0 2948 652 9251 3518 p 2 0 2713 887 7896 3231 p 2 0 2540 1060 7251 3050 p 2 0 2820 780 9528 3378 p 2 0 3447 153 24937 5121 i 2 3600 0 0 124348 15475 p 2 0 3523 77 19785 4825 p 2 0 3452 148 20763 4603 p 2 0 3125 475 13489 3978 p 2 0 2739 861 9239 3394 p 2 2 2908 690 11238 3656 p 2 0 3017 583 11290 3732 p 2 0 3089 511 12566 3887 p 2 0 2610 990 8604 3194 p 2 0 2222 1378 7055 2747 p 2 0 1987 1613 5974 2483 p 2 0 2691 909 9324 3307 p 2 0 3283 317 14388 4227 p 2 0 3137 463 13392 3953 p 2 0 3174 426 14787 4027 p 2 0 3025 575 12179 3776 p 2 0 3089 511 12565 3803 p 2 0 2946 654 11043 3639 p 2 0 2898 702 10841 3577 p 2 0 2876 724 10569 3518 p 2 0 2810 790 9827 3457 p 2 0 2790 810 9130 3401 p 2 0 2750 850 9369 3333 p 2 0 2609 991 8753 3206 p 2 0 2940 660 10694 3619 p 2 0 3054 546 11733 3735 p 2 0 3338 262 23114 4475 p 2 0 3204 396 15142 4104 p 2 0 2941 659 12127 3667 i 2 3600 0 0 102369 13438 p 2 0 3563 37 23941 4935 p 2 0 3336 264 12721 4283 p 2 0 3317 283 11594 4178 p 2 0 3415 185 14570 4433 p 2 0 3239 361 10761 4036 p 2 0 2896 704 9319 3564 p 2 0 2974 626 9921 3592 p 2 0 3237 363 12388 4153 p 2 0 3383 217 15578 4341 p 2 0 2853 747 8910 3501 p 2 0 3301 299 12422 4206 p 2 0 3230 370 11088 4057 p 2 0 3192 408 10773 3954 p 2 0 3174 426 10855 3973 p 2 0 3108 492 10105 3832 p 2 0 3071 529 9994 3799 p 2 0 3005 595 9348 3724 p 2 0 3120 480 10303 3903 p 2 0 3261 339 12748 4087 p 2 0 2980 620 9166 3647 p 2 0 3312 288 11759 4216 p 2 0 2429 1171 6428 2925 p 2 0 3161 439 10805 3934 p 2 0 2903 697 8778 3577 p 2 0 2850 750 8398 3478 p 2 0 2811 789 8260 3443 p 2 0 2899 701 8804 3516 p 2 0 2765 835 7969 3404 p 2 0 2860 740 8204 3490 p 2 0 2820 780 8003 3440 p 2 0 3011 589 9439 3715 p 2 0 3130 470 10757 3876 p 2 0 3276 324 11684 4160 p 2 0 2336 1264 6138 2834 p 2 0 3068 532 10510 3745 p 2 0 2965 635 9927 3646 p 2 0 2896 704 8649 3551 p 2 0 2954 646 8823 3618 p 2 0 2980 620 8693 3639 p 2 0 3055 545 9748 3766 p 2 0 2918 682 8501 3544 p 2 0 2794 806 8287 3420 p 2 0 3114 486 10150 3860 p 2 0 2832 768 8579 3453 p 2 0 3268 332 13233 4145 p 2 0 2455 1145 6797 2950 p 2 0 2872 728 8795 3510 p 2 0 3104 496 10432 3815 p 2 0 3271 329 12626 4058 p 2 0 3015 585 9878 3672 p 2 0 2989 611 9211 3652 p 2 0 2826 774 8416 3451 p 2 0 2719 881 7785 3249 p 2 0 2833 767 8595 3451 p 2 0 3069 531 10261 3768 p 2 0 2961 639 8814 3681 p 2 0 3404 196 13594 4394 p 2 0 3257 343 11550 4052 p 2 0 2775 825 7965 3340 i 2 3600 0 0 53526 13390 p 2 7 3588 5 22333 5676 p 2 0 3313 287 11900 4546 p 2 0 3212 388 16523 4956 p 2 0 3360 240 14326 4817 p 2 0 3200 400 13933 4677 p 2 0 3353 247 21359 5361 p 2 0 3152 448 12171 4549 p 2 0 3161 439 11814 4376 p 2 0 3214 386 16476 4684 p 2 0 3134 466 11622 4396 p 2 0 3138 462 13488 4552 p 2 0 3227 373 14308 4575 p 2 0 3203 397 13248 4554 p 2 0 3084 516 12102 4356 p 2 0 3190 410 15207 4689 p 2 0 3053 547 11604 4264 p 2 0 3116 484 13028 4477 p 2 0 3218 382 17217 4921 p 2 0 3065 535 11131 4266 p 2 0 3118 482 12145 4442 p 2 0 3295 305 17800 4859 p 2 0 3129 471 13315 4625 i 2 3600 0 0 30428 10938 p 2 0 2888 712 5740 3063 p 2 0 2439 1161 6907 2831 p 2 0 2375 1225 5417 2625 p 2 0 1968 1632 5013 2396 p 2 0 2672 928 6339 2968 p 2 0 2080 1520 6367 2661 p 2 0 2359 1241 5303 2690 p 2 0 2136 1464 4879 2523 p 2 0 2464 1136 6380 2885 p 2 0 2069 1531 6526 2632 p 2 0 2445 1155 6243 2808 p 2 0 2130 1470 4790 2518 p 2 0 2497 1103 6311 2880 p 2 0 2077 1523 6426 2687 p 2 0 2515 1085 5682 2798 p 2 0 1743 1857 4820 2281 p 2 0 3019 581 6234 3202 p 2 0 2305 1295 6204 2802 p 2 0 2282 1318 5538 2704 p 2 0 2369 1231 4843 2643 p 2 0 2553 1047 6258 2925 p 2 0 2284 1316 7239 2853 p 2 0 2570 1030 7611 2924 p 2 0 1950 1650 5407 2484 p 2 0 2084 1516 5805 2622 p 2 0 2118 1482 9091 2764 p 2 0 2102 1498 5669 2543 p 2 0 1895 1705 4928 2389 p 2 0 2333 1267 6276 2795 p 2 0 1919 1681 6491 2571 p 2 0 2546 1054 5867 2860 p 2 0 2079 1521 4339 2412 p 2 0 2022 1578 5945 2603 p 2 0 1981 1619 7109 2658 p 2 0 2255 1345 5900 2712 p 2 0 2323 1277 5101 2651 p 2 0 2032 1568 6467 2639 p 2 3 2048 1549 11122 2752 p 2 0 2243 1357 6465 2712 p 2 0 2136 1464 5261 2561 p 2 1 2624 975 10464 3049 p 2 0 2243 1357 7431 2842 p 2 0 2723 877 6510 3008 p 2 2 2055 1543 8708 2629 p 2 0 2582 1018 6656 2969 p 2 0 2218 1382 7121 2783 p 2 0 2562 1038 10071 2991 p 2 0 2339 1261 5680 2691 p 2 0 1836 1764 6262 2487 p 2 0 2081 1519 6915 2732 p 2 0 1937 1663 5434 2468 p 2 0 2267 1333 5400 2649 p 2 0 2203 1397 5808 2677 p 2 0 2359 1241 7019 2883 p 2 0 2426 1174 5680 2771 p 2 0 2003 1597 4743 2474 p 2 0 2757 843 6331 3018 p 2 0 2236 1364 7502 2835 p 2 0 2339 1261 5707 2748 p 2 0 2314 1286 5138 2664 p 2 0 1827 1773 5489 2426 p 2 0 1928 1672 6489 2539 p 2 0 2015 1585 5287 2490 p 2 0 1826 1774 4916 2359 p 2 0 1977 1623 5982 2565 p 2 0 2111 1489 6315 2694 p 2 0 1998 1602 5392 2508 p 2 0 1798 1802 5211 2403 p 2 0 2308 1292 6098 2803 p 2 0 2121 1479 7018 2719 p 2 0 2313 1287 5674 2718 p 2 0 2053 1547 4826 2498 p 2 0 2080 1520 5959 2630 p 2 0 1978 1622 6101 2580 p 2 0 1996 1604 5484 2500 p 2 0 2336 1264 4976 2641 p 2 0 2351 1249 6058 2766 p 2 0 2628 972 6831 3029 p 2 0 2286 1314 5518 2672 p 2 0 2079 1521 5215 2544 p 2 0 2526 1074 6166 2910 p 2 0 2300 1300 6630 2816 p 2 0 2332 1268 5979 2761 p 2 0 2204 1396 4887 2594 p 2 0 2023 1577 5659 2572 p 2 0 1907 1693 6329 2555 p 2 0 1875 1725 4929 2400 p 2 0 1957 1643 4932 2446 p 2 0 2270 1330 5853 2727 p 2 0 1870 1730 6505 2590 p 2 0 1855 1745 5111 2389 p 2 0 2048 1552 4651 2480 p 2 0 2090 1510 5923 2620 p 2 0 1945 1655 6507 2583 p 2 0 1892 1708 5686 2480 p 2 0 2271 1329 5182 2698 p 2 0 1802 1798 5690 2452 p 2 0 2230 1370 6641 2745 p 2 0 1761 1839 5269 2339 p 2 0 2097 1503 4848 2512 p 2 0 2234 1366 6148 2720 p 2 0 2225 1375 6477 2769 p 2 0 2356 1244 5584 2711 p 2 0 2242 1358 5193 2618 p 2 0 2096 1504 5910 2611 p 2 0 2123 1477 6615 2704 p 2 0 2210 1390 6484 2712 p 2 0 1862 1738 5029 2389 p 2 0 2014 1586 5795 2566 p 2 0 1880 1720 6304 2533 p 2 0 1991 1609 5689 2490 p 2 0 1946 1654 5009 2445 p 2 0 1869 1731 5838 2470 p 2 0 1979 1621 6631 2662 p 2 0 1926 1674 5009 2425 p 2 0 1956 1644 5305 2469 p 2 0 2277 1323 6001 2763 p 2 0 2070 1530 7384 2727 p 2 0 2005 1595 7509 2604 p 2 0 2370 1230 5621 2732 p 2 0 2443 1157 6553 2876 p 2 1 2298 1301 8444 2861 p 2 0 2001 1599 5418 2506 p 2 0 2009 1591 5350 2511 p 2 0 2457 1143 6071 2844 p 2 0 2341 1259 6974 2859 p 2 0 1889 1711 5541 2439 p 2 0 2553 1047 5084 2785 p 2 0 2040 1560 6168 2602 p 2 0 1962 1638 6420 2585 p 2 0 2405 1195 6008 2804 p 2 0 2227 1373 5271 2640 p 2 0 2366 1234 6017 2796 p 2 0 2432 1168 6807 2893 p 2 0 2167 1433 5291 2590 p 2 0 1976 1624 4815 2417 i 2 3600 0 0 63260 13106 p 2 1 3130 469 16216 4259 p 2 0 2994 606 15946 4183 p 2 0 3017 583 15309 3944 p 2 1 2982 617 14580 3986 p 2 1 2978 621 16963 4183 p 2 0 2901 699 15877 4081 p 2 2 3015 583 18554 4296 p 2 0 2878 722 14176 3953 p 2 2 2970 628 16664 4175 p 2 0 2963 637 16063 4179 p 2 1 2996 603 18360 4171 p 2 1 2863 736 12983 3934 p 2 0 2981 619 16770 4141 p 2 268 2825 507 59267 7440 p 2 2 2990 608 17471 4553 p 2 1 3047 552 17453 4227 p 2 291 2856 453 63284 7630 p 2 1 2905 694 16117 4267 p 2 2 2964 634 18881 4329 p 2 258 2786 556 61062 7299 p 2 1 3124 475 20651 4510 p 2 1 3044 555 18415 4475 p 2 298 2832 470 61147 7652 p 2 1 2967 632 17603 4230 p 2 0 3048 552 18342 4290 p 2 0 2959 641 15607 4157 p 2 0 3111 489 19072 4377 p 2 0 2980 620 14788 4091 p 2 1 3072 527 16066 4202 p 2 1 2928 671 17073 4166 p 2 0 2973 627 15923 4142 p 2 0 2884 716 13407 3886 p 2 1 3018 581 16028 4153 p 2 1 2897 702 15701 4005 p 2 0 3017 583 18222 4159 p 2 0 2932 668 15104 3982 p 2 1 2987 612 16286 4117 p 2 0 2890 710 16440 4035 p 2 0 2988 612 15702 4088 i 2 3600 0 0 57789 12986 p 2 2 2977 621 16902 4418 p 2 610 2467 523 66298 8903 p 2 1 3035 564 20881 4730 p 2 346 2790 464 69628 8447 p 2 1 3035 564 21495 5007 p 2 1 2939 660 16030 4334 p 2 28 3096 476 43873 5947 p 2 0 3128 472 19062 4434 p 2 0 2995 605 18295 4217 p 2 8 3113 479 39499 5609 p 2 0 2902 698 13793 3869 p 2 1 3071 528 17612 4263 p 2 20 3113 467 38277 5445 p 2 0 3032 568 18556 4369 p 2 0 3059 541 19297 4349 p 2 1 2960 639 15019 4102 p 2 0 3049 551 18354 4298 p 2 0 2989 611 17453 4254 p 2 3 3039 558 20127 4403 p 2 2 2990 608 16788 4180 p 2 14 2999 587 18648 4389 p 2 0 2892 708 16988 4112 p 2 3 2994 603 18412 4312 p 2 2 2934 664 15316 4120 p 2 1 3056 543 19175 4365 p 2 0 2977 623 19715 4238 p 2 1 3065 534 19213 4355 p 2 7 2967 626 13920 4098 p 2 1 3076 523 18010 4278 p 2 1 2996 603 18622 4239 p 2 16 3055 529 20734 4473 p 2 0 3005 595 16487 4155 p 2 1 3003 596 17085 4246 p 2 0 3011 589 19563 4303 p 2 0 3053 547 19534 4307 p 2 0 2977 623 14492 4160 p 2 5 3071 524 19920 4361 p 2 0 2951 649 18647 4178 p 2 0 3047 553 19903 4368 p 2 14 3025 561 16498 4209 p 2 1 3025 574 19367 4361 p 2 2 2982 616 16963 4213 p 2 1 3071 528 20874 4401 p 2 1 2994 605 16609 4141 p 2 2 3015 583 17006 4245 p 2 1 2959 640 18814 4220 p 2 2 3030 568 19472 4274 p 2 3 3084 513 17670 4227 p 2 7 3087 506 20254 4400 i 2 3600 0 0 48628 12422 p 2 0 3251 349 17362 5079 p 2 3 3232 365 14213 4617 p 2 0 3245 355 15312 4728 p 2 0 3113 487 12149 4311 p 2 3 3223 374 14599 4670 p 2 0 3237 363 16004 4893 p 2 0 3345 255 18468 5028 p 2 1 3189 410 13225 4543 p 2 0 3288 312 15672 4754 p 2 0 3293 307 14839 4760 p 2 5 3268 327 14999 4742 p 2 0 3141 459 12294 4351 p 2 0 3223 377 13808 4555 p 2 0 3285 315 16611 4770 p 2 0 3321 279 15760 4782 p 2 2 3174 424 12542 4331 p 2 0 3221 379 14610 4578 p 2 0 3260 340 15371 4670 p 2 0 3248 352 15141 4716 p 2 3 3177 420 12937 4327 p 2 0 3236 364 13415 4550 p 2 0 3243 357 15032 4697 p 2 1 3287 312 15798 4703 p 2 0 3146 454 12497 4365 p 2 0 3215 385 13902 4605 p 2 5 3287 308 15357 4825 p 2 0 3325 275 15672 4832 p 2 0 3178 422 12459 4349 p 2 1 3252 347 15051 4701 p 2 0 3273 327 15397 4795 p 2 0 3293 307 15734 4843 p 2 3 3192 405 12644 4428 p 2 0 3237 363 13623 4495 p 2 0 3293 307 15923 4839 p 2 3 3259 338 15209 4686 p 2 0 3109 491 11620 4215 p 2 0 3207 393 13981 4524 p 2 0 3262 338 14982 4702 p 2 0 3228 372 14207 4544 p 2 2 3092 506 11534 4219 p 2 213 3120 267 49038 7132 p 2 1 3272 327 16872 5051 p 2 1 3302 297 15940 4784 p 2 252 3019 329 50620 7441 p 2 0 3105 495 10446 4212 p 2 0 3250 350 15185 4692 p 2 179 3166 255 50015 7007 p 2 0 3170 430 14652 4673 p 2 0 3188 412 15355 4819 p 2 33 3316 251 38332 6018 p 2 0 3295 305 17880 5095 p 2 0 3189 411 12855 4409 p 2 19 3326 255 36016 6043 p 2 0 3251 349 18112 4948 p 2 0 3261 339 16646 4806 p 2 0 3200 400 13692 4478 p 2 0 3255 345 15214 4726 p 2 0 3361 239 17170 4880 p 2 0 3328 272 16335 4844 p 2 0 3180 420 12751 4374 p 2 0 3252 348 14547 4640 p 2 8 3270 322 14903 4627 p 2 0 3323 277 15337 4683 p 2 0 3121 479 11637 4205 p 2 3 3241 356 14138 4612 p 2 0 3174 426 14589 4587 p 2 0 3248 352 14743 4628 p 2 3 3141 456 11711 4249 p 2 0 3216 384 13329 4353 p 2 0 3230 370 15513 4683 p 2 0 3289 311 15760 4670 p 2 1 3115 484 12421 4314 p 2 1 3220 379 14567 4651 p 2 3 3308 289 16008 4892 p 2 0 3264 336 15008 4712 p 2 1 3127 472 11708 4291 p 2 3 3214 383 14846 4615 p 2 0 3287 313 16539 4852 p 2 1 3309 290 16851 4956 p 2 0 3239 361 14197 4511 p 2 0 3309 291 16046 4733 p 2 0 3288 312 15406 4738 p 2 0 3328 272 16565 4745 p 2 0 3119 481 12246 4224 p 2 0 3238 362 13841 4562 p 2 0 3257 343 16179 4791 p 2 0 3328 272 15382 4709 p 2 0 3115 485 11710 4237 p 2 2 3220 378 13925 4547 p 2 0 3221 379 14129 4598 p 2 0 3274 326 14735 4659 p 2 8 3163 429 12395 4334 p 2 0 3244 356 14675 4557 p 2 0 3266 334 14979 4632 p 2 0 3210 390 14476 4509 p 2 1 3161 438 12030 4313 p 2 1 3251 348 14515 4647 p 2 1 3321 278 15954 4833 p 2 0 3274 326 15709 4770 p 2 0 3189 411 12911 4351 p 2 1 3267 332 15199 4768 p 2 0 3244 356 15588 4768 p 2 0 3268 332 15658 4781 p 2 3 3190 407 12817 4429 p 2 0 3250 350 14800 4650 p 2 0 3311 289 16518 4860 p 2 0 3269 331 16534 4767 p 2 0 3178 422 12066 4296 p 2 0 3262 338 13851 4602 p 2 2 3273 325 14826 4668 p 2 0 3263 337 14353 4681 p 2 0 3163 437 11711 4266 p 2 8 3189 403 13729 4515 p 2 0 3255 345 15480 4742 p 2 0 3237 363 15601 4719 p 2 0 3146 454 12339 4301 p 2 0 3233 367 14681 4558 p 2 0 3248 352 13585 4467 p 2 0 3275 325 15805 4655 i 2 3600 0 0 45414 12122 p 2 0 3292 308 14758 4202 p 2 0 2634 966 8964 3300 p 2 0 2620 980 11512 3359 p 2 0 2251 1349 7756 2923 p 2 0 2448 1152 9781 3183 p 2 0 2379 1221 10127 3207 p 2 0 2501 1099 11051 3302 p 2 0 2184 1416 7855 2922 p 2 0 2388 1212 10151 3177 p 2 0 2426 1174 10712 3295 p 2 0 2435 1165 10867 3318 p 2 0 2235 1365 8013 3021 p 2 1 2307 1292 9522 3094 p 2 2 2422 1176 10144 3334 p 2 2 2363 1235 9627 3183 p 2 0 2204 1396 7815 2940 p 2 0 2283 1317 9590 3105 p 2 0 2342 1258 9903 3199 p 2 0 2439 1161 10581 3266 p 2 0 2147 1453 7256 2846 p 2 0 2384 1216 10641 3107 p 2 0 2557 1043 11435 3335 p 2 4 2490 1106 22264 4175 p 2 0 2322 1278 9259 3221 p 2 0 2428 1172 11160 3282 p 2 4 2641 955 21225 4189 p 2 0 2576 1024 11117 3484 p 2 0 2191 1409 8448 2984 p 2 8 2498 1094 24753 4452 p 2 0 2587 1013 13698 3619 p 2 0 2488 1112 11465 3428 p 2 9 2468 1123 26445 4517 p 2 0 2329 1271 7955 3034 p 2 0 2352 1248 10484 3301 p 2 2 2560 1038 23137 4214 p 2 0 2304 1296 8445 3191 p 2 0 2391 1209 9866 3250 p 2 0 2510 1090 22168 4184 p 2 0 2469 1131 11615 3423 p 2 0 2314 1286 8576 3092 p 2 0 2493 1107 10424 3326 p 2 0 2427 1173 9792 3243 p 2 0 2356 1244 10822 3240 p 2 0 2243 1357 7584 3013 p 2 0 2408 1192 10613 3219 p 2 0 2435 1165 11110 3279 p 2 0 2418 1182 10423 3286 p 2 0 2272 1328 7657 3031 p 2 0 2377 1223 9424 3177 p 2 0 2410 1190 11204 3324 p 2 0 2462 1138 10510 3271 p 2 0 2262 1338 7538 2989 p 2 6 2370 1224 10762 3266 p 2 0 2308 1292 10197 3139 p 2 0 2469 1131 10514 3317 p 2 10 2171 1419 8833 3003 p 2 0 2233 1367 9038 2915 p 2 0 2326 1274 9970 3161 p 2 0 2443 1157 11080 3325 p 2 0 2252 1348 8352 3003 p 2 0 2304 1296 8309 3092 p 2 0 2447 1153 10544 3281 p 2 0 2492 1108 10161 3264 p 2 0 2276 1324 8603 2949 p 2 0 2330 1270 9809 3114 p 2 0 2295 1305 9354 3138 p 2 0 2408 1192 10762 3247 p 2 3 2431 1166 19457 3882 p 2 0 2139 1461 7578 2769 p 2 0 2380 1220 11121 3242 p 2 0 2534 1066 19552 3847 p 2 0 2275 1325 8641 3098 p 2 0 2351 1249 9615 3156 p 2 1 2580 1019 20159 3896 p 2 0 2512 1088 11473 3380 p 2 0 2217 1383 7611 2967 p 2 0 2543 1057 19321 3981 p 2 0 2473 1127 12227 3439 p 2 0 2462 1138 10644 3357 p 2 1 2501 1098 19618 3889 p 2 0 2289 1311 9049 2976 p 2 0 2543 1057 12692 3404 p 2 6 2529 1065 19857 3950 p 2 0 2299 1301 9288 3147 p 2 0 2199 1401 8138 3023 p 2 0 2440 1160 11032 3331 p 2 0 2385 1215 9908 3211 p 2 88 2456 1056 32967 5139 p 2 0 2397 1203 9979 3308 p 2 17 2518 1065 25914 4525 p 2 0 2507 1093 12206 3510 p 2 16 2438 1146 27500 4532 p 2 0 2235 1365 7674 2924 p 2 0 2479 1121 11540 3456 p 2 0 2495 1105 12668 3437 p 2 0 2277 1323 8094 3104 p 2 0 2455 1145 10937 3265 p 2 0 2416 1184 10973 3280 p 2 0 2423 1177 10144 3233 p 2 0 2213 1387 7888 2905 p 2 0 2443 1157 10660 3242 p 2 0 2315 1285 9403 3170 p 2 0 2319 1281 9262 3161 p 2 0 2151 1449 6853 2893 p 2 0 2506 1094 11065 3278 p 2 0 2561 1039 10852 3354 p 2 1 2450 1149 11428 3340 p 2 0 2183 1417 8594 2935 p 2 0 2297 1303 9456 3092 p 2 0 2397 1203 9615 3261 p 2 0 2413 1187 10762 3213 p 2 0 2223 1377 7906 2899 p 2 0 2349 1251 8658 3073 p 2 0 2386 1214 11241 3203 p 2 0 2358 1242 10255 3178 p 2 0 2171 1429 7795 2907 p 2 0 2187 1413 7354 2835 p 2 0 2287 1313 10200 3104 p 2 0 2341 1259 9767 3150 p 2 0 2281 1319 8126 3014 p 2 0 2347 1253 9438 3078 p 2 0 2535 1065 10813 3376 p 2 0 2514 1086 10485 3286 p 2 0 2233 1367 7880 2952 p 2 0 2381 1219 10130 3171 p 2 0 2290 1310 9255 3132 p 2 0 2382 1218 11624 3212 p 2 0 2151 1449 7044 2849 p 2 0 2319 1281 9448 3093 p 2 0 2296 1304 9255 3081 p 2 0 2453 1147 10930 3324 p 2 0 2178 1422 7604 2919 p 2 0 2317 1283 9844 3061 p 2 0 2379 1221 9439 3197 p 2 0 2377 1223 9109 3140 p 2 0 2195 1405 7457 2859 p 2 0 2200 1400 9034 3001 p 2 0 2305 1295 9106 3122 p 2 1 2358 1241 11268 3212 p 2 0 2147 1453 6839 2851 p 2 0 2290 1310 9462 3043 p 2 0 2527 1073 9755 3325 p 2 1 2402 1197 10911 3252 p 2 0 2276 1324 7975 3016 p 2 0 2042 1558 6093 2677 p 2 11 2452 1137 14507 3791 p 2 0 2246 1354 7663 2979 p 2 0 2598 1002 9574 3185 p 2 0 2198 1402 6648 2791 i 2 3600 0 0 36111 11803 p 2 0 2121 1479 4842 2596 p 2 0 2394 1206 7248 3104 p 2 23 2319 1258 23074 4530 p 2 0 2562 1038 9705 3463 p 2 0 2259 1341 8245 3111 p 2 20 2335 1245 23668 4545 p 2 0 2293 1307 8972 3249 p 2 0 2333 1267 8784 3283 p 2 37 2364 1199 23273 4610 p 2 0 2319 1281 8897 3214 p 2 0 2294 1306 8977 3241 p 2 2 2452 1146 18910 4275 p 2 0 2391 1209 9054 3337 p 2 0 2184 1416 7861 3064 p 2 3 2447 1150 18857 4299 p 2 0 2321 1279 9740 3348 p 2 0 2247 1353 7385 3103 p 2 0 2250 1350 7956 3117 p 2 0 2303 1297 8276 3174 p 2 0 2361 1239 9141 3240 p 2 0 2290 1310 7147 3024 p 2 0 2209 1391 7223 2977 p 2 2 2311 1287 8367 3136 p 2 0 2306 1294 9025 3216 p 2 0 2179 1421 6819 2911 p 2 0 2152 1448 6978 2891 p 2 0 2198 1402 7312 3038 p 2 0 2238 1362 7608 3105 p 2 0 2209 1391 7185 2993 p 2 0 2188 1412 7336 3023 p 2 0 2282 1318 8471 3161 p 2 0 2266 1334 7752 3122 p 2 0 2186 1414 6613 2896 p 2 0 2225 1375 7437 3008 i 2 3600 0 0 100583 12860 p 2 0 3560 40 20619 4730 p 2 0 3472 128 16278 4680 p 2 0 3242 358 12868 4168 p 2 0 3166 434 11973 4054 p 2 0 3450 150 15311 4700 p 2 0 2801 799 9887 3558 p 2 0 3377 223 16110 4547 p 2 0 3274 326 13034 4270 p 2 0 3367 233 14338 4410 p 2 0 3145 455 12237 4069 p 2 0 2338 1262 8123 2927 p 2 0 3054 546 10851 3829 p 2 0 3093 507 11434 3944 p 2 0 3004 596 10827 3795 p 2 0 3116 484 11321 3949 p 2 0 2850 750 9868 3603 p 2 0 3221 379 13791 4183 p 2 0 2803 797 9784 3520 p 2 0 3169 431 12946 4006 p 2 0 2736 864 9394 3361 p 2 0 2625 975 8724 3239 p 2 0 2920 680 10190 3646 p 2 0 2889 711 10279 3596 p 2 0 2694 906 9239 3338 p 2 0 2697 903 9366 3316 p 2 0 2702 898 9239 3326 p 2 0 2535 1065 8484 3136 p 2 0 2220 1380 6938 2795 p 2 0 2776 824 9500 3468 p 2 0 2777 823 9504 3511 p 2 0 3013 587 11242 3793 p 2 0 2854 746 10319 3565 p 2 0 2790 810 10011 3497 p 2 0 2659 941 8929 3285 p 2 0 2740 860 9302 3378 p 2 0 2575 1025 8548 3168 p 2 0 2427 1173 7894 3022 p 2 0 2828 772 9656 3505 p 2 0 2632 968 8809 3267 p 2 0 2909 691 10261 3686 p 2 0 2613 987 8714 3233 p 2 0 3115 485 12112 3957 p 2 0 2747 853 9309 3472 p 2 0 2948 652 10744 3691 i 2 3600 0 0 71172 12865 p 2 0 3492 108 16823 4685 p 2 4 3594 2 32934 5569 p 2 1 3594 5 35069 5897 p 2 4 3593 3 30225 5624 p 2 3 3597 0 30422 5495 p 2 0 3599 1 30240 5544 p 2 1 3596 3 32947 5534 p 2 0 3600 0 28941 5387 p 2 2 3598 0 29649 5327 p 2 0 3595 5 32640 5577 p 2 0 3599 1 31664 5562 p 2 1 3596 3 30546 5115 p 2 0 3599 1 29473 5295 p 2 1 3598 1 32564 5416 p 2 1 3598 1 35416 5599 p 2 2 3598 0 32286 5391 p 2 2 3597 1 32140 5279 p 2 5 3594 1 30529 5399 p 2 2 3595 3 33821 5461 p 2 3 3592 5 30370 5390 p 2 1 3599 0 32593 5456 p 2 1 3594 5 31963 5550 p 2 2 3597 1 32285 5548 p 2 1 3598 1 32728 5262 p 2 0 3599 1 30423 5339 p 2 0 3599 1 31997 5418 p 2 2 3596 2 33246 5702 p 2 0 3599 1 31208 5515 p 2 10 3590 0 31782 5363 p 2 9 3589 2 30309 5402 p 2 0 3598 2 33359 5564 p 2 4 3595 1 30086 5431 p 2 3 3597 0 32826 5641 p 2 1 3597 2 34051 5686 p 2 0 3599 1 33247 5639 p 2 0 3597 3 31835 5254 p 2 0 3598 2 29615 5337 p 2 1 3599 0 31567 5146 p 2 1 3598 1 34393 5589 p 2 0 3597 3 31448 5421 p 2 2 3598 0 31938 5295 p 2 4 3595 1 29802 5122 p 2 4 3595 1 31480 5179 p 2 0 3598 2 30191 5297 p 2 2 3598 0 32537 5444 p 2 2 3596 2 32982 5569 p 2 5 3593 2 31686 5374 p 2 1 3599 0 31272 5321 p 2 0 3600 0 30689 5300 p 2 1 3597 2 32197 5363 p 2 1 3598 1 35599 5652 p 2 0 3596 4 31705 5467 p 2 2 3597 1 31908 5315 p 2 0 3596 4 29415 5291 p 2 0 3600 0 31947 5421 p 2 0 3600 0 28982 5089 p 2 0 3600 0 31880 5309 p 2 0 3597 3 32061 5308 p 2 0 3598 2 33238 5681 p 2 0 3598 2 32285 5350 p 2 0 3600 0 29870 5392 p 2 0 3598 2 30249 5309 p 2 5 3595 0 32098 5535 p 2 0 3599 1 28143 5044 p 2 0 3599 1 30191 5208 p 2 2 3595 3 29093 5221 p 2 0 3600 0 32583 5402 p 2 0 3600 0 30113 5304 p 2 0 3600 0 31415 5412 p 2 0 3599 1 32203 5534 p 2 0 3600 0 31621 5501 p 2 0 3598 2 30491 5292 p 2 0 3600 0 28798 5258 p 2 2 3595 3 29986 5296 p 2 0 3600 0 29484 5278 p 2 0 3595 5 30188 5448 i 2 3600 0 0 77451 13316 p 2 0 3541 59 23297 5248 p 2 0 3296 304 15756 4555 p 2 0 2898 702 10669 3722 p 2 0 2426 1174 7662 3083 p 2 0 2421 1179 7663 3072 p 2 0 1989 1611 5896 2551 p 2 0 1512 2088 4314 1997 p 2 0 1705 1895 4820 2202 p 2 0 1448 2152 4106 1944 p 2 0 1095 2505 3111 1565 p 2 0 1014 2586 2756 1485 p 2 0 776 2824 2099 1228 p 2 0 755 2845 2074 1203 p 2 0 1592 2008 4369 2081 p 2 0 1981 1619 5637 2511 p 2 0 2636 964 8557 3368 p 2 0 1597 2003 4689 2122 p 2 0 1850 1750 5155 2406 p 2 0 1643 1957 4306 2121 p 2 0 1285 2315 3601 1740 p 2 0 947 2653 2946 1438 p 2 0 749 2851 2286 1222 p 2 0 599 3001 1976 1069 p 2 0 529 3071 1726 992 p 2 0 475 3125 1488 928 p 2 0 902 2698 2591 1364 p 2 0 258 3342 1223 740 p 2 0 1659 1941 4468 2199 p 2 0 1038 2562 2561 1490 p 2 0 1321 2279 3341 1808 p 2 0 1126 2474 2857 1574 p 2 0 790 2810 2111 1228 p 2 0 586 3014 1914 1061 p 2 0 514 3086 1485 964 p 2 0 420 3180 1354 876 p 2 0 348 3252 1186 795 p 2 0 331 3269 1235 788 p 2 0 610 2990 1823 1075 p 2 0 161 3439 893 629 p 2 0 1460 2140 3611 1958 p 2 0 1488 2112 3577 1966 p 2 0 1044 2556 2409 1478 p 2 0 686 2914 2126 1141 p 2 0 496 3104 1649 948 p 2 0 2801 799 10423 3797 i 2 3600 0 0 75174 11768 p 2 7 3487 106 25387 5002 p 2 0 2911 689 10662 3596 p 2 3 3165 432 18246 4067 p 2 1 3127 472 19444 4166 p 2 0 3004 596 10862 3680 p 2 0 2947 653 13746 3655 p 2 0 2980 620 12045 3620 p 2 0 2922 678 10609 3522 p 2 0 2803 797 9869 3358 p 2 0 2276 1324 6693 2713 p 2 61 2759 780 23044 4164 p 2 0 2579 1021 9635 3157 p 2 75 2850 675 24174 4381 p 2 0 2707 893 9287 3303 p 2 0 2666 934 9162 3196 p 2 81 2767 752 23297 4276 p 2 0 2492 1108 9179 3052 p 2 0 2771 829 10747 3429 p 2 38 2838 724 21968 4168 p 2 0 2591 1009 9566 3151 p 2 0 2845 755 9613 3386 p 2 0 1999 1601 6107 2441 p 2 22 2518 1060 21026 3691 p 2 0 2333 1267 7941 2864 p 2 0 2522 1078 7379 3021 p 2 0 2487 1113 7292 2995 p 2 0 2571 1029 7631 3026 p 2 0 2683 917 8455 3201 p 2 0 2336 1264 7134 2797 p 2 0 2710 890 9865 3297 p 2 0 2630 970 9541 3163 p 2 0 2581 1019 7428 3055 p 2 0 2787 813 8611 3289 p 2 0 2401 1199 7003 2862 p 2 0 1931 1669 6139 2320 p 2 0 2350 1250 6657 2811 p 2 0 2479 1121 7390 2929 p 2 0 2366 1234 6799 2796 p 2 0 3349 251 19959 4502 i 2 3600 0 0 55130 12434 p 2 79 3511 10 38298 6187 p 2 30 3562 8 32460 5836 p 2 4 3592 4 38997 6133 p 2 0 3576 24 36773 5861 p 2 0 3594 6 33978 5784 p 2 5 3579 16 36428 6028 p 2 0 3575 25 32172 5957 p 2 0 3578 22 32658 5908 p 2 58 3539 3 38196 6392 p 2 25 3565 10 34170 6245 p 2 54 3541 5 36128 6408 p 2 51 3536 13 43719 6873 p 2 51 3526 23 40598 6844 p 2 82 3488 30 43768 7120 p 2 42 3545 13 47703 7256 p 2 43 3537 20 48206 7194 p 2 21 3571 8 44841 6958 p 2 17 3568 15 51403 6994 p 2 53 3541 6 51709 7096 p 2 18 3547 35 53087 6940 p 2 44 3549 7 77848 7073 p 2 12 3578 10 55265 6399 p 2 25 3561 14 53376 6502 p 2 0 3592 8 56336 6428 p 2 12 3576 12 32029 5607 p 2 0 3539 61 30867 5360 p 2 2 3563 35 30169 5340 p 2 1 3520 79 30539 5387 p 2 2 3524 74 27443 5221 p 2 9 3458 133 30331 5248 p 2 203 3290 107 46252 5984 p 2 3 3559 38 33695 5502 p 2 2 3542 56 26680 5253 p 2 1 3504 95 27578 5207 p 2 1 3436 163 24234 4979 p 2 1 3429 170 26847 5093 p 2 0 3564 36 25917 5228 p 2 0 3532 68 27450 5237 p 2 0 3503 97 26342 5092 p 2 0 3503 97 26337 5188 p 2 221 3335 44 59070 6137 p 2 0 3522 78 27672 5383 p 2 0 3510 90 25228 5113 p 2 0 3505 95 27295 5208 p 2 0 3518 82 24528 5134 p 2 0 3506 94 25880 5169 p 2 0 3422 178 23759 4975 p 2 0 3410 190 24597 4935 p 2 0 3545 55 24750 5077 p 2 1 3496 103 25875 5036 p 2 161 3414 25 46360 5973 p 2 0 3553 47 30012 5463 p 2 0 3540 60 25052 5160 p 2 0 3521 79 27219 5269 p 2 0 3473 127 24938 5061 p 2 0 3500 100 26389 5204 p 2 1 3478 121 24815 5091 p 2 2 3526 72 25880 5128 p 2 0 3498 102 24130 5096 p 2 0 3447 153 25152 5053 p 2 230 3341 29 69152 6179 p 2 0 3537 63 27682 5192 p 2 2 3546 52 24939 5100 p 2 1 3521 78 25049 5127 p 2 0 3481 119 22616 4869 p 2 0 3493 107 24279 4979 p 2 0 3398 202 21751 4836 p 2 0 3466 134 23167 5009 p 2 0 3377 223 21969 4823 p 2 0 3491 109 24261 4958 p 2 136 3372 92 50299 5696 p 2 0 3472 128 24660 5065 p 2 0 3551 49 24543 5077 p 2 0 3485 115 23986 4947 p 2 0 3547 53 24852 5140 p 2 0 3500 100 23661 5064 p 2 0 3361 239 22059 4734 p 2 0 3471 129 25268 4958 p 2 0 3355 245 21410 4725 p 2 0 3409 191 22514 4883 p 2 235 3323 42 64545 6244 p 2 0 3499 101 24353 5065 p 2 0 3459 141 21827 4979 p 2 0 3484 116 23469 5088 p 2 0 3557 43 24854 5275 p 2 0 3459 141 23876 5120 p 2 0 3561 39 24920 5246 p 2 0 3504 96 23778 5105 p 2 0 3424 176 22755 4947 p 2 0 3400 200 22651 4991 p 2 189 3319 92 40043 5925 p 2 0 3527 73 25392 5230 p 2 0 3463 137 24568 5096 p 2 0 3445 155 22622 5010 p 2 1 3406 193 21908 4968 p 2 0 3413 187 22677 4960 p 2 0 3551 49 24284 5300 p 2 0 3498 102 23718 5190 p 2 0 3512 88 24898 5233 p 2 0 3434 166 24080 5115 p 2 219 3326 55 63195 6182 p 2 0 3548 52 27973 5399 p 2 0 3463 137 23795 5150 p 2 0 3482 118 25028 5187 p 2 2 3460 138 24842 5164 p 2 0 3447 153 23536 5128 p 2 0 3416 184 22202 5020 p 2 0 3467 133 24372 5248 p 2 0 3509 91 24955 5207 p 2 0 3523 77 24517 5146 p 2 177 3404 19 43348 6087 p 2 0 3546 54 26206 5313 p 2 0 3497 103 24355 5121 i 2 3600 0 0 120587 14040 p 2 0 3467 133 31823 5632 p 2 0 3505 95 26485 5201 p 2 0 3494 106 22824 5066 p 2 0 3486 114 22693 5098 p 2 0 3392 208 22096 4814 p 2 0 3417 183 23401 4955 p 2 228 3345 27 68502 6226 p 2 0 3489 111 23790 5132 p 2 0 3489 111 23705 5112 p 2 0 3501 99 23953 5040 p 2 0 3426 174 23359 4991 p 2 0 3518 82 26103 5196 p 2 0 3418 182 20771 4878 p 2 0 3474 126 24752 5161 p 2 0 3505 95 25355 5197 p 2 0 3452 148 22566 5063 p 2 173 3363 64 47580 5992 p 2 0 3509 91 25584 5077 p 2 0 3531 69 25151 5130 p 2 1 3523 76 23697 5083 p 2 0 3574 26 28321 5330 p 2 0 3529 71 26788 5199 p 2 0 3475 125 24990 5095 p 2 0 3471 129 24515 5106 p 2 0 3438 162 20911 4917 p 2 0 3436 164 24194 5100 p 2 236 3292 72 69619 6201 p 2 0 3419 181 24143 4951 p 2 0 3372 228 21763 4766 p 2 0 3286 314 20728 4659 p 2 0 3586 14 24568 5249 p 2 0 3398 202 21760 4921 p 2 0 3541 59 26358 5236 p 2 0 3551 49 27519 5278 p 2 0 3489 111 24034 5160 p 2 0 3508 92 23936 5200 p 2 180 3341 79 40370 5890 p 2 0 3537 63 27916 5349 p 2 0 3520 80 24542 5172 p 2 0 3455 145 24220 5059 p 2 0 3474 126 22663 5010 p 2 0 3475 125 22858 5092 p 2 0 3555 45 25316 5362 p 2 0 3485 115 22659 5126 p 2 0 3554 46 26281 5232 p 2 0 3543 57 28704 5288 p 2 236 3350 14 59670 6372 p 2 0 3543 57 25698 5258 p 2 0 3465 135 22202 4947 p 2 0 3519 81 26247 5235 p 2 0 3451 149 24735 5075 p 2 0 3519 81 23955 5175 p 2 0 3467 133 22824 5029 p 2 0 3448 152 21895 4994 p 2 0 3466 134 21196 4985 p 2 0 3353 247 21112 4833 p 2 185 3382 33 44625 6036 p 2 0 3572 28 29280 5405 p 2 0 3525 75 24519 5233 p 2 0 3507 93 24234 5193 p 2 0 3442 158 21669 4956 p 2 0 3464 136 25386 5121 p 2 0 3497 103 25605 5172 p 2 0 3473 127 23149 5086 p 2 0 3471 129 21905 4992 p 2 0 3459 141 23042 5018 p 2 236 3346 18 66266 6325 p 2 0 3556 44 27067 5307 p 2 0 3561 39 26147 5249 p 2 0 3539 61 24534 5200 p 2 0 3485 115 23492 5112 p 2 0 3565 35 27052 5357 p 2 0 3506 94 21866 5009 p 2 0 3519 81 26987 5203 p 2 0 3486 114 23458 5085 p 2 0 3439 161 22762 5041 p 2 191 3340 69 39577 5902 p 2 0 3482 118 23978 5127 p 2 0 3568 32 26596 5359 p 2 0 3477 123 24476 5143 p 2 0 3543 57 25813 5195 p 2 0 3503 97 23776 5122 p 2 0 3466 134 22327 5038 p 2 0 3540 60 25164 5258 p 2 0 3514 86 23731 5085 p 2 0 3436 164 24499 5052 p 2 264 3261 75 65607 6242 p 2 0 3456 144 27539 4960 p 2 0 3451 149 21489 4897 p 2 0 3500 100 24295 5066 p 2 0 3534 66 23515 5106 p 2 0 3533 67 25623 5236 p 2 0 3554 46 25432 5201 p 2 0 3500 100 24365 5107 p 2 0 3515 85 23131 5125 p 2 0 3483 117 23984 5143 p 2 146 3363 91 54170 5879 p 2 0 3548 52 29864 5375 p 2 0 3480 120 24561 5176 p 2 0 3543 57 24055 5213 p 2 0 3473 127 22607 4953 p 2 0 3465 135 24300 5013 p 2 0 3550 50 26441 5272 p 2 0 3503 97 24095 5138 p 2 0 3569 31 26037 5242 p 2 0 3473 127 22461 5071 p 2 232 3311 57 64791 6283 p 2 0 3541 59 24843 5190 p 2 0 3437 163 21953 4914 p 2 0 3556 44 27861 5323 p 2 0 3544 56 24332 5204 p 2 0 3491 109 22453 5098 p 2 0 3457 143 22429 4983 p 2 0 3468 132 23570 5051 p 2 0 3514 86 25073 5240 p 2 0 3510 90 23113 5186 p 2 189 3382 29 42409 6070 p 2 0 3546 54 26354 5298 p 2 0 3475 125 23172 5104 p 2 0 3491 109 24893 5118 p 2 0 3452 148 20902 4912 p 2 0 3532 68 25513 5232 p 2 0 3534 66 24356 5211 p 2 0 3460 140 22065 5017 p 2 0 3462 138 22918 4998 p 2 0 3455 145 23651 5030 p 2 216 3374 10 63357 6277 p 2 0 3514 86 23713 5142 p 2 0 3540 60 23300 5165 p 2 0 3515 85 24569 5105 p 2 0 3481 119 22251 5008 p 2 0 3477 123 24080 5073 p 2 0 3481 119 21038 4988 p 2 0 3508 92 23735 5175 p 2 0 3514 86 24213 5125 p 2 0 3531 69 23120 5135 p 2 171 3370 59 44669 5880 p 2 0 3528 72 26149 5180 p 2 0 3562 38 23805 5230 p 2 0 3451 149 21190 4979 p 2 0 3564 36 25395 5231 p 2 0 3545 55 25666 5212 p 2 0 3499 101 25200 5095 p 2 0 3431 169 21397 4997 p 2 0 3422 178 20589 4915 p 2 0 3426 174 22226 4963 p 2 238 3299 63 58698 6187 p 2 0 3500 100 23727 5093 p 2 0 3506 94 25117 5293 i 2 3600 0 0 110350 13284 p 2 0 3528 72 21624 4960 p 2 0 3344 256 16870 4526 p 2 0 3466 134 18469 4681 p 2 0 3262 338 12933 4233 p 2 0 3251 349 13161 4178 p 2 0 2333 1267 7401 2935 p 2 185 2793 622 31414 4672 p 2 0 3139 461 12728 4056 p 2 0 3106 494 12848 3996 p 2 0 2879 721 10314 3659 p 2 0 2860 740 10616 3582 p 2 0 2945 655 10551 3697 p 2 0 3129 471 12604 3999 p 2 0 2955 645 11083 3726 p 2 0 3191 409 13631 4088 p 2 0 3087 513 12265 3974 p 2 223 2681 696 48246 4620 p 2 0 2716 884 10319 3422 p 2 0 2472 1128 8386 3092 p 2 0 2775 825 10619 3479 p 2 0 2732 868 9292 3394 p 2 0 2571 1029 8574 3244 p 2 0 2556 1044 8089 3155 p 2 0 2804 796 10056 3515 p 2 0 3194 406 13190 4165 p 2 0 2894 706 10273 3652 p 2 185 2884 531 32071 4740 p 2 0 2983 617 13291 3814 p 2 1 2872 727 11243 3610 p 2 0 2867 733 11385 3615 p 2 1 2541 1058 9429 3163 p 2 0 2676 924 9669 3325 p 2 0 2593 1007 8972 3242 p 2 0 2523 1077 8778 3149 p 2 0 2522 1078 8492 3117 p 2 0 2720 880 9885 3438 p 2 222 2790 588 47070 4788 p 2 0 2918 682 11892 3750 p 2 0 3021 579 11885 3821 p 2 0 2899 701 11409 3620 p 2 0 2705 895 10254 3357 p 2 0 2834 766 10741 3530 p 2 0 2497 1103 8482 3082 p 2 0 2300 1300 7555 2823 p 2 0 2756 844 9573 3433 p 2 0 2521 1079 8399 3128 p 2 196 2588 816 27851 4322 p 2 0 1899 1701 6311 2435 p 2 0 2856 744 11274 3603 p 2 0 2838 762 10930 3583 p 2 0 3080 520 13905 3933 p 2 0 3079 521 13249 3913 p 2 0 3045 555 12457 3885 p 2 0 2919 681 11094 3667 p 2 0 2630 970 9170 3273 p 2 0 2820 780 10363 3524 p 2 216 2722 662 43234 4613 p 2 0 2815 785 10987 3600 p 2 0 3179 421 14856 4269 i 2 3600 0 0 86599 12705 p 2 0 3462 138 20339 5031 p 2 0 3406 194 18500 4731 p 2 0 3564 36 22978 5028 p 2 0 3438 162 19307 4796 p 2 0 3336 264 17812 4598 p 2 0 3318 282 17584 4568 p 2 195 3198 207 35651 5468 p 2 0 3443 157 21567 4882 p 2 0 3302 298 18484 4561 p 2 0 3329 271 18757 4649 p 2 0 3418 182 19663 4734 p 2 0 3448 152 20867 4897 p 2 0 3508 92 22280 5038 p 2 0 3454 146 20542 4820 p 2 0 3434 166 20718 4763 p 2 0 3457 143 20782 4799 p 2 230 3233 137 59459 5833 p 2 0 3423 177 22025 4817 p 2 0 3446 154 20305 4761 p 2 0 3493 107 21824 4928 p 2 0 3383 217 19424 4757 p 2 0 3317 283 18473 4694 p 2 0 3327 273 18647 4606 p 2 0 3386 214 19861 4839 p 2 0 3469 131 20422 4989 p 2 0 3334 266 18833 4748 p 2 196 3330 74 41957 5869 p 2 0 3526 74 25801 5115 p 2 0 3508 92 22025 5030 p 2 0 3520 80 22019 5008 p 2 0 3371 229 18999 4668 p 2 0 3456 144 20709 4929 p 2 0 3489 111 22012 4954 p 2 0 3381 219 19744 4845 p 2 0 3406 194 20183 4812 p 2 0 3414 186 19987 4886 p 2 273 3274 53 59568 6211 p 2 0 3484 116 22240 5010 p 2 0 3494 106 20616 4929 p 2 0 3483 117 22320 4998 p 2 0 3480 120 21038 4962 p 2 0 3512 88 21333 4941 p 2 0 3357 243 18834 4603 p 2 0 3407 193 19762 4772 p 2 0 3346 254 19160 4640 p 2 0 3394 206 19951 4736 p 2 192 3235 173 38424 5553 p 2 0 3475 125 22041 4914 p 2 0 3514 86 21362 5040 p 2 0 3427 173 20417 4905 p 2 0 3478 122 21994 4954 p 2 0 3406 194 20381 4873 p 2 0 3383 217 19921 4845 p 2 0 3492 108 21460 5031 p 2 0 3368 232 19395 4742 p 2 0 3415 185 21712 4937 p 2 272 3231 97 54689 6086 p 2 0 3435 165 21258 4947 p 2 0 3408 192 20126 4818 p 2 0 3390 210 19919 4843 p 2 0 3532 68 22207 5054 p 2 0 3466 134 21360 4955 p 2 0 3461 139 20955 4825 p 2 0 3415 185 20191 4772 p 2 0 3274 326 18548 4561 p 2 0 3348 252 19481 4760 p 2 200 3313 87 38046 5824 p 2 0 3497 103 22653 5061 p 2 0 3415 185 21260 4933 p 2 0 3456 144 21107 4980 p 2 1 3383 216 19838 4815 p 2 0 3428 172 21129 4944 p 2 0 3482 118 21540 4966 p 2 0 3450 150 21389 4923 p 2 0 3509 91 22380 4983 p 2 0 3458 142 22614 4979 p 2 241 3242 117 52861 5905 p 2 0 3462 138 22476 5055 p 2 0 3440 160 20802 4861 p 2 0 3511 89 23102 5088 p 2 0 3417 183 21381 4920 p 2 0 3390 210 20590 4790 p 2 0 3369 231 20195 4733 p 2 0 3430 170 21564 4962 p 2 0 3438 162 21915 5026 p 2 0 3382 218 21245 4881 p 2 188 3320 92 43460 5897 p 2 0 3527 73 25169 5139 p 2 0 3418 182 21891 4904 p 2 0 3460 140 22000 4949 p 2 0 3351 249 19765 4702 p 2 0 3508 92 23520 5065 p 2 0 3437 163 21477 4930 p 2 0 3402 198 21213 4837 p 2 0 3335 265 20023 4669 p 2 0 3247 353 20711 4722 p 2 221 3331 48 62486 6180 p 2 0 3489 111 23912 5123 p 2 0 3516 84 22165 4962 p 2 0 3518 82 22156 4939 p 2 0 3394 206 19983 4806 p 2 0 3500 100 21794 4950 p 2 0 3390 210 18734 4622 p 2 0 3478 122 21790 4909 p 2 0 3509 91 22191 4924 p 2 0 3441 159 18937 4729 p 2 176 3315 109 43430 5691 p 2 0 3431 169 21133 4810 p 2 0 3472 128 21118 4990 p 2 1 3486 113 21298 5004 p 2 0 3513 87 22080 4957 p 2 1 3506 93 22688 5044 p 2 0 3412 188 20283 4843 p 2 0 3452 148 20474 4856 p 2 0 3385 215 20229 4708 p 2 0 3399 201 21074 4921 p 2 251 3253 96 52791 6146 p 2 0 3503 97 22921 5181 p 2 0 3459 141 20262 4944 p 2 0 3457 143 21042 4995 p 2 0 3536 64 21514 5029 p 2 0 3434 166 19971 4816 p 2 0 3441 159 19934 4796 p 2 0 3434 166 19601 4871 p 2 0 3330 270 19320 4704 p 2 0 3388 212 19759 4876 p 2 175 3220 205 41678 5606 p 2 0 3442 158 21811 4951 p 2 0 3333 267 19996 4782 p 2 0 3332 268 19323 4744 p 2 0 3481 119 20932 4892 p 2 0 3413 187 19585 4877 p 2 0 3454 146 20883 4995 p 2 0 3387 213 19486 4780 p 2 0 3501 99 20854 4883 p 2 0 3474 126 20668 4974 p 2 221 3267 112 49916 5905 p 2 0 3519 81 21553 4993 p 2 0 3433 167 19079 4741 p 2 0 3478 122 20824 4919 i 2 3600 0 0 126961 14599 p 2 3 3415 182 21796 5096 p 2 0 3449 151 17223 4712 p 2 0 3318 282 14344 4483 p 2 0 2622 978 9014 3349 p 2 0 2810 790 10160 3483 p 2 188 3097 315 34930 5207 p 2 0 2826 774 10646 3583 p 2 0 3012 588 11588 3855 p 2 0 3145 455 12905 4028 p 2 0 2827 773 10171 3549 p 2 0 3007 593 11830 3834 p 2 0 3093 507 12189 3937 p 2 0 2968 632 10960 3776 p 2 0 3116 484 12750 4012 p 2 248 2992 360 50740 5355 p 2 0 2929 671 12534 3728 p 2 0 3266 334 14741 4266 p 2 0 3098 502 12828 3992 p 2 0 2932 668 10598 3655 p 2 0 2983 617 10845 3771 p 2 0 2968 632 11227 3786 p 2 0 2602 998 8879 3266 p 2 0 2907 693 10366 3625 p 2 0 2706 894 9144 3380 p 2 0 2846 754 9778 3560 p 2 178 2781 641 30896 4644 p 2 0 2855 745 10513 3610 p 2 0 3259 341 14753 4332 p 2 0 3010 590 12070 3850 p 2 0 3126 474 14259 3993 p 2 0 3005 595 12699 3800 p 2 0 2878 722 10963 3571 p 2 0 2872 728 10623 3581 p 2 0 2340 1260 7953 2918 p 2 0 2888 712 10499 3586 p 2 234 2663 703 45030 4788 p 2 1 2764 835 10971 3535 p 2 0 2621 979 9515 3286 p 2 0 2682 918 9468 3357 p 2 0 3115 485 12210 4028 p 2 0 3115 485 12197 4037 p 2 0 3144 456 13703 4029 p 2 0 2885 715 11247 3611 p 2 0 2820 780 10293 3518 p 2 0 2790 810 9925 3512 p 2 177 2417 1006 30911 4125 p 2 0 2911 689 12317 3709 p 2 0 2816 784 10481 3515 p 2 0 3453 147 24987 4762 p 2 0 3468 132 29658 4979 p 2 0 3479 121 35745 5281 p 2 0 3520 80 34139 5344 p 2 3 3451 146 36842 5496 p 2 14 3579 7 45667 6137 p 2 0 3492 108 39611 5765 p 2 91 3469 40 74795 6776 p 2 7 3559 34 42971 6081 p 2 4 3514 82 41748 6131 p 2 13 3539 48 43492 6262 p 2 11 3472 117 38580 5818 p 2 6 3501 93 37685 5953 p 2 16 3503 81 40941 6117 p 2 15 3507 78 42966 6178 p 2 8 3524 68 40772 6053 p 2 19 3431 150 39330 5971 p 2 105 3484 11 70488 7332 p 2 11 3530 59 49059 6759 p 2 16 3460 124 42002 6090 p 2 9 3525 66 46468 6231 p 2 1 3517 82 42458 6307 p 2 7 3531 62 43844 6330 p 2 15 3465 120 45187 6336 p 2 11 3481 108 40776 6018 p 2 3 3499 98 40655 5972 p 2 18 3514 68 49163 6506 p 2 127 3461 12 70540 7133 p 2 10 3489 101 40951 6041 p 2 12 3563 25 52396 6925 p 2 16 3534 50 44905 6436 p 2 5 3560 35 40501 6063 p 2 6 3526 68 38737 6037 p 2 12 3481 107 41008 6166 p 2 12 3494 94 42611 6291 p 2 0 3473 127 37993 5920 p 2 1 3478 121 33942 5689 p 2 73 3453 74 62568 6676 p 2 4 3528 68 42246 6207 p 2 5 3560 35 37774 5963 p 2 0 3464 136 32954 5546 p 2 0 3568 32 36332 5936 p 2 0 3520 80 35887 5793 p 2 0 3531 69 33124 5748 p 2 0 3479 121 31048 5465 p 2 0 3419 181 29829 5410 p 2 0 3553 47 33680 5510 p 2 251 3307 42 78610 7545 p 2 0 3171 429 15255 4331 p 2 18 3346 236 41282 6053 p 2 0 3425 175 18973 4960 p 2 0 3141 459 13735 4229 p 2 0 2978 622 12224 3850 p 2 41 3383 176 43777 6179 p 2 0 3202 398 15374 4360 p 2 3 3279 318 35180 5545 p 2 0 2737 863 10875 3604 p 2 128 2933 539 41666 4870 p 2 0 3175 425 14728 4172 p 2 2 3323 275 38775 5580 p 2 0 3086 514 15469 4200 p 2 0 2982 618 12738 3859 p 2 0 2955 645 11809 3796 p 2 0 3296 304 15935 4422 p 2 0 3039 561 12586 3957 p 2 0 3221 379 15227 4239 p 2 197 2796 607 50727 4799 p 2 0 2862 738 12594 3656 p 2 0 3057 543 13869 3899 p 2 0 2279 1321 8196 2860 p 2 0 2871 729 11086 3624 p 2 0 2637 963 9321 3306 p 2 0 2690 910 9870 3412 p 2 0 2358 1242 7947 2957 p 2 0 2074 1526 6854 2580 p 2 0 2845 755 10729 3646 p 2 0 2795 805 9907 3544 p 2 141 2998 461 33669 4877 p 2 0 2928 672 12808 3751 p 2 0 2750 850 10872 3471 p 2 0 2804 796 11540 3583 p 2 0 2443 1157 9298 3067 p 2 0 2680 920 11188 3372 p 2 0 2443 1157 9117 3052 p 2 0 2472 1128 9097 3070 p 2 0 2207 1393 7719 2758 p 2 0 2430 1170 8776 3044 p 2 178 2845 577 57913 4928 p 2 0 2854 746 12504 3688 p 2 0 2945 655 12413 3727 p 2 0 2715 885 11048 3395 p 2 0 2982 618 11694 3805 i 2 3600 0 0 111947 13519 p 2 0 3356 244 27562 5094 p 2 1 3504 95 29292 5229 p 2 0 3432 168 27375 5063 p 2 0 3438 162 27175 5075 p 2 86 3467 47 63856 5995 p 2 0 3512 88 34071 5276 p 2 0 3567 33 30219 5320 p 2 0 3555 45 30520 5388 p 2 0 3585 15 31865 5424 p 2 0 3503 97 29570 5277 p 2 0 3455 145 29140 5206 p 2 0 3491 109 28110 5174 p 2 0 3403 197 28044 5062 p 2 0 3420 180 29185 5132 p 2 200 3378 22 73192 6421 p 2 0 3476 124 27807 5172 p 2 0 3455 145 26061 5078 p 2 0 3454 146 28640 5151 p 2 0 3552 48 28790 5280 p 2 0 3539 61 30543 5387 p 2 0 3546 54 28946 5231 p 2 0 3517 83 29526 5311 p 2 0 3429 171 27326 5079 p 2 0 3382 218 26980 5030 p 2 122 3348 130 50999 5982 p 2 0 3524 76 32108 5399 p 2 0 3481 119 29140 5288 p 2 0 3519 81 29606 5306 p 2 0 3531 69 28366 5170 p 2 0 3455 145 30072 5137 p 2 0 3555 45 30647 5352 p 2 0 3518 82 29788 5374 p 2 0 3567 33 31754 5378 p 2 0 3496 104 29777 5274 p 2 195 3345 60 67706 6396 p 2 0 3556 44 31974 5460 p 2 0 3480 120 28213 5171 p 2 0 3522 78 32523 5369 p 2 0 3441 159 27367 5106 p 2 0 3468 132 28983 5204 p 2 0 3508 92 26365 5154 p 2 0 3477 123 30161 5218 p 2 0 3539 61 30683 5410 p 2 0 3485 115 29638 5296 p 2 117 3472 11 48929 6130 p 2 0 3546 54 31667 5473 p 2 0 3466 134 29037 5237 p 2 0 3514 86 30516 5392 p 2 0 3439 161 27830 5123 p 2 0 3533 67 33351 5452 p 2 0 3486 114 28818 5247 p 2 0 3447 153 28850 5171 p 2 0 3450 150 26680 5076 p 2 0 3492 108 30326 5299 p 2 179 3404 17 69443 6514 p 2 0 3516 84 31165 5339 p 2 0 3552 48 30207 5373 p 2 0 3482 118 29336 5269 p 2 0 3482 118 29324 5224 p 2 0 3498 102 29697 5311 p 2 0 3449 151 27891 5162 p 2 0 3528 72 32447 5446 p 2 0 3479 121 28938 5196 p 2 0 3366 234 29836 5021 p 2 107 3392 101 53413 6003 p 2 0 3568 32 34630 5418 p 2 0 3565 35 31522 5450 p 2 0 3527 73 31268 5390 p 2 0 3563 37 31817 5434 p 2 0 3498 102 30218 5349 p 2 0 3486 114 32182 5359 p 2 0 3521 79 29883 5338 p 2 0 3443 157 29446 5188 p 2 0 3476 124 29687 5302 p 2 169 3354 77 71421 6243 p 2 0 3441 159 30109 5218 p 2 0 3512 88 27770 5176 p 2 0 3475 125 31773 5240 p 2 0 3580 20 33036 5527 p 2 0 3538 62 31048 5425 p 2 0 3570 30 31151 5439 p 2 0 3527 73 30431 5397 p 2 0 3504 96 30674 5365 p 2 0 3506 94 29998 5342 p 2 109 3402 89 46691 6006 p 2 0 3538 62 34468 5537 p 2 0 3508 92 29224 5299 p 2 0 3436 164 29773 5162 p 2 1 3447 152 26486 5096 p 2 0 3481 119 31739 5304 p 2 0 3560 40 31719 5520 p 2 0 3539 61 32744 5492 p 2 0 3570 30 31196 5482 p 2 0 3447 153 29963 5222 p 2 207 3337 56 64831 6522 p 2 0 3492 108 28256 5274 p 2 0 3450 150 30037 5201 p 2 0 3533 67 31699 5439 p 2 0 3489 111 29416 5269 p 2 0 3472 128 29793 5286 p 2 0 3437 163 26915 5102 p 2 0 3458 142 31406 5229 p 2 0 3507 93 30408 5382 p 2 0 3515 85 32615 5382 p 2 96 3497 7 57899 6303 p 2 0 3569 31 34431 5572 p 2 0 3491 109 31237 5370 p 2 0 3565 35 32473 5482 p 2 0 3489 111 30331 5262 p 2 0 3487 113 30610 5329 p 2 0 3441 159 29347 5150 p 2 0 3503 97 31002 5334 p 2 0 3449 151 27835 5077 p 2 0 3501 99 33229 5345 p 2 192 3393 15 69470 6590 p 2 0 3524 76 33866 5432 p 2 0 3567 33 31093 5494 p 2 0 3517 83 31571 5384 p 2 0 3473 127 30791 5302 p 2 0 3506 94 30192 5339 p 2 0 3464 136 29741 5244 p 2 0 3574 26 33408 5497 p 2 0 3495 105 29663 5248 p 2 0 3417 183 29566 5183 p 2 106 3420 74 49130 6029 p 2 0 3515 85 33903 5472 p 2 0 3561 39 32645 5476 p 2 0 3562 38 34925 5556 i 2 3600 0 0 96096 12595 p 2 0 3474 126 16633 4623 p 2 0 3358 242 14360 4454 p 2 0 3331 269 13643 4348 p 2 0 3055 545 10829 3792 p 2 0 3164 436 11546 3960 p 2 157 2774 669 42420 4694 p 2 0 3031 569 12023 3849 p 2 0 2995 605 10997 3724 p 2 0 2789 811 8986 3381 p 2 0 3195 405 11818 4061 p 2 0 3173 427 11862 4050 p 2 0 3206 394 13573 4087 p 2 0 3077 523 11670 3756 p 2 0 3154 446 12394 3884 p 2 0 3041 559 10648 3698 p 2 102 2748 750 31129 4233 p 2 0 3005 595 11703 3744 p 2 0 2757 843 9396 3390 p 2 0 2680 920 9195 3317 p 2 0 2671 929 9093 3249 p 2 0 2788 812 9567 3413 p 2 0 3059 541 11650 3811 p 2 0 2827 773 9626 3431 p 2 0 3167 433 18570 4470 p 2 0 3127 473 11554 3975 p 2 141 2954 505 48414 4807 p 2 5 3266 329 20451 4686 p 2 0 2963 637 11312 3711 p 2 0 2983 617 10250 3689 p 2 0 3070 530 17112 4351 p 2 0 2928 672 10333 3700 p 2 0 2887 713 14681 3991 p 2 0 3110 490 12102 3938 p 2 0 3003 597 10486 3670 p 2 0 2961 639 10246 3578 p 2 75 3174 351 51149 5152 p 2 0 3067 533 12810 3820 p 2 0 2898 702 10298 3511 p 2 0 3113 487 11331 3842 p 2 0 2847 753 10610 3479 p 2 0 3099 501 11296 3800 p 2 0 2922 678 10086 3590 p 2 0 2878 722 9862 3501 p 2 0 2540 1060 7792 3045 p 2 165 3008 427 54156 4983 p 2 0 3102 498 12642 3871 p 2 0 3177 423 11651 4019 p 2 0 2490 1110 7499 2993 p 2 0 2696 904 8854 3229 p 2 0 2816 784 9091 3390 p 2 0 2765 835 9452 3345 p 2 0 2633 967 8399 3169 p 2 0 2902 698 10267 3557 p 2 0 2743 857 8807 3346 p 2 0 2581 1019 7950 3111 p 2 111 2709 780 32816 4255 p 2 0 2211 1389 7083 2723 p 2 0 2996 604 12108 3733 p 2 0 2812 788 9505 3402 p 2 0 2893 707 10655 3534 p 2 0 2722 878 9447 3311 p 2 0 2886 714 9917 3534 p 2 0 2845 755 10324 3464 p 2 1 2643 956 8936 3182 p 2 149 2740 711 48447 4527 p 2 0 2674 926 10503 3264 p 2 0 2055 1545 8892 2551 p 2 0 2702 898 11090 3338 p 2 0 2558 1042 8382 3095 p 2 0 2881 719 10623 3564 p 2 0 2723 877 9136 3318 p 2 0 2849 751 10647 3477 p 2 0 2847 753 9475 3426 p 2 0 2591 1009 8258 3104 p 2 0 2768 832 9602 3327 p 2 126 2430 1044 25803 3896 p 2 0 2425 1175 8989 3007 p 2 0 2874 726 11646 3587 p 2 0 2751 849 9898 3388 p 2 0 2363 1237 7369 2887 p 2 0 2432 1168 7276 2927 p 2 0 2648 952 8509 3220 p 2 0 2664 936 8824 3236 i 2 3600 0 0 110688 13469 p 2 0 3350 250 15015 4355 p 2 141 3233 226 55565 5448 p 2 0 3338 262 19187 4462 p 2 0 3017 583 12327 3801 p 2 0 3194 406 14013 4040 p 2 3 3166 431 17503 4203 p 2 0 3210 390 13968 4097 p 2 0 2909 691 11947 3675 p 2 5 2863 732 14592 3747 p 2 0 3179 421 13802 4108 p 2 0 2988 612 11501 3793 p 2 91 3146 363 44318 5162 p 2 0 3104 496 16743 3938 p 2 0 3150 450 14583 4010 p 2 1 3101 498 17467 4065 p 2 0 2770 830 11673 3446 p 2 1 2941 658 12641 3638 p 2 10 2728 862 14346 3559 p 2 0 2699 901 10790 3298 p 2 0 2557 1043 9868 3118 p 2 3 2688 909 13638 3487 p 2 159 2945 496 51851 4848 p 2 0 2839 761 17189 3582 p 2 1 3019 580 15643 3923 p 2 0 2878 722 12696 3569 p 2 0 2931 669 11068 3668 p 2 1 2920 679 15528 3800 p 2 0 2486 1114 9236 3045 p 2 0 2760 840 10888 3377 p 2 4 2642 954 13472 3442 p 2 0 2446 1154 8617 3022 p 2 107 2256 1237 27509 3729 p 2 4 2624 972 14097 3524 p 2 0 2814 786 12023 3550 p 2 0 2705 895 11285 3366 p 2 2 2874 724 14930 3704 p 2 0 2828 772 12184 3536 p 2 0 2734 866 10469 3331 p 2 0 2741 859 13083 3475 p 2 0 2330 1270 8685 2869 p 2 0 2597 1003 9203 3175 i 2 3600 0 0 79465 11806 p 2 0 3426 174 16182 4567 p 2 0 3083 517 10211 3893 p 2 0 3080 520 10965 3905 p 2 0 3191 409 11539 3977 p 2 0 2887 713 9410 3497 p 2 0 3094 506 11282 3757 p 2 0 2911 689 9922 3536 p 2 0 3060 540 10171 3641 p 2 0 2989 611 10251 3597 p 2 108 2860 632 30439 4305 p 2 0 2854 746 9425 3468 p 2 0 2458 1142 8056 3016 p 2 0 2606 994 8650 3188 p 2 0 2474 1126 7883 3008 p 2 0 2600 1000 8646 3157 p 2 0 2793 807 9989 3438 p 2 0 2647 953 8534 3212 p 2 0 2893 707 10181 3496 p 2 0 2812 788 9491 3388 p 2 144 2672 784 41245 4282 p 2 0 2756 844 10073 3336 p 2 0 2663 937 9203 3191 p 2 0 2662 938 8693 3221 p 2 0 2565 1035 8364 3116 p 2 0 2549 1051 7651 3083 p 2 0 2434 1166 7401 2934 p 2 0 2290 1310 6861 2768 p 2 0 2820 780 9366 3381 p 2 0 2924 676 9989 3567 p 2 109 2761 730 27832 4253 p 2 0 2719 881 10797 3375 p 2 0 2820 780 10082 3464 p 2 0 2860 740 10101 3507 p 2 0 2457 1143 7880 2948 p 2 0 2736 864 9053 3329 i 2 3600 0 0 98008 13290 p 2 0 3545 55 25798 5567 p 2 0 3413 187 20674 4886 p 2 0 3355 245 19595 4754 p 2 127 3420 53 48881 6038 p 2 0 3495 105 21308 4927 p 2 3 3570 27 24392 5152 p 2 0 3520 80 22288 4974 p 2 3 3466 131 20268 4829 p 2 0 3482 118 20732 4846 p 2 3 3340 257 20018 4644 p 2 0 3391 209 20372 4703 p 2 0 3322 278 20029 4680 p 2 0 3414 186 19219 4644 p 2 97 3391 112 40247 5590 p 2 0 3475 125 21422 4837 p 2 1 3524 75 22013 4870 p 2 0 3453 147 19978 4705 p 2 2 3511 87 22923 4923 p 2 0 3509 91 21486 4814 p 2 3 3426 171 20583 4677 p 2 0 3460 140 20351 4690 p 2 0 3361 239 19498 4567 p 2 0 3447 153 21955 4803 p 2 128 3377 95 52677 5780 p 2 0 3433 167 20843 4747 p 2 3 3424 173 21367 4796 p 2 0 3404 196 20152 4716 p 2 0 3544 56 22368 5026 p 2 0 3504 96 20725 4957 p 2 2 3542 56 23735 4998 p 2 0 3546 54 22350 4953 p 2 0 3514 86 20624 4891 p 2 0 3469 131 20945 4846 p 2 99 3411 90 40787 5607 p 2 0 3537 63 23657 4976 p 2 2 3473 125 21231 4809 p 2 1 3467 132 19551 4703 p 2 1 3403 196 20491 4755 p 2 1 3432 167 19941 4698 p 2 3 3505 92 21791 4917 p 2 0 3468 132 20189 4806 p 2 0 3544 56 23741 4994 p 2 0 3482 118 22669 4913 p 2 115 3437 48 47336 5794 p 2 0 3542 58 22356 4935 p 2 3 3436 161 21192 4805 p 2 0 3514 86 22366 4903 p 2 0 3448 152 20943 4766 p 2 0 3477 123 20233 4726 p 2 3 3459 138 20789 4794 p 2 0 3453 147 20072 4720 p 2 0 3443 157 20422 4790 p 2 0 3383 217 19414 4706 p 2 88 3454 58 44508 5695 p 2 0 3510 90 23297 5012 p 2 0 3515 85 20910 4920 p 2 0 3536 64 23026 5019 p 2 0 3465 135 21058 4821 p 2 0 3458 142 22347 4879 p 2 4 3479 117 21324 4873 p 2 0 3471 129 20429 4810 p 2 0 3423 177 20480 4725 p 2 0 3395 205 19897 4742 p 2 126 3431 43 49559 5750 p 2 0 3488 112 20590 4811 i 2 3600 0 0 80399 12252 p 2 0 3353 247 15017 4321 p 2 0 2986 614 10339 3723 p 2 0 2972 628 10740 3721 p 2 0 2828 772 9317 3480 p 2 0 2975 625 10253 3647 p 2 0 2954 646 9870 3664 p 2 0 2843 757 9604 3502 p 2 105 2847 648 28675 4354 p 2 0 3131 469 12775 3941 p 2 0 3009 591 11113 3729 p 2 0 2758 842 8909 3282 p 2 0 2681 919 9683 3246 p 2 0 2568 1032 8983 3096 p 2 0 2785 815 9925 3364 p 2 0 2784 816 10099 3365 p 2 0 2446 1154 7915 2935 p 2 144 2848 608 41885 4626 p 2 0 2741 859 9817 3334 p 2 0 2636 964 9289 3206 p 2 0 2588 1012 8744 3147 p 2 0 2890 710 10847 3586 p 2 0 2606 994 8793 3144 p 2 0 2428 1172 7549 2884 p 2 0 2511 1089 8601 3008 p 2 0 2559 1041 8402 3086 p 2 0 2759 841 8888 3280 p 2 0 2844 756 9250 3391 p 2 112 2382 1106 29168 3730 p 2 0 3024 576 12723 3714 p 2 0 2741 859 10217 3365 p 2 0 2550 1050 8802 3131 p 2 0 2512 1088 8660 3027 p 2 0 2295 1305 7703 2763 p 2 0 2842 758 10365 3456 p 2 0 2484 1116 8553 3017 i 2 3600 0 0 111030 13460 p 2 0 3304 296 15557 4299 p 2 115 2952 533 51509 4849 p 2 0 2945 655 11578 3687 p 2 0 2529 1071 8679 3143 p 2 0 2871 729 10075 3502 p 2 0 2920 680 12090 3672 p 2 0 2896 704 10495 3642 p 2 0 2682 918 9348 3258 p 2 0 2230 1370 6934 2712 p 2 0 2989 611 11402 3756 p 2 0 2870 730 10273 3584 p 2 90 3051 459 37478 4753 p 2 0 3011 589 15366 3829 p 2 0 3120 480 13609 3939 p 2 0 3076 524 13295 3836 p 2 0 2623 977 9589 3173 p 2 0 2890 710 10944 3523 p 2 0 2763 837 10493 3408 p 2 0 2764 836 10691 3376 p 2 0 2366 1234 7976 2880 p 2 0 2483 1117 8744 3055 p 2 163 2745 692 39813 4686 p 2 0 2727 873 10765 3449 p 2 0 2865 735 10905 3539 p 2 0 2664 936 9734 3262 p 2 0 2757 843 9769 3332 p 2 0 2753 847 9899 3371 p 2 0 2356 1244 7630 2882 p 2 0 2276 1324 7470 2798 i 2 3600 0 0 76997 12318 p 2 0 3299 301 15730 4395 p 2 60 3090 450 34513 4401 p 2 0 2749 851 11338 3392 p 2 0 2848 752 11292 3551 p 2 0 2658 942 9579 3248 p 2 0 2684 916 10449 3287 p 2 0 2552 1048 9484 3121 p 2 0 2506 1094 8464 2979 p 2 0 2707 893 9055 3269 p 2 0 2149 1451 6793 2613 p 2 0 2541 1059 9093 3059 p 2 158 2366 1076 48232 4335 p 2 0 2502 1098 9203 3057 p 2 0 2190 1410 7957 2741 p 2 0 2358 1242 8076 2817 p 2 0 2647 953 9777 3228 p 2 0 2288 1312 7919 2801 p 2 0 2502 1098 9048 3037 p 2 0 2283 1317 8166 2774 p 2 0 2500 1100 8729 3033 p 2 0 2436 1164 7587 2919 p 2 102 2194 1304 29703 3555 p 2 0 2361 1239 8377 2822 i 2 3600 0 0 64439 12557 p 2 0 3482 118 18421 4981 p 2 0 3303 297 12654 4243 p 2 0 3215 385 12360 4113 p 2 0 2940 660 10126 3624 p 2 0 3059 541 10427 3832 p 2 0 3010 590 10467 3699 p 2 0 2655 945 8150 3223 p 2 0 2744 856 8632 3328 p 2 0 2811 789 8557 3397 p 2 0 2653 947 9091 3277 p 2 0 2577 1023 8033 3169 p 2 0 2078 1522 5871 2537 p 2 0 2283 1317 6723 2763 p 2 0 2478 1122 7877 3047 p 2 0 2795 805 8503 3396 p 2 0 2458 1142 8282 3005 p 2 0 3021 579 9824 3698 p 2 0 2975 625 9740 3658 p 2 0 2642 958 8909 3304 p 2 0 2726 874 8423 3351 p 2 0 2498 1102 7383 3051 p 2 1 2708 891 8942 3315 i 2 3600 0 0 78121 12490 p 2 0 3334 266 16867 4494 p 2 0 2476 1124 6834 2950 p 2 112 2998 490 34123 5093 p 2 117 3109 374 51667 6242 p 2 0 3017 583 13218 3892 p 2 0 2875 725 9026 3365 p 2 217 3095 288 66547 7579 p 2 0 2889 711 12542 3784 p 2 49 2986 565 38356 5645 p 2 0 3014 586 12374 3943 p 2 88 2939 573 36236 5496 p 2 0 3078 522 12422 3957 p 2 77 3035 488 41496 5892 p 2 0 2853 747 11615 3783 p 2 115 2923 562 50733 6725 p 2 40 2952 608 35222 5820 p 2 0 2934 666 11247 3911 p 2 0 2673 927 8531 3180 p 2 103 3028 469 40413 5537 p 2 0 3048 552 11788 3774 p 2 95 2822 683 49140 5422 p 2 0 2830 770 10319 3368 p 2 169 2811 620 64534 6386 p 2 224 2733 643 82583 7237 p 2 0 2405 1195 10366 3060 p 2 0 2681 919 12830 3187 p 2 20 3140 440 51719 5437 p 2 20 3136 444 46504 5491 p 2 0 2746 854 13840 3712 p 2 0 3061 539 12990 3666 p 2 0 3145 455 13831 3721 p 2 0 2979 621 10122 3446 p 2 0 2695 905 8260 3131 p 2 0 3352 248 21475 4529 i 2 3600 0 0 67207 12807 p 2 0 3496 104 16018 4593 p 2 0 3397 203 14817 4523 p 2 0 3123 477 11898 4085 p 2 0 3169 431 12596 4096 p 2 0 2999 601 10060 3777 p 2 0 3234 366 12702 4202 p 2 0 3353 247 13467 4369 p 2 0 2752 848 8496 3371 p 2 0 3149 451 11720 4012 p 2 0 3096 504 10345 3946 p 2 0 3050 550 10043 3826 p 2 0 2928 672 10025 3723 p 2 0 2945 655 9960 3716 p 2 0 2753 847 8800 3464 p 2 0 2872 728 9439 3628 p 2 0 2683 917 8391 3373 p 2 0 2961 639 10172 3690 p 2 0 2892 708 10066 3589 p 2 0 3090 510 10574 3875 p 2 0 2292 1308 6763 2821 p 2 0 2944 656 9526 3703 p 2 0 2545 1055 7683 3129 p 2 0 2540 1060 7647 3146 p 2 0 2444 1156 7688 3061 p 2 0 2582 1018 7626 3182 p 2 0 2567 1033 8021 3199 p 2 0 2490 1110 7519 3086 p 2 0 2417 1183 6982 2977 p 2 0 2737 863 9030 3430 p 2 0 2556 1044 7837 3147 p 2 0 2893 707 9346 3615 p 2 0 2863 737 9086 3586 p 2 0 2638 962 8155 3240 p 2 0 2621 979 8451 3245 p 2 0 2250 1350 6620 2751 p 2 63 2740 797 21056 4235 p 2 0 2785 815 9507 3535 p 2 88 2592 920 17524 4040 p 2 0 2546 1054 8594 3265 p 2 0 2592 1008 8258 3285 p 2 90 2823 687 18688 4445 p 2 0 2651 949 8484 3375 p 2 0 3120 480 10776 3984 p 2 0 2369 1231 6870 2890 p 2 0 2759 841 8673 3416 p 2 0 2537 1063 7709 3142 p 2 0 2682 918 7845 3292 p 2 0 2544 1056 7654 3153 p 2 0 2597 1003 7862 3218 p 2 0 2487 1113 7699 3117 p 2 0 2528 1072 7576 3176 p 2 0 2413 1187 7271 3039 p 2 0 2746 854 8706 3397 p 2 0 2707 893 8223 3313 p 2 0 3026 574 10130 3802 p 2 0 2168 1432 6222 2690 p 2 0 2755 845 8579 3436 p 2 0 2702 898 7873 3289 p 2 0 2572 1028 7877 3158 p 2 0 2592 1008 8154 3228 p 2 0 2622 978 8219 3260 p 2 0 2424 1176 7140 3017 p 2 0 2399 1201 7314 2984 p 2 0 2545 1055 7706 3147 p 2 0 2821 779 9272 3505 p 2 0 2544 1056 7792 3132 p 2 0 2888 712 9548 3652 p 2 0 2754 846 8792 3478 p 2 0 2610 990 8104 3221 p 2 0 2523 1077 7766 3119 p 2 0 1931 1669 5324 2417 p 2 0 2410 1190 7308 2974 p 2 0 2622 978 7671 3220 p 2 0 2439 1161 6825 3008 p 2 0 2439 1161 7329 3036 p 2 0 2472 1128 7438 3065 p 2 0 2305 1295 6766 2886 p 2 1 2756 843 8794 3402 p 2 0 3038 562 10398 3815 p 2 0 2261 1339 6504 2781 p 2 0 2784 816 8610 3452 p 2 0 2682 918 8310 3346 p 2 0 2003 1597 5918 2497 p 2 0 2455 1145 7350 3063 p 2 0 2387 1213 6697 2945 p 2 0 2545 1055 7837 3160 p 2 0 2566 1034 8121 3236 p 2 0 2485 1115 7580 3093 p 2 0 2701 899 8542 3337 p 2 0 2627 973 8264 3220 p 2 0 3027 573 10003 3797 p 2 0 2120 1480 6160 2632 p 2 0 2547 1053 8021 3157 p 2 0 2029 1571 5966 2494 p 2 0 2647 953 7940 3270 p 2 0 2498 1102 7838 3105 p 2 0 2456 1144 7301 3053 p 2 0 2363 1237 6912 2939 p 2 0 2416 1184 7302 3007 p 2 0 2362 1238 6902 2918 p 2 0 2190 1410 6426 2731 i 2 3600 0 0 47600 12123 p 2 150 3445 5 29963 6775 p 2 1 2845 754 14191 4448 p 2 4 2640 956 14347 4082 p 2 2 2710 888 13068 3852 p 2 2 2735 863 14877 4043 p 2 2 2636 962 14816 3944 p 2 1 2683 916 14347 3960 p 2 0 2509 1091 11606 3656 p 2 4 2633 963 13924 3917 p 2 2 2500 1098 13227 3767 p 2 2 2640 958 14693 3920 p 2 2 2500 1098 11260 3638 p 2 0 2668 932 13687 3849 p 2 0 2608 992 14856 3850 p 2 0 2606 994 12453 3702 p 2 0 2718 882 12704 3736 p 2 1 2716 883 14295 3922 p 2 1 2565 1034 12975 3723 p 2 3 2647 950 14832 3884 p 2 6 2401 1193 11613 3456 p 2 2 2630 968 13901 3851 i 2 3600 0 0 66222 12835 p 2 0 3526 74 17958 4703 p 2 0 3420 180 13191 4627 p 2 0 3028 572 10443 3928 p 2 0 3278 322 12498 4272 p 2 1 2945 654 9701 3676 p 2 0 3109 491 10152 3878 p 2 0 2765 835 8311 3415 p 2 0 2890 710 9048 3598 p 2 0 2938 662 9495 3677 p 2 0 2813 787 8532 3503 p 2 0 2863 737 9455 3596 p 2 0 2735 865 8693 3408 p 2 0 2732 868 8267 3401 p 2 0 2877 723 8937 3577 p 2 0 2765 835 8273 3371 p 2 0 2693 907 8101 3303 p 2 0 2847 753 8766 3544 p 2 0 2778 822 8489 3384 p 2 0 2692 908 7842 3271 p 2 0 2437 1163 7503 3014 p 2 0 2523 1077 7408 3118 p 2 0 2510 1090 7758 3106 p 2 0 2532 1068 7091 3080 p 2 0 2294 1306 6599 2830 p 2 1 2909 690 8975 3570 p 2 0 2584 1016 7894 3183 p 2 0 3030 570 10149 3805 p 2 0 2233 1367 6304 2728 p 2 0 2716 884 8713 3393 p 2 0 2501 1099 7115 3056 p 2 0 2606 994 7767 3201 p 2 1 2497 1102 7652 3087 p 2 0 2572 1028 7448 3160 p 2 0 2539 1061 7286 3129 p 2 0 2436 1164 7488 3039 p 2 0 2559 1041 7648 3141 p 2 0 2600 1000 8096 3181 p 2 0 2388 1212 6814 2916 p 2 0 2902 698 9457 3614 p 2 0 2859 741 8982 3580 p 2 0 2492 1108 7570 3072 p 2 0 2488 1112 7594 3045 p 2 0 2221 1379 6796 2778 p 2 0 2457 1143 7095 3018 p 2 0 2417 1183 7095 2970 p 2 0 2410 1190 7240 2998 p 2 0 2439 1161 7425 3016 p 2 0 2395 1205 6851 2972 p 2 1 2657 942 7569 3247 p 2 0 2451 1149 6994 3020 p 2 0 2423 1177 6931 2951 p 2 0 2552 1048 7823 3139 p 2 0 2668 932 8509 3293 p 2 0 2713 887 7994 3329 p 2 0 2032 1568 5628 2493 p 2 0 2508 1092 7531 3081 p 2 0 2493 1107 7274 3101 p 2 264 2470 866 22677 5024 p 2 0 2637 963 9020 3363 p 2 0 2595 1005 8896 3276 p 2 0 2578 1022 8551 3264 p 2 237 2724 639 26214 5320 p 2 0 2702 898 9926 3537 p 2 0 2868 732 9838 3647 p 2 263 2581 756 26492 5156 p 2 0 2597 1003 9345 3331 p 2 0 2677 923 8923 3407 p 2 92 2657 851 24529 4540 p 2 0 2852 748 10891 3722 p 2 71 2621 908 24577 4495 p 2 0 2689 911 9703 3497 p 2 0 2671 929 9234 3400 p 2 132 2791 677 26598 4995 p 2 0 2620 980 9507 3413 p 2 0 3113 487 10977 4035 p 2 104 2857 639 25512 4961 p 2 0 2605 995 9018 3412 p 2 0 2618 982 8954 3344 p 2 0 2235 1365 6964 2877 p 2 260 2486 854 25762 5225 p 2 0 2728 872 10100 3593 p 2 246 2447 907 24755 5085 p 2 0 2713 887 10286 3570 p 2 0 2725 875 9192 3545 i 2 3600 0 0 53738 12453 p 2 0 3286 314 11823 4092 p 2 1 3222 377 20663 4596 p 2 0 2998 602 10490 3808 p 2 4 3142 454 20467 4510 p 2 0 2943 657 10914 3672 p 2 0 2526 1074 8609 3072 p 2 1 3078 521 18516 4258 p 2 0 2519 1081 8563 3105 p 2 0 2217 1383 6488 2661 p 2 0 2328 1272 6580 2815 p 2 0 2932 668 18835 4088 p 2 0 2706 894 9155 3301 p 2 4 3019 577 24441 4713 p 2 0 2575 1025 8351 3267 p 2 0 2787 813 8795 3431 p 2 0 2513 1087 8335 3059 p 2 1 3054 545 23115 4709 p 2 0 2436 1164 8958 3106 p 2 0 2408 1192 7390 2925 p 2 3 2932 665 22659 4474 p 2 0 2739 861 10581 3395 p 2 0 2575 1025 8449 3179 p 2 3 3054 543 23846 4750 p 2 0 2469 1131 9493 3140 i 2 3600 0 0 51624 12397 p 2 0 3153 447 14206 4135 p 2 1194 2148 258 45281 9779 p 2 0 3101 499 14785 4590 p 2 1290 2174 136 56628 10843 p 2 0 3249 351 15818 4843 p 2 26 3376 198 35313 5889 p 2 0 3248 352 16784 4890 p 2 8 3364 228 29457 5389 p 2 0 3251 349 12789 4405 p 2 404 3026 170 47155 7827 p 2 0 3333 267 15199 4898 p 2 42 3395 163 37500 6623 p 2 0 3295 305 14409 4755 p 2 0 2784 816 9541 3697 p 2 64 3355 181 38902 6887 p 2 9 3368 223 30110 5728 p 2 0 3035 565 12396 4117 i 2 3600 0 0 53783 11771 p 2 0 3466 134 14141 4591 p 2 5 3382 213 16047 4678 p 2 0 3224 376 11469 4187 p 2 0 3062 538 9671 3860 p 2 1 3304 295 14796 4543 p 2 0 3138 462 10411 4062 p 2 0 3138 462 10742 4084 p 2 2 2950 648 12214 4018 p 2 0 2926 674 9468 3776 p 2 0 2876 724 9030 3663 p 2 0 2340 1260 6119 2893 p 2 3 2858 739 11632 3818 p 2 0 3078 522 9490 3855 p 2 1 2886 713 11417 3819 p 2 0 2622 978 7989 3331 p 2 0 2659 941 8087 3390 p 2 0 2884 716 11755 3769 p 2 0 2605 995 7824 3243 p 2 0 3111 489 10495 3990 p 2 0 2318 1282 6438 2851 p 2 0 2840 760 8506 3556 p 2 0 2590 1010 7355 3223 p 2 0 2708 892 7990 3375 p 2 0 2609 991 7450 3241 p 2 0 2580 1020 7575 3204 p 2 0 2367 1233 6787 2942 p 2 0 2426 1174 7056 3038 p 2 0 2547 1053 7121 3170 p 2 0 2415 1185 6590 2994 p 2 0 2616 984 7503 3223 p 2 0 3101 499 10291 3942 p 2 0 2292 1308 6510 2847 p 2 0 2555 1045 7461 3215 p 2 0 2846 754 8588 3579 p 2 0 2814 786 8147 3501 p 2 0 2795 805 8315 3506 p 2 0 2733 867 7950 3432 p 2 6 2781 813 13484 3766 p 2 0 2809 791 8853 3545 p 2 0 2551 1049 7628 3194 p 2 0 2456 1144 7219 3072 p 2 0 2748 852 12949 3612 p 2 0 3026 574 10151 3840 p 2 3 2841 756 13096 3798 p 2 0 2585 1015 7865 3241 p 2 0 2536 1064 7506 3155 p 2 0 2118 1482 5676 2619 p 2 1 2591 1008 12024 3408 p 2 0 2600 1000 7973 3220 p 2 0 2547 1053 7568 3167 p 2 0 2780 820 7817 3369 p 2 0 2442 1158 6987 3028 p 2 0 2634 966 8483 3316 p 2 0 2450 1150 7142 3033 p 2 0 3007 593 9513 3767 p 2 0 2259 1341 6172 2783 p 2 0 2609 991 7909 3272 p 2 0 2736 864 7969 3405 p 2 0 2540 1060 7360 3140 p 2 0 2619 981 7758 3282 p 2 0 2557 1043 7264 3179 p 2 0 2494 1106 7067 3129 p 2 0 2501 1099 7570 3132 p 2 0 2574 1026 7901 3267 p 2 0 2521 1079 7188 3175 p 2 0 2641 959 7723 3275 p 2 0 3062 538 10163 3869 p 2 0 2206 1394 6114 2743 p 2 0 2640 960 7742 3315 p 2 0 2621 979 7954 3228 p 2 0 2678 922 7339 3285 p 2 0 2513 1087 7361 3149 p 2 0 2678 922 7650 3283 p 2 0 2554 1046 7394 3179 p 2 0 2597 1003 7366 3210 p 2 0 2560 1040 7053 3168 p 2 0 2656 944 7665 3287 p 2 0 2461 1139 7053 3039 p 2 0 2839 761 8544 3551 p 2 0 2164 1436 5921 2667 p 2 0 2626 974 7292 3274 p 2 0 2853 747 8449 3556 p 2 0 2809 791 8026 3480 p 2 0 2662 938 7694 3320 p 2 0 2701 899 7333 3342 p 2 0 2659 941 7953 3333 p 2 0 2603 997 7282 3222 p 2 0 2349 1251 6325 2938 p 2 0 2320 1280 6546 2867 p 2 0 2557 1043 8040 3215 p 2 0 2492 1108 7390 3091 p 2 0 2635 965 7602 3247 p 2 0 2611 989 7487 3239 p 2 0 2529 1071 7024 3109 p 2 0 2583 1017 7551 3176 p 2 0 2438 1162 7076 3029 p 2 0 2527 1073 6865 3120 p 2 0 2514 1086 7477 3133 p 2 0 2464 1136 7018 3023 p 2 0 2477 1123 6938 3085 p 2 0 2551 1049 7418 3141 p 2 0 2372 1228 6610 2934 p 2 0 2961 639 9177 3692 p 2 0 2138 1462 5756 2650 p 2 0 2554 1046 7798 3219 p 2 0 2605 995 7778 3205 p 2 0 2567 1033 7309 3143 p 2 0 2524 1076 7199 3120 p 2 0 2576 1024 7665 3188 p 2 0 2512 1088 7217 3110 p 2 0 2579 1021 7633 3179 p 2 0 2619 981 7233 3238 p 2 0 2367 1233 6757 2958 p 2 0 2569 1031 10803 3263 p 2 0 3176 424 11260 4114 p 2 0 2290 1310 6848 2829 p 2 0 2536 1064 10714 3246 p 2 0 2739 861 8167 3328 p 2 0 2727 873 7636 3315 p 2 0 2625 975 11286 3351 p 2 0 2613 987 7454 3195 p 2 0 2585 1015 10387 3279 p 2 0 2644 956 7662 3239 p 2 0 2374 1226 6762 2958 p 2 0 2331 1269 6648 2898 p 2 0 2715 885 11713 3446 p 2 0 2503 1097 7697 3087 p 2 0 2541 1059 9310 3180 p 2 0 2677 923 8445 3346 p 2 0 2591 1009 8864 3208 p 2 0 2504 1096 7272 3084 p 2 0 2411 1189 7301 3014 p 2 0 2488 1112 7023 3054 p 2 0 2458 1142 6920 3055 p 2 0 2474 1126 7168 3057 p 2 0 2381 1219 6848 2970 p 2 0 2657 943 7942 3278 p 2 0 2413 1187 6807 2981 p 2 0 2980 620 9593 3764 p 2 0 2361 1239 6646 2874 p 2 0 2744 856 8224 3429 p 2 0 2890 710 8887 3616 p 2 0 2723 877 7759 3408 p 2 0 2712 888 8221 3400 p 2 0 2578 1022 7454 3222 p 2 0 2603 997 7628 3238 p 2 0 2660 940 7273 3293 p 2 0 2537 1063 7174 3142 p 2 0 2725 875 7729 3325 p 2 0 2653 947 7746 3243 p 2 0 2940 660 9168 3664 p 2 0 2123 1477 5948 2634 p 2 0 2323 1277 6702 2874 p 2 0 2117 1483 5601 2603 p 2 0 2643 957 7522 3274 p 2 0 2568 1032 7560 3197 p 2 0 2507 1093 7047 3092 p 2 0 2314 1286 6702 2893 p 2 0 2426 1174 6980 3022 p 2 0 2372 1228 6853 2965 p 2 0 2678 922 7865 3331 p 2 0 2415 1185 6814 2979 p 2 0 2748 852 8619 3443 p 2 0 2683 917 7658 3354 p 2 0 2640 960 7582 3289 p 2 0 2609 991 7590 3274 p 2 0 2082 1518 5615 2574 p 2 0 2654 946 7642 3273 p 2 0 2520 1080 6984 3125 p 2 0 2489 1111 7110 3120 p 2 0 2477 1123 7140 3118 p 2 0 2465 1135 7182 3094 p 2 0 2732 868 8187 3369 p 2 0 2348 1252 6522 2891 p 2 0 3054 546 9559 3816 p 2 0 2241 1359 5724 2738 p 2 0 2709 891 8132 3366 p 2 0 2738 862 8035 3405 p 2 0 2108 1492 5767 2609 p 2 0 2521 1079 7103 3104 p 2 0 2543 1057 7278 3142 p 2 0 2490 1110 7145 3096 p 2 0 2702 898 8023 3330 p 2 0 2530 1070 6985 3118 p 2 0 2357 1243 6408 2915 p 2 0 2516 1084 7337 3108 p 2 0 2628 972 7687 3220 p 2 0 2779 821 8346 3471 p 2 0 2524 1076 7313 3114 p 2 0 1952 1648 5177 2430 p 2 0 2718 882 7778 3334 p 2 0 2446 1154 6914 3026 p 2 0 2570 1030 7009 3159 p 2 0 2369 1231 6516 2937 p 2 0 2374 1226 6617 2937 p 2 0 2437 1163 7074 3028 p 2 0 2678 922 8038 3287 p 2 0 2519 1081 6900 3079 p 2 0 2828 772 8627 3518 p 2 0 2086 1514 5933 2576 p 2 0 2571 1029 7578 3216 p 2 0 2867 733 8247 3545 p 2 0 2770 830 8121 3447 p 2 0 2663 937 7777 3325 p 2 0 2880 720 8473 3543 p 2 0 2495 1105 7314 3129 p 2 0 2441 1159 7099 3056 p 2 0 2516 1084 7272 3140 p 2 0 2619 981 8063 3253 p 2 0 2386 1214 6636 2933 p 2 0 2982 618 9346 3754 p 2 0 2261 1339 6256 2753 p 2 0 2602 998 7411 3233 p 2 0 2668 932 7594 3324 p 2 0 2700 900 7952 3357 p 2 0 2641 959 7863 3315 p 2 0 2860 740 8188 3546 p 2 0 2692 908 7569 3349 p 2 0 2635 965 7752 3281 p 2 0 2595 1005 7473 3202 p 2 0 2692 908 7574 3323 p 2 0 2625 975 7628 3208 p 2 0 2971 629 9362 3724 p 2 0 2898 702 8712 3625 p 2 0 2544 1056 6897 3125 p 2 0 2359 1241 6792 2938 p 2 0 1862 1738 5075 2334 p 2 0 2452 1148 10393 3124 p 2 0 2635 965 8085 3256 p 2 0 2407 1193 10298 3103 p 2 0 2482 1118 7577 3082 p 2 0 2334 1266 6627 2925 p 2 0 2675 925 11066 3379 p 2 0 2485 1115 7195 3067 p 2 0 2793 807 8294 3488 p 2 0 2110 1490 5726 2604 p 2 0 2579 1021 10740 3330 p 2 0 2765 835 8746 3462 p 2 0 2080 1520 5742 2561 p 2 0 2566 1034 7520 3176 p 2 0 2551 1049 7542 3177 p 2 0 2689 911 8131 3344 p 2 0 2816 784 8310 3466 p 2 0 2571 1029 7460 3214 p 2 0 2640 960 8014 3269 p 2 0 2431 1169 6569 2998 p 2 0 2973 627 9383 3732 p 2 0 2231 1369 6272 2717 p 2 0 2674 926 8160 3335 p 2 0 2490 1110 6893 3074 p 2 0 2620 980 7640 3229 p 2 0 2539 1061 7214 3156 p 2 0 2480 1120 7055 3051 p 2 0 2439 1161 7045 3034 p 2 0 2542 1058 7020 3119 p 2 0 2289 1311 6377 2840 p 2 0 2475 1125 7021 3050 p 2 0 2608 992 7376 3194 p 2 0 2867 733 8994 3592 p 2 0 2103 1497 5720 2603 p 2 0 2494 1106 7397 3125 p 2 0 2711 889 7894 3387 p 2 0 2711 889 7769 3363 p 2 0 2684 916 7928 3333 p 2 0 2526 1074 7458 3132 p 2 0 2610 990 7338 3249 p 2 0 2620 980 7590 3265 p 2 0 2644 956 7829 3327 p 2 0 2798 802 8247 3498 p 2 0 2429 1171 6850 2990 p 2 0 2771 829 8320 3457 p 2 0 2769 831 8184 3455 p 2 0 2501 1099 7317 3160 p 2 0 2620 980 7874 3300 p 2 0 2094 1506 5680 2587 p 2 0 2720 880 9303 3432 p 2 0 2715 885 8155 3383 p 2 0 2744 856 9407 3466 p 2 0 2667 933 7932 3296 p 2 0 2382 1218 6825 2993 p 2 0 2835 765 9742 3527 p 2 0 2434 1166 7131 2992 p 2 0 2169 1431 5956 2658 p 2 0 2355 1245 6938 2890 p 2 0 2487 1113 7219 3095 p 2 0 2630 970 7288 3277 p 2 0 2603 997 7824 3257 p 2 0 2594 1006 7671 3236 p 2 0 2483 1117 7021 3077 p 2 0 2482 1118 6834 3076 p 2 0 2454 1146 7229 3084 p 2 0 2420 1180 6918 3038 p 2 0 2551 1049 7525 3130 p 2 0 2422 1178 7099 2990 p 2 0 2960 640 9342 3723 p 2 0 2093 1507 5723 2581 p 2 0 2546 1054 7482 3199 p 2 0 2604 996 7398 3210 p 2 0 2619 981 7678 3196 p 2 0 2222 1378 6190 2735 p 2 0 2527 1073 6878 3065 p 2 0 2467 1133 7014 3043 p 2 0 2575 1025 7238 3170 p 2 0 2446 1154 6626 3002 p 2 0 2555 1045 7514 3158 p 2 0 2559 1041 7199 3128 p 2 0 2244 1356 5847 2746 p 2 0 2355 1245 6826 2891 p 2 0 2664 936 7859 3312 p 2 0 2609 991 7734 3236 p 2 0 2048 1552 5692 2534 p 2 0 2572 1028 8628 3185 p 2 0 2489 1111 6993 3070 p 2 0 2560 1040 8670 3210 p 2 0 2544 1056 7171 3120 p 2 0 2378 1222 6826 2953 p 2 0 2320 1280 6503 2899 p 2 0 2689 911 9183 3358 p 2 0 2948 652 9310 3708 p 2 0 2169 1431 6232 2694 p 2 0 2722 878 9636 3483 p 2 0 2135 1465 5863 2636 p 2 0 2549 1051 7322 3185 p 2 0 2677 923 7901 3367 p 2 0 2471 1129 7257 3045 i 2 3600 0 0 73431 12853 p 2 0 3400 200 16639 4830 p 2 0 3366 234 13035 4465 p 2 0 3133 467 11043 4067 p 2 0 3062 538 9934 3873 p 2 0 3250 350 12390 4281 p 2 0 3228 372 11059 4215 p 2 0 3116 484 10293 4002 p 2 0 3062 538 9942 3938 p 2 0 2971 629 9332 3770 p 2 0 2618 982 7342 3228 p 2 0 2849 751 8762 3575 p 2 0 2874 726 8362 3577 p 2 0 2786 814 8518 3508 p 2 0 2740 860 7939 3406 p 2 0 2880 720 8951 3592 p 2 0 2859 741 9021 3573 p 2 0 3117 483 10665 3957 p 2 0 2850 750 9035 3549 p 2 0 2600 1000 7700 3184 p 2 0 2541 1059 7273 3078 p 2 0 2614 986 7551 3224 p 2 0 2680 920 8140 3340 p 2 0 2553 1047 7208 3153 p 2 0 2650 950 7727 3294 p 2 0 1880 1720 5196 2355 p 2 0 3097 503 11587 4185 i 2 3600 0 0 73344 12404 p 2 0 3537 63 18835 5119 p 2 2 3310 288 16756 4568 p 2 0 3434 166 15129 4662 p 2 2 3221 377 15236 4224 p 2 0 3230 370 11429 4103 p 2 0 3108 492 11811 4006 p 2 0 3050 550 13437 3953 p 2 0 2991 609 11240 3837 p 2 0 2866 734 10581 3647 p 2 0 2743 857 9422 3439 p 2 0 2940 660 10790 3740 p 2 0 3092 508 12057 3983 p 2 0 3049 551 10264 3906 p 2 0 3122 478 11910 4035 p 2 0 3012 588 11783 3814 p 2 0 2401 1199 7854 2970 p 2 0 2862 738 10271 3590 p 2 0 2647 953 9264 3313 p 2 0 2688 912 9308 3377 p 2 0 2729 871 8822 3407 p 2 0 2557 1043 8154 3226 p 2 0 2760 840 9531 3400 p 2 0 2885 715 10437 3729 i 2 3600 0 0 69698 13085 p 2 0 3452 148 16259 4888 p 2 3 3337 260 32290 5385 p 2 0 3416 184 16180 4701 p 2 0 3141 459 11680 4032 p 2 0 3346 254 29261 5198 p 2 0 3138 462 13277 4127 p 2 0 2924 676 10643 3645 p 2 8 3223 369 28419 4937 p 2 0 3114 486 12687 4014 p 2 0 2963 637 12114 3747 p 2 20 3156 424 28427 4906 p 2 0 3182 418 13831 4140 p 2 20 3131 449 32601 5169 p 2 0 3176 424 12878 4191 p 2 0 3031 569 11021 3841 p 2 0 2682 918 9230 3339 p 2 20 2922 658 33373 4993 p 2 0 2924 676 11769 3754 p 2 0 2688 912 9478 3373 p 2 0 2609 991 9339 3285 p 2 0 2667 933 8963 3329 p 2 0 2765 835 9589 3427 p 2 0 2804 796 9647 3522 p 2 0 2951 649 10830 3677 p 2 0 2685 915 9124 3306 p 2 0 2907 693 10726 3731 p 2 0 2746 854 9684 3425 p 2 0 2540 1060 8505 3086 p 2 0 2720 880 8996 3359 p 2 0 2370 1230 7858 2977 p 2 0 2683 917 9233 3326 p 2 0 2576 1024 8829 3246 p 2 0 2599 1001 9027 3283 p 2 0 1854 1746 5794 2348 p 2 0 2384 1216 7865 2964 p 2 0 2567 1033 8919 3178 p 2 0 2451 1149 8359 3041 p 2 0 2334 1266 8228 2918 p 2 119 3064 417 46872 6287 p 2 0 2838 762 12029 3682 p 2 125 2864 611 46476 6133 p 2 0 2936 664 12769 3820 p 2 453 2590 557 50448 7360 p 2 0 2913 687 11309 3827 p 2 176 2923 501 49123 6690 p 2 0 2785 815 13056 3756 p 2 198 2830 572 52482 6712 p 2 0 2601 999 9395 3335 p 2 563 2795 242 57842 8800 p 2 0 2914 686 13274 4166 p 2 344 2797 459 61968 8187 p 2 0 2932 668 14143 4309 p 2 331 2773 496 61502 8071 p 2 0 3046 554 13525 4210 p 2 251 2757 592 64245 7669 p 2 0 2914 686 11731 4017 p 2 406 2786 408 60964 8173 p 2 0 2973 627 14389 4261 p 2 347 2862 391 61716 8188 p 2 396 2754 450 64117 8583 p 2 0 3008 592 15772 4487 p 2 0 2746 854 9314 3469 p 2 450 2840 310 61957 8509 p 2 0 2963 637 14531 4187 p 2 278 2799 523 51810 7076 p 2 0 3261 339 16255 4323 p 2 62 3069 469 44301 5995 p 2 2 3201 397 17407 4536 p 2 77 3053 470 45812 6046 p 2 0 2885 715 13189 4032 p 2 166 2917 517 47553 6445 p 2 0 2537 1063 9134 3423 p 2 82 3082 436 41274 5868 p 2 0 2814 786 12315 3897 p 2 44 3209 347 34884 5448 p 2 0 2917 683 11953 3773 p 2 59 2974 567 38767 5369 p 2 0 2979 621 12765 3848 p 2 0 2706 894 9641 3400 p 2 0 2814 786 10100 3549 p 2 0 2807 793 9640 3486 p 2 0 2525 1075 8316 3111 p 2 1 2719 880 9131 3383 p 2 0 2903 697 10542 3630 p 2 0 2700 900 9145 3355 p 2 0 2948 652 11060 3754 p 2 0 2806 794 9980 3539 p 2 0 2352 1248 7010 2941 p 2 2 2362 1236 7658 2937 p 2 0 2509 1091 7773 3116 p 2 0 2283 1317 6839 2825 p 2 0 2428 1172 7751 3008 p 2 0 2535 1065 7871 3136 p 2 0 2557 1043 8587 3178 p 2 0 2613 987 8358 3243 p 2 0 2537 1063 7994 3146 p 2 0 3051 549 10610 3883 p 2 0 2921 679 10837 3717 p 2 0 2882 718 10836 3753 i 2 3600 0 0 68885 12609 p 2 0 3430 170 16024 4590 p 2 0 3266 334 13699 4377 p 2 0 2920 680 10722 3743 p 2 0 2863 737 10244 3658 p 2 0 2988 612 10651 3808 p 2 0 3009 591 10672 3840 p 2 0 2988 612 10607 3815 p 2 0 3173 427 11643 4159 p 2 0 3128 472 11200 4098 p 2 0 3164 436 12573 4176 p 2 0 3012 588 10587 3925 p 2 0 2751 849 9532 3521 p 2 0 2978 622 10471 3831 p 2 0 2827 773 9366 3602 p 2 0 2889 711 9837 3695 p 2 0 2748 852 8831 3512 p 2 0 2721 879 9161 3479 p 2 0 2717 883 8819 3448 p 2 0 2668 932 8797 3382 p 2 0 2521 1079 7912 3206 p 2 0 2804 796 9327 3543 p 2 0 2659 941 8970 3369 p 2 0 2918 682 10641 3728 p 2 0 2811 789 9643 3514 p 2 0 2782 818 9468 3496 p 2 0 2434 1166 8054 3102 p 2 0 2460 1140 8026 3056 p 2 0 2339 1261 7318 2936 p 2 0 2536 1064 8209 3166 p 2 0 2425 1175 7666 3035 p 2 0 2494 1106 8164 3137 p 2 0 2735 865 9060 3449 p 2 0 2440 1160 7648 3054 p 2 0 2932 668 10533 3731 p 2 0 2894 706 10342 3650 p 2 0 2583 1017 8598 3227 p 2 0 2445 1155 8202 3066 p 2 0 2573 1027 8167 3181 p 2 0 2758 842 9217 3437 p 2 0 2574 1026 8455 3239 p 2 0 2530 1070 7977 3178 p 2 0 2414 1186 7604 3049 p 2 0 2643 957 8625 3323 p 2 0 2814 786 9414 3552 p 2 0 1823 1777 5680 2330 p 2 0 2970 630 10361 3784 p 2 0 2779 821 9562 3527 p 2 0 2368 1232 7539 2972 p 2 0 2312 1288 7404 2925 p 2 0 2441 1159 7673 3051 p 2 0 2528 1072 8161 3173 p 2 0 2503 1097 7781 3121 p 2 0 2547 1053 8277 3208 p 2 0 2493 1107 8110 3157 p 2 0 2470 1130 7747 3103 p 2 0 2556 1044 8124 3170 i 2 3600 0 0 82378 14056 p 2 0 3338 262 11195 4367 p 2 0 3565 35 34191 5978 p 2 29 3326 245 16363 4861 p 2 0 3557 43 32025 5653 p 2 4 3559 37 34450 5957 p 2 0 3512 88 30753 5568 p 2 0 3451 149 25884 5246 p 2 1 3532 67 35840 6018 p 2 3 3541 56 37088 6124 p 2 0 3484 116 28048 5422 p 2 11 3501 88 35449 5886 p 2 20 3533 47 35934 6157 p 2 1 3531 68 37201 6278 p 2 0 3530 70 31234 5703 p 2 17 3488 95 33927 5882 p 2 1 3565 34 36669 6008 p 2 0 3537 63 35911 6003 p 2 5 3394 201 16900 4828 p 2 0 3518 82 33160 5681 p 2 0 3474 126 31561 5566 p 2 24 3498 78 34222 5909 p 2 0 3477 123 33118 5836 p 2 1 3510 89 35094 5934 p 2 17 3537 46 38122 6180 p 2 0 3526 74 36253 6041 p 2 0 3501 99 32989 5693 p 2 3 3421 176 16583 4891 p 2 0 3531 69 33212 5747 p 2 8 3553 39 38924 6359 p 2 1 3461 138 34370 5811 p 2 0 3533 67 35757 6007 p 2 3 3514 83 37363 6078 p 2 8 3406 186 15124 4821 p 2 0 3455 145 29629 5523 p 2 0 3512 88 34373 5772 p 2 0 3538 62 35844 5910 p 2 0 3354 246 13745 4624 p 2 0 3458 142 27281 5410 p 2 1 3474 125 34178 5810 p 2 0 3519 81 35673 5949 p 2 0 3415 185 15303 4777 p 2 0 3455 145 30171 5418 p 2 0 3531 69 31312 5615 i 2 3600 0 0 122253 14595 p 2 9 3546 45 26602 5843 p 2 0 3401 199 17314 4550 p 2 0 3479 121 18754 4747 p 2 0 2346 1254 8151 2957 p 2 0 2617 983 9138 3228 p 2 0 3025 575 11549 3792 p 2 0 1824 1776 5943 2334 p 2 0 1633 1967 4715 2093 p 2 0 1954 1646 5829 2463 p 2 0 1730 1870 4954 2226 p 2 0 2188 1412 6655 2726 p 2 0 1936 1664 5535 2448 p 2 0 1455 2145 4225 1920 p 2 0 1436 2164 3982 1920 p 2 0 2946 654 10779 3672 p 2 0 1282 2318 3957 1745 p 2 0 2869 731 9713 3556 p 2 0 2064 1536 5803 2583 p 2 0 998 2602 3017 1457 p 2 0 1071 2529 3244 1508 p 2 0 478 3122 1849 962 p 2 0 695 2905 2371 1156 p 2 0 781 2819 2738 1248 p 2 0 586 3014 2038 1042 p 2 0 512 3088 1921 970 p 2 0 435 3165 1531 887 p 2 0 1034 2566 3172 1479 p 2 0 321 3279 1324 783 p 2 0 1996 1604 5713 2532 p 2 0 1420 2180 3830 1896 p 2 0 1577 2023 4272 2036 p 2 0 1044 2556 2939 1493 p 2 0 732 2868 2651 1202 p 2 0 538 3062 1949 1004 p 2 0 508 3092 1910 971 p 2 0 464 3136 1630 919 p 2 0 470 3130 1621 923 p 2 0 374 3226 1485 834 p 2 0 779 2821 2480 1226 p 2 0 402 3198 1646 870 p 2 0 1678 1922 4382 2169 p 2 0 813 2787 2432 1255 p 2 0 1441 2159 3513 1903 p 2 0 1016 2584 2456 1445 p 2 0 658 2942 2238 1114 p 2 0 463 3137 1616 924 p 2 0 394 3206 1504 850 p 2 0 339 3261 1658 800 p 2 0 448 3152 1740 904 p 2 0 364 3236 1491 823 p 2 0 1104 2496 3231 1536 p 2 0 370 3230 1459 827 p 2 0 2988 612 13109 3761 p 2 0 2469 1131 8354 3048 p 2 0 720 2880 2498 1176 p 2 0 2032 1568 6102 2495 p 2 0 3415 185 19588 4834 i 2 3600 0 0 71957 12313 p 2 537 3060 3 53365 8335 p 2 0 3378 222 15300 4669 p 2 520 2651 429 42526 7260 p 2 188 3254 158 45848 6636 p 2 0 3431 169 14913 4954 p 2 74 3194 332 44511 5790 p 2 0 3287 313 12587 4497 p 2 0 2576 1024 7735 3417 p 2 97 2997 506 36059 5367 p 2 33 3111 456 24438 4988 p 2 0 2996 604 11698 4206 p 2 109 3079 412 27677 5382 p 2 0 3006 594 10781 4018 p 2 82 2957 561 24383 5003 p 2 0 2896 704 10150 3932 p 2 162 2738 700 22341 4932 p 2 0 3012 588 10869 3971 p 2 125 2677 798 21499 4524 p 2 0 3034 566 10206 3995 p 2 77 2772 751 17659 4220 p 2 0 1994 1606 5584 2665 p 2 0 2680 920 13067 3425 p 2 0 2527 1073 7255 3080 p 2 0 2373 1227 6634 2920 p 2 0 2363 1237 6020 2824 p 2 0 2259 1341 6100 2788 p 2 0 2343 1257 6083 2820 p 2 0 2185 1415 5969 2701 p 2 0 2768 832 7970 3323 p 2 0 2387 1213 6485 2878 p 2 0 2889 711 8736 3524 p 2 0 2687 913 7527 3322 p 2 0 1777 1823 4546 2263 i 2 3600 0 0 117170 13605 p 2 0 3532 68 23202 4472 p 2 0 3334 266 13536 4329 p 2 0 3157 443 12232 3971 p 2 0 3143 457 12103 3923 p 2 0 2961 639 10955 3657 p 2 0 2892 708 10251 3581 p 2 0 3319 281 13772 4221 p 2 0 3136 464 11575 3926 p 2 0 3455 145 17622 4497 p 2 1 3288 311 14541 4124 p 2 0 3211 389 13081 4024 p 2 0 3126 474 12509 3832 p 2 0 2108 1492 6585 2567 p 2 0 2924 676 11175 3545 p 2 0 2658 942 8735 3210 p 2 0 2758 842 9336 3333 p 2 0 2695 905 8870 3275 p 2 0 2653 947 8656 3229 p 2 1 2922 677 10895 3594 p 2 0 2835 765 9953 3436 p 2 0 3292 308 14405 4161 p 2 0 2988 612 11442 3752 p 2 0 2803 797 9615 3390 p 2 0 2860 740 10204 3424 p 2 0 1841 1759 5682 2279 p 2 1 2494 1105 8578 3000 p 2 0 2399 1201 7901 2937 p 2 0 2571 1029 8590 3098 p 2 0 2613 987 8519 3151 p 2 0 2450 1150 7917 2963 p 2 0 2876 724 10168 3509 p 2 0 2530 1070 8339 3057 p 2 0 3075 525 11608 3800 p 2 0 3079 521 11802 3755 p 2 0 2795 805 10102 3397 p 2 0 2622 978 8765 3167 p 2 0 2424 1176 7708 2939 p 2 0 2394 1206 7945 2939 p 2 0 2561 1039 8338 3095 p 2 0 2590 1010 8105 3125 p 2 0 2409 1191 7860 2946 p 2 0 2613 987 8542 3178 p 2 1 2894 705 10358 3533 p 2 0 2543 1057 8338 3089 p 2 0 3132 468 12246 3892 p 2 0 2152 1448 6601 2613 p 2 1 2867 732 10297 3476 p 2 0 2899 701 9926 3577 p 2 0 2852 748 9809 3454 p 2 1 2668 931 9117 3226 p 2 0 2362 1238 7423 2861 p 2 1 2361 1238 7691 2883 p 2 0 2407 1193 7400 2922 p 2 0 2469 1131 7825 2973 p 2 0 2783 817 9708 3377 p 2 0 2619 981 8582 3183 p 2 0 3288 312 14790 4121 p 2 0 3032 568 11547 3725 p 2 0 2866 734 10557 3456 p 2 0 2845 755 10371 3440 p 2 0 1796 1804 5545 2234 p 2 1 2489 1110 8468 2994 p 2 0 2571 1029 8545 3115 p 2 0 2376 1224 7481 2888 p 2 1 2632 967 8941 3153 p 2 0 2545 1055 8272 3058 p 2 0 2517 1083 8068 3025 p 2 0 3074 526 11332 3826 p 2 0 3206 394 13551 4068 p 2 0 2822 778 9614 3447 p 2 0 2899 701 10125 3561 p 2 0 2943 657 10792 3574 p 2 0 1910 1690 5749 2333 p 2 0 2603 997 8783 3129 p 2 0 2653 947 8870 3213 p 2 0 2439 1161 8240 2979 p 2 0 2376 1224 7333 2867 p 2 0 2290 1310 7140 2792 p 2 0 2857 743 10119 3459 p 2 0 2488 1112 7998 3016 p 2 0 3135 465 12033 3879 p 2 0 2204 1396 6828 2660 p 2 0 2710 890 9353 3258 p 2 0 2789 811 9747 3354 p 2 0 2806 794 10148 3363 p 2 0 2618 982 8675 3181 p 2 0 2557 1043 8287 3100 p 2 0 2511 1089 7959 3044 p 2 0 2506 1094 7978 3038 p 2 0 2466 1134 8027 2999 p 2 0 2110 1490 6685 2637 p 2 0 2675 925 8900 3244 p 2 0 3241 359 13729 4053 p 2 0 2187 1413 6944 2644 p 2 0 2596 1004 8862 3126 p 2 0 2696 904 8924 3221 p 2 0 2418 1182 7505 2933 p 2 0 2580 1020 8343 3108 p 2 0 2635 965 8538 3187 p 2 0 2541 1059 8207 3084 p 2 0 2471 1129 7803 3002 p 2 0 2389 1211 7443 2904 p 2 0 2392 1208 7350 2886 p 2 0 2814 786 9958 3434 p 2 0 2431 1169 7765 2936 p 2 0 3125 475 13456 3811 i 2 3600 0 0 116510 13563 p 2 3 3593 4 38294 5629 p 2 0 3286 314 14473 4163 p 2 5 3440 155 22287 4664 p 2 0 2419 1181 7835 2933 p 2 5 3134 461 19838 4033 p 2 0 2786 814 9404 3389 p 2 0 2123 1477 6431 2630 p 2 10 2837 753 16244 3693 p 2 0 3322 278 13205 4288 p 2 0 3419 181 17059 4386 p 2 0 3354 246 14484 4228 p 2 0 2985 615 10275 3681 p 2 0 3266 334 12848 4125 p 2 0 2232 1368 6471 2703 p 2 0 2582 1018 7712 3102 p 2 0 3018 582 10346 3713 p 2 0 3009 591 10614 3748 p 2 0 2862 738 9352 3550 p 2 0 2965 635 9845 3598 p 2 0 3035 565 10703 3746 p 2 0 3000 600 10880 3669 p 2 0 3259 341 12745 4066 p 2 0 2286 1314 6813 2769 p 2 0 3059 541 10519 3815 p 2 0 2942 658 9519 3574 p 2 0 2731 869 8693 3272 p 2 0 2774 826 8846 3364 p 2 0 2835 765 9056 3447 p 2 0 2799 801 9164 3432 p 2 0 1920 1680 5159 2353 p 2 28 2152 1420 10557 2837 p 2 56 2558 986 15204 3536 p 2 65 2923 612 19377 4138 p 2 54 2564 982 17951 3640 p 2 13 3066 521 21139 4067 p 2 0 2901 699 15077 3693 p 2 0 2963 637 14605 3719 p 2 0 2772 828 12601 3434 p 2 0 2723 877 9016 3288 p 2 0 2601 999 8216 3145 p 2 0 2764 836 8979 3372 p 2 0 2872 728 10032 3503 p 2 0 2700 900 8773 3276 p 2 0 3128 472 10978 3926 p 2 0 2942 658 9858 3625 p 2 0 3317 283 14453 4216 p 2 0 3141 459 11899 3877 p 2 0 2832 768 9221 3408 p 2 0 2943 657 10158 3554 p 2 0 1995 1605 5767 2432 p 2 14 2664 922 17546 3464 p 2 0 2752 848 8969 3320 p 2 6 2549 1045 17038 3352 p 2 0 2643 957 8576 3234 p 2 0 3001 599 11015 3656 p 2 13 3113 474 20530 4195 p 2 0 2710 890 8894 3336 p 2 0 3331 269 14766 4250 p 2 0 2392 1208 7361 2889 p 2 11 3108 481 23717 4198 p 2 0 2915 685 10411 3601 p 2 0 2869 731 10208 3472 p 2 0 2818 782 9680 3398 p 2 0 2775 825 9254 3336 p 2 0 2649 951 8695 3174 p 2 5 2672 923 9345 3243 p 2 0 2558 1042 7807 3065 p 2 0 2609 991 8449 3136 p 2 0 3149 451 11602 3954 p 2 0 2799 801 9107 3483 p 2 0 3089 511 11554 3823 p 2 0 2775 825 9540 3369 p 2 0 2968 632 9935 3613 p 2 0 3009 591 10504 3662 p 2 0 2334 1266 7214 2807 p 2 0 2541 1059 7699 3040 p 2 0 2676 924 8383 3214 p 2 0 2552 1048 7761 3062 p 2 0 2573 1027 7521 3091 p 2 0 2856 744 9441 3472 p 2 0 2425 1175 7199 2955 p 2 0 3130 470 11744 3864 p 2 0 2151 1449 6321 2615 p 2 0 2836 764 9093 3459 p 2 0 2452 1148 7469 2996 p 2 0 2804 796 9026 3336 p 2 0 2569 1031 7882 3099 p 2 0 2511 1089 7446 3020 p 2 0 2582 1018 7727 3140 p 2 0 2430 1170 7043 2936 p 2 0 2724 876 8349 3283 p 2 0 2888 712 9483 3519 p 2 0 2980 620 9509 3639 p 2 0 3211 389 12672 3997 p 2 0 2171 1429 6403 2633 p 2 0 2928 672 9275 3625 p 2 0 2852 748 9340 3463 p 2 0 2530 1070 7533 3044 p 2 0 2638 962 8129 3174 p 2 0 2652 948 8069 3207 p 2 0 2596 1004 7810 3141 p 2 0 2624 976 7800 3144 p 2 0 2476 1124 7182 2987 p 2 0 2532 1068 7536 3048 p 2 0 2841 759 9531 3413 p 2 0 3246 354 15626 4217 i 2 3600 0 0 67984 13150 p 2 3 3547 50 24863 5445 p 2 1 3286 313 18099 4284 p 2 0 3300 300 18850 4338 p 2 0 2907 693 15852 3704 p 2 2 3039 559 16775 3882 p 2 1 2800 799 16166 3600 p 2 3 2853 744 16038 3604 p 2 1 2619 980 14298 3327 p 2 4 2727 869 13555 3450 p 2 1 2938 661 14314 3762 p 2 5 2789 806 12930 3536 p 2 1 2858 741 14237 3659 p 2 0 2949 651 13644 3715 p 2 0 2798 802 12451 3517 p 2 0 2807 793 11502 3481 p 2 0 2407 1193 10596 3000 p 2 0 2689 911 9217 3265 p 2 0 2007 1593 5158 2417 p 2 0 2551 1049 7935 3091 p 2 0 2623 977 8149 3155 p 2 0 2801 799 9380 3387 p 2 0 2544 1056 7324 3025 p 2 0 3093 507 10280 3809 p 2 0 2795 805 8547 3376 p 2 0 2786 814 8536 3379 p 2 0 2575 1025 7455 3081 p 2 0 2427 1173 6946 2912 p 2 0 2406 1194 7478 2918 p 2 0 1880 1720 5031 2295 p 2 0 2377 1223 6628 2861 p 2 0 1816 1784 4588 2229 p 2 0 2155 1445 6083 2622 p 2 0 2609 991 7432 3119 p 2 0 2389 1211 6691 2877 p 2 0 2915 685 9358 3539 p 2 0 2578 1022 7136 3094 p 2 0 2545 1055 7363 3090 p 2 0 2426 1174 6845 2924 p 2 0 2434 1166 6742 2913 p 2 0 2343 1257 7008 2882 p 2 0 2331 1269 6481 2830 p 2 0 1681 1919 4182 2097 p 2 0 2271 1329 6156 2740 p 2 0 2265 1335 6188 2735 p 2 0 2498 1102 7453 3030 p 2 0 2320 1280 6358 2777 p 2 0 2056 1544 5301 2468 p 2 0 2445 1155 7451 2926 p 2 0 2551 1049 7512 3088 p 2 0 2391 1209 6757 2864 p 2 0 2425 1175 7091 2918 p 2 0 2325 1275 6717 2794 p 2 0 2350 1250 6842 2856 p 2 0 2255 1345 6206 2730 p 2 0 2185 1415 5928 2649 p 2 0 2175 1425 5736 2646 p 2 0 2451 1149 7485 2982 p 2 0 2234 1366 6392 2694 p 2 0 2899 701 9245 3540 p 2 0 2550 1050 7831 3079 p 2 0 2482 1118 7220 3017 p 2 0 2177 1423 6087 2645 p 2 0 2478 1122 7037 2966 p 2 0 2327 1273 6597 2816 p 2 0 2265 1335 6405 2762 p 2 0 2326 1274 6562 2822 p 2 0 1663 1937 4290 2078 p 2 0 2059 1541 5720 2531 p 2 0 2578 1022 7327 3138 p 2 0 2350 1250 6856 2871 p 2 0 2806 794 8793 3400 p 2 0 2291 1309 6427 2761 p 2 0 2562 1038 7255 3079 p 2 0 2213 1387 6046 2712 p 2 0 2363 1237 6947 2905 p 2 0 2609 991 7426 3111 p 2 0 2298 1302 6439 2736 i 2 3600 0 0 151112 14844 p 2 0 3136 464 10647 3955 p 2 0 3461 139 21643 4491 p 2 5 3338 257 25401 4594 p 2 0 3450 150 21172 4664 p 2 0 3014 586 16255 3893 p 2 29 3446 125 36695 5116 p 2 1 3246 353 21084 4251 p 2 2 3373 225 22042 4510 p 2 6 2907 687 23926 3925 p 2 0 2291 1309 15056 2994 p 2 0 3138 462 20103 3983 p 2 4 2804 792 23684 3729 p 2 3 2531 1066 15748 3247 p 2 2 3245 353 20910 4272 p 2 38 3178 384 37534 4779 p 2 5 3405 190 24420 4679 p 2 0 3330 270 23375 4435 p 2 15 3341 244 36212 4898 p 2 1 3366 233 26525 4558 p 2 3 3282 315 22418 4346 p 2 9 3126 465 32470 4502 p 2 3 2963 634 20618 3916 p 2 4 3109 487 21050 4089 p 2 57 2968 575 41356 4677 p 2 2 3011 587 20386 4013 p 2 1 2883 716 19560 3764 p 2 7 3127 466 34804 4444 p 2 2 3183 415 21718 4318 p 2 1 2644 955 17984 3547 p 2 7 3381 212 39853 4947 p 2 1 3393 206 28061 4658 p 2 0 3361 239 23433 4535 p 2 52 3026 522 46427 4970 p 2 2 3052 546 24177 4223 p 2 1 3189 410 23912 4313 p 2 21 3290 289 42999 5082 p 2 0 3376 224 25702 4615 p 2 1 3126 473 22542 4189 p 2 13 3154 433 40900 4795 p 2 0 3402 198 25569 4752 p 2 0 3224 376 21814 4383 p 2 74 3406 120 54602 5820 p 2 1 3359 240 27604 4658 p 2 1 3359 240 23444 4602 p 2 5 3267 328 39954 4935 p 2 2 2899 699 21996 3948 p 2 1 3345 254 24958 4553 p 2 8 3188 404 40397 4817 p 2 0 3291 309 23567 4504 p 2 1 3219 380 23331 4362 p 2 61 3224 315 52271 5455 p 2 6 3314 280 24407 4650 p 2 2 2907 691 20282 4011 p 2 22 3432 146 48205 5544 p 2 0 3291 309 25850 4514 p 2 3 3243 354 21653 4440 p 2 15 3166 419 40052 4860 p 2 1 3086 513 23401 4221 p 2 0 3160 440 23536 4338 p 2 79 3248 273 52242 5607 p 2 2 3147 451 23027 4433 p 2 3 2993 604 21618 4130 p 2 8 3294 298 42121 4972 p 2 3 3342 255 23732 4720 p 2 3 2837 760 18954 3938 p 2 10 3498 92 49866 5583 p 2 1 3419 180 30296 4863 p 2 0 3453 147 26032 4863 p 2 58 3335 207 53901 5711 p 2 3 3213 384 25287 4493 p 2 3 3357 240 26332 4671 p 2 19 3113 468 44396 4952 p 2 1 3143 456 21345 4254 i 2 3600 0 0 135954 14459 p 2 0 3488 112 40676 5240 p 2 0 3520 80 29289 4917 p 2 6 3142 452 33184 4460 p 2 0 3382 218 22935 4495 p 2 0 2905 695 17669 3740 p 2 6 2765 829 27627 3827 p 2 0 2533 1067 14373 3304 p 2 0 2123 1477 13953 2826 p 2 1 2654 945 26017 3640 p 2 0 2264 1336 14561 2982 p 2 0 2317 1283 13370 2969 p 2 5 3073 522 29152 4194 p 2 0 2516 1084 16635 3235 p 2 0 3483 117 26660 4753 p 2 4 3235 361 32083 4587 p 2 0 3442 158 23600 4557 p 2 0 3414 186 23517 4430 p 2 1 3351 248 31469 4639 p 2 0 3365 235 20283 4398 p 2 0 3017 583 17308 3835 p 2 3 3287 310 30232 4490 p 2 0 3233 367 19377 4183 p 2 0 3158 442 18069 4067 p 2 1 2716 883 26581 3757 p 2 0 2870 730 18405 3683 p 2 0 3133 467 17012 4087 p 2 6 2891 703 28791 4150 p 2 0 3380 220 21995 4432 p 2 0 3404 196 22410 4469 p 2 4 3273 323 30452 4512 p 2 0 3059 541 16686 3943 p 2 0 2732 868 16177 3506 p 2 2 3270 328 30092 4459 p 2 0 3208 392 18592 4140 p 2 0 3127 473 17882 4043 p 2 3 2753 844 27389 3843 p 2 0 3008 592 18999 3837 p 2 0 3170 430 17877 4145 p 2 3 2911 686 29247 4129 p 2 0 3472 128 25765 4673 p 2 0 3368 232 22303 4416 p 2 2 2882 716 27829 3948 p 2 0 2642 958 15340 3394 p 2 0 3099 501 19308 4268 i 2 3600 0 0 135193 14245 p 2 3 3302 295 14473 4039 p 2 0 3425 175 18641 4321 p 2 0 2999 601 11116 3639 p 2 0 3397 203 19948 4487 p 2 0 2871 729 10577 3493 p 2 0 2737 863 9265 3233 p 2 0 2968 632 11719 3539 p 2 1 2983 616 11157 3613 p 2 0 3148 452 12766 3825 p 2 0 2278 1322 6334 2693 p 2 0 2921 679 10401 3522 p 2 0 2921 679 9843 3466 p 2 0 2868 732 9617 3447 p 2 0 2751 849 8918 3299 p 2 0 2722 878 8510 3261 p 2 0 3138 462 13022 3797 p 2 0 2745 855 8601 3237 p 2 0 3119 481 12095 3785 p 2 0 2940 660 10651 3505 p 2 0 2782 818 9759 3275 p 2 0 2541 1059 7759 2997 p 2 0 2244 1356 6302 2670 p 2 3 2312 1285 6814 2761 p 2 0 2484 1116 7167 2928 p 2 0 2334 1266 6758 2789 p 2 0 2351 1249 6495 2800 p 2 0 2284 1316 6188 2698 p 2 3 2829 768 9067 3438 p 2 0 2655 945 7875 3167 p 2 0 3220 380 14662 3928 p 2 0 2280 1320 6625 2660 p 2 0 2797 803 9534 3329 p 2 0 2975 625 11276 3549 p 2 0 1964 1636 5414 2347 p 2 1 2393 1206 7544 2799 p 2 0 2266 1334 6402 2678 p 2 0 2495 1105 7730 2942 p 2 0 2317 1283 6579 2740 p 2 0 2374 1226 6798 2787 p 2 0 2903 697 9273 3498 p 2 0 2423 1177 6554 2916 p 2 0 3196 404 14075 3922 p 2 0 2268 1332 6612 2663 p 2 3 2625 972 8487 3106 p 2 0 3005 595 11713 3575 p 2 0 2004 1596 5789 2382 p 2 0 2604 996 8659 3072 p 2 0 2445 1155 7427 2863 p 2 0 2446 1154 6981 2879 p 2 1 2320 1279 6937 2741 p 2 0 2413 1187 6895 2841 p 2 0 2682 918 8661 3195 p 2 0 2677 923 7737 3191 p 2 0 3059 541 11709 3728 p 2 9 3083 508 37209 4543 p 2 0 2844 756 10341 3486 p 2 0 2937 663 10281 3547 p 2 0 2328 1272 7558 2768 p 2 0 3008 592 34173 4341 p 2 0 2777 823 10797 3405 p 2 1 3048 551 35128 4391 p 2 0 2866 734 11634 3501 p 2 0 2714 886 9143 3283 p 2 0 3206 394 36737 4547 p 2 0 2993 607 12734 3589 p 2 0 3338 262 20345 4152 p 2 0 3152 448 13988 3826 p 2 0 3016 584 11243 3602 p 2 0 2722 878 8950 3223 p 2 0 2573 1027 7772 3037 p 2 0 2783 817 9525 3291 p 2 0 2678 922 8660 3162 p 2 0 2590 1010 9746 3069 p 2 0 2857 743 10323 3352 p 2 0 3161 439 15781 4049 i 2 3600 0 0 56850 12021 p 2 0 3515 85 14501 4511 p 2 0 3280 320 9145 3955 p 2 0 3070 530 7485 3640 p 2 0 2764 836 5915 3225 p 2 0 2631 969 5926 3105 p 2 0 2766 834 6339 3201 p 2 0 2503 1097 5294 2911 p 2 0 2484 1116 5546 2914 p 2 0 2571 1029 5509 3002 p 2 0 2396 1204 5071 2806 p 2 0 2613 987 5398 3001 p 2 0 2697 903 6062 3115 p 2 0 2409 1191 4926 2793 p 2 0 2691 909 6151 3155 p 2 0 2555 1045 5474 2995 p 2 0 2117 1483 4320 2528 p 2 0 2494 1106 5368 2914 p 2 0 2081 1519 4083 2490 p 2 0 2024 1576 4054 2398 p 2 0 2359 1241 4738 2744 p 2 0 2370 1230 5026 2789 p 2 0 2302 1298 4696 2689 p 2 0 2261 1339 4234 2617 p 2 0 2180 1420 4067 2556 p 2 0 2561 1039 5130 2980 p 2 0 2240 1360 5042 2660 p 2 0 3383 217 18126 4650 i 2 3600 0 0 130437 14095 p 2 0 3497 103 16643 4471 p 2 55 3428 117 54527 5917 p 2 0 3402 198 16220 4324 p 2 54 3030 516 50244 5215 p 2 0 2627 973 9162 3151 p 2 0 3158 442 12955 3809 p 2 0 2368 1232 8703 2867 p 2 71 3066 463 51708 5339 p 2 0 3276 324 12742 4088 p 2 0 3120 480 13940 3766 p 2 18 3184 398 44752 4882 p 2 0 2748 852 12043 3374 p 2 9 3414 177 47514 5239 p 2 0 3167 433 13809 3888 p 2 0 3193 407 12436 3880 p 2 72 3073 455 53588 5383 p 2 0 2441 1159 8490 2994 p 2 0 3138 462 14589 3889 p 2 0 2342 1258 8540 2844 p 2 54 3068 478 52521 5240 p 2 0 3243 357 16313 4048 p 2 0 3131 469 14143 3815 p 2 163 3291 146 62494 6342 p 2 0 3021 579 13733 3730 i 2 3600 0 0 130139 13658 p 2 0 3585 15 30374 4413 p 2 0 3540 60 24039 4270 p 2 0 3419 181 15261 4056 p 2 0 3165 435 12562 3639 p 2 0 3282 318 14246 3791 p 2 0 3106 494 12164 3537 p 2 0 2851 749 9410 3238 p 2 0 3175 425 11767 3738 p 2 0 2321 1279 6904 2741 p 2 0 3563 37 22213 4341 p 2 0 3345 255 14555 3875 p 2 0 3366 234 14792 3963 p 2 0 3302 298 13218 3832 p 2 0 3269 331 12960 3823 p 2 0 3202 398 11932 3737 p 2 0 3090 510 10993 3580 p 2 0 3101 499 10973 3588 p 2 0 3096 504 10743 3552 p 2 0 3278 322 12950 3803 p 2 0 3022 578 10722 3425 p 2 0 3455 145 17333 4053 p 2 0 3329 271 14704 3869 p 2 0 2933 667 10050 3350 p 2 0 2932 668 9825 3331 p 2 0 3005 595 10281 3437 p 2 0 2803 797 9186 3216 i 2 3600 0 0 134804 14184 p 2 0 3579 21 32070 4728 p 2 0 3151 449 13408 3696 p 2 59 3480 61 60613 5900 p 2 0 3435 165 19894 4392 p 2 159 3092 349 59083 6016 p 2 0 3239 361 14292 4019 p 2 0 3006 594 10463 3656 p 2 147 3097 356 57891 5989 p 2 0 3116 484 12388 3873 p 2 0 2424 1176 7822 2950 p 2 38 3353 209 55168 5514 p 2 0 3169 431 14211 3948 p 2 0 2421 1179 7737 2902 p 2 0 2711 889 10863 3263 p 2 41 3123 436 53419 5198 p 2 0 3301 299 16877 4177 p 2 200 3106 294 68458 6478 p 2 0 3393 207 19745 4388 p 2 0 3303 297 14692 4143 p 2 0 2865 735 10337 3418 p 2 214 2771 615 66051 6182 p 2 0 2910 690 12135 3670 p 2 416 2807 377 71968 7200 p 2 0 3124 476 15196 4115 i 2 3600 0 0 98507 12351 p 2 0 3573 27 26337 4630 p 2 0 3455 145 16830 4306 p 2 0 3479 121 14774 4420 p 2 0 3456 144 14740 4373 p 2 0 3559 41 19268 4506 p 2 0 3458 142 15284 4266 p 2 0 3164 436 10811 3744 p 2 0 3147 453 10813 3722 p 2 0 3217 383 11309 3828 p 2 0 3108 492 10457 3707 p 2 0 3082 518 9720 3635 p 2 0 3097 503 10365 3640 p 2 0 2987 613 9449 3501 p 2 0 2857 743 8681 3334 p 2 0 3257 343 11979 3833 p 2 0 2857 743 9193 3322 p 2 0 2228 1372 6045 2600 p 2 0 3027 573 10560 3508 p 2 0 2737 863 8337 3141 p 2 0 2844 756 8813 3239 p 2 0 2514 1086 7214 2892 p 2 0 1746 1854 4484 2092 p 2 0 2751 849 8382 3138 p 2 0 2771 829 8422 3174 p 2 0 2552 1048 7426 2940 p 2 0 2723 877 8140 3162 p 2 0 2877 723 8930 3293 i 2 3600 0 0 131077 14200 p 2 0 3463 137 16726 4460 p 2 0 3378 222 15249 4207 p 2 208 3169 223 68818 6711 p 2 0 3276 324 15425 4274 p 2 0 2986 614 10819 3619 p 2 0 2367 1233 7049 2862 p 2 425 2917 258 72703 7393 p 2 0 3220 380 14162 4185 p 2 0 3127 473 12860 3891 p 2 449 2774 377 71781 7194 p 2 0 3367 233 15288 4468 p 2 225 2950 425 67429 6554 p 2 0 3482 118 18783 4762 p 2 0 3295 305 13599 4176 p 2 227 3164 209 70083 6853 p 2 0 3127 473 13733 4060 p 2 0 3151 449 12910 3876 p 2 3 3167 430 45623 4921 p 2 0 2959 641 12494 3686 p 2 0 2936 664 10854 3587 p 2 0 2195 1405 7442 2664 p 2 4 2978 618 43646 4697 p 2 0 3196 404 14942 3976 p 2 8 3003 589 43891 4751 p 2 0 3301 299 14774 4182 i 2 3600 0 0 80501 13034 p 2 0 3395 205 14279 4351 p 2 0 2626 974 7396 3130 p 2 0 3239 361 12194 4004 p 2 0 2681 919 8103 3247 p 2 1 2913 686 9762 3529 p 2 0 2823 777 9142 3403 p 2 0 2697 903 7978 3252 p 2 1 2679 920 8715 3260 p 2 0 2879 721 9445 3497 p 2 0 2580 1020 8162 3093 p 2 0 3119 481 11772 3813 p 2 0 2799 801 9253 3411 p 2 0 2651 949 8223 3194 p 2 0 2636 964 8146 3173 p 2 0 2593 1007 7722 3096 p 2 1 2612 987 8362 3144 p 2 47 3516 37 32031 5859 p 2 24 3553 23 36724 6122 p 2 0 3189 411 11324 3937 p 2 42 3518 40 35808 5996 p 2 58 3521 21 38238 6148 p 2 58 3520 22 40453 6470 p 2 67 3516 17 42481 6308 p 2 53 3538 9 38375 6452 p 2 74 3507 19 39942 6385 p 2 67 3528 5 40749 6540 p 2 91 3482 27 42421 6492 p 2 60 3517 23 39735 6498 p 2 87 3494 19 43449 6421 p 2 152 3433 15 44728 6962 p 2 146 3433 21 44321 6650 p 2 137 3449 14 45603 6851 p 2 126 3449 25 42301 6326 p 2 123 3467 10 47286 7008 p 2 120 3476 4 50003 6504 p 2 107 3482 11 42690 6614 p 2 156 3423 21 45784 6555 p 2 135 3450 15 47506 6660 p 2 195 3385 20 41589 6219 p 2 204 3383 13 50049 6747 p 2 0 3454 146 19600 4419 p 2 0 3441 159 15139 4271 p 2 0 3363 237 13014 3948 p 2 0 3252 348 11930 3807 p 2 0 2498 1102 6383 2850 p 2 0 3241 359 11602 3812 p 2 0 3414 186 14107 4041 p 2 0 3186 414 10819 3673 p 2 0 2776 824 7595 3165 p 2 0 2808 792 7882 3250 p 2 0 3063 537 8989 3495 p 2 0 2759 841 7961 3199 p 2 0 2916 684 8204 3320 p 2 0 2633 967 7401 3033 p 2 0 2706 894 7168 3080 p 2 0 2674 926 7316 3079 p 2 0 2975 625 8516 3364 p 2 0 2777 823 8501 3153 p 2 0 3158 442 9920 3572 p 2 0 2712 888 7897 3085 p 2 0 2696 904 7418 3012 p 2 0 2510 1090 7136 2861 p 2 0 2369 1231 5525 2687 p 2 0 2650 950 7535 3024 p 2 0 2658 942 6541 2993 p 2 0 1704 1896 3991 2040 p 2 0 2747 853 6974 3090 p 2 0 2239 1361 5735 2618 p 2 0 2804 796 7566 3159 p 2 0 2310 1290 6010 2658 p 2 0 2248 1352 5188 2515 p 2 0 2681 919 8096 3034 p 2 0 2452 1148 6113 2747 p 2 0 2196 1404 5666 2537 p 2 0 2296 1304 5117 2605 p 2 0 2366 1234 6140 2734 p 2 0 2324 1276 5367 2679 p 2 0 1526 2074 3364 1882 p 2 0 2493 1107 5953 2803 p 2 0 1727 1873 4162 2105 i 2 3600 0 0 68387 12635 p 2 15 3427 158 18663 4860 p 2 0 2715 885 8545 3389 p 2 0 2467 1133 8179 3094 p 2 0 2303 1297 7177 2878 p 2 0 2156 1444 6604 2677 p 2 0 2137 1463 6282 2655 p 2 0 2075 1525 6264 2602 p 2 0 2010 1590 6079 2499 p 2 0 2162 1438 6406 2664 p 2 0 1923 1677 5614 2395 p 2 0 2157 1443 6020 2617 p 2 0 2271 1329 7109 2799 p 2 0 1959 1641 5693 2461 p 2 0 2394 1206 8111 3028 p 2 0 2204 1396 7080 2770 p 2 0 2147 1453 6083 2642 p 2 0 2148 1452 6518 2702 p 2 0 2150 1450 6365 2673 p 2 0 2196 1404 6779 2700 p 2 0 2080 1520 5953 2575 p 2 0 2037 1563 5795 2542 p 2 0 1886 1714 5600 2402 p 2 0 2026 1574 6172 2540 p 2 0 2172 1428 6867 2695 p 2 0 2019 1581 5674 2484 p 2 0 2266 1334 7390 2842 p 2 0 2203 1397 6678 2746 p 2 0 2144 1456 6625 2652 p 2 0 1986 1614 6037 2515 p 2 0 2046 1554 5869 2550 p 2 0 1939 1661 5677 2438 p 2 0 1885 1715 5394 2366 p 2 0 2067 1533 5547 2523 p 2 0 1972 1628 5715 2461 p 2 0 2016 1584 5839 2499 p 2 0 1520 2080 4282 1964 p 2 0 2119 1481 6061 2597 p 2 0 2337 1263 7776 2936 p 2 0 2264 1336 6520 2832 p 2 0 2319 1281 6524 2813 p 2 0 2199 1401 6387 2699 p 2 0 1841 1759 5213 2333 p 2 0 2082 1518 5829 2581 p 2 0 2046 1554 6061 2541 p 2 0 1955 1645 5494 2445 p 2 0 1735 1865 5103 2223 p 2 0 1905 1695 5602 2389 p 2 0 2001 1599 6205 2529 p 2 0 2056 1544 6318 2553 p 2 0 2274 1326 7904 2839 p 2 0 2251 1349 7217 2801 p 2 0 1973 1627 5956 2461 p 2 0 1956 1644 5716 2421 p 2 0 1829 1771 5039 2287 p 2 0 2003 1597 6176 2510 p 2 0 1859 1741 5525 2331 p 2 0 1836 1764 5495 2306 p 2 0 1899 1701 5435 2350 p 2 0 1779 1821 5204 2243 p 2 0 1910 1690 5670 2392 p 2 0 1829 1771 5302 2280 p 2 0 1605 1995 4789 2046 p 2 0 2028 1572 6517 2513 i 2 3600 0 0 118453 13512 p 2 0 3559 41 20199 4838 p 2 0 2583 1017 7682 3159 p 2 60 2814 726 21948 3991 p 2 0 3034 566 10308 3708 p 2 56 2837 707 21621 3993 p 2 0 2887 713 10320 3522 p 2 0 2872 728 9890 3505 p 2 0 2002 1598 5875 2470 p 2 53 3212 335 23621 4584 p 2 0 3104 496 10806 3997 p 2 0 3285 315 14486 4162 p 2 51 3164 385 24615 4413 p 2 0 3212 388 12836 4039 p 2 0 3009 591 10551 3685 p 2 28 2821 751 20817 3734 p 2 0 2841 759 9961 3432 p 2 3 2930 667 19686 3715 p 2 0 2775 825 9771 3369 p 2 0 2901 699 9666 3546 p 2 19 3152 429 21122 4259 p 2 0 2973 627 9692 3720 p 2 0 3359 241 14313 4314 p 2 0 2351 1249 7367 2877 p 2 30 2891 679 20574 3934 p 2 0 3084 516 11897 3808 p 2 0 2120 1480 6439 2579 p 2 35 2758 807 19030 3653 p 2 0 2780 820 9289 3342 p 2 0 2744 856 8946 3293 p 2 13 2729 858 16294 3489 p 2 0 2551 1049 7983 3072 p 2 12 2785 803 15578 3568 p 2 0 2745 855 9114 3322 p 2 0 3175 425 12096 3950 p 2 0 2235 1365 6370 2700 p 2 2 2893 705 11234 3628 p 2 0 3074 526 10747 3844 p 2 0 2812 788 9440 3438 p 2 1 2763 836 9941 3411 p 2 0 2659 941 8120 3231 p 2 0 2625 975 7864 3208 p 2 0 2766 834 9902 3461 p 2 0 2874 726 9010 3538 p 2 0 2678 922 8057 3309 p 2 0 3026 574 10386 3730 p 2 0 3229 371 13219 4073 p 2 0 2305 1295 7015 2781 p 2 0 2847 753 8865 3521 p 2 0 2856 744 9442 3463 p 2 0 2472 1128 7509 2964 p 2 0 2559 1041 7806 3098 p 2 0 2582 1018 7752 3147 p 2 0 2641 959 7853 3220 p 2 0 2602 998 7415 3150 p 2 0 2765 835 8442 3360 p 2 0 3021 579 10246 3704 p 2 0 2602 998 7832 3160 p 2 0 3162 438 11596 3901 p 2 0 2869 731 9446 3467 p 2 0 2541 1059 7447 3027 p 2 0 2786 814 8382 3342 p 2 0 2631 969 7926 3168 p 2 0 2723 877 8038 3267 p 2 0 2637 963 7976 3205 p 2 0 2574 1026 7550 3120 p 2 0 2546 1054 7333 3086 p 2 0 2450 1150 6938 2969 p 2 0 2808 792 8864 3384 p 2 0 2659 941 8069 3215 p 2 0 3263 337 14353 4105 p 2 0 3019 581 10637 3696 p 2 0 2780 820 9080 3368 p 2 0 2838 762 9251 3413 p 2 0 2725 875 8236 3297 p 2 0 2549 1051 7695 3047 p 2 0 2975 625 10404 3602 p 2 0 2794 806 8994 3398 p 2 0 2875 725 9365 3499 p 2 0 2755 845 8494 3324 p 2 0 3163 437 11166 3987 p 2 0 2838 762 8914 3494 p 2 0 3078 522 11031 3832 p 2 0 2745 855 8616 3343 p 2 0 3014 586 9861 3714 p 2 0 2979 621 10004 3632 p 2 0 2646 954 8045 3183 p 2 0 2417 1183 7220 2890 p 2 0 2423 1177 7091 2907 p 2 0 2351 1249 6647 2854 p 2 0 2468 1132 7101 2994 p 2 0 2670 930 8117 3230 p 2 0 2986 614 10063 3662 p 2 0 2590 1010 7429 3119 p 2 0 3054 546 11058 3774 p 2 0 2985 615 9991 3655 p 2 0 2434 1166 6907 2949 p 2 0 2882 718 9587 3489 p 2 0 2497 1103 7608 2996 p 2 0 2423 1177 7292 2918 p 2 0 2443 1157 7012 2967 p 2 0 2931 669 9546 3547 p 2 0 2857 743 9220 3466 p 2 0 2402 1198 6997 2907 p 2 0 2126 1474 5922 2613 p 2 0 2574 1026 7651 3118 p 2 0 2712 888 8176 3276 p 2 0 2959 641 10315 3587 p 2 0 2919 681 9414 3574 p 2 0 2746 854 8311 3330 p 2 0 2386 1214 6829 2903 p 2 0 2628 972 7680 3171 p 2 0 2641 959 7812 3197 p 2 0 2692 908 8342 3278 p 2 0 2495 1105 7455 3043 p 2 0 2426 1174 7208 2969 p 2 0 2405 1195 6722 2928 p 2 0 2858 742 9349 3519 p 2 0 2528 1072 7588 3056 p 2 0 2735 865 9171 3304 p 2 0 2569 1031 8046 3080 p 2 0 1847 1753 5239 2264 p 2 0 2791 809 8960 3341 p 2 0 2446 1154 7377 2928 p 2 0 2327 1273 6723 2810 p 2 0 2520 1080 7376 3029 p 2 0 2546 1054 7656 3053 p 2 0 2391 1209 6909 2886 p 2 0 2850 750 9061 3458 p 2 0 2485 1115 7441 3016 p 2 0 3264 336 13905 4101 p 2 0 2303 1297 7123 2764 p 2 0 2856 744 9891 3452 p 2 0 2522 1078 7717 3026 p 2 0 2689 911 8631 3223 p 2 0 2155 1445 6353 2599 p 2 0 2678 922 8169 3194 p 2 0 2724 876 8204 3292 p 2 0 2513 1087 7350 3049 p 2 0 2838 762 9375 3431 p 2 0 2987 613 9769 3728 p 2 0 2680 920 8165 3271 p 2 0 3169 431 12220 3969 p 2 0 2186 1414 6329 2649 p 2 0 2474 1126 7471 2978 p 2 0 2611 989 8332 3142 p 2 0 2392 1208 7301 2877 p 2 0 1990 1610 5594 2408 p 2 0 2551 1049 7952 3048 p 2 0 2675 925 7966 3222 p 2 0 2605 995 7774 3115 p 2 0 2491 1109 7432 3026 p 2 0 2730 870 8460 3306 p 2 0 2829 771 8729 3458 p 2 0 3093 507 11165 3829 p 2 0 2176 1424 6429 2632 p 2 0 2555 1045 7585 3075 p 2 0 2833 767 8858 3442 p 2 0 2831 769 9269 3429 p 2 0 2175 1425 6283 2632 p 2 0 2462 1138 7214 2938 p 2 0 2483 1117 7038 3002 p 2 0 2734 866 8335 3275 p 2 0 2554 1046 7472 3062 p 2 0 2960 640 10584 3619 p 2 0 2855 745 8701 3511 p 2 0 3152 448 11955 3945 p 2 0 2624 976 8187 3174 p 2 0 2701 899 7929 3296 p 2 0 2931 669 9683 3536 p 2 0 1831 1769 5052 2245 p 2 0 2428 1172 7291 2919 p 2 0 2464 1136 7492 2962 p 2 0 2635 965 8209 3177 p 2 0 2387 1213 7181 2865 p 2 0 2579 1021 7598 3091 p 2 0 2246 1354 6238 2738 p 2 0 2710 890 8188 3264 p 2 0 3237 363 13186 4055 p 2 0 2940 660 9668 3614 p 2 0 2875 725 9094 3532 p 2 0 2896 704 9789 3527 p 2 0 1867 1733 5175 2280 p 2 0 2766 834 8721 3395 p 2 0 2722 878 8205 3335 p 2 0 2671 929 7681 3225 p 2 0 2695 905 8001 3300 p 2 0 2582 1018 7392 3109 p 2 0 2718 882 8338 3294 p 2 0 2607 993 7777 3105 p 2 0 3172 428 12395 3916 p 2 0 2240 1360 6750 2725 p 2 0 2744 856 8454 3351 p 2 0 2566 1034 7656 3079 p 2 0 2615 985 7752 3138 p 2 0 2453 1147 7233 2964 p 2 0 2486 1114 7154 2978 p 2 0 2602 998 7698 3129 p 2 0 2510 1090 7163 3020 p 2 0 2547 1053 7530 3083 p 2 0 2867 733 9502 3486 p 2 0 2570 1030 7740 3108 p 2 0 3031 569 10666 3730 p 2 0 2299 1301 6952 2775 p 2 0 2557 1043 8053 3045 p 2 0 2571 1029 7890 3072 p 2 0 2419 1181 6998 2923 p 2 0 2107 1493 5704 2566 p 2 0 2575 1025 7642 3112 p 2 0 2562 1038 7514 3113 p 2 0 2452 1148 7017 2962 p 2 0 2685 915 8047 3231 p 2 0 2868 732 9267 3485 p 2 0 1816 1784 4923 2247 p 2 0 3270 330 13820 4072 p 2 0 2325 1275 6919 2799 p 2 0 2653 947 8583 3178 p 2 0 2791 809 9102 3349 p 2 0 2457 1143 7458 2939 p 2 0 2087 1513 6143 2528 p 2 0 2660 940 8167 3170 p 2 0 2613 987 7682 3126 p 2 0 2497 1103 7426 3032 p 2 0 2551 1049 7467 3061 p 2 0 2884 716 9061 3577 p 2 0 2782 818 8475 3386 p 2 0 3248 352 13405 4069 p 2 0 2933 667 9913 3567 p 2 0 2684 916 8565 3221 p 2 0 2836 764 9324 3422 p 2 0 2739 861 8917 3289 p 2 0 2554 1046 7805 3031 p 2 0 2455 1145 7616 2933 p 2 0 2534 1066 7558 3067 p 2 0 2858 742 9254 3430 p 2 0 2539 1061 7573 3068 p 2 0 3068 532 10555 3835 p 2 0 2755 845 8560 3389 p 2 0 3108 492 11281 3874 p 2 0 2975 625 10405 3662 p 2 0 2654 946 8267 3212 p 2 0 2948 652 10408 3569 p 2 0 2621 979 8236 3156 p 2 0 2673 927 8424 3193 p 2 0 2632 968 8409 3139 p 2 0 1791 1809 4938 2196 p 2 0 2470 1130 7171 2960 p 2 0 2299 1301 6488 2799 p 2 0 2893 707 9423 3540 p 2 0 2547 1053 7482 3101 p 2 0 3102 498 11338 3823 p 2 0 2729 871 8545 3298 p 2 0 2754 846 8321 3346 i 2 3600 0 0 113472 13647 p 2 0 3514 86 25181 4717 p 2 0 2880 720 10013 3475 p 2 0 3237 363 14456 4123 p 2 0 3026 574 10893 3690 p 2 0 3071 529 12224 3805 p 2 0 2817 783 9706 3418 p 2 0 3158 442 12263 3923 p 2 0 3033 567 11936 3777 p 2 0 3287 313 15132 4162 p 2 0 3008 592 12035 3766 p 2 0 2811 789 9979 3405 p 2 0 2925 675 10664 3610 p 2 0 2852 748 10018 3482 p 2 0 2880 720 10504 3511 p 2 0 2519 1081 8096 3066 p 2 0 2815 785 9625 3430 p 2 0 1890 1710 5384 2304 p 2 0 2620 980 8539 3148 p 2 0 3036 564 11521 3688 p 2 0 2654 946 9359 3198 p 2 0 3026 574 11570 3693 p 2 0 2919 681 10815 3519 p 2 0 2621 979 8799 3113 p 2 0 2704 896 9481 3217 p 2 0 2499 1101 7876 2976 p 2 0 2873 727 10655 3453 p 2 0 2738 862 9122 3310 p 2 0 2586 1014 8598 3128 p 2 0 1609 1991 4473 2008 p 2 0 2515 1085 8035 3008 p 2 0 2800 800 9506 3364 p 2 0 2544 1056 7688 3121 p 2 0 3227 373 15890 4084 p 2 0 3237 363 19464 4538 i 2 3600 0 0 133421 13362 p 2 0 3502 98 18314 4445 p 2 0 3137 463 11943 3761 p 2 0 3438 162 17686 4284 p 2 0 3113 487 11803 3731 p 2 0 3065 535 11676 3661 p 2 0 3311 289 13793 4017 p 2 0 2620 980 9153 3116 p 2 0 3223 377 13142 3968 p 2 0 2691 909 9546 3223 p 2 0 2901 699 10673 3396 p 2 0 3251 349 14886 3910 p 2 0 3461 139 16759 4391 p 2 0 3024 576 10836 3702 p 2 0 3333 267 14429 4108 p 2 0 3262 338 13089 3962 p 2 0 3215 385 12532 3883 p 2 0 3148 452 11819 3755 p 2 0 3132 468 12025 3820 p 2 0 3258 342 13403 3951 p 2 0 3299 301 14678 4035 p 2 0 3009 591 11406 3583 p 2 0 3309 291 15004 4066 p 2 0 3229 371 13291 3955 p 2 0 2883 717 9622 3500 p 2 0 2988 612 10961 3564 p 2 0 2920 680 10629 3446 p 2 0 2787 813 9666 3311 p 2 0 2837 763 9747 3357 p 2 0 2860 740 9899 3383 p 2 0 3098 502 12003 3651 p 2 0 2961 639 10544 3536 p 2 0 3209 391 11831 3978 p 2 0 3038 562 10922 3671 p 2 0 2715 885 9419 3181 p 2 0 3320 280 15279 3952 p 2 0 2991 609 11239 3511 p 2 0 2860 740 9964 3342 p 2 0 3004 596 11122 3573 p 2 0 2955 645 10504 3529 p 2 0 2996 604 11037 3544 p 2 0 2854 746 9859 3385 p 2 0 2877 723 9770 3412 p 2 0 3041 559 11232 3647 p 2 0 3190 410 11768 3887 p 2 0 2857 743 9326 3397 p 2 0 2745 855 9674 3219 p 2 0 3296 304 14945 3953 p 2 0 3063 537 11955 3584 p 2 0 3233 367 12984 3905 p 2 0 3162 438 12767 3782 p 2 0 3022 578 11264 3560 p 2 0 2792 808 9609 3310 p 2 0 2762 838 9754 3305 p 2 0 2698 902 8998 3217 p 2 0 2846 754 10071 3423 p 2 0 3087 513 11221 3793 p 2 0 2716 884 8861 3260 p 2 0 2750 850 9624 3235 p 2 0 3320 280 14961 4027 p 2 0 3154 446 12863 3762 p 2 0 3125 475 12180 3725 p 2 0 3165 435 12841 3759 p 2 0 2948 652 11003 3449 p 2 0 2858 742 10370 3355 p 2 0 2891 709 10116 3410 p 2 0 3000 600 10913 3532 p 2 0 2891 709 10194 3390 p 2 0 3202 398 12890 3913 p 2 0 2931 669 10006 3549 p 2 0 2551 1049 8545 3020 p 2 0 3219 381 13241 3839 p 2 0 2909 691 10398 3512 p 2 0 3169 431 12421 3840 p 2 0 2861 739 9941 3409 p 2 0 2952 648 10149 3531 p 2 0 2961 639 10558 3543 p 2 0 2786 814 9179 3323 p 2 0 2863 737 9853 3415 p 2 0 2744 856 9396 3317 p 2 0 3102 498 12047 3749 p 2 0 2340 1260 7632 2771 p 2 0 2910 690 11072 3416 p 2 0 3218 382 13034 3885 p 2 0 2796 804 9506 3313 p 2 0 2928 672 10162 3511 p 2 0 2968 632 10516 3561 p 2 0 2868 732 9788 3465 p 2 0 2899 701 10353 3483 p 2 0 2825 775 9653 3404 p 2 0 2852 748 9789 3432 p 2 0 2785 815 9343 3342 p 2 0 3105 495 11035 3777 p 2 0 3022 578 11053 3602 p 2 0 2804 796 10470 3291 p 2 0 3380 220 15873 4164 p 2 0 3020 580 11499 3593 p 2 0 2771 829 9979 3259 p 2 0 2845 755 9915 3354 p 2 0 2875 725 10201 3395 p 2 0 2855 745 9823 3351 p 2 0 2801 799 9271 3301 p 2 0 2833 767 9708 3353 p 2 0 2987 613 10647 3525 p 2 0 3133 467 11320 3802 p 2 0 2771 829 9130 3346 p 2 0 2680 920 9108 3142 p 2 0 3390 210 17099 4129 p 2 0 3146 454 12849 3792 p 2 0 3063 537 11498 3648 p 2 0 2841 759 9783 3369 p 2 0 2812 788 9884 3302 p 2 0 2602 998 8573 3062 p 2 0 2810 790 9894 3338 p 2 0 2760 840 9404 3270 p 2 0 2688 912 9089 3193 p 2 0 3153 447 11790 3870 p 2 0 2805 795 9255 3403 p 2 0 2690 910 9155 3146 p 2 0 3267 333 14205 3878 p 2 0 3158 442 13424 3740 p 2 0 3200 400 13235 3871 p 2 0 3160 440 12977 3776 p 2 0 2969 631 11252 3484 p 2 0 2816 784 9983 3332 p 2 0 2848 752 9984 3378 p 2 0 2818 782 9542 3313 p 2 0 1922 1678 5703 2312 p 2 0 2582 1018 10261 3075 p 2 0 3060 540 10894 3712 p 2 0 3116 484 12519 3752 p 2 0 3339 261 16209 4083 p 2 0 3281 319 14228 4019 p 2 0 3186 414 14741 3854 p 2 0 2829 771 10340 3310 p 2 0 2836 764 10217 3288 p 2 0 2889 711 10397 3368 p 2 0 3043 557 11343 3538 p 2 0 2805 795 9466 3296 p 2 0 2725 875 9324 3188 p 2 0 2969 631 11088 3520 p 2 0 2927 673 9990 3511 p 2 0 2783 817 10502 3275 p 2 0 3346 254 16439 4124 p 2 0 3136 464 12473 3755 p 2 0 3376 224 16962 4127 p 2 0 3186 414 13302 3851 p 2 0 3140 460 12776 3775 p 2 0 3227 373 13597 3835 p 2 0 2851 749 10363 3342 p 2 0 3143 457 19079 4248 i 2 3600 0 0 108851 13025 p 2 0 2850 750 9714 3484 p 2 0 3420 180 15786 4375 p 2 0 3328 272 15871 4238 p 2 0 3214 386 13935 4004 p 2 0 2970 630 10618 3619 p 2 0 3122 478 12332 3859 p 2 0 2186 1414 6753 2663 p 2 0 2572 1028 8376 3076 p 2 0 2835 765 9449 3389 p 2 0 3044 556 11499 3721 p 2 0 3067 533 11319 3747 p 2 0 2957 643 10336 3585 p 2 0 3112 488 12135 3833 p 2 0 3155 445 12771 3877 p 2 0 3236 364 13294 4025 p 2 0 2314 1286 7423 2780 p 2 0 3002 598 11029 3581 p 2 0 2882 718 10260 3435 p 2 0 2848 752 10007 3412 p 2 0 2708 892 9520 3247 p 2 0 2668 932 8612 3206 p 2 0 2426 1174 7777 2958 p 2 0 2710 890 8873 3200 p 2 0 2699 901 9049 3237 p 2 0 2866 734 9952 3482 p 2 0 2482 1118 7735 3002 p 2 0 3256 344 14695 4057 p 2 0 2338 1262 7436 2804 p 2 0 2800 800 9594 3382 p 2 0 2899 701 10350 3473 p 2 0 2946 654 10606 3510 p 2 0 2741 859 9635 3263 p 2 0 3065 535 11714 3662 p 2 0 2872 728 10160 3438 p 2 0 2638 962 8761 3142 p 2 0 2757 843 9137 3301 p 2 0 2685 915 8904 3205 i 2 3600 0 0 106300 13127 p 2 0 3328 272 14254 4303 p 2 0 2173 1427 6939 2693 p 2 17 3369 214 42684 5203 p 2 0 3333 267 16003 4285 p 2 0 2635 965 9783 3187 p 2 1 3149 450 32333 4482 p 2 0 3360 240 17455 4227 p 2 4 3215 381 34538 4650 p 2 0 3234 366 14546 4072 p 2 0 2991 609 11372 3639 p 2 13 3120 467 35769 4544 p 2 0 3011 589 12301 3682 p 2 0 3328 272 15250 4207 p 2 0 2429 1171 8481 2923 p 2 1 3166 433 35343 4568 p 2 0 3176 424 13812 3921 p 2 0 2399 1201 8981 2933 p 2 1 3024 575 39780 4483 p 2 0 3084 516 13075 3778 p 2 0 2832 768 11251 3412 p 2 0 2704 896 10026 3265 p 2 0 2680 920 9604 3223 p 2 0 2519 1081 7968 2976 p 2 0 3003 597 10449 3716 p 2 0 3361 239 16322 4281 p 2 0 3073 527 12190 3803 p 2 0 2731 869 9547 3296 p 2 0 2802 798 9399 3345 p 2 0 2896 704 10227 3468 p 2 2 2666 932 9570 3204 p 2 0 2605 995 8648 3141 p 2 0 2685 915 9626 3261 p 2 0 2917 683 10607 3535 p 2 0 2722 878 9402 3298 p 2 2 2834 764 10612 3469 p 2 0 2560 1040 8203 3079 p 2 0 3152 448 12401 3881 p 2 0 2137 1463 6881 2576 p 2 2 2779 819 10042 3342 p 2 0 2567 1033 8362 3073 p 2 0 2682 918 9230 3205 p 2 1 2554 1045 8860 3098 p 2 0 2695 905 8778 3239 p 2 2 2533 1065 8367 3082 p 2 0 2456 1144 7451 2929 p 2 0 2566 1034 8579 3085 p 2 0 2487 1113 7966 3002 p 2 0 2701 899 9281 3285 p 2 0 3287 313 15298 4141 p 2 0 2289 1311 7401 2768 p 2 0 2855 745 10463 3422 p 2 0 2832 768 9818 3373 p 2 0 2748 852 9264 3298 p 2 2 2327 1271 7288 2792 p 2 0 2679 921 9214 3193 p 2 2 2786 812 10244 3351 p 2 0 2658 942 8546 3189 p 2 0 2587 1013 8173 3107 p 2 0 2624 976 8652 3171 p 2 0 2947 653 10832 3644 p 2 0 2699 901 8802 3291 p 2 0 2885 715 10240 3489 p 2 1 2696 903 9295 3229 p 2 0 2926 674 10102 3542 p 2 0 2891 709 10313 3493 p 2 2 2314 1284 7525 2786 p 2 0 2630 970 8385 3138 p 2 2 2634 964 8867 3199 p 2 0 2571 1029 8082 3087 p 2 0 2423 1177 7518 2937 p 2 2 2943 655 11347 3610 p 2 0 2564 1036 8080 3094 p 2 0 3164 436 12143 3873 p 2 0 2046 1554 6226 2498 p 2 0 2604 996 8745 3120 p 2 0 2377 1223 7395 2854 p 2 0 2703 897 9342 3209 p 2 2 2529 1069 8422 3073 p 2 0 2693 907 8602 3267 p 2 2 2487 1111 8534 3064 p 2 0 2430 1170 7436 2910 p 2 0 2563 1037 8159 3082 p 2 0 2736 864 9628 3294 p 2 0 2474 1126 8141 2975 p 2 0 2993 607 11180 3649 p 2 0 2041 1559 6679 2504 p 2 57 2952 591 49564 5006 p 2 0 2989 611 12689 3719 p 2 0 2315 1285 8256 2845 p 2 63 2877 660 45186 4940 p 2 0 2811 789 10599 3522 p 2 44 3069 487 45438 4977 p 2 0 2878 722 11202 3590 p 2 0 2782 818 9629 3397 p 2 54 3056 490 45094 5194 p 2 0 3070 530 13003 3908 p 2 0 3417 183 16749 4480 p 2 0 2548 1052 8619 3088 p 2 0 2935 665 11670 3587 p 2 0 3070 530 12311 3711 p 2 0 2762 838 9282 3293 p 2 0 2762 838 9380 3299 p 2 0 2614 986 8355 3159 p 2 1 2712 887 9342 3292 p 2 0 2666 934 8620 3188 p 2 0 2708 892 9023 3276 p 2 4 2914 682 10918 3577 p 2 0 2597 1003 8471 3146 p 2 0 3102 498 11756 3804 p 2 0 2302 1298 7177 2745 p 2 0 2836 764 10661 3467 p 2 0 2659 941 8930 3192 p 2 0 2650 950 8531 3148 p 2 0 2166 1434 6760 2622 p 2 0 2692 908 8740 3203 p 2 0 2566 1034 8337 3082 p 2 0 2496 1104 7713 2978 p 2 0 2400 1200 7171 2898 p 2 0 2791 809 9322 3365 p 2 0 2561 1039 8102 3071 p 2 0 3250 350 14311 4051 p 2 0 2215 1385 7030 2691 p 2 1 2777 822 10226 3380 p 2 0 2699 901 9284 3262 p 2 0 2720 880 9280 3247 p 2 0 2703 897 9828 3265 p 2 0 2618 982 8619 3124 p 2 0 2637 963 8720 3144 p 2 1 2541 1058 8696 3050 p 2 0 2474 1126 7990 2972 p 2 0 2855 745 9836 3514 p 2 0 2877 723 9624 3501 p 2 0 3126 474 12403 3898 p 2 0 2958 642 10793 3601 p 2 0 2925 675 10915 3512 p 2 0 2815 785 9860 3373 p 2 0 1807 1793 5405 2235 p 2 0 2448 1152 8171 2937 p 2 0 2444 1156 7719 2911 p 2 0 2475 1125 7572 2984 p 2 0 2569 1031 8672 3084 p 2 0 2555 1045 8534 3054 p 2 0 2731 869 9394 3314 p 2 0 2437 1163 7736 2947 p 2 0 3012 588 11054 3662 p 2 0 2657 943 8843 3235 p 2 0 2727 873 9001 3223 p 2 0 2806 794 9954 3337 p 2 0 1933 1667 5511 2348 p 2 0 2558 1042 8593 3056 p 2 0 2664 936 8205 3184 p 2 4 2529 1067 8545 3087 p 2 0 2458 1142 7451 2954 p 2 0 2601 999 8026 3100 p 2 1 2720 879 9398 3294 p 2 0 2473 1127 7556 2974 p 2 0 3077 523 11575 3774 p 2 0 2082 1518 6166 2505 p 2 4 2349 1247 7890 2859 p 2 0 2433 1167 7791 2922 p 2 0 2649 951 8605 3147 p 2 0 2507 1093 8273 3020 p 2 0 2548 1052 8079 3082 p 2 0 2477 1123 7888 2984 p 2 4 2446 1150 8208 2960 p 2 0 2354 1246 7277 2817 p 2 0 2537 1063 8118 3070 p 2 0 2499 1101 7996 3012 p 2 0 3072 528 12033 3764 p 2 0 2630 970 9058 3189 p 2 0 2583 1017 8740 3085 p 2 0 2487 1113 7752 2960 p 2 0 1676 1924 4971 2092 p 2 4 2520 1076 8911 3059 p 2 0 2579 1021 8265 3129 p 2 0 2578 1022 8734 3167 p 2 0 2449 1151 7790 2957 p 2 0 2551 1049 7937 3071 p 2 0 2762 838 9824 3362 p 2 0 2446 1154 7779 2952 p 2 0 3029 571 11238 3658 p 2 0 2123 1477 6099 2534 p 2 1 2506 1093 8131 3050 p 2 0 2815 785 9879 3387 p 2 0 1758 1842 5289 2182 p 2 4 2449 1147 8582 2952 p 2 0 2724 876 8832 3265 p 2 0 2626 974 8559 3188 p 2 2 2469 1129 8319 2995 p 2 0 2550 1050 8228 3059 p 2 1 2681 918 9483 3249 p 2 0 2424 1176 7401 2915 p 2 0 3058 542 11518 3725 p 2 0 2123 1477 6515 2553 p 2 0 2654 946 9052 3158 p 2 0 2778 822 9911 3324 p 2 0 1731 1869 5114 2146 p 2 1 1983 1616 6160 2429 p 2 0 2616 984 8495 3126 p 2 0 2711 889 9217 3245 p 2 1 2602 997 8810 3174 p 2 0 2495 1105 7567 2995 p 2 0 2249 1351 6500 2721 i 2 3600 0 0 112726 13622 p 2 0 3440 160 16549 4389 p 2 0 3279 321 13519 4093 p 2 0 2970 630 10251 3628 p 2 0 2950 650 10253 3657 p 2 0 3037 563 11016 3717 p 2 0 2855 745 10357 3452 p 2 0 2897 703 9737 3513 p 2 0 2685 915 9184 3294 p 2 0 3016 584 11722 3622 p 2 0 2911 689 10611 3528 p 2 0 2976 624 11017 3669 p 2 0 2611 989 8710 3164 p 2 0 2285 1315 6969 2748 p 2 0 2909 691 11695 3532 p 2 0 2590 1010 8639 3121 p 2 0 2851 749 10472 3419 p 2 0 2604 996 8623 3100 p 2 0 2635 965 8482 3156 p 2 0 2587 1013 8438 3127 p 2 0 2520 1080 7950 3054 p 2 0 2665 935 8287 3193 p 2 0 1595 2005 4304 2004 p 2 0 1876 1724 5439 2315 p 2 0 2735 865 8862 3268 p 2 0 2419 1181 7606 2910 p 2 0 2896 704 11181 3487 p 2 0 2453 1147 7953 2926 p 2 0 2866 734 9960 3459 p 2 0 2606 994 8302 3093 p 2 0 2403 1197 7384 2856 p 2 0 2190 1410 6276 2641 p 2 0 2354 1246 7298 2845 p 2 0 2210 1390 6586 2677 p 2 0 2478 1122 8005 2995 p 2 0 2604 996 8086 3134 p 2 0 2713 887 8691 3331 p 2 0 2142 1458 6199 2578 p 2 0 2758 842 9275 3287 p 2 0 2497 1103 8173 2964 p 2 0 2591 1009 8249 3045 p 2 0 2514 1086 8154 3006 p 2 0 2538 1062 8029 3016 p 2 0 2524 1076 7823 3030 p 2 0 2410 1190 7772 2930 p 2 0 2511 1089 7774 2983 p 2 0 2410 1190 8055 2915 p 2 0 2648 952 8620 3194 p 2 0 2326 1274 7114 2805 p 2 0 2081 1519 6038 2492 p 2 0 2789 811 9983 3342 p 2 0 2553 1047 8266 3036 p 2 0 2820 780 9341 3397 p 2 0 2703 897 9371 3281 p 2 0 2458 1142 7860 2929 p 2 0 2310 1290 7038 2761 p 2 0 2303 1297 6781 2779 p 2 0 2471 1129 7717 2949 p 2 0 2367 1233 7587 2859 p 2 0 2608 992 8601 3167 p 2 0 2205 1395 6603 2675 p 2 0 2980 620 11165 3653 p 2 0 2822 778 9328 3440 p 2 0 2423 1177 7118 2873 p 2 0 2021 1579 5805 2451 p 2 0 2520 1080 8199 2995 p 2 0 2415 1185 7584 2873 p 2 0 2565 1035 7817 3063 p 2 0 2334 1266 7200 2823 p 2 0 2250 1350 6755 2690 p 2 0 2443 1157 7595 2928 p 2 0 2567 1033 8105 3070 p 2 0 2460 1140 8095 2966 p 2 0 3020 580 11643 3687 p 2 0 2694 906 9089 3258 p 2 0 2474 1126 8008 2951 p 2 0 2867 733 33047 3979 p 2 0 2706 894 12756 3258 p 2 1 3004 595 33042 4166 p 2 0 2951 649 14447 3579 p 2 0 3012 588 32515 4173 p 2 0 2752 848 10590 3335 p 2 0 2115 1485 7582 2556 p 2 1 2796 803 30289 3813 p 2 0 2960 640 12311 3685 p 2 0 2783 817 10176 3369 p 2 1 3185 414 15050 4015 p 2 0 3000 600 11670 3677 p 2 1 2951 648 11137 3590 p 2 0 2674 926 9205 3191 p 2 0 2811 789 9594 3408 p 2 1 2716 883 8758 3304 p 2 0 2752 848 9182 3349 p 2 0 2603 997 8037 3131 p 2 1 2704 895 9238 3289 p 2 0 2904 696 9926 3520 p 2 0 2512 1088 8010 3014 p 2 0 2204 1396 6548 2627 p 2 0 2722 878 10312 3278 p 2 0 2383 1217 7877 2868 p 2 0 2434 1166 7656 2873 p 2 1 2567 1032 8232 3039 p 2 0 2483 1117 7864 2945 p 2 0 2465 1135 7375 2933 p 2 0 2515 1085 7739 3015 p 2 0 2585 1015 7983 3064 p 2 0 2539 1061 8009 3019 p 2 0 2245 1355 6885 2723 p 2 0 2624 976 8621 3171 p 2 0 2512 1088 7575 2996 p 2 1 2929 670 12003 3560 p 2 0 2952 648 11306 3538 p 2 0 2747 853 9570 3285 p 2 1 2529 1070 8407 3026 p 2 0 2487 1113 7971 2989 p 2 0 2555 1045 8165 3047 p 2 1 2604 995 8785 3133 p 2 0 2727 873 9109 3282 p 2 0 1735 1865 5104 2151 p 2 0 1955 1645 5810 2370 p 2 0 2708 892 8466 3268 p 2 0 2861 739 9622 3438 p 2 0 2820 780 10180 3376 p 2 0 2883 717 9857 3477 p 2 0 2708 892 9308 3265 p 2 0 2309 1291 7296 2776 p 2 0 2482 1118 7653 2962 p 2 1 2271 1328 6792 2762 p 2 0 2517 1083 7708 3006 p 2 0 2329 1271 6716 2792 p 2 0 1479 2121 3972 1888 p 2 1 2273 1326 6794 2726 p 2 0 2668 932 8625 3198 p 2 0 2614 986 8596 3135 p 2 0 2812 788 10260 3354 p 2 0 2514 1086 7952 2979 p 2 1 2785 814 10210 3338 p 2 0 2542 1058 8538 3057 p 2 0 2624 976 8531 3153 p 2 0 2404 1196 7229 2870 p 2 1 2450 1149 7600 2949 p 2 0 2476 1124 7478 2950 p 2 0 2101 1499 6279 2567 p 2 0 2647 953 8521 3143 p 2 0 2328 1272 6925 2795 p 2 0 2117 1483 6016 2530 p 2 1 2800 799 9827 3348 p 2 0 2463 1137 7904 2933 p 2 0 2839 761 9096 3413 p 2 1 2785 814 8817 3360 p 2 0 2559 1041 7958 3061 p 2 1 2378 1221 6990 2852 p 2 0 2443 1157 7304 2927 p 2 0 2412 1188 7062 2899 p 2 1 2310 1289 7195 2799 p 2 0 2648 952 8165 3152 p 2 0 2568 1032 8075 3070 p 2 0 2161 1439 6153 2583 p 2 0 2889 711 10253 3499 p 2 0 2588 1012 8466 3089 p 2 0 2403 1197 7685 2896 p 2 1 2520 1079 8182 3027 p 2 0 2426 1174 7899 2908 p 2 0 2286 1314 6857 2759 p 2 1 2152 1447 6773 2637 p 2 0 2246 1354 6605 2708 p 2 0 2182 1418 6443 2619 p 2 0 2549 1051 8043 3051 p 2 0 2275 1325 6727 2742 p 2 0 2199 1401 6892 2635 p 2 0 2815 785 10404 3389 p 2 0 2530 1070 8659 3055 i 2 3600 0 0 84187 13359 p 2 0 2904 696 10534 3637 p 2 361 3005 234 57932 7004 p 2 0 3356 244 18266 4777 p 2 336 3042 222 59642 7098 p 2 0 3027 573 13791 4218 p 2 559 2413 628 61019 7122 p 2 378 2927 295 65228 7478 p 2 0 2765 835 10752 3738 p 2 0 2735 865 8978 3607 p 2 0 2329 1271 7449 2892 p 2 1 3056 543 27464 4395 p 2 0 3076 524 11697 3940 p 2 0 2082 1518 6635 2617 p 2 0 2834 766 27084 4100 p 2 0 2952 648 11191 3780 p 2 1 2837 762 26982 4126 p 2 0 2712 888 10040 3437 p 2 0 2461 1139 7809 3072 p 2 0 2777 823 10203 3483 p 2 0 1958 1642 5721 2452 p 2 0 3047 553 10927 3795 p 2 0 2683 917 8286 3288 p 2 0 2207 1393 6743 2725 p 2 0 1729 1871 4659 2179 p 2 0 2523 1077 7142 3074 p 2 0 2479 1121 7244 2997 p 2 0 2207 1393 6414 2689 i 2 3600 0 0 67070 12608 p 2 0 3286 314 14664 4332 p 2 1073 2527 0 87934 11870 p 2 71 3490 39 55806 7050 p 2 73 3487 40 50051 6893 p 2 66 3481 53 47947 6624 p 2 52 3466 82 50671 6696 p 2 61 3472 67 55166 7053 p 2 37 3514 49 53121 6586 p 2 37 3515 48 55609 6830 p 2 43 3510 47 56176 6844 p 2 12 3542 46 53917 6717 p 2 29 3502 69 53992 6471 p 2 68 3470 62 52687 6795 p 2 40 3494 66 51167 6536 p 2 27 3527 46 49620 6487 p 2 42 3476 82 50707 6699 p 2 43 3521 36 49110 6739 p 2 39 3497 64 48450 6810 p 2 35 3521 44 52264 6815 p 2 39 3502 59 51201 6533 p 2 39 3523 38 54229 6662 p 2 37 3487 76 57119 6929 p 2 42 3516 42 61189 6824 p 2 25 3492 83 59823 6673 p 2 33 3495 72 57783 6749 p 2 42 3528 30 54502 6642 p 2 37 3506 57 53897 6638 p 2 15 3508 77 56504 6604 p 2 23 3508 69 54040 6544 p 2 36 3523 41 57212 6694 p 2 46 3511 43 61949 6689 p 2 27 3557 16 59370 6544 p 2 35 3544 21 63778 6652 p 2 42 3541 17 61021 6793 p 2 27 3545 28 63102 6766 p 2 30 3536 34 58695 6691 p 2 19 3555 26 57822 6589 p 2 8 3570 22 57027 6681 p 2 9 3565 26 59542 6579 p 2 33 3551 16 61028 6779 p 2 31 3537 32 62031 6796 p 2 49 3529 22 62300 6888 p 2 36 3536 28 63597 6815 p 2 14 3552 34 57738 6629 p 2 24 3554 22 60034 6670 p 2 26 3549 25 60058 6687 p 2 25 3564 11 67771 6752 p 2 22 3563 15 63277 6702 p 2 20 3577 3 60294 6539 p 2 18 3575 7 62146 6609 p 2 24 3569 7 61613 6482 p 2 23 3568 9 62334 6757 p 2 36 3550 14 63372 6512 p 2 23 3533 44 68696 6818 p 2 26 3543 31 65172 6618 p 2 22 3545 33 64849 6651 p 2 26 3524 50 61166 6526 p 2 20 3517 63 64181 6634 p 2 22 3521 57 63533 6510 p 2 22 3492 86 61689 6562 p 2 11 3507 82 56672 6258 p 2 12 3490 98 59932 6331 p 2 4 3527 69 60300 6252 p 2 4 3509 87 54707 6247 i 2 3600 0 0 132192 14113 p 2 0 3243 357 15827 3978 p 2 0 2648 952 9221 3239 p 2 0 3201 399 12094 3947 p 2 0 2592 1008 7722 3089 p 2 0 3016 584 10605 3665 p 2 0 3222 378 12659 3981 p 2 1 3086 513 12796 3832 p 2 0 3114 486 11147 3824 p 2 0 3013 587 10516 3695 p 2 0 3246 354 13390 4027 p 2 0 3077 523 11301 3724 p 2 0 3359 241 16438 4284 p 2 0 2588 1012 8374 3102 p 2 3 2994 603 11946 3707 p 2 0 2211 1389 6624 2651 p 2 0 3067 533 11038 3694 p 2 0 2880 720 9934 3434 p 2 0 2687 913 8283 3202 p 2 2 2876 722 11045 3447 p 2 0 2751 849 8599 3263 p 2 0 2676 924 8321 3208 p 2 0 3158 442 11320 3950 p 2 0 2868 732 9434 3491 p 2 0 3394 206 16676 4332 p 2 0 2606 994 8565 3090 p 2 3 3136 461 12936 3862 p 2 0 2853 747 9854 3426 p 2 0 2814 786 9153 3386 p 2 0 2834 766 9661 3386 p 2 0 2642 958 8440 3151 p 2 0 2686 914 8643 3245 p 2 0 2515 1085 7827 3028 p 2 0 2862 738 9363 3435 p 2 0 3198 402 11464 3995 p 2 0 2902 698 9262 3586 p 2 0 3413 187 16069 4371 p 2 0 2436 1164 7666 2902 p 2 0 2866 734 10026 3414 p 2 0 3138 462 11610 3868 p 2 0 3089 511 11553 3756 p 2 0 2945 655 10491 3552 p 2 0 2578 1022 8241 3094 p 2 0 2624 976 8361 3156 p 2 0 2583 1017 7946 3085 p 2 0 2493 1107 7436 2965 p 2 0 2991 609 10212 3670 p 2 0 2876 724 9076 3514 p 2 0 3362 238 15566 4251 p 2 0 3225 375 13043 3960 p 2 0 3092 508 11872 3826 p 2 0 3018 582 11018 3659 p 2 0 2001 1599 5743 2406 p 2 0 2687 913 9201 3176 p 2 0 2699 901 9109 3212 p 2 0 2638 962 8487 3158 p 2 0 2791 809 9336 3294 p 2 0 2727 873 8748 3245 p 2 0 3149 451 11740 3911 p 2 0 2833 767 9048 3450 p 2 0 2430 1170 7379 2918 p 2 0 3129 471 11661 3829 p 2 0 3099 501 11030 3819 p 2 0 3234 366 12524 4021 p 2 0 2944 656 9964 3599 p 2 0 2878 722 9224 3496 p 2 0 2766 834 8673 3340 p 2 0 2888 712 9534 3524 p 2 0 2742 858 8453 3346 p 2 0 2850 750 9123 3453 p 2 0 3091 509 11392 3771 p 2 0 2726 874 8810 3272 p 2 0 3199 401 12667 3948 p 2 0 3072 528 10722 3774 p 2 0 2572 1028 7951 3087 p 2 0 2774 826 8850 3286 p 2 0 1899 1701 5290 2300 p 2 0 2569 1031 7822 3080 p 2 0 2701 899 8608 3256 p 2 0 2552 1048 7614 3071 p 2 0 2588 1012 8020 3118 p 2 0 2639 961 8413 3173 p 2 0 2954 646 10078 3583 p 2 0 2654 946 8393 3171 p 2 0 3337 263 15872 4173 p 2 0 3055 545 11534 3738 p 2 0 3085 515 10984 3765 p 2 0 2799 801 9231 3382 p 2 0 2613 987 8122 3134 p 2 0 2961 639 10663 3549 p 2 0 2877 723 9698 3451 p 2 0 2800 800 9205 3342 p 2 0 2850 750 9105 3396 p 2 0 2775 825 8828 3312 p 2 0 3085 515 10904 3829 p 2 0 2857 743 9506 3454 p 2 0 3326 274 15447 4153 p 2 0 2370 1230 7532 2842 p 2 0 2887 713 9898 3448 p 2 0 2915 685 10298 3489 p 2 0 2922 678 9904 3493 p 2 0 2660 940 8634 3176 p 2 0 2921 679 10672 3494 p 2 0 2848 752 9493 3434 p 2 0 2706 894 8666 3243 p 2 0 2857 743 9484 3426 p 2 0 3161 439 10931 3890 p 2 0 2813 787 8592 3457 p 2 0 3382 218 15896 4301 p 2 0 2464 1136 7845 2936 p 2 0 3004 596 11112 3627 p 2 0 2727 873 9057 3254 p 2 0 2901 699 10237 3460 p 2 0 2643 957 8780 3154 p 2 0 2731 869 8908 3293 p 2 0 2829 771 9084 3410 p 2 2 2632 966 16463 3326 p 2 0 2756 844 9094 3251 p 2 0 3023 577 18076 3860 p 2 0 2042 1558 5987 2508 p 2 0 3380 220 16095 4286 p 2 1 3148 451 20433 4010 p 2 0 3164 436 12575 3916 p 2 0 3110 490 11520 3825 p 2 0 1993 1607 5990 2429 p 2 5 2704 891 18828 3473 p 2 0 2965 635 11066 3582 p 2 13 3124 463 22502 4040 p 2 0 3071 529 12203 3739 p 2 0 2894 706 10406 3461 p 2 1 2717 882 18606 3496 p 2 0 2270 1330 8232 2803 p 2 0 3248 352 16200 4168 i 2 3600 0 0 101548 13448 p 2 0 3440 160 16534 4548 p 2 178 3139 283 46046 5978 p 2 0 3298 302 14083 4329 p 2 0 2889 711 10633 3658 p 2 158 3046 396 46698 5718 p 2 0 2729 871 10374 3499 p 2 0 2961 639 11916 3735 p 2 137 3113 350 46665 5806 p 2 0 3309 291 15724 4465 p 2 92 3102 406 45507 5562 p 2 0 3368 232 17109 4622 p 2 0 3285 315 15025 4243 p 2 416 2788 396 57942 6878 p 2 0 3251 349 16655 4348 p 2 0 2975 625 12036 3767 p 2 0 2354 1246 8132 2948 p 2 180 2977 443 71480 6572 p 2 0 3051 549 13456 4109 p 2 0 2943 657 13307 3769 p 2 234 2949 417 74713 6775 p 2 0 3163 437 15338 4172 p 2 870 2376 354 82020 8652 p 2 0 3375 225 18199 4613 p 2 0 2786 814 10805 3534 p 2 556 2659 385 81262 7877 p 2 0 2905 695 13006 3896 p 2 0 3086 514 13728 3973 p 2 0 2372 1228 8859 3022 p 2 320 2832 448 71498 6648 p 2 0 3049 551 15298 3971 p 2 0 2962 638 14034 3861 p 2 50 3065 485 59496 5425 p 2 0 3240 360 17665 4316 p 2 42 2983 575 57109 5212 p 2 0 3320 280 17031 4569 p 2 0 3178 422 15900 4108 p 2 0 2883 717 12206 3593 p 2 14 2919 667 48030 4719 p 2 0 3023 577 14271 3856 p 2 0 2589 1011 10439 3235 p 2 9 3025 566 46804 4815 p 2 0 2792 808 11759 3567 p 2 0 2769 831 12200 3463 p 2 11 2918 671 47811 4715 p 2 0 3050 550 16004 3937 p 2 4 2860 736 39964 4341 p 2 0 3183 417 14265 4097 p 2 0 3001 599 12027 3770 p 2 4 3227 369 63869 5566 p 2 0 3209 391 18211 4167 p 2 0 2940 660 13514 3703 p 2 1 3150 449 33228 4583 p 2 0 3059 541 13561 3911 p 2 0 2944 656 12158 3687 p 2 0 2211 1389 8136 2732 p 2 2 2917 681 32034 4287 p 2 0 3131 469 13952 4020 p 2 2 3025 573 29834 4342 p 2 0 3309 291 17256 4319 p 2 0 3073 527 13891 3874 p 2 0 2802 798 11095 3407 p 2 0 2788 812 11090 3426 p 2 0 2790 810 10617 3416 p 2 0 2334 1266 8197 2857 p 2 0 2759 841 10613 3352 p 2 0 2732 868 10204 3337 p 2 0 2535 1065 8684 3076 p 2 0 2548 1052 8870 3091 p 2 0 2686 914 10078 3285 i 2 3600 0 0 120823 14706 p 2 0 3534 66 21762 5039 p 2 5 3386 209 14825 4415 p 2 0 3100 500 10957 3825 p 2 0 3056 544 11316 3780 p 2 0 2126 1474 6392 2612 p 2 2 2853 745 9965 3551 p 2 0 2966 634 10223 3642 p 2 0 2878 722 9786 3543 p 2 0 2881 719 9113 3493 p 2 0 2617 983 8560 3171 p 2 0 2540 1060 7733 3094 p 2 1 2995 604 12100 3696 p 2 0 2708 892 10472 3283 p 2 0 2940 660 12684 3606 p 2 8 2962 630 12929 3651 p 2 1 2711 888 15685 3328 p 2 14 2883 703 20179 3686 p 2 25 2441 1134 18341 3304 p 2 35 2793 772 22911 3807 p 2 47 2633 920 24955 3666 p 2 37 2511 1052 23118 3523 p 2 15 2266 1319 20782 3157 p 2 0 2313 1287 21527 3120 p 2 3 3083 514 24323 4097 p 2 2 2809 789 20296 3697 p 2 2 3078 520 21865 4009 p 2 4 3068 528 23472 4024 p 2 0 3012 588 15573 3888 p 2 0 2805 795 16743 3591 p 2 8 2807 785 17978 3603 p 2 0 2775 825 10416 3424 p 2 0 2782 818 10055 3440 p 2 0 2761 839 9470 3379 p 2 0 2631 969 8513 3226 p 2 1 2896 703 10726 3555 p 2 0 2782 818 9697 3376 p 2 0 3308 292 16436 4120 p 2 0 2972 628 11359 3614 p 2 0 2801 799 10411 3357 i 2 3600 0 0 116111 12582 p 2 0 3342 258 20141 3909 p 2 0 3520 80 44095 4488 p 2 0 3557 43 49334 4537 p 2 0 3564 36 41189 4347 p 2 0 3554 46 52547 4507 p 2 0 3543 57 56052 4528 p 2 0 3571 29 50086 4494 p 2 2 3553 45 43025 4408 p 2 0 3567 33 44284 4344 p 2 0 3562 38 49224 4485 p 2 0 3574 26 47869 4387 p 2 0 3539 61 47253 4262 p 2 0 3580 20 45181 4297 p 2 0 3529 71 53083 4335 p 2 0 3574 26 51291 4360 p 2 0 3553 47 42791 4291 p 2 1 3552 47 42939 4303 p 2 0 3541 59 43417 4304 p 2 0 3554 46 44558 4385 p 2 1 3555 44 48837 4319 p 2 0 3564 36 47543 4225 p 2 0 3564 36 45790 4333 p 2 0 3567 33 48613 4313 p 2 0 3565 35 48196 4338 p 2 0 3576 24 44430 4362 p 2 0 3544 56 46126 4434 p 2 0 3576 24 44407 4407 p 2 0 3560 40 46937 4431 p 2 0 3556 44 47156 4403 p 2 0 3531 69 45883 4463 p 2 0 3560 40 42629 4489 p 2 0 3545 55 44954 4474 p 2 0 3577 23 45861 4431 p 2 0 3558 42 44456 4592 p 2 0 3571 29 42617 4506 p 2 0 3554 46 45716 4518 p 2 0 3576 24 45315 4491 p 2 0 3557 43 47370 4495 p 2 0 3574 26 40792 4498 p 2 0 3549 51 36312 4469 p 2 0 3576 24 44268 4559 p 2 0 3544 56 46671 4772 p 2 2 3577 21 46409 4877 p 2 0 3551 49 40354 4814 p 2 0 3586 14 44163 4798 p 2 0 3577 23 48918 4807 p 2 0 3577 23 46109 4857 p 2 1 3582 17 42778 4807 p 2 0 3578 22 35820 4816 p 2 0 3570 30 36822 4796 p 2 1 3587 12 36418 4898 p 2 0 3571 29 32651 4773 p 2 0 3582 18 38389 4788 p 2 0 3573 27 43583 4849 p 2 0 3581 19 44444 4910 p 2 0 3545 55 41533 4776 p 2 0 3578 22 38642 4758 p 2 0 3574 26 33774 4831 p 2 0 3576 24 34445 4864 p 2 0 3579 21 34809 4911 p 2 4 3577 19 37479 5019 p 2 0 3569 31 35894 4912 p 2 0 3580 20 36666 4855 p 2 0 3571 29 33992 4876 p 2 0 3580 20 38917 4824 p 2 0 3567 33 39808 4964 p 2 0 3559 41 39241 4866 p 2 0 3581 19 37039 4975 p 2 0 3591 9 38276 4969 p 2 0 3569 31 34247 4996 p 2 0 3582 18 38231 5076 p 2 0 3576 24 37813 5009 p 2 0 3585 15 37177 5024 p 2 0 3582 18 38073 4986 p 2 0 3580 20 35798 5046 p 2 0 3587 13 34916 5082 p 2 0 3593 7 35013 5011 p 2 0 3575 25 36235 5062 p 2 0 3585 15 39416 5135 p 2 0 3579 21 36077 5046 p 2 0 3585 15 34355 5039 p 2 0 3587 13 34143 5004 p 2 0 3581 19 31843 5048 p 2 0 3587 13 33900 4922 p 2 0 3587 13 31280 4932 p 2 0 3571 29 34380 4880 p 2 0 3585 15 31180 4985 p 2 0 3574 26 27811 4892 p 2 0 3578 22 30549 4980 p 2 0 3576 24 29642 5053 p 2 0 3578 22 28692 5123 p 2 0 3582 18 29445 5009 p 2 0 3584 16 30291 4997 p 2 0 3594 6 36988 5613 i 2 3600 0 0 108960 13145 p 2 0 3443 157 18357 4258 p 2 0 3395 205 18563 4322 p 2 0 2647 953 8894 3165 p 2 0 3018 582 11189 3623 p 2 0 3189 411 38296 4729 p 2 0 3059 541 14086 3783 p 2 0 3258 342 34824 4648 p 2 0 3300 300 36221 4826 p 2 0 2891 709 10815 3516 p 2 0 3139 461 13571 3866 p 2 0 3203 397 13560 3962 p 2 0 3097 503 12257 3788 p 2 0 3117 483 11916 3796 p 2 0 3021 579 11312 3656 p 2 0 3184 416 13400 3866 i 2 3600 0 0 113176 13573 p 2 0 3570 30 28720 5185 p 2 0 3038 562 11930 3735 p 2 3 3376 221 17676 4370 p 2 0 3208 392 13703 3942 p 2 0 3284 316 14411 4239 p 2 0 2943 657 10937 3681 p 2 0 3390 210 16320 4434 p 2 0 2743 857 9630 3405 p 2 1 2908 691 10639 3514 p 2 0 2816 784 9734 3440 p 2 0 2310 1290 7307 2809 p 2 0 2911 689 10548 3552 p 2 0 2721 879 9215 3315 p 2 0 3011 589 10792 3672 p 2 0 2925 675 10831 3604 p 2 0 3086 514 12166 3801 p 2 0 2721 879 9992 3339 p 2 0 3094 506 12148 3821 p 2 0 2860 740 10249 3462 p 2 0 2527 1073 8282 3024 p 2 0 2814 786 10166 3370 p 2 0 2524 1076 8437 3033 p 2 0 2465 1135 8268 2958 p 2 0 2541 1059 8569 3054 p 2 0 2665 935 9232 3232 p 2 0 2446 1154 8001 2954 p 2 3 2586 1011 8937 3168 p 2 0 2778 822 9380 3377 p 2 0 2601 999 8613 3192 p 2 0 3207 393 13862 3971 p 2 0 2938 662 10596 3625 p 2 0 2808 792 10146 3404 p 2 12 3021 567 55461 5176 p 2 0 2897 703 11905 3629 p 2 0 2627 973 8976 3226 p 2 4 3125 471 53458 5165 p 2 0 3038 562 14067 3849 p 2 0 2876 724 12407 3537 p 2 8 3128 464 55580 5278 p 2 0 3096 504 13070 3961 p 2 2 3211 387 54058 5302 p 2 0 3400 200 18898 4460 p 2 3 3196 401 15031 4121 p 2 0 3216 384 13342 4040 p 2 0 3122 478 13655 3920 p 2 0 2813 787 10264 3414 p 2 2 2893 705 11149 3525 p 2 0 2636 964 8886 3180 p 2 0 2751 849 9748 3277 p 2 0 1802 1798 5387 2239 p 2 0 2574 1026 8438 3106 p 2 0 2865 735 10282 3490 p 2 3 2866 731 9616 3553 p 2 0 3082 518 12024 3830 p 2 0 2933 667 10507 3624 p 2 0 2595 1005 8776 3133 p 2 3 2322 1275 7994 2829 p 2 0 2663 937 8976 3193 p 2 0 2213 1387 7005 2687 p 2 0 2581 1019 8491 3098 p 2 0 2633 967 8395 3152 p 2 0 2412 1188 7819 2932 p 2 1 2545 1054 8547 3120 p 2 0 2823 777 9994 3456 p 2 3 2460 1137 8668 3022 p 2 0 3054 546 11739 3740 p 2 0 2799 801 9616 3385 p 2 0 2724 876 9392 3253 p 2 0 2530 1070 8491 3062 p 2 0 2390 1210 7659 2916 p 2 469 2772 359 89776 7975 p 2 0 3095 505 15255 4148 p 2 0 2405 1195 8195 2975 p 2 0 2696 904 11417 3418 p 2 418 2775 407 86257 7685 p 2 0 3038 562 14054 4049 p 2 72 3159 369 73802 6382 p 2 0 3315 285 16603 4508 p 2 0 3068 532 11548 3973 p 2 25 3257 318 62019 5886 p 2 0 3233 367 15273 4247 p 2 0 2868 732 11102 3591 p 2 40 3194 366 60608 5750 p 2 0 3009 591 13999 3907 p 2 0 3001 599 11915 3755 p 2 0 2940 660 11533 3632 p 2 0 2867 733 10762 3539 p 2 0 3114 486 12425 3932 p 2 0 3017 583 11515 3739 p 2 0 3334 266 18887 4318 p 2 0 3449 151 21900 4956 i 2 3600 0 0 109385 13151 p 2 0 3558 42 22588 4625 p 2 0 3401 199 16540 4312 p 2 0 3209 391 14165 3985 p 2 0 2871 729 9663 3432 p 2 0 2883 717 10586 3532 p 2 0 2989 611 11611 3600 p 2 0 2592 1008 8810 3095 p 2 0 3085 515 11894 3764 p 2 0 2558 1042 8094 3114 p 2 0 2524 1076 8578 2995 p 2 0 3262 338 14916 3951 p 2 0 3098 502 12113 3776 p 2 0 3122 478 12744 3828 p 2 0 2828 772 9942 3451 p 2 0 2760 840 9238 3323 p 2 0 2939 661 10792 3569 p 2 0 2898 702 10281 3528 p 2 0 2879 721 9924 3470 p 2 0 2800 800 9464 3369 p 2 0 2927 673 10817 3529 p 2 0 2879 721 10733 3433 p 2 0 2432 1168 8017 2897 p 2 1 3160 439 24927 4342 p 2 0 3024 576 11686 3682 p 2 1 2865 734 20587 3825 p 2 0 2456 1144 9003 3011 p 2 0 2072 1528 6518 2518 p 2 0 2813 787 10443 3379 p 2 0 2728 872 18100 3564 p 2 0 2840 760 10632 3461 p 2 0 1972 1628 6320 2429 p 2 0 2765 835 19264 3602 p 2 0 2985 615 12422 3687 p 2 0 3228 372 14154 3986 p 2 0 3039 561 12182 3701 p 2 0 2601 999 8775 3125 p 2 0 2581 1019 8333 3037 p 2 0 2779 821 9629 3306 p 2 0 2599 1001 8525 3065 p 2 0 2659 941 8788 3144 p 2 0 2666 934 8716 3199 p 2 0 2549 1051 8146 3065 p 2 0 2682 918 8756 3210 p 2 0 2838 762 10190 3430 p 2 25 2922 653 44897 4801 p 2 0 3222 378 14131 4022 p 2 0 3062 538 11699 3708 p 2 20 3177 403 44618 5134 p 2 0 3109 491 13578 3898 p 2 0 2810 790 10025 3425 p 2 23 3104 473 34760 4606 p 2 0 3008 592 12831 3715 p 2 0 2844 756 11004 3477 p 2 0 2128 1472 7345 2606 p 2 3 2917 680 33278 4244 p 2 0 3033 567 13052 3764 p 2 0 2940 660 29478 4147 p 2 0 3280 320 15717 4124 p 2 0 3101 499 12420 3767 p 2 0 2967 633 10981 3615 p 2 0 3043 557 28360 4183 p 2 0 2940 660 11879 3548 p 2 0 3238 362 31291 4491 p 2 0 2975 625 12202 3637 p 2 0 2958 642 11454 3558 p 2 0 2056 1544 7053 2486 p 2 1 2992 607 31029 4237 p 2 0 3164 436 13582 3957 p 2 0 2820 780 10306 3413 p 2 0 3225 375 14423 3989 p 2 0 3104 496 12915 3773 p 2 0 2706 894 9291 3233 p 2 0 2936 664 10669 3481 p 2 0 2532 1068 8431 2992 p 2 0 2486 1114 8195 3087 i 2 3600 0 0 104566 14338 p 2 4 3453 143 17803 4596 p 2 0 3360 240 14152 4315 p 2 3 2901 696 10493 3610 p 2 0 3270 330 14361 4251 p 2 0 2750 850 9312 3464 p 2 0 2443 1157 8111 2974 p 2 2 3040 558 12433 3806 p 2 0 2348 1252 7370 2895 p 2 1 3027 572 11562 3751 p 2 0 2634 966 8661 3237 p 2 0 2732 868 8936 3348 p 2 0 2887 713 10518 3516 p 2 22 3212 366 54980 5803 p 2 0 2919 681 12933 3739 p 2 13 3116 471 50383 5476 p 2 0 2224 1376 7815 2859 p 2 7 3049 544 51663 5412 p 2 0 3281 319 14109 4302 p 2 0 2460 1140 8728 3090 p 2 9 3158 433 54672 5575 p 2 0 3127 473 13459 4034 p 2 0 2281 1319 8449 2895 p 2 135 2904 561 66258 6374 p 2 0 2791 809 11647 3609 p 2 26 3026 548 65248 6056 p 2 0 2898 702 14311 3945 p 2 0 2909 691 11961 3727 p 2 139 3058 403 70185 6700 p 2 0 2895 705 13852 3894 p 2 0 3138 462 12254 3986 p 2 0 2517 1083 8674 3171 p 2 11 3223 366 54749 5809 p 2 10 3217 373 57286 5835 p 2 0 2951 649 13347 3969 p 2 0 2972 628 10686 3717 p 2 193 2920 487 72674 6955 p 2 0 2925 675 12487 3873 p 2 0 2589 1011 8609 3252 p 2 35 3032 533 57427 5806 p 2 0 3115 485 15121 4173 p 2 0 3022 578 11682 3877 p 2 0 2719 881 10371 3410 p 2 61 3259 280 62977 6305 p 2 0 3023 577 15040 3977 p 2 0 3081 519 13279 3942 p 2 0 2608 992 9324 3263 p 2 0 2968 632 10964 3692 p 2 0 2739 861 9679 3416 p 2 0 2599 1001 8344 3215 p 2 0 2477 1123 7640 3039 p 2 2 2216 1382 6677 2791 p 2 0 2705 895 9075 3322 p 2 0 2610 990 8594 3204 p 2 0 2403 1197 7946 2989 p 2 544 2656 400 81654 8340 p 2 0 2824 776 14286 3984 p 2 13 2995 592 54208 5532 p 2 0 2738 862 12475 3644 p 2 18 2913 669 55414 5523 p 2 0 2850 750 12914 3768 p 2 81 2951 568 53280 5659 p 2 0 2849 751 12614 3727 p 2 0 2826 774 10311 3606 p 2 23 3167 410 47717 5512 p 2 0 2927 673 12789 3832 p 2 0 3276 324 14454 4284 p 2 0 2633 967 10183 3376 p 2 846 2356 398 83347 9117 p 2 0 2352 1248 8290 3190 p 2 0 2800 800 10674 3577 p 2 111 3008 481 70230 6590 p 2 0 3061 539 13396 4050 p 2 8 3042 550 51893 5540 p 2 0 2837 763 12714 3737 p 2 0 2802 798 9671 3522 p 2 11 3270 319 54578 5901 p 2 0 2998 602 13880 3940 p 2 0 3079 521 11152 3926 p 2 0 2569 1031 9416 3277 p 2 593 2693 314 88404 8839 p 2 0 3100 500 14795 4282 p 2 0 2414 1186 9338 3106 p 2 264 2743 593 77534 7227 p 2 0 2982 618 12433 3977 p 2 13 3101 486 58847 5969 p 2 0 2959 641 13689 4065 p 2 0 2912 688 10916 3857 p 2 48 3164 388 69788 6445 p 2 0 2910 690 14410 3938 p 2 0 2625 975 8809 3318 p 2 297 2989 314 79772 7729 p 2 0 2971 629 16855 4158 p 2 11 3149 440 59626 5962 p 2 0 3149 451 17374 4368 p 2 20 3154 426 60407 5884 p 2 0 3078 522 15503 4094 p 2 0 2889 711 11428 3663 p 2 0 2309 1291 8107 2935 p 2 65 2910 625 63084 5870 p 2 0 2940 660 12334 3814 p 2 89 3105 406 66067 6431 p 2 0 3180 420 13894 4228 p 2 0 2986 614 10408 3823 p 2 34 3175 391 63131 6189 p 2 0 3120 480 14243 4165 p 2 0 2843 757 11557 3591 p 2 50 3026 524 65909 6095 p 2 0 2465 1135 10009 3240 p 2 0 2582 1018 10251 3303 p 2 0 2549 1051 10166 3268 p 2 96 3024 480 70633 6490 p 2 135 3029 436 77310 7091 p 2 0 2882 718 13849 4045 p 2 0 3063 537 11107 4034 p 2 0 2404 1196 8332 3037 p 2 76 2962 562 52755 5721 p 2 0 2967 633 13952 3879 p 2 0 2246 1354 8215 2860 p 2 12 2836 752 41886 4929 p 2 0 2747 853 10316 3523 p 2 0 2764 836 9796 3485 p 2 1 2838 761 34848 4558 p 2 0 2620 980 9751 3360 p 2 3 3096 501 39093 5039 p 2 0 2735 865 11317 3542 p 2 0 2928 672 10470 3705 p 2 0 2756 844 9650 3399 p 2 0 2287 1313 7096 2835 i 2 3600 0 0 107534 13065 p 2 0 3247 353 12559 3834 p 2 1 3416 183 35905 4882 p 2 0 3402 198 17326 4327 p 2 1 3336 263 33082 4678 p 2 0 3253 347 14732 4031 p 2 1 3142 457 31512 4311 p 2 0 3216 384 13731 4058 p 2 0 2810 790 10474 3433 p 2 0 2602 998 9081 3078 p 2 0 2945 655 12373 3523 p 2 1 3070 529 31213 4240 p 2 1 3396 203 33118 4748 p 2 0 3024 576 12613 3658 p 2 1 3280 319 32212 4552 p 2 0 2977 623 12725 3624 p 2 1 3262 337 31524 4496 p 2 0 2991 609 12822 3672 p 2 0 2249 1351 7668 2701 p 2 1 3140 459 31224 4296 p 2 0 3182 418 14913 3928 p 2 2 3091 507 31155 4216 p 2 0 3031 569 12704 3666 p 2 1 3103 496 30628 4235 p 2 2 3275 323 31448 4450 p 2 0 2997 603 12985 3605 p 2 1 3216 383 31406 4415 p 2 0 2979 621 12084 3598 p 2 2 3095 503 30106 4245 p 2 0 2838 762 11665 3447 p 2 0 2899 701 11068 3486 p 2 0 2984 616 11493 3581 p 2 0 2747 853 9707 3274 p 2 0 3266 334 15522 4098 p 2 0 3128 472 12948 3806 p 2 0 2802 798 9738 3367 p 2 1 2861 738 29837 3990 p 2 0 3043 557 12654 3642 p 2 2 3028 570 30026 4111 p 2 0 2805 795 9736 3344 p 2 1 3050 549 30252 4174 p 2 0 2834 766 10478 3387 p 2 2 2905 693 29616 4009 p 2 1 3124 475 30460 4349 p 2 0 2840 760 12024 3494 p 2 0 2804 796 11054 3360 p 2 2 3555 43 43430 5686 i 2 3600 0 0 134876 13373 p 2 0 3565 35 28892 4752 p 2 0 3530 70 22782 4573 p 2 0 3439 161 19936 4321 p 2 0 3217 383 13192 3900 p 2 0 3108 492 14585 3780 p 2 0 3408 192 16874 4192 p 2 0 3220 380 15828 3948 p 2 0 2924 676 11007 3469 p 2 0 3266 334 15571 4116 p 2 0 2257 1343 7594 2772 p 2 0 3440 160 22791 4322 p 2 0 3470 130 18083 4409 p 2 0 3160 440 15067 3876 p 2 0 3388 212 16850 4203 p 2 0 3253 347 16207 3952 p 2 0 3233 367 16025 3938 p 2 0 3253 347 14034 3942 p 2 0 2656 944 9492 3102 p 2 0 3242 358 16354 3997 p 2 0 3146 454 12772 3812 p 2 0 3365 235 18429 4159 p 2 0 3172 428 13089 3819 p 2 0 3210 390 15989 3880 p 2 0 3085 515 12284 3710 p 2 0 2894 706 12645 3453 p 2 0 2885 715 10442 3445 p 2 0 2810 790 12083 3373 p 2 0 2962 638 12934 3554 p 2 0 2811 789 9917 3375 p 2 0 2035 1565 6147 2447 p 2 0 3043 557 13690 3637 p 2 0 2801 799 9471 3336 p 2 0 3144 456 13623 3876 p 2 0 2877 723 9891 3503 p 2 0 3389 211 19076 4224 p 2 0 3190 410 13600 3802 p 2 0 3124 476 15115 3762 p 2 0 2838 762 10425 3356 p 2 0 2770 830 12168 3293 p 2 0 2879 721 12930 3455 p 2 0 2779 821 9929 3325 p 2 0 2011 1589 5973 2412 p 2 0 2886 714 12088 3401 p 2 0 2939 661 11409 3488 p 2 0 3142 458 14282 3906 p 2 0 2801 799 9887 3401 p 2 0 3381 219 18939 4195 p 2 0 3156 444 13567 3764 p 2 0 3222 378 16099 3935 p 2 0 3152 448 13392 3776 p 2 0 3002 598 13613 3548 p 2 0 2720 880 11432 3234 p 2 0 2888 712 10138 3413 p 2 0 2051 1549 6123 2442 p 2 0 2385 1215 9661 2842 p 2 0 2718 882 9681 3233 p 2 0 3214 386 14940 3990 p 2 0 2827 773 9876 3464 p 2 0 3392 208 19529 4272 p 2 0 3201 399 13550 3855 p 2 0 3148 452 14781 3837 p 2 0 3233 367 14050 3921 p 2 0 3039 561 13941 3627 p 2 0 2913 687 10505 3465 p 2 0 3013 587 12995 3632 p 2 0 2744 856 9695 3265 p 2 0 2876 724 12395 3426 p 2 0 2536 1064 8596 3031 p 2 0 3095 505 13205 3778 p 2 0 2931 669 10659 3574 p 2 0 3390 210 19205 4248 p 2 0 3125 475 12573 3775 p 2 0 3072 528 14137 3754 p 2 0 3093 507 12121 3740 p 2 0 3096 504 13920 3795 p 2 0 3008 592 11293 3621 p 2 0 2907 693 12716 3504 p 2 0 2881 719 10215 3470 p 2 0 2670 930 11173 3212 p 2 0 2830 770 9972 3385 p 2 0 3111 489 14305 3765 p 2 0 2925 675 11080 3480 p 2 0 3359 241 19412 4195 p 2 0 2985 615 11872 3580 p 2 0 3077 523 13982 3710 p 2 0 3020 580 11764 3646 p 2 0 3079 521 14022 3741 p 2 0 2923 677 10822 3497 p 2 0 2888 712 12694 3480 p 2 0 2909 691 10678 3519 p 2 0 2684 916 11241 3217 p 2 0 2886 714 10549 3455 p 2 0 3191 409 14117 3952 p 2 0 2762 838 9634 3356 p 2 0 3439 161 20725 4301 p 2 0 3251 349 13988 3943 p 2 0 2815 785 12747 3388 p 2 0 2984 616 11738 3532 p 2 0 2801 799 12209 3341 p 2 0 3111 489 12586 3688 p 2 0 2938 662 12630 3511 p 2 0 2758 842 9604 3313 p 2 0 2949 651 12507 3524 p 2 0 2684 916 9246 3186 p 2 0 3122 478 13658 3828 p 2 0 2748 852 9202 3331 p 2 0 3370 230 18220 4142 p 2 0 3212 388 14512 3835 p 2 0 3229 371 15744 3952 p 2 0 3136 464 12399 3798 p 2 0 2980 620 13553 3573 p 2 0 2881 719 12869 3434 p 2 0 2804 796 10067 3344 p 2 0 2056 1544 6352 2456 p 2 0 2363 1237 9826 2802 p 2 0 2258 1342 7338 2665 p 2 0 3063 537 13027 3727 p 2 0 2898 702 10213 3520 p 2 0 3400 200 18517 4231 p 2 0 3210 390 13830 3866 p 2 0 3295 305 17063 4062 p 2 0 3237 363 14496 3921 p 2 0 2952 648 13511 3497 p 2 0 2822 778 12250 3369 p 2 0 2949 651 10950 3505 p 2 0 2186 1414 6767 2578 p 2 0 2477 1123 10079 2937 p 2 0 2807 793 9995 3330 p 2 0 3122 478 13824 3840 p 2 0 2743 857 9348 3306 p 2 0 3407 193 19506 4270 p 2 0 3194 406 13526 3830 p 2 0 3143 457 14211 3776 p 2 0 3216 384 15109 3879 p 2 0 3044 556 14322 3628 p 2 0 3105 495 14039 3721 p 2 0 2887 713 10532 3403 p 2 0 1915 1685 6044 2336 p 2 0 2173 1427 8949 2602 p 2 0 2285 1315 7702 2737 p 2 0 3110 490 13591 3809 p 2 0 2739 861 9155 3300 p 2 0 3398 202 18918 4218 p 2 0 3223 377 15490 3952 p 2 0 3191 409 13042 3915 p 2 0 2296 1304 7679 2760 p 2 0 3049 551 15067 3743 p 2 0 3127 473 15822 3828 p 2 0 2985 615 10952 3605 p 2 0 2155 1445 6976 2578 p 2 10 2934 656 15696 3595 p 2 12 3148 440 17742 3943 p 2 0 2912 688 11036 3439 p 2 0 3275 325 14865 3998 p 2 8 3134 458 16894 3905 p 2 0 2919 681 10968 3540 p 2 0 3058 542 11523 3702 p 2 0 2613 987 8180 3139 p 2 0 3019 581 11696 3613 p 2 0 2762 838 9321 3291 p 2 0 2439 1161 8003 2987 p 2 0 2780 820 9492 3356 p 2 0 2933 667 10434 3470 p 2 0 3139 461 12709 3753 i 2 3600 0 0 128592 15740 p 2 0 3258 342 14601 4295 p 2 128 3472 0 129651 10140 p 2 209 3390 1 132287 10116 p 2 90 3510 0 132522 9603 p 2 77 3523 0 128076 9509 p 2 246 3353 1 135268 10127 p 2 48 3552 0 128260 9316 p 2 90 3510 0 135416 9749 p 2 214 3386 0 140678 9871 p 2 102 3498 0 132273 9734 p 2 43 3557 0 132076 9192 p 2 97 3503 0 142054 9945 p 2 53 3547 0 126785 9262 p 2 102 3498 0 135262 9629 p 2 85 3515 0 136600 9455 p 2 102 3498 0 142291 9730 p 2 48 3552 0 130175 9095 p 2 215 3385 0 139811 10057 p 2 72 3528 0 133141 9431 p 2 101 3499 0 139673 9731 p 2 199 3401 0 143250 9677 p 2 104 3496 0 136343 9639 p 2 39 3561 0 139603 9024 p 2 222 3378 0 142138 10049 p 2 51 3549 0 126723 9189 p 2 128 3471 1 134105 9871 p 2 212 3388 0 139191 9911 p 2 137 3463 0 148146 9963 p 2 72 3528 0 132597 9323 p 2 229 3371 0 144419 10321 p 2 58 3542 0 129753 9321 p 2 95 3505 0 141287 9774 p 2 204 3396 0 143557 9888 p 2 102 3498 0 139287 9999 p 2 38 3562 0 141170 9242 p 2 117 3483 0 145763 10146 p 2 49 3551 0 130565 9299 p 2 151 3449 0 138929 10185 p 2 84 3516 0 135661 9537 p 2 150 3450 0 144324 10321 p 2 51 3549 0 128858 9296 p 2 125 3475 0 141653 10301 p 2 68 3532 0 131360 9556 p 2 116 3484 0 141016 10088 p 2 86 3514 0 138204 9741 p 2 150 3450 0 133053 10367 p 2 33 3567 0 133619 9544 p 2 110 3490 0 137653 10252 p 2 64 3536 0 125520 9687 p 2 124 3476 0 126906 10251 p 2 51 3549 0 128998 9645 p 2 93 3507 0 131250 10170 p 2 67 3533 0 122827 9708 p 2 102 3498 0 125567 10088 p 2 54 3546 0 118150 9652 p 2 80 3520 0 124691 9977 p 2 36 3564 0 112917 9188 p 2 131 3469 0 118666 10249 p 2 40 3560 0 112746 9452 p 2 164 3436 0 120759 10537 p 2 62 3538 0 105357 9583 p 2 91 3509 0 110197 9802 p 2 35 3565 0 107032 9275 p 2 98 3502 0 112027 9916 p 2 47 3553 0 108125 9607 i 2 3600 0 0 110061 14070 p 2 112 3480 8 63037 7253 p 2 151 3096 353 49785 6056 p 2 95 3357 148 54602 6739 p 2 156 3124 320 51405 6307 p 2 124 3131 345 46928 6351 p 2 107 3024 469 41496 5998 p 2 80 2817 703 32347 5448 p 2 235 3365 0 63612 7974 p 2 182 3418 0 61083 7916 p 2 235 3365 0 61773 7614 p 2 37 3563 0 51074 6249 p 2 3 3594 3 37620 5563 p 2 0 3600 0 36933 5194 p 2 0 3593 7 34059 4660 p 2 0 3258 342 17736 4124 p 2 0 3265 335 18406 4173 p 2 0 3195 405 18529 4063 p 2 0 3448 152 20705 4574 p 2 0 3115 485 16467 4027 p 2 0 3499 101 22852 4703 p 2 0 3315 285 19069 4292 p 2 0 3336 264 18383 4333 p 2 0 3469 131 22419 4495 p 2 0 3341 259 18871 4674 i 2 3600 0 0 122206 13374 p 2 386 3027 187 68422 7750 p 2 325 3097 178 73011 7463 p 2 440 2945 215 89077 7984 p 2 346 2911 343 63750 7409 p 2 300 3175 125 75365 7703 p 2 368 2955 277 83280 7579 p 2 388 3031 181 68426 7854 p 2 295 2980 325 75106 7404 p 2 399 2721 480 81756 7354 p 2 292 2783 525 41340 7015 p 2 101 2714 785 22930 4761 p 2 95 2781 724 21324 4617 p 2 62 2714 824 15743 4065 p 2 100 2560 940 21057 4162 p 2 63 2729 808 16096 4067 p 2 93 2566 941 20759 4061 p 2 81 3134 385 16871 4736 p 2 140 2733 727 23570 4511 p 2 140 3234 226 23142 5021 p 2 929 2671 0 95085 11810 p 2 71 3529 0 53736 7363 p 2 63 3536 1 53132 7362 p 2 11 3493 96 24206 5349 p 2 108 3490 2 64975 7816 p 2 97 3501 2 52689 7400 p 2 36 3562 2 50109 6858 p 2 11 3551 38 30240 6221 p 2 1051 2547 2 91311 11660 p 2 256 3344 0 69899 8865 p 2 190 3395 15 65166 8733 p 2 148 3439 13 46882 7859 i 2 3600 0 0 75925 12957 p 2 1624 1973 3 88904 12786 p 2 1411 2188 1 87030 12301 p 2 572 3028 0 77730 9915 p 2 721 2879 0 85360 10901 p 2 1052 2548 0 97650 11964 p 2 1264 2332 4 107189 12874 p 2 725 2871 4 102729 11350 p 2 1845 1755 0 90102 13516 p 2 1075 2525 0 75653 12262 p 2 1613 1985 2 77636 12883 p 2 1174 2426 0 81334 12033 i 2 3600 0 0 78762 13492 p 2 2525 1075 0 88921 14053 p 2 2412 1172 16 80245 13823 p 2 2138 1459 3 69279 13582 i 2 3600 0 0 50025 12889 i 2 3600 0 0 41433 11877 i 2 3600 0 0 37430 11692 i 2 3600 0 0 54999 11158 i 2 3600 0 0 49369 11984 p 2 2456 1094 50 73788 13154 p 2 2563 1036 1 78604 14316 p 2 2243 1355 2 70272 13834 p 2 1933 1666 1 54522 12474 i 2 3600 0 0 47418 11808 i 2 3600 0 0 56125 11940 p 2 2634 966 0 75032 13925 p 2 2073 1527 0 82345 13534 p 2 1781 1815 4 97728 13208 p 2 1768 1832 0 101865 13611 p 2 1475 2125 0 113044 13033 p 2 1243 2357 0 100745 12428 p 2 702 2893 5 93089 11250 p 2 500 3097 3 78588 10102 p 2 787 2808 5 79966 10906 p 2 484 3109 7 81428 10235 p 2 414 3180 6 71435 9530 p 2 330 3267 3 90089 9979 p 2 1075 2521 4 85876 11308 p 2 863 2734 3 80548 11242 p 2 577 3022 1 92349 10546 p 2 1333 2266 1 86112 12017 p 2 914 2686 0 89989 10910 p 2 1058 2541 1 82240 11239 p 2 628 2972 0 89720 10583 p 2 433 3161 6 69338 9129 p 2 143 3450 7 69151 8043 p 2 645 2948 7 75030 9603 p 2 212 3380 8 80101 9050 p 2 529 3062 9 70365 9276 i 2 3600 0 0 110463 13237 p 2 881 2715 4 63857 8550 p 2 562 2183 855 42612 5996 p 2 172 2286 1142 41330 4780 p 2 719 2244 637 69924 7368 p 2 944 1980 676 77158 8458 p 2 135 3033 432 69029 6383 p 2 20 2558 1022 48567 4739 p 2 10 2815 775 51211 4731 p 2 2 2396 1202 42913 3969 p 2 2 2291 1307 35660 3665 p 2 0 1937 1663 12721 2689 p 2 0 1943 1657 10684 2594 p 2 1 2017 1582 35279 3247 i 2 3600 0 0 85033 11738 p 2 148 2930 522 104706 5825 p 2 409 1386 1805 85081 5221 p 2 254 1567 1779 93795 4927 p 2 189 1600 1811 92863 4620 p 2 247 1570 1783 96590 4797 p 2 180 2617 803 94395 5758 i 2 3600 0 0 94193 13394 p 2 218 2787 595 67477 6085 p 2 0 2301 1299 19891 3437 p 2 604 1835 1161 71808 6420 p 2 1140 1545 915 93137 8828 p 2 1068 1802 730 110972 9232 p 2 632 2501 467 100051 8580 p 2 121 2928 551 95985 6852 p 2 18 2837 745 89779 5727 p 2 1 3056 543 57701 5144 p 2 1 2811 788 53513 4647 p 2 0 2677 923 21160 3659 i 2 3600 0 0 103010 12389 p 2 1042 2300 258 120108 9120 p 2 0 1864 1736 54124 2864 p 2 396 1428 1776 94972 5099 p 2 273 1571 1756 105024 4904 p 2 545 1412 1643 110981 6063 p 2 273 1838 1489 140937 5470 p 2 451 1638 1511 107637 5825 p 2 383 1685 1532 107432 5760 p 2 293 1663 1644 111526 5209 p 2 322 1567 1711 111622 5164 p 2 399 1704 1497 111026 5778 p 2 747 1444 1409 141694 7308 p 2 710 1586 1304 131716 7393 p 2 705 1648 1247 157367 8074 p 2 1086 1840 674 185525 10148 p 2 1130 2013 457 224558 11179 p 2 1376 1866 358 262598 12752 p 2 1346 1956 298 279153 13106 p 2 1305 2079 216 299505 13272 p 2 1254 2134 212 297225 13235 p 2 1372 2047 181 294632 13521 p 2 1216 2146 238 264953 12936 p 2 1185 2163 252 271035 12798 p 2 1292 2072 236 270053 13182 p 2 1343 2030 227 298901 13554 p 2 1463 1927 210 283672 13880 p 2 1208 2199 193 326412 13271 i 2 3600 0 0 248815 15895 p 2 1754 1586 260 285170 14210 p 2 1481 1945 174 297936 13877 p 2 1284 2137 179 273519 13105 p 2 1064 2301 235 260487 12269 p 2 1060 2216 324 210296 11442 p 2 919 2169 512 170020 10419 p 2 664 2251 685 167181 9457 p 2 733 2092 775 131858 9265 p 2 1526 1958 116 116385 11646 p 2 92 3292 216 63186 6465 p 2 67 3299 234 67175 6208 p 2 112 3274 214 67322 6190 p 2 75 3238 287 64341 5989 p 2 108 3313 179 61522 6163 p 2 72 3403 125 64299 6329 p 2 114 3334 152 60193 6407 p 2 110 3379 111 74392 6761 p 2 110 3354 136 76236 6771 p 2 76 3378 146 80867 6857 p 2 71 3394 135 81489 6840 p 2 108 3370 122 84382 6882 p 2 128 3408 64 93176 7309 p 2 75 3410 115 84922 7135 p 2 78 3428 94 84822 7149 p 2 27 3430 143 79605 6862 p 2 76 3410 114 83707 7122 p 2 57 3487 56 87080 7290 p 2 118 3422 60 96532 7360 p 2 72 3469 59 97775 7329 p 2 162 3381 57 91245 7562 p 2 111 3393 96 94157 7484 p 2 131 3363 106 101500 7329 p 2 74 3471 55 100252 7647 p 2 68 3478 54 92110 7552 p 2 98 3454 48 104551 7833 p 2 30 3523 47 102229 7514 p 2 90 3469 41 102369 7761 p 2 62 3500 38 97118 7619 p 2 101 3460 39 112428 7952 p 2 65 3498 37 111801 8011 p 2 123 3453 24 104403 7995 p 2 112 3425 63 96256 7685 p 2 152 3404 44 108192 7858 p 2 99 3457 44 107737 7872 p 2 49 3514 37 98529 7672 p 2 96 3456 48 102786 7593 p 2 91 3476 33 109307 7911 p 2 77 3498 25 109880 8040 p 2 36 3515 49 103724 7763 p 2 113 3465 22 116681 8174 p 2 71 3517 12 119175 7995 p 2 93 3484 23 112340 8003 p 2 94 3468 38 101777 7824 p 2 141 3423 36 105706 7878 p 2 122 3449 29 114382 8107 p 2 76 3492 32 106783 7913 p 2 75 3477 48 108212 7701 p 2 58 3499 43 107144 7695 p 2 165 3414 21 115394 8225 p 2 85 3485 30 114356 7835 p 2 111 3455 34 116882 7828 p 2 79 3485 36 120238 7928 p 2 121 3453 26 113303 8058 p 2 104 3440 56 108838 7951 p 2 130 3437 33 111045 7902 p 2 111 3442 47 111319 7742 p 2 74 3493 33 110479 7778 p 2 57 3507 36 112430 7788 p 2 33 3537 30 108950 7572 p 2 102 3462 36 112268 7810 p 2 114 3451 35 119411 7908 p 2 103 3467 30 127223 7949 p 2 109 3463 28 124047 8034 p 2 111 3444 45 112977 8014 p 2 82 3481 37 115816 7918 p 2 172 3379 49 121497 8132 p 2 114 3468 18 120085 8410 p 2 59 3507 34 105793 7949 p 2 149 3412 39 113670 8121 p 2 52 3514 34 116091 7692 p 2 75 3488 37 108495 7619 p 2 103 3455 42 108278 7906 i 2 3600 0 0 155016 14231 p 2 408 3156 36 110743 8289 p 2 166 3004 430 85876 6630 p 2 109 3018 473 82469 6310 p 2 50 3074 476 70715 5741 p 2 89 2944 567 60972 5355 p 2 166 3141 293 90196 6587 p 2 145 2999 456 78691 6198 p 2 97 2894 609 79741 5992 p 2 126 2962 512 79834 6123 p 2 0 2674 926 45567 4525 p 2 0 2719 881 41404 4295 p 2 0 2639 961 41400 4016 p 2 0 2694 906 40360 3949 i 2 3600 0 0 104146 11991 p 2 1130 2071 399 120809 9091 p 2 190 1131 2279 125414 4075 p 2 219 916 2465 112506 3622 p 2 196 906 2498 122023 3518 p 2 324 819 2457 118349 4059 p 2 324 2818 458 131522 6867 i 2 3600 0 0 114312 14413 p 2 3 3220 377 78203 5593 p 2 5 2901 694 71332 5103 p 2 31 2903 666 88431 5712 p 2 20 3028 552 85211 5789 p 2 4 2947 649 74405 5274 p 2 1 2985 614 71091 5023 p 2 0 2664 936 27725 3798 p 2 0 2147 1453 13505 2889 p 2 2 2636 962 20104 3542 p 2 5 1672 1923 10828 2302 p 2 0 2597 1003 26575 3480 i 2 3600 0 0 88201 11923 p 2 1691 1626 283 96939 10109 p 2 0 1394 2206 33214 2287 p 2 278 1122 2200 84755 4095 p 2 164 1406 2030 115346 3957 p 2 259 1196 2145 87459 4160 p 2 217 1212 2171 84477 4056 p 2 229 1189 2182 83120 3970 p 2 221 1195 2184 87042 4015 p 2 192 1285 2123 98665 4034 p 2 292 1204 2104 91450 4344 p 2 251 1676 1673 88668 4736 p 2 728 1662 1210 95265 7098 p 2 680 1951 969 112288 7890 p 2 558 2144 898 137984 8334 p 2 615 2077 908 145823 8423 p 2 618 2019 963 155599 7820 p 2 1040 1664 896 180400 9269 p 2 990 1921 689 220248 10251 p 2 1115 1961 524 246604 11434 p 2 1284 1954 362 265503 12247 p 2 1472 1892 236 294548 13447 p 2 1389 1947 264 293619 13178 p 2 1315 2080 205 288174 13125 p 2 1269 2123 208 284080 13066 p 2 1275 2076 249 279849 13168 p 2 1371 2038 191 288996 13533 p 2 1281 2157 162 306932 13315 p 2 1293 2121 186 299230 13215 p 2 1477 1865 258 258589 13307 p 2 1302 2029 269 271582 13124 p 2 1383 2008 209 311297 13540 i 2 3600 0 0 261242 16102 p 2 1750 1638 212 258461 14008 p 2 1419 1944 237 254314 13411 p 2 1234 2065 301 242298 12726 p 2 1140 2089 371 276708 12120 p 2 1299 1859 442 298167 12310 p 2 1409 1769 422 256658 12947 p 2 1054 2090 456 256642 11474 p 2 990 2081 529 259124 10987 p 2 1024 1877 699 218120 10623 p 2 903 1956 741 197321 9963 p 2 797 2026 777 192040 9414 p 2 783 1885 932 145354 8897 p 2 515 2197 888 150055 8102 p 2 801 2450 349 182228 9722 p 2 3 2845 752 45464 4920 p 2 0 2788 812 43897 4072 p 2 0 2726 874 42853 3720 p 2 0 3005 595 48528 3846 p 2 0 2936 664 47759 3730 p 2 0 2965 635 51296 3857 p 2 0 2764 836 43886 3613 p 2 0 2802 798 45270 3653 p 2 2 2818 780 47135 3685 p 2 1 2813 786 44518 3630 p 2 3 2719 878 56236 3823 p 2 0 2925 675 47123 3862 p 2 0 2605 995 44696 3560 p 2 0 2890 710 45949 3727 p 2 1 2515 1084 43319 3369 p 2 1 2878 721 44943 3736 p 2 0 2545 1055 45318 3452 p 2 0 3049 551 46984 3931 p 2 0 2529 1071 43950 3418 p 2 0 2908 692 46206 3795 p 2 0 2653 947 49282 3580 p 2 0 2871 729 48141 3761 p 2 0 2655 945 47080 3712 p 2 0 2880 720 46382 3759 p 2 1 2563 1036 48420 3579 p 2 0 2881 719 46227 3781 p 2 0 2558 1042 44257 3507 p 2 1 2886 713 44704 3730 p 2 2 2722 876 47834 3574 p 2 0 2962 638 48918 3800 p 2 0 2743 857 43751 3554 p 2 0 2958 642 48310 3761 p 2 0 2819 781 52239 3704 p 2 0 2877 723 53011 3754 p 2 0 2894 706 49331 3769 p 2 0 3008 592 50936 3830 p 2 0 2778 822 55259 3807 p 2 0 2967 633 54932 3937 p 2 0 2623 977 51884 3579 p 2 1 2865 734 52770 3737 p 2 0 2934 666 57729 3770 p 2 0 3073 527 58318 3935 p 2 0 2863 737 57456 3751 p 2 0 2865 735 56754 3752 p 2 0 2915 685 62690 3905 p 2 0 3156 444 61644 4115 p 2 0 2745 855 60210 3845 p 2 0 3061 539 59766 3979 p 2 0 2878 722 61891 3968 p 2 0 3114 486 61055 4124 p 2 0 2710 890 56024 3736 p 2 0 3032 568 55610 4015 p 2 0 2609 991 57836 3699 p 2 0 2939 661 56671 3984 p 2 0 2625 975 52583 3668 p 2 0 2975 625 52780 3915 p 2 0 2976 624 54023 3902 p 2 0 3120 480 54743 4084 p 2 0 3062 538 51194 4034 p 2 2 2940 658 52671 3899 p 2 0 2694 906 57382 3792 p 2 1 3092 507 55938 4091 p 2 1 2678 921 52450 3703 p 2 0 2983 617 51605 3924 p 2 0 2818 782 56569 3794 p 2 0 2945 655 55975 3983 p 2 0 2790 810 54635 3781 p 2 0 2916 684 55607 3847 p 2 0 2837 763 58881 3853 p 2 0 3049 551 60053 4023 p 2 0 2994 606 61371 4035 p 2 0 2949 651 59962 3952 p 2 0 2818 782 63849 3960 p 2 0 2993 607 61287 4049 p 2 0 2770 830 56561 3831 p 2 0 2992 608 56994 4009 p 2 0 2867 733 60791 3920 p 2 0 2967 633 60775 4002 p 2 0 2882 718 56096 3895 p 2 1 2960 639 57882 3953 p 2 0 2826 774 56546 3893 p 2 0 2987 613 56406 3977 p 2 0 2762 838 51304 3820 p 2 0 2924 676 54005 3915 p 2 0 2807 793 57717 3892 p 2 2 2941 657 56665 3995 p 2 0 2684 916 52209 3747 p 2 0 2974 626 50957 3974 p 2 0 2839 761 53921 3876 p 2 0 3007 593 52338 4030 p 2 1 2895 704 50442 3889 p 2 1 2990 609 51674 3946 p 2 3 2849 748 54455 3919 p 2 0 2946 654 54967 3954 p 2 0 2958 642 53444 3958 p 2 0 2904 696 55900 3907 p 2 0 2855 745 64878 4037 p 2 0 3014 586 63351 4124 p 2 0 2733 867 60393 3869 p 2 0 2977 623 60942 4031 p 2 0 2854 746 65532 3967 p 2 0 3029 571 68154 4147 p 2 0 2837 763 64022 3895 p 2 0 2928 672 65412 3961 p 2 0 2869 731 65883 3940 p 2 0 2919 681 70877 4035 p 2 0 2966 634 63106 4037 p 2 0 2951 649 64515 3962 p 2 0 2809 791 68450 3996 p 2 0 2833 767 65965 3955 i 2 3600 0 0 68538 13632 p 2 214 3067 319 56902 7249 p 2 71 3066 463 53956 6483 p 2 137 2928 535 56581 6507 p 2 222 2955 423 67359 7128 p 2 63 2967 570 60254 5993 p 2 40 2991 569 95170 5542 p 2 174 2691 735 56940 5403 p 2 79 2803 718 49849 4920 p 2 60 2453 1087 47478 4393 p 2 84 2696 820 49595 4587 p 2 294 2341 965 55555 5413 p 2 126 2336 1138 45690 4769 p 2 153 2181 1266 60128 4709 p 2 130 2307 1163 70992 4951 p 2 161 2183 1256 73658 4992 p 2 119 2131 1350 67305 4620 p 2 161 2130 1309 63109 4762 p 2 224 2310 1066 74352 5469 p 2 246 2236 1118 77423 5652 p 2 194 2452 954 83355 5815 p 2 335 2424 841 94318 6879 p 2 319 2752 529 110342 7797 p 2 282 2713 605 104686 7372 p 2 239 2605 756 100459 7016 p 2 200 2667 733 101662 6765 p 2 185 2746 669 111725 6937 p 2 170 2745 685 107541 6824 p 2 240 2481 879 102972 7124 p 2 405 2303 892 102907 7878 p 2 460 2331 809 102252 8091 p 2 145 2573 882 81190 6546 p 2 228 2399 973 93324 6578 i 2 3600 0 0 180273 15234 p 2 203 2792 605 67989 5072 p 2 0 2840 760 65723 3964 p 2 0 2722 878 64236 3674 p 2 1 2785 814 62554 3704 p 2 1 2717 882 67888 3702 p 2 1 2806 793 70866 3818 p 2 0 2757 843 65255 3714 p 2 4 2775 821 62437 3826 p 2 0 2828 772 63427 3801 p 2 0 2823 777 59961 3792 p 2 0 2928 672 60114 3891 p 2 0 2845 755 60147 3795 p 2 0 2947 653 68513 3977 p 2 0 2909 691 63459 3843 p 2 0 2761 839 61302 3715 p 2 0 2934 666 64425 3861 p 2 0 2917 683 64077 3842 p 2 4 2979 617 65836 3982 p 2 0 2848 752 54220 3754 p 2 0 2903 697 52641 3810 p 2 0 2904 696 54577 3813 p 2 0 2906 694 53344 3850 p 2 1 2933 666 53220 3885 p 2 0 2789 811 51660 3700 p 2 1 2896 703 56050 3849 p 2 0 2878 722 52528 3783 p 2 0 2780 820 46910 3670 p 2 1 2833 766 48456 3706 p 2 0 2801 799 51654 3650 p 2 0 2815 785 52403 3647 p 2 0 2760 840 51900 3601 p 2 0 2696 904 47765 3502 p 2 0 2759 841 52517 3607 p 2 0 2771 829 51995 3683 p 2 0 2779 821 54438 3674 p 2 0 2705 895 56578 3575 p 2 2 2750 848 61618 3719 p 2 0 2768 832 57701 3688 p 2 0 2691 909 51015 3568 p 2 1 2823 776 51796 3659 p 2 0 2747 853 54708 3578 p 2 1 2821 778 55976 3677 p 2 1 2739 860 54605 3594 p 2 0 2780 820 52311 3631 p 2 0 2769 831 56092 3606 p 2 5 2736 859 56601 3631 p 2 0 2791 809 53154 3607 p 2 1 2705 894 60226 3568 p 2 0 2812 788 61804 3770 p 2 1 2720 879 58351 3630 p 2 1 2682 917 52469 3567 p 2 0 2736 864 47542 3516 p 2 0 2706 894 48569 3488 p 2 4 2785 811 51091 3684 p 2 0 2726 874 46123 3552 p 2 0 2738 862 44198 3599 p 2 0 2747 853 46522 3578 p 2 1 2750 849 46709 3581 p 2 0 2770 830 46188 3591 p 2 1 2691 908 45961 3554 p 2 0 2802 798 49368 3714 p 2 0 2760 840 41887 3559 p 2 0 2721 879 39029 3514 p 2 3 2757 840 39039 3523 p 2 0 2729 871 42432 3511 p 2 0 2781 819 46448 3579 p 2 1 2746 853 42988 3563 p 2 0 2776 824 42128 3584 p 2 0 2770 830 41522 3557 p 2 0 2788 812 41208 3587 p 2 0 2789 811 39645 3582 p 2 0 2717 883 41402 3480 p 2 1 2827 772 46866 3654 p 2 1 2802 797 44016 3623 p 2 0 2760 840 42070 3569 p 2 0 2789 811 43336 3567 p 2 0 2827 773 45098 3637 p 2 0 2857 743 52396 3663 p 2 0 2733 867 49236 3551 p 2 0 2791 809 46780 3580 p 2 6 2831 763 49027 3706 p 2 0 2843 757 45039 3641 p 2 0 2841 759 44107 3652 p 2 0 2765 835 46949 3563 p 2 0 2896 704 52117 3758 p 2 0 2864 736 52076 3672 p 2 0 2830 770 47994 3610 p 2 0 2910 690 49470 3636 p 2 1 2860 739 52526 3653 p 2 2 2841 757 50333 3609 p 2 2 2911 687 54129 3714 p 2 0 2874 726 44786 3605 p 2 0 2854 746 47305 3612 p 2 0 2838 762 47323 3634 p 2 0 2881 719 45725 3633 p 2 0 2665 935 45610 3432 p 2 0 2825 775 47678 3612 p 2 0 2799 801 44241 3589 p 2 0 2695 905 39466 3471 p 2 1 2775 824 37861 3487 p 2 0 2692 908 39856 3444 p 2 0 2810 790 40707 3535 p 2 0 2667 933 38314 3370 p 2 0 2765 835 37527 3468 p 2 0 2728 872 40634 3453 p 2 0 2790 810 43645 3533 p 2 0 2748 852 41207 3465 p 2 0 2710 890 43602 3455 i 2 3600 0 0 33329 12076 p 2 164 3296 140 31254 7638 p 2 160 3290 150 32932 7512 p 2 77 3256 267 35220 7164 p 2 325 3192 83 49706 8741 p 2 154 3355 91 53490 8153 p 2 261 3198 141 113808 8634 p 2 160 3157 283 42263 6189 p 2 64 3218 318 40976 5613 p 2 60 2845 695 29064 4761 p 2 333 2827 440 45516 6289 p 2 97 2858 645 40612 5264 p 2 102 2743 755 40085 5015 p 2 124 2654 822 40056 4953 p 2 58 2705 837 34815 4562 p 2 84 2582 934 36737 4561 p 2 162 2223 1215 36406 4543 p 2 446 2346 808 49916 6387 p 2 233 2390 977 36332 5374 p 2 242 2264 1094 60512 5766 p 2 254 2462 884 62822 5865 p 2 336 2495 769 65124 6559 p 2 245 2665 690 68300 6699 p 2 327 2506 767 71722 6705 p 2 234 2685 681 77743 6629 p 2 287 2505 808 80509 7076 p 2 191 2516 893 76033 6846 p 2 296 2280 1024 77648 6718 p 2 165 2372 1063 77582 6185 p 2 329 2191 1080 76787 6771 p 2 232 2041 1327 77385 6177 p 2 318 2048 1234 71633 6243 p 2 271 2169 1160 82706 6515 p 2 210 2239 1151 76283 6245 p 2 102 2476 1022 64357 5799 p 2 238 2185 1177 57372 5716 p 2 307 2579 714 78422 6799 p 2 247 2627 726 87638 6914 p 2 354 2409 837 97129 7454 i 2 3600 0 0 121177 13666 p 2 222 2407 971 57890 4840 p 2 0 2120 1480 55322 3203 p 2 0 1953 1647 52227 2910 p 2 0 2045 1555 40377 2844 p 2 0 2007 1593 43133 2866 p 2 0 1947 1653 44595 2806 p 2 0 2160 1440 36918 2967 p 2 0 2030 1570 51515 2884 p 2 0 2097 1503 54108 2954 p 2 0 2023 1577 53088 2886 p 2 0 1872 1728 47903 2760 p 2 0 1969 1631 44985 2852 p 2 0 1967 1633 48473 2842 p 2 0 2122 1478 55537 2996 p 2 0 1994 1606 52802 2848 p 2 0 2059 1541 51353 2887 p 2 0 2058 1542 51403 2913 p 2 0 2060 1540 49887 2919 p 2 0 2118 1482 43993 2927 p 2 0 2056 1544 48669 2845 p 2 0 2096 1504 56368 2933 p 2 0 2092 1508 56783 2923 p 2 0 2024 1576 53519 2898 p 2 0 2037 1563 50966 2846 p 2 0 2002 1598 49962 2820 p 2 0 2072 1528 52006 2936 p 2 0 2049 1551 50561 2902 p 2 0 2040 1560 47207 2874 p 2 1 2145 1454 50140 2978 p 2 0 2109 1491 45462 2961 p 2 0 2132 1468 40205 2898 p 2 0 2044 1556 43962 2849 p 2 0 2124 1476 43027 2931 p 2 0 2102 1498 45708 2877 p 2 0 2086 1514 47526 2835 p 2 0 2122 1478 50744 2929 p 2 0 2031 1569 50791 2878 p 2 0 2148 1452 53431 2970 p 2 0 2080 1520 51200 2884 p 2 0 2095 1505 45541 2930 p 2 0 2100 1500 55569 2940 p 2 0 2075 1525 56958 2934 p 2 0 2188 1412 48030 3031 p 2 0 2057 1543 53654 2934 p 2 0 2114 1486 51014 2995 p 2 0 2067 1533 48168 2886 p 2 0 2105 1495 45400 2913 p 2 0 2150 1450 54032 2985 p 2 0 2097 1503 56399 2993 p 2 0 2120 1480 58257 3008 p 2 0 2135 1465 50033 2956 p 2 0 2121 1479 39260 2925 p 2 0 2164 1436 46541 3027 p 2 0 2141 1459 51431 2984 p 2 1 2169 1430 44157 3057 p 2 0 2165 1435 49807 3007 p 2 0 2211 1389 51429 3087 p 2 0 2189 1411 46467 2999 p 2 0 2181 1419 48179 3033 p 2 0 2221 1379 49616 3076 p 2 1 2265 1334 61523 3165 p 2 0 2244 1356 70833 3168 p 2 0 2245 1355 61695 3166 p 2 0 2287 1313 52220 3188 p 2 0 2301 1299 63910 3199 p 2 0 2350 1250 69774 3277 p 2 0 2417 1183 65153 3291 p 2 0 2289 1311 68712 3217 p 2 0 2355 1245 68307 3264 p 2 0 2287 1313 60416 3158 p 2 0 2279 1321 47932 3102 p 2 0 2267 1333 55058 3130 p 2 0 2321 1279 62250 3182 p 2 0 2392 1208 72106 3296 p 2 0 2330 1270 69222 3234 p 2 0 2352 1248 51105 3250 p 2 0 2399 1201 54670 3269 p 2 0 2385 1215 57176 3294 p 2 0 2430 1170 53500 3327 p 2 0 2400 1200 72145 3363 p 2 0 2464 1136 66711 3402 p 2 0 2453 1147 59536 3315 p 2 0 2451 1149 47290 3286 p 2 0 2493 1107 47069 3313 p 2 0 2426 1174 54506 3273 p 2 0 2450 1150 67442 3384 p 2 0 2410 1190 72348 3361 p 2 0 2385 1215 67319 3335 p 2 0 2489 1111 69994 3425 p 2 0 2463 1137 65167 3403 p 2 0 2502 1098 58584 3514 p 2 0 2465 1135 71373 3457 p 2 0 2428 1172 77910 3472 p 2 0 2409 1191 72216 3400 p 2 0 2417 1183 57304 3379 p 2 0 2417 1183 50471 3289 p 2 0 2436 1164 56003 3339 p 2 0 2369 1231 63806 3330 p 2 0 2371 1229 62188 3338 p 2 0 2339 1261 55940 3266 p 2 0 2357 1243 64517 3306 p 2 0 2296 1304 61930 3275 p 2 0 2318 1282 49244 3218 p 2 0 2401 1199 58868 3310 p 2 0 2363 1237 62034 3293 p 2 0 2355 1245 67079 3287 p 2 0 2437 1163 57347 3292 p 2 0 2415 1185 60770 3316 p 2 0 2384 1216 60081 3251 p 2 0 2272 1328 60014 3198 i 2 3600 0 0 69600 13840 p 2 162 2918 520 48311 6263 p 2 87 2887 626 54717 5879 p 2 43 2783 774 50512 5481 p 2 330 2755 515 63999 7095 p 2 62 2699 839 60866 5618 p 2 191 2606 803 95090 5884 p 2 218 2469 913 60659 5557 p 2 58 2506 1036 48043 4630 p 2 82 2291 1227 50429 4354 p 2 112 2316 1172 46407 4335 p 2 277 2134 1189 59893 5326 p 2 484 2057 1059 56266 6223 p 2 293 2360 947 69590 6369 p 2 249 2560 791 95903 6398 p 2 281 2558 761 97385 6460 p 2 252 2719 629 95622 6690 p 2 227 2579 794 93227 6402 p 2 236 2723 641 92965 6490 p 2 165 2625 810 89894 6302 p 2 339 2335 926 96878 6881 p 2 358 2264 978 116220 7343 p 2 195 2498 907 115265 6859 p 2 180 2542 878 108318 6673 p 2 355 2575 670 129380 7683 p 2 556 2816 228 134014 9624 p 2 324 3117 159 155524 9488 p 2 433 2969 198 140126 9290 p 2 401 2905 294 141077 9242 p 2 237 2669 694 113304 7648 p 2 197 2605 798 91673 6547 p 2 126 2381 1093 85269 5713 p 2 265 2342 993 103722 6778 i 2 3600 0 0 200354 15764 p 2 159 3187 254 71821 6053 p 2 0 3211 389 64918 4995 p 2 0 3122 478 64381 4798 p 2 0 3243 357 66907 4958 p 2 0 3293 307 68440 5110 p 2 0 3327 273 73551 5202 p 2 0 3386 214 74072 5413 p 2 0 3229 371 67754 5036 p 2 0 3347 253 75419 5288 p 2 0 3296 304 67093 5144 p 2 1 3221 378 64892 4970 p 2 0 3237 363 65326 5055 p 2 0 3222 378 64673 4887 p 2 2 3333 265 77528 5291 p 2 0 3285 315 69738 5059 p 2 0 3237 363 68935 5048 p 2 0 3349 251 71929 5202 p 2 1 3353 246 71625 5141 p 2 1 3401 198 72486 5342 p 2 0 3280 320 68823 5125 p 2 0 3410 190 75332 5395 p 2 0 3359 241 71367 5338 p 2 0 3318 282 66925 5222 p 2 0 3340 260 66959 5235 p 2 0 3314 286 68994 5214 p 2 0 3353 247 70347 5350 p 2 0 3193 407 65029 5016 p 2 0 3298 302 68034 5140 p 2 0 3344 256 67252 5223 p 2 0 3316 284 68880 5182 p 2 1 3306 293 65941 5186 p 2 0 3266 334 67881 5080 p 2 0 3367 233 73499 5313 p 2 5 3312 283 70359 5220 p 2 0 3236 364 67106 5003 p 2 0 3262 338 67692 5070 p 2 0 3284 316 67698 5120 p 2 0 3278 322 67660 5127 p 2 0 3261 339 68733 5146 p 2 0 3252 348 67411 5109 p 2 2 3285 313 68263 5180 p 2 0 3279 321 67654 5212 p 2 0 3286 314 65467 5157 p 2 0 3122 478 65881 4936 p 2 0 3356 244 75670 5385 p 2 0 3304 296 68579 5237 p 2 0 3229 371 64638 5025 p 2 0 3295 305 65904 5112 p 2 0 3245 355 67224 5042 p 2 0 3256 344 66644 5067 p 2 0 3143 457 61409 4803 p 2 1 3213 386 62291 4921 p 2 0 3294 306 61477 4999 p 2 0 3268 332 64200 5016 p 2 0 3285 315 61238 4998 p 2 0 3135 465 59260 4706 p 2 0 3251 349 65828 5001 p 2 0 3229 371 62606 4944 p 2 0 3177 423 60337 4859 p 2 0 3192 408 59837 4898 p 2 1 3199 400 60290 4857 p 2 0 3166 434 59786 4788 p 2 0 3218 382 58964 4886 p 2 1 3181 418 59729 4831 p 2 0 3247 353 59493 4872 p 2 0 3234 366 61709 4852 p 2 0 3257 343 60327 4946 p 2 0 3115 485 58069 4679 p 2 0 3276 324 65181 4998 p 2 0 3271 329 62532 4937 p 2 1 3199 400 58746 4794 p 2 1 3211 388 57634 4775 p 2 0 3154 446 58518 4721 p 2 0 3164 436 58935 4765 p 2 0 3154 446 60343 4790 p 2 0 3132 468 57978 4691 p 2 0 3143 457 58903 4749 p 2 0 3119 481 59675 4723 p 2 14 3039 547 55893 4645 p 2 0 2976 624 57942 4489 p 2 0 3197 403 91985 4899 p 2 1 3213 386 86462 4879 p 2 0 3155 445 95729 4876 p 2 0 3180 420 98617 4948 p 2 0 3128 472 90707 4877 p 2 0 3190 410 97714 5141 p 2 16 3104 480 84469 5124 p 2 109 3061 430 73253 5561 p 2 91 3089 420 57128 6172 p 2 0 3184 416 46020 5057 p 2 0 3197 403 42870 4770 p 2 142 3093 365 172461 6089 p 2 0 3232 368 62074 4886 p 2 0 3173 427 60071 4741 p 2 0 3040 560 57985 4539 p 2 0 3170 430 62081 4717 p 2 0 3110 490 60650 4595 p 2 0 3261 339 64290 4922 p 2 1 3138 461 58996 4645 p 2 0 3202 398 58735 4695 p 2 0 3153 447 59639 4694 p 2 0 3141 459 59012 4677 p 2 0 3196 404 58512 4712 p 2 1 2994 605 54856 4421 p 2 0 3136 464 58816 4666 p 2 0 3102 498 56161 4554 p 2 1 3076 523 53451 4451 p 2 2 3098 500 54700 4485 p 2 3 3023 574 55690 4436 p 2 1 2976 623 53848 4304 p 2 0 2960 640 54481 4323 p 2 0 2987 613 54553 4331 p 2 0 3020 580 54068 4364 p 2 0 3029 571 55255 4367 p 2 0 3095 505 53258 4476 p 2 1 3057 542 55224 4392 p 2 0 3151 449 57387 4586 p 2 0 3068 532 55819 4474 p 2 0 2976 624 53018 4348 p 2 0 2969 631 52838 4340 p 2 0 3014 586 54662 4405 p 2 0 3061 539 55285 4528 p 2 0 2911 689 52572 4307 p 2 0 2945 655 54027 4325 p 2 0 3031 569 54706 4424 p 2 0 3001 599 56828 4443 p 2 3 3072 525 56350 4559 p 2 0 2863 737 53738 4232 p 2 0 3098 502 57352 4595 p 2 0 3024 576 53641 4459 p 2 0 2983 617 52950 4415 p 2 0 2943 657 52993 4366 p 2 0 2917 683 53595 4301 p 2 0 2991 609 54554 4449 p 2 0 2914 686 52806 4327 p 2 0 2873 727 52372 4303 p 2 0 2939 661 53495 4367 p 2 0 2920 680 54785 4389 p 2 0 3020 580 54614 4524 p 2 1 2787 812 53775 4223 p 2 0 3019 581 57312 4506 p 2 0 2970 630 55447 4462 p 2 0 2849 751 54709 4281 p 2 0 2863 737 53714 4265 p 2 1 2814 785 54382 4199 p 2 0 2817 783 54845 4197 p 2 0 2898 702 57356 4369 p 2 0 2852 748 55261 4270 p 2 0 2865 735 55801 4312 p 2 0 2885 715 57031 4349 p 2 0 2984 616 56345 4478 p 2 1 2745 854 55949 4184 p 2 0 3029 571 59004 4535 p 2 0 2930 670 57855 4412 p 2 0 2852 748 53623 4275 p 2 0 2819 781 54051 4223 p 2 0 2772 828 53200 4173 p 2 0 2760 840 52943 4174 p 2 0 2783 817 53817 4192 p 2 0 2820 780 54137 4244 p 2 0 2793 807 55839 4188 p 2 0 2769 831 56203 4164 p 2 0 2872 728 56376 4337 p 2 0 2626 974 53953 3991 p 2 1 2910 689 60639 4398 p 2 0 2869 731 55807 4294 p 2 0 2703 897 53846 4080 p 2 7 2779 814 55072 4190 p 2 1 2762 837 58128 4164 p 2 0 2821 779 60327 4278 p 2 0 2641 959 57655 4049 p 2 0 2686 914 58541 4066 p 2 0 2944 656 84793 4451 p 2 0 2948 652 84624 4437 p 2 0 2973 627 92741 4519 p 2 0 2967 633 93971 4545 p 2 1 2918 681 86345 4517 p 2 0 2993 607 84856 4649 p 2 14 2936 650 80339 4735 p 2 83 2916 601 69996 5069 p 2 100 2812 688 54759 5603 p 2 0 2852 748 43745 4459 i 2 3600 0 0 110273 12961 p 2 35 2442 1123 34244 3851 p 2 0 1909 1691 25722 2656 p 2 0 1990 1610 25266 2659 p 2 0 1959 1641 26713 2724 p 2 0 1799 1801 22870 2474 p 2 0 2004 1596 26586 2731 p 2 0 1911 1689 24388 2620 p 2 0 1994 1606 23386 2755 p 2 0 1916 1684 24413 2650 p 2 0 1904 1696 24210 2624 p 2 0 1917 1683 25991 2640 p 2 0 1849 1751 25711 2573 p 2 0 1791 1809 25846 2558 p 2 1 1819 1780 26704 2549 p 2 1 1929 1670 28529 2692 p 2 0 2042 1558 27273 2813 p 2 0 1882 1718 26834 2607 p 2 0 1993 1607 29061 2760 p 2 0 1929 1671 28513 2695 p 2 2 1877 1721 27088 2603 p 2 2 1914 1684 27913 2643 p 2 0 1699 1901 27582 2411 p 2 0 1881 1719 27474 2584 p 2 0 1746 1854 26627 2420 p 2 0 1708 1892 25706 2405 p 2 0 1703 1897 27050 2385 p 2 0 1706 1894 27994 2409 p 2 2 1921 1677 29161 2678 p 2 0 1867 1733 28201 2619 p 2 0 1948 1652 27849 2669 p 2 0 1925 1675 27507 2636 p 2 0 1873 1727 24634 2543 p 2 0 1808 1792 23305 2497 p 2 0 1766 1834 23660 2453 p 2 0 1774 1826 23415 2468 p 2 0 1683 1917 23421 2377 p 2 0 1680 1920 24065 2413 p 2 0 1665 1935 26847 2429 p 2 0 1709 1891 27714 2454 p 2 0 1937 1663 27989 2711 p 2 0 1878 1722 26002 2625 p 2 0 1992 1608 27153 2723 p 2 0 1855 1745 28162 2631 p 2 0 1895 1705 26581 2621 p 2 1 1853 1746 27755 2614 p 2 1 1815 1784 28854 2555 p 2 0 1900 1700 29384 2643 p 2 0 1711 1889 28677 2433 p 2 1 1779 1820 29641 2528 p 2 1 1551 2048 30166 2295 p 2 1 1696 1903 31913 2492 p 2 0 1774 1826 31139 2513 p 2 0 1884 1716 30816 2656 p 2 0 2069 1531 33133 2847 p 2 0 2235 1365 42888 3024 p 2 1 2330 1269 46353 3226 p 2 0 2323 1277 49927 3166 p 2 1 2260 1339 46511 3083 p 2 0 2283 1317 48041 3095 p 2 0 2204 1396 47221 3051 p 2 7 2309 1284 46460 3267 p 2 30 2265 1305 44024 3299 p 2 24 2277 1299 36411 3662 p 2 0 2059 1541 32746 3086 p 2 0 1876 1724 30099 2722 p 2 0 1688 1912 29650 2490 p 2 1 1767 1832 31011 2602 p 2 77 2343 1180 94520 3723 p 2 0 2327 1273 39403 3214 p 2 0 2218 1382 35790 3073 p 2 0 2217 1383 33993 3048 p 2 0 2081 1519 31037 2889 p 2 0 2013 1587 29826 2810 p 2 0 1976 1624 30245 2754 p 2 2 1998 1600 29460 2804 p 2 1 2186 1413 29256 3018 p 2 0 2060 1540 27850 2836 p 2 0 2181 1419 30357 2968 p 2 0 2121 1479 30152 2936 p 2 0 2053 1547 27660 2792 p 2 1 1900 1699 28077 2667 p 2 1 1838 1761 28065 2614 p 2 0 2015 1585 27843 2784 p 2 0 1830 1770 25837 2582 p 2 1 1833 1766 25669 2584 p 2 0 1761 1839 27817 2505 p 2 0 1785 1815 28109 2547 p 2 2 1934 1664 29189 2742 p 2 0 1921 1679 28376 2728 p 2 0 2114 1486 30410 2918 p 2 0 1985 1615 28774 2757 p 2 0 1980 1620 27103 2750 p 2 0 2017 1583 31458 2812 p 2 0 1854 1746 31659 2599 p 2 0 2026 1574 31303 2781 p 2 0 1844 1756 30983 2576 p 2 0 1795 1805 29932 2532 p 2 0 1802 1798 30510 2507 p 2 0 1775 1825 30121 2515 p 2 0 1987 1613 31722 2768 p 2 0 1818 1782 31132 2589 p 2 0 2100 1500 32584 2894 p 2 0 1901 1699 31483 2688 p 2 0 1975 1625 30784 2792 p 2 2 1992 1606 32029 2822 p 2 0 1856 1744 30301 2641 p 2 0 1910 1690 28884 2683 p 2 0 1915 1685 26914 2638 p 2 0 1788 1812 25678 2533 p 2 1 1892 1707 26747 2634 p 2 0 1797 1803 26783 2564 p 2 0 1939 1661 28650 2757 p 2 0 1902 1698 28854 2719 p 2 1 2063 1536 32521 2898 p 2 0 1930 1670 31715 2768 p 2 0 1902 1698 29197 2743 p 2 0 1907 1693 29294 2732 p 2 2 1882 1716 29998 2685 p 2 0 1939 1661 31772 2766 p 2 0 1795 1805 30547 2588 p 2 1 1749 1850 29542 2567 p 2 0 2018 1582 31915 2809 p 2 0 2191 1409 42491 3026 p 2 0 2272 1328 52673 3137 p 2 0 2246 1354 52842 3144 p 2 0 2211 1389 51434 3102 p 2 0 2264 1336 50392 3184 p 2 0 2371 1229 51890 3255 p 2 6 2400 1194 51840 3390 p 2 53 2328 1219 46137 3487 p 2 34 2366 1200 39586 3879 p 2 0 2144 1456 35917 3130 p 2 0 2176 1424 35907 3020 p 2 0 2178 1422 36958 2949 p 2 0 2059 1541 35485 2789 p 2 65 2328 1207 95094 3628 p 2 0 2189 1411 38765 3082 p 2 0 2239 1361 36656 3060 p 2 0 2230 1370 36014 3068 p 2 1 2215 1384 33400 3063 p 2 1 2229 1370 34343 3059 p 2 0 2183 1417 33153 2974 p 2 1 2384 1215 34021 3224 p 2 1 2249 1350 31957 3061 p 2 0 2080 1520 30368 2908 p 2 0 2169 1431 31451 2979 p 2 0 2067 1533 31061 2911 p 2 2 2137 1461 31552 3049 p 2 0 2028 1572 29015 2868 p 2 0 2193 1407 30579 3021 p 2 0 2107 1493 32537 2996 p 2 2 1971 1627 30954 2818 p 2 1 1902 1697 30515 2757 p 2 0 1793 1807 30583 2632 p 2 0 1894 1706 31673 2743 p 2 1 1780 1819 31133 2608 p 2 0 1815 1785 31442 2679 p 2 0 1801 1799 31481 2572 p 2 0 1814 1786 32194 2648 p 2 0 2017 1583 32125 2848 p 2 0 1940 1660 31478 2802 p 2 0 2142 1458 34442 2985 p 2 0 2036 1564 35912 2909 p 2 0 1903 1697 32530 2740 p 2 5 1907 1688 34472 2831 p 2 3 1880 1717 33496 2731 p 2 0 1900 1700 33977 2745 p 2 1 1674 1925 34332 2496 p 2 0 1841 1759 37416 2719 p 2 0 1784 1816 39865 2645 p 2 1 1757 1842 39465 2644 p 2 0 1977 1623 39352 2865 p 2 0 1764 1836 38784 2623 p 2 0 2063 1537 40718 2928 p 2 0 1940 1660 40047 2790 p 2 0 1935 1665 38587 2819 p 2 0 1998 1602 39307 2881 p 2 2 1948 1650 38937 2793 p 2 0 1979 1621 39088 2859 p 2 0 1793 1807 36954 2646 p 2 0 1793 1807 35873 2650 p 2 0 1848 1752 38450 2722 p 2 0 1880 1720 35929 2756 p 2 1 1898 1701 32964 2794 p 2 0 1901 1699 30938 2784 p 2 0 2017 1583 34523 2916 p 2 0 1931 1669 34500 2838 p 2 0 1895 1705 32560 2801 p 2 0 1805 1795 32408 2713 p 2 1 1942 1657 33048 2837 p 2 0 2178 1422 43363 3099 p 2 0 2174 1426 46525 3096 p 2 0 2229 1371 49498 3173 p 2 0 2205 1395 49687 3136 p 2 2 2271 1327 49324 3260 p 2 2 2406 1192 51693 3443 p 2 4 2430 1166 47039 3500 p 2 35 2306 1259 43980 3519 p 2 24 2252 1324 37826 3837 p 2 0 2039 1561 34403 3200 p 2 2 1854 1744 36059 2875 p 2 1 1744 1855 36309 2686 p 2 0 1718 1882 36670 2629 p 2 16 2052 1532 66901 3021 p 2 0 1873 1727 36038 2738 p 2 0 1970 1630 39968 2830 p 2 0 1951 1649 39631 2851 p 2 2 2002 1596 40466 2944 p 2 0 1918 1682 39687 2822 p 2 0 2052 1548 39099 2870 p 2 0 1991 1609 39776 2863 p 2 0 1874 1726 37093 2733 p 2 0 1829 1771 38749 2700 p 2 0 1746 1854 38890 2603 p 2 0 1780 1820 38095 2651 p 2 1 1702 1897 36597 2552 p 2 2 1660 1938 36086 2541 p 2 0 1673 1927 37919 2524 p 2 0 1682 1918 37542 2556 p 2 0 1818 1782 38460 2696 p 2 0 1845 1755 37054 2765 p 2 1 1919 1680 35361 2792 p 2 0 1811 1789 35241 2716 p 2 0 1825 1775 33291 2703 p 2 1 1849 1750 33597 2733 p 2 1 1809 1790 33954 2680 p 2 1 1842 1757 34535 2731 p 2 0 1768 1832 32585 2620 p 2 0 1721 1879 31200 2588 p 2 0 1685 1915 33070 2549 p 2 1 1728 1871 32187 2613 p 2 0 1840 1760 32465 2721 p 2 0 1835 1765 31836 2696 p 2 1 1934 1665 32444 2787 p 2 0 1886 1714 32031 2760 p 2 0 1838 1762 28932 2666 p 2 0 1787 1813 32391 2630 p 2 2 1768 1830 32425 2578 p 2 0 1825 1775 32867 2658 p 2 0 1802 1798 31067 2667 p 2 0 1741 1859 31507 2603 p 2 0 1724 1876 33232 2530 p 2 0 1690 1910 32097 2529 p 2 0 1798 1802 33895 2632 p 2 0 1777 1823 32932 2642 p 2 1 1874 1725 34448 2746 p 2 0 1829 1771 34975 2716 p 2 0 1806 1794 31832 2646 p 2 0 1766 1834 34023 2611 p 2 0 1667 1933 33532 2496 p 2 0 1736 1864 33557 2588 p 2 1 1683 1916 32485 2507 p 2 0 1661 1939 33117 2531 p 2 0 1703 1897 34188 2534 p 2 2 1712 1886 32571 2578 p 2 1 1721 1878 33533 2592 p 2 0 1733 1867 32583 2618 p 2 0 1958 1642 33359 2813 p 2 0 1997 1603 38033 2867 p 2 0 1986 1614 38417 2862 p 2 0 2028 1572 42469 2901 p 2 1 1967 1632 40306 2829 p 2 0 2013 1587 41767 2851 p 2 0 1934 1666 43480 2782 i 2 3600 0 0 94273 12623 p 2 2878 722 0 67347 12258 i 2 3600 0 0 82013 12301 p 2 2886 714 0 56530 12044 i 2 3600 0 0 72797 12158 p 2 2894 705 1 53754 12050 i 2 3600 0 0 67512 12112 p 2 2892 706 2 54116 12324 i 2 3600 0 0 67609 12334 i 2 3600 0 0 67994 12398 p 2 2675 925 0 56660 12277 p 2 2701 899 0 59872 12424 p 2 2630 969 1 53862 11937 i 2 3600 0 0 59951 12258 p 2 2669 929 2 43724 12026 p 2 2824 776 0 47132 12111 p 2 69 1357 2174 22318 2585 p 2 125 1394 2081 31688 3259 p 2 243 1239 2118 24259 3054 p 2 333 1187 2080 48278 4198 p 2 48 1545 2007 25246 2802 p 2 554 991 2055 56343 4902 p 2 24 1530 2046 24596 2551 p 2 495 1080 2025 55040 4565 p 2 0 1042 2558 11689 1686 p 2 17 1436 2147 46273 2689 p 2 0 1094 2506 12574 1723 p 2 13 1517 2070 46930 2802 p 2 0 1068 2532 11647 1691 p 2 25 1418 2157 49532 2855 p 2 0 1122 2478 13451 1858 p 2 33 1375 2192 49141 2882 p 2 0 1041 2559 11417 1751 p 2 28 1236 2336 45186 2716 p 2 0 1039 2561 12013 1756 p 2 25 1291 2284 44389 2701 p 2 0 942 2658 10551 1608 p 2 34 1322 2244 40384 2722 p 2 0 1006 2594 11031 1750 p 2 21 1330 2249 38024 2647 p 2 0 1106 2494 10604 1794 p 2 14 1371 2215 34541 2613 p 2 0 1057 2543 11304 1741 p 2 12 1388 2200 34656 2551 p 2 0 1063 2537 10576 1707 p 2 8 1247 2345 31433 2274 p 2 0 1042 2558 9966 1574 p 2 1 1226 2373 29620 2152 p 2 0 858 2742 9539 1407 p 2 4 1594 2002 32967 2603 p 2 3034 566 0 29853 11820 p 2 3118 482 0 47048 12439 p 2 3086 514 0 30416 11866 p 2 3118 482 0 45333 12458 p 2 3101 499 0 30796 11849 p 2 3115 485 0 39980 12160 p 2 3108 492 0 30299 11885 p 2 3103 497 0 37247 12058 p 2 3122 478 0 29657 11866 p 2 3134 465 1 37109 12231 p 2 3122 478 0 28395 11837 p 2 3124 476 0 35768 12135 i 2 3600 0 0 41459 11370 p 2 3125 475 0 33042 12032 p 2 3121 479 0 27167 11787 p 2 3143 457 0 33106 12097 p 2 3133 467 0 26548 11759 p 2 3129 471 0 31255 11996 p 2 3125 475 0 25602 11806 p 2 3118 482 0 30052 12043 p 2 3030 570 0 27351 11771 p 2 2918 682 0 30869 12020 p 2 2671 929 0 29195 11918 p 2 2365 1235 0 30803 11845 p 2 2090 1510 0 30635 11579 p 2 1736 1864 0 33559 11325 p 2 2896 704 0 24902 12036 p 2 1279 2321 0 34989 10950 p 2 3033 567 0 22371 12108 p 2 3245 355 0 22147 12298 p 2 3025 575 0 22052 12129 p 2 2573 1027 0 24370 11982 p 2 1793 1807 0 24537 11156 i 2 3600 0 0 53730 11981 p 2 16 3107 477 19720 4434 p 2 15 2315 1270 46246 3889 p 2 1 2558 1041 44571 4186 p 2 30 2436 1134 54301 4375 p 2 0 2348 1252 14279 3349 p 2 0 1753 1847 9025 2433 p 2 171 2077 1352 59829 4780 p 2 52 2015 1533 56350 4251 p 2 0 1725 1875 14019 2689 p 2 7 1739 1854 43196 3504 p 2 1 2047 1552 36724 3538 p 2 0 1736 1864 9893 2550 p 2 0 1998 1602 10666 2576 p 2 0 2057 1543 36219 3387 p 2 0 2019 1581 10640 2725 i 2 3600 0 0 246582 17729 p 2 0 3085 515 25920 4150 p 2 9 3548 43 146992 6691 p 2 7 3535 58 133679 6428 p 2 19 3524 57 152496 6806 p 2 7 3538 55 127038 6356 p 2 9 3546 45 156658 6794 p 2 5 3539 56 137104 6457 p 2 10 3488 102 158356 6710 p 2 11 3451 138 133210 6350 p 2 13 3477 110 156155 6648 p 2 6 3478 116 137195 6327 p 2 33 3491 76 159494 6977 p 2 10 3478 112 132480 6351 p 2 23 3503 74 162473 6809 p 2 7 3487 106 131207 6282 p 2 32 3419 149 154713 6666 p 2 19 3433 148 122030 6269 p 2 45 3396 159 157672 6777 p 2 8 3440 152 135874 6228 p 2 32 3388 180 151081 6640 p 2 20 3406 174 130295 6200 p 2 19 3436 145 157441 6665 p 2 17 3457 126 138273 6315 p 2 22 3515 63 156852 6986 p 2 15 3466 119 133363 6443 p 2 25 3515 60 158006 6907 p 2 19 3461 120 131456 6425 p 2 23 3487 90 155408 6800 p 2 20 3445 135 128130 6288 p 2 18 3460 122 158514 6768 p 2 13 3478 109 140702 6450 p 2 15 3464 121 154871 6728 p 2 14 3434 152 132156 6360 p 2 18 3456 126 155157 6756 p 2 26 3457 117 143665 6564 p 2 28 3516 56 157675 7065 p 2 51 3434 115 135733 6744 p 2 18 3540 42 162148 6980 p 2 23 3463 114 135072 6561 p 2 22 3496 82 153769 6835 p 2 29 3462 109 131522 6585 p 2 18 3509 73 160404 6812 p 2 18 3515 67 144160 6601 p 2 33 3468 99 167222 7026 p 2 32 3475 93 141073 6617 p 2 25 3503 72 170450 6953 p 2 23 3505 72 152033 6608 p 2 35 3534 31 175318 7143 p 2 29 3488 83 148610 6722 p 2 45 3524 31 177327 7233 p 2 20 3515 65 148450 6614 p 2 23 3526 51 167594 6960 p 2 42 3475 83 140522 6614 p 2 22 3505 73 170828 6887 p 2 31 3519 50 150665 6707 p 2 22 3500 78 163567 6950 p 2 16 3505 79 143671 6531 p 2 18 3457 125 155690 6747 p 2 10 3470 120 141118 6318 p 2 36 3487 77 154917 6920 p 2 19 3492 89 139734 6504 p 2 28 3543 29 172352 6958 p 2 16 3525 59 145416 6489 p 2 26 3526 48 171724 6900 p 2 19 3501 80 149909 6501 p 2 12 3514 74 166841 6777 p 2 13 3512 75 154365 6552 p 2 40 3481 79 166555 7082 p 2 78 3414 108 142999 6818 p 2 83 3424 93 152487 7454 p 2 16 3479 105 133834 6544 p 2 60 3481 59 216407 7517 p 2 15 3444 141 132384 6345 p 2 14 3534 52 149325 6758 p 2 10 3509 81 130939 6285 p 2 42 3485 73 157940 6873 p 2 12 3482 106 127613 6330 p 2 28 3493 79 158961 6803 p 2 14 3481 105 138083 6425 p 2 22 3477 101 155304 6812 p 2 12 3479 109 122540 6295 p 2 47 3435 118 152212 6870 p 2 9 3436 155 132808 6213 p 2 41 3514 45 151308 6986 p 2 12 3460 128 127167 6329 p 2 25 3506 69 158201 6915 p 2 23 3487 90 127915 6433 p 2 30 3500 70 147338 6835 p 2 11 3480 109 125046 6407 p 2 12 3482 106 154477 6725 p 2 4 3492 104 138332 6371 p 2 28 3465 107 156284 6783 p 2 7 3458 135 135287 6302 p 2 28 3475 97 161656 6858 p 2 8 3473 119 142431 6393 p 2 8 3557 35 159806 6909 p 2 3 3517 80 141512 6507 p 2 7 3543 50 165557 6887 p 2 3 3535 62 137669 6431 p 2 12 3529 59 159161 6877 p 2 15 3506 79 134612 6558 p 2 22 3502 76 159665 6846 p 2 4 3527 69 145386 6563 p 2 15 3513 72 156190 6803 p 2 7 3507 86 133778 6483 p 2 18 3499 83 155236 6788 p 2 10 3497 93 136529 6420 p 2 43 3525 32 159133 7197 p 2 13 3510 77 130781 6516 p 2 27 3543 30 159477 7059 p 2 7 3499 94 134903 6490 p 2 33 3512 55 160455 7014 p 2 5 3539 56 130232 6443 p 2 45 3492 63 163134 7044 p 2 10 3527 63 145498 6529 p 2 46 3480 74 163702 6989 p 2 28 3496 76 134355 6467 p 2 29 3498 73 159984 6888 p 2 9 3507 84 146303 6467 p 2 20 3541 39 160376 7003 p 2 10 3504 86 141204 6542 p 2 14 3548 38 159030 6946 p 2 15 3478 107 135743 6474 p 2 32 3508 60 153601 6836 p 2 18 3462 120 128181 6395 p 2 23 3467 110 155479 6775 p 2 11 3478 111 136015 6384 p 2 9 3463 128 152677 6609 p 2 13 3439 148 132117 6332 p 2 12 3463 125 150864 6761 p 2 6 3470 124 134714 6322 p 2 13 3507 80 145856 6799 p 2 17 3451 132 141497 6447 p 2 15 3537 48 173498 6961 p 2 6 3503 91 142368 6423 p 2 22 3507 71 173606 6960 p 2 12 3465 123 153678 6608 p 2 22 3496 82 177491 6949 p 2 19 3503 78 166000 6790 p 2 103 3424 73 179433 7629 p 2 72 3441 87 148794 7186 p 2 20 3495 85 162896 7238 p 2 5 3497 98 145890 6682 p 2 23 3506 71 165720 7295 p 2 8 3489 103 151888 6803 i 2 3600 0 0 231440 16704 p 2 17 3581 2 152449 7240 p 2 24 3513 63 150461 6974 p 2 4 3534 62 113657 6240 p 2 28 3484 88 153159 6862 p 2 5 3525 70 114476 6273 p 2 17 3483 100 149848 6778 p 2 2 3469 129 113376 6062 p 2 18 3468 114 146161 6748 p 2 3 3447 150 118091 6034 p 2 16 3543 41 152030 6935 p 2 8 3460 132 110541 6041 p 2 25 3516 59 154285 6797 p 2 7 3444 149 113318 5986 p 2 15 3443 142 150218 6632 p 2 8 3424 168 109974 5996 p 2 36 3378 186 145506 6614 p 2 6 3435 159 115251 5936 p 2 36 3371 193 145709 6626 p 2 18 3373 209 113870 5951 p 2 41 3351 208 141269 6584 p 2 8 3385 207 112090 5851 p 2 25 3462 113 143759 6662 p 2 7 3426 167 108331 5923 p 2 23 3459 118 134513 6408 p 2 7 3449 144 107304 5865 p 2 14 3402 184 132466 6222 p 2 11 3401 188 104473 5773 p 2 20 3395 185 139943 6327 p 2 7 3421 172 109212 5826 p 2 19 3365 216 135302 6271 p 2 15 3329 256 113753 5806 p 2 26 3331 243 137858 6282 p 2 11 3322 267 117170 5795 p 2 20 3451 129 143408 6508 p 2 25 3392 183 111340 6006 p 2 25 3444 131 146065 6477 p 2 22 3376 202 116757 5978 p 2 31 3342 227 149198 6541 p 2 18 3354 228 112657 5908 p 2 32 3365 203 152781 6670 p 2 19 3375 206 118750 6019 p 2 29 3360 211 147902 6608 p 2 20 3357 223 117173 6036 p 2 35 3397 168 150121 6730 p 2 10 3394 196 122758 6109 p 2 26 3471 103 151183 6919 p 2 9 3413 178 116429 6107 p 2 30 3450 120 149182 6755 p 2 18 3424 158 113863 6030 p 2 32 3391 177 151925 6729 p 2 53 3361 186 112144 6245 p 2 33 3351 216 151708 6778 p 2 33 3370 197 121467 6287 p 2 40 3356 204 148895 6803 p 2 20 3342 238 119213 6045 p 2 67 3394 139 150727 6952 p 2 15 3394 191 122848 6096 p 2 51 3412 137 151725 6879 p 2 33 3392 175 113430 6153 p 2 51 3464 85 156923 6799 p 2 20 3435 145 125893 6145 p 2 41 3430 129 155577 6707 p 2 25 3449 126 132019 6270 p 2 30 3434 136 153652 6606 p 2 22 3472 106 133769 6312 p 2 46 3437 117 151520 6854 p 2 73 3391 136 127587 6515 p 2 76 3396 128 138052 7075 p 2 21 3460 119 119061 6350 p 2 27 3421 152 136056 6814 p 2 16 3434 150 108836 6205 p 2 49 3426 125 166905 6991 p 2 16 3469 115 112232 6161 p 2 22 3466 112 137219 6580 p 2 28 3438 134 108134 6044 p 2 24 3420 156 142378 6745 p 2 7 3448 145 117746 6137 p 2 30 3387 183 146913 6800 p 2 13 3363 224 113317 5972 p 2 30 3418 152 146462 6782 p 2 4 3406 190 116963 6058 p 2 25 3438 137 151161 6909 p 2 10 3428 162 114853 6131 p 2 23 3434 143 148115 6820 p 2 6 3424 170 113135 5971 p 2 26 3341 233 148533 6688 p 2 12 3408 180 107352 5977 p 2 21 3351 228 150588 6768 p 2 11 3416 173 113227 6033 p 2 30 3351 219 144875 6701 p 2 20 3387 193 115472 5978 p 2 34 3390 176 143044 6688 p 2 5 3426 169 119599 6033 p 2 66 3409 125 150031 7001 p 2 15 3442 143 112985 6095 p 2 35 3455 110 145654 6807 p 2 9 3438 153 108628 6000 p 2 33 3422 145 138943 6587 p 2 5 3441 154 104893 5898 p 2 35 3397 168 132326 6479 p 2 5 3376 219 105703 5889 p 2 16 3343 241 126466 6253 p 2 17 3306 277 106347 5820 p 2 28 3359 213 130014 6364 p 2 9 3380 211 107430 5830 p 2 11 3410 179 127175 6367 p 2 13 3412 175 103466 5902 p 2 17 3411 172 131866 6401 p 2 3 3367 230 103636 5718 p 2 19 3376 205 133461 6348 p 2 10 3388 202 103589 5736 p 2 30 3374 196 134026 6394 p 2 13 3386 201 112986 5888 p 2 29 3331 240 139237 6535 p 2 10 3359 231 112665 5898 p 2 29 3366 205 141709 6708 p 2 4 3374 222 112230 5849 p 2 28 3396 176 143912 6754 p 2 11 3379 210 111079 5973 p 2 35 3405 160 147603 6833 p 2 4 3404 192 113185 5895 p 2 26 3439 135 147830 6749 p 2 13 3444 143 106533 5950 p 2 20 3437 143 149954 6784 p 2 10 3418 172 113355 6084 p 2 27 3412 161 151349 6956 p 2 10 3425 165 115275 6115 p 2 25 3442 133 146519 6895 p 2 9 3456 135 120646 6150 p 2 25 3454 121 144621 6844 p 2 20 3472 108 112994 6141 p 2 64 3421 115 154470 7017 p 2 11 3459 130 117847 6111 p 2 37 3442 121 151863 6838 p 2 11 3460 129 116186 6105 p 2 38 3409 153 150127 6689 p 2 9 3436 155 123190 6075 p 2 24 3404 172 141612 6549 p 2 53 3349 198 118088 6243 p 2 51 3373 176 133109 6803 p 2 11 3383 206 112651 6067 p 2 25 3401 174 130773 6690 p 2 9 3383 208 105730 6056 p 2 12 3395 193 122341 6443 p 2 8 3367 225 101872 5938 p 2 24 3342 234 127234 6406 p 2 12 3338 250 102350 5926 p 2 22 3303 275 126786 6320 p 2 7 3313 280 105043 5860 i 2 3600 0 0 129730 15651 p 2 24 3540 36 71852 6433 p 2 0 3498 102 61664 5653 p 2 7 3526 67 63025 5746 p 2 2 3565 33 55594 5737 p 2 9 3539 52 59293 5706 p 2 0 3516 84 58508 5667 p 2 3 3551 46 62048 5721 p 2 2 3533 65 59139 5539 p 2 3 3554 43 59474 5633 p 2 0 3519 81 61317 5531 p 2 5 3553 42 62095 5668 p 2 1 3545 54 59995 5587 p 2 7 3533 60 62500 5656 p 2 63 3464 73 133958 6271 p 2 5 3547 48 84573 5870 p 2 7 3547 46 80744 5908 p 2 10 3548 42 80126 5911 p 2 5 3542 53 78753 5840 p 2 7 3522 71 78956 5826 p 2 4 3537 59 75677 5755 p 2 10 3513 77 78165 5793 p 2 2 3517 81 79631 5786 p 2 7 3527 66 80355 5916 p 2 2 3522 76 79053 5805 p 2 4 3522 74 79485 5846 p 2 2 3520 78 76903 5733 p 2 2 3513 85 79918 5769 p 2 5 3562 33 78728 5903 p 2 6 3550 44 80683 5873 p 2 2 3571 27 83043 5893 p 2 1 3556 43 80674 5853 p 2 3 3522 75 80580 5769 p 2 7 3526 67 80880 5788 p 2 1 3505 94 83629 5748 p 2 7 3544 49 85937 5846 p 2 7 3538 55 83525 5785 p 2 8 3512 80 83556 5738 p 2 4 3500 96 83263 5689 p 2 2 3513 85 85453 5740 p 2 6 3534 60 85140 5854 p 2 8 3501 91 85008 5814 p 2 2 3536 62 82591 5763 p 2 3 3531 66 82942 5781 p 2 3 3529 68 79045 5750 p 2 3 3555 42 79198 5788 p 2 1 3512 87 79977 5710 p 2 2 3544 54 80834 5764 p 2 0 3492 108 80811 5681 p 2 6 3511 83 81923 5757 p 2 1 3501 98 79579 5650 p 2 1 3520 79 82749 5713 p 2 1 3534 65 79829 5748 p 2 9 3541 50 81106 5787 p 2 2 3549 49 82074 5729 p 2 0 3523 77 81699 5676 p 2 7 3502 91 79750 5609 p 2 1 3532 67 79819 5669 p 2 1 3513 86 80793 5616 p 2 4 3522 74 81457 5626 p 2 1 3473 126 77859 5531 p 2 7 3478 115 79402 5587 p 2 5 3486 109 75799 5568 p 2 3 3499 98 78395 5624 p 2 5 3546 49 74933 5659 p 2 4 3521 75 76651 5621 p 2 1 3519 80 80558 5692 p 2 3 3501 96 78418 5601 p 2 4 3471 125 77791 5486 p 2 8 3500 92 77939 5636 p 2 10 3469 121 79887 5578 p 2 7 3542 51 83519 5772 p 2 9 3500 91 82833 5739 p 2 13 3523 64 83338 5785 p 2 8 3486 106 81867 5754 p 2 11 3503 86 86310 5826 p 2 8 3509 83 84234 5872 p 2 11 3509 80 86269 5903 p 2 3 3528 69 88587 5915 p 2 6 3535 59 86262 5937 p 2 3 3530 67 85721 5845 p 2 6 3530 64 84708 5891 p 2 7 3487 106 86518 5849 p 2 13 3511 76 87354 5943 p 2 12 3484 104 86601 5845 p 2 13 3504 83 90027 5909 p 2 5 3473 122 90162 5835 p 2 8 3521 71 93477 5955 p 2 13 3533 54 93718 6052 p 2 13 3511 76 96487 6054 p 2 5 3536 59 99402 6081 p 2 17 3511 72 97989 6106 p 2 22 3525 53 96308 6109 p 2 52 3481 67 95650 6233 p 2 9 3517 74 96677 6078 p 2 15 3538 47 97491 6180 p 2 12 3509 79 95583 6078 p 2 26 3505 69 95304 6153 p 2 18 3540 42 107276 6210 p 2 18 3549 33 109420 6213 p 2 27 3547 26 108381 6295 p 2 27 3546 27 109641 6309 p 2 12 3526 62 106756 6214 p 2 15 3541 44 105523 6234 p 2 24 3538 38 105194 6245 p 2 52 3510 38 95956 6386 p 2 63 3478 59 92181 6612 p 2 10 3556 34 86416 6160 p 2 13 3537 50 86132 6014 p 2 28 3532 40 91310 6084 p 2 11 3545 44 89476 6042 p 2 22 3532 46 93506 6072 p 2 57 3510 33 135425 6471 p 2 15 3546 39 100562 6090 p 2 6 3532 62 100377 5934 p 2 10 3545 45 100493 5955 p 2 5 3536 59 98234 5859 p 2 16 3541 43 96690 5950 p 2 11 3531 58 96427 5936 p 2 19 3510 71 96892 6021 p 2 10 3505 85 94855 5919 p 2 5 3532 63 97360 5923 p 2 7 3519 74 93847 5865 p 2 7 3537 56 97213 5931 p 2 5 3562 33 93773 5867 p 2 9 3532 59 95979 5918 p 2 1 3560 39 99323 5919 p 2 3 3532 65 97778 5823 p 2 3 3538 59 95926 5718 p 2 9 3523 68 96839 5765 p 2 7 3529 64 97195 5799 p 2 4 3542 54 99011 5856 p 2 1 3522 77 96835 5772 p 2 13 3528 59 98058 5814 p 2 1 3533 66 97590 5765 p 2 7 3524 69 101849 5838 p 2 3 3539 58 100645 5853 p 2 6 3532 62 101225 5915 p 2 8 3551 41 105327 5981 p 2 12 3539 49 103078 5931 p 2 9 3535 56 102676 5855 p 2 12 3528 60 101810 5868 p 2 4 3541 55 106532 5884 p 2 5 3540 55 108681 5929 p 2 5 3531 64 107852 5901 p 2 17 3528 55 110823 5986 p 2 4 3533 63 107178 5817 p 2 6 3527 67 110607 5783 p 2 3 3557 40 107390 5825 p 2 2 3552 46 108545 5857 p 2 1 3578 21 109996 5909 p 2 1 3554 45 104935 5836 p 2 4 3530 66 104830 5818 p 2 2 3526 72 101723 5837 p 2 2 3534 64 106051 5889 p 2 4 3542 54 106817 5935 p 2 2 3527 71 104373 5896 p 2 3 3547 50 107562 5938 p 2 3 3539 58 104998 5923 p 2 2 3536 62 108412 6005 p 2 0 3559 41 104861 5964 p 2 2 3559 39 107302 6012 p 2 4 3558 38 111429 6054 p 2 3 3559 38 106513 5972 p 2 1 3556 43 105606 5866 p 2 5 3535 60 102151 5922 p 2 1 3535 64 106420 5893 p 2 1 3546 53 107233 5920 p 2 1 3533 66 105774 5948 p 2 4 3532 64 106558 6021 p 2 5 3557 38 105861 6016 p 2 2 3560 38 110112 6014 p 2 3 3560 37 103065 6018 p 2 9 3548 43 108864 6066 p 2 4 3572 24 113971 6096 p 2 5 3569 26 115856 6149 p 2 2 3565 33 116283 6101 p 2 3 3570 27 112935 6121 p 2 2 3543 55 118660 6114 p 2 4 3574 22 120296 6161 p 2 2 3541 57 115663 6121 p 2 9 3560 31 120379 6230 p 2 4 3546 50 113744 6169 p 2 2 3559 39 118805 6236 p 2 4 3579 17 110863 6261 p 2 5 3550 45 113386 6186 p 2 3 3585 12 119272 6291 p 2 5 3562 33 115751 6181 p 2 4 3554 42 115997 6039 p 2 8 3562 30 115521 6090 p 2 2 3532 66 118365 5981 p 2 4 3542 54 120734 6065 p 2 2 3531 67 118348 5960 p 2 6 3543 51 122974 6042 p 2 2 3546 52 118324 6031 p 2 8 3525 67 121912 6036 p 2 3 3541 56 124181 6052 p 2 13 3515 72 125303 6075 p 2 1 3532 67 128932 6026 p 2 6 3523 71 124153 6037 p 2 5 3534 61 128794 5982 p 2 6 3522 72 123154 6020 p 2 8 3488 104 125470 5977 p 2 23 3508 69 125034 6183 p 2 27 3488 85 124172 6244 p 2 4 3528 68 123233 6102 p 2 4 3493 103 118190 6069 p 2 1 3524 75 123255 6091 p 2 2 3522 76 117167 6099 p 2 11 3511 78 119567 6165 p 2 9 3494 97 127979 6132 p 2 4 3527 69 119362 6126 p 2 1 3504 95 116422 5985 p 2 6 3518 76 110925 6050 p 2 5 3538 57 112698 6048 p 2 5 3544 51 111450 6128 p 2 2 3505 93 108449 6057 p 2 7 3505 88 110390 6120 p 2 3 3500 97 104828 6017 p 2 3 3502 95 109981 6045 p 2 5 3528 67 104000 6016 p 2 2 3509 89 108603 5997 p 2 0 3496 104 110399 5974 p 2 3 3475 122 108530 5886 p 2 10 3487 103 108815 5842 p 2 8 3475 117 106795 5778 p 2 2 3485 113 114164 5906 p 2 6 3501 93 112477 6045 p 2 7 3481 112 110356 5950 p 2 9 3474 117 112544 6012 p 2 5 3518 77 108588 6050 p 2 8 3501 91 115000 6077 p 2 1 3522 77 108103 5983 p 2 2 3504 94 109413 5995 p 2 2 3536 62 113566 6037 p 2 3 3505 92 113819 5975 p 2 0 3527 73 114996 5915 p 2 4 3539 57 112565 5984 p 2 3 3504 93 114083 5932 p 2 4 3540 56 116272 6040 p 2 0 3529 71 114400 5968 p 2 4 3512 84 115817 5940 p 2 4 3495 101 106031 5855 p 2 5 3532 63 112946 5947 p 2 8 3514 78 102277 5993 p 2 6 3503 91 107614 5957 p 2 2 3503 95 104855 5879 p 2 1 3486 113 105730 5852 p 2 2 3459 139 107314 5764 p 2 9 3472 119 102191 5806 p 2 2 3483 115 107453 5803 p 2 4 3504 92 108489 5850 p 2 4 3442 154 104840 5702 p 2 11 3477 112 108233 5769 p 2 2 3441 157 102703 5693 p 2 11 3435 154 108752 5807 p 2 5 3462 133 102472 5751 p 2 10 3436 154 105222 5725 p 2 3 3440 157 103770 5674 p 2 2 3442 156 102018 5599 p 2 3 3452 145 101991 5572 p 2 11 3456 133 97362 5621 p 2 6 3476 118 101840 5647 p 2 5 3458 137 103819 5716 p 2 4 3448 148 100945 5704 p 2 14 3444 142 102802 5711 p 2 6 3397 197 98870 5629 p 2 9 3394 197 104983 5629 p 2 10 3409 181 99108 5694 p 2 15 3392 193 101541 5687 p 2 8 3410 182 103724 5688 p 2 10 3453 137 104524 5738 p 2 5 3458 137 107175 5734 p 2 7 3466 127 105677 5771 p 2 11 3418 171 105730 5729 p 2 14 3479 107 107329 5883 p 2 15 3496 89 105743 5867 p 2 16 3510 74 108491 5968 p 2 11 3523 66 102493 5889 p 2 9 3485 106 109538 5956 p 2 14 3529 57 100268 5973 p 2 15 3485 100 103038 5929 p 2 12 3498 90 105519 5998 p 2 12 3499 89 104296 5949 p 2 13 3475 112 107244 5881 p 2 48 3452 100 104614 6089 p 2 23 3472 105 115396 6038 p 2 22 3490 88 120024 6210 p 2 12 3480 108 113887 6067 p 2 13 3478 109 119498 6104 p 2 19 3476 105 113132 6004 p 2 17 3489 94 117892 6014 p 2 17 3511 72 112342 6007 p 2 23 3465 112 113156 5991 p 2 19 3496 85 119015 6035 p 2 19 3473 108 115470 6014 p 2 21 3510 69 118932 5948 p 2 13 3505 82 112051 5918 p 2 12 3469 119 113817 5858 p 2 15 3498 87 113969 5909 p 2 17 3467 116 110169 5794 p 2 41 3466 93 114674 5978 p 2 23 3453 124 102563 5818 p 2 20 3444 136 107447 5829 p 2 15 3495 90 102052 5873 p 2 25 3414 161 102293 5753 p 2 9 3462 129 100517 5711 p 2 5 3421 174 99139 5547 p 2 7 3410 183 100396 5551 p 2 21 3437 142 98028 5631 p 2 8 3408 184 97232 5541 p 2 14 3427 159 100608 5678 p 2 10 3407 183 97438 5546 p 2 6 3389 205 102683 5533 p 2 3 3371 226 95403 5457 p 2 5 3440 155 100246 5544 p 2 3 3464 133 89850 5580 p 2 10 3418 172 94353 5538 p 2 7 3434 159 89006 5457 p 2 4 3416 180 88345 5449 p 2 9 3429 162 95895 5416 p 2 13 3402 185 88228 5435 p 2 4 3335 261 88020 5277 p 2 8 3375 217 90902 5410 p 2 1 3372 227 86637 5287 p 2 16 3347 237 93969 5371 p 2 4 3332 264 86336 5309 p 2 9 3307 284 89041 5290 p 2 6 3419 175 84344 5564 p 2 6 3398 196 83663 5462 p 2 5 3405 190 83743 5460 p 2 12 3299 289 72957 5164 p 2 5 3357 238 82271 5167 p 2 5 3335 260 74398 5091 p 2 9 3292 299 67060 4971 p 2 5 3351 244 73694 5094 p 2 10 3310 280 60315 4902 p 2 17 3234 349 68219 4887 p 2 4 3311 285 58533 4864 p 2 8 3270 322 57814 4853 p 2 2 3359 239 47834 4889 p 2 13 3178 409 43174 4636 p 2 4 3252 344 40723 4702 p 2 2 2994 604 31411 4247 p 2 2 3042 556 28929 4262 p 2 3 2830 767 28583 4011 p 2 1 2780 819 25639 3830 p 2 3 2642 955 24792 3686 p 2 3 2881 716 25270 4027 p 2 5 2663 932 24192 3790 p 2 1 2799 800 24494 3887 p 2 1 2473 1126 23609 3505 p 2 4 3036 560 28628 4319 p 2 5 2434 1161 23336 3487 p 2 7 3110 483 29977 4418 p 2 2 2910 688 26364 4005 p 2 1 2673 926 22872 3624 p 2 11 2733 856 26157 3835 p 2 3 2538 1059 23111 3502 p 2 6 2340 1254 23710 3306 p 2 4 2310 1286 22660 3271 p 2 4 2178 1418 21494 3107 p 2 6 2288 1306 18912 3175 p 2 1 2073 1526 18288 2965 p 2 4 2794 802 22944 3893 p 2 9 2450 1141 21251 3486 p 2 6 3027 567 30329 4289 p 2 4 2791 805 27247 3983 p 2 5 2358 1237 22608 3314 i 2 3600 0 0 124050 14519 p 2 96 3278 226 43268 6025 p 2 222 2969 409 59443 5894 p 2 0 2694 906 26812 3788 p 2 418 2845 337 90319 7615 p 2 38 3237 325 34327 5031 p 2 397 2858 345 92629 7383 p 2 2 3062 536 28927 4476 p 2 833 2250 517 90810 8488 p 2 8 3347 245 35876 5220 p 2 947 2312 341 87696 8988 p 2 440 2678 482 85251 7959 p 2 5 2975 620 28580 4645 p 2 320 2782 498 82626 7263 p 2 5 3132 463 32655 4859 p 2 330 2736 534 82073 7164 p 2 9 2784 807 25897 4237 p 2 406 2821 373 81911 7453 p 2 22 2892 686 27968 4511 p 2 355 3082 163 85164 7794 p 2 26 2909 665 24166 4576 p 2 0 3004 596 22025 4188 p 2 4 3105 491 61241 5305 p 2 0 2819 781 20389 3961 p 2 1 2896 703 22209 3953 p 2 1 2419 1180 17173 3260 p 2 1 2564 1035 19231 3474 p 2 2 1973 1625 15267 2750 p 2 2 2190 1408 15575 2996 p 2 0 2207 1393 15433 2966 p 2 2 2041 1557 14899 2832 p 2 1 2761 838 19266 3726 p 2 4 2107 1489 15095 2912 p 2 0 2747 853 17805 3704 p 2 1 2435 1164 15702 3212 p 2 1 1794 1805 11365 2467 p 2 4 1712 1884 11245 2427 p 2 1 1686 1913 11527 2395 p 2 2 1701 1897 12313 2423 p 2 0 1585 2015 14848 2286 p 2 1 1585 2014 16345 2285 p 2 0 1693 1907 16349 2363 p 2 1 1530 2069 15700 2196 p 2 2 2259 1339 18126 2995 p 2 3 1925 1672 17530 2627 p 2 2 2443 1155 19521 3289 p 2 2 2214 1384 17929 2980 p 2 16 1689 1895 14941 2531 p 2 510 2872 218 38365 6583 p 2 814 2691 95 38882 7570 p 2 843 2587 170 46985 7646 p 2 853 2691 56 39392 7832 p 2 840 2655 105 43445 7766 p 2 838 2717 45 70007 8840 p 2 886 2656 58 48780 8429 p 2 763 2811 26 71397 8630 p 2 845 2650 105 46282 8155 p 2 817 2743 40 58624 8583 p 2 837 2705 58 43750 7969 p 2 899 2630 71 57156 8405 p 2 827 2730 43 45868 8410 p 2 950 2610 40 74150 9535 p 2 782 2643 175 43850 7955 p 2 978 2585 37 66864 9419 p 2 824 2729 47 46690 8337 p 2 847 2710 43 65982 9079 p 2 724 2803 73 42734 7963 p 2 1188 2373 39 72586 10406 p 2 776 2793 31 47712 8648 p 2 920 2615 65 61648 9588 p 2 699 2766 135 39120 8209 p 2 805 2711 84 59953 9226 p 2 549 2972 79 40747 8290 p 2 734 2786 80 56662 9305 p 2 595 2899 106 39116 8167 p 2 708 2799 93 50452 9062 p 2 456 3087 57 39625 8227 p 2 672 2899 29 48785 8836 p 2 579 2979 42 40262 8137 p 2 635 2877 88 48880 8467 p 2 556 3019 25 43664 8213 p 2 755 2795 50 41459 8384 p 2 899 2674 27 37238 8636 p 2 415 3071 114 39415 7595 p 2 865 2714 21 35386 8374 p 2 906 2623 71 30934 8192 p 2 1182 2398 20 29899 8403 p 2 1169 2387 44 26202 8137 p 2 1116 2454 30 27936 8361 p 2 0 1961 1639 14016 2951 p 2 0 1737 1863 12763 2368 p 2 0 1414 2186 15195 1984 p 2 0 1419 2181 14045 1790 p 2 0 1159 2441 11759 1540 p 2 0 1137 2463 10434 1481 p 2 0 924 2676 12655 1305 p 2 0 953 2647 13115 1308 p 2 0 746 2854 10705 1146 p 2 0 765 2835 12592 1160 p 2 0 650 2950 11282 1053 p 2 0 668 2932 12594 1062 p 2 0 561 3039 11910 973 p 2 0 557 3043 4728 972 p 2 0 523 3077 4426 942 p 2 0 459 3141 2835 881 p 2 0 388 3212 2483 817 p 2 0 252 3348 1260 686 p 2 0 176 3424 942 616 p 2 0 74 3526 628 525 p 2 0 70 3530 621 520 p 2 0 55 3545 576 507 p 2 0 41 3559 550 494 p 2 0 121 3479 786 566 p 2 0 118 3482 778 563 p 2 0 305 3295 1571 732 p 2 0 294 3306 1435 722 p 2 0 387 3213 2289 810 p 2 0 241 3359 1257 678 p 2 0 102 3498 731 549 p 2 0 74 3526 659 525 p 2 0 13 3587 487 470 p 2 0 37 3563 535 490 p 2 0 24 3576 515 479 p 2 0 32 3568 525 486 p 2 0 23 3577 511 479 p 2 0 15 3585 491 471 p 2 0 18 3582 492 474 p 2 0 61 3539 603 512 p 2 0 107 3493 735 553 p 2 0 51 3549 587 503 p 2 0 23 3577 509 478 p 2 0 12 3588 483 468 p 2 0 1 3599 459 458 p 2 0 15 3585 481 471 p 2 0 14 3586 482 470 p 2 0 12 3588 478 468 p 2 0 13 3587 480 469 p 2 0 14 3586 483 470 p 2 0 31 3569 526 485 p 2 0 4 3596 464 461 p 2 0 69 3531 611 519 p 2 0 65 3535 613 514 p 2 0 29 3571 520 485 p 2 0 16 3584 491 472 p 2 0 10 3590 479 467 p 2 0 12 3588 486 469 p 2 0 10 3590 479 467 p 2 0 6 3594 468 463 p 2 0 7 3593 472 465 p 2 0 8 3592 469 464 p 2 0 29 3571 515 484 p 2 0 1 3599 464 459 p 2 0 64 3536 597 515 p 2 0 35 3565 532 489 p 2 0 10 3590 478 467 p 2 0 7 3593 469 463 p 2 0 0 3600 6 6 p 2 0 10 3590 472 466 p 2 0 9 3591 471 465 p 2 0 4 3596 463 461 p 2 0 5 3595 465 462 p 2 0 10 3590 473 466 p 2 0 23 3577 499 478 p 2 0 6 3594 469 463 p 2 0 46 3554 548 498 p 2 0 29 3571 511 484 p 2 0 8 3592 470 464 p 2 0 24 3576 509 478 p 2 0 1 3599 460 458 p 2 0 13 3587 477 469 p 2 0 9 3591 474 465 p 2 0 6 3594 466 463 p 2 0 34 3566 536 487 p 2 0 235 3365 1321 670 p 2 0 296 3304 1568 726 p 2 0 137 3463 963 581 p 2 0 363 3237 2620 791 p 2 0 3005 595 18943 3871 i 2 3600 0 0 113360 12561 p 2 1695 1905 0 146404 14289 p 2 0 3584 16 39845 5660 p 2 0 3501 99 26779 5213 i 2 3600 0 0 105891 13266 p 2 0 3462 138 27655 4852 i 2 3600 0 0 79857 12834 p 2 0 3344 256 19390 4752 p 2 669 2494 437 23815 6041 i 2 3600 0 0 89148 13263 p 2 1239 2218 143 73970 10359 p 2 0 3272 328 18899 4926 p 2 857 2436 307 82255 8823 p 2 638 2527 435 79310 8314 p 2 0 2981 619 20591 4243 p 2 633 2333 634 86420 8247 p 2 1200 2135 265 88796 11243 p 2 0 3297 303 23054 5217 p 2 0 3275 325 18651 4884 p 2 1586 1989 25 109329 12054 p 2 1701 1869 30 103772 12691 p 2 0 3221 379 23177 5145 p 2 949 2619 32 103124 11529 p 2 200 3342 58 89498 9148 p 2 3 3411 186 32664 5889 p 2 291 3214 95 89406 8954 p 2 14 3368 218 30632 5433 i 2 3600 0 0 79794 13282 p 2 15 3435 150 32820 5410 i 2 3600 0 0 81581 13350 i 2 3600 0 0 85580 13534 p 2 0 3304 296 27682 4766 i 2 3600 0 0 71828 12892 p 2 0 2930 670 14152 3724 p 2 998 2245 357 73279 9770 p 2 548 2556 496 63559 8262 p 2 7 2737 856 17489 4442 i 2 3600 0 0 56163 11805 p 2 174 3364 62 33572 6135 p 2 97 3086 417 32249 5487 p 2 0 2768 832 11990 3781 p 2 342 2582 676 37034 5756 p 2 0 2763 837 10566 3482 p 2 2 3254 344 21890 4473 p 2 0 3356 244 21872 4414 p 2 214 3150 236 47121 6455 p 2 0 3394 206 27558 5101 p 2 0 3430 170 26342 4804 p 2 95 3357 148 46422 6418 p 2 2 3421 177 28202 5075 p 2 0 3456 144 25196 4852 p 2 209 3241 150 48256 6556 p 2 1 3442 157 26716 4973 p 2 0 3478 122 27657 4969 p 2 54 3407 139 47481 6237 p 2 0 3416 184 29275 5174 p 2 1 3412 187 26407 4841 p 2 332 3149 119 53651 7105 p 2 0 3465 135 25379 4861 p 2 0 3438 162 24762 4742 p 2 335 3118 147 52484 6993 p 2 0 3195 405 18811 4519 p 2 1 3195 404 17977 4208 p 2 0 2968 632 15970 3772 p 2 1 2780 819 14693 3475 p 2 0 2845 755 16272 3667 p 2 0 2926 674 16483 3728 p 2 0 2556 1044 14532 3246 p 2 2 2428 1170 14625 3027 p 2 2 2737 861 17006 3554 p 2 0 2743 857 16638 3495 p 2 3 2579 1018 16545 3398 p 2 2 2524 1074 16443 3199 p 2 0 2622 978 16422 3278 p 2 0 2538 1062 16352 3222 p 2 0 2269 1331 16302 2922 p 2 2 2331 1267 16233 2964 p 2 1 2384 1215 16502 3039 p 2 0 2405 1195 16577 3075 p 2 1 2086 1513 16299 2743 p 2 0 1982 1618 15961 2591 p 2 2 2481 1117 17867 3230 p 2 0 2337 1263 16847 2983 p 2 1 2453 1146 18433 3225 p 2 1 2243 1356 17474 2945 p 2 1 2348 1251 18538 3024 p 2 1 2520 1079 19723 3254 p 2 2 2140 1458 19606 2825 p 2 0 2226 1374 18167 2821 p 2 0 2366 1234 19304 3044 p 2 0 2356 1244 20415 3053 p 2 0 1978 1622 19141 2652 p 2 0 1987 1613 19934 2614 p 2 22 2512 1066 34942 3836 p 2 0 2480 1120 22358 3247 p 2 0 2551 1049 22957 3380 p 2 17 2403 1180 34583 3605 p 2 5 2564 1031 23145 3351 p 2 0 2445 1155 22553 3204 p 2 0 2316 1284 22987 3009 p 2 1 2147 1452 22630 2879 p 2 0 2214 1386 22551 2973 p 2 0 2305 1295 23857 3087 p 2 1 2118 1481 22834 2833 p 2 0 1917 1683 22523 2613 p 2 1 2498 1101 26060 3352 p 2 0 2415 1185 23573 3186 p 2 0 2753 847 26747 3688 p 2 2 2604 994 27075 3487 p 2 0 2607 993 25693 3382 p 2 0 2596 1004 25218 3331 p 2 1 2134 1465 25907 2900 p 2 1 2117 1482 25227 2824 p 2 0 2027 1573 25169 2783 p 2 0 2325 1275 26138 3087 p 2 1 3227 372 37876 4780 i 2 3600 0 0 151389 13951 p 2 6 3558 36 60848 5474 p 2 4 3278 318 42903 4529 p 2 6 3252 342 42317 4456 p 2 5 3168 427 42960 4293 p 2 4 3292 304 44168 4505 p 2 6 2979 615 40447 4020 p 2 2 2607 991 38661 3538 p 2 4 2424 1172 38257 3336 p 2 7 2530 1063 38328 3479 p 2 4 2316 1280 37365 3226 p 2 4 2495 1101 40028 3432 p 2 3 1923 1674 37610 2796 p 2 2 3073 525 42204 4244 p 2 12 2416 1172 39235 3419 p 2 3 3300 297 48307 4578 p 2 5 3232 363 46055 4450 p 2 5 3164 431 43958 4350 p 2 6 3170 424 44173 4355 p 2 7 2946 647 42882 3993 p 2 10 2896 694 42986 3927 p 2 6 3115 479 43185 4225 p 2 3 3206 391 44742 4380 p 2 14 2977 609 42966 4154 p 2 6 2877 717 42546 3909 p 2 2 3239 359 44937 4466 p 2 8 2675 917 41280 3748 p 2 5 3281 314 47493 4558 p 2 8 2998 594 42863 4049 p 2 6 3229 365 44778 4426 p 2 5 3010 585 42525 4095 p 2 0 2922 678 41838 3932 p 2 3 2814 783 41178 3795 p 2 5 2926 669 41593 3990 p 2 3 3197 400 43573 4335 p 2 13 2975 612 43392 4115 p 2 9 2806 785 41471 3818 p 2 2 3251 347 44106 4485 p 2 4 2550 1046 40490 3552 p 2 4 3185 411 45647 4385 p 2 4 3012 584 43533 4104 p 2 5 3110 485 43300 4223 p 2 2 3069 529 42888 4164 p 2 2 2746 852 41758 3691 p 2 6 2750 844 42614 3734 p 2 8 2834 758 41766 3854 p 2 8 3202 390 44047 4377 p 2 4 2995 601 43456 4081 p 2 3 2687 910 41822 3657 p 2 4 3234 362 44237 4441 p 2 6 2623 971 40855 3689 p 2 4 3246 350 46105 4449 p 2 2 2910 688 41933 3901 p 2 11 3039 550 44183 4151 p 2 5 3046 549 42236 4139 p 2 1 2794 805 41463 3765 p 2 8 2691 901 41730 3696 p 2 3 2931 666 42772 4002 p 2 3 3011 586 42966 4091 p 2 13 2898 689 42432 3965 p 2 8 2543 1049 40738 3475 p 2 6 3018 576 43181 4149 p 2 6 2675 919 42076 3771 p 2 7 3227 366 46017 4487 p 2 5 2813 782 41427 3813 p 2 4 3100 496 44493 4247 p 2 4 2873 723 41792 3966 p 2 6 2751 843 41073 3791 p 2 13 2609 978 41200 3623 p 2 13 2867 720 40640 3904 p 2 6 3072 522 43045 4200 p 2 9 2875 716 42671 3966 p 2 4 2619 977 40653 3586 p 2 6 3141 453 41939 4318 p 2 11 3289 300 45358 4659 p 2 4 3412 184 49374 4853 p 2 6 2870 724 42012 3913 p 2 7 3149 444 44369 4297 p 2 4 3039 557 43114 4163 p 2 7 2739 854 40434 3738 p 2 12 2745 843 41252 3777 p 2 3 2927 670 40883 3968 p 2 9 3227 364 42700 4445 p 2 3 3001 596 42179 4105 p 2 7 2701 892 40115 3685 i 2 3600 0 0 110989 13606 p 2 1 3449 150 43002 5255 p 2 0 3095 505 34268 4329 p 2 0 3062 538 35962 4160 p 2 0 2996 604 34080 4059 p 2 0 2974 626 33506 4015 p 2 3 2717 880 33569 3679 p 2 0 2627 973 32589 3531 p 2 1 2859 740 34435 3943 p 2 1 2818 781 33132 3861 p 2 1 2638 961 32356 3620 p 2 0 2511 1089 32831 3439 p 2 3 2919 678 34274 4089 p 2 0 2889 711 33497 3912 p 2 0 2772 828 33577 3842 p 2 1 2730 869 31500 3649 p 2 0 2875 725 32759 3859 p 2 1 2690 909 31427 3604 p 2 2 2301 1297 29798 3202 p 2 1 2301 1298 30160 3181 p 2 0 2636 964 32875 3610 p 2 0 2604 996 31174 3562 p 2 2 2236 1362 30381 3139 p 2 0 2313 1287 30708 3143 p 2 2 2728 870 31743 3761 p 2 0 2640 960 32236 3628 p 2 1 2813 786 34562 3853 p 2 2 2590 1008 32224 3503 p 2 0 2609 991 31697 3559 p 2 1 2739 860 32855 3737 p 2 1 2388 1211 31584 3283 p 2 0 2454 1146 31283 3303 p 2 2 2285 1313 31476 3183 p 2 0 2407 1193 31522 3286 p 2 1 2299 1300 31616 3173 p 2 2 2209 1389 31454 3094 p 2 1 2541 1058 32483 3537 p 2 1 2663 936 33345 3619 p 2 0 2723 877 33875 3758 p 2 1 2545 1054 32906 3474 p 2 0 2694 906 33610 3627 p 2 1 2833 766 33966 3775 p 2 0 2389 1211 32852 3302 p 2 0 2353 1247 32267 3220 p 2 0 2270 1330 32223 3181 p 2 1 2392 1207 32130 3291 p 2 1 2137 1462 31382 3005 p 2 0 2143 1457 32298 3006 p 2 0 2630 970 32038 3628 p 2 0 2714 886 32811 3736 p 2 0 2727 873 33593 3824 p 2 1 2490 1109 31303 3390 p 2 1 2604 995 31342 3505 p 2 0 2583 1017 30758 3526 p 2 0 2354 1246 29608 3237 p 2 0 2407 1193 29946 3240 p 2 0 2597 1003 31064 3496 p 2 0 2563 1037 30010 3418 p 2 0 2191 1409 28447 3031 p 2 0 2188 1412 28300 2995 p 2 0 2707 893 29638 3683 p 2 0 2708 892 29557 3662 p 2 1 2855 744 30032 3876 p 2 0 2406 1194 27161 3244 p 2 0 2762 838 28659 3673 p 2 0 2731 869 28227 3655 p 2 0 2334 1266 26678 3172 p 2 0 2365 1235 26415 3166 p 2 1 2193 1406 25938 3031 p 2 0 2358 1242 25873 3177 p 2 0 2130 1470 24619 2916 p 2 0 2086 1514 24932 2840 p 2 1 2652 947 26929 3637 p 2 0 2651 949 26792 3493 p 2 0 2553 1047 26343 3439 p 2 0 2270 1330 24926 3035 i 2 3600 0 0 118286 13235 p 2 2 3573 25 50062 5627 p 2 6 3381 213 36807 4748 p 2 3 3137 460 29908 4212 p 2 0 3222 378 30741 4360 p 2 1 3257 342 35637 4464 p 2 2 3079 519 28135 4090 p 2 2 2787 811 26031 3661 p 2 4 3271 325 35051 4605 p 2 2 2988 610 25657 3983 p 2 1 3339 260 29485 4518 p 2 3 3032 565 32038 4129 p 2 0 3193 407 26870 4268 p 2 4 3243 353 27371 4347 p 2 4 3015 581 30960 4115 p 2 0 2824 776 24341 3646 p 2 2 3029 569 27055 4024 p 2 1 2895 704 30796 3906 p 2 2 2777 821 24005 3613 p 2 0 2614 986 22673 3376 p 2 3 3057 540 30244 4218 p 2 0 3064 536 24114 4121 p 2 0 3214 386 25621 4343 p 2 2 3103 495 30349 4246 p 2 1 3092 507 23257 4118 p 2 0 3106 494 22722 4089 p 2 3 2807 790 26855 3810 p 2 1 2584 1015 19723 3338 p 2 1 3008 591 21343 3900 p 2 32 3097 471 29129 4381 p 2 2 2820 778 20747 3695 p 2 5 2432 1163 18180 3170 p 2 22 2943 635 28506 4129 p 2 2 2787 811 19668 3591 p 2 0 3096 504 21906 4030 p 2 12 2762 826 25065 3756 p 2 0 3201 399 20908 4181 p 2 1 3151 448 19971 4108 p 2 11 2735 854 24645 3789 p 2 2 2581 1017 16978 3304 p 2 0 2785 815 17511 3561 p 2 13 2940 647 24428 4022 p 2 0 2750 850 17663 3570 p 2 1 2481 1118 15092 3164 p 2 10 3112 478 24794 4276 p 2 1 2999 600 17071 3857 p 2 1 2954 645 17061 3793 p 2 12 2735 853 21805 3650 p 2 0 2737 863 15024 3447 p 2 0 2965 635 15781 3727 p 2 22 2590 988 20882 3517 p 2 1 2400 1199 12743 2996 p 2 1 2815 784 14226 3526 p 2 0 2778 822 19430 3587 p 2 0 2511 1089 11706 3127 p 2 1 2338 1261 10383 2891 p 2 0 2870 730 18406 3769 p 2 0 2705 895 12104 3393 p 2 1 2960 639 13237 3707 p 2 0 2649 951 16744 3357 p 2 0 2949 651 12176 3615 p 2 0 2819 781 10911 3477 p 2 2 2474 1124 14623 3157 p 2 1 2331 1268 8121 2848 p 2 0 2843 757 9549 3484 p 2 33 2775 792 16021 3728 p 2 0 2497 1103 7197 3060 p 2 0 2943 657 10428 3610 p 2 10 2829 761 15729 3724 p 2 0 2957 643 9284 3733 p 2 0 3067 533 10854 3844 p 2 30 2823 747 16707 3764 p 2 0 2987 613 9548 3643 p 2 0 2949 651 9361 3603 p 2 20 2799 781 16103 3666 p 2 0 2771 829 8354 3355 p 2 0 2876 724 15506 3616 p 2 0 2738 862 8094 3319 p 2 0 2802 798 8308 3407 p 2 0 3011 589 15604 3845 p 2 0 2589 1011 7684 3173 p 2 0 3136 464 11148 3990 p 2 0 2382 1218 6744 2903 p 2 1 2735 864 14848 3469 p 2 0 2966 634 10274 3660 p 2 0 2011 1589 5556 2454 p 2 1 2887 712 14975 3686 p 2 0 2855 745 9413 3483 p 2 0 2879 721 14719 3675 p 2 0 2727 873 7910 3324 p 2 0 2782 818 8152 3423 p 2 0 2639 961 7171 3288 p 2 1 2947 652 15290 3789 p 2 0 2900 700 9240 3567 p 2 0 2864 736 9884 3560 p 2 35 2865 700 16959 3881 p 2 0 2998 602 9995 3746 p 2 0 2192 1408 6171 2676 p 2 4 2723 873 11350 3399 p 2 0 2797 803 8857 3407 p 2 0 2679 921 7659 3311 p 2 7 2664 929 11028 3351 p 2 0 2239 1361 5922 2731 p 2 3 2920 677 11667 3707 p 2 0 2935 665 8951 3631 p 2 0 3351 249 14544 4385 p 2 0 2596 1004 7824 3163 p 2 5 2948 647 12778 3812 p 2 0 3036 564 10321 3771 p 2 0 2123 1477 5560 2591 p 2 3 2828 769 11693 3567 p 2 0 2769 831 7928 3412 p 2 5 2845 750 11433 3579 p 2 0 2703 897 7547 3285 p 2 0 2593 1007 7437 3163 p 2 3 2946 651 12358 3716 p 2 0 2666 934 7777 3257 p 2 0 3134 466 10945 3909 p 2 0 2289 1311 6649 2784 p 2 15 2785 800 15403 3661 p 2 0 2558 1042 7474 3131 p 2 0 2331 1269 6516 2855 p 2 8 2633 959 15116 3400 p 2 0 2765 835 8026 3370 p 2 10 2612 978 14356 3443 p 2 0 2568 1032 7416 3136 p 2 0 2511 1089 6957 3077 p 2 8 2822 770 15900 3699 p 2 0 2653 947 8128 3254 p 2 0 3314 286 13444 4257 p 2 0 2474 1126 7312 2991 p 2 11 2999 590 17386 3946 p 2 0 2911 689 9657 3591 p 2 0 2561 1039 7603 3124 p 2 24 2663 913 15689 3521 p 2 0 2739 861 8024 3327 p 2 0 2787 813 14778 3533 p 2 0 2692 908 7961 3311 p 2 0 2707 893 7824 3338 p 2 1 2994 605 15094 3865 p 2 0 2943 657 9276 3646 p 2 0 3257 343 12465 4158 p 2 1 3144 455 17153 4064 p 2 0 3062 538 11313 3773 p 2 0 2942 658 9953 3616 p 2 0 2199 1401 6099 2670 p 2 1 2691 908 14258 3381 p 2 0 2795 805 8047 3426 p 2 0 2918 682 15252 3681 p 2 0 2675 925 7855 3243 p 2 0 2587 1013 7505 3134 p 2 1 3072 527 16163 3999 p 2 0 2912 688 8826 3620 p 2 0 3111 489 11126 3975 p 2 0 2371 1229 6820 2882 p 2 0 2762 838 14363 3475 p 2 0 3027 573 10575 3790 p 2 0 2064 1536 5793 2552 p 2 1 2903 696 14908 3741 p 2 0 2930 670 8881 3621 p 2 33 2784 783 15966 3754 p 2 0 2564 1036 7417 3162 p 2 0 2777 823 8433 3440 p 2 0 2566 1034 7191 3184 p 2 0 3041 559 10518 3794 p 2 0 3255 345 11928 4149 p 2 0 2466 1134 7151 2995 p 2 24 2895 681 17179 3876 p 2 0 2696 904 7885 3271 p 2 0 2574 1026 7441 3145 p 2 11 2646 943 14714 3485 p 2 0 2762 838 8028 3385 p 2 8 2702 890 14887 3541 p 2 0 2757 843 8292 3389 p 2 0 2675 925 7571 3296 p 2 10 2860 730 15093 3751 p 2 0 2181 1419 5805 2658 p 2 0 2726 874 8545 3318 p 2 0 2536 1064 7732 3091 p 2 9 2756 835 15881 3591 p 2 0 2775 825 8738 3388 p 2 0 2601 999 7261 3149 p 2 11 2876 713 16445 3728 p 2 0 2780 820 8335 3421 p 2 13 2847 740 15173 3719 p 2 0 2740 860 8421 3365 p 2 0 2689 911 8054 3316 p 2 0 2604 996 7408 3178 p 2 5 2869 726 12314 3640 p 2 0 3287 313 14270 4226 p 2 0 2555 1045 7685 3082 p 2 3 2850 747 11910 3563 p 2 0 3008 592 10121 3698 p 2 0 2180 1420 5942 2644 p 2 5 2756 839 11364 3409 p 2 0 2805 795 8597 3403 p 2 0 2592 1008 7570 3131 p 2 4 2525 1071 10551 3136 p 2 0 2642 958 7711 3213 p 2 5 2834 761 11968 3555 p 2 0 2617 983 7761 3191 p 2 0 3179 421 11069 4002 p 2 3 3001 596 12893 3800 p 2 0 2925 675 9028 3660 p 2 0 2978 622 9632 3678 p 2 0 2004 1596 5355 2459 p 2 5 2804 791 11278 3514 i 2 3600 0 0 45388 11646 p 2 4 3411 185 17706 4636 p 2 0 2414 1186 5552 2745 p 2 221 2417 962 23254 4405 p 2 68 2623 909 21689 4129 p 2 0 2394 1206 7726 2970 p 2 0 2368 1232 7060 2901 p 2 0 2183 1417 5541 2566 p 2 243 1907 1450 28702 4382 p 2 0 2162 1438 8995 2684 p 2 0 1821 1779 4617 2288 p 2 0 2103 1497 6104 2538 p 2 0 1720 1880 6328 2156 p 2 0 1490 2110 3963 1877 p 2 0 1707 1893 4849 2129 p 2 0 1705 1895 4245 2084 p 2 0 1944 1656 5400 2341 p 2 0 1529 2071 4003 1933 p 2 0 2683 917 11403 3341 i 2 3600 0 0 92561 14500 p 2 1122 2478 0 115030 13284 p 2 691 2909 0 103787 11717 p 2 211 3389 0 98491 10531 p 2 164 3436 0 101934 10599 p 2 175 3425 0 104740 10007 p 2 167 3433 0 99219 9886 p 2 46 3554 0 80987 8592 p 2 0 3599 1 51330 6141 p 2 0 3599 1 49970 5604 p 2 0 3600 0 43438 5654 p 2 0 3599 1 41902 5429 p 2 0 3596 4 45146 5435 p 2 0 3594 6 39991 5233 p 2 0 3586 14 42372 5228 p 2 0 3589 11 37453 5221 p 2 0 3574 26 38649 5124 p 2 0 3588 12 42391 5323 p 2 0 3576 24 41472 5260 p 2 0 3581 19 43542 5307 p 2 0 3591 9 40521 5302 p 2 0 3589 11 45482 5436 p 2 0 3594 6 43305 5472 p 2 0 3588 12 42061 5394 p 2 0 3577 23 39457 5432 p 2 0 3587 13 43465 5371 p 2 0 3570 30 40613 5295 p 2 0 3570 30 40262 5298 p 2 0 3547 53 36244 5054 p 2 0 3566 34 40209 5257 p 2 0 3559 41 37474 5170 p 2 0 3558 42 38934 5177 p 2 0 3540 60 34422 5121 p 2 0 3554 46 39338 5160 p 2 0 3550 50 35571 5228 p 2 0 3572 28 38184 5276 p 2 0 3519 81 33576 5087 p 2 0 3541 59 36444 5163 p 2 0 3527 73 36454 5117 p 2 0 3545 55 34263 5089 p 2 0 3487 113 30825 4905 p 2 0 3535 65 33752 4963 p 2 0 3497 103 33358 5069 p 2 0 3512 88 33841 4986 p 2 0 3529 71 37075 5146 p 2 0 3434 166 22357 4566 p 2 0 3514 86 30968 5005 p 2 0 3527 73 31100 4860 p 2 0 3544 56 35883 5265 p 2 0 3448 152 20757 4680 p 2 0 3449 151 29096 4762 p 2 0 3481 119 28159 4784 p 2 0 3483 117 33724 4863 p 2 0 3397 203 22265 4401 p 2 0 3381 219 25379 4474 p 2 0 3426 174 30416 4625 p 2 0 3427 173 27134 4576 p 2 0 3356 244 22730 4332 p 2 0 3452 148 26772 4613 p 2 0 3456 144 26395 4702 p 2 0 3566 34 38983 5549 i 2 3600 0 0 69684 12518 p 2 0 3202 398 11053 3916 p 2 0 3385 215 13951 4347 p 2 0 3093 507 11443 3865 p 2 0 2914 686 10530 3638 p 2 0 2861 739 9508 3497 p 2 0 2825 775 9214 3480 p 2 0 2877 723 9424 3505 p 2 0 2869 731 9989 3621 p 2 0 2798 802 8972 3472 p 2 0 2963 637 11914 3842 p 2 0 2849 751 9809 3613 p 2 0 2802 798 8651 3417 p 2 0 2766 834 8959 3370 p 2 0 2386 1214 7206 2950 p 2 0 2548 1052 7547 3106 p 2 0 2399 1201 7405 2942 p 2 0 2463 1137 6970 2988 p 2 0 2572 1028 7762 3140 p 2 0 2551 1049 7854 3082 p 2 0 2440 1160 7052 2943 p 2 0 2779 821 8978 3383 p 2 0 2457 1143 7267 2973 p 2 0 2725 875 9027 3304 p 2 0 2465 1135 7995 3030 p 2 0 2337 1263 6723 2792 p 2 0 2338 1262 7151 2832 p 2 0 2056 1544 5837 2490 p 2 0 2138 1462 6120 2624 p 2 0 2290 1310 6936 2791 p 2 0 2234 1366 6210 2736 p 2 0 2249 1351 6820 2708 p 2 0 2508 1092 8077 3083 p 2 0 2331 1269 6765 2799 p 2 0 1927 1673 5779 2383 p 2 0 2465 1135 7882 2975 p 2 0 2503 1097 7946 2978 p 2 0 2394 1206 7314 2878 p 2 0 1973 1627 5755 2435 p 2 0 2169 1431 5656 2629 p 2 0 2214 1386 6689 2688 p 2 0 2294 1306 6608 2760 p 2 0 2227 1373 6285 2702 p 2 0 2256 1344 6479 2706 p 2 0 2060 1540 5362 2499 p 2 0 2414 1186 7242 2895 p 2 0 2028 1572 5957 2457 p 2 1 2482 1117 8013 2986 p 2 0 2463 1137 7549 3008 p 2 0 2236 1364 6625 2681 p 2 0 2185 1415 7158 2678 p 2 0 2101 1499 6202 2529 p 2 0 2031 1569 5855 2487 p 2 0 2039 1561 6299 2510 p 2 0 2256 1344 5983 2733 p 2 0 1539 2061 4237 1937 p 2 0 2128 1472 5944 2568 p 2 0 2494 1106 7181 2990 p 2 0 2265 1335 6572 2763 p 2 0 2507 1093 7623 3018 p 2 0 2384 1216 7897 2919 p 2 0 2180 1420 6343 2620 p 2 0 2034 1566 5862 2511 p 2 0 1948 1652 5737 2382 p 2 0 2243 1357 6556 2703 p 2 0 2207 1393 6373 2697 p 2 0 2117 1483 5765 2598 p 2 1 2128 1471 6549 2600 p 2 0 2475 1125 7054 3003 p 2 0 1711 1889 4803 2114 p 2 0 2071 1529 6467 2529 p 2 0 2406 1194 7869 2917 p 2 0 2397 1203 7011 2863 p 2 0 2534 1066 8193 3024 p 2 0 2164 1436 6183 2615 p 2 0 2106 1494 6320 2579 p 2 0 2115 1485 5480 2555 p 2 1 2105 1494 6221 2605 p 2 0 2125 1475 5786 2609 p 2 0 2078 1522 5620 2496 p 2 1 2071 1528 5924 2538 p 2 0 2358 1242 6928 2869 p 2 0 2384 1216 6718 2867 p 2 0 2520 1080 7692 3023 p 2 0 2420 1180 7159 2887 p 2 0 2281 1319 6591 2732 p 2 0 1911 1689 4742 2340 p 2 0 2295 1305 6594 2760 p 2 1 2254 1345 6553 2742 p 2 0 2243 1357 6297 2717 p 2 0 2238 1362 6433 2702 p 2 0 2136 1464 6589 2625 p 2 0 2414 1186 7297 2942 p 2 0 2204 1396 6138 2661 p 2 0 1831 1769 4869 2280 p 2 0 2420 1180 8128 2925 p 2 0 2453 1147 7145 2955 p 2 0 2571 1029 8492 3091 p 2 0 1973 1627 5807 2465 p 2 0 2130 1470 5920 2582 p 2 0 2101 1499 6181 2560 p 2 0 2185 1415 6418 2660 p 2 0 2171 1429 5604 2619 p 2 0 2053 1547 6258 2528 p 2 0 2428 1172 7810 2958 p 2 0 2193 1407 5919 2639 p 2 0 1915 1685 5169 2327 p 2 0 2276 1324 7223 2723 i 2 3600 0 0 99035 12421 p 2 0 3579 21 29998 5265 p 2 0 3251 349 12302 4058 p 2 12 3214 374 19537 4300 p 2 0 3397 203 16756 4380 p 2 0 3315 285 18014 4332 p 2 0 3210 390 12191 4033 p 2 0 3028 572 9958 3707 p 2 3 3264 333 17510 4383 p 2 0 3182 418 10783 4057 p 2 0 3398 202 16828 4498 p 2 0 2814 786 9701 3418 p 2 9 3300 291 19400 4315 p 2 0 3289 311 12241 4172 p 2 0 3182 418 11865 3961 p 2 2 3038 560 16524 3812 p 2 0 2969 631 10824 3640 p 2 0 2957 643 10678 3614 p 2 0 2783 817 9276 3350 p 2 0 2804 796 9323 3383 p 2 0 3106 494 10744 3937 p 2 0 2892 708 8350 3580 p 2 0 3340 260 15549 4371 p 2 0 2627 973 8130 3196 p 2 0 2994 606 10017 3730 p 2 0 2933 667 10073 3581 p 2 0 2704 896 9188 3264 p 2 0 2839 761 10029 3407 p 2 0 2674 926 8088 3232 p 2 0 2914 686 9454 3528 p 2 0 2999 601 11312 3706 p 2 0 2277 1323 6196 2763 p 2 0 2451 1149 6899 2942 p 2 0 2890 710 10121 3548 p 2 0 3246 354 13877 4163 p 2 0 2604 996 7989 3149 p 2 0 3087 513 10593 3847 p 2 0 3107 493 10505 3830 p 2 0 2405 1195 6941 2878 p 2 0 2843 757 8747 3467 p 2 0 2822 778 8358 3407 p 2 0 2907 693 8675 3565 p 2 0 2774 826 8272 3403 p 2 0 2980 620 9792 3645 p 2 0 2739 861 8290 3360 p 2 0 2926 674 9305 3614 p 2 0 3282 318 14314 4232 p 2 0 2490 1110 7731 3012 p 2 0 3137 463 10366 3917 p 2 0 2241 1359 6119 2714 p 2 0 2915 685 9226 3584 p 2 0 2474 1126 7013 2997 p 2 0 2937 663 9068 3576 p 2 0 2849 751 8444 3492 p 2 0 2772 828 8091 3382 p 2 0 2743 857 8110 3333 p 2 0 2669 931 7847 3269 p 2 0 2965 635 9581 3618 p 2 0 3334 266 16464 4309 p 2 0 2622 978 8457 3146 p 2 0 2856 744 9259 3463 p 2 0 2820 780 10086 3442 p 2 0 2519 1081 7922 3041 p 2 0 2371 1229 7089 2836 p 2 0 2744 856 8390 3309 p 2 0 2845 755 9132 3441 p 2 0 2845 755 8761 3460 p 2 0 2815 785 8454 3409 p 2 0 3156 444 12913 3906 p 2 0 2964 636 9852 3601 p 2 0 3461 139 26912 5156 i 2 3600 0 0 115353 13215 p 2 0 3310 290 18716 4343 p 2 17 2958 625 41634 4833 p 2 0 3328 272 14438 4276 p 2 0 3094 506 11931 3833 p 2 10 3353 237 41936 5257 p 2 0 3060 540 12420 3815 p 2 0 3080 520 14024 3797 p 2 7 3061 532 40540 4797 p 2 0 3354 246 14650 4349 p 2 4 3105 491 41009 4894 p 2 0 3013 587 11174 3729 p 2 0 3452 148 17734 4579 p 2 4 3310 286 14887 4233 p 2 0 3342 258 15971 4252 p 2 0 3084 516 12298 3755 p 2 0 2487 1113 8001 2979 p 2 0 3124 476 12778 3823 p 2 0 3117 483 12253 3816 p 2 0 2955 645 10794 3565 p 2 0 2753 847 9452 3352 p 2 0 3036 564 11255 3728 p 2 4 2949 647 10771 3586 p 2 0 3396 204 16311 4374 p 2 0 3133 467 12037 3948 p 2 0 3010 590 11481 3721 p 2 0 3032 568 10827 3741 p 2 0 2823 777 9341 3449 p 2 0 2923 677 10185 3596 p 2 0 2753 847 8601 3356 p 2 0 2904 696 9778 3575 p 2 0 2081 1519 5819 2519 p 2 4 2632 964 8802 3208 p 2 0 3051 549 11395 3753 p 2 4 2656 940 8895 3239 p 2 0 3219 381 12875 3978 p 2 0 3059 541 12147 3784 p 2 0 2919 681 9974 3579 p 2 2 2658 940 9034 3251 p 2 0 2689 911 8537 3225 p 2 0 2973 627 10592 3619 p 2 0 2791 809 9267 3393 p 2 0 2673 927 8464 3222 p 2 0 1867 1733 5241 2288 p 2 4 2617 979 8419 3206 p 2 0 2944 656 10364 3604 p 2 2 2688 910 9014 3259 p 2 0 3349 251 16023 4288 p 2 0 3161 439 12684 3911 p 2 0 3146 454 13216 3845 p 2 0 2945 655 11052 3596 p 2 0 2714 886 8793 3257 p 2 0 2855 745 9782 3439 p 2 0 2812 788 9390 3366 p 2 0 2717 883 8935 3279 p 2 0 1962 1638 5565 2398 p 2 0 2581 1019 8686 3141 p 2 0 2984 616 9999 3696 p 2 4 2856 740 9571 3572 p 2 0 3380 220 15869 4360 p 2 0 3105 495 11878 3832 p 2 2 2982 616 12070 3648 p 2 0 2919 681 10848 3515 p 2 0 2698 902 8917 3232 p 2 0 2043 1557 6004 2472 p 2 0 2385 1215 7860 2845 p 2 0 2620 980 8205 3151 p 2 0 2759 841 9425 3283 p 2 4 2680 916 8934 3279 p 2 0 2575 1025 8039 3103 i 2 3600 0 0 55146 12071 p 2 48 3462 90 50955 6894 p 2 0 2854 746 12960 3953 p 2 0 2552 1048 8834 3183 p 2 129 3193 278 50425 6291 p 2 0 2949 651 12340 4049 p 2 11 3241 348 45406 6134 p 2 0 2681 919 11466 3700 p 2 0 2171 1429 7557 2834 p 2 0 2606 994 10659 3176 p 2 126 3089 385 50689 6304 p 2 0 2731 869 12902 3876 p 2 36 3288 276 47274 6235 p 2 0 2719 881 12567 3956 p 2 0 2588 1012 7937 3365 p 2 157 3111 332 52390 6371 p 2 0 2846 754 14249 4102 p 2 0 2631 969 10827 3241 p 2 2 3154 444 38993 5490 p 2 0 2725 875 12215 3529 p 2 0 2468 1132 10612 3011 p 2 0 2653 947 11472 3215 p 2 8 3161 431 42551 5658 p 2 0 2552 1048 10531 3216 p 2 0 2819 781 12066 3495 p 2 0 2538 1062 10875 3104 p 2 0 2531 1069 9900 3146 p 2 0 2127 1473 7176 2628 p 2 0 2209 1391 5912 2707 p 2 0 2150 1450 7572 2619 p 2 0 1958 1642 6726 2427 p 2 0 2085 1515 5931 2547 i 2 3600 0 0 65724 12697 p 2 37 3506 57 20441 5219 p 2 6 3079 515 22280 4383 p 2 0 3053 547 11294 3706 p 2 0 2627 973 9096 3190 p 2 0 2516 1084 8465 2974 p 2 0 2653 947 21069 3627 p 2 0 2670 930 10136 3253 p 2 1 2675 924 20814 3765 p 2 0 2579 1021 8487 3102 p 2 0 2404 1196 8666 2970 p 2 4 2677 919 20472 3660 p 2 0 2101 1499 6551 2536 p 2 0 2377 1223 7379 2871 p 2 0 2319 1281 7357 2737 p 2 0 2591 1009 9109 3097 p 2 0 2321 1279 6752 2764 p 2 0 2889 711 10485 3465 p 2 0 2591 1009 8814 3170 p 2 0 2358 1242 6940 2782 p 2 10 2296 1294 15929 3248 p 2 0 2145 1455 7008 2621 p 2 0 1714 1886 4794 2108 p 2 0 2352 1248 7480 2801 p 2 0 2213 1387 13575 2986 p 2 0 2309 1291 7868 2800 p 2 0 1796 1804 5584 2205 p 2 3 2174 1423 14051 2928 p 2 0 2321 1279 8348 2850 p 2 0 2179 1421 6790 2652 p 2 0 2673 927 10218 3268 p 2 0 2415 1185 7603 2972 p 2 0 2332 1268 7280 2843 p 2 0 2121 1479 6155 2526 p 2 0 2340 1260 7478 2812 p 2 0 2402 1198 7934 2869 p 2 0 2289 1311 7026 2796 p 2 0 2244 1356 6754 2693 p 2 0 2117 1483 6560 2523 p 2 0 2406 1194 7074 2853 p 2 0 2129 1471 6091 2506 p 2 0 2038 1562 6127 2385 p 2 1 2445 1154 8266 2977 p 2 0 2237 1363 6795 2710 p 2 0 2479 1121 7277 2919 p 2 3 2408 1189 7562 2895 p 2 0 2270 1330 6474 2732 p 2 0 2163 1437 6645 2627 p 2 0 2173 1427 6574 2648 p 2 0 2385 1215 7346 2809 p 2 0 2196 1404 7215 2688 p 2 0 2333 1267 7793 2798 p 2 0 2148 1452 6649 2556 p 2 0 2029 1571 5716 2380 p 2 0 2444 1156 8187 2993 p 2 0 2115 1485 6547 2573 p 2 0 2417 1183 8024 2909 p 2 0 2209 1391 6405 2623 p 2 0 1743 1857 5048 2111 p 2 0 2106 1494 6693 2555 p 2 0 2146 1454 6692 2606 p 2 0 2274 1326 6674 2696 p 2 0 1478 2122 4658 1870 p 2 1 2069 1530 6297 2525 p 2 0 2276 1324 6722 2707 p 2 0 2167 1433 6089 2558 p 2 0 2393 1207 8490 2921 p 2 0 2250 1350 7153 2690 p 2 0 2414 1186 7722 2868 p 2 0 2257 1343 6985 2687 p 2 0 2757 843 10821 3579 i 2 3600 0 0 69776 12683 p 2 0 3202 398 12724 3967 p 2 0 3145 455 10887 3834 p 2 0 2871 729 8602 3433 p 2 0 2885 715 9520 3517 p 2 0 2736 864 8617 3352 p 2 0 2324 1276 6666 2766 p 2 0 2722 878 9456 3313 p 2 0 2554 1046 7201 3039 p 2 0 2563 1037 7298 3038 p 2 0 2473 1127 7323 2985 p 2 0 2390 1210 6515 2822 p 2 0 2374 1226 6455 2833 p 2 0 2348 1252 6472 2784 p 2 0 2232 1368 6270 2657 p 2 0 2191 1409 6108 2616 p 2 0 2157 1443 6040 2584 p 2 2 2647 951 7842 3101 p 2 0 2185 1415 6025 2629 p 2 0 2618 982 8835 3168 p 2 0 2244 1356 6589 2720 p 2 0 2491 1109 7253 2973 p 2 0 2026 1574 5505 2458 p 2 0 1712 1888 4305 2078 p 2 0 2140 1460 5546 2545 p 2 0 2244 1356 5947 2664 p 2 0 2041 1559 5446 2478 p 2 0 2150 1450 5697 2543 p 2 0 2116 1484 5431 2527 p 2 0 2373 1227 6521 2834 p 2 0 2580 1020 8173 3103 p 2 0 2351 1249 6353 2806 p 2 0 2420 1180 6128 2848 p 2 0 2260 1340 5833 2688 p 2 0 1700 1900 4408 2089 p 2 0 1915 1685 5311 2320 p 2 0 1840 1760 4684 2245 p 2 0 1864 1736 5029 2277 p 2 0 2130 1470 6063 2557 p 2 0 3018 582 13929 3958 i 2 3600 0 0 112748 13473 p 2 0 3456 144 15406 4685 p 2 0 3532 68 21036 4979 p 2 0 3112 488 11497 4010 p 2 0 2526 1074 7332 3180 p 2 0 2364 1236 6977 2954 p 2 0 2589 1011 7886 3194 p 2 0 2608 992 7813 3242 p 2 0 2155 1445 5855 2709 p 2 0 1496 2104 4001 1960 p 2 0 2362 1238 6862 2887 p 2 0 2225 1375 6243 2744 p 2 0 3385 215 15617 4535 p 2 0 3009 591 10918 3784 p 2 0 2483 1117 7305 3062 p 2 0 2704 896 8997 3315 p 2 0 2999 601 10979 3772 p 2 1 2684 915 16455 3513 p 2 0 2938 662 10114 3663 p 2 0 3090 510 16884 3975 p 2 0 2865 735 9205 3563 p 2 0 2760 840 8597 3454 p 2 0 1838 1762 5242 2360 p 2 0 2797 803 15065 3608 p 2 0 3196 404 11161 4193 p 2 0 2955 645 9481 3772 p 2 0 3296 304 14228 4352 p 2 0 3074 526 11432 3945 p 2 0 2894 706 9998 3620 p 2 0 2691 909 8617 3349 p 2 0 2832 768 9290 3531 p 2 0 2798 802 8761 3427 p 2 0 2706 894 8226 3331 p 2 0 2677 923 8180 3286 p 2 0 2566 1034 7831 3174 p 2 0 2514 1086 7064 3091 p 2 0 2958 642 9008 3756 p 2 0 2947 653 9009 3723 p 2 0 3178 422 12432 4154 p 2 0 2690 910 8365 3400 p 2 0 2971 629 10093 3762 p 2 0 2964 636 10043 3754 p 2 0 2689 911 8332 3339 p 2 0 2774 826 8378 3477 p 2 0 2687 913 7696 3351 p 2 0 2827 773 8462 3558 p 2 0 2717 883 8096 3418 p 2 0 2678 922 7734 3357 p 2 0 2928 672 9730 3723 p 2 0 2585 1015 7767 3215 p 2 0 3249 351 14903 4257 p 2 0 3406 194 18254 4930 i 2 3600 0 0 60629 12414 p 2 0 3504 96 18116 4293 p 2 9 3260 331 13636 3873 p 2 0 2727 873 8406 3267 p 2 0 2682 918 9400 3150 p 2 0 2705 895 10006 3210 p 2 0 2696 904 8018 3132 p 2 0 2628 972 9946 3031 p 2 1 2652 947 9002 3076 p 2 0 3036 564 10780 3482 p 2 0 2668 932 8963 3095 p 2 2 2825 773 11814 3439 p 2 0 2706 894 9342 3165 p 2 9 2780 811 12025 3364 p 2 0 2494 1106 9799 2932 p 2 0 2704 896 9950 3109 p 2 0 2666 934 9444 3088 p 2 0 2684 916 10011 3150 p 2 0 3130 470 13033 3909 i 2 3600 0 0 65045 12818 p 2 0 2887 713 11760 3509 p 2 2 3149 449 11532 3675 p 2 0 2529 1071 8891 3031 p 2 0 2793 807 9655 3250 p 2 0 2375 1225 8426 2853 p 2 0 2561 1039 7929 2972 p 2 0 2032 1568 5951 2391 p 2 0 2428 1172 7472 2812 p 2 0 2231 1369 6817 2690 p 2 0 2487 1113 6960 2858 p 2 0 2162 1438 6361 2593 p 2 0 2264 1336 6183 2659 p 2 2 2235 1363 7549 2749 p 2 0 2392 1208 6547 2739 p 2 0 2506 1094 8737 3044 p 2 0 2557 1043 7807 3013 p 2 0 2211 1389 6995 2709 i 2 3600 0 0 42338 11581 p 2 3 2780 817 10544 3707 p 2 0 1832 1768 4733 2156 p 2 10 1843 1747 4980 2295 p 2 0 1746 1854 4034 2141 p 2 0 1574 2026 3294 1948 p 2 0 1569 2031 3831 1943 p 2 0 1596 2004 4258 2034 p 2 3 1763 1834 5198 2171 p 2 0 2045 1555 4843 2430 p 2 0 1665 1935 4209 2055 p 2 0 1217 2383 2839 1637 p 2 0 1601 1999 3867 1975 p 2 0 1670 1930 3443 2003 p 2 0 1392 2208 2808 1735 p 2 3 1466 2131 3833 1838 p 2 0 1247 2353 3340 1625 p 2 0 1425 2175 2959 1770 p 2 3 1225 2372 3073 1641 p 2 0 1468 2132 3465 1864 p 2 10 1366 2224 4256 1800 p 2 0 1860 1740 4252 2248 p 2 0 1469 2131 3328 1871 p 2 0 1437 2163 3746 1848 p 2 0 1409 2191 3236 1807 p 2 0 1589 2011 5019 2108 i 2 3600 0 0 39402 11315 p 2 0 2527 1073 5242 2824 p 2 0 2701 899 6335 3051 p 2 0 2628 972 7908 3061 p 2 0 2933 667 6539 3104 p 2 0 2475 1125 6378 2798 p 2 0 2287 1313 5137 2634 p 2 0 2814 786 7686 3158 p 2 0 2681 919 6480 2953 p 2 0 2162 1438 5289 2489 p 2 0 2628 972 5814 2811 p 2 0 2258 1342 5641 2494 p 2 0 2593 1007 5576 2786 p 2 0 2187 1413 5012 2449 p 2 0 1740 1860 3512 2042 p 2 0 2454 1146 5671 2665 p 2 0 2284 1316 4470 2455 p 2 0 1810 1790 4085 2083 p 2 0 2344 1256 4950 2504 p 2 0 2763 837 8599 3270 i 2 3600 0 0 59892 12437 p 2 10 2654 936 10635 3496 p 2 0 2694 906 10059 3115 p 2 0 2314 1286 6527 2702 p 2 0 1990 1610 6465 2428 p 2 0 2106 1494 5905 2479 p 2 0 1241 2359 3377 1640 p 2 0 1596 2004 4547 1965 p 2 2 1386 2212 4613 1894 p 2 0 1841 1759 6369 2381 p 2 10 1727 1863 6335 2307 p 2 0 2611 989 8339 2991 p 2 0 2169 1431 6097 2530 p 2 4 1593 2003 5585 2141 p 2 0 1667 1933 5027 2115 p 2 0 1394 2206 4023 1819 p 2 10 1519 2071 5761 2029 p 2 0 1416 2184 4237 1867 p 2 0 1100 2500 3091 1502 p 2 0 1263 2337 3555 1692 p 2 0 1266 2334 4666 1736 p 2 0 1161 2439 2974 1546 p 2 0 1533 2067 4952 1995 p 2 1 1686 1913 6042 2180 p 2 0 1758 1842 5714 2247 p 2 0 1622 1978 5805 2100 p 2 0 1611 1989 4945 2033 p 2 0 1253 2347 3864 1702 p 2 2 1303 2295 4091 1776 p 2 0 1395 2205 3991 1827 i 2 3600 0 0 71509 12445 p 2 0 2980 620 13138 3786 p 2 0 2749 851 9204 3205 p 2 0 2838 762 10529 3306 p 2 1 2667 932 10242 3106 p 2 0 2413 1187 8215 2827 p 2 0 2836 764 11035 3348 p 2 0 2422 1178 8617 2875 p 2 0 2737 863 9828 3197 p 2 0 2594 1006 9694 3062 p 2 0 2593 1007 10490 3072 p 2 0 2408 1192 9159 2893 p 2 0 1997 1603 7446 2396 p 2 0 2022 1578 7852 2454 p 2 0 2272 1328 8946 2739 p 2 0 2229 1371 7754 2647 p 2 0 2571 1029 10390 3000 p 2 0 2569 1031 9072 2963 p 2 0 2706 894 10738 3123 p 2 0 2392 1208 8859 2877 i 2 3600 0 0 47040 11732 p 2 0 3209 391 14157 3968 p 2 0 2089 1511 5814 2500 p 2 4 2113 1483 7590 2628 p 2 0 1952 1648 5375 2397 p 2 0 1856 1744 5035 2281 p 2 0 1852 1748 5609 2260 p 2 0 1941 1659 5664 2425 p 2 0 1990 1610 6741 2460 p 2 0 2485 1115 7862 2927 p 2 0 2144 1456 6557 2604 p 2 0 1926 1674 5612 2351 p 2 0 2078 1522 6319 2498 p 2 0 2035 1565 6065 2441 p 2 0 1712 1888 4470 2093 p 2 0 1838 1762 5965 2269 p 2 0 1749 1851 4956 2154 p 2 0 1929 1671 5063 2307 p 2 4 1750 1846 5096 2184 p 2 0 1827 1773 5867 2288 p 2 0 1845 1755 5578 2280 p 2 0 2187 1413 6583 2588 p 2 0 1828 1772 5564 2258 p 2 0 1717 1883 5101 2142 p 2 5 1951 1644 5781 2370 p 2 0 1704 1896 4727 2115 p 2 0 1838 1762 5589 2268 p 2 0 1637 1963 4175 2041 p 2 0 1586 2014 4652 2013 p 2 0 1379 2221 3691 1740 p 2 0 1644 1956 5223 2087 p 2 0 1810 1790 4855 2208 p 2 0 1842 1758 5401 2276 p 2 0 2155 1445 6592 2586 p 2 0 1839 1761 4849 2260 p 2 0 1785 1815 5447 2208 p 2 0 1726 1874 5308 2149 p 2 0 1687 1913 5101 2068 p 2 4 1897 1699 5262 2328 p 2 0 1709 1891 4607 2121 p 2 0 1801 1799 5402 2197 p 2 0 1307 2293 3604 1677 p 2 4 1574 2022 4891 2007 p 2 0 1796 1804 5350 2223 p 2 0 1708 1892 5742 2170 p 2 0 1672 1928 4548 2020 p 2 0 1901 1699 5532 2312 p 2 0 1744 1856 4516 2131 p 2 3 1704 1893 4794 2139 p 2 0 1739 1861 5094 2170 p 2 0 1699 1901 4643 2114 p 2 0 1712 1888 5032 2105 p 2 0 1639 1961 4376 2053 p 2 0 1341 2259 3693 1708 p 2 5 1513 2082 4738 1946 p 2 0 1659 1941 4839 2090 p 2 0 1851 1749 5394 2286 p 2 0 2083 1517 5878 2463 p 2 0 1895 1705 5271 2266 p 2 3 1725 1872 4927 2156 p 2 0 1872 1728 4787 2231 p 2 0 1583 2017 4522 1966 p 2 5 1765 1830 5954 2205 p 2 0 1648 1952 4754 2083 p 2 0 1447 2153 3909 1806 p 2 0 1461 2139 3760 1820 p 2 0 1532 2068 4466 1946 p 2 0 1776 1824 4858 2169 p 2 0 1803 1797 5394 2205 p 2 0 2125 1475 6311 2520 p 2 0 1774 1826 5257 2172 p 2 0 1808 1792 5108 2221 p 2 0 1716 1884 5166 2141 p 2 0 1833 1767 4921 2177 p 2 0 1839 1761 5303 2228 p 2 0 1695 1905 4648 2069 p 2 0 1727 1873 4474 2093 p 2 0 1313 2287 3573 1680 p 2 0 1674 1926 4742 2068 p 2 0 1790 1810 5594 2197 p 2 3 1799 1798 5201 2227 p 2 0 2044 1556 6580 2456 p 2 0 1791 1809 5061 2195 p 2 4 1757 1839 5471 2200 p 2 0 1894 1706 5545 2259 p 2 0 1571 2029 4864 1965 p 2 0 1774 1826 6069 2206 p 2 0 1660 1940 4543 2054 p 2 0 1701 1899 5296 2088 p 2 0 1366 2234 3353 1706 p 2 0 1483 2117 4305 1903 p 2 0 1666 1934 4937 2082 p 2 2 1765 1833 5279 2189 p 2 0 2041 1559 5908 2415 p 2 0 1916 1684 5416 2302 p 2 5 1754 1841 5551 2187 p 2 0 1797 1803 4874 2170 p 2 0 1587 2013 4679 1982 p 2 0 1752 1848 4653 2125 p 2 0 1651 1949 4637 2019 p 2 0 1319 2281 4360 1705 p 2 0 1504 2096 4069 1865 p 2 3 1633 1964 4416 2007 i 2 3600 0 0 94101 13029 p 2 0 3476 124 24941 4652 p 2 0 2708 892 9980 3380 p 2 0 2910 690 14307 3630 p 2 0 2670 930 9652 3275 p 2 0 3040 560 15451 3797 p 2 0 2674 926 9927 3270 p 2 0 2602 998 9196 3165 p 2 0 2953 647 11430 3617 p 2 0 2745 855 9675 3352 p 2 0 2584 1016 8748 3166 p 2 0 2122 1478 7419 2620 p 2 109 2740 751 50416 5200 p 2 0 2920 680 11840 3670 p 2 0 3030 570 12696 3794 p 2 18 3151 431 41780 4897 p 2 0 3025 575 13197 3820 p 2 4 3206 390 36199 4770 p 2 0 2927 673 12721 3681 p 2 0 2974 626 10889 3664 p 2 0 3037 563 35202 4490 p 2 0 2892 708 14001 3653 p 2 0 2690 910 10329 3334 p 2 0 1990 1610 6336 2470 p 2 3 2230 1367 8034 2770 p 2 0 2851 749 11042 3529 p 2 0 2692 908 9586 3271 p 2 2 2884 714 11583 3533 p 2 0 2600 1000 8896 3158 p 2 0 2468 1132 8448 2980 p 2 0 2584 1016 9474 3163 p 2 0 2758 842 9801 3323 p 2 2 2331 1267 7612 2889 p 2 0 1780 1820 5356 2230 p 2 0 2563 1037 8618 3127 p 2 0 1846 1754 5200 2291 p 2 6 2415 1179 7955 3001 p 2 0 2713 887 8936 3325 p 2 0 2375 1225 7726 2896 p 2 3 2763 834 10182 3406 p 2 0 2563 1037 8741 3109 p 2 2 2718 880 9588 3293 p 2 0 2465 1135 8003 3020 p 2 0 2691 909 8934 3282 p 2 0 2524 1076 8661 3114 p 2 0 2404 1196 7467 2954 p 2 0 2305 1295 7549 2833 p 2 0 2443 1157 8557 3033 p 2 0 2493 1107 8363 3057 p 2 0 2331 1269 7186 2820 p 2 0 2155 1445 6901 2619 p 2 0 2645 955 9582 3240 p 2 0 2378 1222 7787 2879 p 2 0 2491 1109 8148 3017 p 2 0 2379 1221 7779 2885 p 2 0 2424 1176 7780 2922 p 2 0 2328 1272 7362 2842 p 2 6 2313 1281 7771 2877 p 2 0 2425 1175 8044 2939 p 2 2 2529 1069 8932 3114 p 2 0 2742 858 9334 3347 p 2 0 2394 1206 8034 2903 p 2 0 2094 1506 6570 2563 p 2 2 2680 918 10128 3285 p 2 0 2441 1159 8107 2972 p 2 0 2677 923 9901 3281 p 2 0 2343 1257 7955 2901 p 2 0 2262 1338 7385 2739 p 2 3 2191 1406 7151 2705 p 2 0 2375 1225 7320 2892 p 2 0 2325 1275 7480 2799 p 2 6 2342 1252 8172 2895 p 2 0 2656 944 8399 3268 p 2 0 2340 1260 7198 2901 p 2 0 2349 1251 8146 2877 p 2 0 3034 566 12967 3823 p 2 0 2283 1317 7933 2847 p 2 0 2727 873 10164 3369 p 2 0 2146 1454 7374 2693 p 2 0 2768 832 10211 3391 p 2 0 2539 1061 8736 3087 p 2 0 1780 1820 5829 2241 p 2 0 3462 138 25988 5170 i 2 3600 0 0 156700 15037 p 2 0 3554 46 31651 4883 p 2 0 3313 287 19287 4316 p 2 0 3349 251 17388 4306 p 2 0 3384 216 18114 4385 p 2 0 2598 1002 8811 3157 p 2 0 2582 1018 9002 3138 p 2 0 1940 1660 6230 2441 p 2 0 1902 1698 6064 2376 p 2 0 1915 1685 6061 2398 p 2 0 1664 1936 5065 2122 p 2 0 1922 1678 5946 2373 p 2 0 2483 1117 8368 2948 p 2 0 3358 242 16624 4391 p 2 0 3298 302 14154 4206 p 2 0 3516 84 23716 4818 p 2 0 3400 200 16767 4402 p 2 0 3271 329 15387 4123 p 2 0 3224 376 13312 4044 p 2 0 3317 283 14772 4194 p 2 0 2803 797 9867 3373 p 2 0 2948 652 10794 3562 p 2 0 2787 813 9467 3331 p 2 0 3076 524 12003 3744 p 2 0 2999 601 11209 3647 p 2 0 3224 376 12320 4080 p 2 0 2898 702 9814 3591 p 2 0 3430 170 19211 4508 p 2 0 3235 365 14718 4108 p 2 0 2985 615 11329 3662 p 2 0 3339 261 16300 4231 p 2 0 3083 517 12773 3773 p 2 0 3119 481 12657 3884 p 2 0 3071 529 11790 3786 p 2 0 2997 603 10899 3660 p 2 0 2947 653 10673 3659 p 2 0 3050 550 11602 3748 p 2 0 2880 720 10181 3527 p 2 0 3226 374 13195 4126 p 2 0 3471 129 19685 4592 p 2 0 3319 281 14594 4267 p 2 0 3315 285 15325 4204 p 2 0 3213 387 13172 4042 p 2 0 3125 475 12396 3867 p 2 0 3049 551 11411 3776 p 2 0 3032 568 11241 3738 p 2 0 3000 600 11125 3670 p 2 0 2982 618 10592 3675 p 2 0 3000 600 11164 3688 p 2 0 2824 776 9752 3439 p 2 0 3097 503 12087 3895 p 2 0 3479 121 22842 4611 p 2 0 3002 598 12228 3713 p 2 0 2608 992 9019 3185 p 2 0 3247 353 15566 4070 p 2 0 3574 26 52708 5793 i 2 3600 0 0 118182 14682 p 2 0 3494 106 24020 4896 p 2 0 3600 0 44976 5526 p 2 2 3598 0 41733 5661 p 2 0 3600 0 45078 5672 p 2 0 3600 0 46396 5585 p 2 0 3600 0 39895 5629 p 2 0 3600 0 42021 5436 p 2 0 3600 0 51586 5915 p 2 0 3600 0 49330 5975 p 2 0 3600 0 38053 5169 p 2 2 3598 0 38054 5579 p 2 3 3597 0 43218 6089 p 2 35 3565 0 47827 6522 p 2 3 3597 0 44169 6032 p 2 2 3598 0 39018 5814 p 2 0 3600 0 39420 6037 p 2 0 3600 0 44330 6059 p 2 0 3600 0 39209 5733 p 2 10 3590 0 35295 5701 p 2 6 3594 0 42956 6418 p 2 4 3596 0 43252 6281 p 2 8 3592 0 37368 5774 p 2 10 3590 0 38574 6048 p 2 3 3597 0 40183 6451 p 2 5 3595 0 39813 6240 p 2 4 3596 0 36910 6354 p 2 2 3598 0 36567 5928 p 2 19 3581 0 39088 6540 p 2 9 3591 0 39982 6399 p 2 90 3510 0 38853 6814 p 2 26 3574 0 40872 6816 p 2 0 3600 0 43340 6924 p 2 11 3589 0 45176 6807 p 2 10 3590 0 42338 6610 p 2 16 3584 0 40288 6387 p 2 9 3591 0 38631 6331 p 2 22 3578 0 43152 6482 p 2 28 3572 0 40220 6542 p 2 5 3595 0 39084 6332 p 2 25 3575 0 41717 6772 p 2 56 3544 0 45787 7056 p 2 16 3584 0 40579 6715 p 2 21 3579 0 40399 6911 p 2 5 3594 1 41424 6998 p 2 52 3548 0 46457 7528 p 2 24 3574 2 40817 7029 p 2 8 3592 0 41457 7152 p 2 12 3587 1 40712 7058 p 2 39 3561 0 45887 7351 p 2 25 3573 2 43697 7113 p 2 95 3505 0 46645 7596 p 2 32 3568 0 42912 7295 p 2 58 3542 0 45963 7346 p 2 22 3578 0 40637 7024 p 2 16 3584 0 46858 7383 p 2 24 3576 0 47752 7463 p 2 43 3557 0 50992 7692 p 2 7 3593 0 47247 7390 p 2 50 3550 0 53200 8155 p 2 19 3581 0 50651 7918 p 2 33 3567 0 55348 8300 p 2 29 3569 2 52823 8013 p 2 22 3578 0 50690 7836 p 2 14 3586 0 47970 7760 p 2 18 3582 0 49961 7833 p 2 33 3567 0 51325 8050 p 2 30 3570 0 52329 8112 p 2 28 3572 0 48655 7896 p 2 23 3577 0 50282 8015 p 2 38 3562 0 47176 7744 p 2 30 3570 0 50178 8007 p 2 16 3584 0 47416 7937 p 2 46 3554 0 49400 8305 p 2 21 3579 0 47492 8117 p 2 33 3567 0 46413 8138 p 2 26 3574 0 44663 8096 p 2 20 3580 0 49632 8297 p 2 8 3592 0 47482 8149 p 2 23 3577 0 53467 8381 p 2 17 3583 0 49307 8165 p 2 141 3459 0 54839 8926 p 2 77 3523 0 47659 8293 p 2 90 3510 0 50717 8422 p 2 44 3556 0 48124 7907 p 2 25 3575 0 47154 7604 p 2 15 3585 0 46488 7480 p 2 22 3578 0 45568 7503 p 2 26 3574 0 44503 7521 p 2 26 3574 0 47318 7607 p 2 36 3564 0 45934 7362 p 2 28 3572 0 45216 7348 p 2 43 3557 0 45287 7440 p 2 64 3536 0 44195 7437 p 2 34 3566 0 41073 7051 p 2 68 3532 0 44212 7403 p 2 38 3562 0 42025 7328 p 2 47 3553 0 45273 7512 p 2 45 3555 0 45485 7622 p 2 43 3557 0 44150 7577 p 2 51 3549 0 47048 8062 p 2 43 3557 0 48216 8152 p 2 92 3508 0 52110 8576 p 2 41 3559 0 51692 8408 p 2 41 3559 0 50628 8299 p 2 20 3580 0 51816 8092 p 2 20 3580 0 47533 7680 p 2 37 3562 1 50695 7991 p 2 61 3539 0 51824 8223 p 2 53 3547 0 54806 8317 p 2 53 3545 2 54739 8189 p 2 56 3544 0 51379 8056 p 2 40 3560 0 50263 8028 p 2 41 3559 0 51405 8009 p 2 41 3559 0 46980 7683 p 2 25 3575 0 47176 7684 p 2 39 3561 0 47388 7701 p 2 28 3572 0 47698 7574 p 2 43 3556 1 45522 7489 p 2 49 3551 0 49035 7884 p 2 52 3548 0 48177 7876 p 2 41 3559 0 50088 8033 p 2 39 3561 0 53201 8288 p 2 42 3558 0 50485 8037 p 2 34 3566 0 47450 7946 p 2 35 3565 0 49393 7900 p 2 16 3584 0 48626 7718 p 2 14 3586 0 48789 7813 p 2 20 3580 0 46635 7674 p 2 53 3547 0 49251 7983 p 2 29 3571 0 46763 7645 p 2 22 3578 0 46730 7729 p 2 34 3566 0 45856 7865 p 2 69 3531 0 48403 8099 p 2 16 3583 1 44783 7597 p 2 44 3556 0 42880 7579 p 2 14 3586 0 41695 7395 p 2 83 3517 0 47176 8009 p 2 13 3587 0 45679 7777 p 2 12 3587 1 45310 7855 p 2 9 3590 1 44669 7902 p 2 12 3587 1 45567 7847 p 2 28 3571 1 45407 7807 p 2 10 3585 5 44526 7730 p 2 20 3573 7 42840 7724 p 2 5 3593 2 41996 7540 p 2 11 3582 7 42585 7366 p 2 6 3592 2 42031 7384 p 2 16 3580 4 40010 7313 p 2 7 3588 5 42469 7373 p 2 10 3588 2 43280 7468 p 2 17 3576 7 45898 7775 p 2 12 3582 6 44287 7486 p 2 8 3581 11 44149 7492 p 2 33 3559 8 45326 7415 p 2 61 3532 7 45046 7562 p 2 46 3548 6 43923 7441 p 2 36 3561 3 43822 7516 p 2 15 3575 10 44078 7448 p 2 20 3574 6 42682 7270 p 2 24 3561 15 43651 7456 p 2 18 3577 5 45445 7677 p 2 17 3579 4 45224 7725 p 2 25 3573 2 47956 7973 p 2 16 3579 5 46026 7690 p 2 9 3585 6 46211 7830 p 2 10 3573 17 43278 7419 p 2 2 3575 23 41073 7220 p 2 1 3588 11 41371 7123 p 2 30 3552 18 41559 7142 p 2 10 3571 19 39480 6809 p 2 25 3549 26 38911 7029 p 2 4 3564 32 37343 6766 p 2 5 3557 38 38309 6790 p 2 10 3558 32 36866 6599 p 2 73 3510 17 38886 7121 p 2 26 3552 22 38694 6907 p 2 0 3580 20 38661 6723 p 2 4 3547 49 39179 6809 p 2 5 3574 21 38769 6906 i 2 3600 0 0 46673 12924 p 2 2017 1536 47 45874 12468 p 2 1284 2276 40 49039 11714 p 2 69 3395 136 34475 7445 p 2 89 3417 94 34561 7764 p 2 2 3480 118 28167 6477 p 2 36 3513 51 33996 7527 p 2 24 3499 77 32742 7014 p 2 5 3540 55 29818 6784 p 2 77 3460 63 35518 7369 p 2 14 3517 69 31629 7076 p 2 16 3511 73 32705 6971 p 2 5 3532 63 31678 6852 p 2 50 3473 77 34853 7398 p 2 16 3542 42 34851 7396 p 2 28 3520 52 34483 7090 p 2 32 3503 65 34680 7511 p 2 13 3534 53 34887 6869 p 2 109 3428 63 37085 7995 p 2 35 3511 54 36933 7367 p 2 84 3431 85 35187 7676 p 2 32 3495 73 34314 7232 p 2 39 3488 73 36999 7661 p 2 0 3522 78 19507 5430 p 2 5 3456 139 20582 5644 p 2 31 3380 189 21273 5748 p 2 0 3433 167 17909 5138 p 2 73 3315 212 23965 6111 p 2 45 3366 189 20723 5710 p 2 15 3372 213 20258 5382 p 2 1 3420 179 16591 5182 p 2 0 3417 183 20238 5285 p 2 0 3364 236 16236 4994 p 2 0 3319 281 15111 4733 p 2 55 3363 182 21784 5773 p 2 0 3387 213 16125 4860 p 2 9 3330 261 18441 5215 p 2 0 3336 264 15397 5024 p 2 0 3246 354 16550 4827 p 2 0 3345 255 17794 5184 p 2 1 3084 515 13103 4381 p 2 1 3186 413 14801 4688 p 2 10 3146 444 15800 4755 i 2 3600 0 0 139066 15295 p 2 0 2636 964 14771 3482 p 2 58 3060 482 69793 5705 p 2 0 2941 659 18814 3982 p 2 77 2897 626 67854 5760 p 2 0 2839 761 25531 3978 p 2 71 2926 603 69349 5702 p 2 0 2843 757 22075 3934 p 2 208 2765 627 80309 6554 p 2 0 2844 756 24276 4065 p 2 168 3190 242 85992 7200 p 2 0 3054 546 24712 4311 p 2 50 3433 117 77286 6611 p 2 0 3343 257 26306 4664 p 2 36 3297 267 77910 6419 p 2 0 3288 312 22958 4544 p 2 162 3020 418 77196 6728 p 2 0 3149 451 22167 4370 p 2 100 3366 134 82991 6955 p 2 0 3364 236 26073 4816 p 2 266 2980 354 93249 7570 p 2 0 3172 428 26564 4540 p 2 307 3087 206 96059 8052 p 2 0 3187 413 24865 4681 p 2 99 3395 106 87242 7138 p 2 0 3349 251 25846 4729 p 2 153 3272 175 92923 7216 p 2 0 3265 335 21373 4473 p 2 55 3269 276 85082 6683 p 2 0 3173 427 25231 4498 p 2 0 3001 599 19142 4088 p 2 44 3321 235 84517 6623 p 2 42 3302 256 80474 6627 p 2 0 3243 357 27964 4600 p 2 82 3315 203 90666 6984 p 2 0 3213 387 26867 4553 p 2 55 3485 60 92306 7125 p 2 0 3351 249 28572 4774 p 2 95 3254 251 84831 6863 p 2 102 3292 206 46310 5659 p 2 196 3126 278 83697 7057 p 2 96 3103 401 38332 5174 p 2 0 3105 495 23734 4309 p 2 172 3175 253 88874 7122 p 2 175 3254 171 105231 7692 p 2 0 3567 33 52554 5934 i 2 3600 0 0 190865 17591 p 2 6 3594 0 90360 7017 p 2 0 3600 0 52541 5702 p 2 0 3591 9 43000 5513 p 2 0 3595 5 49846 5544 p 2 0 3599 1 54284 5763 p 2 0 3596 4 50492 5574 p 2 0 3596 4 48023 5522 p 2 0 3568 32 39684 5167 p 2 0 3522 78 39537 5201 p 2 0 3357 243 29760 4829 p 2 0 3422 178 33225 5009 p 2 0 3510 90 26069 5259 i 2 3600 0 0 119610 14246 p 2 0 3073 527 15102 3765 p 2 0 3003 597 18751 3807 p 2 8 2745 847 22462 3686 p 2 0 2767 833 16173 3581 p 2 0 2856 744 13826 3560 p 2 4 2596 1000 20228 3524 p 2 0 2719 881 14516 3438 p 2 0 2400 1200 11551 3039 i 2 3600 0 0 128579 14294 p 2 22 3566 12 59119 6633 p 2 0 3481 119 33872 5057 p 2 3 3438 159 44528 5393 p 2 0 3388 212 31384 4704 p 2 7 3413 180 47653 5552 p 2 0 3342 258 30067 4567 p 2 11 3460 129 49875 5682 p 2 0 3220 380 27938 4430 p 2 6 3270 324 43277 5190 p 2 0 3322 278 27786 4554 p 2 0 3348 252 44134 5219 p 2 0 3252 348 27401 4462 p 2 3 3331 266 42235 5185 p 2 0 3301 299 28768 4476 p 2 2 3423 175 40564 5071 p 2 0 3449 151 33321 4668 p 2 10 3338 252 47679 5385 p 2 0 3414 186 26717 4900 i 2 3600 0 0 103186 13638 p 2 179 3405 16 44350 7124 p 2 4 3306 290 29848 5082 p 2 0 3079 521 16903 4265 p 2 0 2548 1052 12077 3256 p 2 2 3012 586 25487 4196 p 2 4 3008 588 23991 4182 p 2 0 2748 852 13543 3558 p 2 4 2985 611 23360 4169 p 2 0 3076 524 18612 4093 p 2 0 2923 677 22350 4017 p 2 0 2642 958 12716 3345 p 2 0 2850 750 20822 3841 p 2 0 2637 963 12216 3313 p 2 0 2692 908 19786 3650 i 2 3600 0 0 167874 16220 p 2 28 3544 28 42264 5261 p 2 12 3470 118 75732 5743 p 2 0 3212 388 26208 4340 p 2 17 3392 191 72283 5674 p 2 0 2988 612 21926 3957 p 2 71 3380 149 82855 6206 p 2 0 2925 675 17680 3902 p 2 0 2346 1254 15243 3132 p 2 75 2731 794 77832 5234 p 2 5 2762 833 62862 4571 p 2 0 2083 1517 12573 2847 p 2 0 2348 1252 16059 3129 p 2 13 2747 840 63033 4576 p 2 10 2962 628 66722 4920 p 2 0 2645 955 19734 3538 p 2 12 2811 777 62396 4613 p 2 0 2417 1183 17440 3241 i 2 3600 0 0 111920 13924 p 2 325 3199 76 40973 6715 p 2 0 2738 862 25964 3803 p 2 0 2667 933 24893 3644 p 2 0 2654 946 28807 3666 p 2 0 2601 999 25429 3514 p 2 0 2657 943 29119 3684 p 2 0 2589 1011 27938 3555 p 2 0 2486 1114 22630 3351 p 2 0 2486 1114 23788 3384 p 2 0 2331 1269 22398 3197 p 2 0 2203 1397 24326 3132 i 2 3600 0 0 199948 14959 p 2 500 2949 151 53391 6698 p 2 0 3120 480 39061 4353 p 2 0 3311 289 41382 4488 p 2 0 2849 751 36427 3879 p 2 0 3118 482 39496 4140 p 2 0 3008 592 35719 3999 p 2 0 3080 520 38821 4094 p 2 0 2430 1170 33563 3394 p 2 0 2334 1266 35207 3365 i 2 3600 0 0 206137 15470 p 2 326 3248 26 150498 10167 p 2 177 3399 24 123093 8938 p 2 188 3388 24 115125 8863 p 2 187 3368 45 124807 8918 p 2 184 3376 40 120377 8951 p 2 249 3295 56 129674 9459 p 2 148 3396 56 113543 8803 p 2 212 3331 57 124046 8981 p 2 187 3346 67 112109 8584 p 2 201 3339 60 117347 8866 p 2 145 3393 62 126545 9175 p 2 175 3387 38 127508 9015 p 2 279 3305 16 129434 9752 p 2 173 3420 7 125901 8896 p 2 208 3369 23 123106 9229 p 2 0 3593 7 63500 6321 i 2 3600 0 0 138645 13860 p 2 184 3416 0 86390 8316 p 2 38 3408 154 71080 6768 p 2 0 3261 339 22778 4751 p 2 38 3314 248 68456 6370 p 2 0 3248 352 21209 4603 p 2 31 3270 299 60739 6074 p 2 0 3084 516 20082 4319 p 2 0 3143 457 20416 4209 p 2 6 3372 222 50753 5442 p 2 13 3413 174 54970 5620 p 2 0 3035 565 19711 4023 p 2 18 3338 244 54396 5712 p 2 0 2959 641 18732 3894 p 2 6 3205 389 48498 5198 p 2 0 3153 447 21399 4227 p 2 7 3367 226 53235 5470 p 2 0 3104 496 18861 4139 p 2 18 3135 447 51430 5252 p 2 0 3475 125 35990 5287 i 2 3600 0 0 176286 16073 p 2 0 3553 47 32067 5074 p 2 0 3417 183 27303 4699 p 2 0 2985 615 15778 3859 p 2 0 3182 418 17838 4130 p 2 0 2817 783 14886 3603 p 2 0 2508 1092 11529 3148 p 2 0 3023 577 15188 3839 p 2 0 1999 1601 8420 2549 p 2 0 2877 723 15136 3680 i 2 3600 0 0 171855 15959 p 2 0 3055 545 15499 3812 p 2 0 3466 134 35240 4968 p 2 0 3412 188 36673 4815 p 2 0 3437 163 34214 4748 p 2 0 3144 456 18415 4108 p 2 0 3100 500 15728 3963 p 2 1 3238 361 22132 4305 p 2 0 3209 391 17185 4111 p 2 1 3488 111 34791 5310 i 2 3600 0 0 144296 14791 p 2 23 3286 291 38862 5522 p 2 68 3486 46 114797 7261 p 2 9 3455 136 41940 5738 p 2 383 3210 7 117454 8383 p 2 5 3406 189 34228 5347 p 2 318 3270 12 109466 7971 p 2 5 3465 130 43505 5579 p 2 228 3336 36 103029 7625 p 2 1 3399 200 36089 5243 p 2 42 3471 87 87297 6467 p 2 0 3453 147 35562 5269 p 2 16 3487 97 86395 6457 p 2 0 3497 103 37667 5337 p 2 9 3555 36 83163 6210 p 2 0 3510 90 40043 5367 p 2 3 3577 20 80117 6254 p 2 0 3433 167 30795 5126 p 2 24 3497 79 87851 6418 p 2 0 3549 51 41211 5662 i 2 3600 0 0 205388 16524 p 2 1 3545 54 36345 4977 p 2 0 3382 218 27637 4449 p 2 0 3523 77 33045 4902 p 2 0 3437 163 31510 4762 p 2 0 3489 111 31299 4840 p 2 0 3223 377 24810 4241 p 2 0 3551 49 35576 5262 p 2 0 3038 562 17889 3993 p 2 0 3535 65 41851 5166 p 2 0 3361 239 27828 4452 p 2 0 3156 444 21935 4062 p 2 0 3454 146 34321 4717 p 2 0 3330 270 26229 4395 p 2 0 3169 431 23550 4150 p 2 0 3566 34 47938 5622 i 2 3600 0 0 97588 13215 p 2 0 3523 77 44408 5793 p 2 4 3524 72 45478 5310 p 2 4 3513 83 44315 5303 p 2 1 3535 64 47073 5344 p 2 9 3550 41 47845 5385 p 2 15 3534 51 46739 5343 p 2 1 3518 81 44251 5263 p 2 0 3547 53 44511 5191 p 2 2 3503 95 44208 5222 p 2 1 3491 108 41154 5120 p 2 3 3554 43 49789 6036 i 2 3600 0 0 111426 13882 p 2 0 3457 143 27375 4563 p 2 0 2592 1008 24931 3501 p 2 0 2421 1179 13768 3158 p 2 0 2255 1345 11247 2882 p 2 1 2620 979 24112 3535 p 2 0 2660 940 17239 3526 p 2 0 2337 1263 10879 2978 p 2 0 2319 1281 11731 3019 p 2 0 2302 1298 9859 2910 p 2 0 2270 1330 18317 3038 p 2 0 2262 1338 10576 2862 p 2 3 2231 1366 21858 3067 p 2 0 2295 1305 9636 2881 p 2 1 2161 1438 17681 2911 p 2 0 2267 1333 11403 2892 p 2 0 1978 1622 8744 2511 i 2 3600 0 0 176017 14213 p 2 15 3478 107 57900 6275 p 2 203 3383 14 119764 8291 p 2 20 3559 21 67219 6946 p 2 10 3480 110 56491 6345 p 2 184 3415 1 119753 8313 p 2 9 3585 6 57938 6632 p 2 6 3560 34 58325 6300 p 2 247 3353 0 125055 8611 p 2 12 3540 48 57657 6687 p 2 11 3527 62 60057 6344 p 2 85 3506 9 122800 8316 p 2 2100 1500 0 171675 14506 p 2 17 3553 30 65264 6776 p 2 8 3527 65 59343 6492 p 2 140 3452 8 120537 8239 p 2 6 3529 65 62804 6429 p 2 5 3515 80 60294 6199 p 2 190 3402 8 109801 8269 p 2 12 3567 21 66124 6578 p 2 14 3506 80 60944 6316 p 2 328 3247 25 122390 8921 p 2 20 3515 65 65953 6675 p 2 20 3403 177 59525 6284 i 2 3600 0 0 194913 16522 p 2 0 3532 68 33204 5077 p 2 0 3325 275 25145 4575 p 2 0 3491 109 34370 5070 p 2 0 3312 288 26031 4661 p 2 0 3302 298 28606 4684 p 2 0 3434 166 31225 5013 p 2 0 3430 170 31214 4955 p 2 0 3541 59 38138 5433 p 2 0 3427 173 32043 5090 p 2 0 3521 79 36039 5496 p 2 0 3526 74 29979 5302 p 2 0 3577 23 38670 5557 p 2 0 3541 59 35680 5443 p 2 0 3493 107 32002 5158 p 2 0 3506 94 32427 5233 p 2 0 3439 161 31974 5073 p 2 0 3478 122 30593 5140 p 2 0 3422 178 29834 4994 p 2 0 3466 134 30127 5080 p 2 0 3509 91 34987 5294 p 2 0 3456 144 31159 5090 p 2 0 3379 221 29750 5006 p 2 0 3427 173 28111 5076 p 2 0 3563 37 42528 5578 p 2 0 3467 133 31033 5206 p 2 0 3359 241 28471 4919 p 2 0 3479 121 32195 5211 p 2 0 3426 174 30328 5066 p 2 0 3428 172 30962 5065 p 2 0 3392 208 27851 4930 p 2 0 3413 187 30585 5005 p 2 0 3477 123 30005 5105 p 2 0 3474 126 32926 5144 p 2 0 3502 98 36377 5451 p 2 0 3384 216 22929 4794 p 2 0 3563 37 38790 5521 p 2 0 3530 70 32756 5317 p 2 0 3426 174 28049 4991 p 2 0 3462 138 30162 5124 p 2 0 3199 401 23794 4583 p 2 0 3312 288 25617 4753 p 2 0 3330 270 27789 4863 p 2 0 3340 260 25381 4785 p 2 0 3434 166 29355 5066 p 2 0 3408 192 26612 4937 p 2 0 3390 210 26948 4921 p 2 0 3449 151 28586 5109 p 2 0 3562 38 33607 5426 p 2 0 3505 95 28191 5177 p 2 0 3412 188 26291 4898 p 2 0 3464 136 27371 5048 p 2 0 3385 215 26912 4911 p 2 0 3411 189 25649 4938 p 2 0 3333 267 25411 4756 p 2 0 3380 220 26116 4843 p 2 0 3421 179 26960 4966 p 2 0 3336 264 27391 4857 p 2 0 3344 256 25282 4807 p 2 0 3459 141 27744 5070 p 2 0 3545 55 36057 5420 p 2 0 3468 132 28018 5108 p 2 0 3332 268 26619 4783 p 2 0 3467 133 29525 5053 p 2 0 3320 280 26175 4762 p 2 0 3285 315 28574 4790 p 2 0 3249 351 26123 4636 p 2 0 3343 257 29244 4855 p 2 0 3405 195 28866 4938 p 2 0 3344 256 28316 4870 tests/keyframe/x264.log0000664000175000017500000457673714741067256014272 0ustar aniolaniol#options: 720x480 fps=24000/1001 timebase=1/1000000000 cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=0.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 sliced_threads=0 nr=0 decimate=1 interlaced=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=23 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 ip_ratio=1.40 aq=0 in:0 out:0 type:I dur:0 cpbdur:0 q:20.09 tex:3977 mv:5546 misc:4901 imb:1350 pmb:0 smb:0 d:- ref:; in:1 out:1 type:P dur:82000000 cpbdur:82000000 q:19.00 tex:143 mv:38 misc:211 imb:1 pmb:10 smb:1339 d:- ref:0 ; in:2 out:2 type:P dur:82000000 cpbdur:82000000 q:15.00 tex:6811 mv:2703 misc:926 imb:317 pmb:93 smb:940 d:- ref:0 ; in:3 out:3 type:P dur:82000000 cpbdur:82000000 q:11.54 tex:26168 mv:4874 misc:1206 imb:459 pmb:260 smb:631 d:- ref:0 ; in:4 out:4 type:P dur:82000000 cpbdur:82000000 q:10.67 tex:18952 mv:3131 misc:1237 imb:238 pmb:365 smb:747 d:- ref:0 ; in:5 out:5 type:P dur:82000000 cpbdur:82000000 q:11.33 tex:17747 mv:2788 misc:1145 imb:206 pmb:254 smb:890 d:- ref:0 ; in:6 out:6 type:P dur:82000000 cpbdur:82000000 q:10.00 tex:16858 mv:2345 misc:1205 imb:149 pmb:373 smb:828 d:- ref:0 ; in:7 out:7 type:P dur:82000000 cpbdur:82000000 q:10.95 tex:15392 mv:2150 misc:1034 imb:143 pmb:244 smb:963 d:- ref:0 ; in:8 out:8 type:P dur:82000000 cpbdur:82000000 q:10.43 tex:15276 mv:2035 misc:1105 imb:116 pmb:301 smb:933 d:- ref:0 ; in:9 out:9 type:P dur:82000000 cpbdur:82000000 q:11.56 tex:11936 mv:2193 misc:919 imb:154 pmb:221 smb:975 d:- ref:0 ; in:10 out:10 type:P dur:82000000 cpbdur:82000000 q:10.24 tex:16844 mv:1968 misc:1068 imb:119 pmb:296 smb:935 d:- ref:0 ; in:11 out:11 type:P dur:82000000 cpbdur:82000000 q:10.87 tex:10628 mv:2573 misc:1167 imb:245 pmb:193 smb:912 d:- ref:0 ; in:12 out:12 type:P dur:82000000 cpbdur:82000000 q:13.19 tex:10407 mv:4051 misc:1158 imb:446 pmb:89 smb:815 d:- ref:0 ; in:13 out:13 type:P dur:82000000 cpbdur:82000000 q:13.00 tex:10096 mv:2833 misc:1055 imb:231 pmb:155 smb:964 d:- ref:0 ; in:14 out:14 type:P dur:82000000 cpbdur:82000000 q:14.44 tex:8442 mv:3619 misc:883 imb:215 pmb:145 smb:990 d:- ref:0 ; in:15 out:15 type:P dur:82000000 cpbdur:82000000 q:15.11 tex:9691 mv:3467 misc:794 imb:120 pmb:179 smb:1051 d:- ref:0 ; in:16 out:16 type:P dur:82000000 cpbdur:82000000 q:15.87 tex:14598 mv:3508 misc:734 imb:103 pmb:206 smb:1041 d:- ref:0 ; in:17 out:17 type:P dur:82000000 cpbdur:82000000 q:17.15 tex:19663 mv:4076 misc:781 imb:133 pmb:210 smb:1007 d:- ref:0 ; in:18 out:18 type:P dur:82000000 cpbdur:82000000 q:17.74 tex:20936 mv:4392 misc:664 imb:97 pmb:224 smb:1029 d:- ref:0 ; in:19 out:19 type:P dur:82000000 cpbdur:82000000 q:18.24 tex:24650 mv:4465 misc:709 imb:121 pmb:223 smb:1006 d:- ref:0 ; in:20 out:20 type:P dur:82000000 cpbdur:82000000 q:18.53 tex:25851 mv:4331 misc:666 imb:102 pmb:235 smb:1013 d:- ref:0 ; in:21 out:21 type:P dur:82000000 cpbdur:82000000 q:18.99 tex:29779 mv:4628 misc:657 imb:92 pmb:244 smb:1014 d:- ref:0 ; in:22 out:22 type:P dur:82000000 cpbdur:82000000 q:19.09 tex:30808 mv:4816 misc:672 imb:82 pmb:258 smb:1010 d:- ref:0 ; in:23 out:23 type:P dur:82000000 cpbdur:82000000 q:19.31 tex:32420 mv:4789 misc:655 imb:81 pmb:255 smb:1014 d:- ref:0 ; in:24 out:24 type:P dur:82000000 cpbdur:82000000 q:19.44 tex:33411 mv:4942 misc:759 imb:97 pmb:284 smb:969 d:- ref:0 ; in:25 out:25 type:P dur:82000000 cpbdur:82000000 q:19.57 tex:27472 mv:4619 misc:645 imb:93 pmb:249 smb:1008 d:- ref:0 ; in:26 out:26 type:P dur:82000000 cpbdur:82000000 q:19.88 tex:33237 mv:4728 misc:659 imb:110 pmb:236 smb:1004 d:- ref:0 ; in:27 out:27 type:P dur:82000000 cpbdur:82000000 q:19.98 tex:34711 mv:4636 misc:661 imb:102 pmb:256 smb:992 d:- ref:0 ; in:28 out:28 type:P dur:82000000 cpbdur:82000000 q:20.09 tex:34638 mv:4999 misc:651 imb:106 pmb:249 smb:995 d:- ref:0 ; in:29 out:29 type:P dur:82000000 cpbdur:82000000 q:20.25 tex:36855 mv:4808 misc:641 imb:99 pmb:258 smb:993 d:- ref:0 ; in:30 out:30 type:P dur:82000000 cpbdur:82000000 q:20.30 tex:37874 mv:4811 misc:675 imb:107 pmb:253 smb:990 d:- ref:0 ; in:31 out:31 type:P dur:82000000 cpbdur:82000000 q:20.40 tex:39127 mv:4896 misc:673 imb:90 pmb:262 smb:998 d:- ref:0 ; in:32 out:32 type:P dur:82000000 cpbdur:82000000 q:20.59 tex:36730 mv:4974 misc:648 imb:106 pmb:260 smb:984 d:- ref:0 ; in:33 out:33 type:P dur:82000000 cpbdur:82000000 q:20.71 tex:38739 mv:5042 misc:675 imb:107 pmb:260 smb:983 d:- ref:0 ; in:34 out:34 type:P dur:82000000 cpbdur:82000000 q:20.69 tex:39385 mv:5001 misc:670 imb:101 pmb:267 smb:982 d:- ref:0 ; in:35 out:35 type:P dur:82000000 cpbdur:82000000 q:20.88 tex:41415 mv:4960 misc:681 imb:97 pmb:276 smb:977 d:- ref:0 ; in:36 out:36 type:P dur:82000000 cpbdur:82000000 q:20.96 tex:41739 mv:5077 misc:704 imb:104 pmb:277 smb:969 d:- ref:0 ; in:37 out:37 type:P dur:82000000 cpbdur:82000000 q:21.04 tex:43063 mv:5254 misc:691 imb:116 pmb:270 smb:964 d:- ref:0 ; in:38 out:38 type:P dur:82000000 cpbdur:82000000 q:21.13 tex:44501 mv:5185 misc:698 imb:97 pmb:277 smb:976 d:- ref:0 ; in:39 out:39 type:P dur:82000000 cpbdur:82000000 q:21.15 tex:44869 mv:5282 misc:705 imb:104 pmb:280 smb:966 d:- ref:0 ; in:40 out:40 type:P dur:82000000 cpbdur:82000000 q:21.21 tex:45820 mv:5197 misc:671 imb:82 pmb:287 smb:981 d:- ref:0 ; in:41 out:41 type:P dur:82000000 cpbdur:82000000 q:21.45 tex:49402 mv:5175 misc:687 imb:100 pmb:285 smb:965 d:- ref:0 ; in:42 out:42 type:P dur:82000000 cpbdur:82000000 q:21.33 tex:48329 mv:5202 misc:693 imb:77 pmb:294 smb:979 d:- ref:0 ; in:43 out:43 type:P dur:82000000 cpbdur:82000000 q:21.48 tex:48373 mv:5492 misc:687 imb:75 pmb:316 smb:959 d:- ref:0 ; in:44 out:44 type:P dur:82000000 cpbdur:82000000 q:22.00 tex:55387 mv:5473 misc:708 imb:95 pmb:303 smb:952 d:- ref:0 ; in:45 out:45 type:P dur:82000000 cpbdur:82000000 q:22.27 tex:60386 mv:5751 misc:679 imb:72 pmb:323 smb:955 d:- ref:0 ; in:46 out:46 type:P dur:82000000 cpbdur:82000000 q:22.72 tex:58378 mv:5525 misc:681 imb:83 pmb:315 smb:952 d:- ref:0 ; in:47 out:47 type:P dur:82000000 cpbdur:82000000 q:22.81 tex:61037 mv:5459 misc:696 imb:75 pmb:327 smb:948 d:- ref:0 ; in:48 out:48 type:P dur:82000000 cpbdur:82000000 q:23.00 tex:62391 mv:5358 misc:699 imb:77 pmb:326 smb:947 d:- ref:0 ; in:49 out:49 type:P dur:82000000 cpbdur:82000000 q:23.01 tex:63078 mv:5171 misc:695 imb:69 pmb:333 smb:948 d:- ref:0 ; in:50 out:50 type:P dur:82000000 cpbdur:82000000 q:23.12 tex:63101 mv:5175 misc:708 imb:88 pmb:323 smb:939 d:- ref:0 ; in:51 out:51 type:P dur:82000000 cpbdur:82000000 q:23.16 tex:62668 mv:5206 misc:710 imb:78 pmb:338 smb:934 d:- ref:0 ; in:52 out:52 type:P dur:82000000 cpbdur:82000000 q:23.31 tex:66989 mv:5341 misc:710 imb:83 pmb:329 smb:938 d:- ref:0 ; in:53 out:53 type:P dur:82000000 cpbdur:82000000 q:23.37 tex:66647 mv:5257 misc:696 imb:77 pmb:341 smb:932 d:- ref:0 ; in:54 out:54 type:P dur:82000000 cpbdur:82000000 q:23.35 tex:68360 mv:5373 misc:707 imb:74 pmb:345 smb:931 d:- ref:0 ; in:55 out:55 type:P dur:82000000 cpbdur:82000000 q:23.21 tex:61602 mv:5344 misc:710 imb:70 pmb:356 smb:924 d:- ref:0 ; in:56 out:56 type:P dur:82000000 cpbdur:82000000 q:23.10 tex:56726 mv:5009 misc:721 imb:72 pmb:333 smb:945 d:- ref:0 ; in:57 out:57 type:P dur:82000000 cpbdur:82000000 q:22.96 tex:57208 mv:5241 misc:735 imb:87 pmb:335 smb:928 d:- ref:0 ; in:58 out:58 type:P dur:82000000 cpbdur:82000000 q:22.85 tex:54286 mv:5341 misc:749 imb:72 pmb:345 smb:933 d:- ref:0 ; in:59 out:59 type:P dur:82000000 cpbdur:82000000 q:22.96 tex:57094 mv:5172 misc:734 imb:77 pmb:340 smb:933 d:- ref:0 ; in:60 out:60 type:P dur:82000000 cpbdur:82000000 q:23.13 tex:60224 mv:5205 misc:739 imb:70 pmb:349 smb:931 d:- ref:0 ; in:61 out:61 type:P dur:82000000 cpbdur:82000000 q:23.14 tex:62742 mv:5310 misc:764 imb:91 pmb:344 smb:915 d:- ref:0 ; in:62 out:62 type:P dur:82000000 cpbdur:82000000 q:23.24 tex:62055 mv:5332 misc:781 imb:81 pmb:342 smb:927 d:- ref:0 ; in:63 out:63 type:P dur:82000000 cpbdur:82000000 q:23.18 tex:58960 mv:5519 misc:769 imb:71 pmb:361 smb:918 d:- ref:0 ; in:64 out:64 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:64804 mv:5367 misc:781 imb:87 pmb:349 smb:914 d:- ref:0 ; in:65 out:65 type:P dur:82000000 cpbdur:82000000 q:23.32 tex:61426 mv:5282 misc:764 imb:70 pmb:352 smb:928 d:- ref:0 ; in:66 out:66 type:P dur:82000000 cpbdur:82000000 q:23.37 tex:64526 mv:5580 misc:766 imb:80 pmb:354 smb:916 d:- ref:0 ; in:67 out:67 type:P dur:82000000 cpbdur:82000000 q:23.20 tex:60779 mv:5543 misc:774 imb:73 pmb:363 smb:914 d:- ref:0 ; in:68 out:68 type:P dur:82000000 cpbdur:82000000 q:23.29 tex:65246 mv:5503 misc:787 imb:80 pmb:369 smb:901 d:- ref:0 ; in:69 out:69 type:P dur:82000000 cpbdur:82000000 q:23.37 tex:65949 mv:5482 misc:785 imb:81 pmb:362 smb:907 d:- ref:0 ; in:70 out:70 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:67594 mv:5684 misc:778 imb:72 pmb:382 smb:896 d:- ref:0 ; in:71 out:71 type:P dur:82000000 cpbdur:82000000 q:23.39 tex:66004 mv:5600 misc:788 imb:70 pmb:378 smb:902 d:- ref:0 ; in:72 out:72 type:P dur:82000000 cpbdur:82000000 q:23.38 tex:62312 mv:5669 misc:827 imb:85 pmb:373 smb:892 d:- ref:0 ; in:73 out:73 type:P dur:82000000 cpbdur:82000000 q:23.22 tex:61784 mv:5793 misc:823 imb:97 pmb:363 smb:890 d:- ref:0 ; in:74 out:74 type:P dur:82000000 cpbdur:82000000 q:23.34 tex:65309 mv:5770 misc:809 imb:78 pmb:382 smb:890 d:- ref:0 ; in:75 out:75 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:61316 mv:5524 misc:824 imb:52 pmb:386 smb:912 d:- ref:0 ; in:76 out:76 type:P dur:82000000 cpbdur:82000000 q:23.47 tex:63818 mv:5714 misc:828 imb:79 pmb:372 smb:899 d:- ref:0 ; in:77 out:77 type:P dur:82000000 cpbdur:82000000 q:23.35 tex:61716 mv:5767 misc:837 imb:58 pmb:371 smb:921 d:- ref:0 ; in:78 out:78 type:P dur:82000000 cpbdur:82000000 q:23.35 tex:61073 mv:5742 misc:833 imb:76 pmb:368 smb:906 d:- ref:0 ; in:79 out:79 type:P dur:82000000 cpbdur:82000000 q:23.38 tex:62979 mv:5358 misc:823 imb:49 pmb:360 smb:941 d:- ref:0 ; in:80 out:80 type:P dur:82000000 cpbdur:82000000 q:23.41 tex:63121 mv:5867 misc:844 imb:60 pmb:365 smb:925 d:- ref:0 ; in:81 out:81 type:P dur:82000000 cpbdur:82000000 q:23.23 tex:59466 mv:5598 misc:840 imb:62 pmb:370 smb:918 d:- ref:0 ; in:82 out:82 type:P dur:82000000 cpbdur:82000000 q:23.14 tex:60054 mv:5633 misc:841 imb:49 pmb:377 smb:924 d:- ref:0 ; in:83 out:83 type:P dur:82000000 cpbdur:82000000 q:23.14 tex:60117 mv:5391 misc:836 imb:36 pmb:371 smb:943 d:- ref:0 ; in:84 out:84 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:62872 mv:5815 misc:849 imb:61 pmb:391 smb:898 d:- ref:0 ; in:85 out:85 type:P dur:82000000 cpbdur:82000000 q:23.28 tex:61413 mv:5659 misc:864 imb:52 pmb:389 smb:909 d:- ref:0 ; in:86 out:86 type:P dur:82000000 cpbdur:82000000 q:23.37 tex:63047 mv:5705 misc:864 imb:57 pmb:385 smb:908 d:- ref:0 ; in:87 out:87 type:P dur:82000000 cpbdur:82000000 q:23.27 tex:61247 mv:5431 misc:866 imb:58 pmb:385 smb:907 d:- ref:0 ; in:88 out:88 type:P dur:82000000 cpbdur:82000000 q:23.49 tex:65911 mv:5677 misc:884 imb:68 pmb:375 smb:907 d:- ref:0 ; in:89 out:89 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:55453 mv:5861 misc:862 imb:70 pmb:387 smb:893 d:- ref:0 ; in:90 out:90 type:P dur:82000000 cpbdur:82000000 q:23.57 tex:59276 mv:5924 misc:896 imb:54 pmb:410 smb:886 d:- ref:0 ; in:91 out:91 type:P dur:82000000 cpbdur:82000000 q:23.61 tex:57234 mv:5842 misc:876 imb:57 pmb:396 smb:897 d:- ref:0 ; in:92 out:92 type:P dur:82000000 cpbdur:82000000 q:23.72 tex:61969 mv:5954 misc:877 imb:59 pmb:392 smb:899 d:- ref:0 ; in:93 out:93 type:P dur:82000000 cpbdur:82000000 q:23.66 tex:61566 mv:5990 misc:884 imb:52 pmb:412 smb:886 d:- ref:0 ; in:94 out:94 type:P dur:82000000 cpbdur:82000000 q:23.76 tex:62790 mv:6194 misc:888 imb:71 pmb:400 smb:879 d:- ref:0 ; in:95 out:95 type:P dur:82000000 cpbdur:82000000 q:23.72 tex:59198 mv:6177 misc:873 imb:48 pmb:419 smb:883 d:- ref:0 ; in:96 out:96 type:P dur:82000000 cpbdur:82000000 q:23.65 tex:58698 mv:6420 misc:898 imb:72 pmb:408 smb:870 d:- ref:0 ; in:97 out:97 type:P dur:82000000 cpbdur:82000000 q:23.45 tex:66945 mv:6200 misc:903 imb:72 pmb:422 smb:856 d:- ref:0 ; in:98 out:98 type:P dur:82000000 cpbdur:82000000 q:23.56 tex:55570 mv:6169 misc:885 imb:60 pmb:399 smb:891 d:- ref:0 ; in:99 out:99 type:P dur:82000000 cpbdur:82000000 q:23.74 tex:59698 mv:5896 misc:886 imb:49 pmb:394 smb:907 d:- ref:0 ; in:100 out:100 type:P dur:82000000 cpbdur:82000000 q:23.78 tex:63090 mv:5964 misc:898 imb:45 pmb:408 smb:897 d:- ref:0 ; in:101 out:101 type:P dur:82000000 cpbdur:82000000 q:23.76 tex:61698 mv:6280 misc:894 imb:52 pmb:410 smb:888 d:- ref:0 ; in:102 out:102 type:P dur:82000000 cpbdur:82000000 q:23.79 tex:61356 mv:6312 misc:916 imb:67 pmb:406 smb:877 d:- ref:0 ; in:103 out:103 type:P dur:82000000 cpbdur:82000000 q:23.80 tex:58148 mv:6585 misc:923 imb:72 pmb:427 smb:851 d:- ref:0 ; in:104 out:104 type:P dur:82000000 cpbdur:82000000 q:23.84 tex:62410 mv:6256 misc:918 imb:62 pmb:414 smb:874 d:- ref:0 ; in:105 out:105 type:P dur:82000000 cpbdur:82000000 q:23.71 tex:57317 mv:6428 misc:935 imb:78 pmb:422 smb:850 d:- ref:0 ; in:106 out:106 type:P dur:82000000 cpbdur:82000000 q:23.64 tex:57328 mv:6514 misc:982 imb:82 pmb:450 smb:818 d:- ref:0 ; in:107 out:107 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:56141 mv:6311 misc:996 imb:80 pmb:441 smb:829 d:- ref:0 ; in:108 out:108 type:P dur:82000000 cpbdur:82000000 q:23.52 tex:59108 mv:6800 misc:1020 imb:117 pmb:454 smb:779 d:- ref:0 ; in:109 out:109 type:P dur:82000000 cpbdur:82000000 q:23.65 tex:60334 mv:6302 misc:980 imb:56 pmb:454 smb:840 d:- ref:0 ; in:110 out:110 type:P dur:82000000 cpbdur:82000000 q:23.75 tex:62564 mv:6666 misc:986 imb:63 pmb:460 smb:827 d:- ref:0 ; in:111 out:111 type:P dur:82000000 cpbdur:82000000 q:23.75 tex:61126 mv:6796 misc:1054 imb:134 pmb:446 smb:770 d:- ref:0 ; in:112 out:112 type:P dur:82000000 cpbdur:82000000 q:23.81 tex:63158 mv:6827 misc:1015 imb:102 pmb:457 smb:791 d:- ref:0 ; in:113 out:113 type:P dur:82000000 cpbdur:82000000 q:23.78 tex:60621 mv:7059 misc:1048 imb:133 pmb:441 smb:776 d:- ref:0 ; in:114 out:114 type:P dur:82000000 cpbdur:82000000 q:23.75 tex:62199 mv:6986 misc:1047 imb:104 pmb:448 smb:798 d:- ref:0 ; in:115 out:115 type:P dur:82000000 cpbdur:82000000 q:23.72 tex:60494 mv:7136 misc:1018 imb:99 pmb:454 smb:797 d:- ref:0 ; in:116 out:116 type:P dur:82000000 cpbdur:82000000 q:23.75 tex:63201 mv:7536 misc:1055 imb:133 pmb:470 smb:747 d:- ref:0 ; in:117 out:117 type:P dur:82000000 cpbdur:82000000 q:23.73 tex:62793 mv:7395 misc:1060 imb:102 pmb:485 smb:763 d:- ref:0 ; in:118 out:118 type:P dur:82000000 cpbdur:82000000 q:23.80 tex:64136 mv:7341 misc:1019 imb:77 pmb:465 smb:808 d:- ref:0 ; in:119 out:119 type:P dur:82000000 cpbdur:82000000 q:23.63 tex:59477 mv:7130 misc:1009 imb:62 pmb:468 smb:820 d:- ref:0 ; in:120 out:120 type:P dur:82000000 cpbdur:82000000 q:23.63 tex:60181 mv:7583 misc:1020 imb:89 pmb:469 smb:792 d:- ref:0 ; in:121 out:121 type:P dur:82000000 cpbdur:82000000 q:23.61 tex:56008 mv:7137 misc:1015 imb:89 pmb:459 smb:802 d:- ref:0 ; in:122 out:122 type:P dur:82000000 cpbdur:82000000 q:23.60 tex:59357 mv:7451 misc:1088 imb:116 pmb:481 smb:753 d:- ref:0 ; in:123 out:123 type:P dur:82000000 cpbdur:82000000 q:23.73 tex:61027 mv:7196 misc:1033 imb:73 pmb:454 smb:823 d:- ref:0 ; in:124 out:124 type:P dur:82000000 cpbdur:82000000 q:23.90 tex:60354 mv:7165 misc:1033 imb:74 pmb:467 smb:809 d:- ref:0 ; in:125 out:125 type:P dur:82000000 cpbdur:82000000 q:23.66 tex:59424 mv:6888 misc:1048 imb:86 pmb:452 smb:812 d:- ref:0 ; in:126 out:126 type:P dur:82000000 cpbdur:82000000 q:23.75 tex:59678 mv:6874 misc:1048 imb:70 pmb:456 smb:824 d:- ref:0 ; in:127 out:127 type:P dur:82000000 cpbdur:82000000 q:23.91 tex:62241 mv:7122 misc:1045 imb:77 pmb:460 smb:813 d:- ref:0 ; in:128 out:128 type:P dur:82000000 cpbdur:82000000 q:24.05 tex:66006 mv:7428 misc:1054 imb:88 pmb:464 smb:798 d:- ref:0 ; in:129 out:129 type:P dur:82000000 cpbdur:82000000 q:23.91 tex:63191 mv:7054 misc:1059 imb:83 pmb:464 smb:803 d:- ref:0 ; in:130 out:130 type:P dur:82000000 cpbdur:82000000 q:23.78 tex:60677 mv:7112 misc:1059 imb:73 pmb:472 smb:805 d:- ref:0 ; in:131 out:131 type:P dur:82000000 cpbdur:82000000 q:23.74 tex:60514 mv:7263 misc:1071 imb:57 pmb:481 smb:812 d:- ref:0 ; in:132 out:132 type:P dur:82000000 cpbdur:82000000 q:23.80 tex:64217 mv:7570 misc:1117 imb:116 pmb:498 smb:736 d:- ref:0 ; in:133 out:133 type:P dur:82000000 cpbdur:82000000 q:23.71 tex:61129 mv:7307 misc:1060 imb:72 pmb:487 smb:791 d:- ref:0 ; in:134 out:134 type:P dur:82000000 cpbdur:82000000 q:23.79 tex:62619 mv:7562 misc:1083 imb:79 pmb:514 smb:757 d:- ref:0 ; in:135 out:135 type:P dur:82000000 cpbdur:82000000 q:23.74 tex:63019 mv:7639 misc:1126 imb:93 pmb:537 smb:720 d:- ref:0 ; in:136 out:136 type:P dur:82000000 cpbdur:82000000 q:24.26 tex:81174 mv:8086 misc:1084 imb:108 pmb:520 smb:722 d:- ref:0 ; in:137 out:137 type:P dur:82000000 cpbdur:82000000 q:24.51 tex:74488 mv:8080 misc:1088 imb:82 pmb:522 smb:746 d:- ref:0 ; in:138 out:138 type:P dur:82000000 cpbdur:82000000 q:24.58 tex:76527 mv:8523 misc:1110 imb:123 pmb:533 smb:694 d:- ref:0 ; in:139 out:139 type:P dur:82000000 cpbdur:82000000 q:24.62 tex:82182 mv:9083 misc:1127 imb:151 pmb:555 smb:644 d:- ref:0 ; in:140 out:140 type:P dur:82000000 cpbdur:82000000 q:24.63 tex:77369 mv:8746 misc:1141 imb:123 pmb:538 smb:689 d:- ref:0 ; in:141 out:141 type:P dur:82000000 cpbdur:82000000 q:24.50 tex:71240 mv:8833 misc:1119 imb:140 pmb:515 smb:695 d:- ref:0 ; in:142 out:142 type:P dur:82000000 cpbdur:82000000 q:24.21 tex:67416 mv:9520 misc:1128 imb:176 pmb:510 smb:664 d:- ref:0 ; in:143 out:143 type:P dur:82000000 cpbdur:82000000 q:23.90 tex:56556 mv:9268 misc:1168 imb:191 pmb:514 smb:645 d:- ref:0 ; in:144 out:144 type:P dur:82000000 cpbdur:82000000 q:23.57 tex:51853 mv:8916 misc:1143 imb:124 pmb:526 smb:700 d:- ref:0 ; in:145 out:145 type:P dur:82000000 cpbdur:82000000 q:23.31 tex:61139 mv:9250 misc:1219 imb:152 pmb:540 smb:658 d:- ref:0 ; in:146 out:146 type:P dur:82000000 cpbdur:82000000 q:23.52 tex:51553 mv:8872 misc:1127 imb:102 pmb:496 smb:752 d:- ref:0 ; in:147 out:147 type:P dur:82000000 cpbdur:82000000 q:23.80 tex:57942 mv:8548 misc:1158 imb:105 pmb:512 smb:733 d:- ref:0 ; in:148 out:148 type:P dur:82000000 cpbdur:82000000 q:23.87 tex:58374 mv:9058 misc:1168 imb:97 pmb:526 smb:727 d:- ref:0 ; in:149 out:149 type:P dur:82000000 cpbdur:82000000 q:23.81 tex:58045 mv:9214 misc:1157 imb:126 pmb:540 smb:684 d:- ref:0 ; in:150 out:150 type:P dur:82000000 cpbdur:82000000 q:23.76 tex:57836 mv:9223 misc:1181 imb:115 pmb:543 smb:692 d:- ref:0 ; in:151 out:151 type:P dur:82000000 cpbdur:82000000 q:23.77 tex:57312 mv:9462 misc:1210 imb:124 pmb:566 smb:660 d:- ref:0 ; in:152 out:152 type:P dur:82000000 cpbdur:82000000 q:24.81 tex:93504 mv:12674 misc:1422 imb:1238 pmb:72 smb:40 d:- ref:0 ; in:153 out:153 type:P dur:82000000 cpbdur:82000000 q:24.13 tex:55520 mv:11330 misc:1278 imb:206 pmb:604 smb:540 d:- ref:0 ; in:154 out:154 type:P dur:82000000 cpbdur:82000000 q:22.13 tex:32324 mv:3819 misc:1441 imb:145 pmb:603 smb:602 d:- ref:0 ; in:155 out:155 type:P dur:82000000 cpbdur:82000000 q:22.93 tex:63505 mv:12700 misc:1355 imb:271 pmb:670 smb:409 d:- ref:0 ; in:156 out:156 type:P dur:82000000 cpbdur:82000000 q:21.37 tex:41062 mv:4761 misc:1441 imb:107 pmb:727 smb:516 d:- ref:0 ; in:157 out:157 type:P dur:82000000 cpbdur:82000000 q:22.82 tex:76389 mv:12847 misc:1396 imb:346 pmb:653 smb:351 d:- ref:0 ; in:158 out:158 type:P dur:82000000 cpbdur:82000000 q:21.26 tex:42069 mv:4702 misc:1477 imb:123 pmb:758 smb:469 d:- ref:0 ; in:159 out:159 type:P dur:82000000 cpbdur:82000000 q:22.53 tex:61941 mv:12339 misc:1432 imb:220 pmb:747 smb:383 d:- ref:0 ; in:160 out:160 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:39072 mv:6185 misc:1471 imb:106 pmb:737 smb:507 d:- ref:0 ; in:161 out:161 type:P dur:82000000 cpbdur:82000000 q:22.54 tex:66195 mv:11701 misc:1432 imb:225 pmb:731 smb:394 d:- ref:0 ; in:162 out:162 type:P dur:82000000 cpbdur:82000000 q:20.89 tex:44244 mv:4212 misc:1488 imb:87 pmb:768 smb:495 d:- ref:0 ; in:163 out:163 type:P dur:82000000 cpbdur:82000000 q:21.44 tex:59801 mv:9558 misc:1457 imb:116 pmb:826 smb:408 d:- ref:0 ; in:164 out:164 type:P dur:82000000 cpbdur:82000000 q:20.10 tex:30585 mv:3387 misc:1452 imb:45 pmb:629 smb:676 d:- ref:0 ; in:165 out:165 type:P dur:82000000 cpbdur:82000000 q:20.90 tex:51678 mv:9006 misc:1468 imb:106 pmb:816 smb:428 d:- ref:0 ; in:166 out:166 type:P dur:82000000 cpbdur:82000000 q:19.86 tex:31186 mv:3769 misc:1517 imb:75 pmb:651 smb:624 d:- ref:0 ; in:167 out:167 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:49456 mv:9075 misc:1485 imb:108 pmb:819 smb:423 d:- ref:0 ; in:168 out:168 type:P dur:82000000 cpbdur:82000000 q:19.47 tex:59720 mv:5419 misc:1493 imb:81 pmb:913 smb:356 d:- ref:0 ; in:169 out:169 type:P dur:82000000 cpbdur:82000000 q:20.39 tex:45433 mv:7743 misc:1440 imb:57 pmb:793 smb:500 d:- ref:0 ; in:170 out:170 type:P dur:82000000 cpbdur:82000000 q:19.37 tex:41458 mv:4611 misc:1475 imb:52 pmb:825 smb:473 d:- ref:0 ; in:171 out:171 type:P dur:82000000 cpbdur:82000000 q:20.61 tex:44347 mv:8129 misc:1500 imb:109 pmb:769 smb:472 d:- ref:0 ; in:172 out:172 type:P dur:82000000 cpbdur:82000000 q:19.38 tex:50855 mv:5254 misc:1539 imb:55 pmb:904 smb:391 d:- ref:0 ; in:173 out:173 type:P dur:82000000 cpbdur:82000000 q:20.48 tex:49226 mv:7647 misc:1463 imb:66 pmb:795 smb:489 d:- ref:0 ; in:174 out:174 type:P dur:82000000 cpbdur:82000000 q:18.97 tex:33001 mv:3802 misc:1525 imb:40 pmb:770 smb:540 d:- ref:0 ; in:175 out:175 type:P dur:82000000 cpbdur:82000000 q:20.17 tex:47289 mv:7280 misc:1471 imb:67 pmb:776 smb:507 d:- ref:0 ; in:176 out:176 type:P dur:82000000 cpbdur:82000000 q:19.50 tex:29681 mv:3291 misc:1332 imb:15 pmb:527 smb:808 d:- ref:0 ; in:177 out:177 type:P dur:82000000 cpbdur:82000000 q:19.83 tex:38017 mv:5629 misc:1458 imb:51 pmb:705 smb:594 d:- ref:0 ; in:178 out:178 type:P dur:82000000 cpbdur:82000000 q:23.22 tex:65580 mv:14215 misc:1413 imb:1203 pmb:143 smb:4 d:- ref:0 ; in:179 out:179 type:P dur:82000000 cpbdur:82000000 q:22.37 tex:26393 mv:10844 misc:1371 imb:337 pmb:644 smb:369 d:- ref:0 ; in:180 out:180 type:P dur:82000000 cpbdur:82000000 q:22.06 tex:32430 mv:10229 misc:1101 imb:130 pmb:623 smb:597 d:- ref:0 ; in:181 out:181 type:P dur:82000000 cpbdur:82000000 q:22.04 tex:36797 mv:9920 misc:987 imb:73 pmb:614 smb:663 d:- ref:0 ; in:182 out:182 type:P dur:82000000 cpbdur:82000000 q:22.32 tex:46802 mv:10084 misc:978 imb:89 pmb:600 smb:661 d:- ref:0 ; in:183 out:183 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:43416 mv:9701 misc:939 imb:72 pmb:577 smb:701 d:- ref:0 ; in:184 out:184 type:P dur:82000000 cpbdur:82000000 q:23.00 tex:54824 mv:9915 misc:925 imb:88 pmb:571 smb:691 d:- ref:0 ; in:185 out:185 type:P dur:82000000 cpbdur:82000000 q:23.28 tex:61422 mv:9500 misc:958 imb:92 pmb:552 smb:706 d:- ref:0 ; in:186 out:186 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:57280 mv:9019 misc:893 imb:81 pmb:553 smb:716 d:- ref:0 ; in:187 out:187 type:P dur:82000000 cpbdur:82000000 q:23.91 tex:71778 mv:8661 misc:897 imb:69 pmb:533 smb:748 d:- ref:0 ; in:188 out:188 type:P dur:82000000 cpbdur:82000000 q:24.35 tex:87686 mv:8034 misc:912 imb:71 pmb:532 smb:747 d:- ref:0 ; in:189 out:189 type:P dur:82000000 cpbdur:82000000 q:24.35 tex:79423 mv:7360 misc:881 imb:45 pmb:528 smb:777 d:- ref:0 ; in:190 out:190 type:P dur:82000000 cpbdur:82000000 q:24.28 tex:73982 mv:7280 misc:914 imb:54 pmb:522 smb:774 d:- ref:0 ; in:191 out:191 type:P dur:82000000 cpbdur:82000000 q:24.18 tex:72966 mv:6977 misc:889 imb:55 pmb:515 smb:780 d:- ref:0 ; in:192 out:192 type:P dur:82000000 cpbdur:82000000 q:24.18 tex:73435 mv:7099 misc:898 imb:49 pmb:529 smb:772 d:- ref:0 ; in:193 out:193 type:P dur:82000000 cpbdur:82000000 q:24.11 tex:73727 mv:7035 misc:910 imb:45 pmb:527 smb:778 d:- ref:0 ; in:194 out:194 type:P dur:82000000 cpbdur:82000000 q:24.15 tex:75226 mv:7261 misc:897 imb:53 pmb:525 smb:772 d:- ref:0 ; in:195 out:195 type:P dur:82000000 cpbdur:82000000 q:24.21 tex:74107 mv:6877 misc:904 imb:37 pmb:525 smb:788 d:- ref:0 ; in:196 out:196 type:P dur:82000000 cpbdur:82000000 q:24.23 tex:77783 mv:6897 misc:896 imb:31 pmb:537 smb:782 d:- ref:0 ; in:197 out:197 type:P dur:82000000 cpbdur:82000000 q:24.19 tex:72170 mv:6983 misc:903 imb:39 pmb:541 smb:770 d:- ref:0 ; in:198 out:198 type:P dur:82000000 cpbdur:82000000 q:23.89 tex:61636 mv:6855 misc:885 imb:35 pmb:527 smb:788 d:- ref:0 ; in:199 out:199 type:P dur:82000000 cpbdur:82000000 q:23.71 tex:61997 mv:6839 misc:916 imb:43 pmb:527 smb:780 d:- ref:0 ; in:200 out:200 type:P dur:82000000 cpbdur:82000000 q:23.78 tex:65060 mv:7044 misc:912 imb:42 pmb:534 smb:774 d:- ref:0 ; in:201 out:201 type:P dur:82000000 cpbdur:82000000 q:23.71 tex:61588 mv:7082 misc:922 imb:34 pmb:516 smb:800 d:- ref:0 ; in:202 out:202 type:P dur:82000000 cpbdur:82000000 q:23.81 tex:62866 mv:7353 misc:901 imb:42 pmb:519 smb:789 d:- ref:0 ; in:203 out:203 type:P dur:82000000 cpbdur:82000000 q:23.69 tex:60978 mv:6876 misc:914 imb:35 pmb:500 smb:815 d:- ref:0 ; in:204 out:204 type:P dur:82000000 cpbdur:82000000 q:23.58 tex:61163 mv:6804 misc:913 imb:38 pmb:506 smb:806 d:- ref:0 ; in:205 out:205 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:74320 mv:7302 misc:994 imb:73 pmb:546 smb:731 d:- ref:0 ; in:206 out:206 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:58664 mv:7027 misc:893 imb:39 pmb:505 smb:806 d:- ref:0 ; in:207 out:207 type:P dur:82000000 cpbdur:82000000 q:23.45 tex:71302 mv:7074 misc:912 imb:47 pmb:524 smb:779 d:- ref:0 ; in:208 out:208 type:P dur:82000000 cpbdur:82000000 q:23.47 tex:68344 mv:6999 misc:905 imb:49 pmb:513 smb:788 d:- ref:0 ; in:209 out:209 type:P dur:82000000 cpbdur:82000000 q:23.35 tex:61929 mv:6866 misc:933 imb:28 pmb:516 smb:806 d:- ref:0 ; in:210 out:210 type:P dur:82000000 cpbdur:82000000 q:23.44 tex:65906 mv:6847 misc:935 imb:48 pmb:509 smb:793 d:- ref:0 ; in:211 out:211 type:P dur:82000000 cpbdur:82000000 q:23.34 tex:63014 mv:6907 misc:919 imb:41 pmb:511 smb:798 d:- ref:0 ; in:212 out:212 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:64327 mv:7081 misc:904 imb:41 pmb:519 smb:790 d:- ref:0 ; in:213 out:213 type:P dur:82000000 cpbdur:82000000 q:23.32 tex:66286 mv:6810 misc:896 imb:34 pmb:510 smb:806 d:- ref:0 ; in:214 out:214 type:P dur:82000000 cpbdur:82000000 q:23.58 tex:58851 mv:6617 misc:884 imb:29 pmb:503 smb:818 d:- ref:0 ; in:215 out:215 type:P dur:82000000 cpbdur:82000000 q:23.69 tex:63350 mv:6672 misc:906 imb:44 pmb:506 smb:800 d:- ref:0 ; in:216 out:216 type:P dur:82000000 cpbdur:82000000 q:23.65 tex:61860 mv:6635 misc:889 imb:36 pmb:499 smb:815 d:- ref:0 ; in:217 out:217 type:P dur:82000000 cpbdur:82000000 q:23.45 tex:72088 mv:6830 misc:914 imb:39 pmb:526 smb:785 d:- ref:0 ; in:218 out:218 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:59831 mv:6862 misc:875 imb:41 pmb:492 smb:817 d:- ref:0 ; in:219 out:219 type:P dur:82000000 cpbdur:82000000 q:23.43 tex:74667 mv:6810 misc:883 imb:39 pmb:514 smb:797 d:- ref:0 ; in:220 out:220 type:P dur:82000000 cpbdur:82000000 q:23.41 tex:69606 mv:7086 misc:876 imb:48 pmb:498 smb:804 d:- ref:0 ; in:221 out:221 type:P dur:82000000 cpbdur:82000000 q:23.45 tex:70161 mv:6849 misc:886 imb:34 pmb:507 smb:809 d:- ref:0 ; in:222 out:222 type:P dur:82000000 cpbdur:82000000 q:23.54 tex:58238 mv:6788 misc:862 imb:47 pmb:486 smb:817 d:- ref:0 ; in:223 out:223 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:59317 mv:6954 misc:865 imb:48 pmb:496 smb:806 d:- ref:0 ; in:224 out:224 type:P dur:82000000 cpbdur:82000000 q:23.50 tex:74112 mv:7186 misc:902 imb:69 pmb:502 smb:779 d:- ref:0 ; in:225 out:225 type:P dur:82000000 cpbdur:82000000 q:23.32 tex:67096 mv:6924 misc:876 imb:42 pmb:508 smb:800 d:- ref:0 ; in:226 out:226 type:P dur:82000000 cpbdur:82000000 q:23.38 tex:68248 mv:6758 misc:890 imb:51 pmb:494 smb:805 d:- ref:0 ; in:227 out:227 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:65236 mv:6591 misc:869 imb:45 pmb:485 smb:820 d:- ref:0 ; in:228 out:228 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:59739 mv:6456 misc:869 imb:46 pmb:488 smb:816 d:- ref:0 ; in:229 out:229 type:P dur:82000000 cpbdur:82000000 q:23.50 tex:56763 mv:6635 misc:866 imb:38 pmb:493 smb:819 d:- ref:0 ; in:230 out:230 type:P dur:82000000 cpbdur:82000000 q:23.37 tex:71824 mv:6936 misc:904 imb:53 pmb:498 smb:799 d:- ref:0 ; in:231 out:231 type:P dur:82000000 cpbdur:82000000 q:23.16 tex:61744 mv:6385 misc:903 imb:31 pmb:499 smb:820 d:- ref:0 ; in:232 out:232 type:P dur:82000000 cpbdur:82000000 q:23.15 tex:62515 mv:6460 misc:873 imb:42 pmb:500 smb:808 d:- ref:0 ; in:233 out:233 type:P dur:82000000 cpbdur:82000000 q:23.11 tex:62831 mv:6617 misc:896 imb:64 pmb:491 smb:795 d:- ref:0 ; in:234 out:234 type:P dur:82000000 cpbdur:82000000 q:23.24 tex:65883 mv:6389 misc:896 imb:46 pmb:493 smb:811 d:- ref:0 ; in:235 out:235 type:P dur:82000000 cpbdur:82000000 q:23.26 tex:63899 mv:6373 misc:888 imb:31 pmb:499 smb:820 d:- ref:0 ; in:236 out:236 type:P dur:82000000 cpbdur:82000000 q:23.37 tex:64692 mv:6708 misc:896 imb:44 pmb:498 smb:808 d:- ref:0 ; in:237 out:237 type:P dur:82000000 cpbdur:82000000 q:23.41 tex:63852 mv:6688 misc:908 imb:52 pmb:502 smb:796 d:- ref:0 ; in:238 out:238 type:P dur:82000000 cpbdur:82000000 q:23.48 tex:68946 mv:6651 misc:915 imb:58 pmb:491 smb:801 d:- ref:0 ; in:239 out:239 type:P dur:82000000 cpbdur:82000000 q:23.57 tex:56359 mv:6608 misc:873 imb:80 pmb:486 smb:784 d:- ref:0 ; in:240 out:240 type:P dur:82000000 cpbdur:82000000 q:23.77 tex:63806 mv:6941 misc:869 imb:72 pmb:497 smb:781 d:- ref:0 ; in:241 out:241 type:P dur:82000000 cpbdur:82000000 q:23.74 tex:62944 mv:6852 misc:892 imb:64 pmb:500 smb:786 d:- ref:0 ; in:242 out:242 type:P dur:82000000 cpbdur:82000000 q:23.84 tex:65405 mv:7099 misc:872 imb:63 pmb:507 smb:780 d:- ref:0 ; in:243 out:243 type:P dur:82000000 cpbdur:82000000 q:23.77 tex:65319 mv:6968 misc:865 imb:57 pmb:512 smb:781 d:- ref:0 ; in:244 out:244 type:P dur:82000000 cpbdur:82000000 q:23.87 tex:67610 mv:7271 misc:863 imb:46 pmb:523 smb:781 d:- ref:0 ; in:245 out:245 type:P dur:82000000 cpbdur:82000000 q:23.75 tex:65601 mv:6911 misc:864 imb:37 pmb:531 smb:782 d:- ref:0 ; in:246 out:246 type:P dur:82000000 cpbdur:82000000 q:23.87 tex:71525 mv:7144 misc:859 imb:44 pmb:528 smb:778 d:- ref:0 ; in:247 out:247 type:P dur:82000000 cpbdur:82000000 q:24.01 tex:75747 mv:7323 misc:866 imb:42 pmb:539 smb:769 d:- ref:0 ; in:248 out:248 type:P dur:82000000 cpbdur:82000000 q:24.20 tex:80883 mv:7747 misc:866 imb:51 pmb:541 smb:758 d:- ref:0 ; in:249 out:249 type:P dur:82000000 cpbdur:82000000 q:24.19 tex:75119 mv:7613 misc:860 imb:38 pmb:549 smb:763 d:- ref:0 ; in:250 out:250 type:I dur:82000000 cpbdur:82000000 q:20.67 tex:278691 mv:10380 misc:377 imb:1350 pmb:0 smb:0 d:- ref:; in:251 out:251 type:P dur:82000000 cpbdur:82000000 q:26.39 tex:45655 mv:7070 misc:875 imb:23 pmb:524 smb:803 d:- ref:0 ; in:252 out:252 type:P dur:82000000 cpbdur:82000000 q:25.46 tex:69649 mv:7640 misc:887 imb:30 pmb:554 smb:766 d:- ref:0 ; in:253 out:253 type:P dur:82000000 cpbdur:82000000 q:24.82 tex:70131 mv:7445 misc:880 imb:42 pmb:541 smb:767 d:- ref:0 ; in:254 out:254 type:P dur:82000000 cpbdur:82000000 q:24.57 tex:71378 mv:7826 misc:884 imb:44 pmb:546 smb:760 d:- ref:0 ; in:255 out:255 type:P dur:82000000 cpbdur:82000000 q:24.32 tex:79281 mv:7467 misc:884 imb:46 pmb:557 smb:747 d:- ref:0 ; in:256 out:256 type:P dur:82000000 cpbdur:82000000 q:24.29 tex:80231 mv:7472 misc:889 imb:43 pmb:558 smb:749 d:- ref:0 ; in:257 out:257 type:P dur:82000000 cpbdur:82000000 q:24.25 tex:79227 mv:7305 misc:876 imb:37 pmb:561 smb:752 d:- ref:0 ; in:258 out:258 type:P dur:82000000 cpbdur:82000000 q:24.28 tex:83245 mv:7247 misc:884 imb:35 pmb:555 smb:760 d:- ref:0 ; in:259 out:259 type:P dur:82000000 cpbdur:82000000 q:24.35 tex:81953 mv:7150 misc:881 imb:27 pmb:554 smb:769 d:- ref:0 ; in:260 out:260 type:P dur:82000000 cpbdur:82000000 q:24.40 tex:85038 mv:7376 misc:874 imb:30 pmb:552 smb:768 d:- ref:0 ; in:261 out:261 type:P dur:82000000 cpbdur:82000000 q:24.40 tex:83563 mv:7224 misc:877 imb:41 pmb:550 smb:759 d:- ref:0 ; in:262 out:262 type:P dur:82000000 cpbdur:82000000 q:24.44 tex:86955 mv:7197 misc:880 imb:47 pmb:545 smb:758 d:- ref:0 ; in:263 out:263 type:P dur:82000000 cpbdur:82000000 q:24.40 tex:80130 mv:7199 misc:895 imb:34 pmb:555 smb:761 d:- ref:0 ; in:264 out:264 type:P dur:82000000 cpbdur:82000000 q:24.39 tex:81470 mv:7284 misc:878 imb:32 pmb:558 smb:760 d:- ref:0 ; in:265 out:265 type:P dur:82000000 cpbdur:82000000 q:24.33 tex:78135 mv:7126 misc:883 imb:37 pmb:544 smb:769 d:- ref:0 ; in:266 out:266 type:P dur:82000000 cpbdur:82000000 q:24.26 tex:80264 mv:7162 misc:878 imb:35 pmb:544 smb:771 d:- ref:0 ; in:267 out:267 type:P dur:82000000 cpbdur:82000000 q:24.19 tex:73758 mv:7161 misc:873 imb:38 pmb:547 smb:765 d:- ref:0 ; in:268 out:268 type:P dur:82000000 cpbdur:82000000 q:24.24 tex:77811 mv:7305 misc:868 imb:40 pmb:539 smb:771 d:- ref:0 ; in:269 out:269 type:P dur:82000000 cpbdur:82000000 q:24.23 tex:79372 mv:7134 misc:870 imb:46 pmb:540 smb:764 d:- ref:0 ; in:270 out:270 type:P dur:82000000 cpbdur:82000000 q:24.23 tex:76040 mv:7323 misc:869 imb:33 pmb:547 smb:770 d:- ref:0 ; in:271 out:271 type:P dur:82000000 cpbdur:82000000 q:24.09 tex:76912 mv:6820 misc:876 imb:25 pmb:544 smb:781 d:- ref:0 ; in:272 out:272 type:P dur:82000000 cpbdur:82000000 q:24.12 tex:75957 mv:7324 misc:863 imb:39 pmb:558 smb:753 d:- ref:0 ; in:273 out:273 type:P dur:82000000 cpbdur:82000000 q:24.03 tex:76957 mv:7271 misc:876 imb:37 pmb:543 smb:770 d:- ref:0 ; in:274 out:274 type:P dur:82000000 cpbdur:82000000 q:23.99 tex:72425 mv:7181 misc:874 imb:28 pmb:549 smb:773 d:- ref:0 ; in:275 out:275 type:P dur:82000000 cpbdur:82000000 q:23.97 tex:73693 mv:7190 misc:877 imb:26 pmb:546 smb:778 d:- ref:0 ; in:276 out:276 type:P dur:82000000 cpbdur:82000000 q:24.02 tex:77161 mv:7601 misc:894 imb:48 pmb:549 smb:753 d:- ref:0 ; in:277 out:277 type:P dur:82000000 cpbdur:82000000 q:24.03 tex:77038 mv:7140 misc:894 imb:40 pmb:548 smb:762 d:- ref:0 ; in:278 out:278 type:P dur:82000000 cpbdur:82000000 q:24.22 tex:79847 mv:7510 misc:899 imb:41 pmb:552 smb:757 d:- ref:0 ; in:279 out:279 type:P dur:82000000 cpbdur:82000000 q:24.17 tex:79669 mv:7127 misc:892 imb:41 pmb:549 smb:760 d:- ref:0 ; in:280 out:280 type:P dur:82000000 cpbdur:82000000 q:24.20 tex:80013 mv:7384 misc:907 imb:45 pmb:554 smb:751 d:- ref:0 ; in:281 out:281 type:P dur:82000000 cpbdur:82000000 q:24.23 tex:80959 mv:7284 misc:925 imb:47 pmb:560 smb:743 d:- ref:0 ; in:282 out:282 type:P dur:82000000 cpbdur:82000000 q:24.58 tex:87137 mv:7522 misc:909 imb:42 pmb:562 smb:746 d:- ref:0 ; in:283 out:283 type:P dur:82000000 cpbdur:82000000 q:24.67 tex:88143 mv:7354 misc:903 imb:46 pmb:552 smb:752 d:- ref:0 ; in:284 out:284 type:P dur:82000000 cpbdur:82000000 q:24.85 tex:92753 mv:7224 misc:903 imb:42 pmb:542 smb:766 d:- ref:0 ; in:285 out:285 type:P dur:82000000 cpbdur:82000000 q:24.87 tex:94522 mv:7244 misc:906 imb:36 pmb:558 smb:756 d:- ref:0 ; in:286 out:286 type:P dur:82000000 cpbdur:82000000 q:24.85 tex:94496 mv:7532 misc:908 imb:53 pmb:542 smb:755 d:- ref:0 ; in:287 out:287 type:P dur:82000000 cpbdur:82000000 q:24.72 tex:83843 mv:7665 misc:916 imb:54 pmb:539 smb:757 d:- ref:0 ; in:288 out:288 type:P dur:82000000 cpbdur:82000000 q:24.49 tex:86571 mv:8054 misc:903 imb:78 pmb:526 smb:746 d:- ref:0 ; in:289 out:289 type:P dur:82000000 cpbdur:82000000 q:24.16 tex:70887 mv:7686 misc:899 imb:37 pmb:554 smb:759 d:- ref:0 ; in:290 out:290 type:P dur:82000000 cpbdur:82000000 q:24.00 tex:69777 mv:7832 misc:919 imb:37 pmb:550 smb:763 d:- ref:0 ; in:291 out:291 type:P dur:82000000 cpbdur:82000000 q:23.86 tex:70541 mv:7714 misc:913 imb:33 pmb:548 smb:769 d:- ref:0 ; in:292 out:292 type:P dur:82000000 cpbdur:82000000 q:23.81 tex:70860 mv:7901 misc:911 imb:37 pmb:553 smb:760 d:- ref:0 ; in:293 out:293 type:P dur:82000000 cpbdur:82000000 q:23.75 tex:68442 mv:7876 misc:906 imb:45 pmb:552 smb:753 d:- ref:0 ; in:294 out:294 type:P dur:82000000 cpbdur:82000000 q:23.77 tex:70551 mv:7875 misc:894 imb:33 pmb:559 smb:758 d:- ref:0 ; in:295 out:295 type:P dur:82000000 cpbdur:82000000 q:23.77 tex:70493 mv:7698 misc:913 imb:40 pmb:556 smb:754 d:- ref:0 ; in:296 out:296 type:P dur:82000000 cpbdur:82000000 q:23.83 tex:74403 mv:8078 misc:911 imb:48 pmb:554 smb:748 d:- ref:0 ; in:297 out:297 type:P dur:82000000 cpbdur:82000000 q:23.91 tex:72851 mv:8190 misc:895 imb:39 pmb:562 smb:749 d:- ref:0 ; in:298 out:298 type:P dur:82000000 cpbdur:82000000 q:23.88 tex:72957 mv:7994 misc:897 imb:36 pmb:564 smb:750 d:- ref:0 ; in:299 out:299 type:P dur:82000000 cpbdur:82000000 q:23.86 tex:71621 mv:7593 misc:914 imb:43 pmb:549 smb:758 d:- ref:0 ; in:300 out:300 type:P dur:82000000 cpbdur:82000000 q:23.81 tex:70327 mv:8010 misc:903 imb:44 pmb:554 smb:752 d:- ref:0 ; in:301 out:301 type:P dur:82000000 cpbdur:82000000 q:23.76 tex:70541 mv:7677 misc:894 imb:32 pmb:551 smb:767 d:- ref:0 ; in:302 out:302 type:P dur:82000000 cpbdur:82000000 q:23.73 tex:68126 mv:7844 misc:902 imb:35 pmb:554 smb:761 d:- ref:0 ; in:303 out:303 type:P dur:82000000 cpbdur:82000000 q:23.67 tex:67873 mv:7592 misc:903 imb:37 pmb:542 smb:771 d:- ref:0 ; in:304 out:304 type:P dur:82000000 cpbdur:82000000 q:23.67 tex:68885 mv:7417 misc:914 imb:25 pmb:549 smb:776 d:- ref:0 ; in:305 out:305 type:P dur:82000000 cpbdur:82000000 q:23.68 tex:67904 mv:7352 misc:912 imb:23 pmb:546 smb:781 d:- ref:0 ; in:306 out:306 type:P dur:82000000 cpbdur:82000000 q:23.67 tex:68408 mv:7761 misc:911 imb:31 pmb:561 smb:758 d:- ref:0 ; in:307 out:307 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:66738 mv:7548 misc:906 imb:29 pmb:554 smb:767 d:- ref:0 ; in:308 out:308 type:P dur:82000000 cpbdur:82000000 q:23.65 tex:67302 mv:7660 misc:910 imb:33 pmb:546 smb:771 d:- ref:0 ; in:309 out:309 type:P dur:82000000 cpbdur:82000000 q:23.58 tex:66303 mv:7407 misc:898 imb:31 pmb:547 smb:772 d:- ref:0 ; in:310 out:310 type:P dur:82000000 cpbdur:82000000 q:23.67 tex:69567 mv:7399 misc:898 imb:29 pmb:549 smb:772 d:- ref:0 ; in:311 out:311 type:P dur:82000000 cpbdur:82000000 q:23.67 tex:68297 mv:7443 misc:900 imb:30 pmb:533 smb:787 d:- ref:0 ; in:312 out:312 type:P dur:82000000 cpbdur:82000000 q:23.65 tex:67856 mv:7589 misc:891 imb:47 pmb:539 smb:764 d:- ref:0 ; in:313 out:313 type:P dur:82000000 cpbdur:82000000 q:23.52 tex:66665 mv:7744 misc:879 imb:37 pmb:546 smb:767 d:- ref:0 ; in:314 out:314 type:P dur:82000000 cpbdur:82000000 q:23.58 tex:66572 mv:7369 misc:883 imb:28 pmb:543 smb:779 d:- ref:0 ; in:315 out:315 type:P dur:82000000 cpbdur:82000000 q:23.57 tex:66614 mv:7258 misc:864 imb:29 pmb:542 smb:779 d:- ref:0 ; in:316 out:316 type:P dur:82000000 cpbdur:82000000 q:23.67 tex:67896 mv:7693 misc:867 imb:40 pmb:527 smb:783 d:- ref:0 ; in:317 out:317 type:P dur:82000000 cpbdur:82000000 q:23.64 tex:66267 mv:7420 misc:865 imb:25 pmb:540 smb:785 d:- ref:0 ; in:318 out:318 type:P dur:82000000 cpbdur:82000000 q:23.64 tex:67627 mv:7626 misc:859 imb:31 pmb:538 smb:781 d:- ref:0 ; in:319 out:319 type:P dur:82000000 cpbdur:82000000 q:23.56 tex:66570 mv:7644 misc:866 imb:33 pmb:542 smb:775 d:- ref:0 ; in:320 out:320 type:P dur:82000000 cpbdur:82000000 q:23.60 tex:65867 mv:7785 misc:860 imb:36 pmb:549 smb:765 d:- ref:0 ; in:321 out:321 type:P dur:82000000 cpbdur:82000000 q:23.57 tex:66479 mv:7774 misc:859 imb:37 pmb:540 smb:773 d:- ref:0 ; in:322 out:322 type:P dur:82000000 cpbdur:82000000 q:23.62 tex:67897 mv:7414 misc:849 imb:31 pmb:522 smb:797 d:- ref:0 ; in:323 out:323 type:P dur:82000000 cpbdur:82000000 q:23.54 tex:67541 mv:7337 misc:858 imb:36 pmb:527 smb:787 d:- ref:0 ; in:324 out:324 type:P dur:82000000 cpbdur:82000000 q:23.63 tex:66738 mv:7668 misc:866 imb:39 pmb:530 smb:781 d:- ref:0 ; in:325 out:325 type:P dur:82000000 cpbdur:82000000 q:23.61 tex:65955 mv:7414 misc:871 imb:25 pmb:526 smb:799 d:- ref:0 ; in:326 out:326 type:P dur:82000000 cpbdur:82000000 q:25.61 tex:134264 mv:13625 misc:1407 imb:1257 pmb:59 smb:34 d:- ref:0 ; in:327 out:327 type:P dur:82000000 cpbdur:82000000 q:25.66 tex:99453 mv:14527 misc:1308 imb:300 pmb:661 smb:389 d:- ref:0 ; in:328 out:328 type:P dur:82000000 cpbdur:82000000 q:23.54 tex:32676 mv:3017 misc:1435 imb:45 pmb:655 smb:650 d:- ref:0 ; in:329 out:329 type:P dur:82000000 cpbdur:82000000 q:25.53 tex:138804 mv:17893 misc:1423 imb:532 pmb:651 smb:167 d:- ref:0 ; in:330 out:330 type:P dur:82000000 cpbdur:82000000 q:23.37 tex:61862 mv:4478 misc:1516 imb:127 pmb:936 smb:287 d:- ref:0 ; in:331 out:331 type:P dur:82000000 cpbdur:82000000 q:24.82 tex:117435 mv:16889 misc:1444 imb:276 pmb:853 smb:221 d:- ref:0 ; in:332 out:332 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:38858 mv:3130 misc:1524 imb:42 pmb:770 smb:538 d:- ref:0 ; in:333 out:333 type:P dur:82000000 cpbdur:82000000 q:24.73 tex:127221 mv:18193 misc:1434 imb:367 pmb:875 smb:108 d:- ref:0 ; in:334 out:334 type:P dur:82000000 cpbdur:82000000 q:22.94 tex:52237 mv:4311 misc:1532 imb:50 pmb:869 smb:431 d:- ref:0 ; in:335 out:335 type:P dur:82000000 cpbdur:82000000 q:23.94 tex:96167 mv:16152 misc:1449 imb:195 pmb:992 smb:163 d:- ref:0 ; in:336 out:336 type:P dur:82000000 cpbdur:82000000 q:21.91 tex:65403 mv:4087 misc:1542 imb:57 pmb:953 smb:340 d:- ref:0 ; in:337 out:337 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:90307 mv:15349 misc:1464 imb:204 pmb:951 smb:195 d:- ref:0 ; in:338 out:338 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:60966 mv:4175 misc:1539 imb:41 pmb:951 smb:358 d:- ref:0 ; in:339 out:339 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:79290 mv:12285 misc:1497 imb:138 pmb:965 smb:247 d:- ref:0 ; in:340 out:340 type:P dur:82000000 cpbdur:82000000 q:21.06 tex:66682 mv:4597 misc:1553 imb:42 pmb:975 smb:333 d:- ref:0 ; in:341 out:341 type:P dur:82000000 cpbdur:82000000 q:22.49 tex:95114 mv:12947 misc:1491 imb:120 pmb:1017 smb:213 d:- ref:0 ; in:342 out:342 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:34311 mv:3252 misc:1541 imb:23 pmb:734 smb:593 d:- ref:0 ; in:343 out:343 type:P dur:82000000 cpbdur:82000000 q:22.06 tex:82587 mv:12006 misc:1495 imb:92 pmb:1004 smb:254 d:- ref:0 ; in:344 out:344 type:P dur:82000000 cpbdur:82000000 q:20.71 tex:40110 mv:4170 misc:1576 imb:55 pmb:828 smb:467 d:- ref:0 ; in:345 out:345 type:P dur:82000000 cpbdur:82000000 q:21.98 tex:78461 mv:11237 misc:1478 imb:72 pmb:995 smb:283 d:- ref:0 ; in:346 out:346 type:P dur:82000000 cpbdur:82000000 q:20.68 tex:40382 mv:4143 misc:1555 imb:47 pmb:847 smb:456 d:- ref:0 ; in:347 out:347 type:P dur:82000000 cpbdur:82000000 q:22.16 tex:85555 mv:12169 misc:1476 imb:85 pmb:1007 smb:258 d:- ref:0 ; in:348 out:348 type:P dur:82000000 cpbdur:82000000 q:20.86 tex:42438 mv:4372 misc:1566 imb:63 pmb:852 smb:435 d:- ref:0 ; in:349 out:349 type:P dur:82000000 cpbdur:82000000 q:22.18 tex:85252 mv:12134 misc:1462 imb:92 pmb:1002 smb:256 d:- ref:0 ; in:350 out:350 type:P dur:82000000 cpbdur:82000000 q:20.97 tex:49485 mv:4320 misc:1475 imb:27 pmb:814 smb:509 d:- ref:0 ; in:351 out:351 type:P dur:82000000 cpbdur:82000000 q:21.94 tex:71589 mv:10103 misc:1468 imb:45 pmb:953 smb:352 d:- ref:0 ; in:352 out:352 type:P dur:82000000 cpbdur:82000000 q:20.23 tex:55685 mv:3430 misc:1509 imb:17 pmb:872 smb:461 d:- ref:0 ; in:353 out:353 type:P dur:82000000 cpbdur:82000000 q:21.44 tex:77013 mv:8848 misc:1475 imb:52 pmb:968 smb:330 d:- ref:0 ; in:354 out:354 type:P dur:82000000 cpbdur:82000000 q:20.98 tex:50611 mv:5268 misc:1489 imb:22 pmb:784 smb:544 d:- ref:0 ; in:355 out:355 type:P dur:82000000 cpbdur:82000000 q:21.42 tex:70546 mv:8203 misc:1475 imb:30 pmb:931 smb:389 d:- ref:0 ; in:356 out:356 type:P dur:82000000 cpbdur:82000000 q:20.37 tex:47744 mv:3488 misc:1496 imb:17 pmb:762 smb:571 d:- ref:0 ; in:357 out:357 type:P dur:82000000 cpbdur:82000000 q:23.22 tex:65403 mv:14104 misc:1413 imb:1225 pmb:124 smb:1 d:- ref:0 ; in:358 out:358 type:P dur:82000000 cpbdur:82000000 q:22.11 tex:21825 mv:8393 misc:1086 imb:61 pmb:603 smb:686 d:- ref:0 ; in:359 out:359 type:P dur:82000000 cpbdur:82000000 q:21.59 tex:28843 mv:8925 misc:1104 imb:62 pmb:623 smb:665 d:- ref:0 ; in:360 out:360 type:P dur:82000000 cpbdur:82000000 q:21.44 tex:39753 mv:9308 misc:1107 imb:80 pmb:626 smb:644 d:- ref:0 ; in:361 out:361 type:P dur:82000000 cpbdur:82000000 q:21.60 tex:37297 mv:9243 misc:1076 imb:68 pmb:611 smb:671 d:- ref:0 ; in:362 out:362 type:P dur:82000000 cpbdur:82000000 q:21.88 tex:46100 mv:9116 misc:1072 imb:74 pmb:598 smb:678 d:- ref:0 ; in:363 out:363 type:P dur:82000000 cpbdur:82000000 q:22.00 tex:46995 mv:9019 misc:1074 imb:71 pmb:587 smb:692 d:- ref:0 ; in:364 out:364 type:P dur:82000000 cpbdur:82000000 q:22.41 tex:58744 mv:8870 misc:1042 imb:83 pmb:580 smb:687 d:- ref:0 ; in:365 out:365 type:P dur:82000000 cpbdur:82000000 q:22.59 tex:52665 mv:7437 misc:1042 imb:86 pmb:529 smb:735 d:- ref:0 ; in:366 out:366 type:P dur:82000000 cpbdur:82000000 q:23.27 tex:83557 mv:7639 misc:1068 imb:126 pmb:535 smb:689 d:- ref:0 ; in:367 out:367 type:P dur:82000000 cpbdur:82000000 q:23.82 tex:91357 mv:5905 misc:1034 imb:58 pmb:537 smb:755 d:- ref:0 ; in:368 out:368 type:P dur:82000000 cpbdur:82000000 q:23.89 tex:94305 mv:4912 misc:1039 imb:54 pmb:548 smb:748 d:- ref:0 ; in:369 out:369 type:P dur:82000000 cpbdur:82000000 q:23.61 tex:71141 mv:4493 misc:1014 imb:44 pmb:537 smb:769 d:- ref:0 ; in:370 out:370 type:P dur:82000000 cpbdur:82000000 q:23.54 tex:75708 mv:4943 misc:1045 imb:63 pmb:547 smb:740 d:- ref:0 ; in:371 out:371 type:P dur:82000000 cpbdur:82000000 q:23.37 tex:91460 mv:4775 misc:1101 imb:65 pmb:543 smb:742 d:- ref:0 ; in:372 out:372 type:P dur:82000000 cpbdur:82000000 q:23.47 tex:82309 mv:4682 misc:1041 imb:54 pmb:528 smb:768 d:- ref:0 ; in:373 out:373 type:P dur:82000000 cpbdur:82000000 q:23.40 tex:81629 mv:4330 misc:1041 imb:35 pmb:526 smb:789 d:- ref:0 ; in:374 out:374 type:P dur:82000000 cpbdur:82000000 q:23.58 tex:73258 mv:4650 misc:1044 imb:48 pmb:524 smb:778 d:- ref:0 ; in:375 out:375 type:P dur:82000000 cpbdur:82000000 q:23.52 tex:76335 mv:4200 misc:1009 imb:36 pmb:512 smb:802 d:- ref:0 ; in:376 out:376 type:P dur:82000000 cpbdur:82000000 q:23.63 tex:77513 mv:4542 misc:1033 imb:41 pmb:516 smb:793 d:- ref:0 ; in:377 out:377 type:P dur:82000000 cpbdur:82000000 q:23.21 tex:76094 mv:4479 misc:1059 imb:54 pmb:527 smb:769 d:- ref:0 ; in:378 out:378 type:P dur:82000000 cpbdur:82000000 q:22.95 tex:63428 mv:4266 misc:1050 imb:43 pmb:492 smb:815 d:- ref:0 ; in:379 out:379 type:P dur:82000000 cpbdur:82000000 q:22.67 tex:61205 mv:4184 misc:1003 imb:48 pmb:458 smb:844 d:- ref:0 ; in:380 out:380 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:62714 mv:4257 misc:1021 imb:44 pmb:479 smb:827 d:- ref:0 ; in:381 out:381 type:P dur:82000000 cpbdur:82000000 q:22.59 tex:60277 mv:4429 misc:1014 imb:59 pmb:449 smb:842 d:- ref:0 ; in:382 out:382 type:P dur:82000000 cpbdur:82000000 q:22.46 tex:85545 mv:4365 misc:1106 imb:51 pmb:545 smb:754 d:- ref:0 ; in:383 out:383 type:P dur:82000000 cpbdur:82000000 q:22.37 tex:66335 mv:4141 misc:1020 imb:46 pmb:481 smb:823 d:- ref:0 ; in:384 out:384 type:P dur:82000000 cpbdur:82000000 q:22.25 tex:67352 mv:3992 misc:976 imb:22 pmb:450 smb:878 d:- ref:0 ; in:385 out:385 type:P dur:82000000 cpbdur:82000000 q:22.21 tex:66159 mv:4151 misc:1002 imb:25 pmb:481 smb:844 d:- ref:0 ; in:386 out:386 type:P dur:82000000 cpbdur:82000000 q:22.17 tex:67617 mv:4000 misc:967 imb:29 pmb:444 smb:877 d:- ref:0 ; in:387 out:387 type:P dur:82000000 cpbdur:82000000 q:21.98 tex:62348 mv:3771 misc:953 imb:27 pmb:439 smb:884 d:- ref:0 ; in:388 out:388 type:P dur:82000000 cpbdur:82000000 q:22.03 tex:61186 mv:3702 misc:976 imb:25 pmb:448 smb:877 d:- ref:0 ; in:389 out:389 type:P dur:82000000 cpbdur:82000000 q:21.95 tex:62838 mv:3835 misc:935 imb:18 pmb:449 smb:883 d:- ref:0 ; in:390 out:390 type:P dur:82000000 cpbdur:82000000 q:22.13 tex:62542 mv:4444 misc:1022 imb:26 pmb:486 smb:838 d:- ref:0 ; in:391 out:391 type:P dur:82000000 cpbdur:82000000 q:22.00 tex:58315 mv:3715 misc:954 imb:22 pmb:419 smb:909 d:- ref:0 ; in:392 out:392 type:P dur:82000000 cpbdur:82000000 q:22.06 tex:65482 mv:3812 misc:938 imb:23 pmb:442 smb:885 d:- ref:0 ; in:393 out:393 type:P dur:82000000 cpbdur:82000000 q:22.11 tex:62793 mv:4104 misc:991 imb:36 pmb:476 smb:838 d:- ref:0 ; in:394 out:394 type:P dur:82000000 cpbdur:82000000 q:22.03 tex:65162 mv:4255 misc:975 imb:35 pmb:469 smb:846 d:- ref:0 ; in:395 out:395 type:P dur:82000000 cpbdur:82000000 q:21.74 tex:56832 mv:4017 misc:967 imb:26 pmb:463 smb:861 d:- ref:0 ; in:396 out:396 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:61191 mv:4115 misc:982 imb:26 pmb:477 smb:847 d:- ref:0 ; in:397 out:397 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:60158 mv:4115 misc:951 imb:23 pmb:465 smb:862 d:- ref:0 ; in:398 out:398 type:P dur:82000000 cpbdur:82000000 q:21.52 tex:54794 mv:4170 misc:996 imb:27 pmb:488 smb:835 d:- ref:0 ; in:399 out:399 type:P dur:82000000 cpbdur:82000000 q:21.43 tex:75218 mv:4245 misc:1073 imb:41 pmb:547 smb:762 d:- ref:0 ; in:400 out:400 type:P dur:82000000 cpbdur:82000000 q:21.52 tex:56273 mv:3762 misc:957 imb:26 pmb:454 smb:870 d:- ref:0 ; in:401 out:401 type:P dur:82000000 cpbdur:82000000 q:21.67 tex:61944 mv:4262 misc:978 imb:21 pmb:486 smb:843 d:- ref:0 ; in:402 out:402 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:57116 mv:4108 misc:920 imb:25 pmb:440 smb:885 d:- ref:0 ; in:403 out:403 type:P dur:82000000 cpbdur:82000000 q:21.51 tex:58329 mv:3956 misc:979 imb:31 pmb:464 smb:855 d:- ref:0 ; in:404 out:404 type:P dur:82000000 cpbdur:82000000 q:21.53 tex:61788 mv:4141 misc:983 imb:20 pmb:477 smb:853 d:- ref:0 ; in:405 out:405 type:P dur:82000000 cpbdur:82000000 q:21.64 tex:60205 mv:4158 misc:1013 imb:37 pmb:480 smb:833 d:- ref:0 ; in:406 out:406 type:P dur:82000000 cpbdur:82000000 q:21.64 tex:60891 mv:4065 misc:988 imb:41 pmb:469 smb:840 d:- ref:0 ; in:407 out:407 type:P dur:82000000 cpbdur:82000000 q:21.66 tex:62110 mv:3906 misc:992 imb:19 pmb:464 smb:867 d:- ref:0 ; in:408 out:408 type:P dur:82000000 cpbdur:82000000 q:21.84 tex:63329 mv:4254 misc:993 imb:29 pmb:486 smb:835 d:- ref:0 ; in:409 out:409 type:P dur:82000000 cpbdur:82000000 q:21.87 tex:64039 mv:4185 misc:968 imb:22 pmb:475 smb:853 d:- ref:0 ; in:410 out:410 type:P dur:82000000 cpbdur:82000000 q:22.00 tex:63496 mv:4341 misc:995 imb:26 pmb:493 smb:831 d:- ref:0 ; in:411 out:411 type:P dur:82000000 cpbdur:82000000 q:21.80 tex:63098 mv:4148 misc:986 imb:20 pmb:488 smb:842 d:- ref:0 ; in:412 out:412 type:P dur:82000000 cpbdur:82000000 q:21.99 tex:65776 mv:4202 misc:1014 imb:21 pmb:506 smb:823 d:- ref:0 ; in:413 out:413 type:P dur:82000000 cpbdur:82000000 q:21.84 tex:62445 mv:4480 misc:1011 imb:39 pmb:480 smb:831 d:- ref:0 ; in:414 out:414 type:P dur:82000000 cpbdur:82000000 q:21.77 tex:65933 mv:4300 misc:1007 imb:26 pmb:486 smb:838 d:- ref:0 ; in:415 out:415 type:P dur:82000000 cpbdur:82000000 q:21.86 tex:64281 mv:4560 misc:1023 imb:18 pmb:516 smb:816 d:- ref:0 ; in:416 out:416 type:P dur:82000000 cpbdur:82000000 q:21.72 tex:63000 mv:4463 misc:1001 imb:36 pmb:483 smb:831 d:- ref:0 ; in:417 out:417 type:P dur:82000000 cpbdur:82000000 q:21.80 tex:65654 mv:4575 misc:1019 imb:36 pmb:501 smb:813 d:- ref:0 ; in:418 out:418 type:P dur:82000000 cpbdur:82000000 q:21.88 tex:68612 mv:4718 misc:1014 imb:45 pmb:500 smb:805 d:- ref:0 ; in:419 out:419 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:67691 mv:4409 misc:980 imb:29 pmb:503 smb:818 d:- ref:0 ; in:420 out:420 type:P dur:82000000 cpbdur:82000000 q:21.96 tex:67710 mv:4566 misc:996 imb:26 pmb:504 smb:820 d:- ref:0 ; in:421 out:421 type:P dur:82000000 cpbdur:82000000 q:21.82 tex:64851 mv:4398 misc:951 imb:29 pmb:484 smb:837 d:- ref:0 ; in:422 out:422 type:P dur:82000000 cpbdur:82000000 q:22.06 tex:70265 mv:4892 misc:1019 imb:36 pmb:520 smb:794 d:- ref:0 ; in:423 out:423 type:P dur:82000000 cpbdur:82000000 q:22.20 tex:73290 mv:4425 misc:981 imb:21 pmb:501 smb:828 d:- ref:0 ; in:424 out:424 type:P dur:82000000 cpbdur:82000000 q:22.33 tex:69020 mv:4421 misc:975 imb:27 pmb:495 smb:828 d:- ref:0 ; in:425 out:425 type:P dur:82000000 cpbdur:82000000 q:22.31 tex:68228 mv:4467 misc:953 imb:21 pmb:505 smb:824 d:- ref:0 ; in:426 out:426 type:P dur:82000000 cpbdur:82000000 q:22.39 tex:74106 mv:4636 misc:994 imb:23 pmb:508 smb:819 d:- ref:0 ; in:427 out:427 type:P dur:82000000 cpbdur:82000000 q:22.53 tex:56751 mv:4570 misc:983 imb:22 pmb:500 smb:828 d:- ref:0 ; in:428 out:428 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:66093 mv:4711 misc:996 imb:28 pmb:505 smb:817 d:- ref:0 ; in:429 out:429 type:P dur:82000000 cpbdur:82000000 q:22.51 tex:63556 mv:4618 misc:1002 imb:24 pmb:508 smb:818 d:- ref:0 ; in:430 out:430 type:P dur:82000000 cpbdur:82000000 q:22.59 tex:63962 mv:4600 misc:998 imb:42 pmb:498 smb:810 d:- ref:0 ; in:431 out:431 type:P dur:82000000 cpbdur:82000000 q:22.57 tex:62854 mv:4559 misc:995 imb:27 pmb:505 smb:818 d:- ref:0 ; in:432 out:432 type:P dur:82000000 cpbdur:82000000 q:22.61 tex:63239 mv:4634 misc:999 imb:31 pmb:506 smb:813 d:- ref:0 ; in:433 out:433 type:P dur:82000000 cpbdur:82000000 q:22.59 tex:60358 mv:4796 misc:990 imb:25 pmb:522 smb:803 d:- ref:0 ; in:434 out:434 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:61373 mv:4760 misc:987 imb:27 pmb:508 smb:815 d:- ref:0 ; in:435 out:435 type:P dur:82000000 cpbdur:82000000 q:22.64 tex:61064 mv:4485 misc:1003 imb:28 pmb:507 smb:815 d:- ref:0 ; in:436 out:436 type:P dur:82000000 cpbdur:82000000 q:22.60 tex:64775 mv:4913 misc:984 imb:40 pmb:515 smb:795 d:- ref:0 ; in:437 out:437 type:P dur:82000000 cpbdur:82000000 q:22.55 tex:62867 mv:4546 misc:979 imb:24 pmb:518 smb:808 d:- ref:0 ; in:438 out:438 type:P dur:82000000 cpbdur:82000000 q:22.55 tex:68839 mv:4717 misc:980 imb:25 pmb:519 smb:806 d:- ref:0 ; in:439 out:439 type:P dur:82000000 cpbdur:82000000 q:22.37 tex:83207 mv:5185 misc:1016 imb:28 pmb:573 smb:749 d:- ref:0 ; in:440 out:440 type:P dur:82000000 cpbdur:82000000 q:22.59 tex:63540 mv:4931 misc:977 imb:42 pmb:491 smb:817 d:- ref:0 ; in:441 out:441 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:85863 mv:4997 misc:1036 imb:43 pmb:539 smb:768 d:- ref:0 ; in:442 out:442 type:P dur:82000000 cpbdur:82000000 q:22.55 tex:59054 mv:5010 misc:1016 imb:28 pmb:512 smb:810 d:- ref:0 ; in:443 out:443 type:P dur:82000000 cpbdur:82000000 q:22.48 tex:79705 mv:5291 misc:1044 imb:46 pmb:553 smb:751 d:- ref:0 ; in:444 out:444 type:P dur:82000000 cpbdur:82000000 q:22.45 tex:70894 mv:4896 misc:1010 imb:48 pmb:524 smb:778 d:- ref:0 ; in:445 out:445 type:P dur:82000000 cpbdur:82000000 q:22.40 tex:71173 mv:5107 misc:1008 imb:32 pmb:543 smb:775 d:- ref:0 ; in:446 out:446 type:P dur:82000000 cpbdur:82000000 q:22.47 tex:74158 mv:5065 misc:1009 imb:20 pmb:549 smb:781 d:- ref:0 ; in:447 out:447 type:P dur:82000000 cpbdur:82000000 q:22.47 tex:71391 mv:5378 misc:1039 imb:38 pmb:542 smb:770 d:- ref:0 ; in:448 out:448 type:P dur:82000000 cpbdur:82000000 q:22.51 tex:59973 mv:4958 misc:989 imb:27 pmb:506 smb:817 d:- ref:0 ; in:449 out:449 type:P dur:82000000 cpbdur:82000000 q:22.51 tex:60418 mv:5004 misc:1010 imb:34 pmb:532 smb:784 d:- ref:0 ; in:450 out:450 type:P dur:82000000 cpbdur:82000000 q:22.38 tex:80433 mv:5295 misc:1032 imb:38 pmb:567 smb:745 d:- ref:0 ; in:451 out:451 type:P dur:82000000 cpbdur:82000000 q:22.50 tex:55553 mv:5278 misc:1017 imb:43 pmb:504 smb:803 d:- ref:0 ; in:452 out:452 type:P dur:82000000 cpbdur:82000000 q:22.53 tex:60176 mv:4885 misc:1027 imb:49 pmb:513 smb:788 d:- ref:0 ; in:453 out:453 type:P dur:82000000 cpbdur:82000000 q:22.71 tex:65281 mv:5025 misc:1062 imb:53 pmb:519 smb:778 d:- ref:0 ; in:454 out:454 type:P dur:82000000 cpbdur:82000000 q:22.87 tex:52603 mv:9343 misc:1270 imb:1069 pmb:27 smb:254 d:- ref:0 ; in:455 out:455 type:P dur:82000000 cpbdur:82000000 q:20.92 tex:7698 mv:4088 misc:1238 imb:372 pmb:312 smb:666 d:- ref:0 ; in:456 out:456 type:P dur:82000000 cpbdur:82000000 q:20.80 tex:33226 mv:7171 misc:1139 imb:303 pmb:345 smb:702 d:- ref:0 ; in:457 out:457 type:P dur:82000000 cpbdur:82000000 q:19.25 tex:19145 mv:2172 misc:1099 imb:57 pmb:382 smb:911 d:- ref:0 ; in:458 out:458 type:P dur:82000000 cpbdur:82000000 q:20.36 tex:37101 mv:5762 misc:953 imb:173 pmb:292 smb:885 d:- ref:0 ; in:459 out:459 type:P dur:82000000 cpbdur:82000000 q:18.51 tex:11804 mv:1894 misc:886 imb:50 pmb:310 smb:990 d:- ref:0 ; in:460 out:460 type:P dur:82000000 cpbdur:82000000 q:20.78 tex:43132 mv:6124 misc:872 imb:250 pmb:224 smb:876 d:- ref:0 ; in:461 out:461 type:P dur:82000000 cpbdur:82000000 q:18.72 tex:12929 mv:1768 misc:943 imb:40 pmb:316 smb:994 d:- ref:0 ; in:462 out:462 type:P dur:82000000 cpbdur:82000000 q:20.74 tex:38871 mv:6309 misc:908 imb:184 pmb:277 smb:889 d:- ref:0 ; in:463 out:463 type:P dur:82000000 cpbdur:82000000 q:18.76 tex:16235 mv:1619 misc:962 imb:39 pmb:317 smb:994 d:- ref:0 ; in:464 out:464 type:P dur:82000000 cpbdur:82000000 q:19.86 tex:28806 mv:4830 misc:780 imb:87 pmb:280 smb:983 d:- ref:0 ; in:465 out:465 type:P dur:82000000 cpbdur:82000000 q:18.07 tex:16645 mv:1787 misc:968 imb:51 pmb:317 smb:982 d:- ref:0 ; in:466 out:466 type:P dur:82000000 cpbdur:82000000 q:19.74 tex:31075 mv:5774 misc:1039 imb:184 pmb:290 smb:876 d:- ref:0 ; in:467 out:467 type:P dur:82000000 cpbdur:82000000 q:17.85 tex:14831 mv:1843 misc:974 imb:62 pmb:309 smb:979 d:- ref:0 ; in:468 out:468 type:P dur:82000000 cpbdur:82000000 q:19.20 tex:33793 mv:5484 misc:851 imb:121 pmb:314 smb:915 d:- ref:0 ; in:469 out:469 type:P dur:82000000 cpbdur:82000000 q:17.45 tex:19057 mv:3656 misc:1415 imb:249 pmb:394 smb:707 d:- ref:0 ; in:470 out:470 type:P dur:82000000 cpbdur:82000000 q:19.22 tex:32728 mv:4957 misc:795 imb:72 pmb:323 smb:955 d:- ref:0 ; in:471 out:471 type:P dur:82000000 cpbdur:82000000 q:17.82 tex:11788 mv:1660 misc:840 imb:31 pmb:252 smb:1067 d:- ref:0 ; in:472 out:472 type:P dur:82000000 cpbdur:82000000 q:20.78 tex:45636 mv:5925 misc:775 imb:212 pmb:243 smb:895 d:- ref:0 ; in:473 out:473 type:P dur:82000000 cpbdur:82000000 q:21.25 tex:37139 mv:5413 misc:800 imb:220 pmb:249 smb:881 d:- ref:0 ; in:474 out:474 type:P dur:82000000 cpbdur:82000000 q:22.10 tex:40336 mv:5814 misc:858 imb:187 pmb:248 smb:915 d:- ref:0 ; in:475 out:475 type:P dur:82000000 cpbdur:82000000 q:22.31 tex:32202 mv:5521 misc:829 imb:259 pmb:213 smb:878 d:- ref:0 ; in:476 out:476 type:P dur:82000000 cpbdur:82000000 q:22.09 tex:29078 mv:4276 misc:782 imb:157 pmb:194 smb:999 d:- ref:0 ; in:477 out:477 type:P dur:82000000 cpbdur:82000000 q:21.18 tex:14089 mv:3007 misc:832 imb:196 pmb:109 smb:1045 d:- ref:0 ; in:478 out:478 type:P dur:82000000 cpbdur:82000000 q:19.85 tex:10463 mv:1941 misc:844 imb:166 pmb:63 smb:1121 d:- ref:0 ; in:479 out:479 type:P dur:82000000 cpbdur:82000000 q:18.34 tex:2139 mv:1696 misc:1013 imb:174 pmb:114 smb:1062 d:- ref:0 ; in:480 out:480 type:P dur:82000000 cpbdur:82000000 q:16.38 tex:5278 mv:2612 misc:1270 imb:287 pmb:188 smb:875 d:- ref:0 ; in:481 out:481 type:P dur:82000000 cpbdur:82000000 q:15.21 tex:2728 mv:1688 misc:1016 imb:174 pmb:60 smb:1116 d:- ref:0 ; in:482 out:482 type:P dur:82000000 cpbdur:82000000 q:14.45 tex:6041 mv:2717 misc:1186 imb:266 pmb:123 smb:961 d:- ref:0 ; in:483 out:483 type:P dur:82000000 cpbdur:82000000 q:13.23 tex:14734 mv:3677 misc:1341 imb:319 pmb:283 smb:748 d:- ref:0 ; in:484 out:484 type:P dur:82000000 cpbdur:82000000 q:12.32 tex:15624 mv:3921 misc:1487 imb:307 pmb:391 smb:652 d:- ref:0 ; in:485 out:485 type:P dur:82000000 cpbdur:82000000 q:12.31 tex:16759 mv:5613 misc:1420 imb:579 pmb:409 smb:362 d:- ref:0 ; in:486 out:486 type:P dur:82000000 cpbdur:82000000 q:13.26 tex:20085 mv:5604 misc:1327 imb:501 pmb:368 smb:481 d:- ref:0 ; in:487 out:487 type:P dur:82000000 cpbdur:82000000 q:12.69 tex:21163 mv:5891 misc:1402 imb:497 pmb:559 smb:294 d:- ref:0 ; in:488 out:488 type:P dur:82000000 cpbdur:82000000 q:11.82 tex:20767 mv:5365 misc:1508 imb:440 pmb:583 smb:327 d:- ref:0 ; in:489 out:489 type:P dur:82000000 cpbdur:82000000 q:11.54 tex:7955 mv:3055 misc:1294 imb:286 pmb:205 smb:859 d:- ref:0 ; in:490 out:490 type:P dur:82000000 cpbdur:82000000 q:13.06 tex:11207 mv:5309 misc:1388 imb:659 pmb:113 smb:578 d:- ref:0 ; in:491 out:491 type:P dur:82000000 cpbdur:82000000 q:14.80 tex:9322 mv:1439 misc:687 imb:117 pmb:59 smb:1174 d:- ref:0 ; in:492 out:492 type:P dur:82000000 cpbdur:82000000 q:16.79 tex:15911 mv:2720 misc:953 imb:194 pmb:158 smb:998 d:- ref:0 ; in:493 out:493 type:P dur:82000000 cpbdur:82000000 q:18.69 tex:25124 mv:3012 misc:640 imb:128 pmb:152 smb:1070 d:- ref:0 ; in:494 out:494 type:P dur:82000000 cpbdur:82000000 q:18.71 tex:22292 mv:3000 misc:668 imb:69 pmb:244 smb:1037 d:- ref:0 ; in:495 out:495 type:P dur:82000000 cpbdur:82000000 q:20.45 tex:41264 mv:4950 misc:738 imb:226 pmb:196 smb:928 d:- ref:0 ; in:496 out:496 type:P dur:82000000 cpbdur:82000000 q:21.21 tex:43200 mv:4994 misc:790 imb:196 pmb:258 smb:896 d:- ref:0 ; in:497 out:497 type:P dur:82000000 cpbdur:82000000 q:20.99 tex:36849 mv:4098 misc:805 imb:155 pmb:322 smb:873 d:- ref:0 ; in:498 out:498 type:P dur:82000000 cpbdur:82000000 q:21.41 tex:48129 mv:5077 misc:954 imb:200 pmb:333 smb:817 d:- ref:0 ; in:499 out:499 type:P dur:82000000 cpbdur:82000000 q:20.65 tex:26304 mv:3001 misc:935 imb:118 pmb:359 smb:873 d:- ref:0 ; in:500 out:500 type:I dur:82000000 cpbdur:82000000 q:15.28 tex:145902 mv:9760 misc:378 imb:1350 pmb:0 smb:0 d:- ref:; in:501 out:501 type:P dur:82000000 cpbdur:82000000 q:22.97 tex:28146 mv:3005 misc:809 imb:49 pmb:329 smb:972 d:- ref:0 ; in:502 out:502 type:P dur:82000000 cpbdur:82000000 q:21.84 tex:27052 mv:3378 misc:954 imb:146 pmb:370 smb:834 d:- ref:0 ; in:503 out:503 type:P dur:82000000 cpbdur:82000000 q:21.58 tex:37366 mv:3230 misc:844 imb:69 pmb:352 smb:929 d:- ref:0 ; in:504 out:504 type:P dur:82000000 cpbdur:82000000 q:20.94 tex:34522 mv:3362 misc:964 imb:106 pmb:392 smb:852 d:- ref:0 ; in:505 out:505 type:P dur:82000000 cpbdur:82000000 q:20.88 tex:38616 mv:3246 misc:914 imb:79 pmb:408 smb:863 d:- ref:0 ; in:506 out:506 type:P dur:82000000 cpbdur:82000000 q:20.87 tex:38972 mv:3651 misc:1017 imb:139 pmb:393 smb:818 d:- ref:0 ; in:507 out:507 type:P dur:82000000 cpbdur:82000000 q:20.26 tex:34057 mv:2706 misc:957 imb:66 pmb:414 smb:870 d:- ref:0 ; in:508 out:508 type:P dur:82000000 cpbdur:82000000 q:20.37 tex:40151 mv:3092 misc:1021 imb:119 pmb:400 smb:831 d:- ref:0 ; in:509 out:509 type:P dur:82000000 cpbdur:82000000 q:19.67 tex:22764 mv:2309 misc:943 imb:70 pmb:381 smb:899 d:- ref:0 ; in:510 out:510 type:P dur:82000000 cpbdur:82000000 q:19.67 tex:30854 mv:2692 misc:974 imb:94 pmb:392 smb:864 d:- ref:0 ; in:511 out:511 type:P dur:82000000 cpbdur:82000000 q:18.49 tex:33006 mv:2375 misc:1067 imb:63 pmb:437 smb:850 d:- ref:0 ; in:512 out:512 type:P dur:82000000 cpbdur:82000000 q:18.15 tex:23957 mv:1601 misc:930 imb:20 pmb:325 smb:1005 d:- ref:0 ; in:513 out:513 type:P dur:82000000 cpbdur:82000000 q:18.41 tex:31185 mv:1826 misc:933 imb:23 pmb:362 smb:965 d:- ref:0 ; in:514 out:514 type:P dur:82000000 cpbdur:82000000 q:18.35 tex:26650 mv:2175 misc:1071 imb:54 pmb:413 smb:883 d:- ref:0 ; in:515 out:515 type:P dur:82000000 cpbdur:82000000 q:18.77 tex:26891 mv:2510 misc:999 imb:70 pmb:368 smb:912 d:- ref:0 ; in:516 out:516 type:P dur:82000000 cpbdur:82000000 q:19.84 tex:31303 mv:2919 misc:954 imb:68 pmb:349 smb:933 d:- ref:0 ; in:517 out:517 type:P dur:82000000 cpbdur:82000000 q:19.30 tex:28091 mv:3335 misc:1062 imb:94 pmb:431 smb:825 d:- ref:0 ; in:518 out:518 type:P dur:82000000 cpbdur:82000000 q:19.59 tex:25506 mv:3631 misc:1111 imb:154 pmb:377 smb:819 d:- ref:0 ; in:519 out:519 type:P dur:82000000 cpbdur:82000000 q:19.10 tex:27472 mv:3678 misc:1138 imb:136 pmb:464 smb:750 d:- ref:0 ; in:520 out:520 type:P dur:82000000 cpbdur:82000000 q:19.47 tex:32976 mv:3553 misc:1087 imb:100 pmb:445 smb:805 d:- ref:0 ; in:521 out:521 type:P dur:82000000 cpbdur:82000000 q:19.04 tex:24798 mv:2302 misc:932 imb:44 pmb:310 smb:996 d:- ref:0 ; in:522 out:522 type:P dur:82000000 cpbdur:82000000 q:19.39 tex:32049 mv:3497 misc:1070 imb:91 pmb:437 smb:822 d:- ref:0 ; in:523 out:523 type:P dur:82000000 cpbdur:82000000 q:20.58 tex:36604 mv:3645 misc:983 imb:94 pmb:377 smb:879 d:- ref:0 ; in:524 out:524 type:P dur:82000000 cpbdur:82000000 q:20.57 tex:29119 mv:3510 misc:1019 imb:118 pmb:384 smb:848 d:- ref:0 ; in:525 out:525 type:P dur:82000000 cpbdur:82000000 q:21.34 tex:43637 mv:4240 misc:995 imb:136 pmb:390 smb:824 d:- ref:0 ; in:526 out:526 type:P dur:82000000 cpbdur:82000000 q:21.77 tex:39117 mv:5262 misc:1101 imb:183 pmb:402 smb:765 d:- ref:0 ; in:527 out:527 type:P dur:82000000 cpbdur:82000000 q:21.23 tex:33972 mv:4002 misc:1178 imb:143 pmb:432 smb:775 d:- ref:0 ; in:528 out:528 type:P dur:82000000 cpbdur:82000000 q:22.26 tex:48121 mv:5428 misc:1115 imb:160 pmb:402 smb:788 d:- ref:0 ; in:529 out:529 type:P dur:82000000 cpbdur:82000000 q:22.00 tex:35871 mv:5064 misc:1161 imb:143 pmb:424 smb:783 d:- ref:0 ; in:530 out:530 type:P dur:82000000 cpbdur:82000000 q:22.13 tex:41091 mv:5563 misc:1218 imb:170 pmb:451 smb:729 d:- ref:0 ; in:531 out:531 type:P dur:82000000 cpbdur:82000000 q:22.34 tex:45145 mv:5767 misc:1200 imb:147 pmb:451 smb:752 d:- ref:0 ; in:532 out:532 type:P dur:82000000 cpbdur:82000000 q:21.83 tex:30507 mv:4696 misc:1221 imb:144 pmb:442 smb:764 d:- ref:0 ; in:533 out:533 type:P dur:82000000 cpbdur:82000000 q:22.25 tex:46134 mv:7245 misc:1373 imb:218 pmb:511 smb:621 d:- ref:0 ; in:534 out:534 type:P dur:82000000 cpbdur:82000000 q:22.04 tex:36350 mv:6096 misc:1378 imb:206 pmb:528 smb:616 d:- ref:0 ; in:535 out:535 type:P dur:82000000 cpbdur:82000000 q:22.25 tex:43448 mv:7549 misc:1427 imb:245 pmb:561 smb:544 d:- ref:0 ; in:536 out:536 type:P dur:82000000 cpbdur:82000000 q:22.32 tex:43244 mv:7846 misc:1470 imb:297 pmb:558 smb:495 d:- ref:0 ; in:537 out:537 type:P dur:82000000 cpbdur:82000000 q:21.89 tex:30545 mv:7324 misc:1467 imb:253 pmb:582 smb:515 d:- ref:0 ; in:538 out:538 type:P dur:82000000 cpbdur:82000000 q:22.34 tex:47720 mv:9641 misc:1471 imb:283 pmb:653 smb:414 d:- ref:0 ; in:539 out:539 type:P dur:82000000 cpbdur:82000000 q:21.70 tex:25475 mv:6894 misc:1463 imb:240 pmb:612 smb:498 d:- ref:0 ; in:540 out:540 type:P dur:82000000 cpbdur:82000000 q:20.95 tex:26272 mv:4933 misc:1395 imb:135 pmb:533 smb:682 d:- ref:0 ; in:541 out:541 type:P dur:82000000 cpbdur:82000000 q:20.35 tex:27050 mv:4044 misc:1322 imb:87 pmb:520 smb:743 d:- ref:0 ; in:542 out:542 type:P dur:82000000 cpbdur:82000000 q:19.72 tex:20515 mv:2870 misc:1119 imb:52 pmb:398 smb:900 d:- ref:0 ; in:543 out:543 type:P dur:82000000 cpbdur:82000000 q:19.94 tex:26887 mv:3548 misc:1221 imb:60 pmb:500 smb:790 d:- ref:0 ; in:544 out:544 type:P dur:82000000 cpbdur:82000000 q:19.83 tex:29650 mv:2660 misc:970 imb:23 pmb:428 smb:899 d:- ref:0 ; in:545 out:545 type:P dur:82000000 cpbdur:82000000 q:20.51 tex:30969 mv:4207 misc:1104 imb:68 pmb:447 smb:835 d:- ref:0 ; in:546 out:546 type:P dur:82000000 cpbdur:82000000 q:21.14 tex:39868 mv:4728 misc:1060 imb:59 pmb:490 smb:801 d:- ref:0 ; in:547 out:547 type:P dur:82000000 cpbdur:82000000 q:20.87 tex:27949 mv:3618 misc:1089 imb:47 pmb:472 smb:831 d:- ref:0 ; in:548 out:548 type:P dur:82000000 cpbdur:82000000 q:20.80 tex:31868 mv:4138 misc:1082 imb:91 pmb:418 smb:841 d:- ref:0 ; in:549 out:549 type:P dur:82000000 cpbdur:82000000 q:19.79 tex:18247 mv:2675 misc:1134 imb:42 pmb:385 smb:923 d:- ref:0 ; in:550 out:550 type:P dur:82000000 cpbdur:82000000 q:20.43 tex:32693 mv:4785 misc:1242 imb:123 pmb:467 smb:760 d:- ref:0 ; in:551 out:551 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:28048 mv:3472 misc:1104 imb:55 pmb:430 smb:865 d:- ref:0 ; in:552 out:552 type:P dur:82000000 cpbdur:82000000 q:20.27 tex:22116 mv:3719 misc:1125 imb:35 pmb:479 smb:836 d:- ref:0 ; in:553 out:553 type:P dur:82000000 cpbdur:82000000 q:19.73 tex:23289 mv:2918 misc:961 imb:28 pmb:398 smb:924 d:- ref:0 ; in:554 out:554 type:P dur:82000000 cpbdur:82000000 q:19.77 tex:21292 mv:3659 misc:1121 imb:35 pmb:497 smb:818 d:- ref:0 ; in:555 out:555 type:P dur:82000000 cpbdur:82000000 q:19.94 tex:26958 mv:3400 misc:1122 imb:32 pmb:442 smb:876 d:- ref:0 ; in:556 out:556 type:P dur:82000000 cpbdur:82000000 q:19.86 tex:25033 mv:3523 misc:1116 imb:36 pmb:441 smb:873 d:- ref:0 ; in:557 out:557 type:P dur:82000000 cpbdur:82000000 q:19.39 tex:32731 mv:4818 misc:1339 imb:54 pmb:672 smb:624 d:- ref:0 ; in:558 out:558 type:P dur:82000000 cpbdur:82000000 q:19.51 tex:20578 mv:2557 misc:1009 imb:20 pmb:393 smb:937 d:- ref:0 ; in:559 out:559 type:P dur:82000000 cpbdur:82000000 q:19.11 tex:31095 mv:3893 misc:1268 imb:40 pmb:567 smb:743 d:- ref:0 ; in:560 out:560 type:P dur:82000000 cpbdur:82000000 q:20.54 tex:32163 mv:4622 misc:1151 imb:69 pmb:492 smb:789 d:- ref:0 ; in:561 out:561 type:P dur:82000000 cpbdur:82000000 q:20.27 tex:26084 mv:3879 misc:1181 imb:56 pmb:485 smb:809 d:- ref:0 ; in:562 out:562 type:P dur:82000000 cpbdur:82000000 q:19.96 tex:20002 mv:3465 misc:1221 imb:63 pmb:447 smb:840 d:- ref:0 ; in:563 out:563 type:P dur:82000000 cpbdur:82000000 q:19.56 tex:20013 mv:2471 misc:988 imb:23 pmb:339 smb:988 d:- ref:0 ; in:564 out:564 type:P dur:82000000 cpbdur:82000000 q:19.08 tex:28578 mv:4051 misc:1339 imb:52 pmb:621 smb:677 d:- ref:0 ; in:565 out:565 type:P dur:82000000 cpbdur:82000000 q:19.28 tex:26012 mv:3985 misc:1283 imb:38 pmb:533 smb:779 d:- ref:0 ; in:566 out:566 type:P dur:82000000 cpbdur:82000000 q:19.82 tex:21353 mv:5394 misc:1397 imb:84 pmb:584 smb:682 d:- ref:0 ; in:567 out:567 type:P dur:82000000 cpbdur:82000000 q:18.37 tex:28347 mv:4192 misc:1469 imb:63 pmb:636 smb:651 d:- ref:0 ; in:568 out:568 type:P dur:82000000 cpbdur:82000000 q:18.71 tex:19998 mv:2811 misc:1143 imb:30 pmb:385 smb:935 d:- ref:0 ; in:569 out:569 type:P dur:82000000 cpbdur:82000000 q:18.30 tex:18388 mv:2965 misc:1295 imb:22 pmb:459 smb:869 d:- ref:0 ; in:570 out:570 type:P dur:82000000 cpbdur:82000000 q:19.55 tex:24206 mv:3298 misc:1096 imb:32 pmb:388 smb:930 d:- ref:0 ; in:571 out:571 type:P dur:82000000 cpbdur:82000000 q:19.46 tex:28546 mv:4230 misc:1392 imb:48 pmb:576 smb:726 d:- ref:0 ; in:572 out:572 type:P dur:82000000 cpbdur:82000000 q:19.34 tex:21082 mv:4018 misc:1324 imb:32 pmb:534 smb:784 d:- ref:0 ; in:573 out:573 type:P dur:82000000 cpbdur:82000000 q:19.53 tex:17256 mv:2840 misc:1176 imb:38 pmb:398 smb:914 d:- ref:0 ; in:574 out:574 type:P dur:82000000 cpbdur:82000000 q:19.27 tex:25372 mv:5108 misc:1416 imb:68 pmb:632 smb:650 d:- ref:0 ; in:575 out:575 type:P dur:82000000 cpbdur:82000000 q:20.61 tex:31164 mv:7235 misc:1377 imb:138 pmb:583 smb:629 d:- ref:0 ; in:576 out:576 type:P dur:82000000 cpbdur:82000000 q:20.34 tex:27670 mv:4486 misc:1308 imb:67 pmb:528 smb:755 d:- ref:0 ; in:577 out:577 type:P dur:82000000 cpbdur:82000000 q:19.52 tex:16152 mv:2590 misc:1202 imb:78 pmb:404 smb:868 d:- ref:0 ; in:578 out:578 type:P dur:82000000 cpbdur:82000000 q:19.83 tex:26270 mv:4693 misc:1333 imb:127 pmb:505 smb:718 d:- ref:0 ; in:579 out:579 type:P dur:82000000 cpbdur:82000000 q:19.16 tex:29957 mv:4933 misc:1454 imb:68 pmb:687 smb:595 d:- ref:0 ; in:580 out:580 type:P dur:82000000 cpbdur:82000000 q:19.50 tex:19478 mv:3626 misc:1240 imb:55 pmb:416 smb:879 d:- ref:0 ; in:581 out:581 type:P dur:82000000 cpbdur:82000000 q:19.66 tex:23589 mv:3454 misc:1117 imb:45 pmb:436 smb:869 d:- ref:0 ; in:582 out:582 type:P dur:82000000 cpbdur:82000000 q:19.80 tex:22747 mv:3336 misc:1237 imb:67 pmb:462 smb:821 d:- ref:0 ; in:583 out:583 type:P dur:82000000 cpbdur:82000000 q:20.44 tex:32751 mv:3794 misc:1167 imb:53 pmb:478 smb:819 d:- ref:0 ; in:584 out:584 type:P dur:82000000 cpbdur:82000000 q:20.66 tex:31025 mv:3751 misc:1080 imb:36 pmb:475 smb:839 d:- ref:0 ; in:585 out:585 type:P dur:82000000 cpbdur:82000000 q:21.58 tex:40443 mv:4745 misc:1100 imb:76 pmb:461 smb:813 d:- ref:0 ; in:586 out:586 type:P dur:82000000 cpbdur:82000000 q:22.32 tex:51579 mv:6095 misc:1214 imb:120 pmb:513 smb:717 d:- ref:0 ; in:587 out:587 type:P dur:82000000 cpbdur:82000000 q:22.08 tex:38014 mv:5795 misc:1191 imb:113 pmb:527 smb:710 d:- ref:0 ; in:588 out:588 type:P dur:82000000 cpbdur:82000000 q:22.47 tex:53882 mv:7531 misc:1307 imb:196 pmb:539 smb:615 d:- ref:0 ; in:589 out:589 type:P dur:82000000 cpbdur:82000000 q:21.85 tex:27601 mv:4749 misc:1290 imb:140 pmb:477 smb:733 d:- ref:0 ; in:590 out:590 type:P dur:82000000 cpbdur:82000000 q:21.45 tex:35983 mv:5597 misc:1372 imb:174 pmb:561 smb:615 d:- ref:0 ; in:591 out:591 type:P dur:82000000 cpbdur:82000000 q:21.39 tex:36635 mv:5835 misc:1298 imb:159 pmb:527 smb:664 d:- ref:0 ; in:592 out:592 type:P dur:82000000 cpbdur:82000000 q:20.86 tex:23547 mv:4554 misc:1243 imb:118 pmb:482 smb:750 d:- ref:0 ; in:593 out:593 type:P dur:82000000 cpbdur:82000000 q:21.39 tex:43032 mv:6197 misc:1291 imb:145 pmb:529 smb:676 d:- ref:0 ; in:594 out:594 type:P dur:82000000 cpbdur:82000000 q:21.33 tex:42612 mv:5465 misc:1307 imb:132 pmb:537 smb:681 d:- ref:0 ; in:595 out:595 type:P dur:82000000 cpbdur:82000000 q:21.55 tex:35433 mv:5350 misc:1153 imb:147 pmb:452 smb:751 d:- ref:0 ; in:596 out:596 type:P dur:82000000 cpbdur:82000000 q:25.55 tex:341363 mv:17813 misc:1416 imb:1145 pmb:205 smb:0 d:- ref:0 ; in:597 out:597 type:P dur:82000000 cpbdur:82000000 q:27.10 tex:97117 mv:5071 misc:1324 imb:43 pmb:823 smb:484 d:- ref:0 ; in:598 out:598 type:P dur:82000000 cpbdur:82000000 q:25.71 tex:77495 mv:4569 misc:1368 imb:47 pmb:769 smb:534 d:- ref:0 ; in:599 out:599 type:P dur:82000000 cpbdur:82000000 q:24.73 tex:98703 mv:4716 misc:1389 imb:49 pmb:912 smb:389 d:- ref:0 ; in:600 out:600 type:P dur:82000000 cpbdur:82000000 q:24.87 tex:130525 mv:5895 misc:1388 imb:98 pmb:879 smb:373 d:- ref:0 ; in:601 out:601 type:P dur:82000000 cpbdur:82000000 q:24.39 tex:111829 mv:4853 misc:1382 imb:57 pmb:895 smb:398 d:- ref:0 ; in:602 out:602 type:P dur:82000000 cpbdur:82000000 q:24.19 tex:95018 mv:4993 misc:1421 imb:56 pmb:857 smb:437 d:- ref:0 ; in:603 out:603 type:P dur:82000000 cpbdur:82000000 q:23.05 tex:79877 mv:4268 misc:1455 imb:60 pmb:930 smb:360 d:- ref:0 ; in:604 out:604 type:P dur:82000000 cpbdur:82000000 q:25.01 tex:145118 mv:5985 misc:1345 imb:105 pmb:825 smb:420 d:- ref:0 ; in:605 out:605 type:P dur:82000000 cpbdur:82000000 q:24.18 tex:84584 mv:3422 misc:1354 imb:14 pmb:860 smb:476 d:- ref:0 ; in:606 out:606 type:P dur:82000000 cpbdur:82000000 q:23.55 tex:68025 mv:4232 misc:1439 imb:28 pmb:822 smb:500 d:- ref:0 ; in:607 out:607 type:P dur:82000000 cpbdur:82000000 q:23.16 tex:105624 mv:4231 misc:1441 imb:68 pmb:943 smb:339 d:- ref:0 ; in:608 out:608 type:P dur:82000000 cpbdur:82000000 q:23.81 tex:105020 mv:4160 misc:1340 imb:19 pmb:810 smb:521 d:- ref:0 ; in:609 out:609 type:P dur:82000000 cpbdur:82000000 q:24.13 tex:112290 mv:4557 misc:1409 imb:47 pmb:863 smb:440 d:- ref:0 ; in:610 out:610 type:P dur:82000000 cpbdur:82000000 q:24.93 tex:138050 mv:6044 misc:1354 imb:96 pmb:834 smb:420 d:- ref:0 ; in:611 out:611 type:P dur:82000000 cpbdur:82000000 q:24.77 tex:117088 mv:5218 misc:1398 imb:68 pmb:892 smb:390 d:- ref:0 ; in:612 out:612 type:P dur:82000000 cpbdur:82000000 q:24.76 tex:101562 mv:4614 misc:1384 imb:49 pmb:844 smb:457 d:- ref:0 ; in:613 out:613 type:P dur:82000000 cpbdur:82000000 q:24.49 tex:114749 mv:5105 misc:1434 imb:103 pmb:837 smb:410 d:- ref:0 ; in:614 out:614 type:P dur:82000000 cpbdur:82000000 q:24.64 tex:103512 mv:4946 misc:1366 imb:35 pmb:878 smb:437 d:- ref:0 ; in:615 out:615 type:P dur:82000000 cpbdur:82000000 q:24.20 tex:83908 mv:4337 misc:1371 imb:39 pmb:867 smb:444 d:- ref:0 ; in:616 out:616 type:P dur:82000000 cpbdur:82000000 q:24.87 tex:139586 mv:6445 misc:1337 imb:95 pmb:851 smb:404 d:- ref:0 ; in:617 out:617 type:P dur:82000000 cpbdur:82000000 q:23.98 tex:76627 mv:4001 misc:1356 imb:12 pmb:855 smb:483 d:- ref:0 ; in:618 out:618 type:P dur:82000000 cpbdur:82000000 q:24.32 tex:119148 mv:5424 misc:1388 imb:38 pmb:874 smb:438 d:- ref:0 ; in:619 out:619 type:P dur:82000000 cpbdur:82000000 q:23.43 tex:83514 mv:4143 misc:1439 imb:42 pmb:921 smb:387 d:- ref:0 ; in:620 out:620 type:P dur:82000000 cpbdur:82000000 q:24.54 tex:132545 mv:6282 misc:1333 imb:86 pmb:838 smb:426 d:- ref:0 ; in:621 out:621 type:P dur:82000000 cpbdur:82000000 q:24.03 tex:83892 mv:4149 misc:1383 imb:20 pmb:837 smb:493 d:- ref:0 ; in:622 out:622 type:P dur:82000000 cpbdur:82000000 q:24.66 tex:126738 mv:5862 misc:1336 imb:67 pmb:852 smb:431 d:- ref:0 ; in:623 out:623 type:P dur:82000000 cpbdur:82000000 q:24.40 tex:101822 mv:5014 misc:1364 imb:65 pmb:822 smb:463 d:- ref:0 ; in:624 out:624 type:P dur:82000000 cpbdur:82000000 q:23.88 tex:72704 mv:3969 misc:1375 imb:27 pmb:713 smb:610 d:- ref:0 ; in:625 out:625 type:P dur:82000000 cpbdur:82000000 q:22.81 tex:79361 mv:3387 misc:1404 imb:36 pmb:879 smb:435 d:- ref:0 ; in:626 out:626 type:P dur:82000000 cpbdur:82000000 q:24.07 tex:119525 mv:5654 misc:1357 imb:82 pmb:802 smb:466 d:- ref:0 ; in:627 out:627 type:P dur:82000000 cpbdur:82000000 q:24.11 tex:110303 mv:4708 misc:1317 imb:69 pmb:804 smb:477 d:- ref:0 ; in:628 out:628 type:P dur:82000000 cpbdur:82000000 q:23.69 tex:65564 mv:3761 misc:1387 imb:28 pmb:695 smb:627 d:- ref:0 ; in:629 out:629 type:P dur:82000000 cpbdur:82000000 q:23.30 tex:103756 mv:3462 misc:1398 imb:32 pmb:908 smb:410 d:- ref:0 ; in:630 out:630 type:P dur:82000000 cpbdur:82000000 q:23.68 tex:97501 mv:4320 misc:1315 imb:31 pmb:802 smb:517 d:- ref:0 ; in:631 out:631 type:P dur:82000000 cpbdur:82000000 q:23.31 tex:92519 mv:4005 misc:1380 imb:23 pmb:893 smb:434 d:- ref:0 ; in:632 out:632 type:P dur:82000000 cpbdur:82000000 q:24.22 tex:123954 mv:5503 misc:1351 imb:89 pmb:829 smb:432 d:- ref:0 ; in:633 out:633 type:P dur:82000000 cpbdur:82000000 q:23.62 tex:74580 mv:3149 misc:1303 imb:4 pmb:797 smb:549 d:- ref:0 ; in:634 out:634 type:P dur:82000000 cpbdur:82000000 q:24.01 tex:114182 mv:5292 misc:1366 imb:53 pmb:848 smb:449 d:- ref:0 ; in:635 out:635 type:P dur:82000000 cpbdur:82000000 q:23.98 tex:92803 mv:4574 misc:1319 imb:68 pmb:754 smb:528 d:- ref:0 ; in:636 out:636 type:P dur:82000000 cpbdur:82000000 q:23.77 tex:90622 mv:4341 misc:1349 imb:28 pmb:845 smb:477 d:- ref:0 ; in:637 out:637 type:P dur:82000000 cpbdur:82000000 q:23.32 tex:100012 mv:3737 misc:1419 imb:48 pmb:907 smb:395 d:- ref:0 ; in:638 out:638 type:P dur:82000000 cpbdur:82000000 q:23.91 tex:109083 mv:4809 misc:1356 imb:31 pmb:823 smb:496 d:- ref:0 ; in:639 out:639 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:68662 mv:3446 misc:1356 imb:7 pmb:764 smb:579 d:- ref:0 ; in:640 out:640 type:P dur:82000000 cpbdur:82000000 q:24.07 tex:106439 mv:5239 misc:1362 imb:74 pmb:813 smb:463 d:- ref:0 ; in:641 out:641 type:P dur:82000000 cpbdur:82000000 q:23.63 tex:80067 mv:3168 misc:1341 imb:8 pmb:808 smb:534 d:- ref:0 ; in:642 out:642 type:P dur:82000000 cpbdur:82000000 q:24.34 tex:115471 mv:5127 misc:1330 imb:49 pmb:851 smb:450 d:- ref:0 ; in:643 out:643 type:P dur:82000000 cpbdur:82000000 q:23.89 tex:71989 mv:3548 misc:1335 imb:17 pmb:780 smb:553 d:- ref:0 ; in:644 out:644 type:P dur:82000000 cpbdur:82000000 q:24.60 tex:120034 mv:5339 misc:1323 imb:89 pmb:819 smb:442 d:- ref:0 ; in:645 out:645 type:P dur:82000000 cpbdur:82000000 q:24.24 tex:102094 mv:4639 misc:1347 imb:96 pmb:761 smb:493 d:- ref:0 ; in:646 out:646 type:P dur:82000000 cpbdur:82000000 q:24.01 tex:77655 mv:4013 misc:1348 imb:30 pmb:757 smb:563 d:- ref:0 ; in:647 out:647 type:P dur:82000000 cpbdur:82000000 q:24.27 tex:116123 mv:5180 misc:1353 imb:83 pmb:810 smb:457 d:- ref:0 ; in:648 out:648 type:P dur:82000000 cpbdur:82000000 q:24.70 tex:125554 mv:5685 misc:1305 imb:58 pmb:855 smb:437 d:- ref:0 ; in:649 out:649 type:P dur:82000000 cpbdur:82000000 q:24.43 tex:111408 mv:4949 misc:1315 imb:57 pmb:859 smb:434 d:- ref:0 ; in:650 out:650 type:P dur:82000000 cpbdur:82000000 q:28.43 tex:460244 mv:16655 misc:1421 imb:1120 pmb:229 smb:1 d:- ref:0 ; in:651 out:651 type:P dur:82000000 cpbdur:82000000 q:27.81 tex:8925 mv:949 misc:1054 imb:1 pmb:253 smb:1096 d:- ref:0 ; in:652 out:652 type:P dur:82000000 cpbdur:82000000 q:28.49 tex:238380 mv:14663 misc:1469 imb:160 pmb:1035 smb:155 d:- ref:0 ; in:653 out:653 type:P dur:82000000 cpbdur:82000000 q:27.05 tex:111042 mv:5515 misc:1531 imb:24 pmb:1039 smb:287 d:- ref:0 ; in:654 out:654 type:P dur:82000000 cpbdur:82000000 q:27.74 tex:200008 mv:12396 misc:1484 imb:107 pmb:1064 smb:179 d:- ref:0 ; in:655 out:655 type:P dur:82000000 cpbdur:82000000 q:25.56 tex:81087 mv:3463 misc:1554 imb:18 pmb:997 smb:335 d:- ref:0 ; in:656 out:656 type:P dur:82000000 cpbdur:82000000 q:27.88 tex:240473 mv:14166 misc:1473 imb:184 pmb:1006 smb:160 d:- ref:0 ; in:657 out:657 type:P dur:82000000 cpbdur:82000000 q:26.29 tex:122693 mv:4611 misc:1544 imb:21 pmb:1043 smb:286 d:- ref:0 ; in:658 out:658 type:P dur:82000000 cpbdur:82000000 q:28.04 tex:239508 mv:13971 misc:1473 imb:186 pmb:1003 smb:161 d:- ref:0 ; in:659 out:659 type:P dur:82000000 cpbdur:82000000 q:25.98 tex:94368 mv:3531 misc:1557 imb:22 pmb:971 smb:357 d:- ref:0 ; in:660 out:660 type:P dur:82000000 cpbdur:82000000 q:27.37 tex:228469 mv:12583 misc:1492 imb:126 pmb:1047 smb:177 d:- ref:0 ; in:661 out:661 type:P dur:82000000 cpbdur:82000000 q:25.52 tex:67185 mv:3898 misc:1573 imb:22 pmb:892 smb:436 d:- ref:0 ; in:662 out:662 type:P dur:82000000 cpbdur:82000000 q:27.66 tex:233919 mv:13134 misc:1507 imb:154 pmb:1008 smb:188 d:- ref:0 ; in:663 out:663 type:P dur:82000000 cpbdur:82000000 q:25.56 tex:86873 mv:3717 misc:1562 imb:25 pmb:985 smb:340 d:- ref:0 ; in:664 out:664 type:P dur:82000000 cpbdur:82000000 q:27.87 tex:247000 mv:14521 misc:1479 imb:194 pmb:1005 smb:151 d:- ref:0 ; in:665 out:665 type:P dur:82000000 cpbdur:82000000 q:25.94 tex:101148 mv:3774 misc:1558 imb:12 pmb:990 smb:348 d:- ref:0 ; in:666 out:666 type:P dur:82000000 cpbdur:82000000 q:27.49 tex:239255 mv:12309 misc:1484 imb:131 pmb:1043 smb:176 d:- ref:0 ; in:667 out:667 type:P dur:82000000 cpbdur:82000000 q:25.95 tex:95250 mv:4711 misc:1551 imb:20 pmb:989 smb:341 d:- ref:0 ; in:668 out:668 type:P dur:82000000 cpbdur:82000000 q:27.93 tex:239106 mv:13965 misc:1473 imb:158 pmb:1055 smb:137 d:- ref:0 ; in:669 out:669 type:P dur:82000000 cpbdur:82000000 q:25.68 tex:81765 mv:3149 misc:1574 imb:14 pmb:967 smb:369 d:- ref:0 ; in:670 out:670 type:P dur:82000000 cpbdur:82000000 q:28.06 tex:258505 mv:14918 misc:1481 imb:184 pmb:1008 smb:158 d:- ref:0 ; in:671 out:671 type:P dur:82000000 cpbdur:82000000 q:26.03 tex:98438 mv:3616 misc:1554 imb:3 pmb:984 smb:363 d:- ref:0 ; in:672 out:672 type:P dur:82000000 cpbdur:82000000 q:27.63 tex:215407 mv:13592 misc:1457 imb:669 pmb:594 smb:87 d:- ref:0 ; in:673 out:673 type:P dur:82000000 cpbdur:82000000 q:25.46 tex:106707 mv:3721 misc:1452 imb:40 pmb:959 smb:351 d:- ref:0 ; in:674 out:674 type:P dur:82000000 cpbdur:82000000 q:27.21 tex:202753 mv:12867 misc:1444 imb:206 pmb:845 smb:299 d:- ref:0 ; in:675 out:675 type:P dur:82000000 cpbdur:82000000 q:24.99 tex:81331 mv:3104 misc:1477 imb:31 pmb:854 smb:465 d:- ref:0 ; in:676 out:676 type:P dur:82000000 cpbdur:82000000 q:27.30 tex:213028 mv:14021 misc:1447 imb:247 pmb:833 smb:270 d:- ref:0 ; in:677 out:677 type:P dur:82000000 cpbdur:82000000 q:25.22 tex:87899 mv:3504 misc:1509 imb:47 pmb:880 smb:423 d:- ref:0 ; in:678 out:678 type:P dur:82000000 cpbdur:82000000 q:27.05 tex:199561 mv:13554 misc:1461 imb:214 pmb:886 smb:250 d:- ref:0 ; in:679 out:679 type:P dur:82000000 cpbdur:82000000 q:24.81 tex:81993 mv:3085 misc:1498 imb:32 pmb:879 smb:439 d:- ref:0 ; in:680 out:680 type:P dur:82000000 cpbdur:82000000 q:27.27 tex:222983 mv:14301 misc:1452 imb:264 pmb:843 smb:243 d:- ref:0 ; in:681 out:681 type:P dur:82000000 cpbdur:82000000 q:25.07 tex:83155 mv:3525 misc:1520 imb:39 pmb:889 smb:422 d:- ref:0 ; in:682 out:682 type:P dur:82000000 cpbdur:82000000 q:27.74 tex:223779 mv:15099 misc:1474 imb:350 pmb:811 smb:189 d:- ref:0 ; in:683 out:683 type:P dur:82000000 cpbdur:82000000 q:25.58 tex:67051 mv:2912 misc:1525 imb:23 pmb:800 smb:527 d:- ref:0 ; in:684 out:684 type:P dur:82000000 cpbdur:82000000 q:27.43 tex:229295 mv:14223 misc:1490 imb:320 pmb:867 smb:163 d:- ref:0 ; in:685 out:685 type:P dur:82000000 cpbdur:82000000 q:25.39 tex:104260 mv:3871 misc:1541 imb:36 pmb:969 smb:345 d:- ref:0 ; in:686 out:686 type:P dur:82000000 cpbdur:82000000 q:27.37 tex:224415 mv:14517 misc:1468 imb:208 pmb:943 smb:199 d:- ref:0 ; in:687 out:687 type:P dur:82000000 cpbdur:82000000 q:25.13 tex:94242 mv:3444 misc:1514 imb:28 pmb:974 smb:348 d:- ref:0 ; in:688 out:688 type:P dur:82000000 cpbdur:82000000 q:27.23 tex:217766 mv:14050 misc:1456 imb:168 pmb:974 smb:208 d:- ref:0 ; in:689 out:689 type:P dur:82000000 cpbdur:82000000 q:25.34 tex:114803 mv:4069 misc:1512 imb:27 pmb:987 smb:336 d:- ref:0 ; in:690 out:690 type:P dur:82000000 cpbdur:82000000 q:26.70 tex:180140 mv:11982 misc:1454 imb:109 pmb:1020 smb:221 d:- ref:0 ; in:691 out:691 type:P dur:82000000 cpbdur:82000000 q:24.98 tex:111613 mv:4404 misc:1495 imb:30 pmb:1004 smb:316 d:- ref:0 ; in:692 out:692 type:P dur:82000000 cpbdur:82000000 q:27.08 tex:210882 mv:13383 misc:1447 imb:139 pmb:1007 smb:204 d:- ref:0 ; in:693 out:693 type:P dur:82000000 cpbdur:82000000 q:25.05 tex:102877 mv:3585 misc:1506 imb:32 pmb:985 smb:333 d:- ref:0 ; in:694 out:694 type:P dur:82000000 cpbdur:82000000 q:26.68 tex:170829 mv:9207 misc:1156 imb:99 pmb:655 smb:596 d:- ref:0 ; in:695 out:695 type:P dur:82000000 cpbdur:82000000 q:24.67 tex:82451 mv:3041 misc:1468 imb:10 pmb:865 smb:475 d:- ref:0 ; in:696 out:696 type:P dur:82000000 cpbdur:82000000 q:26.44 tex:197913 mv:9869 misc:1442 imb:93 pmb:921 smb:336 d:- ref:0 ; in:697 out:697 type:P dur:82000000 cpbdur:82000000 q:26.23 tex:146688 mv:7360 misc:1480 imb:46 pmb:946 smb:358 d:- ref:0 ; in:698 out:698 type:P dur:82000000 cpbdur:82000000 q:27.15 tex:184669 mv:10125 misc:1422 imb:91 pmb:893 smb:366 d:- ref:0 ; in:699 out:699 type:P dur:82000000 cpbdur:82000000 q:28.95 tex:228630 mv:16521 misc:1417 imb:1183 pmb:167 smb:0 d:- ref:0 ; in:700 out:700 type:P dur:82000000 cpbdur:82000000 q:27.45 tex:93682 mv:5483 misc:1403 imb:48 pmb:835 smb:467 d:- ref:0 ; in:701 out:701 type:P dur:82000000 cpbdur:82000000 q:26.22 tex:89623 mv:4961 misc:1392 imb:79 pmb:725 smb:546 d:- ref:0 ; in:702 out:702 type:P dur:82000000 cpbdur:82000000 q:25.14 tex:94704 mv:5297 misc:1463 imb:100 pmb:929 smb:321 d:- ref:0 ; in:703 out:703 type:P dur:82000000 cpbdur:82000000 q:24.61 tex:105298 mv:5661 misc:1401 imb:92 pmb:839 smb:419 d:- ref:0 ; in:704 out:704 type:P dur:82000000 cpbdur:82000000 q:23.89 tex:88697 mv:4806 misc:1409 imb:46 pmb:834 smb:470 d:- ref:0 ; in:705 out:705 type:P dur:82000000 cpbdur:82000000 q:24.31 tex:112208 mv:6176 misc:1360 imb:69 pmb:830 smb:451 d:- ref:0 ; in:706 out:706 type:P dur:82000000 cpbdur:82000000 q:23.83 tex:78680 mv:4416 misc:1448 imb:85 pmb:776 smb:489 d:- ref:0 ; in:707 out:707 type:P dur:82000000 cpbdur:82000000 q:24.96 tex:125099 mv:6100 misc:1361 imb:99 pmb:760 smb:491 d:- ref:0 ; in:708 out:708 type:P dur:82000000 cpbdur:82000000 q:24.12 tex:69692 mv:4175 misc:1413 imb:25 pmb:773 smb:552 d:- ref:0 ; in:709 out:709 type:P dur:82000000 cpbdur:82000000 q:24.38 tex:118485 mv:5953 misc:1362 imb:84 pmb:811 smb:455 d:- ref:0 ; in:710 out:710 type:P dur:82000000 cpbdur:82000000 q:24.33 tex:104639 mv:5286 misc:1387 imb:93 pmb:784 smb:473 d:- ref:0 ; in:711 out:711 type:P dur:82000000 cpbdur:82000000 q:24.61 tex:110552 mv:6145 misc:1335 imb:93 pmb:767 smb:490 d:- ref:0 ; in:712 out:712 type:P dur:82000000 cpbdur:82000000 q:23.66 tex:61416 mv:3812 misc:1468 imb:32 pmb:754 smb:564 d:- ref:0 ; in:713 out:713 type:P dur:82000000 cpbdur:82000000 q:24.27 tex:124665 mv:6356 misc:1339 imb:78 pmb:812 smb:460 d:- ref:0 ; in:714 out:714 type:P dur:82000000 cpbdur:82000000 q:24.20 tex:97105 mv:5332 misc:1379 imb:93 pmb:750 smb:507 d:- ref:0 ; in:715 out:715 type:P dur:82000000 cpbdur:82000000 q:24.44 tex:116778 mv:6042 misc:1388 imb:84 pmb:800 smb:466 d:- ref:0 ; in:716 out:716 type:P dur:82000000 cpbdur:82000000 q:24.24 tex:97526 mv:5642 misc:1424 imb:63 pmb:816 smb:471 d:- ref:0 ; in:717 out:717 type:P dur:82000000 cpbdur:82000000 q:24.57 tex:110752 mv:6165 misc:1291 imb:86 pmb:777 smb:487 d:- ref:0 ; in:718 out:718 type:P dur:82000000 cpbdur:82000000 q:24.23 tex:100262 mv:5425 misc:1401 imb:97 pmb:795 smb:458 d:- ref:0 ; in:719 out:719 type:P dur:82000000 cpbdur:82000000 q:24.43 tex:121678 mv:6138 misc:1368 imb:82 pmb:830 smb:438 d:- ref:0 ; in:720 out:720 type:P dur:82000000 cpbdur:82000000 q:24.09 tex:90508 mv:5327 misc:1349 imb:63 pmb:779 smb:508 d:- ref:0 ; in:721 out:721 type:P dur:82000000 cpbdur:82000000 q:24.42 tex:114849 mv:6070 misc:1361 imb:93 pmb:810 smb:447 d:- ref:0 ; in:722 out:722 type:P dur:82000000 cpbdur:82000000 q:24.27 tex:99143 mv:5737 misc:1408 imb:92 pmb:795 smb:463 d:- ref:0 ; in:723 out:723 type:P dur:82000000 cpbdur:82000000 q:24.56 tex:107847 mv:6256 misc:1321 imb:94 pmb:766 smb:490 d:- ref:0 ; in:724 out:724 type:P dur:82000000 cpbdur:82000000 q:23.97 tex:70186 mv:4450 misc:1484 imb:34 pmb:804 smb:512 d:- ref:0 ; in:725 out:725 type:P dur:82000000 cpbdur:82000000 q:24.49 tex:125177 mv:6154 misc:1301 imb:101 pmb:772 smb:477 d:- ref:0 ; in:726 out:726 type:P dur:82000000 cpbdur:82000000 q:24.07 tex:77587 mv:4304 misc:1405 imb:66 pmb:718 smb:566 d:- ref:0 ; in:727 out:727 type:P dur:82000000 cpbdur:82000000 q:24.35 tex:116409 mv:5661 misc:1354 imb:90 pmb:793 smb:467 d:- ref:0 ; in:728 out:728 type:P dur:82000000 cpbdur:82000000 q:24.06 tex:82751 mv:4850 misc:1383 imb:43 pmb:734 smb:573 d:- ref:0 ; in:729 out:729 type:P dur:82000000 cpbdur:82000000 q:24.44 tex:119292 mv:6355 misc:1393 imb:97 pmb:823 smb:430 d:- ref:0 ; in:730 out:730 type:P dur:82000000 cpbdur:82000000 q:24.34 tex:101424 mv:5677 misc:1395 imb:100 pmb:753 smb:497 d:- ref:0 ; in:731 out:731 type:P dur:82000000 cpbdur:82000000 q:24.62 tex:110222 mv:6497 misc:1345 imb:96 pmb:761 smb:493 d:- ref:0 ; in:732 out:732 type:P dur:82000000 cpbdur:82000000 q:24.28 tex:98732 mv:5209 misc:1435 imb:77 pmb:803 smb:470 d:- ref:0 ; in:733 out:733 type:P dur:82000000 cpbdur:82000000 q:24.36 tex:113582 mv:6074 misc:1368 imb:55 pmb:842 smb:453 d:- ref:0 ; in:734 out:734 type:P dur:82000000 cpbdur:82000000 q:23.88 tex:79502 mv:4526 misc:1420 imb:69 pmb:790 smb:491 d:- ref:0 ; in:735 out:735 type:P dur:82000000 cpbdur:82000000 q:24.34 tex:118425 mv:6098 misc:1293 imb:101 pmb:726 smb:523 d:- ref:0 ; in:736 out:736 type:P dur:82000000 cpbdur:82000000 q:28.34 tex:522584 mv:18637 misc:1427 imb:922 pmb:419 smb:9 d:- ref:0 ; in:737 out:737 type:P dur:82000000 cpbdur:82000000 q:28.43 tex:29974 mv:2122 misc:1216 imb:8 pmb:424 smb:918 d:- ref:0 ; in:738 out:738 type:P dur:82000000 cpbdur:82000000 q:29.15 tex:258955 mv:13889 misc:1468 imb:114 pmb:1141 smb:95 d:- ref:0 ; in:739 out:739 type:P dur:82000000 cpbdur:82000000 q:27.38 tex:143779 mv:5034 misc:1515 imb:17 pmb:1204 smb:129 d:- ref:0 ; in:740 out:740 type:P dur:82000000 cpbdur:82000000 q:28.32 tex:258889 mv:12086 misc:1481 imb:73 pmb:1168 smb:109 d:- ref:0 ; in:741 out:741 type:P dur:82000000 cpbdur:82000000 q:26.71 tex:105246 mv:4465 misc:1577 imb:12 pmb:1051 smb:287 d:- ref:0 ; in:742 out:742 type:P dur:82000000 cpbdur:82000000 q:28.43 tex:287749 mv:13503 misc:1468 imb:93 pmb:1157 smb:100 d:- ref:0 ; in:743 out:743 type:P dur:82000000 cpbdur:82000000 q:26.48 tex:134281 mv:4385 misc:1534 imb:16 pmb:1157 smb:177 d:- ref:0 ; in:744 out:744 type:P dur:82000000 cpbdur:82000000 q:28.66 tex:267353 mv:14089 misc:1478 imb:126 pmb:1121 smb:103 d:- ref:0 ; in:745 out:745 type:P dur:82000000 cpbdur:82000000 q:27.94 tex:189208 mv:7706 misc:1494 imb:31 pmb:1200 smb:119 d:- ref:0 ; in:746 out:746 type:P dur:82000000 cpbdur:82000000 q:28.66 tex:232610 mv:12610 misc:1476 imb:92 pmb:1170 smb:88 d:- ref:0 ; in:747 out:747 type:P dur:82000000 cpbdur:82000000 q:27.28 tex:167987 mv:5232 misc:1509 imb:19 pmb:1200 smb:131 d:- ref:0 ; in:748 out:748 type:P dur:82000000 cpbdur:82000000 q:28.65 tex:255149 mv:13881 misc:1474 imb:120 pmb:1119 smb:111 d:- ref:0 ; in:749 out:749 type:P dur:82000000 cpbdur:82000000 q:26.83 tex:137312 mv:4533 misc:1531 imb:16 pmb:1165 smb:169 d:- ref:0 ; in:750 out:750 type:I dur:82000000 cpbdur:82000000 q:23.41 tex:764499 mv:15660 misc:369 imb:1350 pmb:0 smb:0 d:- ref:; in:751 out:751 type:P dur:82000000 cpbdur:82000000 q:29.20 tex:20942 mv:1537 misc:1017 imb:6 pmb:297 smb:1047 d:- ref:0 ; in:752 out:752 type:P dur:82000000 cpbdur:82000000 q:29.15 tex:219442 mv:12380 misc:1482 imb:73 pmb:1160 smb:117 d:- ref:0 ; in:753 out:753 type:P dur:82000000 cpbdur:82000000 q:27.12 tex:107645 mv:4394 misc:1545 imb:10 pmb:1126 smb:214 d:- ref:0 ; in:754 out:754 type:P dur:82000000 cpbdur:82000000 q:28.55 tex:248478 mv:13340 misc:1470 imb:118 pmb:1134 smb:98 d:- ref:0 ; in:755 out:755 type:P dur:82000000 cpbdur:82000000 q:27.02 tex:144071 mv:4884 misc:1533 imb:42 pmb:1110 smb:198 d:- ref:0 ; in:756 out:756 type:P dur:82000000 cpbdur:82000000 q:28.56 tex:240330 mv:14852 misc:1442 imb:587 pmb:734 smb:29 d:- ref:0 ; in:757 out:757 type:P dur:82000000 cpbdur:82000000 q:26.27 tex:110772 mv:3290 misc:1434 imb:22 pmb:944 smb:384 d:- ref:0 ; in:758 out:758 type:P dur:82000000 cpbdur:82000000 q:27.60 tex:204800 mv:12750 misc:1394 imb:187 pmb:910 smb:253 d:- ref:0 ; in:759 out:759 type:P dur:82000000 cpbdur:82000000 q:25.49 tex:136725 mv:3818 misc:1449 imb:49 pmb:1026 smb:275 d:- ref:0 ; in:760 out:760 type:P dur:82000000 cpbdur:82000000 q:27.74 tex:239065 mv:14289 misc:1374 imb:274 pmb:853 smb:223 d:- ref:0 ; in:761 out:761 type:P dur:82000000 cpbdur:82000000 q:25.49 tex:132384 mv:3607 misc:1441 imb:33 pmb:1007 smb:310 d:- ref:0 ; in:762 out:762 type:P dur:82000000 cpbdur:82000000 q:27.69 tex:228480 mv:14305 misc:1375 imb:217 pmb:915 smb:218 d:- ref:0 ; in:763 out:763 type:P dur:82000000 cpbdur:82000000 q:25.48 tex:133380 mv:3425 misc:1435 imb:16 pmb:1025 smb:309 d:- ref:0 ; in:764 out:764 type:P dur:82000000 cpbdur:82000000 q:27.30 tex:229840 mv:13118 misc:1386 imb:169 pmb:962 smb:219 d:- ref:0 ; in:765 out:765 type:P dur:82000000 cpbdur:82000000 q:25.20 tex:112384 mv:3480 misc:1440 imb:20 pmb:978 smb:352 d:- ref:0 ; in:766 out:766 type:P dur:82000000 cpbdur:82000000 q:27.84 tex:246267 mv:14821 misc:1440 imb:279 pmb:913 smb:158 d:- ref:0 ; in:767 out:767 type:P dur:82000000 cpbdur:82000000 q:25.62 tex:79903 mv:2969 misc:1512 imb:13 pmb:875 smb:462 d:- ref:0 ; in:768 out:768 type:P dur:82000000 cpbdur:82000000 q:28.19 tex:270648 mv:15959 misc:1457 imb:269 pmb:941 smb:140 d:- ref:0 ; in:769 out:769 type:P dur:82000000 cpbdur:82000000 q:25.97 tex:87246 mv:3118 misc:1524 imb:14 pmb:922 smb:414 d:- ref:0 ; in:770 out:770 type:P dur:82000000 cpbdur:82000000 q:27.79 tex:231849 mv:14440 misc:1455 imb:188 pmb:1000 smb:162 d:- ref:0 ; in:771 out:771 type:P dur:82000000 cpbdur:82000000 q:25.55 tex:87485 mv:3117 misc:1526 imb:16 pmb:935 smb:399 d:- ref:0 ; in:772 out:772 type:P dur:82000000 cpbdur:82000000 q:27.87 tex:251617 mv:15685 misc:1442 imb:193 pmb:1037 smb:120 d:- ref:0 ; in:773 out:773 type:P dur:82000000 cpbdur:82000000 q:26.85 tex:143036 mv:5255 misc:1485 imb:24 pmb:1011 smb:315 d:- ref:0 ; in:774 out:774 type:P dur:82000000 cpbdur:82000000 q:27.74 tex:207028 mv:11221 misc:1399 imb:93 pmb:935 smb:322 d:- ref:0 ; in:775 out:775 type:P dur:82000000 cpbdur:82000000 q:29.89 tex:267860 mv:17247 misc:1421 imb:1167 pmb:183 smb:0 d:- ref:0 ; in:776 out:776 type:P dur:82000000 cpbdur:82000000 q:29.91 tex:192709 mv:21371 misc:1392 imb:535 pmb:743 smb:72 d:- ref:0 ; in:777 out:777 type:P dur:82000000 cpbdur:82000000 q:30.10 tex:214130 mv:22320 misc:1390 imb:442 pmb:826 smb:82 d:- ref:0 ; in:778 out:778 type:P dur:82000000 cpbdur:82000000 q:30.09 tex:205236 mv:20158 misc:1390 imb:542 pmb:728 smb:80 d:- ref:0 ; in:779 out:779 type:P dur:82000000 cpbdur:82000000 q:30.00 tex:192007 mv:21228 misc:1389 imb:518 pmb:752 smb:80 d:- ref:0 ; in:780 out:780 type:P dur:82000000 cpbdur:82000000 q:30.05 tex:200989 mv:22272 misc:1387 imb:420 pmb:848 smb:82 d:- ref:0 ; in:781 out:781 type:P dur:82000000 cpbdur:82000000 q:29.99 tex:194354 mv:21123 misc:1387 imb:484 pmb:799 smb:67 d:- ref:0 ; in:782 out:782 type:P dur:82000000 cpbdur:82000000 q:29.93 tex:190279 mv:21853 misc:1396 imb:511 pmb:763 smb:76 d:- ref:0 ; in:783 out:783 type:P dur:82000000 cpbdur:82000000 q:30.47 tex:260639 mv:22283 misc:1390 imb:468 pmb:819 smb:63 d:- ref:0 ; in:784 out:784 type:P dur:82000000 cpbdur:82000000 q:30.48 tex:229303 mv:20311 misc:1386 imb:549 pmb:733 smb:68 d:- ref:0 ; in:785 out:785 type:P dur:82000000 cpbdur:82000000 q:30.36 tex:212294 mv:20763 misc:1391 imb:476 pmb:801 smb:73 d:- ref:0 ; in:786 out:786 type:P dur:82000000 cpbdur:82000000 q:30.36 tex:222054 mv:20492 misc:1390 imb:424 pmb:834 smb:92 d:- ref:0 ; in:787 out:787 type:P dur:82000000 cpbdur:82000000 q:30.37 tex:221499 mv:20260 misc:1393 imb:508 pmb:768 smb:74 d:- ref:0 ; in:788 out:788 type:P dur:82000000 cpbdur:82000000 q:30.35 tex:210955 mv:20845 misc:1392 imb:483 pmb:801 smb:66 d:- ref:0 ; in:789 out:789 type:P dur:82000000 cpbdur:82000000 q:30.41 tex:218847 mv:21204 misc:1397 imb:433 pmb:840 smb:77 d:- ref:0 ; in:790 out:790 type:P dur:82000000 cpbdur:82000000 q:30.30 tex:210018 mv:19615 misc:1391 imb:428 pmb:829 smb:93 d:- ref:0 ; in:791 out:791 type:P dur:82000000 cpbdur:82000000 q:30.33 tex:212888 mv:19722 misc:1406 imb:520 pmb:760 smb:70 d:- ref:0 ; in:792 out:792 type:P dur:82000000 cpbdur:82000000 q:30.24 tex:200596 mv:19886 misc:1390 imb:434 pmb:832 smb:84 d:- ref:0 ; in:793 out:793 type:P dur:82000000 cpbdur:82000000 q:30.08 tex:188130 mv:18633 misc:1405 imb:411 pmb:829 smb:110 d:- ref:0 ; in:794 out:794 type:P dur:82000000 cpbdur:82000000 q:30.12 tex:197318 mv:19368 misc:1418 imb:487 pmb:784 smb:79 d:- ref:0 ; in:795 out:795 type:P dur:82000000 cpbdur:82000000 q:30.12 tex:198803 mv:19382 misc:1399 imb:429 pmb:826 smb:95 d:- ref:0 ; in:796 out:796 type:P dur:82000000 cpbdur:82000000 q:29.93 tex:182051 mv:17198 misc:1415 imb:421 pmb:808 smb:121 d:- ref:0 ; in:797 out:797 type:P dur:82000000 cpbdur:82000000 q:29.84 tex:179946 mv:17905 misc:1421 imb:476 pmb:771 smb:103 d:- ref:0 ; in:798 out:798 type:P dur:82000000 cpbdur:82000000 q:29.81 tex:178905 mv:18214 misc:1409 imb:445 pmb:794 smb:111 d:- ref:0 ; in:799 out:799 type:P dur:82000000 cpbdur:82000000 q:29.66 tex:168937 mv:16973 misc:1426 imb:400 pmb:841 smb:109 d:- ref:0 ; in:800 out:800 type:P dur:82000000 cpbdur:82000000 q:29.67 tex:171927 mv:16949 misc:1452 imb:448 pmb:781 smb:121 d:- ref:0 ; in:801 out:801 type:P dur:82000000 cpbdur:82000000 q:29.53 tex:161528 mv:16679 misc:1433 imb:419 pmb:819 smb:112 d:- ref:0 ; in:802 out:802 type:P dur:82000000 cpbdur:82000000 q:29.54 tex:163724 mv:16446 misc:1438 imb:404 pmb:832 smb:114 d:- ref:0 ; in:803 out:803 type:P dur:82000000 cpbdur:82000000 q:29.42 tex:176260 mv:16597 misc:1447 imb:451 pmb:811 smb:88 d:- ref:0 ; in:804 out:804 type:P dur:82000000 cpbdur:82000000 q:29.19 tex:157277 mv:16170 misc:1441 imb:380 pmb:814 smb:156 d:- ref:0 ; in:805 out:805 type:P dur:82000000 cpbdur:82000000 q:29.03 tex:155349 mv:16104 misc:1435 imb:387 pmb:848 smb:115 d:- ref:0 ; in:806 out:806 type:P dur:82000000 cpbdur:82000000 q:28.92 tex:150938 mv:16153 misc:1445 imb:402 pmb:837 smb:111 d:- ref:0 ; in:807 out:807 type:P dur:82000000 cpbdur:82000000 q:28.72 tex:137567 mv:15524 misc:1437 imb:387 pmb:806 smb:157 d:- ref:0 ; in:808 out:808 type:P dur:82000000 cpbdur:82000000 q:28.58 tex:127579 mv:14480 misc:1429 imb:353 pmb:780 smb:217 d:- ref:0 ; in:809 out:809 type:P dur:82000000 cpbdur:82000000 q:28.37 tex:146193 mv:14355 misc:1428 imb:361 pmb:815 smb:174 d:- ref:0 ; in:810 out:810 type:P dur:82000000 cpbdur:82000000 q:27.96 tex:123813 mv:13627 misc:1400 imb:343 pmb:723 smb:284 d:- ref:0 ; in:811 out:811 type:P dur:82000000 cpbdur:82000000 q:27.61 tex:110211 mv:12444 misc:1377 imb:290 pmb:686 smb:374 d:- ref:0 ; in:812 out:812 type:P dur:82000000 cpbdur:82000000 q:27.43 tex:130227 mv:12652 misc:1441 imb:328 pmb:776 smb:246 d:- ref:0 ; in:813 out:813 type:P dur:82000000 cpbdur:82000000 q:27.21 tex:114149 mv:11220 misc:1375 imb:274 pmb:684 smb:392 d:- ref:0 ; in:814 out:814 type:P dur:82000000 cpbdur:82000000 q:26.80 tex:100917 mv:11296 misc:1403 imb:319 pmb:686 smb:345 d:- ref:0 ; in:815 out:815 type:P dur:82000000 cpbdur:82000000 q:26.53 tex:94088 mv:10819 misc:1397 imb:305 pmb:709 smb:336 d:- ref:0 ; in:816 out:816 type:P dur:82000000 cpbdur:82000000 q:26.18 tex:106881 mv:11319 misc:1400 imb:320 pmb:783 smb:247 d:- ref:0 ; in:817 out:817 type:P dur:82000000 cpbdur:82000000 q:26.08 tex:105221 mv:11735 misc:1428 imb:347 pmb:793 smb:210 d:- ref:0 ; in:818 out:818 type:P dur:82000000 cpbdur:82000000 q:25.84 tex:99225 mv:11061 misc:1442 imb:329 pmb:797 smb:224 d:- ref:0 ; in:819 out:819 type:P dur:82000000 cpbdur:82000000 q:25.45 tex:116815 mv:10387 misc:1430 imb:205 pmb:1001 smb:144 d:- ref:0 ; in:820 out:820 type:P dur:82000000 cpbdur:82000000 q:24.79 tex:79571 mv:8767 misc:1398 imb:141 pmb:825 smb:384 d:- ref:0 ; in:821 out:821 type:P dur:82000000 cpbdur:82000000 q:24.57 tex:90420 mv:8109 misc:1415 imb:121 pmb:985 smb:244 d:- ref:0 ; in:822 out:822 type:P dur:82000000 cpbdur:82000000 q:24.14 tex:99447 mv:8413 misc:1468 imb:153 pmb:999 smb:198 d:- ref:0 ; in:823 out:823 type:P dur:82000000 cpbdur:82000000 q:23.55 tex:75466 mv:6876 misc:1410 imb:124 pmb:820 smb:406 d:- ref:0 ; in:824 out:824 type:P dur:82000000 cpbdur:82000000 q:22.91 tex:90830 mv:7066 misc:1448 imb:105 pmb:1048 smb:197 d:- ref:0 ; in:825 out:825 type:P dur:82000000 cpbdur:82000000 q:22.53 tex:69512 mv:6380 misc:1452 imb:97 pmb:956 smb:297 d:- ref:0 ; in:826 out:826 type:P dur:82000000 cpbdur:82000000 q:21.96 tex:105644 mv:6181 misc:1447 imb:91 pmb:1095 smb:164 d:- ref:0 ; in:827 out:827 type:P dur:82000000 cpbdur:82000000 q:20.85 tex:73748 mv:5092 misc:1488 imb:53 pmb:1114 smb:183 d:- ref:0 ; in:828 out:828 type:P dur:82000000 cpbdur:82000000 q:19.81 tex:76262 mv:4052 misc:1502 imb:28 pmb:1048 smb:274 d:- ref:0 ; in:829 out:829 type:P dur:82000000 cpbdur:82000000 q:19.35 tex:110301 mv:5057 misc:1474 imb:41 pmb:1193 smb:116 d:- ref:0 ; in:830 out:830 type:P dur:82000000 cpbdur:82000000 q:19.31 tex:55563 mv:4131 misc:1530 imb:30 pmb:901 smb:419 d:- ref:0 ; in:831 out:831 type:P dur:82000000 cpbdur:82000000 q:18.63 tex:35726 mv:3583 misc:1507 imb:18 pmb:767 smb:565 d:- ref:0 ; in:832 out:832 type:P dur:82000000 cpbdur:82000000 q:18.03 tex:58477 mv:3918 misc:1565 imb:13 pmb:1016 smb:321 d:- ref:0 ; in:833 out:833 type:P dur:82000000 cpbdur:82000000 q:16.23 tex:163008 mv:4160 misc:1464 imb:16 pmb:1260 smb:74 d:- ref:0 ; in:834 out:834 type:P dur:82000000 cpbdur:82000000 q:18.63 tex:56241 mv:2759 misc:1512 imb:7 pmb:829 smb:514 d:- ref:0 ; in:835 out:835 type:P dur:82000000 cpbdur:82000000 q:20.11 tex:47622 mv:4084 misc:1486 imb:91 pmb:610 smb:649 d:- ref:0 ; in:836 out:836 type:P dur:82000000 cpbdur:82000000 q:18.02 tex:29576 mv:2606 misc:1514 imb:3 pmb:744 smb:603 d:- ref:0 ; in:837 out:837 type:P dur:82000000 cpbdur:82000000 q:17.11 tex:49885 mv:3564 misc:1559 imb:17 pmb:996 smb:337 d:- ref:0 ; in:838 out:838 type:P dur:82000000 cpbdur:82000000 q:16.95 tex:31845 mv:3070 misc:1581 imb:8 pmb:810 smb:532 d:- ref:0 ; in:839 out:839 type:P dur:82000000 cpbdur:82000000 q:17.18 tex:32774 mv:3577 misc:1585 imb:15 pmb:853 smb:482 d:- ref:0 ; in:840 out:840 type:P dur:82000000 cpbdur:82000000 q:17.72 tex:27770 mv:3285 misc:1537 imb:23 pmb:749 smb:578 d:- ref:0 ; in:841 out:841 type:P dur:82000000 cpbdur:82000000 q:15.76 tex:74605 mv:4036 misc:1487 imb:10 pmb:1186 smb:154 d:- ref:0 ; in:842 out:842 type:P dur:82000000 cpbdur:82000000 q:16.21 tex:41609 mv:2851 misc:1580 imb:12 pmb:799 smb:539 d:- ref:0 ; in:843 out:843 type:P dur:82000000 cpbdur:82000000 q:14.60 tex:32097 mv:2609 misc:1550 imb:5 pmb:727 smb:618 d:- ref:0 ; in:844 out:844 type:P dur:82000000 cpbdur:82000000 q:15.46 tex:39935 mv:3324 misc:1565 imb:17 pmb:750 smb:583 d:- ref:0 ; in:845 out:845 type:P dur:82000000 cpbdur:82000000 q:14.07 tex:66441 mv:3791 misc:1536 imb:16 pmb:1055 smb:279 d:- ref:0 ; in:846 out:846 type:P dur:82000000 cpbdur:82000000 q:15.28 tex:34975 mv:2398 misc:1547 imb:7 pmb:626 smb:717 d:- ref:0 ; in:847 out:847 type:P dur:82000000 cpbdur:82000000 q:15.94 tex:35571 mv:2191 misc:1534 imb:7 pmb:653 smb:690 d:- ref:0 ; in:848 out:848 type:P dur:82000000 cpbdur:82000000 q:15.87 tex:24321 mv:2098 misc:1501 imb:2 pmb:630 smb:718 d:- ref:0 ; in:849 out:849 type:P dur:82000000 cpbdur:82000000 q:14.24 tex:44307 mv:3103 misc:1582 imb:2 pmb:901 smb:447 d:- ref:0 ; in:850 out:850 type:P dur:82000000 cpbdur:82000000 q:14.38 tex:25431 mv:2020 misc:1485 imb:6 pmb:560 smb:784 d:- ref:0 ; in:851 out:851 type:P dur:82000000 cpbdur:82000000 q:16.47 tex:35308 mv:2191 misc:1509 imb:2 pmb:671 smb:677 d:- ref:0 ; in:852 out:852 type:P dur:82000000 cpbdur:82000000 q:20.45 tex:83484 mv:3878 misc:1414 imb:33 pmb:752 smb:565 d:- ref:0 ; in:853 out:853 type:P dur:82000000 cpbdur:82000000 q:20.44 tex:61272 mv:2790 misc:1362 imb:14 pmb:684 smb:652 d:- ref:0 ; in:854 out:854 type:P dur:82000000 cpbdur:82000000 q:21.23 tex:62371 mv:3439 misc:1358 imb:27 pmb:681 smb:642 d:- ref:0 ; in:855 out:855 type:P dur:82000000 cpbdur:82000000 q:25.23 tex:316221 mv:18256 misc:1419 imb:1086 pmb:264 smb:0 d:- ref:0 ; in:856 out:856 type:P dur:82000000 cpbdur:82000000 q:26.00 tex:57848 mv:4633 misc:1479 imb:91 pmb:695 smb:564 d:- ref:0 ; in:857 out:857 type:P dur:82000000 cpbdur:82000000 q:24.82 tex:79011 mv:4713 misc:1420 imb:28 pmb:847 smb:475 d:- ref:0 ; in:858 out:858 type:P dur:82000000 cpbdur:82000000 q:23.36 tex:72271 mv:3868 misc:1533 imb:77 pmb:874 smb:399 d:- ref:0 ; in:859 out:859 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:97599 mv:4635 misc:1502 imb:101 pmb:987 smb:262 d:- ref:0 ; in:860 out:860 type:P dur:82000000 cpbdur:82000000 q:22.17 tex:98245 mv:4214 misc:1485 imb:42 pmb:850 smb:458 d:- ref:0 ; in:861 out:861 type:P dur:82000000 cpbdur:82000000 q:22.35 tex:103568 mv:5176 misc:1536 imb:83 pmb:882 smb:385 d:- ref:0 ; in:862 out:862 type:P dur:82000000 cpbdur:82000000 q:22.12 tex:78818 mv:3675 misc:1499 imb:29 pmb:821 smb:500 d:- ref:0 ; in:863 out:863 type:P dur:82000000 cpbdur:82000000 q:21.92 tex:93380 mv:3927 misc:1437 imb:29 pmb:843 smb:478 d:- ref:0 ; in:864 out:864 type:P dur:82000000 cpbdur:82000000 q:21.38 tex:95132 mv:4028 misc:1488 imb:35 pmb:924 smb:391 d:- ref:0 ; in:865 out:865 type:P dur:82000000 cpbdur:82000000 q:21.32 tex:83425 mv:4024 misc:1503 imb:89 pmb:726 smb:535 d:- ref:0 ; in:866 out:866 type:P dur:82000000 cpbdur:82000000 q:24.60 tex:105514 mv:3348 misc:1106 imb:55 pmb:480 smb:815 d:- ref:0 ; in:867 out:867 type:P dur:82000000 cpbdur:82000000 q:23.87 tex:72951 mv:4550 misc:1403 imb:23 pmb:802 smb:525 d:- ref:0 ; in:868 out:868 type:P dur:82000000 cpbdur:82000000 q:22.84 tex:66499 mv:3447 misc:1574 imb:65 pmb:773 smb:512 d:- ref:0 ; in:869 out:869 type:P dur:82000000 cpbdur:82000000 q:22.23 tex:109322 mv:4371 misc:1539 imb:63 pmb:941 smb:346 d:- ref:0 ; in:870 out:870 type:P dur:82000000 cpbdur:82000000 q:22.27 tex:103200 mv:4808 misc:1544 imb:63 pmb:858 smb:429 d:- ref:0 ; in:871 out:871 type:P dur:82000000 cpbdur:82000000 q:22.57 tex:83988 mv:4496 misc:1508 imb:61 pmb:816 smb:473 d:- ref:0 ; in:872 out:872 type:P dur:82000000 cpbdur:82000000 q:23.08 tex:92956 mv:6145 misc:1531 imb:100 pmb:871 smb:379 d:- ref:0 ; in:873 out:873 type:P dur:82000000 cpbdur:82000000 q:22.10 tex:63762 mv:3289 misc:1421 imb:14 pmb:793 smb:543 d:- ref:0 ; in:874 out:874 type:P dur:82000000 cpbdur:82000000 q:20.66 tex:51976 mv:3012 misc:1532 imb:27 pmb:846 smb:477 d:- ref:0 ; in:875 out:875 type:P dur:82000000 cpbdur:82000000 q:21.66 tex:88000 mv:4539 misc:1525 imb:63 pmb:827 smb:460 d:- ref:0 ; in:876 out:876 type:P dur:82000000 cpbdur:82000000 q:21.25 tex:92171 mv:3558 misc:1535 imb:36 pmb:886 smb:428 d:- ref:0 ; in:877 out:877 type:P dur:82000000 cpbdur:82000000 q:20.36 tex:90159 mv:2965 misc:1476 imb:10 pmb:883 smb:457 d:- ref:0 ; in:878 out:878 type:P dur:82000000 cpbdur:82000000 q:21.51 tex:96285 mv:4334 misc:1525 imb:51 pmb:842 smb:457 d:- ref:0 ; in:879 out:879 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:85475 mv:4164 misc:1537 imb:32 pmb:838 smb:480 d:- ref:0 ; in:880 out:880 type:P dur:82000000 cpbdur:82000000 q:20.66 tex:79420 mv:3096 misc:1524 imb:23 pmb:840 smb:487 d:- ref:0 ; in:881 out:881 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:96545 mv:4469 misc:1514 imb:81 pmb:823 smb:446 d:- ref:0 ; in:882 out:882 type:P dur:82000000 cpbdur:82000000 q:20.92 tex:79130 mv:3353 misc:1493 imb:16 pmb:845 smb:489 d:- ref:0 ; in:883 out:883 type:P dur:82000000 cpbdur:82000000 q:20.36 tex:101840 mv:3209 misc:1487 imb:19 pmb:877 smb:454 d:- ref:0 ; in:884 out:884 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:104277 mv:5356 misc:1527 imb:83 pmb:886 smb:381 d:- ref:0 ; in:885 out:885 type:P dur:82000000 cpbdur:82000000 q:22.08 tex:101136 mv:5092 misc:1492 imb:82 pmb:848 smb:420 d:- ref:0 ; in:886 out:886 type:P dur:82000000 cpbdur:82000000 q:21.39 tex:83065 mv:3407 misc:1560 imb:39 pmb:881 smb:430 d:- ref:0 ; in:887 out:887 type:P dur:82000000 cpbdur:82000000 q:21.84 tex:89968 mv:4162 misc:1486 imb:37 pmb:854 smb:459 d:- ref:0 ; in:888 out:888 type:P dur:82000000 cpbdur:82000000 q:20.55 tex:58441 mv:3004 misc:1571 imb:30 pmb:802 smb:518 d:- ref:0 ; in:889 out:889 type:P dur:82000000 cpbdur:82000000 q:20.63 tex:65439 mv:2730 misc:1415 imb:24 pmb:682 smb:644 d:- ref:0 ; in:890 out:890 type:P dur:82000000 cpbdur:82000000 q:21.45 tex:118177 mv:4663 misc:1496 imb:68 pmb:891 smb:391 d:- ref:0 ; in:891 out:891 type:P dur:82000000 cpbdur:82000000 q:21.37 tex:105538 mv:4214 misc:1504 imb:84 pmb:834 smb:432 d:- ref:0 ; in:892 out:892 type:P dur:82000000 cpbdur:82000000 q:21.63 tex:87804 mv:4129 misc:1499 imb:42 pmb:843 smb:465 d:- ref:0 ; in:893 out:893 type:P dur:82000000 cpbdur:82000000 q:21.90 tex:100836 mv:5091 misc:1513 imb:91 pmb:869 smb:390 d:- ref:0 ; in:894 out:894 type:P dur:82000000 cpbdur:82000000 q:20.77 tex:71465 mv:3178 misc:1493 imb:22 pmb:852 smb:476 d:- ref:0 ; in:895 out:895 type:P dur:82000000 cpbdur:82000000 q:20.84 tex:84958 mv:3055 misc:1475 imb:26 pmb:793 smb:531 d:- ref:0 ; in:896 out:896 type:P dur:82000000 cpbdur:82000000 q:21.46 tex:121562 mv:4799 misc:1503 imb:89 pmb:905 smb:356 d:- ref:0 ; in:897 out:897 type:P dur:82000000 cpbdur:82000000 q:21.52 tex:82081 mv:3967 misc:1496 imb:38 pmb:799 smb:513 d:- ref:0 ; in:898 out:898 type:P dur:82000000 cpbdur:82000000 q:22.43 tex:114486 mv:6130 misc:1512 imb:102 pmb:914 smb:334 d:- ref:0 ; in:899 out:899 type:P dur:82000000 cpbdur:82000000 q:21.25 tex:61187 mv:3050 misc:1523 imb:18 pmb:840 smb:492 d:- ref:0 ; in:900 out:900 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:88775 mv:5176 misc:1497 imb:105 pmb:792 smb:453 d:- ref:0 ; in:901 out:901 type:P dur:82000000 cpbdur:82000000 q:21.42 tex:84563 mv:3774 misc:1471 imb:18 pmb:862 smb:470 d:- ref:0 ; in:902 out:902 type:P dur:82000000 cpbdur:82000000 q:20.03 tex:67860 mv:2854 misc:1494 imb:11 pmb:842 smb:497 d:- ref:0 ; in:903 out:903 type:P dur:82000000 cpbdur:82000000 q:21.66 tex:95329 mv:4595 misc:1484 imb:34 pmb:873 smb:443 d:- ref:0 ; in:904 out:904 type:P dur:82000000 cpbdur:82000000 q:22.11 tex:99769 mv:5343 misc:1504 imb:106 pmb:837 smb:407 d:- ref:0 ; in:905 out:905 type:P dur:82000000 cpbdur:82000000 q:20.85 tex:62361 mv:2936 misc:1479 imb:22 pmb:798 smb:530 d:- ref:0 ; in:906 out:906 type:P dur:82000000 cpbdur:82000000 q:21.27 tex:91266 mv:4299 misc:1531 imb:64 pmb:831 smb:455 d:- ref:0 ; in:907 out:907 type:P dur:82000000 cpbdur:82000000 q:21.93 tex:100693 mv:4763 misc:1504 imb:62 pmb:857 smb:431 d:- ref:0 ; in:908 out:908 type:P dur:82000000 cpbdur:82000000 q:21.56 tex:71546 mv:3669 misc:1473 imb:43 pmb:699 smb:608 d:- ref:0 ; in:909 out:909 type:P dur:82000000 cpbdur:82000000 q:22.53 tex:85796 mv:5917 misc:1503 imb:119 pmb:845 smb:386 d:- ref:0 ; in:910 out:910 type:P dur:82000000 cpbdur:82000000 q:20.90 tex:67907 mv:3308 misc:1489 imb:18 pmb:910 smb:422 d:- ref:0 ; in:911 out:911 type:P dur:82000000 cpbdur:82000000 q:20.74 tex:65755 mv:2612 misc:1337 imb:11 pmb:610 smb:729 d:- ref:0 ; in:912 out:912 type:P dur:82000000 cpbdur:82000000 q:21.83 tex:96619 mv:4761 misc:1500 imb:70 pmb:861 smb:419 d:- ref:0 ; in:913 out:913 type:P dur:82000000 cpbdur:82000000 q:21.97 tex:94718 mv:4597 misc:1509 imb:63 pmb:841 smb:446 d:- ref:0 ; in:914 out:914 type:P dur:82000000 cpbdur:82000000 q:20.79 tex:67466 mv:3433 misc:1541 imb:49 pmb:831 smb:470 d:- ref:0 ; in:915 out:915 type:P dur:82000000 cpbdur:82000000 q:21.07 tex:87565 mv:3423 misc:1492 imb:17 pmb:841 smb:492 d:- ref:0 ; in:916 out:916 type:P dur:82000000 cpbdur:82000000 q:20.64 tex:82424 mv:2971 misc:1477 imb:21 pmb:777 smb:552 d:- ref:0 ; in:917 out:917 type:P dur:82000000 cpbdur:82000000 q:22.33 tex:109063 mv:6232 misc:1505 imb:118 pmb:888 smb:344 d:- ref:0 ; in:918 out:918 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:46093 mv:2219 misc:1328 imb:6 pmb:581 smb:763 d:- ref:0 ; in:919 out:919 type:P dur:82000000 cpbdur:82000000 q:19.80 tex:71110 mv:3010 misc:1488 imb:16 pmb:900 smb:434 d:- ref:0 ; in:920 out:920 type:P dur:82000000 cpbdur:82000000 q:20.78 tex:78265 mv:3449 misc:1462 imb:18 pmb:767 smb:565 d:- ref:0 ; in:921 out:921 type:P dur:82000000 cpbdur:82000000 q:21.50 tex:108472 mv:4774 misc:1522 imb:93 pmb:848 smb:409 d:- ref:0 ; in:922 out:922 type:P dur:82000000 cpbdur:82000000 q:21.10 tex:84598 mv:3547 misc:1487 imb:27 pmb:851 smb:472 d:- ref:0 ; in:923 out:923 type:P dur:82000000 cpbdur:82000000 q:21.06 tex:86929 mv:3629 misc:1482 imb:21 pmb:857 smb:472 d:- ref:0 ; in:924 out:924 type:P dur:82000000 cpbdur:82000000 q:22.03 tex:108255 mv:5800 misc:1489 imb:92 pmb:864 smb:394 d:- ref:0 ; in:925 out:925 type:P dur:82000000 cpbdur:82000000 q:22.15 tex:90240 mv:4222 misc:1482 imb:23 pmb:820 smb:507 d:- ref:0 ; in:926 out:926 type:P dur:82000000 cpbdur:82000000 q:20.61 tex:44286 mv:2618 misc:1528 imb:22 pmb:752 smb:576 d:- ref:0 ; in:927 out:927 type:P dur:82000000 cpbdur:82000000 q:21.35 tex:99454 mv:4504 misc:1522 imb:50 pmb:864 smb:436 d:- ref:0 ; in:928 out:928 type:P dur:82000000 cpbdur:82000000 q:21.97 tex:90774 mv:4649 misc:1513 imb:53 pmb:859 smb:438 d:- ref:0 ; in:929 out:929 type:P dur:82000000 cpbdur:82000000 q:22.53 tex:90994 mv:5940 misc:1522 imb:100 pmb:836 smb:414 d:- ref:0 ; in:930 out:930 type:P dur:82000000 cpbdur:82000000 q:21.16 tex:71081 mv:3349 misc:1514 imb:28 pmb:905 smb:417 d:- ref:0 ; in:931 out:931 type:P dur:82000000 cpbdur:82000000 q:20.24 tex:77242 mv:2635 misc:1475 imb:8 pmb:815 smb:527 d:- ref:0 ; in:932 out:932 type:P dur:82000000 cpbdur:82000000 q:21.27 tex:99453 mv:4444 misc:1519 imb:57 pmb:846 smb:447 d:- ref:0 ; in:933 out:933 type:P dur:82000000 cpbdur:82000000 q:21.37 tex:99144 mv:3964 misc:1516 imb:68 pmb:766 smb:516 d:- ref:0 ; in:934 out:934 type:P dur:82000000 cpbdur:82000000 q:22.35 tex:85566 mv:4602 misc:1320 imb:124 pmb:580 smb:646 d:- ref:0 ; in:935 out:935 type:P dur:82000000 cpbdur:82000000 q:20.76 tex:38250 mv:2271 misc:1415 imb:10 pmb:651 smb:689 d:- ref:0 ; in:936 out:936 type:P dur:82000000 cpbdur:82000000 q:22.37 tex:110200 mv:6259 misc:1517 imb:121 pmb:847 smb:382 d:- ref:0 ; in:937 out:937 type:P dur:82000000 cpbdur:82000000 q:22.06 tex:63381 mv:3245 misc:1366 imb:14 pmb:657 smb:679 d:- ref:0 ; in:938 out:938 type:P dur:82000000 cpbdur:82000000 q:20.84 tex:46823 mv:2682 misc:1487 imb:18 pmb:758 smb:574 d:- ref:0 ; in:939 out:939 type:P dur:82000000 cpbdur:82000000 q:19.25 tex:108362 mv:3912 misc:1510 imb:34 pmb:1056 smb:260 d:- ref:0 ; in:940 out:940 type:P dur:82000000 cpbdur:82000000 q:18.72 tex:49419 mv:2422 misc:1463 imb:7 pmb:722 smb:621 d:- ref:0 ; in:941 out:941 type:P dur:82000000 cpbdur:82000000 q:20.99 tex:82138 mv:3451 misc:1395 imb:24 pmb:745 smb:581 d:- ref:0 ; in:942 out:942 type:P dur:82000000 cpbdur:82000000 q:22.30 tex:105839 mv:5669 misc:1524 imb:98 pmb:837 smb:415 d:- ref:0 ; in:943 out:943 type:P dur:82000000 cpbdur:82000000 q:21.02 tex:50029 mv:2498 misc:1401 imb:5 pmb:702 smb:643 d:- ref:0 ; in:944 out:944 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:72336 mv:3080 misc:1432 imb:24 pmb:772 smb:554 d:- ref:0 ; in:945 out:945 type:P dur:82000000 cpbdur:82000000 q:21.92 tex:89260 mv:4741 misc:1423 imb:52 pmb:767 smb:531 d:- ref:0 ; in:946 out:946 type:P dur:82000000 cpbdur:82000000 q:25.92 tex:389775 mv:18534 misc:1419 imb:1098 pmb:252 smb:0 d:- ref:0 ; in:947 out:947 type:P dur:82000000 cpbdur:82000000 q:26.81 tex:50835 mv:4288 misc:1429 imb:2 pmb:852 smb:496 d:- ref:0 ; in:948 out:948 type:P dur:82000000 cpbdur:82000000 q:25.32 tex:81524 mv:5005 misc:1479 imb:11 pmb:1027 smb:312 d:- ref:0 ; in:949 out:949 type:P dur:82000000 cpbdur:82000000 q:24.13 tex:71071 mv:4770 misc:1519 imb:13 pmb:1032 smb:305 d:- ref:0 ; in:950 out:950 type:P dur:82000000 cpbdur:82000000 q:23.73 tex:94866 mv:4610 misc:1468 imb:8 pmb:956 smb:386 d:- ref:0 ; in:951 out:951 type:P dur:82000000 cpbdur:82000000 q:23.13 tex:115445 mv:4987 misc:1480 imb:20 pmb:1133 smb:197 d:- ref:0 ; in:952 out:952 type:P dur:82000000 cpbdur:82000000 q:23.47 tex:125151 mv:5445 misc:1476 imb:15 pmb:1027 smb:308 d:- ref:0 ; in:953 out:953 type:P dur:82000000 cpbdur:82000000 q:25.33 tex:147151 mv:4586 misc:1431 imb:37 pmb:858 smb:455 d:- ref:0 ; in:954 out:954 type:P dur:82000000 cpbdur:82000000 q:24.50 tex:93822 mv:5272 misc:1474 imb:7 pmb:1044 smb:299 d:- ref:0 ; in:955 out:955 type:P dur:82000000 cpbdur:82000000 q:23.86 tex:104388 mv:5273 misc:1483 imb:7 pmb:1007 smb:336 d:- ref:0 ; in:956 out:956 type:P dur:82000000 cpbdur:82000000 q:23.43 tex:133642 mv:5122 misc:1476 imb:10 pmb:1116 smb:224 d:- ref:0 ; in:957 out:957 type:P dur:82000000 cpbdur:82000000 q:23.17 tex:93460 mv:4888 misc:1492 imb:6 pmb:1030 smb:314 d:- ref:0 ; in:958 out:958 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:120773 mv:5237 misc:1486 imb:6 pmb:1041 smb:303 d:- ref:0 ; in:959 out:959 type:P dur:82000000 cpbdur:82000000 q:22.65 tex:69863 mv:3902 misc:1515 imb:7 pmb:946 smb:397 d:- ref:0 ; in:960 out:960 type:P dur:82000000 cpbdur:82000000 q:23.19 tex:126452 mv:5088 misc:1476 imb:12 pmb:1078 smb:260 d:- ref:0 ; in:961 out:961 type:P dur:82000000 cpbdur:82000000 q:23.19 tex:118116 mv:4302 misc:1462 imb:7 pmb:936 smb:407 d:- ref:0 ; in:962 out:962 type:P dur:82000000 cpbdur:82000000 q:22.91 tex:99624 mv:4557 misc:1499 imb:18 pmb:1061 smb:271 d:- ref:0 ; in:963 out:963 type:P dur:82000000 cpbdur:82000000 q:22.76 tex:116149 mv:4901 misc:1494 imb:16 pmb:1043 smb:291 d:- ref:0 ; in:964 out:964 type:P dur:82000000 cpbdur:82000000 q:22.84 tex:123460 mv:4719 misc:1493 imb:5 pmb:1033 smb:312 d:- ref:0 ; in:965 out:965 type:P dur:82000000 cpbdur:82000000 q:22.79 tex:109252 mv:4966 misc:1486 imb:13 pmb:1090 smb:247 d:- ref:0 ; in:966 out:966 type:P dur:82000000 cpbdur:82000000 q:22.72 tex:119055 mv:4807 misc:1474 imb:9 pmb:1045 smb:296 d:- ref:0 ; in:967 out:967 type:P dur:82000000 cpbdur:82000000 q:22.88 tex:121523 mv:4507 misc:1482 imb:3 pmb:987 smb:360 d:- ref:0 ; in:968 out:968 type:P dur:82000000 cpbdur:82000000 q:22.78 tex:101044 mv:4811 misc:1481 imb:9 pmb:1061 smb:280 d:- ref:0 ; in:969 out:969 type:P dur:82000000 cpbdur:82000000 q:22.76 tex:112116 mv:4529 misc:1467 imb:5 pmb:1013 smb:332 d:- ref:0 ; in:970 out:970 type:P dur:82000000 cpbdur:82000000 q:23.06 tex:130795 mv:5252 misc:1497 imb:7 pmb:1070 smb:273 d:- ref:0 ; in:971 out:971 type:P dur:82000000 cpbdur:82000000 q:22.81 tex:99770 mv:4935 misc:1487 imb:9 pmb:1061 smb:280 d:- ref:0 ; in:972 out:972 type:P dur:82000000 cpbdur:82000000 q:23.10 tex:126987 mv:5487 misc:1486 imb:12 pmb:1057 smb:281 d:- ref:0 ; in:973 out:973 type:P dur:82000000 cpbdur:82000000 q:22.87 tex:113687 mv:4343 misc:1490 imb:2 pmb:1025 smb:323 d:- ref:0 ; in:974 out:974 type:P dur:82000000 cpbdur:82000000 q:22.97 tex:121218 mv:5182 misc:1464 imb:6 pmb:1086 smb:258 d:- ref:0 ; in:975 out:975 type:P dur:82000000 cpbdur:82000000 q:23.25 tex:127221 mv:5374 misc:1477 imb:6 pmb:1040 smb:304 d:- ref:0 ; in:976 out:976 type:P dur:82000000 cpbdur:82000000 q:22.60 tex:83110 mv:4006 misc:1524 imb:5 pmb:968 smb:377 d:- ref:0 ; in:977 out:977 type:P dur:82000000 cpbdur:82000000 q:22.49 tex:155392 mv:5191 misc:1465 imb:20 pmb:1179 smb:151 d:- ref:0 ; in:978 out:978 type:P dur:82000000 cpbdur:82000000 q:23.10 tex:111486 mv:4727 misc:1483 imb:2 pmb:965 smb:383 d:- ref:0 ; in:979 out:979 type:P dur:82000000 cpbdur:82000000 q:22.46 tex:116784 mv:5044 misc:1476 imb:13 pmb:1132 smb:205 d:- ref:0 ; in:980 out:980 type:P dur:82000000 cpbdur:82000000 q:23.01 tex:108228 mv:4896 misc:1468 imb:4 pmb:1016 smb:330 d:- ref:0 ; in:981 out:981 type:P dur:82000000 cpbdur:82000000 q:22.90 tex:108354 mv:4897 misc:1501 imb:7 pmb:1011 smb:332 d:- ref:0 ; in:982 out:982 type:P dur:82000000 cpbdur:82000000 q:22.51 tex:79611 mv:4729 misc:1508 imb:4 pmb:1011 smb:335 d:- ref:0 ; in:983 out:983 type:P dur:82000000 cpbdur:82000000 q:23.09 tex:120992 mv:4895 misc:1473 imb:8 pmb:961 smb:381 d:- ref:0 ; in:984 out:984 type:P dur:82000000 cpbdur:82000000 q:22.96 tex:94578 mv:4678 misc:1480 imb:4 pmb:1038 smb:308 d:- ref:0 ; in:985 out:985 type:P dur:82000000 cpbdur:82000000 q:23.15 tex:114640 mv:5187 misc:1469 imb:6 pmb:989 smb:355 d:- ref:0 ; in:986 out:986 type:P dur:82000000 cpbdur:82000000 q:22.92 tex:105039 mv:4558 misc:1483 imb:6 pmb:1028 smb:316 d:- ref:0 ; in:987 out:987 type:P dur:82000000 cpbdur:82000000 q:22.96 tex:116429 mv:4862 misc:1469 imb:5 pmb:1082 smb:263 d:- ref:0 ; in:988 out:988 type:P dur:82000000 cpbdur:82000000 q:22.90 tex:118763 mv:4914 misc:1499 imb:6 pmb:1024 smb:320 d:- ref:0 ; in:989 out:989 type:P dur:82000000 cpbdur:82000000 q:22.68 tex:115193 mv:4400 misc:1495 imb:4 pmb:1052 smb:294 d:- ref:0 ; in:990 out:990 type:P dur:82000000 cpbdur:82000000 q:22.93 tex:125414 mv:5563 misc:1479 imb:7 pmb:1115 smb:228 d:- ref:0 ; in:991 out:991 type:P dur:82000000 cpbdur:82000000 q:23.28 tex:129010 mv:5415 misc:1495 imb:2 pmb:1049 smb:299 d:- ref:0 ; in:992 out:992 type:P dur:82000000 cpbdur:82000000 q:22.75 tex:89998 mv:4286 misc:1500 imb:4 pmb:978 smb:368 d:- ref:0 ; in:993 out:993 type:P dur:82000000 cpbdur:82000000 q:22.56 tex:95007 mv:4541 misc:1492 imb:10 pmb:1065 smb:275 d:- ref:0 ; in:994 out:994 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:128954 mv:5612 misc:1482 imb:7 pmb:1084 smb:259 d:- ref:0 ; in:995 out:995 type:P dur:82000000 cpbdur:82000000 q:22.68 tex:73166 mv:4313 misc:1513 imb:5 pmb:977 smb:368 d:- ref:0 ; in:996 out:996 type:P dur:82000000 cpbdur:82000000 q:22.81 tex:104909 mv:5141 misc:1478 imb:10 pmb:1087 smb:253 d:- ref:0 ; in:997 out:997 type:P dur:82000000 cpbdur:82000000 q:22.93 tex:114003 mv:4853 misc:1480 imb:7 pmb:987 smb:356 d:- ref:0 ; in:998 out:998 type:P dur:82000000 cpbdur:82000000 q:22.31 tex:130859 mv:5281 misc:1476 imb:15 pmb:1187 smb:148 d:- ref:0 ; in:999 out:999 type:P dur:82000000 cpbdur:82000000 q:22.94 tex:106792 mv:4642 misc:1510 imb:2 pmb:978 smb:370 d:- ref:0 ; in:1000 out:1000 type:I dur:82000000 cpbdur:82000000 q:19.92 tex:682559 mv:15138 misc:375 imb:1350 pmb:0 smb:0 d:- ref:; in:1001 out:1001 type:P dur:82000000 cpbdur:82000000 q:26.94 tex:45332 mv:3721 misc:1211 imb:91 pmb:395 smb:864 d:- ref:0 ; in:1002 out:1002 type:P dur:82000000 cpbdur:82000000 q:26.16 tex:68105 mv:4983 misc:1480 imb:0 pmb:909 smb:441 d:- ref:0 ; in:1003 out:1003 type:P dur:82000000 cpbdur:82000000 q:24.79 tex:76412 mv:4825 misc:1491 imb:2 pmb:1007 smb:341 d:- ref:0 ; in:1004 out:1004 type:P dur:82000000 cpbdur:82000000 q:23.97 tex:89986 mv:5010 misc:1468 imb:0 pmb:1030 smb:320 d:- ref:0 ; in:1005 out:1005 type:P dur:82000000 cpbdur:82000000 q:23.79 tex:106421 mv:5389 misc:1502 imb:4 pmb:1049 smb:297 d:- ref:0 ; in:1006 out:1006 type:P dur:82000000 cpbdur:82000000 q:23.23 tex:114294 mv:4963 misc:1471 imb:6 pmb:1103 smb:241 d:- ref:0 ; in:1007 out:1007 type:P dur:82000000 cpbdur:82000000 q:23.41 tex:124872 mv:5697 misc:1495 imb:6 pmb:1091 smb:253 d:- ref:0 ; in:1008 out:1008 type:P dur:82000000 cpbdur:82000000 q:22.95 tex:98263 mv:4625 misc:1496 imb:2 pmb:991 smb:357 d:- ref:0 ; in:1009 out:1009 type:P dur:82000000 cpbdur:82000000 q:22.45 tex:119328 mv:5322 misc:1478 imb:8 pmb:1148 smb:194 d:- ref:0 ; in:1010 out:1010 type:P dur:82000000 cpbdur:82000000 q:23.11 tex:112701 mv:5160 misc:1483 imb:3 pmb:1002 smb:345 d:- ref:0 ; in:1011 out:1011 type:P dur:82000000 cpbdur:82000000 q:23.12 tex:110301 mv:4745 misc:1458 imb:6 pmb:1009 smb:335 d:- ref:0 ; in:1012 out:1012 type:P dur:82000000 cpbdur:82000000 q:22.68 tex:86202 mv:4528 misc:1470 imb:6 pmb:918 smb:426 d:- ref:0 ; in:1013 out:1013 type:P dur:82000000 cpbdur:82000000 q:26.68 tex:221978 mv:6297 misc:1461 imb:83 pmb:877 smb:390 d:- ref:0 ; in:1014 out:1014 type:P dur:82000000 cpbdur:82000000 q:25.66 tex:88792 mv:5454 misc:1474 imb:4 pmb:1034 smb:312 d:- ref:0 ; in:1015 out:1015 type:P dur:82000000 cpbdur:82000000 q:24.42 tex:134974 mv:5120 misc:1466 imb:10 pmb:1170 smb:170 d:- ref:0 ; in:1016 out:1016 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:90663 mv:4654 misc:1491 imb:4 pmb:1026 smb:320 d:- ref:0 ; in:1017 out:1017 type:P dur:82000000 cpbdur:82000000 q:23.05 tex:150100 mv:4949 misc:1447 imb:3 pmb:1179 smb:168 d:- ref:0 ; in:1018 out:1018 type:P dur:82000000 cpbdur:82000000 q:22.98 tex:117577 mv:4891 misc:1492 imb:7 pmb:1093 smb:250 d:- ref:0 ; in:1019 out:1019 type:P dur:82000000 cpbdur:82000000 q:22.99 tex:117079 mv:4764 misc:1485 imb:11 pmb:982 smb:357 d:- ref:0 ; in:1020 out:1020 type:P dur:82000000 cpbdur:82000000 q:22.82 tex:112940 mv:4569 misc:1483 imb:7 pmb:1035 smb:308 d:- ref:0 ; in:1021 out:1021 type:P dur:82000000 cpbdur:82000000 q:22.90 tex:114403 mv:5342 misc:1471 imb:10 pmb:1104 smb:236 d:- ref:0 ; in:1022 out:1022 type:P dur:82000000 cpbdur:82000000 q:22.79 tex:115786 mv:4656 misc:1486 imb:3 pmb:992 smb:355 d:- ref:0 ; in:1023 out:1023 type:P dur:82000000 cpbdur:82000000 q:22.97 tex:121858 mv:5213 misc:1489 imb:10 pmb:1117 smb:223 d:- ref:0 ; in:1024 out:1024 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:115525 mv:4105 misc:1466 imb:2 pmb:967 smb:381 d:- ref:0 ; in:1025 out:1025 type:P dur:82000000 cpbdur:82000000 q:22.84 tex:119935 mv:4940 misc:1469 imb:6 pmb:1100 smb:244 d:- ref:0 ; in:1026 out:1026 type:P dur:82000000 cpbdur:82000000 q:22.71 tex:116380 mv:4750 misc:1486 imb:10 pmb:1026 smb:314 d:- ref:0 ; in:1027 out:1027 type:P dur:82000000 cpbdur:82000000 q:22.67 tex:123117 mv:4464 misc:1483 imb:5 pmb:1028 smb:317 d:- ref:0 ; in:1028 out:1028 type:P dur:82000000 cpbdur:82000000 q:22.81 tex:116937 mv:5022 misc:1481 imb:11 pmb:1100 smb:239 d:- ref:0 ; in:1029 out:1029 type:P dur:82000000 cpbdur:82000000 q:22.76 tex:120106 mv:4680 misc:1454 imb:3 pmb:1042 smb:305 d:- ref:0 ; in:1030 out:1030 type:P dur:82000000 cpbdur:82000000 q:22.90 tex:130170 mv:5200 misc:1486 imb:4 pmb:1106 smb:240 d:- ref:0 ; in:1031 out:1031 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:104062 mv:4493 misc:1493 imb:2 pmb:1077 smb:271 d:- ref:0 ; in:1032 out:1032 type:P dur:82000000 cpbdur:82000000 q:22.96 tex:120559 mv:4796 misc:1477 imb:6 pmb:1040 smb:304 d:- ref:0 ; in:1033 out:1033 type:P dur:82000000 cpbdur:82000000 q:22.39 tex:156455 mv:4963 misc:1454 imb:9 pmb:1211 smb:130 d:- ref:0 ; in:1034 out:1034 type:P dur:82000000 cpbdur:82000000 q:22.85 tex:105615 mv:4620 misc:1477 imb:5 pmb:1030 smb:315 d:- ref:0 ; in:1035 out:1035 type:P dur:82000000 cpbdur:82000000 q:22.92 tex:119537 mv:4652 misc:1491 imb:6 pmb:1002 smb:342 d:- ref:0 ; in:1036 out:1036 type:P dur:82000000 cpbdur:82000000 q:22.58 tex:89267 mv:4662 misc:1495 imb:10 pmb:1056 smb:284 d:- ref:0 ; in:1037 out:1037 type:P dur:82000000 cpbdur:82000000 q:22.81 tex:117542 mv:4851 misc:1463 imb:8 pmb:971 smb:371 d:- ref:0 ; in:1038 out:1038 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:116694 mv:4661 misc:1485 imb:8 pmb:1035 smb:307 d:- ref:0 ; in:1039 out:1039 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:110706 mv:4443 misc:1483 imb:8 pmb:1071 smb:271 d:- ref:0 ; in:1040 out:1040 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:117981 mv:4852 misc:1463 imb:6 pmb:1026 smb:318 d:- ref:0 ; in:1041 out:1041 type:P dur:82000000 cpbdur:82000000 q:22.91 tex:127355 mv:5016 misc:1477 imb:5 pmb:1038 smb:307 d:- ref:0 ; in:1042 out:1042 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:97261 mv:4789 misc:1510 imb:10 pmb:1085 smb:255 d:- ref:0 ; in:1043 out:1043 type:P dur:82000000 cpbdur:82000000 q:22.60 tex:111706 mv:4412 misc:1490 imb:13 pmb:1014 smb:323 d:- ref:0 ; in:1044 out:1044 type:P dur:82000000 cpbdur:82000000 q:23.19 tex:136720 mv:5714 misc:1462 imb:7 pmb:1132 smb:211 d:- ref:0 ; in:1045 out:1045 type:P dur:82000000 cpbdur:82000000 q:23.16 tex:122163 mv:4508 misc:1465 imb:9 pmb:1004 smb:337 d:- ref:0 ; in:1046 out:1046 type:P dur:82000000 cpbdur:82000000 q:23.06 tex:117684 mv:4698 misc:1482 imb:9 pmb:1096 smb:245 d:- ref:0 ; in:1047 out:1047 type:P dur:82000000 cpbdur:82000000 q:22.93 tex:120668 mv:4798 misc:1462 imb:5 pmb:1032 smb:313 d:- ref:0 ; in:1048 out:1048 type:P dur:82000000 cpbdur:82000000 q:22.61 tex:107800 mv:4415 misc:1465 imb:8 pmb:1007 smb:335 d:- ref:0 ; in:1049 out:1049 type:P dur:82000000 cpbdur:82000000 q:22.87 tex:117263 mv:4700 misc:1485 imb:6 pmb:1054 smb:290 d:- ref:0 ; in:1050 out:1050 type:P dur:82000000 cpbdur:82000000 q:22.93 tex:124485 mv:4824 misc:1475 imb:3 pmb:1052 smb:295 d:- ref:0 ; in:1051 out:1051 type:P dur:82000000 cpbdur:82000000 q:23.16 tex:130041 mv:5212 misc:1467 imb:8 pmb:1118 smb:224 d:- ref:0 ; in:1052 out:1052 type:P dur:82000000 cpbdur:82000000 q:22.98 tex:106630 mv:4447 misc:1483 imb:10 pmb:999 smb:341 d:- ref:0 ; in:1053 out:1053 type:P dur:82000000 cpbdur:82000000 q:22.66 tex:105441 mv:4240 misc:1495 imb:6 pmb:998 smb:346 d:- ref:0 ; in:1054 out:1054 type:P dur:82000000 cpbdur:82000000 q:22.83 tex:119764 mv:4973 misc:1487 imb:8 pmb:1117 smb:225 d:- ref:0 ; in:1055 out:1055 type:P dur:82000000 cpbdur:82000000 q:22.82 tex:119191 mv:4782 misc:1475 imb:8 pmb:1000 smb:342 d:- ref:0 ; in:1056 out:1056 type:P dur:82000000 cpbdur:82000000 q:22.56 tex:109292 mv:4560 misc:1500 imb:8 pmb:1060 smb:282 d:- ref:0 ; in:1057 out:1057 type:P dur:82000000 cpbdur:82000000 q:22.80 tex:123846 mv:5300 misc:1478 imb:9 pmb:1124 smb:217 d:- ref:0 ; in:1058 out:1058 type:P dur:82000000 cpbdur:82000000 q:22.77 tex:121058 mv:4517 misc:1465 imb:9 pmb:1007 smb:334 d:- ref:0 ; in:1059 out:1059 type:P dur:82000000 cpbdur:82000000 q:22.87 tex:122021 mv:4922 misc:1473 imb:4 pmb:1110 smb:236 d:- ref:0 ; in:1060 out:1060 type:P dur:82000000 cpbdur:82000000 q:22.88 tex:124350 mv:4705 misc:1481 imb:10 pmb:999 smb:341 d:- ref:0 ; in:1061 out:1061 type:P dur:82000000 cpbdur:82000000 q:22.54 tex:90924 mv:4829 misc:1503 imb:9 pmb:1089 smb:252 d:- ref:0 ; in:1062 out:1062 type:P dur:82000000 cpbdur:82000000 q:23.05 tex:128850 mv:5313 misc:1469 imb:9 pmb:1013 smb:328 d:- ref:0 ; in:1063 out:1063 type:P dur:82000000 cpbdur:82000000 q:22.80 tex:106956 mv:4507 misc:1497 imb:5 pmb:1049 smb:296 d:- ref:0 ; in:1064 out:1064 type:P dur:82000000 cpbdur:82000000 q:23.12 tex:128328 mv:5453 misc:1459 imb:14 pmb:1137 smb:199 d:- ref:0 ; in:1065 out:1065 type:P dur:82000000 cpbdur:82000000 q:22.78 tex:105816 mv:4430 misc:1474 imb:9 pmb:1006 smb:335 d:- ref:0 ; in:1066 out:1066 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:120197 mv:4911 misc:1484 imb:12 pmb:1077 smb:261 d:- ref:0 ; in:1067 out:1067 type:P dur:82000000 cpbdur:82000000 q:22.83 tex:120613 mv:4874 misc:1481 imb:7 pmb:1112 smb:231 d:- ref:0 ; in:1068 out:1068 type:P dur:82000000 cpbdur:82000000 q:22.56 tex:109575 mv:4360 misc:1505 imb:9 pmb:996 smb:345 d:- ref:0 ; in:1069 out:1069 type:P dur:82000000 cpbdur:82000000 q:22.64 tex:125288 mv:4981 misc:1475 imb:11 pmb:1057 smb:282 d:- ref:0 ; in:1070 out:1070 type:P dur:82000000 cpbdur:82000000 q:22.84 tex:120016 mv:4958 misc:1490 imb:20 pmb:1098 smb:232 d:- ref:0 ; in:1071 out:1071 type:P dur:82000000 cpbdur:82000000 q:22.43 tex:168889 mv:5315 misc:1452 imb:18 pmb:1217 smb:115 d:- ref:0 ; in:1072 out:1072 type:P dur:82000000 cpbdur:82000000 q:22.75 tex:103674 mv:4663 misc:1487 imb:4 pmb:969 smb:377 d:- ref:0 ; in:1073 out:1073 type:P dur:82000000 cpbdur:82000000 q:22.23 tex:121833 mv:4646 misc:1481 imb:16 pmb:1152 smb:182 d:- ref:0 ; in:1074 out:1074 type:P dur:82000000 cpbdur:82000000 q:22.99 tex:117374 mv:4723 misc:1511 imb:5 pmb:1009 smb:336 d:- ref:0 ; in:1075 out:1075 type:P dur:82000000 cpbdur:82000000 q:22.40 tex:118650 mv:4812 misc:1482 imb:10 pmb:1124 smb:216 d:- ref:0 ; in:1076 out:1076 type:P dur:82000000 cpbdur:82000000 q:22.83 tex:96984 mv:4566 misc:1490 imb:3 pmb:1010 smb:337 d:- ref:0 ; in:1077 out:1077 type:P dur:82000000 cpbdur:82000000 q:22.90 tex:113166 mv:4559 misc:1475 imb:6 pmb:961 smb:383 d:- ref:0 ; in:1078 out:1078 type:P dur:82000000 cpbdur:82000000 q:22.77 tex:113340 mv:4472 misc:1500 imb:9 pmb:1052 smb:289 d:- ref:0 ; in:1079 out:1079 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:107997 mv:4628 misc:1479 imb:9 pmb:1094 smb:247 d:- ref:0 ; in:1080 out:1080 type:P dur:82000000 cpbdur:82000000 q:22.94 tex:130508 mv:5269 misc:1495 imb:11 pmb:1053 smb:286 d:- ref:0 ; in:1081 out:1081 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:126592 mv:5559 misc:1473 imb:16 pmb:1111 smb:223 d:- ref:0 ; in:1082 out:1082 type:P dur:82000000 cpbdur:82000000 q:23.08 tex:111613 mv:4137 misc:1450 imb:7 pmb:929 smb:414 d:- ref:0 ; in:1083 out:1083 type:P dur:82000000 cpbdur:82000000 q:22.94 tex:106449 mv:4279 misc:1480 imb:7 pmb:927 smb:416 d:- ref:0 ; in:1084 out:1084 type:P dur:82000000 cpbdur:82000000 q:22.79 tex:93656 mv:4522 misc:1494 imb:16 pmb:1026 smb:308 d:- ref:0 ; in:1085 out:1085 type:P dur:82000000 cpbdur:82000000 q:25.42 tex:182808 mv:8931 misc:1461 imb:236 pmb:839 smb:275 d:- ref:0 ; in:1086 out:1086 type:P dur:82000000 cpbdur:82000000 q:24.32 tex:85631 mv:5075 misc:1502 imb:13 pmb:957 smb:380 d:- ref:0 ; in:1087 out:1087 type:P dur:82000000 cpbdur:82000000 q:23.89 tex:98971 mv:4915 misc:1482 imb:12 pmb:985 smb:353 d:- ref:0 ; in:1088 out:1088 type:P dur:82000000 cpbdur:82000000 q:23.29 tex:126798 mv:5221 misc:1477 imb:12 pmb:1141 smb:197 d:- ref:0 ; in:1089 out:1089 type:P dur:82000000 cpbdur:82000000 q:22.58 tex:92605 mv:4133 misc:1486 imb:4 pmb:987 smb:359 d:- ref:0 ; in:1090 out:1090 type:P dur:82000000 cpbdur:82000000 q:22.90 tex:121911 mv:5281 misc:1472 imb:7 pmb:1095 smb:248 d:- ref:0 ; in:1091 out:1091 type:P dur:82000000 cpbdur:82000000 q:23.04 tex:124353 mv:5043 misc:1476 imb:13 pmb:1061 smb:276 d:- ref:0 ; in:1092 out:1092 type:P dur:82000000 cpbdur:82000000 q:22.55 tex:95404 mv:4506 misc:1490 imb:6 pmb:994 smb:350 d:- ref:0 ; in:1093 out:1093 type:P dur:82000000 cpbdur:82000000 q:23.02 tex:116347 mv:4807 misc:1470 imb:5 pmb:1057 smb:288 d:- ref:0 ; in:1094 out:1094 type:P dur:82000000 cpbdur:82000000 q:23.28 tex:122994 mv:5334 misc:1480 imb:12 pmb:1010 smb:328 d:- ref:0 ; in:1095 out:1095 type:P dur:82000000 cpbdur:82000000 q:27.28 tex:308051 mv:16576 misc:1421 imb:1188 pmb:162 smb:0 d:- ref:0 ; in:1096 out:1096 type:P dur:82000000 cpbdur:82000000 q:26.22 tex:61166 mv:5355 misc:1463 imb:112 pmb:797 smb:441 d:- ref:0 ; in:1097 out:1097 type:P dur:82000000 cpbdur:82000000 q:23.91 tex:52265 mv:3090 misc:1445 imb:30 pmb:842 smb:478 d:- ref:0 ; in:1098 out:1098 type:P dur:82000000 cpbdur:82000000 q:21.95 tex:101055 mv:4658 misc:1487 imb:188 pmb:980 smb:182 d:- ref:0 ; in:1099 out:1099 type:P dur:82000000 cpbdur:82000000 q:20.25 tex:97405 mv:4048 misc:1491 imb:122 pmb:960 smb:268 d:- ref:0 ; in:1100 out:1100 type:P dur:82000000 cpbdur:82000000 q:18.63 tex:89287 mv:4014 misc:1499 imb:84 pmb:996 smb:270 d:- ref:0 ; in:1101 out:1101 type:P dur:82000000 cpbdur:82000000 q:19.21 tex:75248 mv:3510 misc:1514 imb:49 pmb:780 smb:521 d:- ref:0 ; in:1102 out:1102 type:P dur:82000000 cpbdur:82000000 q:18.66 tex:36804 mv:2013 misc:1311 imb:30 pmb:475 smb:845 d:- ref:0 ; in:1103 out:1103 type:P dur:82000000 cpbdur:82000000 q:17.70 tex:51898 mv:2999 misc:1527 imb:35 pmb:857 smb:458 d:- ref:0 ; in:1104 out:1104 type:P dur:82000000 cpbdur:82000000 q:16.16 tex:163983 mv:4117 misc:1476 imb:62 pmb:1143 smb:145 d:- ref:0 ; in:1105 out:1105 type:P dur:82000000 cpbdur:82000000 q:16.58 tex:28995 mv:2495 misc:1574 imb:25 pmb:727 smb:598 d:- ref:0 ; in:1106 out:1106 type:P dur:82000000 cpbdur:82000000 q:15.48 tex:67883 mv:3436 misc:1569 imb:58 pmb:874 smb:418 d:- ref:0 ; in:1107 out:1107 type:P dur:82000000 cpbdur:82000000 q:19.39 tex:77388 mv:3102 misc:1462 imb:24 pmb:720 smb:606 d:- ref:0 ; in:1108 out:1108 type:P dur:82000000 cpbdur:82000000 q:18.00 tex:28712 mv:2000 misc:1416 imb:22 pmb:554 smb:774 d:- ref:0 ; in:1109 out:1109 type:P dur:82000000 cpbdur:82000000 q:18.46 tex:46352 mv:2305 misc:1439 imb:31 pmb:583 smb:736 d:- ref:0 ; in:1110 out:1110 type:P dur:82000000 cpbdur:82000000 q:16.65 tex:33738 mv:2530 misc:1556 imb:37 pmb:706 smb:607 d:- ref:0 ; in:1111 out:1111 type:P dur:82000000 cpbdur:82000000 q:17.76 tex:40350 mv:1868 misc:1398 imb:11 pmb:512 smb:827 d:- ref:0 ; in:1112 out:1112 type:P dur:82000000 cpbdur:82000000 q:17.30 tex:45974 mv:2710 misc:1524 imb:24 pmb:782 smb:544 d:- ref:0 ; in:1113 out:1113 type:P dur:82000000 cpbdur:82000000 q:18.33 tex:56877 mv:2592 misc:1475 imb:15 pmb:702 smb:633 d:- ref:0 ; in:1114 out:1114 type:P dur:82000000 cpbdur:82000000 q:19.24 tex:71452 mv:2877 misc:1447 imb:19 pmb:745 smb:586 d:- ref:0 ; in:1115 out:1115 type:P dur:82000000 cpbdur:82000000 q:19.51 tex:59843 mv:2374 misc:1175 imb:5 pmb:548 smb:797 d:- ref:0 ; in:1116 out:1116 type:P dur:82000000 cpbdur:82000000 q:18.30 tex:50110 mv:2723 misc:1487 imb:25 pmb:773 smb:552 d:- ref:0 ; in:1117 out:1117 type:P dur:82000000 cpbdur:82000000 q:18.82 tex:45510 mv:2052 misc:1382 imb:13 pmb:532 smb:805 d:- ref:0 ; in:1118 out:1118 type:P dur:82000000 cpbdur:82000000 q:18.06 tex:46119 mv:2137 misc:1376 imb:12 pmb:601 smb:737 d:- ref:0 ; in:1119 out:1119 type:P dur:82000000 cpbdur:82000000 q:18.67 tex:43125 mv:2457 misc:1498 imb:23 pmb:631 smb:696 d:- ref:0 ; in:1120 out:1120 type:P dur:82000000 cpbdur:82000000 q:18.76 tex:41791 mv:2833 misc:1504 imb:47 pmb:689 smb:614 d:- ref:0 ; in:1121 out:1121 type:P dur:82000000 cpbdur:82000000 q:19.24 tex:55467 mv:2592 misc:1317 imb:17 pmb:584 smb:749 d:- ref:0 ; in:1122 out:1122 type:P dur:82000000 cpbdur:82000000 q:17.72 tex:28775 mv:2048 misc:1481 imb:30 pmb:568 smb:752 d:- ref:0 ; in:1123 out:1123 type:P dur:82000000 cpbdur:82000000 q:17.68 tex:30440 mv:1635 misc:1341 imb:11 pmb:457 smb:882 d:- ref:0 ; in:1124 out:1124 type:P dur:82000000 cpbdur:82000000 q:16.01 tex:103116 mv:3808 misc:1524 imb:56 pmb:1080 smb:214 d:- ref:0 ; in:1125 out:1125 type:P dur:82000000 cpbdur:82000000 q:18.77 tex:59818 mv:2735 misc:1463 imb:22 pmb:691 smb:637 d:- ref:0 ; in:1126 out:1126 type:P dur:82000000 cpbdur:82000000 q:19.02 tex:69049 mv:3180 misc:1403 imb:21 pmb:710 smb:619 d:- ref:0 ; in:1127 out:1127 type:P dur:82000000 cpbdur:82000000 q:17.98 tex:30119 mv:2512 misc:1489 imb:29 pmb:700 smb:621 d:- ref:0 ; in:1128 out:1128 type:P dur:82000000 cpbdur:82000000 q:18.03 tex:43096 mv:2923 misc:1517 imb:48 pmb:729 smb:573 d:- ref:0 ; in:1129 out:1129 type:P dur:82000000 cpbdur:82000000 q:16.65 tex:45284 mv:3059 misc:1569 imb:45 pmb:843 smb:462 d:- ref:0 ; in:1130 out:1130 type:P dur:82000000 cpbdur:82000000 q:17.14 tex:41472 mv:2987 misc:1581 imb:47 pmb:779 smb:524 d:- ref:0 ; in:1131 out:1131 type:P dur:82000000 cpbdur:82000000 q:20.61 tex:88691 mv:4242 misc:1379 imb:11 pmb:734 smb:605 d:- ref:0 ; in:1132 out:1132 type:P dur:82000000 cpbdur:82000000 q:21.46 tex:98055 mv:4366 misc:1427 imb:11 pmb:768 smb:571 d:- ref:0 ; in:1133 out:1133 type:P dur:82000000 cpbdur:82000000 q:21.81 tex:75418 mv:4807 misc:1375 imb:10 pmb:725 smb:615 d:- ref:0 ; in:1134 out:1134 type:P dur:82000000 cpbdur:82000000 q:25.81 tex:336335 mv:16345 misc:1416 imb:1187 pmb:163 smb:0 d:- ref:0 ; in:1135 out:1135 type:P dur:82000000 cpbdur:82000000 q:25.78 tex:46673 mv:3659 misc:1356 imb:22 pmb:601 smb:727 d:- ref:0 ; in:1136 out:1136 type:P dur:82000000 cpbdur:82000000 q:23.63 tex:46952 mv:2667 misc:1461 imb:20 pmb:775 smb:555 d:- ref:0 ; in:1137 out:1137 type:P dur:82000000 cpbdur:82000000 q:24.28 tex:135174 mv:9933 misc:1397 imb:101 pmb:923 smb:326 d:- ref:0 ; in:1138 out:1138 type:P dur:82000000 cpbdur:82000000 q:22.66 tex:61681 mv:3175 misc:1488 imb:41 pmb:799 smb:510 d:- ref:0 ; in:1139 out:1139 type:P dur:82000000 cpbdur:82000000 q:23.91 tex:122993 mv:9757 misc:1418 imb:112 pmb:803 smb:435 d:- ref:0 ; in:1140 out:1140 type:P dur:82000000 cpbdur:82000000 q:22.34 tex:111075 mv:4181 misc:1488 imb:72 pmb:921 smb:357 d:- ref:0 ; in:1141 out:1141 type:P dur:82000000 cpbdur:82000000 q:25.44 tex:182173 mv:13161 misc:1322 imb:224 pmb:653 smb:473 d:- ref:0 ; in:1142 out:1142 type:P dur:82000000 cpbdur:82000000 q:23.44 tex:67775 mv:2512 misc:1393 imb:23 pmb:708 smb:619 d:- ref:0 ; in:1143 out:1143 type:P dur:82000000 cpbdur:82000000 q:24.17 tex:125290 mv:8753 misc:1389 imb:62 pmb:825 smb:463 d:- ref:0 ; in:1144 out:1144 type:P dur:82000000 cpbdur:82000000 q:22.07 tex:88095 mv:3103 misc:1458 imb:40 pmb:871 smb:439 d:- ref:0 ; in:1145 out:1145 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:120361 mv:7751 misc:1368 imb:49 pmb:813 smb:488 d:- ref:0 ; in:1146 out:1146 type:P dur:82000000 cpbdur:82000000 q:22.12 tex:99222 mv:3350 misc:1444 imb:39 pmb:902 smb:409 d:- ref:0 ; in:1147 out:1147 type:P dur:82000000 cpbdur:82000000 q:20.93 tex:82582 mv:3320 misc:1458 imb:34 pmb:840 smb:476 d:- ref:0 ; in:1148 out:1148 type:P dur:82000000 cpbdur:82000000 q:20.16 tex:101614 mv:3007 misc:1435 imb:20 pmb:883 smb:447 d:- ref:0 ; in:1149 out:1149 type:P dur:82000000 cpbdur:82000000 q:19.81 tex:72231 mv:2784 misc:1433 imb:11 pmb:774 smb:565 d:- ref:0 ; in:1150 out:1150 type:P dur:82000000 cpbdur:82000000 q:18.47 tex:131073 mv:3679 misc:1472 imb:44 pmb:1033 smb:273 d:- ref:0 ; in:1151 out:1151 type:P dur:82000000 cpbdur:82000000 q:17.25 tex:93786 mv:3524 misc:1490 imb:38 pmb:996 smb:316 d:- ref:0 ; in:1152 out:1152 type:P dur:82000000 cpbdur:82000000 q:16.51 tex:31644 mv:2289 misc:1531 imb:22 pmb:673 smb:655 d:- ref:0 ; in:1153 out:1153 type:P dur:82000000 cpbdur:82000000 q:16.94 tex:50662 mv:2682 misc:1536 imb:35 pmb:778 smb:537 d:- ref:0 ; in:1154 out:1154 type:P dur:82000000 cpbdur:82000000 q:16.03 tex:114263 mv:3583 misc:1506 imb:34 pmb:1081 smb:235 d:- ref:0 ; in:1155 out:1155 type:P dur:82000000 cpbdur:82000000 q:17.73 tex:53583 mv:2438 misc:1499 imb:12 pmb:694 smb:644 d:- ref:0 ; in:1156 out:1156 type:P dur:82000000 cpbdur:82000000 q:18.20 tex:57130 mv:2047 misc:1359 imb:3 pmb:557 smb:790 d:- ref:0 ; in:1157 out:1157 type:P dur:82000000 cpbdur:82000000 q:18.72 tex:55648 mv:2481 misc:1455 imb:11 pmb:697 smb:642 d:- ref:0 ; in:1158 out:1158 type:P dur:82000000 cpbdur:82000000 q:17.04 tex:53987 mv:2839 misc:1534 imb:33 pmb:819 smb:498 d:- ref:0 ; in:1159 out:1159 type:P dur:82000000 cpbdur:82000000 q:16.65 tex:22172 mv:2516 misc:1560 imb:54 pmb:644 smb:652 d:- ref:0 ; in:1160 out:1160 type:P dur:82000000 cpbdur:82000000 q:16.06 tex:80690 mv:3365 misc:1545 imb:37 pmb:987 smb:326 d:- ref:0 ; in:1161 out:1161 type:P dur:82000000 cpbdur:82000000 q:18.33 tex:62682 mv:2960 misc:1470 imb:26 pmb:744 smb:580 d:- ref:0 ; in:1162 out:1162 type:P dur:82000000 cpbdur:82000000 q:17.74 tex:27648 mv:1369 misc:1231 imb:9 pmb:409 smb:932 d:- ref:0 ; in:1163 out:1163 type:P dur:82000000 cpbdur:82000000 q:17.57 tex:39514 mv:1850 misc:1260 imb:5 pmb:474 smb:871 d:- ref:0 ; in:1164 out:1164 type:P dur:82000000 cpbdur:82000000 q:16.76 tex:29251 mv:2463 misc:1550 imb:25 pmb:727 smb:598 d:- ref:0 ; in:1165 out:1165 type:P dur:82000000 cpbdur:82000000 q:16.81 tex:32845 mv:2509 misc:1566 imb:43 pmb:671 smb:636 d:- ref:0 ; in:1166 out:1166 type:P dur:82000000 cpbdur:82000000 q:20.12 tex:95972 mv:2882 misc:1442 imb:14 pmb:704 smb:632 d:- ref:0 ; in:1167 out:1167 type:P dur:82000000 cpbdur:82000000 q:19.91 tex:80728 mv:2811 misc:1381 imb:6 pmb:725 smb:619 d:- ref:0 ; in:1168 out:1168 type:P dur:82000000 cpbdur:82000000 q:18.73 tex:50955 mv:2778 misc:1491 imb:20 pmb:826 smb:504 d:- ref:0 ; in:1169 out:1169 type:P dur:82000000 cpbdur:82000000 q:18.86 tex:51703 mv:2222 misc:1443 imb:15 pmb:640 smb:695 d:- ref:0 ; in:1170 out:1170 type:P dur:82000000 cpbdur:82000000 q:20.50 tex:100307 mv:3338 misc:1371 imb:14 pmb:712 smb:624 d:- ref:0 ; in:1171 out:1171 type:P dur:82000000 cpbdur:82000000 q:21.57 tex:101671 mv:3957 misc:1404 imb:17 pmb:747 smb:586 d:- ref:0 ; in:1172 out:1172 type:P dur:82000000 cpbdur:82000000 q:22.04 tex:90671 mv:4586 misc:1367 imb:9 pmb:756 smb:585 d:- ref:0 ; in:1173 out:1173 type:P dur:82000000 cpbdur:82000000 q:26.04 tex:362659 mv:17580 misc:1417 imb:1148 pmb:202 smb:0 d:- ref:0 ; in:1174 out:1174 type:P dur:82000000 cpbdur:82000000 q:26.42 tex:57339 mv:3908 misc:1529 imb:3 pmb:842 smb:505 d:- ref:0 ; in:1175 out:1175 type:P dur:82000000 cpbdur:82000000 q:24.06 tex:55862 mv:3318 misc:1564 imb:3 pmb:1042 smb:305 d:- ref:0 ; in:1176 out:1176 type:P dur:82000000 cpbdur:82000000 q:22.92 tex:90538 mv:4284 misc:1514 imb:11 pmb:1120 smb:219 d:- ref:0 ; in:1177 out:1177 type:P dur:82000000 cpbdur:82000000 q:21.71 tex:103245 mv:4020 misc:1495 imb:7 pmb:1226 smb:117 d:- ref:0 ; in:1178 out:1178 type:P dur:82000000 cpbdur:82000000 q:19.94 tex:125415 mv:3893 misc:1468 imb:8 pmb:1259 smb:83 d:- ref:0 ; in:1179 out:1179 type:P dur:82000000 cpbdur:82000000 q:20.50 tex:56347 mv:2650 misc:1491 imb:4 pmb:600 smb:746 d:- ref:0 ; in:1180 out:1180 type:P dur:82000000 cpbdur:82000000 q:18.53 tex:119712 mv:4029 misc:1459 imb:8 pmb:1275 smb:67 d:- ref:0 ; in:1181 out:1181 type:P dur:82000000 cpbdur:82000000 q:17.49 tex:159435 mv:4021 misc:1440 imb:5 pmb:1313 smb:32 d:- ref:0 ; in:1182 out:1182 type:P dur:82000000 cpbdur:82000000 q:21.49 tex:181971 mv:3827 misc:1346 imb:47 pmb:657 smb:646 d:- ref:0 ; in:1183 out:1183 type:P dur:82000000 cpbdur:82000000 q:22.58 tex:22940 mv:1377 misc:1275 imb:1 pmb:449 smb:900 d:- ref:0 ; in:1184 out:1184 type:P dur:82000000 cpbdur:82000000 q:20.74 tex:39463 mv:2452 misc:1533 imb:1 pmb:792 smb:557 d:- ref:0 ; in:1185 out:1185 type:P dur:82000000 cpbdur:82000000 q:21.58 tex:81506 mv:3520 misc:1542 imb:1 pmb:818 smb:531 d:- ref:0 ; in:1186 out:1186 type:P dur:82000000 cpbdur:82000000 q:20.80 tex:64330 mv:3118 misc:1544 imb:5 pmb:980 smb:365 d:- ref:0 ; in:1187 out:1187 type:P dur:82000000 cpbdur:82000000 q:19.32 tex:124911 mv:3778 misc:1487 imb:2 pmb:1212 smb:136 d:- ref:0 ; in:1188 out:1188 type:P dur:82000000 cpbdur:82000000 q:20.66 tex:58026 mv:2571 misc:1379 imb:5 pmb:567 smb:778 d:- ref:0 ; in:1189 out:1189 type:P dur:82000000 cpbdur:82000000 q:20.50 tex:54759 mv:2415 misc:1450 imb:3 pmb:729 smb:618 d:- ref:0 ; in:1190 out:1190 type:P dur:82000000 cpbdur:82000000 q:20.30 tex:63389 mv:3293 misc:1574 imb:8 pmb:1003 smb:339 d:- ref:0 ; in:1191 out:1191 type:P dur:82000000 cpbdur:82000000 q:21.95 tex:79252 mv:5226 misc:1530 imb:46 pmb:1088 smb:216 d:- ref:0 ; in:1192 out:1192 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:51078 mv:3618 misc:1584 imb:16 pmb:1040 smb:294 d:- ref:0 ; in:1193 out:1193 type:P dur:82000000 cpbdur:82000000 q:19.92 tex:53926 mv:3878 misc:1548 imb:26 pmb:1120 smb:204 d:- ref:0 ; in:1194 out:1194 type:P dur:82000000 cpbdur:82000000 q:20.24 tex:57260 mv:2995 misc:1569 imb:14 pmb:747 smb:589 d:- ref:0 ; in:1195 out:1195 type:P dur:82000000 cpbdur:82000000 q:18.95 tex:82474 mv:4031 misc:1495 imb:7 pmb:1245 smb:98 d:- ref:0 ; in:1196 out:1196 type:P dur:82000000 cpbdur:82000000 q:17.86 tex:68780 mv:3515 misc:1577 imb:3 pmb:1131 smb:216 d:- ref:0 ; in:1197 out:1197 type:P dur:82000000 cpbdur:82000000 q:18.73 tex:51649 mv:2681 misc:1558 imb:6 pmb:731 smb:613 d:- ref:0 ; in:1198 out:1198 type:P dur:82000000 cpbdur:82000000 q:17.45 tex:109300 mv:4008 misc:1468 imb:5 pmb:1288 smb:57 d:- ref:0 ; in:1199 out:1199 type:P dur:82000000 cpbdur:82000000 q:16.80 tex:42609 mv:2956 misc:1611 imb:3 pmb:968 smb:379 d:- ref:0 ; in:1200 out:1200 type:P dur:82000000 cpbdur:82000000 q:18.34 tex:52197 mv:1641 misc:1082 imb:3 pmb:321 smb:1026 d:- ref:0 ; in:1201 out:1201 type:P dur:82000000 cpbdur:82000000 q:17.17 tex:42473 mv:2681 misc:1590 imb:1 pmb:885 smb:464 d:- ref:0 ; in:1202 out:1202 type:P dur:82000000 cpbdur:82000000 q:16.66 tex:37873 mv:2548 misc:1603 imb:1 pmb:842 smb:507 d:- ref:0 ; in:1203 out:1203 type:P dur:82000000 cpbdur:82000000 q:19.00 tex:62369 mv:2789 misc:1522 imb:3 pmb:703 smb:644 d:- ref:0 ; in:1204 out:1204 type:P dur:82000000 cpbdur:82000000 q:18.07 tex:42019 mv:2516 misc:1553 imb:2 pmb:828 smb:520 d:- ref:0 ; in:1205 out:1205 type:P dur:82000000 cpbdur:82000000 q:18.71 tex:62457 mv:2656 misc:1527 imb:3 pmb:842 smb:505 d:- ref:0 ; in:1206 out:1206 type:P dur:82000000 cpbdur:82000000 q:19.91 tex:57914 mv:2668 misc:1474 imb:1 pmb:660 smb:689 d:- ref:0 ; in:1207 out:1207 type:P dur:82000000 cpbdur:82000000 q:18.53 tex:43000 mv:2658 misc:1574 imb:1 pmb:864 smb:485 d:- ref:0 ; in:1208 out:1208 type:P dur:82000000 cpbdur:82000000 q:17.32 tex:94350 mv:3744 misc:1514 imb:5 pmb:1212 smb:133 d:- ref:0 ; in:1209 out:1209 type:P dur:82000000 cpbdur:82000000 q:19.18 tex:61783 mv:2601 misc:1536 imb:4 pmb:671 smb:675 d:- ref:0 ; in:1210 out:1210 type:P dur:82000000 cpbdur:82000000 q:17.88 tex:32261 mv:2360 misc:1587 imb:6 pmb:760 smb:584 d:- ref:0 ; in:1211 out:1211 type:P dur:82000000 cpbdur:82000000 q:16.95 tex:58515 mv:3345 misc:1564 imb:2 pmb:1095 smb:253 d:- ref:0 ; in:1212 out:1212 type:P dur:82000000 cpbdur:82000000 q:18.68 tex:54613 mv:2498 misc:1497 imb:4 pmb:636 smb:710 d:- ref:0 ; in:1213 out:1213 type:P dur:82000000 cpbdur:82000000 q:17.59 tex:34429 mv:2348 misc:1575 imb:1 pmb:770 smb:579 d:- ref:0 ; in:1214 out:1214 type:P dur:82000000 cpbdur:82000000 q:16.70 tex:51588 mv:3126 misc:1606 imb:3 pmb:1016 smb:331 d:- ref:0 ; in:1215 out:1215 type:P dur:82000000 cpbdur:82000000 q:19.62 tex:51213 mv:2145 misc:1410 imb:2 pmb:535 smb:813 d:- ref:0 ; in:1216 out:1216 type:P dur:82000000 cpbdur:82000000 q:20.48 tex:78501 mv:2962 misc:1529 imb:1 pmb:892 smb:457 d:- ref:0 ; in:1217 out:1217 type:P dur:82000000 cpbdur:82000000 q:19.09 tex:73170 mv:3226 misc:1532 imb:2 pmb:1042 smb:306 d:- ref:0 ; in:1218 out:1218 type:P dur:82000000 cpbdur:82000000 q:19.59 tex:42432 mv:1720 misc:1320 imb:3 pmb:426 smb:921 d:- ref:0 ; in:1219 out:1219 type:P dur:82000000 cpbdur:82000000 q:18.42 tex:62140 mv:2897 misc:1595 imb:1 pmb:935 smb:414 d:- ref:0 ; in:1220 out:1220 type:P dur:82000000 cpbdur:82000000 q:20.97 tex:91672 mv:4186 misc:1478 imb:2 pmb:942 smb:406 d:- ref:0 ; in:1221 out:1221 type:P dur:82000000 cpbdur:82000000 q:22.36 tex:107174 mv:5387 misc:1503 imb:1 pmb:1013 smb:336 d:- ref:0 ; in:1222 out:1222 type:P dur:82000000 cpbdur:82000000 q:21.63 tex:60808 mv:2363 misc:1125 imb:1 pmb:551 smb:798 d:- ref:0 ; in:1223 out:1223 type:P dur:82000000 cpbdur:82000000 q:25.49 tex:185279 mv:13478 misc:1419 imb:1178 pmb:172 smb:0 d:- ref:0 ; in:1224 out:1224 type:P dur:82000000 cpbdur:82000000 q:23.71 tex:29840 mv:2847 misc:1161 imb:57 pmb:405 smb:888 d:- ref:0 ; in:1225 out:1225 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:70857 mv:6453 misc:1314 imb:110 pmb:523 smb:717 d:- ref:0 ; in:1226 out:1226 type:P dur:82000000 cpbdur:82000000 q:21.66 tex:39495 mv:3967 misc:1474 imb:132 pmb:591 smb:627 d:- ref:0 ; in:1227 out:1227 type:P dur:82000000 cpbdur:82000000 q:22.46 tex:77363 mv:7458 misc:1459 imb:196 pmb:520 smb:634 d:- ref:0 ; in:1228 out:1228 type:P dur:82000000 cpbdur:82000000 q:21.20 tex:39303 mv:4864 misc:1513 imb:199 pmb:622 smb:529 d:- ref:0 ; in:1229 out:1229 type:P dur:82000000 cpbdur:82000000 q:22.71 tex:76761 mv:6815 misc:1176 imb:156 pmb:367 smb:827 d:- ref:0 ; in:1230 out:1230 type:P dur:82000000 cpbdur:82000000 q:21.48 tex:55063 mv:5548 misc:1509 imb:227 pmb:638 smb:485 d:- ref:0 ; in:1231 out:1231 type:P dur:82000000 cpbdur:82000000 q:23.30 tex:87950 mv:8938 misc:1288 imb:292 pmb:390 smb:668 d:- ref:0 ; in:1232 out:1232 type:P dur:82000000 cpbdur:82000000 q:21.66 tex:31426 mv:2787 misc:1299 imb:77 pmb:423 smb:850 d:- ref:0 ; in:1233 out:1233 type:P dur:82000000 cpbdur:82000000 q:23.41 tex:94283 mv:6855 misc:1110 imb:154 pmb:369 smb:827 d:- ref:0 ; in:1234 out:1234 type:P dur:82000000 cpbdur:82000000 q:21.75 tex:29760 mv:2805 misc:1323 imb:84 pmb:411 smb:855 d:- ref:0 ; in:1235 out:1235 type:P dur:82000000 cpbdur:82000000 q:24.05 tex:116873 mv:7852 misc:1139 imb:280 pmb:316 smb:754 d:- ref:0 ; in:1236 out:1236 type:P dur:82000000 cpbdur:82000000 q:22.29 tex:42991 mv:3620 misc:1405 imb:133 pmb:498 smb:719 d:- ref:0 ; in:1237 out:1237 type:P dur:82000000 cpbdur:82000000 q:24.17 tex:120388 mv:8571 misc:1137 imb:260 pmb:357 smb:733 d:- ref:0 ; in:1238 out:1238 type:P dur:82000000 cpbdur:82000000 q:22.56 tex:28497 mv:3240 misc:1375 imb:138 pmb:398 smb:814 d:- ref:0 ; in:1239 out:1239 type:P dur:82000000 cpbdur:82000000 q:25.26 tex:152274 mv:11114 misc:1300 imb:413 pmb:370 smb:567 d:- ref:0 ; in:1240 out:1240 type:P dur:82000000 cpbdur:82000000 q:23.81 tex:35471 mv:4213 misc:1340 imb:149 pmb:429 smb:772 d:- ref:0 ; in:1241 out:1241 type:P dur:82000000 cpbdur:82000000 q:25.44 tex:143842 mv:11832 misc:1390 imb:365 pmb:500 smb:485 d:- ref:0 ; in:1242 out:1242 type:P dur:82000000 cpbdur:82000000 q:24.21 tex:47887 mv:6321 misc:1432 imb:235 pmb:517 smb:598 d:- ref:0 ; in:1243 out:1243 type:P dur:82000000 cpbdur:82000000 q:25.80 tex:141855 mv:13488 misc:1457 imb:548 pmb:498 smb:304 d:- ref:0 ; in:1244 out:1244 type:P dur:82000000 cpbdur:82000000 q:25.31 tex:98028 mv:7860 misc:1496 imb:391 pmb:594 smb:365 d:- ref:0 ; in:1245 out:1245 type:P dur:82000000 cpbdur:82000000 q:26.17 tex:143802 mv:12053 misc:1361 imb:381 pmb:529 smb:440 d:- ref:0 ; in:1246 out:1246 type:P dur:82000000 cpbdur:82000000 q:25.45 tex:95874 mv:6485 misc:1473 imb:301 pmb:603 smb:446 d:- ref:0 ; in:1247 out:1247 type:P dur:82000000 cpbdur:82000000 q:26.12 tex:143351 mv:11013 misc:1228 imb:233 pmb:569 smb:548 d:- ref:0 ; in:1248 out:1248 type:P dur:82000000 cpbdur:82000000 q:25.26 tex:87193 mv:4912 misc:1383 imb:185 pmb:624 smb:541 d:- ref:0 ; in:1249 out:1249 type:P dur:82000000 cpbdur:82000000 q:26.02 tex:141154 mv:11239 misc:1231 imb:172 pmb:655 smb:523 d:- ref:0 ; in:1250 out:1250 type:I dur:82000000 cpbdur:82000000 q:20.16 tex:405345 mv:13554 misc:373 imb:1350 pmb:0 smb:0 d:- ref:; in:1251 out:1251 type:P dur:82000000 cpbdur:82000000 q:27.58 tex:114156 mv:10875 misc:1217 imb:128 pmb:647 smb:575 d:- ref:0 ; in:1252 out:1252 type:P dur:82000000 cpbdur:82000000 q:25.67 tex:49466 mv:2875 misc:1315 imb:39 pmb:627 smb:684 d:- ref:0 ; in:1253 out:1253 type:P dur:82000000 cpbdur:82000000 q:26.20 tex:151799 mv:11541 misc:1308 imb:169 pmb:691 smb:490 d:- ref:0 ; in:1254 out:1254 type:P dur:82000000 cpbdur:82000000 q:24.56 tex:60863 mv:3854 misc:1411 imb:74 pmb:694 smb:582 d:- ref:0 ; in:1255 out:1255 type:P dur:82000000 cpbdur:82000000 q:25.79 tex:153923 mv:11449 misc:1260 imb:168 pmb:683 smb:499 d:- ref:0 ; in:1256 out:1256 type:P dur:82000000 cpbdur:82000000 q:24.08 tex:78432 mv:3200 misc:1384 imb:66 pmb:700 smb:584 d:- ref:0 ; in:1257 out:1257 type:P dur:82000000 cpbdur:82000000 q:25.87 tex:159795 mv:12494 misc:1383 imb:165 pmb:760 smb:425 d:- ref:0 ; in:1258 out:1258 type:P dur:82000000 cpbdur:82000000 q:25.04 tex:110608 mv:8981 misc:1507 imb:278 pmb:857 smb:215 d:- ref:0 ; in:1259 out:1259 type:P dur:82000000 cpbdur:82000000 q:25.73 tex:140165 mv:10796 misc:1311 imb:133 pmb:724 smb:493 d:- ref:0 ; in:1260 out:1260 type:P dur:82000000 cpbdur:82000000 q:24.01 tex:81729 mv:3547 misc:1444 imb:67 pmb:797 smb:486 d:- ref:0 ; in:1261 out:1261 type:P dur:82000000 cpbdur:82000000 q:28.01 tex:311388 mv:17289 misc:1419 imb:1111 pmb:239 smb:0 d:- ref:0 ; in:1262 out:1262 type:P dur:82000000 cpbdur:82000000 q:26.22 tex:54822 mv:3904 misc:1490 imb:22 pmb:966 smb:362 d:- ref:0 ; in:1263 out:1263 type:P dur:82000000 cpbdur:82000000 q:25.02 tex:99027 mv:6243 misc:1514 imb:47 pmb:1023 smb:280 d:- ref:0 ; in:1264 out:1264 type:P dur:82000000 cpbdur:82000000 q:23.03 tex:90895 mv:3927 misc:1490 imb:43 pmb:1123 smb:184 d:- ref:0 ; in:1265 out:1265 type:P dur:82000000 cpbdur:82000000 q:23.44 tex:95907 mv:5273 misc:1308 imb:60 pmb:553 smb:737 d:- ref:0 ; in:1266 out:1266 type:P dur:82000000 cpbdur:82000000 q:21.78 tex:86904 mv:4077 misc:1499 imb:42 pmb:1123 smb:185 d:- ref:0 ; in:1267 out:1267 type:P dur:82000000 cpbdur:82000000 q:23.00 tex:92339 mv:5100 misc:1161 imb:52 pmb:488 smb:810 d:- ref:0 ; in:1268 out:1268 type:P dur:82000000 cpbdur:82000000 q:21.58 tex:64965 mv:2749 misc:1446 imb:15 pmb:833 smb:502 d:- ref:0 ; in:1269 out:1269 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:97834 mv:5169 misc:1085 imb:59 pmb:431 smb:860 d:- ref:0 ; in:1270 out:1270 type:P dur:82000000 cpbdur:82000000 q:22.14 tex:76523 mv:2877 misc:1440 imb:14 pmb:855 smb:481 d:- ref:0 ; in:1271 out:1271 type:P dur:82000000 cpbdur:82000000 q:22.99 tex:93841 mv:4766 misc:1257 imb:39 pmb:602 smb:709 d:- ref:0 ; in:1272 out:1272 type:P dur:82000000 cpbdur:82000000 q:20.87 tex:83688 mv:3369 misc:1503 imb:19 pmb:1031 smb:300 d:- ref:0 ; in:1273 out:1273 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:96457 mv:4673 misc:1222 imb:27 pmb:489 smb:834 d:- ref:0 ; in:1274 out:1274 type:P dur:82000000 cpbdur:82000000 q:20.34 tex:85364 mv:3441 misc:1491 imb:19 pmb:1055 smb:276 d:- ref:0 ; in:1275 out:1275 type:P dur:82000000 cpbdur:82000000 q:22.23 tex:97897 mv:4782 misc:1329 imb:27 pmb:558 smb:765 d:- ref:0 ; in:1276 out:1276 type:P dur:82000000 cpbdur:82000000 q:20.58 tex:32241 mv:1901 misc:1394 imb:5 pmb:599 smb:746 d:- ref:0 ; in:1277 out:1277 type:P dur:82000000 cpbdur:82000000 q:22.30 tex:100268 mv:4515 misc:1105 imb:34 pmb:437 smb:879 d:- ref:0 ; in:1278 out:1278 type:P dur:82000000 cpbdur:82000000 q:20.22 tex:61674 mv:2371 misc:1467 imb:8 pmb:755 smb:587 d:- ref:0 ; in:1279 out:1279 type:P dur:82000000 cpbdur:82000000 q:23.44 tex:122159 mv:5364 misc:925 imb:125 pmb:312 smb:913 d:- ref:0 ; in:1280 out:1280 type:P dur:82000000 cpbdur:82000000 q:21.56 tex:30276 mv:1366 misc:1182 imb:3 pmb:424 smb:923 d:- ref:0 ; in:1281 out:1281 type:P dur:82000000 cpbdur:82000000 q:23.62 tex:110430 mv:5244 misc:886 imb:103 pmb:318 smb:929 d:- ref:0 ; in:1282 out:1282 type:P dur:82000000 cpbdur:82000000 q:21.70 tex:49054 mv:1730 misc:1256 imb:5 pmb:554 smb:791 d:- ref:0 ; in:1283 out:1283 type:P dur:82000000 cpbdur:82000000 q:23.52 tex:104991 mv:5470 misc:827 imb:71 pmb:326 smb:953 d:- ref:0 ; in:1284 out:1284 type:P dur:82000000 cpbdur:82000000 q:21.64 tex:54160 mv:1862 misc:1298 imb:7 pmb:586 smb:757 d:- ref:0 ; in:1285 out:1285 type:P dur:82000000 cpbdur:82000000 q:23.64 tex:107119 mv:5733 misc:932 imb:73 pmb:359 smb:918 d:- ref:0 ; in:1286 out:1286 type:P dur:82000000 cpbdur:82000000 q:22.30 tex:69969 mv:3446 misc:1529 imb:69 pmb:836 smb:445 d:- ref:0 ; in:1287 out:1287 type:P dur:82000000 cpbdur:82000000 q:24.90 tex:133341 mv:7896 misc:1419 imb:173 pmb:640 smb:537 d:- ref:0 ; in:1288 out:1288 type:P dur:82000000 cpbdur:82000000 q:23.58 tex:53118 mv:5098 misc:1544 imb:195 pmb:886 smb:269 d:- ref:0 ; in:1289 out:1289 type:P dur:82000000 cpbdur:82000000 q:24.85 tex:136712 mv:8661 misc:1459 imb:221 pmb:731 smb:398 d:- ref:0 ; in:1290 out:1290 type:P dur:82000000 cpbdur:82000000 q:23.88 tex:74419 mv:5228 misc:1497 imb:159 pmb:974 smb:217 d:- ref:0 ; in:1291 out:1291 type:P dur:82000000 cpbdur:82000000 q:24.65 tex:124177 mv:7739 misc:1404 imb:178 pmb:691 smb:481 d:- ref:0 ; in:1292 out:1292 type:P dur:82000000 cpbdur:82000000 q:23.67 tex:72977 mv:4890 misc:1493 imb:134 pmb:938 smb:278 d:- ref:0 ; in:1293 out:1293 type:P dur:82000000 cpbdur:82000000 q:24.32 tex:128054 mv:7237 misc:1341 imb:162 pmb:675 smb:513 d:- ref:0 ; in:1294 out:1294 type:P dur:82000000 cpbdur:82000000 q:23.69 tex:77060 mv:4971 misc:1481 imb:166 pmb:827 smb:357 d:- ref:0 ; in:1295 out:1295 type:P dur:82000000 cpbdur:82000000 q:23.99 tex:111146 mv:6494 misc:1344 imb:140 pmb:698 smb:512 d:- ref:0 ; in:1296 out:1296 type:P dur:82000000 cpbdur:82000000 q:23.95 tex:99158 mv:5371 misc:1439 imb:216 pmb:667 smb:467 d:- ref:0 ; in:1297 out:1297 type:P dur:82000000 cpbdur:82000000 q:24.61 tex:128000 mv:7348 misc:1372 imb:233 pmb:606 smb:511 d:- ref:0 ; in:1298 out:1298 type:P dur:82000000 cpbdur:82000000 q:24.06 tex:95746 mv:5036 misc:1346 imb:198 pmb:564 smb:588 d:- ref:0 ; in:1299 out:1299 type:P dur:82000000 cpbdur:82000000 q:23.87 tex:83917 mv:4357 misc:1022 imb:212 pmb:391 smb:747 d:- ref:0 ; in:1300 out:1300 type:P dur:82000000 cpbdur:82000000 q:24.49 tex:126076 mv:6271 misc:1117 imb:245 pmb:471 smb:634 d:- ref:0 ; in:1301 out:1301 type:P dur:82000000 cpbdur:82000000 q:24.25 tex:98954 mv:5186 misc:1260 imb:266 pmb:458 smb:626 d:- ref:0 ; in:1302 out:1302 type:P dur:82000000 cpbdur:82000000 q:24.39 tex:95865 mv:5928 misc:1455 imb:302 pmb:580 smb:468 d:- ref:0 ; in:1303 out:1303 type:P dur:82000000 cpbdur:82000000 q:24.40 tex:114147 mv:8386 misc:1491 imb:219 pmb:1010 smb:121 d:- ref:0 ; in:1304 out:1304 type:P dur:82000000 cpbdur:82000000 q:22.75 tex:59874 mv:4120 misc:1502 imb:78 pmb:1040 smb:232 d:- ref:0 ; in:1305 out:1305 type:P dur:82000000 cpbdur:82000000 q:21.17 tex:119967 mv:4863 misc:1466 imb:125 pmb:1159 smb:66 d:- ref:0 ; in:1306 out:1306 type:P dur:82000000 cpbdur:82000000 q:22.18 tex:100744 mv:4758 misc:1202 imb:31 pmb:584 smb:735 d:- ref:0 ; in:1307 out:1307 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:86088 mv:3382 misc:1498 imb:23 pmb:1020 smb:307 d:- ref:0 ; in:1308 out:1308 type:P dur:82000000 cpbdur:82000000 q:19.02 tex:121173 mv:3885 misc:1470 imb:19 pmb:1175 smb:156 d:- ref:0 ; in:1309 out:1309 type:P dur:82000000 cpbdur:82000000 q:21.89 tex:99466 mv:5055 misc:1375 imb:33 pmb:683 smb:634 d:- ref:0 ; in:1310 out:1310 type:P dur:82000000 cpbdur:82000000 q:22.12 tex:67364 mv:5560 misc:1484 imb:165 pmb:1088 smb:97 d:- ref:0 ; in:1311 out:1311 type:P dur:82000000 cpbdur:82000000 q:22.67 tex:74059 mv:5773 misc:1440 imb:234 pmb:1031 smb:85 d:- ref:0 ; in:1312 out:1312 type:P dur:82000000 cpbdur:82000000 q:25.02 tex:162205 mv:11333 misc:1414 imb:364 pmb:985 smb:1 d:- ref:0 ; in:1313 out:1313 type:P dur:82000000 cpbdur:82000000 q:24.78 tex:92432 mv:8050 misc:1430 imb:347 pmb:988 smb:15 d:- ref:0 ; in:1314 out:1314 type:P dur:82000000 cpbdur:82000000 q:24.86 tex:109348 mv:8794 misc:1418 imb:369 pmb:976 smb:5 d:- ref:0 ; in:1315 out:1315 type:P dur:82000000 cpbdur:82000000 q:25.77 tex:141587 mv:11708 misc:1433 imb:374 pmb:918 smb:58 d:- ref:0 ; in:1316 out:1316 type:P dur:82000000 cpbdur:82000000 q:25.25 tex:122066 mv:9086 misc:1424 imb:389 pmb:948 smb:13 d:- ref:0 ; in:1317 out:1317 type:P dur:82000000 cpbdur:82000000 q:25.07 tex:103030 mv:9040 misc:1442 imb:341 pmb:920 smb:89 d:- ref:0 ; in:1318 out:1318 type:P dur:82000000 cpbdur:82000000 q:25.88 tex:139649 mv:12069 misc:1434 imb:534 pmb:777 smb:39 d:- ref:0 ; in:1319 out:1319 type:P dur:82000000 cpbdur:82000000 q:25.83 tex:107676 mv:10022 misc:1446 imb:498 pmb:762 smb:90 d:- ref:0 ; in:1320 out:1320 type:P dur:82000000 cpbdur:82000000 q:25.84 tex:117178 mv:10909 misc:1433 imb:610 pmb:713 smb:27 d:- ref:0 ; in:1321 out:1321 type:P dur:82000000 cpbdur:82000000 q:25.94 tex:126334 mv:14032 misc:1418 imb:687 pmb:660 smb:3 d:- ref:0 ; in:1322 out:1322 type:P dur:82000000 cpbdur:82000000 q:25.81 tex:109502 mv:13082 misc:1424 imb:740 pmb:606 smb:4 d:- ref:0 ; in:1323 out:1323 type:P dur:82000000 cpbdur:82000000 q:25.41 tex:100792 mv:14059 misc:1437 imb:633 pmb:675 smb:42 d:- ref:0 ; in:1324 out:1324 type:P dur:82000000 cpbdur:82000000 q:25.18 tex:88457 mv:15812 misc:1427 imb:811 pmb:526 smb:13 d:- ref:0 ; in:1325 out:1325 type:P dur:82000000 cpbdur:82000000 q:24.75 tex:63282 mv:16726 misc:1416 imb:784 pmb:562 smb:4 d:- ref:0 ; in:1326 out:1326 type:P dur:82000000 cpbdur:82000000 q:24.17 tex:47440 mv:16398 misc:1418 imb:846 pmb:498 smb:6 d:- ref:0 ; in:1327 out:1327 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:41185 mv:16160 misc:1423 imb:671 pmb:672 smb:7 d:- ref:0 ; in:1328 out:1328 type:P dur:82000000 cpbdur:82000000 q:23.29 tex:47564 mv:16417 misc:1435 imb:621 pmb:697 smb:32 d:- ref:0 ; in:1329 out:1329 type:P dur:82000000 cpbdur:82000000 q:23.07 tex:44910 mv:14829 misc:1469 imb:487 pmb:765 smb:98 d:- ref:0 ; in:1330 out:1330 type:P dur:82000000 cpbdur:82000000 q:23.22 tex:52470 mv:15779 misc:1447 imb:628 pmb:629 smb:93 d:- ref:0 ; in:1331 out:1331 type:P dur:82000000 cpbdur:82000000 q:23.57 tex:51318 mv:14542 misc:1444 imb:770 pmb:420 smb:160 d:- ref:0 ; in:1332 out:1332 type:P dur:82000000 cpbdur:82000000 q:23.72 tex:58806 mv:15691 misc:1431 imb:1012 pmb:301 smb:37 d:- ref:0 ; in:1333 out:1333 type:P dur:82000000 cpbdur:82000000 q:23.74 tex:53427 mv:14898 misc:1419 imb:1146 pmb:192 smb:12 d:- ref:0 ; in:1334 out:1334 type:P dur:82000000 cpbdur:82000000 q:23.31 tex:42962 mv:14180 misc:1418 imb:1242 pmb:106 smb:2 d:- ref:0 ; in:1335 out:1335 type:P dur:82000000 cpbdur:82000000 q:22.75 tex:30948 mv:13682 misc:1418 imb:1028 pmb:264 smb:58 d:- ref:0 ; in:1336 out:1336 type:P dur:82000000 cpbdur:82000000 q:22.47 tex:36026 mv:13908 misc:1442 imb:940 pmb:312 smb:98 d:- ref:0 ; in:1337 out:1337 type:P dur:82000000 cpbdur:82000000 q:22.27 tex:35089 mv:14343 misc:1432 imb:850 pmb:351 smb:149 d:- ref:0 ; in:1338 out:1338 type:P dur:82000000 cpbdur:82000000 q:22.55 tex:39584 mv:14494 misc:1434 imb:878 pmb:316 smb:156 d:- ref:0 ; in:1339 out:1339 type:P dur:82000000 cpbdur:82000000 q:22.90 tex:46277 mv:14392 misc:1443 imb:759 pmb:414 smb:177 d:- ref:0 ; in:1340 out:1340 type:P dur:82000000 cpbdur:82000000 q:23.37 tex:56817 mv:16780 misc:1459 imb:648 pmb:568 smb:134 d:- ref:0 ; in:1341 out:1341 type:P dur:82000000 cpbdur:82000000 q:23.40 tex:54189 mv:15645 misc:1446 imb:550 pmb:589 smb:211 d:- ref:0 ; in:1342 out:1342 type:P dur:82000000 cpbdur:82000000 q:23.99 tex:70320 mv:17341 misc:1419 imb:988 pmb:347 smb:15 d:- ref:0 ; in:1343 out:1343 type:P dur:82000000 cpbdur:82000000 q:24.00 tex:64223 mv:17062 misc:1419 imb:960 pmb:358 smb:32 d:- ref:0 ; in:1344 out:1344 type:P dur:82000000 cpbdur:82000000 q:23.90 tex:67681 mv:17031 misc:1424 imb:957 pmb:365 smb:28 d:- ref:0 ; in:1345 out:1345 type:P dur:82000000 cpbdur:82000000 q:23.72 tex:71984 mv:16411 misc:1413 imb:1055 pmb:291 smb:4 d:- ref:0 ; in:1346 out:1346 type:P dur:82000000 cpbdur:82000000 q:24.03 tex:103191 mv:16616 misc:1425 imb:922 pmb:350 smb:78 d:- ref:0 ; in:1347 out:1347 type:P dur:82000000 cpbdur:82000000 q:24.21 tex:90440 mv:15228 misc:1436 imb:507 pmb:608 smb:235 d:- ref:0 ; in:1348 out:1348 type:P dur:82000000 cpbdur:82000000 q:24.46 tex:96706 mv:15482 misc:1444 imb:609 pmb:612 smb:129 d:- ref:0 ; in:1349 out:1349 type:P dur:82000000 cpbdur:82000000 q:24.87 tex:120869 mv:14604 misc:1415 imb:754 pmb:458 smb:138 d:- ref:0 ; in:1350 out:1350 type:P dur:82000000 cpbdur:82000000 q:25.45 tex:156642 mv:15456 misc:1414 imb:744 pmb:514 smb:92 d:- ref:0 ; in:1351 out:1351 type:P dur:82000000 cpbdur:82000000 q:25.82 tex:113920 mv:12953 misc:1423 imb:531 pmb:691 smb:128 d:- ref:0 ; in:1352 out:1352 type:P dur:82000000 cpbdur:82000000 q:26.14 tex:139855 mv:16617 misc:1424 imb:581 pmb:703 smb:66 d:- ref:0 ; in:1353 out:1353 type:P dur:82000000 cpbdur:82000000 q:25.86 tex:102918 mv:11500 misc:1414 imb:359 pmb:818 smb:173 d:- ref:0 ; in:1354 out:1354 type:P dur:82000000 cpbdur:82000000 q:26.23 tex:140475 mv:15874 misc:1427 imb:498 pmb:768 smb:84 d:- ref:0 ; in:1355 out:1355 type:P dur:82000000 cpbdur:82000000 q:25.70 tex:90305 mv:11194 misc:1437 imb:306 pmb:918 smb:126 d:- ref:0 ; in:1356 out:1356 type:P dur:82000000 cpbdur:82000000 q:26.07 tex:143183 mv:16101 misc:1428 imb:467 pmb:845 smb:38 d:- ref:0 ; in:1357 out:1357 type:P dur:82000000 cpbdur:82000000 q:25.53 tex:86375 mv:10674 misc:1447 imb:239 pmb:968 smb:143 d:- ref:0 ; in:1358 out:1358 type:P dur:82000000 cpbdur:82000000 q:26.44 tex:167268 mv:16513 misc:1427 imb:591 pmb:733 smb:26 d:- ref:0 ; in:1359 out:1359 type:P dur:82000000 cpbdur:82000000 q:25.75 tex:85335 mv:10763 misc:1430 imb:277 pmb:963 smb:110 d:- ref:0 ; in:1360 out:1360 type:P dur:82000000 cpbdur:82000000 q:25.54 tex:109465 mv:14991 misc:1424 imb:373 pmb:957 smb:20 d:- ref:0 ; in:1361 out:1361 type:P dur:82000000 cpbdur:82000000 q:23.87 tex:75404 mv:5261 misc:1487 imb:108 pmb:1027 smb:215 d:- ref:0 ; in:1362 out:1362 type:P dur:82000000 cpbdur:82000000 q:23.37 tex:104732 mv:10191 misc:1501 imb:195 pmb:945 smb:210 d:- ref:0 ; in:1363 out:1363 type:P dur:82000000 cpbdur:82000000 q:22.29 tex:91943 mv:4723 misc:1502 imb:48 pmb:981 smb:321 d:- ref:0 ; in:1364 out:1364 type:P dur:82000000 cpbdur:82000000 q:22.24 tex:84886 mv:7062 misc:1428 imb:49 pmb:746 smb:555 d:- ref:0 ; in:1365 out:1365 type:P dur:82000000 cpbdur:82000000 q:24.33 tex:128699 mv:13960 misc:1413 imb:1322 pmb:28 smb:0 d:- ref:0 ; in:1366 out:1366 type:P dur:82000000 cpbdur:82000000 q:24.68 tex:108785 mv:14736 misc:1407 imb:1039 pmb:240 smb:71 d:- ref:0 ; in:1367 out:1367 type:P dur:82000000 cpbdur:82000000 q:24.92 tex:104078 mv:14514 misc:1384 imb:1028 pmb:240 smb:82 d:- ref:0 ; in:1368 out:1368 type:P dur:82000000 cpbdur:82000000 q:24.98 tex:100244 mv:14446 misc:1390 imb:1029 pmb:242 smb:79 d:- ref:0 ; in:1369 out:1369 type:P dur:82000000 cpbdur:82000000 q:25.02 tex:100518 mv:14341 misc:1405 imb:1031 pmb:251 smb:68 d:- ref:0 ; in:1370 out:1370 type:P dur:82000000 cpbdur:82000000 q:24.97 tex:97514 mv:14266 misc:1412 imb:1027 pmb:240 smb:83 d:- ref:0 ; in:1371 out:1371 type:P dur:82000000 cpbdur:82000000 q:25.04 tex:101551 mv:14248 misc:1409 imb:1044 pmb:252 smb:54 d:- ref:0 ; in:1372 out:1372 type:P dur:82000000 cpbdur:82000000 q:25.20 tex:105035 mv:15210 misc:1411 imb:990 pmb:290 smb:70 d:- ref:0 ; in:1373 out:1373 type:P dur:82000000 cpbdur:82000000 q:25.46 tex:116631 mv:14327 misc:1410 imb:1068 pmb:235 smb:47 d:- ref:0 ; in:1374 out:1374 type:P dur:82000000 cpbdur:82000000 q:25.54 tex:98655 mv:14721 misc:1400 imb:1005 pmb:275 smb:70 d:- ref:0 ; in:1375 out:1375 type:P dur:82000000 cpbdur:82000000 q:25.73 tex:106846 mv:14325 misc:1397 imb:982 pmb:297 smb:71 d:- ref:0 ; in:1376 out:1376 type:P dur:82000000 cpbdur:82000000 q:25.96 tex:113942 mv:14777 misc:1409 imb:917 pmb:339 smb:94 d:- ref:0 ; in:1377 out:1377 type:P dur:82000000 cpbdur:82000000 q:26.26 tex:128273 mv:14959 misc:1400 imb:928 pmb:333 smb:89 d:- ref:0 ; in:1378 out:1378 type:P dur:82000000 cpbdur:82000000 q:26.41 tex:126919 mv:15864 misc:1409 imb:881 pmb:366 smb:103 d:- ref:0 ; in:1379 out:1379 type:P dur:82000000 cpbdur:82000000 q:26.59 tex:125942 mv:15335 misc:1419 imb:910 pmb:369 smb:71 d:- ref:0 ; in:1380 out:1380 type:P dur:82000000 cpbdur:82000000 q:26.87 tex:140582 mv:16208 misc:1426 imb:909 pmb:384 smb:57 d:- ref:0 ; in:1381 out:1381 type:P dur:82000000 cpbdur:82000000 q:27.03 tex:146111 mv:15773 misc:1420 imb:877 pmb:405 smb:68 d:- ref:0 ; in:1382 out:1382 type:P dur:82000000 cpbdur:82000000 q:27.06 tex:143089 mv:15541 misc:1434 imb:849 pmb:417 smb:84 d:- ref:0 ; in:1383 out:1383 type:P dur:82000000 cpbdur:82000000 q:27.67 tex:175882 mv:16654 misc:1424 imb:916 pmb:376 smb:58 d:- ref:0 ; in:1384 out:1384 type:P dur:82000000 cpbdur:82000000 q:28.32 tex:217719 mv:18793 misc:1432 imb:872 pmb:451 smb:27 d:- ref:0 ; in:1385 out:1385 type:P dur:82000000 cpbdur:82000000 q:28.61 tex:178939 mv:18950 misc:1423 imb:802 pmb:520 smb:28 d:- ref:0 ; in:1386 out:1386 type:P dur:82000000 cpbdur:82000000 q:28.32 tex:167382 mv:18372 misc:1438 imb:609 pmb:658 smb:83 d:- ref:0 ; in:1387 out:1387 type:P dur:82000000 cpbdur:82000000 q:28.24 tex:170180 mv:17649 misc:1427 imb:665 pmb:573 smb:112 d:- ref:0 ; in:1388 out:1388 type:P dur:82000000 cpbdur:82000000 q:28.55 tex:182795 mv:16283 misc:1426 imb:1098 pmb:235 smb:17 d:- ref:0 ; in:1389 out:1389 type:P dur:82000000 cpbdur:82000000 q:28.66 tex:170323 mv:14915 misc:1418 imb:1243 pmb:107 smb:0 d:- ref:0 ; in:1390 out:1390 type:P dur:82000000 cpbdur:82000000 q:27.79 tex:116780 mv:15621 misc:1455 imb:404 pmb:721 smb:225 d:- ref:0 ; in:1391 out:1391 type:P dur:82000000 cpbdur:82000000 q:27.28 tex:128925 mv:14136 misc:1435 imb:398 pmb:678 smb:274 d:- ref:0 ; in:1392 out:1392 type:P dur:82000000 cpbdur:82000000 q:26.91 tex:108318 mv:8803 misc:1335 imb:350 pmb:477 smb:523 d:- ref:0 ; in:1393 out:1393 type:P dur:82000000 cpbdur:82000000 q:27.34 tex:164044 mv:14552 misc:1420 imb:552 pmb:566 smb:232 d:- ref:0 ; in:1394 out:1394 type:P dur:82000000 cpbdur:82000000 q:25.87 tex:59930 mv:4295 misc:1295 imb:121 pmb:493 smb:736 d:- ref:0 ; in:1395 out:1395 type:P dur:82000000 cpbdur:82000000 q:28.00 tex:221080 mv:15231 misc:1425 imb:1043 pmb:279 smb:28 d:- ref:0 ; in:1396 out:1396 type:P dur:82000000 cpbdur:82000000 q:26.07 tex:58732 mv:2961 misc:1339 imb:17 pmb:569 smb:764 d:- ref:0 ; in:1397 out:1397 type:P dur:82000000 cpbdur:82000000 q:27.99 tex:221609 mv:14963 misc:1420 imb:1152 pmb:159 smb:39 d:- ref:0 ; in:1398 out:1398 type:P dur:82000000 cpbdur:82000000 q:26.63 tex:77508 mv:6802 misc:1410 imb:259 pmb:552 smb:539 d:- ref:0 ; in:1399 out:1399 type:P dur:82000000 cpbdur:82000000 q:27.69 tex:185540 mv:16103 misc:1437 imb:906 pmb:349 smb:95 d:- ref:0 ; in:1400 out:1400 type:P dur:82000000 cpbdur:82000000 q:25.90 tex:51571 mv:5858 misc:1387 imb:148 pmb:534 smb:668 d:- ref:0 ; in:1401 out:1401 type:P dur:82000000 cpbdur:82000000 q:27.32 tex:195465 mv:16623 misc:1448 imb:810 pmb:439 smb:101 d:- ref:0 ; in:1402 out:1402 type:P dur:82000000 cpbdur:82000000 q:27.09 tex:134656 mv:15166 misc:1458 imb:465 pmb:638 smb:247 d:- ref:0 ; in:1403 out:1403 type:P dur:82000000 cpbdur:82000000 q:26.94 tex:127688 mv:14378 misc:1422 imb:319 pmb:676 smb:355 d:- ref:0 ; in:1404 out:1404 type:P dur:82000000 cpbdur:82000000 q:26.84 tex:126304 mv:13679 misc:1409 imb:336 pmb:613 smb:401 d:- ref:0 ; in:1405 out:1405 type:P dur:82000000 cpbdur:82000000 q:26.56 tex:116025 mv:11895 misc:1384 imb:230 pmb:655 smb:465 d:- ref:0 ; in:1406 out:1406 type:P dur:82000000 cpbdur:82000000 q:26.04 tex:111105 mv:11183 misc:1400 imb:159 pmb:741 smb:450 d:- ref:0 ; in:1407 out:1407 type:P dur:82000000 cpbdur:82000000 q:24.14 tex:66202 mv:5082 misc:1532 imb:120 pmb:806 smb:424 d:- ref:0 ; in:1408 out:1408 type:P dur:82000000 cpbdur:82000000 q:25.06 tex:135754 mv:11061 misc:1369 imb:118 pmb:743 smb:489 d:- ref:0 ; in:1409 out:1409 type:P dur:82000000 cpbdur:82000000 q:23.56 tex:52360 mv:3968 misc:1448 imb:44 pmb:670 smb:636 d:- ref:0 ; in:1410 out:1410 type:P dur:82000000 cpbdur:82000000 q:26.26 tex:174846 mv:12519 misc:1315 imb:448 pmb:455 smb:447 d:- ref:0 ; in:1411 out:1411 type:P dur:82000000 cpbdur:82000000 q:27.95 tex:243588 mv:15922 misc:1418 imb:1174 pmb:176 smb:0 d:- ref:0 ; in:1412 out:1412 type:P dur:82000000 cpbdur:82000000 q:26.42 tex:89261 mv:6103 misc:1340 imb:44 pmb:705 smb:601 d:- ref:0 ; in:1413 out:1413 type:P dur:82000000 cpbdur:82000000 q:26.67 tex:158031 mv:13600 misc:1361 imb:351 pmb:598 smb:401 d:- ref:0 ; in:1414 out:1414 type:P dur:82000000 cpbdur:82000000 q:26.73 tex:141185 mv:14859 misc:1404 imb:308 pmb:677 smb:365 d:- ref:0 ; in:1415 out:1415 type:P dur:82000000 cpbdur:82000000 q:26.70 tex:141829 mv:14547 misc:1456 imb:378 pmb:655 smb:317 d:- ref:0 ; in:1416 out:1416 type:P dur:82000000 cpbdur:82000000 q:25.20 tex:86020 mv:6434 misc:1514 imb:246 pmb:722 smb:382 d:- ref:0 ; in:1417 out:1417 type:P dur:82000000 cpbdur:82000000 q:26.17 tex:163324 mv:14427 misc:1401 imb:391 pmb:629 smb:330 d:- ref:0 ; in:1418 out:1418 type:P dur:82000000 cpbdur:82000000 q:24.51 tex:66647 mv:5427 misc:1486 imb:208 pmb:639 smb:503 d:- ref:0 ; in:1419 out:1419 type:P dur:82000000 cpbdur:82000000 q:26.63 tex:178564 mv:13337 misc:1347 imb:813 pmb:277 smb:260 d:- ref:0 ; in:1420 out:1420 type:P dur:82000000 cpbdur:82000000 q:27.55 tex:167344 mv:11317 misc:1347 imb:631 pmb:261 smb:458 d:- ref:0 ; in:1421 out:1421 type:P dur:82000000 cpbdur:82000000 q:27.97 tex:159939 mv:14250 misc:1395 imb:787 pmb:332 smb:231 d:- ref:0 ; in:1422 out:1422 type:P dur:82000000 cpbdur:82000000 q:27.58 tex:102848 mv:11494 misc:1378 imb:652 pmb:282 smb:416 d:- ref:0 ; in:1423 out:1423 type:P dur:82000000 cpbdur:82000000 q:27.32 tex:120557 mv:9678 misc:1349 imb:416 pmb:338 smb:596 d:- ref:0 ; in:1424 out:1424 type:P dur:82000000 cpbdur:82000000 q:27.41 tex:124774 mv:13681 misc:1409 imb:956 pmb:229 smb:165 d:- ref:0 ; in:1425 out:1425 type:P dur:82000000 cpbdur:82000000 q:26.82 tex:96578 mv:12019 misc:1427 imb:848 pmb:261 smb:241 d:- ref:0 ; in:1426 out:1426 type:P dur:82000000 cpbdur:82000000 q:26.80 tex:91481 mv:12381 misc:1402 imb:799 pmb:269 smb:282 d:- ref:0 ; in:1427 out:1427 type:P dur:82000000 cpbdur:82000000 q:25.97 tex:78794 mv:10712 misc:1374 imb:715 pmb:278 smb:357 d:- ref:0 ; in:1428 out:1428 type:P dur:82000000 cpbdur:82000000 q:24.15 tex:36072 mv:6500 misc:1428 imb:352 pmb:414 smb:584 d:- ref:0 ; in:1429 out:1429 type:P dur:82000000 cpbdur:82000000 q:24.37 tex:91054 mv:9357 misc:1397 imb:338 pmb:413 smb:599 d:- ref:0 ; in:1430 out:1430 type:P dur:82000000 cpbdur:82000000 q:22.94 tex:36817 mv:6878 misc:1489 imb:385 pmb:444 smb:521 d:- ref:0 ; in:1431 out:1431 type:P dur:82000000 cpbdur:82000000 q:24.14 tex:96769 mv:8294 misc:1257 imb:255 pmb:372 smb:723 d:- ref:0 ; in:1432 out:1432 type:P dur:82000000 cpbdur:82000000 q:23.25 tex:44767 mv:7906 misc:1495 imb:407 pmb:470 smb:473 d:- ref:0 ; in:1433 out:1433 type:P dur:82000000 cpbdur:82000000 q:24.55 tex:100766 mv:7110 misc:1252 imb:294 pmb:298 smb:758 d:- ref:0 ; in:1434 out:1434 type:P dur:82000000 cpbdur:82000000 q:25.41 tex:117099 mv:8954 misc:1331 imb:418 pmb:344 smb:588 d:- ref:0 ; in:1435 out:1435 type:P dur:82000000 cpbdur:82000000 q:24.33 tex:34665 mv:6053 misc:1370 imb:229 pmb:365 smb:756 d:- ref:0 ; in:1436 out:1436 type:P dur:82000000 cpbdur:82000000 q:25.00 tex:104948 mv:9599 misc:1397 imb:494 pmb:361 smb:495 d:- ref:0 ; in:1437 out:1437 type:P dur:82000000 cpbdur:82000000 q:25.31 tex:112315 mv:9968 misc:1277 imb:320 pmb:420 smb:610 d:- ref:0 ; in:1438 out:1438 type:P dur:82000000 cpbdur:82000000 q:25.44 tex:125845 mv:11079 misc:1324 imb:417 pmb:417 smb:516 d:- ref:0 ; in:1439 out:1439 type:P dur:82000000 cpbdur:82000000 q:25.56 tex:107536 mv:10034 misc:1286 imb:367 pmb:394 smb:589 d:- ref:0 ; in:1440 out:1440 type:P dur:82000000 cpbdur:82000000 q:25.22 tex:106060 mv:9962 misc:1394 imb:305 pmb:498 smb:547 d:- ref:0 ; in:1441 out:1441 type:P dur:82000000 cpbdur:82000000 q:24.54 tex:71660 mv:8254 misc:1342 imb:315 pmb:414 smb:621 d:- ref:0 ; in:1442 out:1442 type:P dur:82000000 cpbdur:82000000 q:25.20 tex:126462 mv:11197 misc:1397 imb:431 pmb:455 smb:464 d:- ref:0 ; in:1443 out:1443 type:P dur:82000000 cpbdur:82000000 q:24.47 tex:72557 mv:8009 misc:1370 imb:286 pmb:467 smb:597 d:- ref:0 ; in:1444 out:1444 type:P dur:82000000 cpbdur:82000000 q:25.05 tex:140733 mv:11003 misc:1392 imb:588 pmb:335 smb:427 d:- ref:0 ; in:1445 out:1445 type:P dur:82000000 cpbdur:82000000 q:24.20 tex:75767 mv:8241 misc:1432 imb:395 pmb:399 smb:556 d:- ref:0 ; in:1446 out:1446 type:P dur:82000000 cpbdur:82000000 q:24.91 tex:121260 mv:10340 misc:1400 imb:553 pmb:316 smb:481 d:- ref:0 ; in:1447 out:1447 type:P dur:82000000 cpbdur:82000000 q:23.80 tex:65489 mv:8906 misc:1453 imb:570 pmb:308 smb:472 d:- ref:0 ; in:1448 out:1448 type:P dur:82000000 cpbdur:82000000 q:23.57 tex:83383 mv:9458 misc:1391 imb:400 pmb:414 smb:536 d:- ref:0 ; in:1449 out:1449 type:P dur:82000000 cpbdur:82000000 q:22.59 tex:63793 mv:8822 misc:1505 imb:408 pmb:510 smb:432 d:- ref:0 ; in:1450 out:1450 type:P dur:82000000 cpbdur:82000000 q:22.53 tex:75560 mv:8282 misc:1406 imb:319 pmb:472 smb:559 d:- ref:0 ; in:1451 out:1451 type:P dur:82000000 cpbdur:82000000 q:21.95 tex:71802 mv:8740 misc:1474 imb:345 pmb:528 smb:477 d:- ref:0 ; in:1452 out:1452 type:P dur:82000000 cpbdur:82000000 q:25.95 tex:195031 mv:14714 misc:1415 imb:1278 pmb:72 smb:0 d:- ref:0 ; in:1453 out:1453 type:P dur:82000000 cpbdur:82000000 q:25.32 tex:63970 mv:6825 misc:1413 imb:134 pmb:645 smb:571 d:- ref:0 ; in:1454 out:1454 type:P dur:82000000 cpbdur:82000000 q:25.30 tex:104496 mv:10373 misc:1403 imb:239 pmb:697 smb:414 d:- ref:0 ; in:1455 out:1455 type:P dur:82000000 cpbdur:82000000 q:24.69 tex:69059 mv:9509 misc:1488 imb:326 pmb:703 smb:321 d:- ref:0 ; in:1456 out:1456 type:P dur:82000000 cpbdur:82000000 q:25.07 tex:110575 mv:11595 misc:1462 imb:393 pmb:651 smb:306 d:- ref:0 ; in:1457 out:1457 type:P dur:82000000 cpbdur:82000000 q:24.54 tex:73864 mv:9385 misc:1447 imb:298 pmb:599 smb:453 d:- ref:0 ; in:1458 out:1458 type:P dur:82000000 cpbdur:82000000 q:25.77 tex:125906 mv:14102 misc:1488 imb:596 pmb:556 smb:198 d:- ref:0 ; in:1459 out:1459 type:P dur:82000000 cpbdur:82000000 q:27.00 tex:163536 mv:15683 misc:1445 imb:655 pmb:511 smb:184 d:- ref:0 ; in:1460 out:1460 type:P dur:82000000 cpbdur:82000000 q:26.56 tex:102403 mv:11376 misc:1437 imb:663 pmb:466 smb:221 d:- ref:0 ; in:1461 out:1461 type:P dur:82000000 cpbdur:82000000 q:27.67 tex:182898 mv:15798 misc:1424 imb:800 pmb:398 smb:152 d:- ref:0 ; in:1462 out:1462 type:P dur:82000000 cpbdur:82000000 q:27.99 tex:172992 mv:14541 misc:1419 imb:803 pmb:375 smb:172 d:- ref:0 ; in:1463 out:1463 type:P dur:82000000 cpbdur:82000000 q:26.99 tex:111181 mv:8786 misc:1369 imb:494 pmb:462 smb:394 d:- ref:0 ; in:1464 out:1464 type:P dur:82000000 cpbdur:82000000 q:27.73 tex:181242 mv:14137 misc:1405 imb:876 pmb:289 smb:185 d:- ref:0 ; in:1465 out:1465 type:P dur:82000000 cpbdur:82000000 q:28.39 tex:231457 mv:15874 misc:1421 imb:1116 pmb:196 smb:38 d:- ref:0 ; in:1466 out:1466 type:P dur:82000000 cpbdur:82000000 q:26.67 tex:65435 mv:5883 misc:1378 imb:135 pmb:569 smb:646 d:- ref:0 ; in:1467 out:1467 type:P dur:82000000 cpbdur:82000000 q:28.10 tex:226862 mv:17122 misc:1424 imb:1067 pmb:272 smb:11 d:- ref:0 ; in:1468 out:1468 type:P dur:82000000 cpbdur:82000000 q:26.39 tex:57443 mv:6431 misc:1438 imb:145 pmb:551 smb:654 d:- ref:0 ; in:1469 out:1469 type:P dur:82000000 cpbdur:82000000 q:27.99 tex:228573 mv:17047 misc:1428 imb:934 pmb:337 smb:79 d:- ref:0 ; in:1470 out:1470 type:P dur:82000000 cpbdur:82000000 q:26.80 tex:94094 mv:8816 misc:1442 imb:328 pmb:648 smb:374 d:- ref:0 ; in:1471 out:1471 type:P dur:82000000 cpbdur:82000000 q:27.45 tex:175809 mv:14987 misc:1428 imb:480 pmb:645 smb:225 d:- ref:0 ; in:1472 out:1472 type:P dur:82000000 cpbdur:82000000 q:25.77 tex:57947 mv:5599 misc:1430 imb:109 pmb:669 smb:572 d:- ref:0 ; in:1473 out:1473 type:P dur:82000000 cpbdur:82000000 q:26.28 tex:143371 mv:12775 misc:1438 imb:234 pmb:759 smb:357 d:- ref:0 ; in:1474 out:1474 type:P dur:82000000 cpbdur:82000000 q:24.96 tex:88584 mv:6612 misc:1460 imb:103 pmb:812 smb:435 d:- ref:0 ; in:1475 out:1475 type:P dur:82000000 cpbdur:82000000 q:25.41 tex:135209 mv:11387 misc:1468 imb:178 pmb:799 smb:373 d:- ref:0 ; in:1476 out:1476 type:P dur:82000000 cpbdur:82000000 q:26.88 tex:156113 mv:14784 misc:1423 imb:1211 pmb:134 smb:5 d:- ref:0 ; in:1477 out:1477 type:P dur:82000000 cpbdur:82000000 q:26.13 tex:88428 mv:7540 misc:1184 imb:272 pmb:358 smb:720 d:- ref:0 ; in:1478 out:1478 type:P dur:82000000 cpbdur:82000000 q:25.32 tex:87431 mv:8065 misc:1296 imb:236 pmb:527 smb:587 d:- ref:0 ; in:1479 out:1479 type:P dur:82000000 cpbdur:82000000 q:25.19 tex:87983 mv:7262 misc:1251 imb:212 pmb:444 smb:694 d:- ref:0 ; in:1480 out:1480 type:P dur:82000000 cpbdur:82000000 q:25.24 tex:95268 mv:7829 misc:1279 imb:300 pmb:389 smb:661 d:- ref:0 ; in:1481 out:1481 type:P dur:82000000 cpbdur:82000000 q:24.90 tex:82599 mv:7045 misc:1196 imb:267 pmb:369 smb:714 d:- ref:0 ; in:1482 out:1482 type:P dur:82000000 cpbdur:82000000 q:25.08 tex:112788 mv:8016 misc:1228 imb:316 pmb:350 smb:684 d:- ref:0 ; in:1483 out:1483 type:P dur:82000000 cpbdur:82000000 q:25.34 tex:105264 mv:8408 misc:1264 imb:292 pmb:406 smb:652 d:- ref:0 ; in:1484 out:1484 type:P dur:82000000 cpbdur:82000000 q:25.31 tex:104522 mv:8223 misc:1255 imb:309 pmb:399 smb:642 d:- ref:0 ; in:1485 out:1485 type:P dur:82000000 cpbdur:82000000 q:25.16 tex:90315 mv:8337 misc:1300 imb:257 pmb:467 smb:626 d:- ref:0 ; in:1486 out:1486 type:P dur:82000000 cpbdur:82000000 q:25.71 tex:111906 mv:7975 misc:1199 imb:297 pmb:345 smb:708 d:- ref:0 ; in:1487 out:1487 type:P dur:82000000 cpbdur:82000000 q:25.94 tex:108048 mv:8622 misc:1218 imb:281 pmb:400 smb:669 d:- ref:0 ; in:1488 out:1488 type:P dur:82000000 cpbdur:82000000 q:26.23 tex:119504 mv:9825 misc:1255 imb:293 pmb:447 smb:610 d:- ref:0 ; in:1489 out:1489 type:P dur:82000000 cpbdur:82000000 q:26.89 tex:145043 mv:8827 misc:1274 imb:447 pmb:291 smb:612 d:- ref:0 ; in:1490 out:1490 type:P dur:82000000 cpbdur:82000000 q:27.99 tex:188236 mv:13847 misc:1357 imb:793 pmb:305 smb:252 d:- ref:0 ; in:1491 out:1491 type:P dur:82000000 cpbdur:82000000 q:28.49 tex:207232 mv:15681 misc:1447 imb:826 pmb:373 smb:151 d:- ref:0 ; in:1492 out:1492 type:P dur:82000000 cpbdur:82000000 q:28.16 tex:157497 mv:14385 misc:1454 imb:568 pmb:479 smb:303 d:- ref:0 ; in:1493 out:1493 type:P dur:82000000 cpbdur:82000000 q:27.91 tex:145500 mv:13022 misc:1374 imb:420 pmb:500 smb:430 d:- ref:0 ; in:1494 out:1494 type:P dur:82000000 cpbdur:82000000 q:27.59 tex:128411 mv:11551 misc:1350 imb:361 pmb:477 smb:512 d:- ref:0 ; in:1495 out:1495 type:P dur:82000000 cpbdur:82000000 q:27.41 tex:139309 mv:10968 misc:1347 imb:360 pmb:494 smb:496 d:- ref:0 ; in:1496 out:1496 type:P dur:82000000 cpbdur:82000000 q:27.70 tex:173310 mv:11544 misc:1378 imb:631 pmb:328 smb:391 d:- ref:0 ; in:1497 out:1497 type:P dur:82000000 cpbdur:82000000 q:27.42 tex:151264 mv:12675 misc:1397 imb:394 pmb:543 smb:413 d:- ref:0 ; in:1498 out:1498 type:P dur:82000000 cpbdur:82000000 q:26.82 tex:121671 mv:10774 misc:1387 imb:325 pmb:546 smb:479 d:- ref:0 ; in:1499 out:1499 type:P dur:82000000 cpbdur:82000000 q:26.77 tex:133042 mv:11550 misc:1376 imb:329 pmb:564 smb:457 d:- ref:0 ; in:1500 out:1500 type:I dur:82000000 cpbdur:82000000 q:23.63 tex:287413 mv:12772 misc:367 imb:1350 pmb:0 smb:0 d:- ref:; in:1501 out:1501 type:P dur:82000000 cpbdur:82000000 q:28.91 tex:235030 mv:13659 misc:1407 imb:740 pmb:347 smb:263 d:- ref:0 ; in:1502 out:1502 type:P dur:82000000 cpbdur:82000000 q:29.34 tex:252162 mv:15836 misc:1434 imb:856 pmb:362 smb:132 d:- ref:0 ; in:1503 out:1503 type:P dur:82000000 cpbdur:82000000 q:28.13 tex:107618 mv:12614 misc:1416 imb:1268 pmb:82 smb:0 d:- ref:0 ; in:1504 out:1504 type:P dur:82000000 cpbdur:82000000 q:27.31 tex:111915 mv:11748 misc:1161 imb:606 pmb:274 smb:470 d:- ref:0 ; in:1505 out:1505 type:P dur:82000000 cpbdur:82000000 q:27.71 tex:162732 mv:15654 misc:1438 imb:893 pmb:364 smb:93 d:- ref:0 ; in:1506 out:1506 type:P dur:82000000 cpbdur:82000000 q:26.88 tex:103154 mv:12912 misc:1406 imb:165 pmb:842 smb:343 d:- ref:0 ; in:1507 out:1507 type:P dur:82000000 cpbdur:82000000 q:26.24 tex:111672 mv:13728 misc:1392 imb:176 pmb:872 smb:302 d:- ref:0 ; in:1508 out:1508 type:P dur:82000000 cpbdur:82000000 q:26.05 tex:117116 mv:14315 misc:1401 imb:204 pmb:897 smb:249 d:- ref:0 ; in:1509 out:1509 type:P dur:82000000 cpbdur:82000000 q:26.07 tex:125989 mv:14040 misc:1395 imb:235 pmb:860 smb:255 d:- ref:0 ; in:1510 out:1510 type:P dur:82000000 cpbdur:82000000 q:25.99 tex:125338 mv:13826 misc:1396 imb:212 pmb:822 smb:316 d:- ref:0 ; in:1511 out:1511 type:P dur:82000000 cpbdur:82000000 q:25.97 tex:129553 mv:12652 misc:1379 imb:203 pmb:798 smb:349 d:- ref:0 ; in:1512 out:1512 type:P dur:82000000 cpbdur:82000000 q:26.97 tex:186876 mv:13863 misc:1421 imb:1291 pmb:59 smb:0 d:- ref:0 ; in:1513 out:1513 type:P dur:82000000 cpbdur:82000000 q:26.02 tex:86694 mv:11942 misc:1340 imb:262 pmb:594 smb:494 d:- ref:0 ; in:1514 out:1514 type:P dur:82000000 cpbdur:82000000 q:25.42 tex:97710 mv:11893 misc:1421 imb:360 pmb:579 smb:411 d:- ref:0 ; in:1515 out:1515 type:P dur:82000000 cpbdur:82000000 q:25.39 tex:107260 mv:13614 misc:1406 imb:424 pmb:604 smb:322 d:- ref:0 ; in:1516 out:1516 type:P dur:82000000 cpbdur:82000000 q:25.13 tex:93057 mv:13966 misc:1441 imb:301 pmb:690 smb:359 d:- ref:0 ; in:1517 out:1517 type:P dur:82000000 cpbdur:82000000 q:25.20 tex:114706 mv:14280 misc:1406 imb:339 pmb:676 smb:335 d:- ref:0 ; in:1518 out:1518 type:P dur:82000000 cpbdur:82000000 q:24.90 tex:95393 mv:12466 misc:1381 imb:238 pmb:650 smb:462 d:- ref:0 ; in:1519 out:1519 type:P dur:82000000 cpbdur:82000000 q:24.84 tex:102385 mv:12020 misc:1371 imb:297 pmb:614 smb:439 d:- ref:0 ; in:1520 out:1520 type:P dur:82000000 cpbdur:82000000 q:24.66 tex:95363 mv:11037 misc:1368 imb:217 pmb:589 smb:544 d:- ref:0 ; in:1521 out:1521 type:P dur:82000000 cpbdur:82000000 q:24.94 tex:112018 mv:11073 misc:1357 imb:298 pmb:519 smb:533 d:- ref:0 ; in:1522 out:1522 type:P dur:82000000 cpbdur:82000000 q:24.80 tex:99771 mv:10682 misc:1347 imb:289 pmb:494 smb:567 d:- ref:0 ; in:1523 out:1523 type:P dur:82000000 cpbdur:82000000 q:25.06 tex:123100 mv:11621 misc:1351 imb:407 pmb:475 smb:468 d:- ref:0 ; in:1524 out:1524 type:P dur:82000000 cpbdur:82000000 q:25.72 tex:126212 mv:11566 misc:1358 imb:461 pmb:434 smb:455 d:- ref:0 ; in:1525 out:1525 type:P dur:82000000 cpbdur:82000000 q:25.67 tex:107217 mv:11971 misc:1380 imb:391 pmb:525 smb:434 d:- ref:0 ; in:1526 out:1526 type:P dur:82000000 cpbdur:82000000 q:26.30 tex:150469 mv:12093 misc:1366 imb:358 pmb:525 smb:467 d:- ref:0 ; in:1527 out:1527 type:P dur:82000000 cpbdur:82000000 q:26.52 tex:131512 mv:11092 misc:1324 imb:646 pmb:276 smb:428 d:- ref:0 ; in:1528 out:1528 type:P dur:82000000 cpbdur:82000000 q:26.85 tex:144936 mv:11593 misc:1391 imb:460 pmb:419 smb:471 d:- ref:0 ; in:1529 out:1529 type:P dur:82000000 cpbdur:82000000 q:26.72 tex:131407 mv:12316 misc:1333 imb:381 pmb:478 smb:491 d:- ref:0 ; in:1530 out:1530 type:P dur:82000000 cpbdur:82000000 q:27.07 tex:154477 mv:14600 misc:1411 imb:499 pmb:522 smb:329 d:- ref:0 ; in:1531 out:1531 type:P dur:82000000 cpbdur:82000000 q:28.18 tex:207682 mv:14641 misc:1349 imb:729 pmb:349 smb:272 d:- ref:0 ; in:1532 out:1532 type:P dur:82000000 cpbdur:82000000 q:28.46 tex:201710 mv:17285 misc:1397 imb:525 pmb:601 smb:224 d:- ref:0 ; in:1533 out:1533 type:P dur:82000000 cpbdur:82000000 q:27.77 tex:131009 mv:16002 misc:1429 imb:330 pmb:770 smb:250 d:- ref:0 ; in:1534 out:1534 type:P dur:82000000 cpbdur:82000000 q:27.25 tex:137607 mv:15440 misc:1473 imb:271 pmb:810 smb:269 d:- ref:0 ; in:1535 out:1535 type:P dur:82000000 cpbdur:82000000 q:26.89 tex:125849 mv:14813 misc:1450 imb:219 pmb:807 smb:324 d:- ref:0 ; in:1536 out:1536 type:P dur:82000000 cpbdur:82000000 q:26.79 tex:131987 mv:14208 misc:1445 imb:222 pmb:798 smb:330 d:- ref:0 ; in:1537 out:1537 type:P dur:82000000 cpbdur:82000000 q:26.66 tex:129669 mv:13382 misc:1429 imb:141 pmb:810 smb:399 d:- ref:0 ; in:1538 out:1538 type:P dur:82000000 cpbdur:82000000 q:26.32 tex:132711 mv:12674 misc:1447 imb:180 pmb:812 smb:358 d:- ref:0 ; in:1539 out:1539 type:P dur:82000000 cpbdur:82000000 q:26.01 tex:118987 mv:12699 misc:1442 imb:160 pmb:813 smb:377 d:- ref:0 ; in:1540 out:1540 type:P dur:82000000 cpbdur:82000000 q:26.19 tex:140437 mv:13636 misc:1463 imb:189 pmb:806 smb:355 d:- ref:0 ; in:1541 out:1541 type:P dur:82000000 cpbdur:82000000 q:25.71 tex:110355 mv:10140 misc:1401 imb:107 pmb:792 smb:451 d:- ref:0 ; in:1542 out:1542 type:P dur:82000000 cpbdur:82000000 q:25.41 tex:127928 mv:11645 misc:1475 imb:195 pmb:843 smb:312 d:- ref:0 ; in:1543 out:1543 type:P dur:82000000 cpbdur:82000000 q:25.17 tex:118495 mv:10576 misc:1441 imb:118 pmb:818 smb:414 d:- ref:0 ; in:1544 out:1544 type:P dur:82000000 cpbdur:82000000 q:25.13 tex:123729 mv:11059 misc:1436 imb:135 pmb:819 smb:396 d:- ref:0 ; in:1545 out:1545 type:P dur:82000000 cpbdur:82000000 q:25.10 tex:118584 mv:10900 misc:1444 imb:106 pmb:812 smb:432 d:- ref:0 ; in:1546 out:1546 type:P dur:82000000 cpbdur:82000000 q:27.87 tex:209907 mv:15420 misc:1417 imb:1162 pmb:188 smb:0 d:- ref:0 ; in:1547 out:1547 type:P dur:82000000 cpbdur:82000000 q:27.17 tex:110993 mv:10914 misc:1373 imb:181 pmb:656 smb:513 d:- ref:0 ; in:1548 out:1548 type:P dur:82000000 cpbdur:82000000 q:25.94 tex:63781 mv:7223 misc:1420 imb:137 pmb:653 smb:560 d:- ref:0 ; in:1549 out:1549 type:P dur:82000000 cpbdur:82000000 q:26.67 tex:134894 mv:11203 misc:1343 imb:221 pmb:627 smb:502 d:- ref:0 ; in:1550 out:1550 type:P dur:82000000 cpbdur:82000000 q:26.75 tex:124151 mv:12962 misc:1415 imb:349 pmb:692 smb:309 d:- ref:0 ; in:1551 out:1551 type:P dur:82000000 cpbdur:82000000 q:26.79 tex:126861 mv:11807 misc:1412 imb:244 pmb:677 smb:429 d:- ref:0 ; in:1552 out:1552 type:P dur:82000000 cpbdur:82000000 q:26.98 tex:133196 mv:12603 misc:1417 imb:297 pmb:655 smb:398 d:- ref:0 ; in:1553 out:1553 type:P dur:82000000 cpbdur:82000000 q:27.47 tex:165131 mv:13247 misc:1446 imb:469 pmb:537 smb:344 d:- ref:0 ; in:1554 out:1554 type:P dur:82000000 cpbdur:82000000 q:27.56 tex:139177 mv:15884 misc:1435 imb:665 pmb:634 smb:51 d:- ref:0 ; in:1555 out:1555 type:P dur:82000000 cpbdur:82000000 q:27.65 tex:142991 mv:17224 misc:1425 imb:710 pmb:620 smb:20 d:- ref:0 ; in:1556 out:1556 type:P dur:82000000 cpbdur:82000000 q:28.10 tex:157911 mv:17650 misc:1431 imb:761 pmb:560 smb:29 d:- ref:0 ; in:1557 out:1557 type:P dur:82000000 cpbdur:82000000 q:28.49 tex:177264 mv:18386 misc:1422 imb:723 pmb:604 smb:23 d:- ref:0 ; in:1558 out:1558 type:P dur:82000000 cpbdur:82000000 q:28.48 tex:164753 mv:18529 misc:1430 imb:711 pmb:611 smb:28 d:- ref:0 ; in:1559 out:1559 type:P dur:82000000 cpbdur:82000000 q:28.45 tex:159292 mv:18544 misc:1428 imb:577 pmb:702 smb:71 d:- ref:0 ; in:1560 out:1560 type:P dur:82000000 cpbdur:82000000 q:28.71 tex:170987 mv:18579 misc:1426 imb:687 pmb:621 smb:42 d:- ref:0 ; in:1561 out:1561 type:P dur:82000000 cpbdur:82000000 q:28.75 tex:156845 mv:18652 misc:1431 imb:532 pmb:742 smb:76 d:- ref:0 ; in:1562 out:1562 type:P dur:82000000 cpbdur:82000000 q:28.58 tex:144247 mv:18608 misc:1433 imb:480 pmb:790 smb:80 d:- ref:0 ; in:1563 out:1563 type:P dur:82000000 cpbdur:82000000 q:28.32 tex:160066 mv:17294 misc:1440 imb:396 pmb:856 smb:98 d:- ref:0 ; in:1564 out:1564 type:P dur:82000000 cpbdur:82000000 q:28.29 tex:162301 mv:17234 misc:1433 imb:360 pmb:876 smb:114 d:- ref:0 ; in:1565 out:1565 type:P dur:82000000 cpbdur:82000000 q:28.91 tex:198689 mv:17767 misc:1432 imb:666 pmb:661 smb:23 d:- ref:0 ; in:1566 out:1566 type:P dur:82000000 cpbdur:82000000 q:29.34 tex:208555 mv:18048 misc:1437 imb:643 pmb:660 smb:47 d:- ref:0 ; in:1567 out:1567 type:P dur:82000000 cpbdur:82000000 q:29.84 tex:222504 mv:18372 misc:1444 imb:708 pmb:578 smb:64 d:- ref:0 ; in:1568 out:1568 type:P dur:82000000 cpbdur:82000000 q:29.70 tex:190011 mv:19312 misc:1453 imb:612 pmb:674 smb:64 d:- ref:0 ; in:1569 out:1569 type:P dur:82000000 cpbdur:82000000 q:29.38 tex:182439 mv:18512 misc:1457 imb:501 pmb:738 smb:111 d:- ref:0 ; in:1570 out:1570 type:P dur:82000000 cpbdur:82000000 q:29.36 tex:192556 mv:18157 misc:1463 imb:486 pmb:713 smb:151 d:- ref:0 ; in:1571 out:1571 type:P dur:82000000 cpbdur:82000000 q:29.16 tex:175314 mv:18038 misc:1456 imb:449 pmb:776 smb:125 d:- ref:0 ; in:1572 out:1572 type:P dur:82000000 cpbdur:82000000 q:28.79 tex:151871 mv:16476 misc:1461 imb:407 pmb:790 smb:153 d:- ref:0 ; in:1573 out:1573 type:P dur:82000000 cpbdur:82000000 q:28.33 tex:162837 mv:15017 misc:1482 imb:357 pmb:825 smb:168 d:- ref:0 ; in:1574 out:1574 type:P dur:82000000 cpbdur:82000000 q:28.06 tex:157519 mv:14921 misc:1488 imb:367 pmb:807 smb:176 d:- ref:0 ; in:1575 out:1575 type:P dur:82000000 cpbdur:82000000 q:28.54 tex:188393 mv:16991 misc:1424 imb:489 pmb:649 smb:212 d:- ref:0 ; in:1576 out:1576 type:P dur:82000000 cpbdur:82000000 q:29.29 tex:239339 mv:18464 misc:1445 imb:777 pmb:470 smb:103 d:- ref:0 ; in:1577 out:1577 type:P dur:82000000 cpbdur:82000000 q:29.26 tex:207705 mv:18011 misc:1444 imb:674 pmb:549 smb:127 d:- ref:0 ; in:1578 out:1578 type:P dur:82000000 cpbdur:82000000 q:28.92 tex:175304 mv:17269 misc:1459 imb:466 pmb:693 smb:191 d:- ref:0 ; in:1579 out:1579 type:P dur:82000000 cpbdur:82000000 q:28.61 tex:161962 mv:17391 misc:1455 imb:451 pmb:717 smb:182 d:- ref:0 ; in:1580 out:1580 type:P dur:82000000 cpbdur:82000000 q:28.97 tex:206933 mv:17184 misc:1443 imb:943 pmb:376 smb:31 d:- ref:0 ; in:1581 out:1581 type:P dur:82000000 cpbdur:82000000 q:27.99 tex:111209 mv:13747 misc:1428 imb:1143 pmb:173 smb:34 d:- ref:0 ; in:1582 out:1582 type:P dur:82000000 cpbdur:82000000 q:28.42 tex:228669 mv:17680 misc:1427 imb:1016 pmb:324 smb:10 d:- ref:0 ; in:1583 out:1583 type:P dur:82000000 cpbdur:82000000 q:28.39 tex:201825 mv:17648 misc:1431 imb:486 pmb:712 smb:152 d:- ref:0 ; in:1584 out:1584 type:P dur:82000000 cpbdur:82000000 q:28.16 tex:181879 mv:16593 misc:1448 imb:364 pmb:789 smb:197 d:- ref:0 ; in:1585 out:1585 type:P dur:82000000 cpbdur:82000000 q:27.56 tex:138084 mv:14630 misc:1478 imb:209 pmb:876 smb:265 d:- ref:0 ; in:1586 out:1586 type:P dur:82000000 cpbdur:82000000 q:27.12 tex:149038 mv:14204 misc:1462 imb:218 pmb:884 smb:248 d:- ref:0 ; in:1587 out:1587 type:P dur:82000000 cpbdur:82000000 q:27.90 tex:221917 mv:17144 misc:1435 imb:608 pmb:608 smb:134 d:- ref:0 ; in:1588 out:1588 type:P dur:82000000 cpbdur:82000000 q:27.98 tex:191732 mv:16172 misc:1448 imb:387 pmb:776 smb:187 d:- ref:0 ; in:1589 out:1589 type:P dur:82000000 cpbdur:82000000 q:28.77 tex:207526 mv:14925 misc:1421 imb:1251 pmb:99 smb:0 d:- ref:0 ; in:1590 out:1590 type:P dur:82000000 cpbdur:82000000 q:27.89 tex:117484 mv:13848 misc:1460 imb:271 pmb:774 smb:305 d:- ref:0 ; in:1591 out:1591 type:P dur:82000000 cpbdur:82000000 q:27.66 tex:134092 mv:14943 misc:1461 imb:271 pmb:801 smb:278 d:- ref:0 ; in:1592 out:1592 type:P dur:82000000 cpbdur:82000000 q:27.02 tex:120471 mv:12093 misc:1476 imb:194 pmb:871 smb:285 d:- ref:0 ; in:1593 out:1593 type:P dur:82000000 cpbdur:82000000 q:27.13 tex:161670 mv:13731 misc:1439 imb:393 pmb:709 smb:248 d:- ref:0 ; in:1594 out:1594 type:P dur:82000000 cpbdur:82000000 q:27.73 tex:188578 mv:15214 misc:1400 imb:609 pmb:498 smb:243 d:- ref:0 ; in:1595 out:1595 type:P dur:82000000 cpbdur:82000000 q:27.77 tex:186689 mv:15259 misc:1436 imb:484 pmb:603 smb:263 d:- ref:0 ; in:1596 out:1596 type:P dur:82000000 cpbdur:82000000 q:28.64 tex:217400 mv:15974 misc:1418 imb:788 pmb:408 smb:154 d:- ref:0 ; in:1597 out:1597 type:P dur:82000000 cpbdur:82000000 q:28.88 tex:197216 mv:16200 misc:1432 imb:633 pmb:538 smb:179 d:- ref:0 ; in:1598 out:1598 type:P dur:82000000 cpbdur:82000000 q:28.78 tex:182751 mv:16182 misc:1427 imb:513 pmb:620 smb:217 d:- ref:0 ; in:1599 out:1599 type:P dur:82000000 cpbdur:82000000 q:28.50 tex:166733 mv:15031 misc:1436 imb:485 pmb:635 smb:230 d:- ref:0 ; in:1600 out:1600 type:P dur:82000000 cpbdur:82000000 q:28.53 tex:170122 mv:14934 misc:1424 imb:704 pmb:462 smb:184 d:- ref:0 ; in:1601 out:1601 type:P dur:82000000 cpbdur:82000000 q:28.30 tex:164110 mv:14253 misc:1445 imb:399 pmb:667 smb:284 d:- ref:0 ; in:1602 out:1602 type:P dur:82000000 cpbdur:82000000 q:28.03 tex:153508 mv:13168 misc:1436 imb:272 pmb:692 smb:386 d:- ref:0 ; in:1603 out:1603 type:P dur:82000000 cpbdur:82000000 q:27.44 tex:134069 mv:11519 misc:1484 imb:185 pmb:831 smb:334 d:- ref:0 ; in:1604 out:1604 type:P dur:82000000 cpbdur:82000000 q:27.04 tex:121106 mv:11039 misc:1415 imb:184 pmb:723 smb:443 d:- ref:0 ; in:1605 out:1605 type:P dur:82000000 cpbdur:82000000 q:27.03 tex:130750 mv:10873 misc:1441 imb:216 pmb:733 smb:401 d:- ref:0 ; in:1606 out:1606 type:P dur:82000000 cpbdur:82000000 q:27.06 tex:142821 mv:12122 misc:1457 imb:311 pmb:670 smb:369 d:- ref:0 ; in:1607 out:1607 type:P dur:82000000 cpbdur:82000000 q:26.85 tex:131713 mv:12137 misc:1470 imb:357 pmb:643 smb:350 d:- ref:0 ; in:1608 out:1608 type:P dur:82000000 cpbdur:82000000 q:26.89 tex:132285 mv:12773 misc:1462 imb:383 pmb:629 smb:338 d:- ref:0 ; in:1609 out:1609 type:P dur:82000000 cpbdur:82000000 q:27.20 tex:158862 mv:13364 misc:1462 imb:562 pmb:536 smb:252 d:- ref:0 ; in:1610 out:1610 type:P dur:82000000 cpbdur:82000000 q:27.54 tex:151262 mv:12564 misc:1422 imb:420 pmb:550 smb:380 d:- ref:0 ; in:1611 out:1611 type:P dur:82000000 cpbdur:82000000 q:27.95 tex:169374 mv:13803 misc:1399 imb:448 pmb:553 smb:349 d:- ref:0 ; in:1612 out:1612 type:P dur:82000000 cpbdur:82000000 q:28.02 tex:167417 mv:14191 misc:1408 imb:488 pmb:535 smb:327 d:- ref:0 ; in:1613 out:1613 type:P dur:82000000 cpbdur:82000000 q:28.09 tex:166943 mv:14598 misc:1459 imb:492 pmb:584 smb:274 d:- ref:0 ; in:1614 out:1614 type:P dur:82000000 cpbdur:82000000 q:28.29 tex:185326 mv:16126 misc:1460 imb:541 pmb:588 smb:221 d:- ref:0 ; in:1615 out:1615 type:P dur:82000000 cpbdur:82000000 q:28.16 tex:171203 mv:15921 misc:1468 imb:442 pmb:659 smb:249 d:- ref:0 ; in:1616 out:1616 type:P dur:82000000 cpbdur:82000000 q:27.74 tex:135502 mv:14757 misc:1453 imb:316 pmb:715 smb:319 d:- ref:0 ; in:1617 out:1617 type:P dur:82000000 cpbdur:82000000 q:27.61 tex:145659 mv:14412 misc:1457 imb:309 pmb:722 smb:319 d:- ref:0 ; in:1618 out:1618 type:P dur:82000000 cpbdur:82000000 q:27.58 tex:145765 mv:14975 misc:1444 imb:430 pmb:639 smb:281 d:- ref:0 ; in:1619 out:1619 type:P dur:82000000 cpbdur:82000000 q:27.41 tex:142445 mv:14383 misc:1476 imb:567 pmb:587 smb:196 d:- ref:0 ; in:1620 out:1620 type:P dur:82000000 cpbdur:82000000 q:27.15 tex:123146 mv:12693 misc:1401 imb:587 pmb:485 smb:278 d:- ref:0 ; in:1621 out:1621 type:P dur:82000000 cpbdur:82000000 q:27.47 tex:149687 mv:12642 misc:1303 imb:560 pmb:424 smb:366 d:- ref:0 ; in:1622 out:1622 type:P dur:82000000 cpbdur:82000000 q:26.98 tex:104830 mv:8737 misc:1249 imb:500 pmb:305 smb:545 d:- ref:0 ; in:1623 out:1623 type:P dur:82000000 cpbdur:82000000 q:27.88 tex:169004 mv:15045 misc:1351 imb:795 pmb:357 smb:198 d:- ref:0 ; in:1624 out:1624 type:P dur:82000000 cpbdur:82000000 q:27.69 tex:117411 mv:12322 misc:1427 imb:796 pmb:336 smb:218 d:- ref:0 ; in:1625 out:1625 type:P dur:82000000 cpbdur:82000000 q:27.25 tex:108512 mv:11369 misc:1351 imb:891 pmb:173 smb:286 d:- ref:0 ; in:1626 out:1626 type:P dur:82000000 cpbdur:82000000 q:27.39 tex:130042 mv:12308 misc:1378 imb:971 pmb:188 smb:191 d:- ref:0 ; in:1627 out:1627 type:P dur:82000000 cpbdur:82000000 q:27.12 tex:111443 mv:11557 misc:1328 imb:805 pmb:223 smb:322 d:- ref:0 ; in:1628 out:1628 type:P dur:82000000 cpbdur:82000000 q:24.84 tex:1723 mv:4881 misc:1116 imb:751 pmb:7 smb:592 d:- ref:0 ; in:1629 out:1629 type:P dur:82000000 cpbdur:82000000 q:25.16 tex:74288 mv:3348 misc:708 imb:299 pmb:48 smb:1003 d:- ref:0 ; in:1630 out:1630 type:P dur:82000000 cpbdur:82000000 q:22.88 tex:4769 mv:7944 misc:1423 imb:1165 pmb:164 smb:21 d:- ref:0 ; in:1631 out:1631 type:P dur:82000000 cpbdur:82000000 q:20.88 tex:6423 mv:8220 misc:1413 imb:1108 pmb:242 smb:0 d:- ref:0 ; in:1632 out:1632 type:P dur:82000000 cpbdur:82000000 q:19.31 tex:15301 mv:7044 misc:1415 imb:712 pmb:638 smb:0 d:- ref:0 ; in:1633 out:1633 type:P dur:82000000 cpbdur:82000000 q:17.51 tex:11929 mv:5669 misc:1418 imb:305 pmb:1045 smb:0 d:- ref:0 ; in:1634 out:1634 type:P dur:82000000 cpbdur:82000000 q:18.28 tex:30196 mv:6842 misc:1418 imb:506 pmb:842 smb:2 d:- ref:0 ; in:1635 out:1635 type:P dur:82000000 cpbdur:82000000 q:22.28 tex:79770 mv:5999 misc:1047 imb:563 pmb:49 smb:738 d:- ref:0 ; in:1636 out:1636 type:P dur:82000000 cpbdur:82000000 q:24.37 tex:80559 mv:8584 misc:1177 imb:686 pmb:114 smb:550 d:- ref:0 ; in:1637 out:1637 type:P dur:82000000 cpbdur:82000000 q:24.13 tex:59237 mv:8193 misc:1130 imb:581 pmb:147 smb:622 d:- ref:0 ; in:1638 out:1638 type:P dur:82000000 cpbdur:82000000 q:26.42 tex:163723 mv:13426 misc:1347 imb:866 pmb:222 smb:262 d:- ref:0 ; in:1639 out:1639 type:P dur:82000000 cpbdur:82000000 q:27.19 tex:150843 mv:15351 misc:1430 imb:984 pmb:297 smb:69 d:- ref:0 ; in:1640 out:1640 type:P dur:82000000 cpbdur:82000000 q:27.46 tex:165313 mv:15914 misc:1429 imb:934 pmb:322 smb:94 d:- ref:0 ; in:1641 out:1641 type:P dur:82000000 cpbdur:82000000 q:27.57 tex:146555 mv:14950 misc:1431 imb:918 pmb:314 smb:118 d:- ref:0 ; in:1642 out:1642 type:P dur:82000000 cpbdur:82000000 q:27.61 tex:140862 mv:14945 misc:1425 imb:1025 pmb:245 smb:80 d:- ref:0 ; in:1643 out:1643 type:P dur:82000000 cpbdur:82000000 q:27.74 tex:153199 mv:14620 misc:1429 imb:847 pmb:326 smb:177 d:- ref:0 ; in:1644 out:1644 type:P dur:82000000 cpbdur:82000000 q:27.85 tex:165683 mv:15410 misc:1427 imb:891 pmb:300 smb:159 d:- ref:0 ; in:1645 out:1645 type:P dur:82000000 cpbdur:82000000 q:27.88 tex:153633 mv:14529 misc:1430 imb:860 pmb:355 smb:135 d:- ref:0 ; in:1646 out:1646 type:P dur:82000000 cpbdur:82000000 q:28.35 tex:196361 mv:17450 misc:1421 imb:858 pmb:418 smb:74 d:- ref:0 ; in:1647 out:1647 type:P dur:82000000 cpbdur:82000000 q:28.43 tex:177778 mv:14827 misc:1451 imb:735 pmb:487 smb:128 d:- ref:0 ; in:1648 out:1648 type:P dur:82000000 cpbdur:82000000 q:29.15 tex:231760 mv:18202 misc:1438 imb:822 pmb:444 smb:84 d:- ref:0 ; in:1649 out:1649 type:P dur:82000000 cpbdur:82000000 q:28.72 tex:156494 mv:14861 misc:1453 imb:646 pmb:621 smb:83 d:- ref:0 ; in:1650 out:1650 type:P dur:82000000 cpbdur:82000000 q:28.77 tex:182131 mv:17073 misc:1444 imb:740 pmb:509 smb:101 d:- ref:0 ; in:1651 out:1651 type:P dur:82000000 cpbdur:82000000 q:28.31 tex:159746 mv:13907 misc:1451 imb:654 pmb:617 smb:79 d:- ref:0 ; in:1652 out:1652 type:P dur:82000000 cpbdur:82000000 q:28.62 tex:189284 mv:17027 misc:1441 imb:811 pmb:475 smb:64 d:- ref:0 ; in:1653 out:1653 type:P dur:82000000 cpbdur:82000000 q:28.40 tex:171592 mv:14757 misc:1435 imb:765 pmb:547 smb:38 d:- ref:0 ; in:1654 out:1654 type:P dur:82000000 cpbdur:82000000 q:28.62 tex:182042 mv:16511 misc:1407 imb:820 pmb:417 smb:113 d:- ref:0 ; in:1655 out:1655 type:P dur:82000000 cpbdur:82000000 q:28.27 tex:158792 mv:13302 misc:1418 imb:674 pmb:536 smb:140 d:- ref:0 ; in:1656 out:1656 type:P dur:82000000 cpbdur:82000000 q:28.51 tex:177815 mv:16796 misc:1437 imb:801 pmb:450 smb:99 d:- ref:0 ; in:1657 out:1657 type:P dur:82000000 cpbdur:82000000 q:28.10 tex:150747 mv:12943 misc:1446 imb:664 pmb:549 smb:137 d:- ref:0 ; in:1658 out:1658 type:P dur:82000000 cpbdur:82000000 q:28.35 tex:193472 mv:16979 misc:1437 imb:778 pmb:487 smb:85 d:- ref:0 ; in:1659 out:1659 type:P dur:82000000 cpbdur:82000000 q:28.30 tex:168214 mv:14165 misc:1453 imb:630 pmb:619 smb:101 d:- ref:0 ; in:1660 out:1660 type:P dur:82000000 cpbdur:82000000 q:28.63 tex:188689 mv:17105 misc:1438 imb:770 pmb:503 smb:77 d:- ref:0 ; in:1661 out:1661 type:P dur:82000000 cpbdur:82000000 q:28.20 tex:151088 mv:13772 misc:1452 imb:509 pmb:712 smb:129 d:- ref:0 ; in:1662 out:1662 type:P dur:82000000 cpbdur:82000000 q:28.48 tex:199442 mv:17695 misc:1447 imb:613 pmb:629 smb:108 d:- ref:0 ; in:1663 out:1663 type:P dur:82000000 cpbdur:82000000 q:28.12 tex:147916 mv:14127 misc:1461 imb:444 pmb:755 smb:151 d:- ref:0 ; in:1664 out:1664 type:P dur:82000000 cpbdur:82000000 q:28.62 tex:193346 mv:17999 misc:1439 imb:648 pmb:593 smb:109 d:- ref:0 ; in:1665 out:1665 type:P dur:82000000 cpbdur:82000000 q:28.25 tex:161816 mv:14261 misc:1459 imb:454 pmb:731 smb:165 d:- ref:0 ; in:1666 out:1666 type:P dur:82000000 cpbdur:82000000 q:28.69 tex:177006 mv:15168 misc:1418 imb:1192 pmb:158 smb:0 d:- ref:0 ; in:1667 out:1667 type:P dur:82000000 cpbdur:82000000 q:27.07 tex:63818 mv:8580 misc:1458 imb:149 pmb:832 smb:369 d:- ref:0 ; in:1668 out:1668 type:P dur:82000000 cpbdur:82000000 q:25.93 tex:75877 mv:9886 misc:1469 imb:235 pmb:874 smb:241 d:- ref:0 ; in:1669 out:1669 type:P dur:82000000 cpbdur:82000000 q:24.51 tex:66568 mv:8398 misc:1466 imb:295 pmb:952 smb:103 d:- ref:0 ; in:1670 out:1670 type:P dur:82000000 cpbdur:82000000 q:23.53 tex:58452 mv:5201 misc:1467 imb:61 pmb:815 smb:474 d:- ref:0 ; in:1671 out:1671 type:P dur:82000000 cpbdur:82000000 q:21.52 tex:85415 mv:4114 misc:1479 imb:44 pmb:1022 smb:284 d:- ref:0 ; in:1672 out:1672 type:P dur:82000000 cpbdur:82000000 q:23.19 tex:74197 mv:8894 misc:1445 imb:195 pmb:876 smb:279 d:- ref:0 ; in:1673 out:1673 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:79910 mv:10335 misc:1435 imb:377 pmb:883 smb:90 d:- ref:0 ; in:1674 out:1674 type:P dur:82000000 cpbdur:82000000 q:24.48 tex:107168 mv:11734 misc:1442 imb:408 pmb:788 smb:154 d:- ref:0 ; in:1675 out:1675 type:P dur:82000000 cpbdur:82000000 q:23.70 tex:51770 mv:8017 misc:1197 imb:143 pmb:663 smb:544 d:- ref:0 ; in:1676 out:1676 type:P dur:82000000 cpbdur:82000000 q:23.72 tex:60996 mv:8536 misc:1180 imb:110 pmb:672 smb:568 d:- ref:0 ; in:1677 out:1677 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:47807 mv:7863 misc:1482 imb:194 pmb:899 smb:257 d:- ref:0 ; in:1678 out:1678 type:P dur:82000000 cpbdur:82000000 q:23.21 tex:80653 mv:5945 misc:1458 imb:80 pmb:795 smb:475 d:- ref:0 ; in:1679 out:1679 type:P dur:82000000 cpbdur:82000000 q:21.24 tex:73784 mv:4169 misc:1487 imb:44 pmb:1023 smb:283 d:- ref:0 ; in:1680 out:1680 type:P dur:82000000 cpbdur:82000000 q:23.11 tex:71325 mv:8512 misc:1395 imb:152 pmb:742 smb:456 d:- ref:0 ; in:1681 out:1681 type:P dur:82000000 cpbdur:82000000 q:23.15 tex:61753 mv:7852 misc:1419 imb:261 pmb:692 smb:397 d:- ref:0 ; in:1682 out:1682 type:P dur:82000000 cpbdur:82000000 q:24.35 tex:91175 mv:10320 misc:1193 imb:218 pmb:624 smb:508 d:- ref:0 ; in:1683 out:1683 type:P dur:82000000 cpbdur:82000000 q:23.79 tex:57946 mv:7837 misc:1257 imb:112 pmb:751 smb:487 d:- ref:0 ; in:1684 out:1684 type:P dur:82000000 cpbdur:82000000 q:24.40 tex:87693 mv:10991 misc:1428 imb:202 pmb:883 smb:265 d:- ref:0 ; in:1685 out:1685 type:P dur:82000000 cpbdur:82000000 q:23.54 tex:49992 mv:8988 misc:1444 imb:273 pmb:912 smb:165 d:- ref:0 ; in:1686 out:1686 type:P dur:82000000 cpbdur:82000000 q:23.81 tex:76709 mv:6196 misc:1455 imb:85 pmb:756 smb:509 d:- ref:0 ; in:1687 out:1687 type:P dur:82000000 cpbdur:82000000 q:21.78 tex:64346 mv:4501 misc:1489 imb:77 pmb:973 smb:300 d:- ref:0 ; in:1688 out:1688 type:P dur:82000000 cpbdur:82000000 q:24.34 tex:106547 mv:10917 misc:1432 imb:182 pmb:841 smb:327 d:- ref:0 ; in:1689 out:1689 type:P dur:82000000 cpbdur:82000000 q:24.11 tex:74053 mv:9773 misc:1438 imb:343 pmb:813 smb:194 d:- ref:0 ; in:1690 out:1690 type:P dur:82000000 cpbdur:82000000 q:25.55 tex:117220 mv:13740 misc:1424 imb:438 pmb:790 smb:122 d:- ref:0 ; in:1691 out:1691 type:P dur:82000000 cpbdur:82000000 q:24.78 tex:86101 mv:9180 misc:1399 imb:146 pmb:888 smb:316 d:- ref:0 ; in:1692 out:1692 type:P dur:82000000 cpbdur:82000000 q:25.29 tex:114271 mv:11554 misc:1423 imb:126 pmb:938 smb:286 d:- ref:0 ; in:1693 out:1693 type:P dur:82000000 cpbdur:82000000 q:23.98 tex:43799 mv:6088 misc:1489 imb:111 pmb:868 smb:371 d:- ref:0 ; in:1694 out:1694 type:P dur:82000000 cpbdur:82000000 q:24.90 tex:112738 mv:10163 misc:1467 imb:147 pmb:883 smb:320 d:- ref:0 ; in:1695 out:1695 type:P dur:82000000 cpbdur:82000000 q:23.03 tex:58417 mv:4144 misc:1503 imb:78 pmb:906 smb:366 d:- ref:0 ; in:1696 out:1696 type:P dur:82000000 cpbdur:82000000 q:25.06 tex:118262 mv:11855 misc:1435 imb:158 pmb:891 smb:301 d:- ref:0 ; in:1697 out:1697 type:P dur:82000000 cpbdur:82000000 q:24.22 tex:61362 mv:7768 misc:1430 imb:169 pmb:798 smb:383 d:- ref:0 ; in:1698 out:1698 type:P dur:82000000 cpbdur:82000000 q:25.52 tex:119384 mv:13076 misc:1396 imb:266 pmb:814 smb:270 d:- ref:0 ; in:1699 out:1699 type:P dur:82000000 cpbdur:82000000 q:24.57 tex:74635 mv:8462 misc:1383 imb:135 pmb:860 smb:355 d:- ref:0 ; in:1700 out:1700 type:P dur:82000000 cpbdur:82000000 q:25.30 tex:123405 mv:13612 misc:1423 imb:258 pmb:918 smb:174 d:- ref:0 ; in:1701 out:1701 type:P dur:82000000 cpbdur:82000000 q:24.38 tex:71048 mv:10007 misc:1425 imb:345 pmb:907 smb:98 d:- ref:0 ; in:1702 out:1702 type:P dur:82000000 cpbdur:82000000 q:24.96 tex:111868 mv:8562 misc:1402 imb:86 pmb:780 smb:484 d:- ref:0 ; in:1703 out:1703 type:P dur:82000000 cpbdur:82000000 q:22.83 tex:53603 mv:3429 misc:1496 imb:58 pmb:829 smb:463 d:- ref:0 ; in:1704 out:1704 type:P dur:82000000 cpbdur:82000000 q:25.03 tex:122891 mv:13353 misc:1428 imb:266 pmb:855 smb:229 d:- ref:0 ; in:1705 out:1705 type:P dur:82000000 cpbdur:82000000 q:24.46 tex:78912 mv:9207 misc:1441 imb:317 pmb:865 smb:168 d:- ref:0 ; in:1706 out:1706 type:P dur:82000000 cpbdur:82000000 q:25.81 tex:126027 mv:15333 misc:1416 imb:431 pmb:809 smb:110 d:- ref:0 ; in:1707 out:1707 type:P dur:82000000 cpbdur:82000000 q:24.58 tex:68388 mv:8016 misc:1396 imb:134 pmb:876 smb:340 d:- ref:0 ; in:1708 out:1708 type:P dur:82000000 cpbdur:82000000 q:25.86 tex:119138 mv:14160 misc:1398 imb:203 pmb:888 smb:259 d:- ref:0 ; in:1709 out:1709 type:P dur:82000000 cpbdur:82000000 q:24.46 tex:73367 mv:8196 misc:1445 imb:190 pmb:980 smb:180 d:- ref:0 ; in:1710 out:1710 type:P dur:82000000 cpbdur:82000000 q:25.56 tex:110647 mv:9968 misc:1401 imb:119 pmb:752 smb:479 d:- ref:0 ; in:1711 out:1711 type:P dur:82000000 cpbdur:82000000 q:23.66 tex:55541 mv:4246 misc:1477 imb:37 pmb:870 smb:443 d:- ref:0 ; in:1712 out:1712 type:P dur:82000000 cpbdur:82000000 q:26.17 tex:140806 mv:13854 misc:1428 imb:284 pmb:792 smb:274 d:- ref:0 ; in:1713 out:1713 type:P dur:82000000 cpbdur:82000000 q:25.18 tex:88155 mv:9603 misc:1434 imb:330 pmb:875 smb:145 d:- ref:0 ; in:1714 out:1714 type:P dur:82000000 cpbdur:82000000 q:26.08 tex:112686 mv:12117 misc:1277 imb:303 pmb:593 smb:454 d:- ref:0 ; in:1715 out:1715 type:P dur:82000000 cpbdur:82000000 q:24.93 tex:70833 mv:7221 misc:1394 imb:147 pmb:789 smb:414 d:- ref:0 ; in:1716 out:1716 type:P dur:82000000 cpbdur:82000000 q:25.81 tex:106492 mv:10753 misc:1363 imb:177 pmb:765 smb:408 d:- ref:0 ; in:1717 out:1717 type:P dur:82000000 cpbdur:82000000 q:24.22 tex:65782 mv:6440 misc:1474 imb:170 pmb:956 smb:224 d:- ref:0 ; in:1718 out:1718 type:P dur:82000000 cpbdur:82000000 q:25.48 tex:116916 mv:9878 misc:1462 imb:164 pmb:748 smb:438 d:- ref:0 ; in:1719 out:1719 type:P dur:82000000 cpbdur:82000000 q:23.68 tex:37985 mv:2736 misc:1463 imb:15 pmb:634 smb:701 d:- ref:0 ; in:1720 out:1720 type:P dur:82000000 cpbdur:82000000 q:24.88 tex:103464 mv:11027 misc:1413 imb:83 pmb:871 smb:396 d:- ref:0 ; in:1721 out:1721 type:P dur:82000000 cpbdur:82000000 q:27.69 tex:227786 mv:16631 misc:1415 imb:1165 pmb:185 smb:0 d:- ref:0 ; in:1722 out:1722 type:P dur:82000000 cpbdur:82000000 q:26.07 tex:63769 mv:6052 misc:1467 imb:62 pmb:752 smb:536 d:- ref:0 ; in:1723 out:1723 type:P dur:82000000 cpbdur:82000000 q:26.03 tex:120623 mv:12520 misc:1449 imb:231 pmb:740 smb:379 d:- ref:0 ; in:1724 out:1724 type:P dur:82000000 cpbdur:82000000 q:24.07 tex:63696 mv:4013 misc:1491 imb:58 pmb:773 smb:519 d:- ref:0 ; in:1725 out:1725 type:P dur:82000000 cpbdur:82000000 q:27.83 tex:242238 mv:16114 misc:1432 imb:1024 pmb:262 smb:64 d:- ref:0 ; in:1726 out:1726 type:P dur:82000000 cpbdur:82000000 q:25.83 tex:42721 mv:3795 misc:1468 imb:43 pmb:643 smb:664 d:- ref:0 ; in:1727 out:1727 type:P dur:82000000 cpbdur:82000000 q:28.15 tex:251317 mv:16525 misc:1438 imb:949 pmb:329 smb:72 d:- ref:0 ; in:1728 out:1728 type:P dur:82000000 cpbdur:82000000 q:26.07 tex:44709 mv:3588 misc:1415 imb:10 pmb:664 smb:676 d:- ref:0 ; in:1729 out:1729 type:P dur:82000000 cpbdur:82000000 q:27.66 tex:203122 mv:17430 misc:1448 imb:576 pmb:638 smb:136 d:- ref:0 ; in:1730 out:1730 type:P dur:82000000 cpbdur:82000000 q:25.53 tex:52595 mv:3288 misc:1461 imb:17 pmb:716 smb:617 d:- ref:0 ; in:1731 out:1731 type:P dur:82000000 cpbdur:82000000 q:26.25 tex:159958 mv:13879 misc:1443 imb:231 pmb:833 smb:286 d:- ref:0 ; in:1732 out:1732 type:P dur:82000000 cpbdur:82000000 q:24.59 tex:78085 mv:4956 misc:1503 imb:50 pmb:876 smb:424 d:- ref:0 ; in:1733 out:1733 type:P dur:82000000 cpbdur:82000000 q:25.92 tex:156104 mv:14004 misc:1460 imb:238 pmb:812 smb:300 d:- ref:0 ; in:1734 out:1734 type:P dur:82000000 cpbdur:82000000 q:24.14 tex:80847 mv:4192 misc:1465 imb:34 pmb:874 smb:442 d:- ref:0 ; in:1735 out:1735 type:P dur:82000000 cpbdur:82000000 q:25.34 tex:156377 mv:13067 misc:1444 imb:156 pmb:869 smb:325 d:- ref:0 ; in:1736 out:1736 type:P dur:82000000 cpbdur:82000000 q:23.65 tex:47677 mv:4193 misc:1474 imb:45 pmb:735 smb:570 d:- ref:0 ; in:1737 out:1737 type:P dur:82000000 cpbdur:82000000 q:24.94 tex:150501 mv:13134 misc:1453 imb:201 pmb:864 smb:285 d:- ref:0 ; in:1738 out:1738 type:P dur:82000000 cpbdur:82000000 q:23.15 tex:78133 mv:4316 misc:1519 imb:72 pmb:856 smb:422 d:- ref:0 ; in:1739 out:1739 type:P dur:82000000 cpbdur:82000000 q:24.89 tex:150968 mv:12677 misc:1435 imb:153 pmb:875 smb:322 d:- ref:0 ; in:1740 out:1740 type:P dur:82000000 cpbdur:82000000 q:23.53 tex:63032 mv:3981 misc:1443 imb:15 pmb:741 smb:594 d:- ref:0 ; in:1741 out:1741 type:P dur:82000000 cpbdur:82000000 q:24.60 tex:129581 mv:11333 misc:1462 imb:86 pmb:899 smb:365 d:- ref:0 ; in:1742 out:1742 type:P dur:82000000 cpbdur:82000000 q:22.84 tex:74678 mv:3917 misc:1493 imb:31 pmb:861 smb:458 d:- ref:0 ; in:1743 out:1743 type:P dur:82000000 cpbdur:82000000 q:25.89 tex:160987 mv:11894 misc:1447 imb:135 pmb:840 smb:375 d:- ref:0 ; in:1744 out:1744 type:P dur:82000000 cpbdur:82000000 q:24.47 tex:95523 mv:4872 misc:1445 imb:24 pmb:874 smb:452 d:- ref:0 ; in:1745 out:1745 type:P dur:82000000 cpbdur:82000000 q:27.26 tex:239616 mv:15877 misc:1427 imb:967 pmb:341 smb:42 d:- ref:0 ; in:1746 out:1746 type:P dur:82000000 cpbdur:82000000 q:25.19 tex:57578 mv:3592 misc:1382 imb:33 pmb:698 smb:619 d:- ref:0 ; in:1747 out:1747 type:P dur:82000000 cpbdur:82000000 q:28.84 tex:309628 mv:17058 misc:1418 imb:1088 pmb:260 smb:2 d:- ref:0 ; in:1748 out:1748 type:P dur:82000000 cpbdur:82000000 q:26.87 tex:67390 mv:4312 misc:1530 imb:24 pmb:866 smb:460 d:- ref:0 ; in:1749 out:1749 type:P dur:82000000 cpbdur:82000000 q:28.19 tex:234712 mv:16502 misc:1434 imb:810 pmb:474 smb:66 d:- ref:0 ; in:1750 out:1750 type:I dur:82000000 cpbdur:82000000 q:22.62 tex:402934 mv:13982 misc:372 imb:1350 pmb:0 smb:0 d:- ref:; in:1751 out:1751 type:P dur:82000000 cpbdur:82000000 q:28.96 tex:176084 mv:14115 misc:1409 imb:514 pmb:537 smb:299 d:- ref:0 ; in:1752 out:1752 type:P dur:82000000 cpbdur:82000000 q:26.88 tex:54499 mv:3943 misc:1486 imb:32 pmb:763 smb:555 d:- ref:0 ; in:1753 out:1753 type:P dur:82000000 cpbdur:82000000 q:28.61 tex:244169 mv:16114 misc:1413 imb:802 pmb:412 smb:136 d:- ref:0 ; in:1754 out:1754 type:P dur:82000000 cpbdur:82000000 q:26.56 tex:60694 mv:4308 misc:1502 imb:16 pmb:812 smb:522 d:- ref:0 ; in:1755 out:1755 type:P dur:82000000 cpbdur:82000000 q:28.36 tex:220362 mv:15860 misc:1442 imb:795 pmb:424 smb:131 d:- ref:0 ; in:1756 out:1756 type:P dur:82000000 cpbdur:82000000 q:26.41 tex:50516 mv:4739 misc:1521 imb:31 pmb:771 smb:548 d:- ref:0 ; in:1757 out:1757 type:P dur:82000000 cpbdur:82000000 q:27.05 tex:139826 mv:10640 misc:1422 imb:343 pmb:528 smb:479 d:- ref:0 ; in:1758 out:1758 type:P dur:82000000 cpbdur:82000000 q:25.21 tex:57435 mv:6092 misc:1529 imb:39 pmb:912 smb:399 d:- ref:0 ; in:1759 out:1759 type:P dur:82000000 cpbdur:82000000 q:25.76 tex:97817 mv:8888 misc:1431 imb:183 pmb:606 smb:561 d:- ref:0 ; in:1760 out:1760 type:P dur:82000000 cpbdur:82000000 q:24.11 tex:52206 mv:7034 misc:1536 imb:73 pmb:952 smb:325 d:- ref:0 ; in:1761 out:1761 type:P dur:82000000 cpbdur:82000000 q:24.84 tex:89318 mv:10411 misc:1535 imb:220 pmb:807 smb:323 d:- ref:0 ; in:1762 out:1762 type:P dur:82000000 cpbdur:82000000 q:24.27 tex:68160 mv:13063 misc:1465 imb:276 pmb:1003 smb:71 d:- ref:0 ; in:1763 out:1763 type:P dur:82000000 cpbdur:82000000 q:25.19 tex:107317 mv:15093 misc:1422 imb:765 pmb:573 smb:12 d:- ref:0 ; in:1764 out:1764 type:P dur:82000000 cpbdur:82000000 q:24.86 tex:77326 mv:12015 misc:1267 imb:356 pmb:611 smb:383 d:- ref:0 ; in:1765 out:1765 type:P dur:82000000 cpbdur:82000000 q:27.75 tex:213860 mv:16069 misc:1423 imb:1088 pmb:261 smb:1 d:- ref:0 ; in:1766 out:1766 type:P dur:82000000 cpbdur:82000000 q:25.72 tex:40218 mv:3771 misc:1243 imb:26 pmb:583 smb:741 d:- ref:0 ; in:1767 out:1767 type:P dur:82000000 cpbdur:82000000 q:27.37 tex:198518 mv:15500 misc:1422 imb:1032 pmb:284 smb:34 d:- ref:0 ; in:1768 out:1768 type:P dur:82000000 cpbdur:82000000 q:25.27 tex:42163 mv:3477 misc:1432 imb:18 pmb:707 smb:625 d:- ref:0 ; in:1769 out:1769 type:P dur:82000000 cpbdur:82000000 q:26.75 tex:169261 mv:13018 misc:1393 imb:739 pmb:344 smb:267 d:- ref:0 ; in:1770 out:1770 type:P dur:82000000 cpbdur:82000000 q:24.76 tex:38957 mv:4438 misc:1509 imb:15 pmb:790 smb:545 d:- ref:0 ; in:1771 out:1771 type:P dur:82000000 cpbdur:82000000 q:26.12 tex:142297 mv:10441 misc:1430 imb:491 pmb:463 smb:396 d:- ref:0 ; in:1772 out:1772 type:P dur:82000000 cpbdur:82000000 q:24.28 tex:45705 mv:5020 misc:1507 imb:36 pmb:822 smb:492 d:- ref:0 ; in:1773 out:1773 type:P dur:82000000 cpbdur:82000000 q:25.90 tex:145722 mv:10683 misc:1371 imb:479 pmb:439 smb:432 d:- ref:0 ; in:1774 out:1774 type:P dur:82000000 cpbdur:82000000 q:24.01 tex:42251 mv:4545 misc:1492 imb:35 pmb:789 smb:526 d:- ref:0 ; in:1775 out:1775 type:P dur:82000000 cpbdur:82000000 q:27.33 tex:242463 mv:13872 misc:1409 imb:924 pmb:272 smb:154 d:- ref:0 ; in:1776 out:1776 type:P dur:82000000 cpbdur:82000000 q:25.29 tex:50601 mv:4367 misc:1424 imb:19 pmb:791 smb:540 d:- ref:0 ; in:1777 out:1777 type:P dur:82000000 cpbdur:82000000 q:27.40 tex:231055 mv:15615 misc:1426 imb:766 pmb:463 smb:121 d:- ref:0 ; in:1778 out:1778 type:P dur:82000000 cpbdur:82000000 q:25.18 tex:47566 mv:3420 misc:1510 imb:24 pmb:768 smb:558 d:- ref:0 ; in:1779 out:1779 type:P dur:82000000 cpbdur:82000000 q:26.65 tex:168522 mv:15416 misc:1438 imb:473 pmb:660 smb:217 d:- ref:0 ; in:1780 out:1780 type:P dur:82000000 cpbdur:82000000 q:24.61 tex:58330 mv:4307 misc:1483 imb:37 pmb:845 smb:468 d:- ref:0 ; in:1781 out:1781 type:P dur:82000000 cpbdur:82000000 q:25.56 tex:134363 mv:13244 misc:1409 imb:240 pmb:744 smb:366 d:- ref:0 ; in:1782 out:1782 type:P dur:82000000 cpbdur:82000000 q:23.82 tex:69989 mv:4859 misc:1480 imb:48 pmb:889 smb:413 d:- ref:0 ; in:1783 out:1783 type:P dur:82000000 cpbdur:82000000 q:24.46 tex:125632 mv:11413 misc:1459 imb:128 pmb:877 smb:345 d:- ref:0 ; in:1784 out:1784 type:P dur:82000000 cpbdur:82000000 q:22.84 tex:61140 mv:4115 misc:1465 imb:35 pmb:851 smb:464 d:- ref:0 ; in:1785 out:1785 type:P dur:82000000 cpbdur:82000000 q:24.24 tex:132451 mv:11451 misc:1442 imb:137 pmb:833 smb:380 d:- ref:0 ; in:1786 out:1786 type:P dur:82000000 cpbdur:82000000 q:22.48 tex:94795 mv:4720 misc:1485 imb:56 pmb:978 smb:316 d:- ref:0 ; in:1787 out:1787 type:P dur:82000000 cpbdur:82000000 q:23.58 tex:101060 mv:9942 misc:1438 imb:81 pmb:846 smb:423 d:- ref:0 ; in:1788 out:1788 type:P dur:82000000 cpbdur:82000000 q:22.47 tex:94536 mv:5419 misc:1461 imb:49 pmb:943 smb:358 d:- ref:0 ; in:1789 out:1789 type:P dur:82000000 cpbdur:82000000 q:23.60 tex:101918 mv:9971 misc:1431 imb:104 pmb:841 smb:405 d:- ref:0 ; in:1790 out:1790 type:P dur:82000000 cpbdur:82000000 q:22.12 tex:79896 mv:4454 misc:1474 imb:27 pmb:924 smb:399 d:- ref:0 ; in:1791 out:1791 type:P dur:82000000 cpbdur:82000000 q:23.63 tex:108434 mv:10627 misc:1411 imb:87 pmb:847 smb:416 d:- ref:0 ; in:1792 out:1792 type:P dur:82000000 cpbdur:82000000 q:22.03 tex:82345 mv:4291 misc:1476 imb:27 pmb:901 smb:422 d:- ref:0 ; in:1793 out:1793 type:P dur:82000000 cpbdur:82000000 q:23.16 tex:109064 mv:8741 misc:1443 imb:57 pmb:867 smb:426 d:- ref:0 ; in:1794 out:1794 type:P dur:82000000 cpbdur:82000000 q:21.55 tex:51285 mv:3940 misc:1471 imb:21 pmb:796 smb:533 d:- ref:0 ; in:1795 out:1795 type:P dur:82000000 cpbdur:82000000 q:22.99 tex:107753 mv:9667 misc:1460 imb:101 pmb:877 smb:372 d:- ref:0 ; in:1796 out:1796 type:P dur:82000000 cpbdur:82000000 q:21.39 tex:83685 mv:4996 misc:1503 imb:67 pmb:970 smb:313 d:- ref:0 ; in:1797 out:1797 type:P dur:82000000 cpbdur:82000000 q:25.39 tex:263186 mv:15636 misc:1426 imb:778 pmb:464 smb:108 d:- ref:0 ; in:1798 out:1798 type:P dur:82000000 cpbdur:82000000 q:24.61 tex:20794 mv:2759 misc:1399 imb:7 pmb:569 smb:774 d:- ref:0 ; in:1799 out:1799 type:P dur:82000000 cpbdur:82000000 q:27.53 tex:184165 mv:14999 misc:1396 imb:856 pmb:339 smb:155 d:- ref:0 ; in:1800 out:1800 type:P dur:82000000 cpbdur:82000000 q:25.56 tex:28710 mv:3963 misc:1439 imb:9 pmb:647 smb:694 d:- ref:0 ; in:1801 out:1801 type:P dur:82000000 cpbdur:82000000 q:25.83 tex:89290 mv:8898 misc:1452 imb:204 pmb:634 smb:512 d:- ref:0 ; in:1802 out:1802 type:P dur:82000000 cpbdur:82000000 q:24.22 tex:45637 mv:6585 misc:1546 imb:30 pmb:973 smb:347 d:- ref:0 ; in:1803 out:1803 type:P dur:82000000 cpbdur:82000000 q:24.36 tex:69580 mv:7066 misc:1482 imb:104 pmb:750 smb:496 d:- ref:0 ; in:1804 out:1804 type:P dur:82000000 cpbdur:82000000 q:23.15 tex:54211 mv:5916 misc:1529 imb:19 pmb:1002 smb:329 d:- ref:0 ; in:1805 out:1805 type:P dur:82000000 cpbdur:82000000 q:23.41 tex:61444 mv:7058 misc:1546 imb:59 pmb:882 smb:409 d:- ref:0 ; in:1806 out:1806 type:P dur:82000000 cpbdur:82000000 q:22.43 tex:55445 mv:7060 misc:1519 imb:23 pmb:1108 smb:219 d:- ref:0 ; in:1807 out:1807 type:P dur:82000000 cpbdur:82000000 q:25.53 tex:138235 mv:11470 misc:1343 imb:595 pmb:336 smb:419 d:- ref:0 ; in:1808 out:1808 type:P dur:82000000 cpbdur:82000000 q:23.67 tex:25023 mv:4093 misc:1428 imb:18 pmb:643 smb:689 d:- ref:0 ; in:1809 out:1809 type:P dur:82000000 cpbdur:82000000 q:26.34 tex:181942 mv:13508 misc:1438 imb:955 pmb:238 smb:157 d:- ref:0 ; in:1810 out:1810 type:P dur:82000000 cpbdur:82000000 q:24.30 tex:32988 mv:3693 misc:1375 imb:21 pmb:609 smb:720 d:- ref:0 ; in:1811 out:1811 type:P dur:82000000 cpbdur:82000000 q:27.56 tex:226486 mv:16371 misc:1423 imb:944 pmb:309 smb:97 d:- ref:0 ; in:1812 out:1812 type:P dur:82000000 cpbdur:82000000 q:25.40 tex:61340 mv:4040 misc:1532 imb:40 pmb:876 smb:434 d:- ref:0 ; in:1813 out:1813 type:P dur:82000000 cpbdur:82000000 q:27.43 tex:232849 mv:16666 misc:1445 imb:637 pmb:536 smb:177 d:- ref:0 ; in:1814 out:1814 type:P dur:82000000 cpbdur:82000000 q:25.30 tex:59576 mv:3819 misc:1533 imb:28 pmb:831 smb:491 d:- ref:0 ; in:1815 out:1815 type:P dur:82000000 cpbdur:82000000 q:27.54 tex:217371 mv:16325 misc:1432 imb:766 pmb:441 smb:143 d:- ref:0 ; in:1816 out:1816 type:P dur:82000000 cpbdur:82000000 q:25.48 tex:73065 mv:5064 misc:1503 imb:32 pmb:954 smb:364 d:- ref:0 ; in:1817 out:1817 type:P dur:82000000 cpbdur:82000000 q:27.12 tex:191705 mv:14643 misc:1436 imb:605 pmb:471 smb:274 d:- ref:0 ; in:1818 out:1818 type:P dur:82000000 cpbdur:82000000 q:25.15 tex:49224 mv:5213 misc:1515 imb:20 pmb:895 smb:435 d:- ref:0 ; in:1819 out:1819 type:P dur:82000000 cpbdur:82000000 q:26.99 tex:185467 mv:13437 misc:1440 imb:459 pmb:539 smb:352 d:- ref:0 ; in:1820 out:1820 type:P dur:82000000 cpbdur:82000000 q:25.22 tex:59842 mv:5944 misc:1550 imb:28 pmb:944 smb:378 d:- ref:0 ; in:1821 out:1821 type:P dur:82000000 cpbdur:82000000 q:26.61 tex:144930 mv:11560 misc:1366 imb:285 pmb:606 smb:459 d:- ref:0 ; in:1822 out:1822 type:P dur:82000000 cpbdur:82000000 q:24.79 tex:59107 mv:5448 misc:1525 imb:29 pmb:946 smb:375 d:- ref:0 ; in:1823 out:1823 type:P dur:82000000 cpbdur:82000000 q:26.48 tex:184779 mv:14348 misc:1441 imb:833 pmb:338 smb:179 d:- ref:0 ; in:1824 out:1824 type:P dur:82000000 cpbdur:82000000 q:24.50 tex:33106 mv:4426 misc:1476 imb:32 pmb:750 smb:568 d:- ref:0 ; in:1825 out:1825 type:P dur:82000000 cpbdur:82000000 q:26.34 tex:170700 mv:14918 misc:1446 imb:669 pmb:446 smb:235 d:- ref:0 ; in:1826 out:1826 type:P dur:82000000 cpbdur:82000000 q:24.39 tex:38429 mv:4475 misc:1536 imb:26 pmb:793 smb:531 d:- ref:0 ; in:1827 out:1827 type:P dur:82000000 cpbdur:82000000 q:25.47 tex:132559 mv:12689 misc:1480 imb:439 pmb:631 smb:280 d:- ref:0 ; in:1828 out:1828 type:P dur:82000000 cpbdur:82000000 q:23.61 tex:20419 mv:3928 misc:1485 imb:16 pmb:632 smb:702 d:- ref:0 ; in:1829 out:1829 type:P dur:82000000 cpbdur:82000000 q:24.45 tex:106601 mv:10925 misc:1498 imb:175 pmb:775 smb:400 d:- ref:0 ; in:1830 out:1830 type:P dur:82000000 cpbdur:82000000 q:23.02 tex:46995 mv:4765 misc:1536 imb:35 pmb:869 smb:446 d:- ref:0 ; in:1831 out:1831 type:P dur:82000000 cpbdur:82000000 q:26.05 tex:187283 mv:14566 misc:1447 imb:995 pmb:266 smb:89 d:- ref:0 ; in:1832 out:1832 type:P dur:82000000 cpbdur:82000000 q:23.99 tex:35710 mv:3690 misc:1440 imb:102 pmb:638 smb:610 d:- ref:0 ; in:1833 out:1833 type:P dur:82000000 cpbdur:82000000 q:25.29 tex:134756 mv:14544 misc:1452 imb:833 pmb:388 smb:129 d:- ref:0 ; in:1834 out:1834 type:P dur:82000000 cpbdur:82000000 q:23.32 tex:35604 mv:3075 misc:1369 imb:76 pmb:553 smb:721 d:- ref:0 ; in:1835 out:1835 type:P dur:82000000 cpbdur:82000000 q:21.50 tex:35587 mv:3446 misc:1423 imb:101 pmb:656 smb:593 d:- ref:0 ; in:1836 out:1836 type:P dur:82000000 cpbdur:82000000 q:25.10 tex:160558 mv:13046 misc:1436 imb:1124 pmb:146 smb:80 d:- ref:0 ; in:1837 out:1837 type:P dur:82000000 cpbdur:82000000 q:28.13 tex:262889 mv:16015 misc:1416 imb:1177 pmb:173 smb:0 d:- ref:0 ; in:1838 out:1838 type:P dur:82000000 cpbdur:82000000 q:26.13 tex:44222 mv:3750 misc:1388 imb:15 pmb:620 smb:715 d:- ref:0 ; in:1839 out:1839 type:P dur:82000000 cpbdur:82000000 q:27.76 tex:192706 mv:16783 misc:1423 imb:938 pmb:339 smb:73 d:- ref:0 ; in:1840 out:1840 type:P dur:82000000 cpbdur:82000000 q:26.10 tex:63696 mv:6102 misc:1506 imb:36 pmb:838 smb:476 d:- ref:0 ; in:1841 out:1841 type:P dur:82000000 cpbdur:82000000 q:26.65 tex:128002 mv:11406 misc:1400 imb:288 pmb:574 smb:488 d:- ref:0 ; in:1842 out:1842 type:P dur:82000000 cpbdur:82000000 q:25.02 tex:64497 mv:6591 misc:1512 imb:59 pmb:927 smb:364 d:- ref:0 ; in:1843 out:1843 type:P dur:82000000 cpbdur:82000000 q:26.03 tex:117797 mv:9390 misc:1293 imb:301 pmb:440 smb:609 d:- ref:0 ; in:1844 out:1844 type:P dur:82000000 cpbdur:82000000 q:24.31 tex:49245 mv:5568 misc:1531 imb:59 pmb:852 smb:439 d:- ref:0 ; in:1845 out:1845 type:P dur:82000000 cpbdur:82000000 q:24.97 tex:85217 mv:7800 misc:1447 imb:234 pmb:548 smb:568 d:- ref:0 ; in:1846 out:1846 type:P dur:82000000 cpbdur:82000000 q:23.50 tex:47498 mv:5634 misc:1524 imb:63 pmb:886 smb:401 d:- ref:0 ; in:1847 out:1847 type:P dur:82000000 cpbdur:82000000 q:24.46 tex:75652 mv:5911 misc:1365 imb:152 pmb:503 smb:695 d:- ref:0 ; in:1848 out:1848 type:P dur:82000000 cpbdur:82000000 q:25.53 tex:101606 mv:4780 misc:1270 imb:94 pmb:480 smb:776 d:- ref:0 ; in:1849 out:1849 type:P dur:82000000 cpbdur:82000000 q:25.40 tex:86927 mv:7925 misc:1436 imb:166 pmb:705 smb:479 d:- ref:0 ; in:1850 out:1850 type:P dur:82000000 cpbdur:82000000 q:24.17 tex:50800 mv:5866 misc:1494 imb:67 pmb:744 smb:539 d:- ref:0 ; in:1851 out:1851 type:P dur:82000000 cpbdur:82000000 q:24.44 tex:73967 mv:6439 misc:1410 imb:113 pmb:645 smb:592 d:- ref:0 ; in:1852 out:1852 type:P dur:82000000 cpbdur:82000000 q:23.52 tex:42124 mv:5757 misc:1455 imb:53 pmb:719 smb:578 d:- ref:0 ; in:1853 out:1853 type:P dur:82000000 cpbdur:82000000 q:23.73 tex:62126 mv:6983 misc:1491 imb:95 pmb:745 smb:510 d:- ref:0 ; in:1854 out:1854 type:P dur:82000000 cpbdur:82000000 q:23.29 tex:66376 mv:7184 misc:1528 imb:83 pmb:916 smb:351 d:- ref:0 ; in:1855 out:1855 type:P dur:82000000 cpbdur:82000000 q:23.16 tex:64474 mv:6127 misc:1487 imb:58 pmb:797 smb:495 d:- ref:0 ; in:1856 out:1856 type:P dur:82000000 cpbdur:82000000 q:22.88 tex:51870 mv:5867 misc:1503 imb:61 pmb:807 smb:482 d:- ref:0 ; in:1857 out:1857 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:57476 mv:5428 misc:1448 imb:52 pmb:676 smb:622 d:- ref:0 ; in:1858 out:1858 type:P dur:82000000 cpbdur:82000000 q:22.75 tex:56087 mv:6490 misc:1495 imb:50 pmb:812 smb:488 d:- ref:0 ; in:1859 out:1859 type:P dur:82000000 cpbdur:82000000 q:22.86 tex:60858 mv:6324 misc:1474 imb:57 pmb:742 smb:551 d:- ref:0 ; in:1860 out:1860 type:P dur:82000000 cpbdur:82000000 q:22.80 tex:53735 mv:6063 misc:1458 imb:68 pmb:773 smb:509 d:- ref:0 ; in:1861 out:1861 type:P dur:82000000 cpbdur:82000000 q:23.01 tex:65116 mv:6476 misc:1456 imb:61 pmb:764 smb:525 d:- ref:0 ; in:1862 out:1862 type:P dur:82000000 cpbdur:82000000 q:22.88 tex:53832 mv:5697 misc:1463 imb:63 pmb:737 smb:550 d:- ref:0 ; in:1863 out:1863 type:P dur:82000000 cpbdur:82000000 q:23.65 tex:67421 mv:5295 misc:1236 imb:64 pmb:557 smb:729 d:- ref:0 ; in:1864 out:1864 type:P dur:82000000 cpbdur:82000000 q:23.23 tex:58824 mv:6415 misc:1513 imb:66 pmb:833 smb:451 d:- ref:0 ; in:1865 out:1865 type:P dur:82000000 cpbdur:82000000 q:23.93 tex:73736 mv:5359 misc:1289 imb:75 pmb:547 smb:728 d:- ref:0 ; in:1866 out:1866 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:59102 mv:5854 misc:1508 imb:59 pmb:804 smb:487 d:- ref:0 ; in:1867 out:1867 type:P dur:82000000 cpbdur:82000000 q:24.38 tex:82676 mv:6369 misc:1395 imb:96 pmb:667 smb:587 d:- ref:0 ; in:1868 out:1868 type:P dur:82000000 cpbdur:82000000 q:23.62 tex:41467 mv:5690 misc:1411 imb:47 pmb:646 smb:657 d:- ref:0 ; in:1869 out:1869 type:P dur:82000000 cpbdur:82000000 q:24.30 tex:76565 mv:6379 misc:1416 imb:72 pmb:693 smb:585 d:- ref:0 ; in:1870 out:1870 type:P dur:82000000 cpbdur:82000000 q:23.56 tex:48025 mv:5752 misc:1431 imb:47 pmb:722 smb:581 d:- ref:0 ; in:1871 out:1871 type:P dur:82000000 cpbdur:82000000 q:24.32 tex:86451 mv:5865 misc:1348 imb:80 pmb:607 smb:663 d:- ref:0 ; in:1872 out:1872 type:P dur:82000000 cpbdur:82000000 q:23.96 tex:64985 mv:6212 misc:1419 imb:73 pmb:736 smb:541 d:- ref:0 ; in:1873 out:1873 type:P dur:82000000 cpbdur:82000000 q:25.11 tex:96710 mv:7000 misc:1330 imb:104 pmb:610 smb:636 d:- ref:0 ; in:1874 out:1874 type:P dur:82000000 cpbdur:82000000 q:24.68 tex:74485 mv:5902 misc:1373 imb:107 pmb:650 smb:593 d:- ref:0 ; in:1875 out:1875 type:P dur:82000000 cpbdur:82000000 q:25.07 tex:98737 mv:7104 misc:1367 imb:122 pmb:630 smb:598 d:- ref:0 ; in:1876 out:1876 type:P dur:82000000 cpbdur:82000000 q:24.81 tex:86403 mv:6779 misc:1410 imb:101 pmb:711 smb:538 d:- ref:0 ; in:1877 out:1877 type:P dur:82000000 cpbdur:82000000 q:25.28 tex:102752 mv:8149 misc:1443 imb:133 pmb:733 smb:484 d:- ref:0 ; in:1878 out:1878 type:P dur:82000000 cpbdur:82000000 q:25.13 tex:88168 mv:6711 misc:1457 imb:99 pmb:717 smb:534 d:- ref:0 ; in:1879 out:1879 type:P dur:82000000 cpbdur:82000000 q:25.59 tex:87399 mv:7148 misc:1277 imb:79 pmb:654 smb:617 d:- ref:0 ; in:1880 out:1880 type:P dur:82000000 cpbdur:82000000 q:25.39 tex:107399 mv:8331 misc:1502 imb:108 pmb:885 smb:357 d:- ref:0 ; in:1881 out:1881 type:P dur:82000000 cpbdur:82000000 q:25.91 tex:102178 mv:7917 misc:1401 imb:105 pmb:701 smb:544 d:- ref:0 ; in:1882 out:1882 type:P dur:82000000 cpbdur:82000000 q:26.11 tex:110172 mv:8566 misc:1422 imb:145 pmb:752 smb:453 d:- ref:0 ; in:1883 out:1883 type:P dur:82000000 cpbdur:82000000 q:26.69 tex:113789 mv:8728 misc:1411 imb:149 pmb:712 smb:489 d:- ref:0 ; in:1884 out:1884 type:P dur:82000000 cpbdur:82000000 q:26.69 tex:110185 mv:8584 misc:1431 imb:168 pmb:730 smb:452 d:- ref:0 ; in:1885 out:1885 type:P dur:82000000 cpbdur:82000000 q:27.08 tex:128814 mv:8959 misc:1443 imb:195 pmb:717 smb:438 d:- ref:0 ; in:1886 out:1886 type:P dur:82000000 cpbdur:82000000 q:26.90 tex:110563 mv:8935 misc:1446 imb:178 pmb:745 smb:427 d:- ref:0 ; in:1887 out:1887 type:P dur:82000000 cpbdur:82000000 q:27.16 tex:133141 mv:9729 misc:1442 imb:267 pmb:667 smb:416 d:- ref:0 ; in:1888 out:1888 type:P dur:82000000 cpbdur:82000000 q:26.90 tex:104546 mv:7856 misc:1446 imb:163 pmb:678 smb:509 d:- ref:0 ; in:1889 out:1889 type:P dur:82000000 cpbdur:82000000 q:26.80 tex:114891 mv:8993 misc:1460 imb:215 pmb:683 smb:452 d:- ref:0 ; in:1890 out:1890 type:P dur:82000000 cpbdur:82000000 q:26.82 tex:110812 mv:8651 misc:1497 imb:177 pmb:739 smb:434 d:- ref:0 ; in:1891 out:1891 type:P dur:82000000 cpbdur:82000000 q:27.06 tex:120015 mv:9034 misc:1495 imb:205 pmb:704 smb:441 d:- ref:0 ; in:1892 out:1892 type:P dur:82000000 cpbdur:82000000 q:27.13 tex:128101 mv:9870 misc:1485 imb:245 pmb:742 smb:363 d:- ref:0 ; in:1893 out:1893 type:P dur:82000000 cpbdur:82000000 q:27.01 tex:110604 mv:8237 misc:1463 imb:208 pmb:691 smb:451 d:- ref:0 ; in:1894 out:1894 type:P dur:82000000 cpbdur:82000000 q:26.91 tex:112490 mv:8281 misc:1493 imb:230 pmb:667 smb:453 d:- ref:0 ; in:1895 out:1895 type:P dur:82000000 cpbdur:82000000 q:27.06 tex:124627 mv:8863 misc:1422 imb:217 pmb:687 smb:446 d:- ref:0 ; in:1896 out:1896 type:P dur:82000000 cpbdur:82000000 q:26.92 tex:108507 mv:7645 misc:1352 imb:193 pmb:595 smb:562 d:- ref:0 ; in:1897 out:1897 type:P dur:82000000 cpbdur:82000000 q:26.88 tex:110671 mv:7880 misc:1401 imb:173 pmb:650 smb:527 d:- ref:0 ; in:1898 out:1898 type:P dur:82000000 cpbdur:82000000 q:26.95 tex:118504 mv:9226 misc:1462 imb:239 pmb:706 smb:405 d:- ref:0 ; in:1899 out:1899 type:P dur:82000000 cpbdur:82000000 q:26.74 tex:100945 mv:7374 misc:1441 imb:203 pmb:610 smb:537 d:- ref:0 ; in:1900 out:1900 type:P dur:82000000 cpbdur:82000000 q:27.16 tex:138949 mv:10843 misc:1472 imb:369 pmb:721 smb:260 d:- ref:0 ; in:1901 out:1901 type:P dur:82000000 cpbdur:82000000 q:27.33 tex:130600 mv:10558 misc:1490 imb:448 pmb:586 smb:316 d:- ref:0 ; in:1902 out:1902 type:P dur:82000000 cpbdur:82000000 q:27.59 tex:111863 mv:9278 misc:1443 imb:391 pmb:540 smb:419 d:- ref:0 ; in:1903 out:1903 type:P dur:82000000 cpbdur:82000000 q:27.66 tex:110056 mv:10990 misc:1474 imb:515 pmb:530 smb:305 d:- ref:0 ; in:1904 out:1904 type:P dur:82000000 cpbdur:82000000 q:27.45 tex:104859 mv:10070 misc:1423 imb:524 pmb:540 smb:286 d:- ref:0 ; in:1905 out:1905 type:P dur:82000000 cpbdur:82000000 q:27.24 tex:98385 mv:8191 misc:1304 imb:354 pmb:435 smb:561 d:- ref:0 ; in:1906 out:1906 type:P dur:82000000 cpbdur:82000000 q:26.27 tex:60246 mv:6372 misc:1238 imb:269 pmb:370 smb:711 d:- ref:0 ; in:1907 out:1907 type:P dur:82000000 cpbdur:82000000 q:25.06 tex:45859 mv:6447 misc:1230 imb:350 pmb:371 smb:629 d:- ref:0 ; in:1908 out:1908 type:P dur:82000000 cpbdur:82000000 q:23.80 tex:35674 mv:4785 misc:1109 imb:292 pmb:323 smb:735 d:- ref:0 ; in:1909 out:1909 type:P dur:82000000 cpbdur:82000000 q:21.94 tex:4512 mv:7199 misc:1449 imb:987 pmb:93 smb:270 d:- ref:0 ; in:1910 out:1910 type:P dur:82000000 cpbdur:82000000 q:20.85 tex:22415 mv:7240 misc:1329 imb:898 pmb:54 smb:398 d:- ref:0 ; in:1911 out:1911 type:P dur:82000000 cpbdur:82000000 q:21.74 tex:61313 mv:12553 misc:1414 imb:1279 pmb:71 smb:0 d:- ref:0 ; in:1912 out:1912 type:P dur:82000000 cpbdur:82000000 q:22.73 tex:68722 mv:12643 misc:1419 imb:1266 pmb:77 smb:7 d:- ref:0 ; in:1913 out:1913 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:86704 mv:13301 misc:1403 imb:1202 pmb:109 smb:39 d:- ref:0 ; in:1914 out:1914 type:P dur:82000000 cpbdur:82000000 q:23.81 tex:77540 mv:13460 misc:1392 imb:1131 pmb:138 smb:81 d:- ref:0 ; in:1915 out:1915 type:P dur:82000000 cpbdur:82000000 q:24.31 tex:107308 mv:14449 misc:1403 imb:1075 pmb:197 smb:78 d:- ref:0 ; in:1916 out:1916 type:P dur:82000000 cpbdur:82000000 q:25.15 tex:138247 mv:15439 misc:1394 imb:1004 pmb:255 smb:91 d:- ref:0 ; in:1917 out:1917 type:P dur:82000000 cpbdur:82000000 q:24.47 tex:80232 mv:10226 misc:1422 imb:760 pmb:514 smb:76 d:- ref:0 ; in:1918 out:1918 type:P dur:82000000 cpbdur:82000000 q:25.86 tex:160787 mv:16078 misc:1407 imb:909 pmb:360 smb:81 d:- ref:0 ; in:1919 out:1919 type:P dur:82000000 cpbdur:82000000 q:24.63 tex:58495 mv:8658 misc:1455 imb:557 pmb:612 smb:181 d:- ref:0 ; in:1920 out:1920 type:P dur:82000000 cpbdur:82000000 q:27.56 tex:212556 mv:15567 misc:1389 imb:962 pmb:271 smb:117 d:- ref:0 ; in:1921 out:1921 type:P dur:82000000 cpbdur:82000000 q:25.95 tex:58026 mv:7194 misc:1444 imb:338 pmb:670 smb:342 d:- ref:0 ; in:1922 out:1922 type:P dur:82000000 cpbdur:82000000 q:27.88 tex:233116 mv:14532 misc:1392 imb:903 pmb:336 smb:111 d:- ref:0 ; in:1923 out:1923 type:P dur:82000000 cpbdur:82000000 q:25.53 tex:28970 mv:1758 misc:1296 imb:34 pmb:454 smb:862 d:- ref:0 ; in:1924 out:1924 type:P dur:82000000 cpbdur:82000000 q:27.40 tex:224261 mv:12712 misc:1371 imb:477 pmb:542 smb:331 d:- ref:0 ; in:1925 out:1925 type:P dur:82000000 cpbdur:82000000 q:25.13 tex:59837 mv:3266 misc:1481 imb:63 pmb:826 smb:461 d:- ref:0 ; in:1926 out:1926 type:P dur:82000000 cpbdur:82000000 q:27.35 tex:225100 mv:12387 misc:1241 imb:563 pmb:365 smb:422 d:- ref:0 ; in:1927 out:1927 type:P dur:82000000 cpbdur:82000000 q:25.04 tex:48548 mv:2315 misc:1417 imb:27 pmb:669 smb:654 d:- ref:0 ; in:1928 out:1928 type:P dur:82000000 cpbdur:82000000 q:26.98 tex:209428 mv:11530 misc:1274 imb:476 pmb:428 smb:446 d:- ref:0 ; in:1929 out:1929 type:P dur:82000000 cpbdur:82000000 q:24.78 tex:54499 mv:2620 misc:1441 imb:30 pmb:714 smb:606 d:- ref:0 ; in:1930 out:1930 type:P dur:82000000 cpbdur:82000000 q:26.18 tex:170035 mv:11304 misc:1253 imb:244 pmb:584 smb:522 d:- ref:0 ; in:1931 out:1931 type:P dur:82000000 cpbdur:82000000 q:24.12 tex:68261 mv:2960 misc:1427 imb:51 pmb:788 smb:511 d:- ref:0 ; in:1932 out:1932 type:P dur:82000000 cpbdur:82000000 q:26.08 tex:172755 mv:11554 misc:1251 imb:321 pmb:544 smb:485 d:- ref:0 ; in:1933 out:1933 type:P dur:82000000 cpbdur:82000000 q:24.03 tex:59765 mv:2815 misc:1468 imb:44 pmb:749 smb:557 d:- ref:0 ; in:1934 out:1934 type:P dur:82000000 cpbdur:82000000 q:25.34 tex:161045 mv:9899 misc:1280 imb:174 pmb:623 smb:553 d:- ref:0 ; in:1935 out:1935 type:P dur:82000000 cpbdur:82000000 q:23.22 tex:70350 mv:3231 misc:1507 imb:81 pmb:817 smb:452 d:- ref:0 ; in:1936 out:1936 type:P dur:82000000 cpbdur:82000000 q:25.65 tex:167709 mv:10273 misc:1178 imb:203 pmb:559 smb:588 d:- ref:0 ; in:1937 out:1937 type:P dur:82000000 cpbdur:82000000 q:23.40 tex:84963 mv:2819 misc:1378 imb:49 pmb:735 smb:566 d:- ref:0 ; in:1938 out:1938 type:P dur:82000000 cpbdur:82000000 q:25.46 tex:176883 mv:10894 misc:1279 imb:148 pmb:654 smb:548 d:- ref:0 ; in:1939 out:1939 type:P dur:82000000 cpbdur:82000000 q:23.57 tex:37535 mv:2105 misc:1336 imb:5 pmb:565 smb:780 d:- ref:0 ; in:1940 out:1940 type:P dur:82000000 cpbdur:82000000 q:25.38 tex:163780 mv:10370 misc:1258 imb:207 pmb:616 smb:527 d:- ref:0 ; in:1941 out:1941 type:P dur:82000000 cpbdur:82000000 q:25.73 tex:131939 mv:9956 misc:1209 imb:145 pmb:584 smb:621 d:- ref:0 ; in:1942 out:1942 type:P dur:82000000 cpbdur:82000000 q:25.56 tex:112200 mv:8043 misc:1205 imb:75 pmb:605 smb:670 d:- ref:0 ; in:1943 out:1943 type:P dur:82000000 cpbdur:82000000 q:25.53 tex:109568 mv:8437 misc:1259 imb:71 pmb:643 smb:636 d:- ref:0 ; in:1944 out:1944 type:P dur:82000000 cpbdur:82000000 q:25.97 tex:142500 mv:10200 misc:1228 imb:170 pmb:636 smb:544 d:- ref:0 ; in:1945 out:1945 type:P dur:82000000 cpbdur:82000000 q:25.87 tex:127048 mv:9073 misc:1415 imb:183 pmb:677 smb:490 d:- ref:0 ; in:1946 out:1946 type:P dur:82000000 cpbdur:82000000 q:25.76 tex:117111 mv:10049 misc:1480 imb:226 pmb:759 smb:365 d:- ref:0 ; in:1947 out:1947 type:P dur:82000000 cpbdur:82000000 q:25.64 tex:118583 mv:8689 misc:1312 imb:135 pmb:665 smb:550 d:- ref:0 ; in:1948 out:1948 type:P dur:82000000 cpbdur:82000000 q:25.51 tex:112494 mv:8404 misc:1326 imb:81 pmb:678 smb:591 d:- ref:0 ; in:1949 out:1949 type:P dur:82000000 cpbdur:82000000 q:25.87 tex:138852 mv:9464 misc:1340 imb:136 pmb:692 smb:522 d:- ref:0 ; in:1950 out:1950 type:P dur:82000000 cpbdur:82000000 q:25.74 tex:120253 mv:8278 misc:1293 imb:66 pmb:678 smb:606 d:- ref:0 ; in:1951 out:1951 type:P dur:82000000 cpbdur:82000000 q:25.74 tex:123510 mv:8975 misc:1347 imb:135 pmb:677 smb:538 d:- ref:0 ; in:1952 out:1952 type:P dur:82000000 cpbdur:82000000 q:25.85 tex:132339 mv:9541 misc:1304 imb:179 pmb:649 smb:522 d:- ref:0 ; in:1953 out:1953 type:P dur:82000000 cpbdur:82000000 q:25.73 tex:120923 mv:9443 misc:1466 imb:162 pmb:735 smb:453 d:- ref:0 ; in:1954 out:1954 type:P dur:82000000 cpbdur:82000000 q:25.75 tex:129933 mv:9845 misc:1366 imb:185 pmb:687 smb:478 d:- ref:0 ; in:1955 out:1955 type:P dur:82000000 cpbdur:82000000 q:25.49 tex:148590 mv:10129 misc:1465 imb:140 pmb:879 smb:331 d:- ref:0 ; in:1956 out:1956 type:P dur:82000000 cpbdur:82000000 q:25.35 tex:134919 mv:9231 misc:1378 imb:103 pmb:723 smb:524 d:- ref:0 ; in:1957 out:1957 type:P dur:82000000 cpbdur:82000000 q:23.36 tex:91285 mv:3605 misc:1502 imb:80 pmb:921 smb:349 d:- ref:0 ; in:1958 out:1958 type:P dur:82000000 cpbdur:82000000 q:25.89 tex:172420 mv:11452 misc:1232 imb:252 pmb:574 smb:524 d:- ref:0 ; in:1959 out:1959 type:P dur:82000000 cpbdur:82000000 q:26.31 tex:152344 mv:11254 misc:1218 imb:237 pmb:562 smb:551 d:- ref:0 ; in:1960 out:1960 type:P dur:82000000 cpbdur:82000000 q:26.35 tex:141144 mv:9959 misc:1177 imb:270 pmb:471 smb:609 d:- ref:0 ; in:1961 out:1961 type:P dur:82000000 cpbdur:82000000 q:26.11 tex:118285 mv:8368 misc:1123 imb:148 pmb:516 smb:686 d:- ref:0 ; in:1962 out:1962 type:P dur:82000000 cpbdur:82000000 q:26.06 tex:119848 mv:8225 misc:1151 imb:176 pmb:481 smb:693 d:- ref:0 ; in:1963 out:1963 type:P dur:82000000 cpbdur:82000000 q:23.94 tex:59590 mv:2793 misc:1433 imb:49 pmb:741 smb:560 d:- ref:0 ; in:1964 out:1964 type:P dur:82000000 cpbdur:82000000 q:25.55 tex:138206 mv:8994 misc:1216 imb:368 pmb:340 smb:642 d:- ref:0 ; in:1965 out:1965 type:P dur:82000000 cpbdur:82000000 q:23.57 tex:47187 mv:2460 misc:1401 imb:20 pmb:652 smb:678 d:- ref:0 ; in:1966 out:1966 type:P dur:82000000 cpbdur:82000000 q:24.72 tex:122640 mv:7797 misc:1227 imb:344 pmb:355 smb:651 d:- ref:0 ; in:1967 out:1967 type:P dur:82000000 cpbdur:82000000 q:22.78 tex:54576 mv:2947 misc:1453 imb:55 pmb:705 smb:590 d:- ref:0 ; in:1968 out:1968 type:P dur:82000000 cpbdur:82000000 q:24.22 tex:112893 mv:7786 misc:1409 imb:316 pmb:502 smb:532 d:- ref:0 ; in:1969 out:1969 type:P dur:82000000 cpbdur:82000000 q:22.06 tex:76820 mv:3537 misc:1467 imb:93 pmb:853 smb:404 d:- ref:0 ; in:1970 out:1970 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:81678 mv:5647 misc:1083 imb:291 pmb:211 smb:848 d:- ref:0 ; in:1971 out:1971 type:P dur:82000000 cpbdur:82000000 q:21.37 tex:66087 mv:3438 misc:1435 imb:97 pmb:820 smb:433 d:- ref:0 ; in:1972 out:1972 type:P dur:82000000 cpbdur:82000000 q:21.63 tex:54782 mv:3771 misc:1287 imb:143 pmb:383 smb:824 d:- ref:0 ; in:1973 out:1973 type:P dur:82000000 cpbdur:82000000 q:19.96 tex:65143 mv:2987 misc:1374 imb:66 pmb:781 smb:503 d:- ref:0 ; in:1974 out:1974 type:P dur:82000000 cpbdur:82000000 q:20.51 tex:45420 mv:3275 misc:1281 imb:113 pmb:375 smb:862 d:- ref:0 ; in:1975 out:1975 type:P dur:82000000 cpbdur:82000000 q:18.68 tex:87368 mv:3457 misc:1399 imb:57 pmb:911 smb:382 d:- ref:0 ; in:1976 out:1976 type:P dur:82000000 cpbdur:82000000 q:19.10 tex:45197 mv:3062 misc:1373 imb:100 pmb:516 smb:734 d:- ref:0 ; in:1977 out:1977 type:P dur:82000000 cpbdur:82000000 q:19.96 tex:54245 mv:3241 misc:1298 imb:33 pmb:613 smb:704 d:- ref:0 ; in:1978 out:1978 type:P dur:82000000 cpbdur:82000000 q:19.74 tex:35034 mv:2611 misc:1267 imb:37 pmb:459 smb:854 d:- ref:0 ; in:1979 out:1979 type:P dur:82000000 cpbdur:82000000 q:18.39 tex:63578 mv:3801 misc:1485 imb:86 pmb:885 smb:379 d:- ref:0 ; in:1980 out:1980 type:P dur:82000000 cpbdur:82000000 q:21.11 tex:70782 mv:3150 misc:1020 imb:159 pmb:178 smb:1013 d:- ref:0 ; in:1981 out:1981 type:P dur:82000000 cpbdur:82000000 q:19.73 tex:18045 mv:1706 misc:1329 imb:23 pmb:442 smb:885 d:- ref:0 ; in:1982 out:1982 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:48369 mv:3821 misc:1282 imb:189 pmb:355 smb:806 d:- ref:0 ; in:1983 out:1983 type:P dur:82000000 cpbdur:82000000 q:19.11 tex:40959 mv:3194 misc:1511 imb:46 pmb:808 smb:496 d:- ref:0 ; in:1984 out:1984 type:P dur:82000000 cpbdur:82000000 q:21.42 tex:71563 mv:5238 misc:1247 imb:207 pmb:336 smb:807 d:- ref:0 ; in:1985 out:1985 type:P dur:82000000 cpbdur:82000000 q:19.44 tex:30348 mv:1930 misc:1394 imb:27 pmb:512 smb:811 d:- ref:0 ; in:1986 out:1986 type:P dur:82000000 cpbdur:82000000 q:23.40 tex:103433 mv:6553 misc:1054 imb:298 pmb:267 smb:785 d:- ref:0 ; in:1987 out:1987 type:P dur:82000000 cpbdur:82000000 q:21.30 tex:26819 mv:1834 misc:1339 imb:48 pmb:450 smb:852 d:- ref:0 ; in:1988 out:1988 type:P dur:82000000 cpbdur:82000000 q:24.11 tex:90715 mv:7940 misc:1137 imb:247 pmb:366 smb:737 d:- ref:0 ; in:1989 out:1989 type:P dur:82000000 cpbdur:82000000 q:22.02 tex:38694 mv:2326 misc:1308 imb:65 pmb:500 smb:785 d:- ref:0 ; in:1990 out:1990 type:P dur:82000000 cpbdur:82000000 q:25.00 tex:147313 mv:10857 misc:1238 imb:340 pmb:419 smb:591 d:- ref:0 ; in:1991 out:1991 type:P dur:82000000 cpbdur:82000000 q:23.36 tex:55189 mv:2825 misc:1378 imb:36 pmb:621 smb:693 d:- ref:0 ; in:1992 out:1992 type:P dur:82000000 cpbdur:82000000 q:25.34 tex:152061 mv:11836 misc:1295 imb:382 pmb:494 smb:474 d:- ref:0 ; in:1993 out:1993 type:P dur:82000000 cpbdur:82000000 q:23.15 tex:41373 mv:2191 misc:1340 imb:48 pmb:535 smb:767 d:- ref:0 ; in:1994 out:1994 type:P dur:82000000 cpbdur:82000000 q:25.58 tex:155443 mv:13570 misc:1363 imb:398 pmb:560 smb:392 d:- ref:0 ; in:1995 out:1995 type:P dur:82000000 cpbdur:82000000 q:23.31 tex:72051 mv:3269 misc:1440 imb:109 pmb:733 smb:508 d:- ref:0 ; in:1996 out:1996 type:P dur:82000000 cpbdur:82000000 q:25.73 tex:173072 mv:14275 misc:1397 imb:381 pmb:609 smb:360 d:- ref:0 ; in:1997 out:1997 type:P dur:82000000 cpbdur:82000000 q:23.60 tex:56760 mv:2705 misc:1407 imb:43 pmb:673 smb:634 d:- ref:0 ; in:1998 out:1998 type:P dur:82000000 cpbdur:82000000 q:27.49 tex:232265 mv:17132 misc:1443 imb:568 pmb:624 smb:158 d:- ref:0 ; in:1999 out:1999 type:P dur:82000000 cpbdur:82000000 q:25.53 tex:53653 mv:3174 misc:1373 imb:25 pmb:644 smb:681 d:- ref:0 ; in:2000 out:2000 type:I dur:82000000 cpbdur:82000000 q:20.47 tex:504173 mv:13882 misc:369 imb:1350 pmb:0 smb:0 d:- ref:; in:2001 out:2001 type:P dur:82000000 cpbdur:82000000 q:26.20 tex:10201 mv:693 misc:858 imb:1 pmb:191 smb:1158 d:- ref:0 ; in:2002 out:2002 type:P dur:82000000 cpbdur:82000000 q:27.85 tex:216531 mv:17485 misc:1408 imb:509 pmb:657 smb:184 d:- ref:0 ; in:2003 out:2003 type:P dur:82000000 cpbdur:82000000 q:25.71 tex:53803 mv:2595 misc:1426 imb:18 pmb:709 smb:623 d:- ref:0 ; in:2004 out:2004 type:P dur:82000000 cpbdur:82000000 q:27.31 tex:204787 mv:15773 misc:1376 imb:410 pmb:653 smb:287 d:- ref:0 ; in:2005 out:2005 type:P dur:82000000 cpbdur:82000000 q:25.25 tex:80954 mv:3521 misc:1429 imb:46 pmb:881 smb:423 d:- ref:0 ; in:2006 out:2006 type:P dur:82000000 cpbdur:82000000 q:27.29 tex:205018 mv:14733 misc:1353 imb:466 pmb:579 smb:305 d:- ref:0 ; in:2007 out:2007 type:P dur:82000000 cpbdur:82000000 q:27.98 tex:187601 mv:13608 misc:1303 imb:345 pmb:602 smb:403 d:- ref:0 ; in:2008 out:2008 type:P dur:82000000 cpbdur:82000000 q:28.64 tex:196450 mv:13117 misc:1185 imb:483 pmb:415 smb:452 d:- ref:0 ; in:2009 out:2009 type:P dur:82000000 cpbdur:82000000 q:28.79 tex:176473 mv:10903 misc:1064 imb:329 pmb:395 smb:626 d:- ref:0 ; in:2010 out:2010 type:P dur:82000000 cpbdur:82000000 q:28.47 tex:162320 mv:9663 misc:1289 imb:190 pmb:547 smb:613 d:- ref:0 ; in:2011 out:2011 type:P dur:82000000 cpbdur:82000000 q:27.30 tex:86415 mv:6612 misc:1317 imb:297 pmb:456 smb:597 d:- ref:0 ; in:2012 out:2012 type:P dur:82000000 cpbdur:82000000 q:25.35 tex:65607 mv:4195 misc:1326 imb:128 pmb:709 smb:513 d:- ref:0 ; in:2013 out:2013 type:P dur:82000000 cpbdur:82000000 q:23.91 tex:45139 mv:4043 misc:1322 imb:61 pmb:711 smb:578 d:- ref:0 ; in:2014 out:2014 type:P dur:82000000 cpbdur:82000000 q:22.04 tex:81819 mv:4259 misc:1418 imb:131 pmb:861 smb:358 d:- ref:0 ; in:2015 out:2015 type:P dur:82000000 cpbdur:82000000 q:26.04 tex:175428 mv:13556 misc:1416 imb:1242 pmb:108 smb:0 d:- ref:0 ; in:2016 out:2016 type:P dur:82000000 cpbdur:82000000 q:25.69 tex:43722 mv:6947 misc:907 imb:37 pmb:519 smb:794 d:- ref:0 ; in:2017 out:2017 type:P dur:82000000 cpbdur:82000000 q:24.73 tex:58633 mv:7624 misc:983 imb:73 pmb:548 smb:729 d:- ref:0 ; in:2018 out:2018 type:P dur:82000000 cpbdur:82000000 q:24.27 tex:62482 mv:7919 misc:1063 imb:74 pmb:567 smb:709 d:- ref:0 ; in:2019 out:2019 type:P dur:82000000 cpbdur:82000000 q:24.02 tex:61151 mv:7796 misc:1013 imb:92 pmb:548 smb:710 d:- ref:0 ; in:2020 out:2020 type:P dur:82000000 cpbdur:82000000 q:23.81 tex:58368 mv:7955 misc:965 imb:51 pmb:549 smb:750 d:- ref:0 ; in:2021 out:2021 type:P dur:82000000 cpbdur:82000000 q:23.76 tex:59250 mv:7125 misc:945 imb:35 pmb:535 smb:780 d:- ref:0 ; in:2022 out:2022 type:P dur:82000000 cpbdur:82000000 q:23.79 tex:61804 mv:7314 misc:946 imb:38 pmb:554 smb:758 d:- ref:0 ; in:2023 out:2023 type:P dur:82000000 cpbdur:82000000 q:23.80 tex:60175 mv:7347 misc:934 imb:37 pmb:541 smb:772 d:- ref:0 ; in:2024 out:2024 type:P dur:82000000 cpbdur:82000000 q:23.81 tex:61016 mv:7091 misc:941 imb:32 pmb:531 smb:787 d:- ref:0 ; in:2025 out:2025 type:P dur:82000000 cpbdur:82000000 q:23.68 tex:58831 mv:7229 misc:948 imb:28 pmb:551 smb:771 d:- ref:0 ; in:2026 out:2026 type:P dur:82000000 cpbdur:82000000 q:23.69 tex:60788 mv:7286 misc:974 imb:46 pmb:538 smb:766 d:- ref:0 ; in:2027 out:2027 type:P dur:82000000 cpbdur:82000000 q:23.64 tex:59387 mv:7483 misc:962 imb:47 pmb:547 smb:756 d:- ref:0 ; in:2028 out:2028 type:P dur:82000000 cpbdur:82000000 q:23.70 tex:62350 mv:7355 misc:975 imb:43 pmb:549 smb:758 d:- ref:0 ; in:2029 out:2029 type:P dur:82000000 cpbdur:82000000 q:23.73 tex:62664 mv:7446 misc:954 imb:35 pmb:556 smb:759 d:- ref:0 ; in:2030 out:2030 type:P dur:82000000 cpbdur:82000000 q:23.62 tex:60006 mv:7401 misc:953 imb:34 pmb:541 smb:775 d:- ref:0 ; in:2031 out:2031 type:P dur:82000000 cpbdur:82000000 q:23.63 tex:62264 mv:7280 misc:936 imb:29 pmb:536 smb:785 d:- ref:0 ; in:2032 out:2032 type:P dur:82000000 cpbdur:82000000 q:23.54 tex:60300 mv:7311 misc:957 imb:30 pmb:541 smb:779 d:- ref:0 ; in:2033 out:2033 type:P dur:82000000 cpbdur:82000000 q:23.48 tex:75749 mv:9145 misc:1338 imb:310 pmb:593 smb:447 d:- ref:0 ; in:2034 out:2034 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:56634 mv:7045 misc:929 imb:21 pmb:543 smb:786 d:- ref:0 ; in:2035 out:2035 type:P dur:82000000 cpbdur:82000000 q:23.48 tex:73453 mv:7430 misc:981 imb:57 pmb:558 smb:735 d:- ref:0 ; in:2036 out:2036 type:P dur:82000000 cpbdur:82000000 q:23.55 tex:57854 mv:7417 misc:929 imb:38 pmb:545 smb:767 d:- ref:0 ; in:2037 out:2037 type:P dur:82000000 cpbdur:82000000 q:23.57 tex:60704 mv:7348 misc:916 imb:29 pmb:552 smb:769 d:- ref:0 ; in:2038 out:2038 type:P dur:82000000 cpbdur:82000000 q:23.61 tex:59994 mv:7239 misc:919 imb:38 pmb:535 smb:777 d:- ref:0 ; in:2039 out:2039 type:P dur:82000000 cpbdur:82000000 q:23.60 tex:60490 mv:7024 misc:926 imb:25 pmb:548 smb:777 d:- ref:0 ; in:2040 out:2040 type:P dur:82000000 cpbdur:82000000 q:26.07 tex:112957 mv:7810 misc:905 imb:93 pmb:488 smb:769 d:- ref:0 ; in:2041 out:2041 type:P dur:82000000 cpbdur:82000000 q:25.21 tex:76703 mv:6751 misc:906 imb:28 pmb:561 smb:761 d:- ref:0 ; in:2042 out:2042 type:P dur:82000000 cpbdur:82000000 q:24.75 tex:68733 mv:6809 misc:898 imb:18 pmb:549 smb:783 d:- ref:0 ; in:2043 out:2043 type:P dur:82000000 cpbdur:82000000 q:24.42 tex:78318 mv:6636 misc:918 imb:23 pmb:560 smb:767 d:- ref:0 ; in:2044 out:2044 type:P dur:82000000 cpbdur:82000000 q:24.23 tex:73823 mv:6605 misc:884 imb:27 pmb:547 smb:776 d:- ref:0 ; in:2045 out:2045 type:P dur:82000000 cpbdur:82000000 q:24.05 tex:73040 mv:6486 misc:882 imb:26 pmb:552 smb:772 d:- ref:0 ; in:2046 out:2046 type:P dur:82000000 cpbdur:82000000 q:24.13 tex:76272 mv:6547 misc:893 imb:27 pmb:549 smb:774 d:- ref:0 ; in:2047 out:2047 type:P dur:82000000 cpbdur:82000000 q:24.18 tex:76114 mv:6487 misc:871 imb:30 pmb:543 smb:777 d:- ref:0 ; in:2048 out:2048 type:P dur:82000000 cpbdur:82000000 q:24.22 tex:78089 mv:6440 misc:863 imb:34 pmb:522 smb:794 d:- ref:0 ; in:2049 out:2049 type:P dur:82000000 cpbdur:82000000 q:24.28 tex:75777 mv:6530 misc:869 imb:20 pmb:540 smb:790 d:- ref:0 ; in:2050 out:2050 type:P dur:82000000 cpbdur:82000000 q:24.25 tex:75437 mv:6692 misc:855 imb:31 pmb:518 smb:801 d:- ref:0 ; in:2051 out:2051 type:P dur:82000000 cpbdur:82000000 q:24.15 tex:73930 mv:6559 misc:855 imb:23 pmb:533 smb:794 d:- ref:0 ; in:2052 out:2052 type:P dur:82000000 cpbdur:82000000 q:24.11 tex:76012 mv:6612 misc:872 imb:23 pmb:542 smb:785 d:- ref:0 ; in:2053 out:2053 type:P dur:82000000 cpbdur:82000000 q:24.08 tex:72577 mv:6548 misc:851 imb:26 pmb:528 smb:796 d:- ref:0 ; in:2054 out:2054 type:P dur:82000000 cpbdur:82000000 q:24.14 tex:74916 mv:6600 misc:860 imb:24 pmb:530 smb:796 d:- ref:0 ; in:2055 out:2055 type:P dur:82000000 cpbdur:82000000 q:24.11 tex:73443 mv:6581 misc:880 imb:30 pmb:517 smb:803 d:- ref:0 ; in:2056 out:2056 type:P dur:82000000 cpbdur:82000000 q:24.08 tex:72486 mv:6471 misc:859 imb:20 pmb:527 smb:803 d:- ref:0 ; in:2057 out:2057 type:P dur:82000000 cpbdur:82000000 q:24.01 tex:73405 mv:6306 misc:865 imb:22 pmb:522 smb:806 d:- ref:0 ; in:2058 out:2058 type:P dur:82000000 cpbdur:82000000 q:24.15 tex:74581 mv:6324 misc:879 imb:28 pmb:516 smb:806 d:- ref:0 ; in:2059 out:2059 type:P dur:82000000 cpbdur:82000000 q:24.16 tex:73637 mv:6319 misc:876 imb:32 pmb:531 smb:787 d:- ref:0 ; in:2060 out:2060 type:P dur:82000000 cpbdur:82000000 q:24.19 tex:73847 mv:6508 misc:861 imb:21 pmb:528 smb:801 d:- ref:0 ; in:2061 out:2061 type:P dur:82000000 cpbdur:82000000 q:24.21 tex:74577 mv:6548 misc:899 imb:38 pmb:530 smb:782 d:- ref:0 ; in:2062 out:2062 type:P dur:82000000 cpbdur:82000000 q:24.19 tex:76095 mv:6514 misc:903 imb:25 pmb:534 smb:791 d:- ref:0 ; in:2063 out:2063 type:P dur:82000000 cpbdur:82000000 q:24.27 tex:75346 mv:6550 misc:912 imb:24 pmb:548 smb:778 d:- ref:0 ; in:2064 out:2064 type:P dur:82000000 cpbdur:82000000 q:24.37 tex:80470 mv:6748 misc:910 imb:35 pmb:540 smb:775 d:- ref:0 ; in:2065 out:2065 type:P dur:82000000 cpbdur:82000000 q:24.30 tex:76630 mv:6480 misc:882 imb:25 pmb:536 smb:789 d:- ref:0 ; in:2066 out:2066 type:P dur:82000000 cpbdur:82000000 q:24.24 tex:76922 mv:6747 misc:883 imb:24 pmb:529 smb:797 d:- ref:0 ; in:2067 out:2067 type:P dur:82000000 cpbdur:82000000 q:24.08 tex:72693 mv:6592 misc:907 imb:24 pmb:532 smb:794 d:- ref:0 ; in:2068 out:2068 type:P dur:82000000 cpbdur:82000000 q:24.07 tex:71648 mv:6557 misc:899 imb:26 pmb:525 smb:799 d:- ref:0 ; in:2069 out:2069 type:P dur:82000000 cpbdur:82000000 q:23.91 tex:69534 mv:6237 misc:901 imb:24 pmb:541 smb:785 d:- ref:0 ; in:2070 out:2070 type:P dur:82000000 cpbdur:82000000 q:24.00 tex:72953 mv:6613 misc:922 imb:29 pmb:537 smb:784 d:- ref:0 ; in:2071 out:2071 type:P dur:82000000 cpbdur:82000000 q:24.00 tex:69525 mv:6449 misc:906 imb:27 pmb:539 smb:784 d:- ref:0 ; in:2072 out:2072 type:P dur:82000000 cpbdur:82000000 q:23.94 tex:71142 mv:6505 misc:881 imb:27 pmb:531 smb:792 d:- ref:0 ; in:2073 out:2073 type:P dur:82000000 cpbdur:82000000 q:23.97 tex:70114 mv:6589 misc:889 imb:19 pmb:531 smb:800 d:- ref:0 ; in:2074 out:2074 type:P dur:82000000 cpbdur:82000000 q:24.13 tex:75513 mv:6546 misc:885 imb:30 pmb:530 smb:790 d:- ref:0 ; in:2075 out:2075 type:P dur:82000000 cpbdur:82000000 q:24.07 tex:77589 mv:6581 misc:894 imb:23 pmb:523 smb:804 d:- ref:0 ; in:2076 out:2076 type:P dur:82000000 cpbdur:82000000 q:24.21 tex:74752 mv:6952 misc:904 imb:33 pmb:530 smb:787 d:- ref:0 ; in:2077 out:2077 type:P dur:82000000 cpbdur:82000000 q:24.12 tex:74394 mv:6672 misc:894 imb:33 pmb:530 smb:787 d:- ref:0 ; in:2078 out:2078 type:P dur:82000000 cpbdur:82000000 q:24.08 tex:74903 mv:6767 misc:898 imb:23 pmb:531 smb:796 d:- ref:0 ; in:2079 out:2079 type:P dur:82000000 cpbdur:82000000 q:23.96 tex:73761 mv:6860 misc:907 imb:24 pmb:544 smb:782 d:- ref:0 ; in:2080 out:2080 type:P dur:82000000 cpbdur:82000000 q:23.91 tex:73513 mv:6747 misc:916 imb:31 pmb:539 smb:780 d:- ref:0 ; in:2081 out:2081 type:P dur:82000000 cpbdur:82000000 q:23.90 tex:73700 mv:6645 misc:903 imb:24 pmb:527 smb:799 d:- ref:0 ; in:2082 out:2082 type:P dur:82000000 cpbdur:82000000 q:23.96 tex:76238 mv:6833 misc:913 imb:31 pmb:539 smb:780 d:- ref:0 ; in:2083 out:2083 type:P dur:82000000 cpbdur:82000000 q:24.06 tex:75821 mv:6686 misc:893 imb:21 pmb:538 smb:791 d:- ref:0 ; in:2084 out:2084 type:P dur:82000000 cpbdur:82000000 q:24.10 tex:76377 mv:6967 misc:896 imb:35 pmb:533 smb:782 d:- ref:0 ; in:2085 out:2085 type:P dur:82000000 cpbdur:82000000 q:24.04 tex:75910 mv:6797 misc:925 imb:28 pmb:543 smb:779 d:- ref:0 ; in:2086 out:2086 type:P dur:82000000 cpbdur:82000000 q:24.16 tex:75975 mv:6857 misc:920 imb:37 pmb:537 smb:776 d:- ref:0 ; in:2087 out:2087 type:P dur:82000000 cpbdur:82000000 q:24.23 tex:76157 mv:6736 misc:915 imb:18 pmb:554 smb:778 d:- ref:0 ; in:2088 out:2088 type:P dur:82000000 cpbdur:82000000 q:24.24 tex:79725 mv:6760 misc:891 imb:26 pmb:542 smb:782 d:- ref:0 ; in:2089 out:2089 type:P dur:82000000 cpbdur:82000000 q:24.15 tex:73983 mv:6639 misc:906 imb:17 pmb:539 smb:794 d:- ref:0 ; in:2090 out:2090 type:P dur:82000000 cpbdur:82000000 q:24.14 tex:76342 mv:6799 misc:907 imb:24 pmb:541 smb:785 d:- ref:0 ; in:2091 out:2091 type:P dur:82000000 cpbdur:82000000 q:24.05 tex:74059 mv:6897 misc:908 imb:31 pmb:561 smb:758 d:- ref:0 ; in:2092 out:2092 type:P dur:82000000 cpbdur:82000000 q:23.97 tex:73251 mv:6551 misc:894 imb:25 pmb:545 smb:780 d:- ref:0 ; in:2093 out:2093 type:P dur:82000000 cpbdur:82000000 q:24.00 tex:73863 mv:6767 misc:882 imb:21 pmb:545 smb:784 d:- ref:0 ; in:2094 out:2094 type:P dur:82000000 cpbdur:82000000 q:24.05 tex:74276 mv:6763 misc:881 imb:21 pmb:541 smb:788 d:- ref:0 ; in:2095 out:2095 type:P dur:82000000 cpbdur:82000000 q:24.08 tex:74383 mv:6907 misc:894 imb:34 pmb:537 smb:779 d:- ref:0 ; in:2096 out:2096 type:P dur:82000000 cpbdur:82000000 q:24.25 tex:79726 mv:6782 misc:868 imb:28 pmb:542 smb:780 d:- ref:0 ; in:2097 out:2097 type:P dur:82000000 cpbdur:82000000 q:24.27 tex:79210 mv:6948 misc:866 imb:33 pmb:532 smb:785 d:- ref:0 ; in:2098 out:2098 type:P dur:82000000 cpbdur:82000000 q:24.33 tex:79582 mv:7060 misc:878 imb:28 pmb:552 smb:770 d:- ref:0 ; in:2099 out:2099 type:P dur:82000000 cpbdur:82000000 q:24.31 tex:75684 mv:6950 misc:870 imb:28 pmb:536 smb:786 d:- ref:0 ; in:2100 out:2100 type:P dur:82000000 cpbdur:82000000 q:24.31 tex:79155 mv:6974 misc:887 imb:42 pmb:530 smb:778 d:- ref:0 ; in:2101 out:2101 type:P dur:82000000 cpbdur:82000000 q:24.22 tex:76770 mv:6774 misc:872 imb:29 pmb:538 smb:783 d:- ref:0 ; in:2102 out:2102 type:P dur:82000000 cpbdur:82000000 q:24.27 tex:77467 mv:6788 misc:865 imb:21 pmb:542 smb:787 d:- ref:0 ; in:2103 out:2103 type:P dur:82000000 cpbdur:82000000 q:24.25 tex:76382 mv:6913 misc:881 imb:30 pmb:549 smb:771 d:- ref:0 ; in:2104 out:2104 type:P dur:82000000 cpbdur:82000000 q:24.28 tex:78940 mv:6839 misc:877 imb:37 pmb:539 smb:774 d:- ref:0 ; in:2105 out:2105 type:P dur:82000000 cpbdur:82000000 q:24.33 tex:79945 mv:7013 misc:890 imb:28 pmb:537 smb:785 d:- ref:0 ; in:2106 out:2106 type:P dur:82000000 cpbdur:82000000 q:24.43 tex:77600 mv:7294 misc:890 imb:32 pmb:546 smb:772 d:- ref:0 ; in:2107 out:2107 type:P dur:82000000 cpbdur:82000000 q:24.35 tex:76901 mv:6879 misc:876 imb:32 pmb:545 smb:773 d:- ref:0 ; in:2108 out:2108 type:P dur:82000000 cpbdur:82000000 q:24.34 tex:76709 mv:7073 misc:890 imb:33 pmb:545 smb:772 d:- ref:0 ; in:2109 out:2109 type:P dur:82000000 cpbdur:82000000 q:24.27 tex:74699 mv:6769 misc:892 imb:36 pmb:541 smb:773 d:- ref:0 ; in:2110 out:2110 type:P dur:82000000 cpbdur:82000000 q:24.23 tex:76409 mv:7003 misc:876 imb:26 pmb:549 smb:775 d:- ref:0 ; in:2111 out:2111 type:P dur:82000000 cpbdur:82000000 q:24.21 tex:75615 mv:6897 misc:896 imb:32 pmb:555 smb:763 d:- ref:0 ; in:2112 out:2112 type:P dur:82000000 cpbdur:82000000 q:24.28 tex:78832 mv:7140 misc:900 imb:34 pmb:550 smb:766 d:- ref:0 ; in:2113 out:2113 type:P dur:82000000 cpbdur:82000000 q:24.28 tex:74590 mv:7299 misc:895 imb:38 pmb:563 smb:749 d:- ref:0 ; in:2114 out:2114 type:P dur:82000000 cpbdur:82000000 q:24.27 tex:78406 mv:7173 misc:893 imb:37 pmb:559 smb:754 d:- ref:0 ; in:2115 out:2115 type:P dur:82000000 cpbdur:82000000 q:24.27 tex:72277 mv:6947 misc:904 imb:30 pmb:553 smb:767 d:- ref:0 ; in:2116 out:2116 type:P dur:82000000 cpbdur:82000000 q:24.21 tex:75869 mv:7103 misc:924 imb:34 pmb:563 smb:753 d:- ref:0 ; in:2117 out:2117 type:P dur:82000000 cpbdur:82000000 q:24.17 tex:74137 mv:6888 misc:903 imb:33 pmb:546 smb:771 d:- ref:0 ; in:2118 out:2118 type:P dur:82000000 cpbdur:82000000 q:24.23 tex:76180 mv:6879 misc:925 imb:42 pmb:545 smb:763 d:- ref:0 ; in:2119 out:2119 type:P dur:82000000 cpbdur:82000000 q:24.22 tex:75571 mv:6722 misc:907 imb:25 pmb:542 smb:783 d:- ref:0 ; in:2120 out:2120 type:P dur:82000000 cpbdur:82000000 q:24.25 tex:75671 mv:7024 misc:921 imb:32 pmb:552 smb:766 d:- ref:0 ; in:2121 out:2121 type:P dur:82000000 cpbdur:82000000 q:24.16 tex:72839 mv:6573 misc:924 imb:28 pmb:545 smb:777 d:- ref:0 ; in:2122 out:2122 type:P dur:82000000 cpbdur:82000000 q:24.20 tex:75517 mv:6606 misc:909 imb:31 pmb:546 smb:773 d:- ref:0 ; in:2123 out:2123 type:P dur:82000000 cpbdur:82000000 q:24.16 tex:74238 mv:6841 misc:937 imb:41 pmb:547 smb:762 d:- ref:0 ; in:2124 out:2124 type:P dur:82000000 cpbdur:82000000 q:24.25 tex:78848 mv:6725 misc:931 imb:24 pmb:553 smb:773 d:- ref:0 ; in:2125 out:2125 type:P dur:82000000 cpbdur:82000000 q:24.21 tex:72284 mv:6968 misc:948 imb:31 pmb:556 smb:763 d:- ref:0 ; in:2126 out:2126 type:P dur:82000000 cpbdur:82000000 q:24.05 tex:73824 mv:6771 misc:925 imb:32 pmb:545 smb:773 d:- ref:0 ; in:2127 out:2127 type:P dur:82000000 cpbdur:82000000 q:23.96 tex:71022 mv:6694 misc:932 imb:25 pmb:550 smb:775 d:- ref:0 ; in:2128 out:2128 type:P dur:82000000 cpbdur:82000000 q:23.97 tex:73765 mv:6707 misc:928 imb:21 pmb:557 smb:772 d:- ref:0 ; in:2129 out:2129 type:P dur:82000000 cpbdur:82000000 q:23.91 tex:71540 mv:6577 misc:947 imb:21 pmb:557 smb:772 d:- ref:0 ; in:2130 out:2130 type:P dur:82000000 cpbdur:82000000 q:23.99 tex:75160 mv:6820 misc:932 imb:20 pmb:554 smb:776 d:- ref:0 ; in:2131 out:2131 type:P dur:82000000 cpbdur:82000000 q:24.00 tex:72148 mv:6947 misc:945 imb:28 pmb:559 smb:763 d:- ref:0 ; in:2132 out:2132 type:P dur:82000000 cpbdur:82000000 q:24.15 tex:79973 mv:6938 misc:921 imb:31 pmb:554 smb:765 d:- ref:0 ; in:2133 out:2133 type:P dur:82000000 cpbdur:82000000 q:24.14 tex:75509 mv:6716 misc:919 imb:21 pmb:548 smb:781 d:- ref:0 ; in:2134 out:2134 type:P dur:82000000 cpbdur:82000000 q:24.25 tex:80060 mv:6746 misc:930 imb:26 pmb:552 smb:772 d:- ref:0 ; in:2135 out:2135 type:P dur:82000000 cpbdur:82000000 q:24.27 tex:79121 mv:6667 misc:916 imb:26 pmb:555 smb:769 d:- ref:0 ; in:2136 out:2136 type:P dur:82000000 cpbdur:82000000 q:24.25 tex:79025 mv:6890 misc:909 imb:26 pmb:558 smb:766 d:- ref:0 ; in:2137 out:2137 type:P dur:82000000 cpbdur:82000000 q:24.19 tex:76820 mv:6566 misc:886 imb:22 pmb:546 smb:782 d:- ref:0 ; in:2138 out:2138 type:P dur:82000000 cpbdur:82000000 q:24.24 tex:78153 mv:6618 misc:901 imb:26 pmb:556 smb:768 d:- ref:0 ; in:2139 out:2139 type:P dur:82000000 cpbdur:82000000 q:24.11 tex:74114 mv:6572 misc:890 imb:21 pmb:552 smb:777 d:- ref:0 ; in:2140 out:2140 type:P dur:82000000 cpbdur:82000000 q:24.05 tex:73124 mv:6696 misc:908 imb:29 pmb:560 smb:761 d:- ref:0 ; in:2141 out:2141 type:P dur:82000000 cpbdur:82000000 q:23.94 tex:71582 mv:6425 misc:881 imb:24 pmb:551 smb:775 d:- ref:0 ; in:2142 out:2142 type:P dur:82000000 cpbdur:82000000 q:24.05 tex:75084 mv:6576 misc:884 imb:29 pmb:532 smb:789 d:- ref:0 ; in:2143 out:2143 type:P dur:82000000 cpbdur:82000000 q:24.16 tex:75173 mv:6472 misc:875 imb:22 pmb:552 smb:776 d:- ref:0 ; in:2144 out:2144 type:P dur:82000000 cpbdur:82000000 q:24.22 tex:77823 mv:6605 misc:892 imb:26 pmb:537 smb:787 d:- ref:0 ; in:2145 out:2145 type:P dur:82000000 cpbdur:82000000 q:24.25 tex:74230 mv:6512 misc:858 imb:29 pmb:538 smb:783 d:- ref:0 ; in:2146 out:2146 type:P dur:82000000 cpbdur:82000000 q:24.21 tex:73202 mv:6461 misc:849 imb:31 pmb:519 smb:800 d:- ref:0 ; in:2147 out:2147 type:P dur:82000000 cpbdur:82000000 q:24.74 tex:89258 mv:7070 misc:920 imb:88 pmb:528 smb:734 d:- ref:0 ; in:2148 out:2148 type:P dur:82000000 cpbdur:82000000 q:26.21 tex:127200 mv:7386 misc:958 imb:210 pmb:418 smb:722 d:- ref:0 ; in:2149 out:2149 type:P dur:82000000 cpbdur:82000000 q:26.51 tex:112323 mv:8717 misc:1136 imb:429 pmb:393 smb:528 d:- ref:0 ; in:2150 out:2150 type:P dur:82000000 cpbdur:82000000 q:26.58 tex:109177 mv:10744 misc:1351 imb:810 pmb:350 smb:190 d:- ref:0 ; in:2151 out:2151 type:P dur:82000000 cpbdur:82000000 q:26.36 tex:108311 mv:7746 misc:959 imb:356 pmb:302 smb:692 d:- ref:0 ; in:2152 out:2152 type:P dur:82000000 cpbdur:82000000 q:26.02 tex:88016 mv:11984 misc:1416 imb:1067 pmb:224 smb:59 d:- ref:0 ; in:2153 out:2153 type:P dur:82000000 cpbdur:82000000 q:25.29 tex:68628 mv:11466 misc:1362 imb:1009 pmb:208 smb:133 d:- ref:0 ; in:2154 out:2154 type:P dur:82000000 cpbdur:82000000 q:23.60 tex:14553 mv:6274 misc:1021 imb:672 pmb:38 smb:640 d:- ref:0 ; in:2155 out:2155 type:P dur:82000000 cpbdur:82000000 q:21.55 tex:2863 mv:5271 misc:1146 imb:775 pmb:3 smb:572 d:- ref:0 ; in:2156 out:2156 type:P dur:82000000 cpbdur:82000000 q:19.60 tex:2252 mv:5141 misc:1207 imb:784 pmb:15 smb:551 d:- ref:0 ; in:2157 out:2157 type:P dur:82000000 cpbdur:82000000 q:17.33 tex:1424 mv:3520 misc:1080 imb:535 pmb:64 smb:751 d:- ref:0 ; in:2158 out:2158 type:P dur:82000000 cpbdur:82000000 q:14.94 tex:244 mv:168 misc:268 imb:24 pmb:2 smb:1324 d:- ref:0 ; in:2159 out:2159 type:P dur:82000000 cpbdur:82000000 q:12.61 tex:2647 mv:1097 misc:608 imb:126 pmb:13 smb:1211 d:- ref:0 ; in:2160 out:2160 type:P dur:82000000 cpbdur:82000000 q:10.43 tex:7471 mv:8695 misc:1418 imb:1305 pmb:45 smb:0 d:- ref:0 ; in:2161 out:2161 type:P dur:82000000 cpbdur:82000000 q:10.00 tex:342 mv:790 misc:612 imb:128 pmb:0 smb:1222 d:- ref:0 ; in:2162 out:2162 type:P dur:82000000 cpbdur:82000000 q:10.00 tex:0 mv:0 misc:88 imb:0 pmb:0 smb:1350 d:- ref:0 ; in:2163 out:2163 type:P dur:82000000 cpbdur:82000000 q:10.00 tex:0 mv:0 misc:88 imb:0 pmb:0 smb:1350 d:- ref:0 ; in:2164 out:2164 type:P dur:82000000 cpbdur:82000000 q:10.00 tex:0 mv:0 misc:88 imb:0 pmb:0 smb:1350 d:- ref:0 ; in:2165 out:2165 type:P dur:82000000 cpbdur:82000000 q:10.00 tex:0 mv:0 misc:88 imb:0 pmb:0 smb:1350 d:- ref:0 ; in:2166 out:2166 type:P dur:82000000 cpbdur:82000000 q:10.00 tex:0 mv:0 misc:88 imb:0 pmb:0 smb:1350 d:- ref:0 ; in:2167 out:2167 type:P dur:82000000 cpbdur:82000000 q:10.00 tex:0 mv:0 misc:88 imb:0 pmb:0 smb:1350 d:- ref:0 ; in:2168 out:2168 type:P dur:82000000 cpbdur:82000000 q:10.00 tex:0 mv:0 misc:88 imb:0 pmb:0 smb:1350 d:- ref:0 ; in:2169 out:2169 type:P dur:82000000 cpbdur:82000000 q:10.00 tex:0 mv:0 misc:88 imb:0 pmb:0 smb:1350 d:- ref:0 ; in:2170 out:2170 type:P dur:82000000 cpbdur:82000000 q:10.00 tex:0 mv:0 misc:88 imb:0 pmb:0 smb:1350 d:- ref:0 ; in:2171 out:2171 type:P dur:82000000 cpbdur:82000000 q:10.00 tex:0 mv:0 misc:88 imb:0 pmb:0 smb:1350 d:- ref:0 ; in:2172 out:2172 type:P dur:82000000 cpbdur:82000000 q:10.00 tex:0 mv:0 misc:88 imb:0 pmb:0 smb:1350 d:- ref:0 ; in:2173 out:2173 type:P dur:82000000 cpbdur:82000000 q:10.00 tex:0 mv:0 misc:88 imb:0 pmb:0 smb:1350 d:- ref:0 ; in:2174 out:2174 type:P dur:82000000 cpbdur:82000000 q:10.00 tex:4594 mv:942 misc:576 imb:99 pmb:20 smb:1231 d:- ref:0 ; in:2175 out:2175 type:P dur:82000000 cpbdur:82000000 q:11.25 tex:16996 mv:4153 misc:931 imb:416 pmb:53 smb:881 d:- ref:0 ; in:2176 out:2176 type:P dur:82000000 cpbdur:82000000 q:15.25 tex:20787 mv:7727 misc:1454 imb:827 pmb:119 smb:404 d:- ref:0 ; in:2177 out:2177 type:P dur:82000000 cpbdur:82000000 q:17.88 tex:28244 mv:8428 misc:1488 imb:711 pmb:382 smb:257 d:- ref:0 ; in:2178 out:2178 type:P dur:82000000 cpbdur:82000000 q:19.93 tex:47731 mv:11345 misc:1444 imb:934 pmb:329 smb:87 d:- ref:0 ; in:2179 out:2179 type:P dur:82000000 cpbdur:82000000 q:20.86 tex:59455 mv:10711 misc:1466 imb:779 pmb:473 smb:98 d:- ref:0 ; in:2180 out:2180 type:P dur:82000000 cpbdur:82000000 q:21.56 tex:68487 mv:11342 misc:1435 imb:740 pmb:566 smb:44 d:- ref:0 ; in:2181 out:2181 type:P dur:82000000 cpbdur:82000000 q:22.45 tex:89954 mv:12797 misc:1425 imb:740 pmb:587 smb:23 d:- ref:0 ; in:2182 out:2182 type:P dur:82000000 cpbdur:82000000 q:22.86 tex:82072 mv:11617 misc:1431 imb:663 pmb:645 smb:42 d:- ref:0 ; in:2183 out:2183 type:P dur:82000000 cpbdur:82000000 q:23.32 tex:100631 mv:12522 misc:1439 imb:677 pmb:648 smb:25 d:- ref:0 ; in:2184 out:2184 type:P dur:82000000 cpbdur:82000000 q:23.87 tex:97113 mv:12949 misc:1426 imb:660 pmb:665 smb:25 d:- ref:0 ; in:2185 out:2185 type:P dur:82000000 cpbdur:82000000 q:24.17 tex:109151 mv:12411 misc:1422 imb:641 pmb:683 smb:26 d:- ref:0 ; in:2186 out:2186 type:P dur:82000000 cpbdur:82000000 q:24.61 tex:110295 mv:12973 misc:1428 imb:647 pmb:685 smb:18 d:- ref:0 ; in:2187 out:2187 type:P dur:82000000 cpbdur:82000000 q:24.87 tex:122003 mv:12680 misc:1429 imb:614 pmb:714 smb:22 d:- ref:0 ; in:2188 out:2188 type:P dur:82000000 cpbdur:82000000 q:25.37 tex:141064 mv:13105 misc:1431 imb:645 pmb:685 smb:20 d:- ref:0 ; in:2189 out:2189 type:P dur:82000000 cpbdur:82000000 q:25.62 tex:125144 mv:12431 misc:1425 imb:616 pmb:723 smb:11 d:- ref:0 ; in:2190 out:2190 type:P dur:82000000 cpbdur:82000000 q:25.57 tex:117022 mv:12083 misc:1431 imb:588 pmb:733 smb:29 d:- ref:0 ; in:2191 out:2191 type:P dur:82000000 cpbdur:82000000 q:25.57 tex:127000 mv:12056 misc:1432 imb:583 pmb:742 smb:25 d:- ref:0 ; in:2192 out:2192 type:P dur:82000000 cpbdur:82000000 q:25.69 tex:129281 mv:12260 misc:1427 imb:586 pmb:754 smb:10 d:- ref:0 ; in:2193 out:2193 type:P dur:82000000 cpbdur:82000000 q:25.71 tex:132046 mv:11929 misc:1425 imb:553 pmb:771 smb:26 d:- ref:0 ; in:2194 out:2194 type:P dur:82000000 cpbdur:82000000 q:25.94 tex:146037 mv:12319 misc:1420 imb:581 pmb:755 smb:14 d:- ref:0 ; in:2195 out:2195 type:P dur:82000000 cpbdur:82000000 q:26.02 tex:145280 mv:12242 misc:1438 imb:549 pmb:778 smb:23 d:- ref:0 ; in:2196 out:2196 type:P dur:82000000 cpbdur:82000000 q:25.63 tex:100947 mv:9352 misc:1461 imb:156 pmb:908 smb:286 d:- ref:0 ; in:2197 out:2197 type:P dur:82000000 cpbdur:82000000 q:24.82 tex:109050 mv:9808 misc:1478 imb:280 pmb:948 smb:122 d:- ref:0 ; in:2198 out:2198 type:P dur:82000000 cpbdur:82000000 q:24.60 tex:105240 mv:8216 misc:1424 imb:57 pmb:902 smb:391 d:- ref:0 ; in:2199 out:2199 type:P dur:82000000 cpbdur:82000000 q:24.33 tex:118460 mv:8795 misc:1465 imb:86 pmb:913 smb:351 d:- ref:0 ; in:2200 out:2200 type:P dur:82000000 cpbdur:82000000 q:24.35 tex:115233 mv:8192 misc:1455 imb:56 pmb:880 smb:414 d:- ref:0 ; in:2201 out:2201 type:P dur:82000000 cpbdur:82000000 q:23.94 tex:87384 mv:6457 misc:1279 imb:28 pmb:623 smb:699 d:- ref:0 ; in:2202 out:2202 type:P dur:82000000 cpbdur:82000000 q:23.71 tex:84121 mv:6219 misc:1228 imb:24 pmb:563 smb:763 d:- ref:0 ; in:2203 out:2203 type:P dur:82000000 cpbdur:82000000 q:23.93 tex:100045 mv:7514 misc:1305 imb:32 pmb:756 smb:562 d:- ref:0 ; in:2204 out:2204 type:P dur:82000000 cpbdur:82000000 q:23.78 tex:84283 mv:6689 misc:1220 imb:19 pmb:617 smb:714 d:- ref:0 ; in:2205 out:2205 type:P dur:82000000 cpbdur:82000000 q:23.89 tex:91895 mv:6900 misc:1269 imb:28 pmb:660 smb:662 d:- ref:0 ; in:2206 out:2206 type:P dur:82000000 cpbdur:82000000 q:23.77 tex:85409 mv:6385 misc:1166 imb:18 pmb:583 smb:749 d:- ref:0 ; in:2207 out:2207 type:P dur:82000000 cpbdur:82000000 q:23.68 tex:77755 mv:5717 misc:1144 imb:18 pmb:537 smb:795 d:- ref:0 ; in:2208 out:2208 type:P dur:82000000 cpbdur:82000000 q:23.73 tex:82422 mv:6131 misc:1087 imb:20 pmb:557 smb:773 d:- ref:0 ; in:2209 out:2209 type:P dur:82000000 cpbdur:82000000 q:23.74 tex:87211 mv:6496 misc:1221 imb:23 pmb:650 smb:677 d:- ref:0 ; in:2210 out:2210 type:P dur:82000000 cpbdur:82000000 q:23.82 tex:88374 mv:6758 misc:1284 imb:23 pmb:668 smb:659 d:- ref:0 ; in:2211 out:2211 type:P dur:82000000 cpbdur:82000000 q:24.00 tex:97708 mv:6969 misc:1211 imb:36 pmb:681 smb:633 d:- ref:0 ; in:2212 out:2212 type:P dur:82000000 cpbdur:82000000 q:24.03 tex:105318 mv:7401 misc:1225 imb:37 pmb:731 smb:582 d:- ref:0 ; in:2213 out:2213 type:P dur:82000000 cpbdur:82000000 q:23.92 tex:93551 mv:6766 misc:1347 imb:27 pmb:730 smb:593 d:- ref:0 ; in:2214 out:2214 type:P dur:82000000 cpbdur:82000000 q:24.24 tex:113902 mv:7794 misc:1376 imb:38 pmb:802 smb:510 d:- ref:0 ; in:2215 out:2215 type:P dur:82000000 cpbdur:82000000 q:24.24 tex:98115 mv:7867 misc:1442 imb:42 pmb:789 smb:519 d:- ref:0 ; in:2216 out:2216 type:P dur:82000000 cpbdur:82000000 q:24.41 tex:114576 mv:8106 misc:1366 imb:30 pmb:788 smb:532 d:- ref:0 ; in:2217 out:2217 type:P dur:82000000 cpbdur:82000000 q:24.50 tex:111838 mv:7817 misc:1393 imb:34 pmb:765 smb:551 d:- ref:0 ; in:2218 out:2218 type:P dur:82000000 cpbdur:82000000 q:24.44 tex:103606 mv:7548 misc:1398 imb:32 pmb:738 smb:580 d:- ref:0 ; in:2219 out:2219 type:P dur:82000000 cpbdur:82000000 q:24.66 tex:100051 mv:7571 misc:1346 imb:40 pmb:721 smb:589 d:- ref:0 ; in:2220 out:2220 type:P dur:82000000 cpbdur:82000000 q:24.62 tex:99042 mv:7796 misc:1394 imb:34 pmb:776 smb:540 d:- ref:0 ; in:2221 out:2221 type:P dur:82000000 cpbdur:82000000 q:25.33 tex:146247 mv:11376 misc:1481 imb:141 pmb:910 smb:299 d:- ref:0 ; in:2222 out:2222 type:P dur:82000000 cpbdur:82000000 q:25.43 tex:143986 mv:11054 misc:1480 imb:134 pmb:904 smb:312 d:- ref:0 ; in:2223 out:2223 type:P dur:82000000 cpbdur:82000000 q:25.20 tex:124357 mv:9571 misc:1448 imb:53 pmb:849 smb:448 d:- ref:0 ; in:2224 out:2224 type:P dur:82000000 cpbdur:82000000 q:25.16 tex:134432 mv:10117 misc:1443 imb:54 pmb:857 smb:439 d:- ref:0 ; in:2225 out:2225 type:P dur:82000000 cpbdur:82000000 q:25.04 tex:123528 mv:9652 misc:1476 imb:59 pmb:878 smb:413 d:- ref:0 ; in:2226 out:2226 type:P dur:82000000 cpbdur:82000000 q:25.11 tex:130676 mv:10127 misc:1477 imb:71 pmb:887 smb:392 d:- ref:0 ; in:2227 out:2227 type:P dur:82000000 cpbdur:82000000 q:25.04 tex:117391 mv:10196 misc:1485 imb:69 pmb:886 smb:395 d:- ref:0 ; in:2228 out:2228 type:P dur:82000000 cpbdur:82000000 q:24.86 tex:111576 mv:9677 misc:1475 imb:56 pmb:867 smb:427 d:- ref:0 ; in:2229 out:2229 type:P dur:82000000 cpbdur:82000000 q:25.09 tex:126477 mv:10184 misc:1515 imb:76 pmb:954 smb:320 d:- ref:0 ; in:2230 out:2230 type:P dur:82000000 cpbdur:82000000 q:25.07 tex:117608 mv:9156 misc:1508 imb:55 pmb:840 smb:455 d:- ref:0 ; in:2231 out:2231 type:P dur:82000000 cpbdur:82000000 q:25.27 tex:128884 mv:9668 misc:1488 imb:54 pmb:952 smb:344 d:- ref:0 ; in:2232 out:2232 type:P dur:82000000 cpbdur:82000000 q:25.35 tex:126416 mv:9623 misc:1497 imb:71 pmb:861 smb:418 d:- ref:0 ; in:2233 out:2233 type:P dur:82000000 cpbdur:82000000 q:25.32 tex:122999 mv:9061 misc:1500 imb:53 pmb:875 smb:422 d:- ref:0 ; in:2234 out:2234 type:P dur:82000000 cpbdur:82000000 q:25.29 tex:128392 mv:9796 misc:1500 imb:55 pmb:964 smb:331 d:- ref:0 ; in:2235 out:2235 type:P dur:82000000 cpbdur:82000000 q:25.27 tex:117138 mv:9144 misc:1510 imb:59 pmb:902 smb:389 d:- ref:0 ; in:2236 out:2236 type:P dur:82000000 cpbdur:82000000 q:25.20 tex:117988 mv:9235 misc:1529 imb:59 pmb:907 smb:384 d:- ref:0 ; in:2237 out:2237 type:P dur:82000000 cpbdur:82000000 q:24.93 tex:106496 mv:8339 misc:1501 imb:52 pmb:851 smb:447 d:- ref:0 ; in:2238 out:2238 type:P dur:82000000 cpbdur:82000000 q:24.91 tex:113500 mv:9137 misc:1507 imb:73 pmb:881 smb:396 d:- ref:0 ; in:2239 out:2239 type:P dur:82000000 cpbdur:82000000 q:24.75 tex:108173 mv:9413 misc:1478 imb:55 pmb:923 smb:372 d:- ref:0 ; in:2240 out:2240 type:P dur:82000000 cpbdur:82000000 q:24.43 tex:109617 mv:8830 misc:1537 imb:50 pmb:966 smb:334 d:- ref:0 ; in:2241 out:2241 type:P dur:82000000 cpbdur:82000000 q:24.58 tex:107327 mv:9899 misc:1478 imb:57 pmb:905 smb:388 d:- ref:0 ; in:2242 out:2242 type:P dur:82000000 cpbdur:82000000 q:24.91 tex:122393 mv:10151 misc:1456 imb:64 pmb:935 smb:351 d:- ref:0 ; in:2243 out:2243 type:P dur:82000000 cpbdur:82000000 q:24.85 tex:110587 mv:9114 misc:1515 imb:43 pmb:944 smb:363 d:- ref:0 ; in:2244 out:2244 type:P dur:82000000 cpbdur:82000000 q:24.99 tex:114886 mv:8805 misc:1469 imb:43 pmb:891 smb:416 d:- ref:0 ; in:2245 out:2245 type:P dur:82000000 cpbdur:82000000 q:24.88 tex:106635 mv:8455 misc:1486 imb:31 pmb:867 smb:452 d:- ref:0 ; in:2246 out:2246 type:P dur:82000000 cpbdur:82000000 q:25.17 tex:147955 mv:10794 misc:1475 imb:77 pmb:1042 smb:231 d:- ref:0 ; in:2247 out:2247 type:P dur:82000000 cpbdur:82000000 q:25.03 tex:120731 mv:9178 misc:1459 imb:49 pmb:916 smb:385 d:- ref:0 ; in:2248 out:2248 type:P dur:82000000 cpbdur:82000000 q:24.93 tex:109650 mv:8727 misc:1471 imb:41 pmb:845 smb:464 d:- ref:0 ; in:2249 out:2249 type:P dur:82000000 cpbdur:82000000 q:24.82 tex:108379 mv:8095 misc:1398 imb:51 pmb:781 smb:518 d:- ref:0 ; in:2250 out:2250 type:I dur:82000000 cpbdur:82000000 q:21.71 tex:563044 mv:14988 misc:376 imb:1350 pmb:0 smb:0 d:- ref:; in:2251 out:2251 type:P dur:82000000 cpbdur:82000000 q:27.85 tex:58623 mv:7286 misc:1171 imb:31 pmb:592 smb:727 d:- ref:0 ; in:2252 out:2252 type:P dur:82000000 cpbdur:82000000 q:26.63 tex:79325 mv:8474 misc:1369 imb:49 pmb:744 smb:557 d:- ref:0 ; in:2253 out:2253 type:P dur:82000000 cpbdur:82000000 q:25.83 tex:91478 mv:8374 misc:1388 imb:39 pmb:780 smb:531 d:- ref:0 ; in:2254 out:2254 type:P dur:82000000 cpbdur:82000000 q:25.52 tex:103372 mv:9663 misc:1389 imb:55 pmb:859 smb:436 d:- ref:0 ; in:2255 out:2255 type:P dur:82000000 cpbdur:82000000 q:25.45 tex:137795 mv:9747 misc:1458 imb:58 pmb:1033 smb:259 d:- ref:0 ; in:2256 out:2256 type:P dur:82000000 cpbdur:82000000 q:25.28 tex:117426 mv:9020 misc:1418 imb:42 pmb:900 smb:408 d:- ref:0 ; in:2257 out:2257 type:P dur:82000000 cpbdur:82000000 q:25.07 tex:105559 mv:8747 misc:1454 imb:50 pmb:871 smb:429 d:- ref:0 ; in:2258 out:2258 type:P dur:82000000 cpbdur:82000000 q:25.15 tex:121920 mv:9154 misc:1414 imb:44 pmb:914 smb:392 d:- ref:0 ; in:2259 out:2259 type:P dur:82000000 cpbdur:82000000 q:25.09 tex:109104 mv:8796 misc:1356 imb:51 pmb:826 smb:473 d:- ref:0 ; in:2260 out:2260 type:P dur:82000000 cpbdur:82000000 q:25.39 tex:140404 mv:9995 misc:1433 imb:56 pmb:939 smb:355 d:- ref:0 ; in:2261 out:2261 type:P dur:82000000 cpbdur:82000000 q:25.34 tex:126162 mv:8949 misc:1393 imb:59 pmb:865 smb:426 d:- ref:0 ; in:2262 out:2262 type:P dur:82000000 cpbdur:82000000 q:25.18 tex:112343 mv:8938 misc:1415 imb:66 pmb:828 smb:456 d:- ref:0 ; in:2263 out:2263 type:P dur:82000000 cpbdur:82000000 q:24.96 tex:100252 mv:7991 misc:1357 imb:46 pmb:725 smb:579 d:- ref:0 ; in:2264 out:2264 type:P dur:82000000 cpbdur:82000000 q:25.05 tex:114342 mv:8891 misc:1391 imb:41 pmb:871 smb:438 d:- ref:0 ; in:2265 out:2265 type:P dur:82000000 cpbdur:82000000 q:25.10 tex:126004 mv:9470 misc:1342 imb:70 pmb:868 smb:412 d:- ref:0 ; in:2266 out:2266 type:P dur:82000000 cpbdur:82000000 q:25.26 tex:130916 mv:9334 misc:1366 imb:38 pmb:876 smb:436 d:- ref:0 ; in:2267 out:2267 type:P dur:82000000 cpbdur:82000000 q:25.15 tex:112861 mv:8592 misc:1275 imb:43 pmb:784 smb:523 d:- ref:0 ; in:2268 out:2268 type:P dur:82000000 cpbdur:82000000 q:25.02 tex:107998 mv:8755 misc:1351 imb:47 pmb:847 smb:456 d:- ref:0 ; in:2269 out:2269 type:P dur:82000000 cpbdur:82000000 q:25.05 tex:116397 mv:8532 misc:1239 imb:37 pmb:780 smb:533 d:- ref:0 ; in:2270 out:2270 type:P dur:82000000 cpbdur:82000000 q:25.11 tex:116121 mv:8832 misc:1343 imb:30 pmb:858 smb:462 d:- ref:0 ; in:2271 out:2271 type:P dur:82000000 cpbdur:82000000 q:25.10 tex:129136 mv:8862 misc:1250 imb:45 pmb:842 smb:463 d:- ref:0 ; in:2272 out:2272 type:P dur:82000000 cpbdur:82000000 q:25.28 tex:135211 mv:8831 misc:1302 imb:64 pmb:815 smb:471 d:- ref:0 ; in:2273 out:2273 type:P dur:82000000 cpbdur:82000000 q:25.27 tex:135568 mv:9121 misc:1239 imb:61 pmb:829 smb:460 d:- ref:0 ; in:2274 out:2274 type:P dur:82000000 cpbdur:82000000 q:25.21 tex:118790 mv:8701 misc:1317 imb:45 pmb:831 smb:474 d:- ref:0 ; in:2275 out:2275 type:P dur:82000000 cpbdur:82000000 q:25.08 tex:122258 mv:8871 misc:1247 imb:53 pmb:771 smb:526 d:- ref:0 ; in:2276 out:2276 type:P dur:82000000 cpbdur:82000000 q:25.03 tex:116139 mv:8887 misc:1262 imb:51 pmb:743 smb:556 d:- ref:0 ; in:2277 out:2277 type:P dur:82000000 cpbdur:82000000 q:25.25 tex:125508 mv:9234 misc:1242 imb:49 pmb:814 smb:487 d:- ref:0 ; in:2278 out:2278 type:P dur:82000000 cpbdur:82000000 q:25.21 tex:122853 mv:8918 misc:1181 imb:48 pmb:728 smb:574 d:- ref:0 ; in:2279 out:2279 type:P dur:82000000 cpbdur:82000000 q:25.32 tex:116829 mv:8641 misc:1266 imb:48 pmb:737 smb:565 d:- ref:0 ; in:2280 out:2280 type:P dur:82000000 cpbdur:82000000 q:25.35 tex:117460 mv:8445 misc:1175 imb:41 pmb:673 smb:636 d:- ref:0 ; in:2281 out:2281 type:P dur:82000000 cpbdur:82000000 q:25.24 tex:117482 mv:9171 misc:1379 imb:45 pmb:837 smb:468 d:- ref:0 ; in:2282 out:2282 type:P dur:82000000 cpbdur:82000000 q:24.90 tex:108145 mv:8462 misc:1217 imb:34 pmb:716 smb:600 d:- ref:0 ; in:2283 out:2283 type:P dur:82000000 cpbdur:82000000 q:24.96 tex:131474 mv:9535 misc:1263 imb:59 pmb:823 smb:468 d:- ref:0 ; in:2284 out:2284 type:P dur:82000000 cpbdur:82000000 q:24.70 tex:114766 mv:8314 misc:1216 imb:49 pmb:734 smb:567 d:- ref:0 ; in:2285 out:2285 type:P dur:82000000 cpbdur:82000000 q:24.59 tex:109507 mv:8400 misc:1189 imb:30 pmb:764 smb:556 d:- ref:0 ; in:2286 out:2286 type:P dur:82000000 cpbdur:82000000 q:24.62 tex:120303 mv:9136 misc:1161 imb:48 pmb:758 smb:544 d:- ref:0 ; in:2287 out:2287 type:P dur:82000000 cpbdur:82000000 q:24.46 tex:119759 mv:8451 misc:1350 imb:60 pmb:783 smb:507 d:- ref:0 ; in:2288 out:2288 type:P dur:82000000 cpbdur:82000000 q:24.39 tex:112141 mv:7506 misc:1249 imb:37 pmb:740 smb:573 d:- ref:0 ; in:2289 out:2289 type:P dur:82000000 cpbdur:82000000 q:24.29 tex:101198 mv:7152 misc:1282 imb:41 pmb:696 smb:613 d:- ref:0 ; in:2290 out:2290 type:P dur:82000000 cpbdur:82000000 q:24.37 tex:101991 mv:7711 misc:1410 imb:79 pmb:725 smb:546 d:- ref:0 ; in:2291 out:2291 type:P dur:82000000 cpbdur:82000000 q:24.48 tex:111440 mv:8881 misc:1463 imb:83 pmb:871 smb:396 d:- ref:0 ; in:2292 out:2292 type:P dur:82000000 cpbdur:82000000 q:24.63 tex:97611 mv:8182 misc:1367 imb:117 pmb:650 smb:583 d:- ref:0 ; in:2293 out:2293 type:P dur:82000000 cpbdur:82000000 q:24.42 tex:98558 mv:8217 misc:1433 imb:108 pmb:713 smb:529 d:- ref:0 ; in:2294 out:2294 type:P dur:82000000 cpbdur:82000000 q:24.25 tex:96253 mv:7270 misc:1213 imb:53 pmb:580 smb:717 d:- ref:0 ; in:2295 out:2295 type:P dur:82000000 cpbdur:82000000 q:24.65 tex:101444 mv:7717 misc:1183 imb:42 pmb:679 smb:629 d:- ref:0 ; in:2296 out:2296 type:P dur:82000000 cpbdur:82000000 q:24.84 tex:107838 mv:7731 misc:1119 imb:48 pmb:651 smb:651 d:- ref:0 ; in:2297 out:2297 type:P dur:82000000 cpbdur:82000000 q:24.73 tex:103284 mv:7861 misc:1151 imb:38 pmb:689 smb:623 d:- ref:0 ; in:2298 out:2298 type:P dur:82000000 cpbdur:82000000 q:24.67 tex:97964 mv:7358 misc:1134 imb:36 pmb:608 smb:706 d:- ref:0 ; in:2299 out:2299 type:P dur:82000000 cpbdur:82000000 q:24.51 tex:104392 mv:7886 misc:1194 imb:42 pmb:662 smb:646 d:- ref:0 ; in:2300 out:2300 type:P dur:82000000 cpbdur:82000000 q:24.25 tex:107184 mv:7928 misc:1280 imb:49 pmb:674 smb:627 d:- ref:0 ; in:2301 out:2301 type:P dur:82000000 cpbdur:82000000 q:24.05 tex:94731 mv:7298 misc:1043 imb:51 pmb:522 smb:777 d:- ref:0 ; in:2302 out:2302 type:P dur:82000000 cpbdur:82000000 q:23.88 tex:100866 mv:7420 misc:1154 imb:49 pmb:644 smb:657 d:- ref:0 ; in:2303 out:2303 type:P dur:82000000 cpbdur:82000000 q:23.90 tex:104165 mv:7353 misc:1186 imb:52 pmb:655 smb:643 d:- ref:0 ; in:2304 out:2304 type:P dur:82000000 cpbdur:82000000 q:23.92 tex:93059 mv:6836 misc:1105 imb:31 pmb:600 smb:719 d:- ref:0 ; in:2305 out:2305 type:P dur:82000000 cpbdur:82000000 q:23.89 tex:86276 mv:6708 misc:1144 imb:32 pmb:632 smb:686 d:- ref:0 ; in:2306 out:2306 type:P dur:82000000 cpbdur:82000000 q:23.83 tex:85998 mv:6635 misc:1135 imb:27 pmb:613 smb:710 d:- ref:0 ; in:2307 out:2307 type:P dur:82000000 cpbdur:82000000 q:24.04 tex:86765 mv:6510 misc:1229 imb:33 pmb:640 smb:677 d:- ref:0 ; in:2308 out:2308 type:P dur:82000000 cpbdur:82000000 q:24.08 tex:108398 mv:7828 misc:1206 imb:31 pmb:740 smb:579 d:- ref:0 ; in:2309 out:2309 type:P dur:82000000 cpbdur:82000000 q:23.92 tex:89230 mv:6637 misc:1293 imb:23 pmb:711 smb:616 d:- ref:0 ; in:2310 out:2310 type:P dur:82000000 cpbdur:82000000 q:23.82 tex:91752 mv:6751 misc:1153 imb:33 pmb:629 smb:688 d:- ref:0 ; in:2311 out:2311 type:P dur:82000000 cpbdur:82000000 q:23.64 tex:82261 mv:6480 misc:1131 imb:27 pmb:596 smb:727 d:- ref:0 ; in:2312 out:2312 type:P dur:82000000 cpbdur:82000000 q:23.43 tex:102273 mv:7139 misc:1452 imb:52 pmb:829 smb:469 d:- ref:0 ; in:2313 out:2313 type:P dur:82000000 cpbdur:82000000 q:23.54 tex:80828 mv:5976 misc:1100 imb:21 pmb:582 smb:747 d:- ref:0 ; in:2314 out:2314 type:P dur:82000000 cpbdur:82000000 q:23.75 tex:83296 mv:6219 misc:1125 imb:19 pmb:565 smb:766 d:- ref:0 ; in:2315 out:2315 type:P dur:82000000 cpbdur:82000000 q:23.77 tex:79522 mv:6054 misc:1016 imb:25 pmb:510 smb:815 d:- ref:0 ; in:2316 out:2316 type:P dur:82000000 cpbdur:82000000 q:23.71 tex:75159 mv:5859 misc:1030 imb:18 pmb:485 smb:847 d:- ref:0 ; in:2317 out:2317 type:P dur:82000000 cpbdur:82000000 q:23.48 tex:94622 mv:6173 misc:1317 imb:19 pmb:633 smb:698 d:- ref:0 ; in:2318 out:2318 type:P dur:82000000 cpbdur:82000000 q:23.68 tex:77943 mv:6185 misc:1032 imb:19 pmb:517 smb:814 d:- ref:0 ; in:2319 out:2319 type:P dur:82000000 cpbdur:82000000 q:23.50 tex:76038 mv:5943 misc:963 imb:16 pmb:465 smb:869 d:- ref:0 ; in:2320 out:2320 type:P dur:82000000 cpbdur:82000000 q:23.53 tex:75687 mv:5879 misc:962 imb:17 pmb:455 smb:878 d:- ref:0 ; in:2321 out:2321 type:P dur:82000000 cpbdur:82000000 q:23.32 tex:88513 mv:6376 misc:1335 imb:38 pmb:612 smb:700 d:- ref:0 ; in:2322 out:2322 type:P dur:82000000 cpbdur:82000000 q:23.35 tex:92480 mv:6582 misc:1242 imb:35 pmb:642 smb:673 d:- ref:0 ; in:2323 out:2323 type:P dur:82000000 cpbdur:82000000 q:23.28 tex:85465 mv:6433 misc:1230 imb:32 pmb:577 smb:741 d:- ref:0 ; in:2324 out:2324 type:P dur:82000000 cpbdur:82000000 q:23.32 tex:90417 mv:6654 misc:1169 imb:30 pmb:592 smb:728 d:- ref:0 ; in:2325 out:2325 type:P dur:82000000 cpbdur:82000000 q:23.53 tex:76366 mv:6006 misc:1084 imb:26 pmb:506 smb:818 d:- ref:0 ; in:2326 out:2326 type:P dur:82000000 cpbdur:82000000 q:23.58 tex:85229 mv:6315 misc:1192 imb:21 pmb:643 smb:686 d:- ref:0 ; in:2327 out:2327 type:P dur:82000000 cpbdur:82000000 q:23.71 tex:91606 mv:6774 misc:1188 imb:17 pmb:684 smb:649 d:- ref:0 ; in:2328 out:2328 type:P dur:82000000 cpbdur:82000000 q:23.76 tex:89976 mv:6812 misc:1148 imb:21 pmb:608 smb:721 d:- ref:0 ; in:2329 out:2329 type:P dur:82000000 cpbdur:82000000 q:23.55 tex:81075 mv:6510 misc:1215 imb:17 pmb:634 smb:699 d:- ref:0 ; in:2330 out:2330 type:P dur:82000000 cpbdur:82000000 q:23.63 tex:87317 mv:6838 misc:1221 imb:23 pmb:668 smb:659 d:- ref:0 ; in:2331 out:2331 type:P dur:82000000 cpbdur:82000000 q:23.84 tex:100507 mv:7443 misc:1242 imb:23 pmb:713 smb:614 d:- ref:0 ; in:2332 out:2332 type:P dur:82000000 cpbdur:82000000 q:23.65 tex:80441 mv:6274 misc:1117 imb:23 pmb:558 smb:769 d:- ref:0 ; in:2333 out:2333 type:P dur:82000000 cpbdur:82000000 q:23.64 tex:83779 mv:6202 misc:1083 imb:25 pmb:590 smb:735 d:- ref:0 ; in:2334 out:2334 type:P dur:82000000 cpbdur:82000000 q:23.69 tex:86488 mv:6389 misc:1123 imb:30 pmb:565 smb:755 d:- ref:0 ; in:2335 out:2335 type:P dur:82000000 cpbdur:82000000 q:23.66 tex:85422 mv:6451 misc:1095 imb:33 pmb:575 smb:742 d:- ref:0 ; in:2336 out:2336 type:P dur:82000000 cpbdur:82000000 q:23.37 tex:94213 mv:6438 misc:1389 imb:26 pmb:760 smb:564 d:- ref:0 ; in:2337 out:2337 type:P dur:82000000 cpbdur:82000000 q:23.29 tex:85237 mv:6209 misc:1210 imb:24 pmb:567 smb:759 d:- ref:0 ; in:2338 out:2338 type:P dur:82000000 cpbdur:82000000 q:23.52 tex:81827 mv:6576 misc:1133 imb:32 pmb:592 smb:726 d:- ref:0 ; in:2339 out:2339 type:P dur:82000000 cpbdur:82000000 q:23.54 tex:74230 mv:5944 misc:1074 imb:15 pmb:496 smb:839 d:- ref:0 ; in:2340 out:2340 type:P dur:82000000 cpbdur:82000000 q:23.86 tex:90175 mv:6888 misc:1217 imb:27 pmb:618 smb:705 d:- ref:0 ; in:2341 out:2341 type:P dur:82000000 cpbdur:82000000 q:23.78 tex:88090 mv:6915 misc:1163 imb:15 pmb:657 smb:678 d:- ref:0 ; in:2342 out:2342 type:P dur:82000000 cpbdur:82000000 q:23.71 tex:84260 mv:6537 misc:1115 imb:20 pmb:613 smb:717 d:- ref:0 ; in:2343 out:2343 type:P dur:82000000 cpbdur:82000000 q:23.60 tex:81073 mv:6122 misc:1045 imb:17 pmb:526 smb:807 d:- ref:0 ; in:2344 out:2344 type:P dur:82000000 cpbdur:82000000 q:23.80 tex:89401 mv:6539 misc:1116 imb:25 pmb:607 smb:718 d:- ref:0 ; in:2345 out:2345 type:P dur:82000000 cpbdur:82000000 q:23.71 tex:85222 mv:6267 misc:1111 imb:18 pmb:575 smb:757 d:- ref:0 ; in:2346 out:2346 type:P dur:82000000 cpbdur:82000000 q:23.65 tex:78455 mv:6093 misc:1060 imb:24 pmb:507 smb:819 d:- ref:0 ; in:2347 out:2347 type:P dur:82000000 cpbdur:82000000 q:23.49 tex:97918 mv:6877 misc:1405 imb:37 pmb:737 smb:576 d:- ref:0 ; in:2348 out:2348 type:P dur:82000000 cpbdur:82000000 q:23.35 tex:82884 mv:6187 misc:1113 imb:20 pmb:509 smb:821 d:- ref:0 ; in:2349 out:2349 type:P dur:82000000 cpbdur:82000000 q:23.63 tex:81067 mv:6443 misc:1186 imb:27 pmb:595 smb:728 d:- ref:0 ; in:2350 out:2350 type:P dur:82000000 cpbdur:82000000 q:23.92 tex:99587 mv:7520 misc:1301 imb:26 pmb:772 smb:552 d:- ref:0 ; in:2351 out:2351 type:P dur:82000000 cpbdur:82000000 q:23.80 tex:72823 mv:6151 misc:1162 imb:26 pmb:543 smb:781 d:- ref:0 ; in:2352 out:2352 type:P dur:82000000 cpbdur:82000000 q:23.77 tex:76450 mv:5935 misc:1095 imb:21 pmb:509 smb:820 d:- ref:0 ; in:2353 out:2353 type:P dur:82000000 cpbdur:82000000 q:23.69 tex:72183 mv:6311 misc:1194 imb:29 pmb:543 smb:778 d:- ref:0 ; in:2354 out:2354 type:P dur:82000000 cpbdur:82000000 q:23.70 tex:76153 mv:6626 misc:1325 imb:46 pmb:580 smb:724 d:- ref:0 ; in:2355 out:2355 type:P dur:82000000 cpbdur:82000000 q:23.86 tex:84970 mv:6922 misc:1356 imb:56 pmb:632 smb:662 d:- ref:0 ; in:2356 out:2356 type:P dur:82000000 cpbdur:82000000 q:23.65 tex:77812 mv:6246 misc:1198 imb:23 pmb:556 smb:771 d:- ref:0 ; in:2357 out:2357 type:P dur:82000000 cpbdur:82000000 q:23.56 tex:85729 mv:6221 misc:1138 imb:29 pmb:599 smb:722 d:- ref:0 ; in:2358 out:2358 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:102444 mv:7308 misc:1448 imb:62 pmb:800 smb:488 d:- ref:0 ; in:2359 out:2359 type:P dur:82000000 cpbdur:82000000 q:23.47 tex:91140 mv:6187 misc:1145 imb:27 pmb:563 smb:760 d:- ref:0 ; in:2360 out:2360 type:P dur:82000000 cpbdur:82000000 q:24.23 tex:125556 mv:9299 misc:1321 imb:126 pmb:823 smb:401 d:- ref:0 ; in:2361 out:2361 type:P dur:82000000 cpbdur:82000000 q:24.56 tex:109119 mv:8745 misc:1312 imb:108 pmb:787 smb:455 d:- ref:0 ; in:2362 out:2362 type:P dur:82000000 cpbdur:82000000 q:24.17 tex:85836 mv:6222 misc:1182 imb:24 pmb:606 smb:720 d:- ref:0 ; in:2363 out:2363 type:P dur:82000000 cpbdur:82000000 q:23.97 tex:81658 mv:6028 misc:1050 imb:30 pmb:506 smb:814 d:- ref:0 ; in:2364 out:2364 type:P dur:82000000 cpbdur:82000000 q:23.69 tex:75471 mv:5823 misc:978 imb:19 pmb:465 smb:866 d:- ref:0 ; in:2365 out:2365 type:P dur:82000000 cpbdur:82000000 q:23.67 tex:78515 mv:6102 misc:1071 imb:13 pmb:540 smb:797 d:- ref:0 ; in:2366 out:2366 type:P dur:82000000 cpbdur:82000000 q:23.72 tex:83395 mv:6175 misc:1046 imb:18 pmb:517 smb:815 d:- ref:0 ; in:2367 out:2367 type:P dur:82000000 cpbdur:82000000 q:23.56 tex:72793 mv:6011 misc:996 imb:11 pmb:469 smb:870 d:- ref:0 ; in:2368 out:2368 type:P dur:82000000 cpbdur:82000000 q:23.60 tex:81976 mv:6257 misc:1039 imb:19 pmb:517 smb:814 d:- ref:0 ; in:2369 out:2369 type:P dur:82000000 cpbdur:82000000 q:23.43 tex:96241 mv:6727 misc:1376 imb:22 pmb:739 smb:589 d:- ref:0 ; in:2370 out:2370 type:P dur:82000000 cpbdur:82000000 q:23.50 tex:97751 mv:6802 misc:1335 imb:39 pmb:696 smb:615 d:- ref:0 ; in:2371 out:2371 type:P dur:82000000 cpbdur:82000000 q:23.28 tex:84209 mv:6487 misc:1264 imb:40 pmb:591 smb:719 d:- ref:0 ; in:2372 out:2372 type:P dur:82000000 cpbdur:82000000 q:23.31 tex:94776 mv:6915 misc:1245 imb:38 pmb:651 smb:661 d:- ref:0 ; in:2373 out:2373 type:P dur:82000000 cpbdur:82000000 q:23.44 tex:85853 mv:5996 misc:1095 imb:31 pmb:506 smb:813 d:- ref:0 ; in:2374 out:2374 type:P dur:82000000 cpbdur:82000000 q:23.47 tex:91078 mv:6332 misc:1118 imb:22 pmb:566 smb:762 d:- ref:0 ; in:2375 out:2375 type:P dur:82000000 cpbdur:82000000 q:23.50 tex:86084 mv:6257 misc:1155 imb:21 pmb:555 smb:774 d:- ref:0 ; in:2376 out:2376 type:P dur:82000000 cpbdur:82000000 q:23.57 tex:78560 mv:6140 misc:1036 imb:24 pmb:522 smb:804 d:- ref:0 ; in:2377 out:2377 type:P dur:82000000 cpbdur:82000000 q:23.49 tex:94285 mv:6721 misc:1242 imb:27 pmb:653 smb:670 d:- ref:0 ; in:2378 out:2378 type:P dur:82000000 cpbdur:82000000 q:23.29 tex:81561 mv:6144 misc:1183 imb:25 pmb:534 smb:791 d:- ref:0 ; in:2379 out:2379 type:P dur:82000000 cpbdur:82000000 q:23.50 tex:92546 mv:6420 misc:1258 imb:27 pmb:618 smb:705 d:- ref:0 ; in:2380 out:2380 type:P dur:82000000 cpbdur:82000000 q:23.40 tex:87023 mv:5947 misc:1126 imb:29 pmb:507 smb:814 d:- ref:0 ; in:2381 out:2381 type:P dur:82000000 cpbdur:82000000 q:23.44 tex:90905 mv:6334 misc:1209 imb:27 pmb:586 smb:737 d:- ref:0 ; in:2382 out:2382 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:77253 mv:6382 misc:1021 imb:31 pmb:484 smb:835 d:- ref:0 ; in:2383 out:2383 type:P dur:82000000 cpbdur:82000000 q:23.83 tex:83517 mv:7046 misc:1413 imb:63 pmb:666 smb:621 d:- ref:0 ; in:2384 out:2384 type:P dur:82000000 cpbdur:82000000 q:23.82 tex:81520 mv:7833 misc:1503 imb:132 pmb:757 smb:461 d:- ref:0 ; in:2385 out:2385 type:P dur:82000000 cpbdur:82000000 q:23.70 tex:76657 mv:7374 misc:1441 imb:98 pmb:688 smb:564 d:- ref:0 ; in:2386 out:2386 type:P dur:82000000 cpbdur:82000000 q:23.93 tex:95627 mv:8893 misc:1528 imb:136 pmb:897 smb:317 d:- ref:0 ; in:2387 out:2387 type:P dur:82000000 cpbdur:82000000 q:24.08 tex:93951 mv:8570 misc:1535 imb:100 pmb:882 smb:368 d:- ref:0 ; in:2388 out:2388 type:P dur:82000000 cpbdur:82000000 q:24.17 tex:93383 mv:8008 misc:1425 imb:92 pmb:780 smb:478 d:- ref:0 ; in:2389 out:2389 type:P dur:82000000 cpbdur:82000000 q:23.93 tex:83733 mv:7586 misc:1449 imb:70 pmb:772 smb:508 d:- ref:0 ; in:2390 out:2390 type:P dur:82000000 cpbdur:82000000 q:24.04 tex:101144 mv:8336 misc:1512 imb:69 pmb:950 smb:331 d:- ref:0 ; in:2391 out:2391 type:P dur:82000000 cpbdur:82000000 q:23.99 tex:93948 mv:7766 misc:1446 imb:67 pmb:800 smb:483 d:- ref:0 ; in:2392 out:2392 type:P dur:82000000 cpbdur:82000000 q:23.93 tex:90703 mv:7427 misc:1438 imb:39 pmb:801 smb:510 d:- ref:0 ; in:2393 out:2393 type:P dur:82000000 cpbdur:82000000 q:23.82 tex:93431 mv:7520 misc:1449 imb:50 pmb:844 smb:456 d:- ref:0 ; in:2394 out:2394 type:P dur:82000000 cpbdur:82000000 q:23.83 tex:94255 mv:7442 misc:1415 imb:38 pmb:840 smb:472 d:- ref:0 ; in:2395 out:2395 type:P dur:82000000 cpbdur:82000000 q:23.72 tex:86044 mv:6968 misc:1412 imb:27 pmb:780 smb:543 d:- ref:0 ; in:2396 out:2396 type:P dur:82000000 cpbdur:82000000 q:23.66 tex:87737 mv:7230 misc:1377 imb:35 pmb:786 smb:529 d:- ref:0 ; in:2397 out:2397 type:P dur:82000000 cpbdur:82000000 q:23.67 tex:86359 mv:6711 misc:1322 imb:30 pmb:725 smb:595 d:- ref:0 ; in:2398 out:2398 type:P dur:82000000 cpbdur:82000000 q:24.00 tex:112260 mv:8413 misc:1439 imb:37 pmb:959 smb:354 d:- ref:0 ; in:2399 out:2399 type:P dur:82000000 cpbdur:82000000 q:24.11 tex:103387 mv:7955 misc:1466 imb:34 pmb:915 smb:401 d:- ref:0 ; in:2400 out:2400 type:P dur:82000000 cpbdur:82000000 q:24.29 tex:109925 mv:8152 misc:1483 imb:36 pmb:994 smb:320 d:- ref:0 ; in:2401 out:2401 type:P dur:82000000 cpbdur:82000000 q:24.20 tex:101812 mv:7573 misc:1431 imb:17 pmb:907 smb:426 d:- ref:0 ; in:2402 out:2402 type:P dur:82000000 cpbdur:82000000 q:24.01 tex:88022 mv:7086 misc:1380 imb:33 pmb:776 smb:541 d:- ref:0 ; in:2403 out:2403 type:P dur:82000000 cpbdur:82000000 q:24.01 tex:94668 mv:6899 misc:1337 imb:30 pmb:767 smb:553 d:- ref:0 ; in:2404 out:2404 type:P dur:82000000 cpbdur:82000000 q:23.90 tex:93908 mv:7103 misc:1365 imb:23 pmb:775 smb:552 d:- ref:0 ; in:2405 out:2405 type:P dur:82000000 cpbdur:82000000 q:23.90 tex:100250 mv:7232 misc:1390 imb:24 pmb:866 smb:460 d:- ref:0 ; in:2406 out:2406 type:P dur:82000000 cpbdur:82000000 q:23.84 tex:96212 mv:6895 misc:1333 imb:43 pmb:727 smb:580 d:- ref:0 ; in:2407 out:2407 type:P dur:82000000 cpbdur:82000000 q:23.99 tex:108077 mv:7571 misc:1456 imb:43 pmb:911 smb:396 d:- ref:0 ; in:2408 out:2408 type:P dur:82000000 cpbdur:82000000 q:24.26 tex:117968 mv:7897 misc:1471 imb:49 pmb:955 smb:346 d:- ref:0 ; in:2409 out:2409 type:P dur:82000000 cpbdur:82000000 q:24.52 tex:112612 mv:7884 misc:1464 imb:34 pmb:958 smb:358 d:- ref:0 ; in:2410 out:2410 type:P dur:82000000 cpbdur:82000000 q:24.32 tex:103263 mv:7593 misc:1440 imb:44 pmb:871 smb:435 d:- ref:0 ; in:2411 out:2411 type:P dur:82000000 cpbdur:82000000 q:24.56 tex:109607 mv:7919 misc:1458 imb:50 pmb:927 smb:373 d:- ref:0 ; in:2412 out:2412 type:P dur:82000000 cpbdur:82000000 q:24.42 tex:110556 mv:7409 misc:1475 imb:40 pmb:885 smb:425 d:- ref:0 ; in:2413 out:2413 type:P dur:82000000 cpbdur:82000000 q:24.21 tex:97946 mv:6796 misc:1378 imb:18 pmb:782 smb:550 d:- ref:0 ; in:2414 out:2414 type:P dur:82000000 cpbdur:82000000 q:24.21 tex:104262 mv:6918 misc:1316 imb:26 pmb:744 smb:580 d:- ref:0 ; in:2415 out:2415 type:P dur:82000000 cpbdur:82000000 q:24.14 tex:100861 mv:6857 misc:1338 imb:28 pmb:741 smb:581 d:- ref:0 ; in:2416 out:2416 type:P dur:82000000 cpbdur:82000000 q:24.63 tex:117872 mv:8136 misc:1456 imb:54 pmb:950 smb:346 d:- ref:0 ; in:2417 out:2417 type:P dur:82000000 cpbdur:82000000 q:24.23 tex:100381 mv:8008 misc:1507 imb:59 pmb:944 smb:347 d:- ref:0 ; in:2418 out:2418 type:P dur:82000000 cpbdur:82000000 q:24.44 tex:120903 mv:8984 misc:1481 imb:81 pmb:1026 smb:243 d:- ref:0 ; in:2419 out:2419 type:P dur:82000000 cpbdur:82000000 q:23.87 tex:76814 mv:7053 misc:1445 imb:51 pmb:695 smb:604 d:- ref:0 ; in:2420 out:2420 type:P dur:82000000 cpbdur:82000000 q:23.50 tex:73084 mv:6497 misc:1259 imb:37 pmb:567 smb:746 d:- ref:0 ; in:2421 out:2421 type:P dur:82000000 cpbdur:82000000 q:23.52 tex:76220 mv:6129 misc:1195 imb:38 pmb:527 smb:785 d:- ref:0 ; in:2422 out:2422 type:P dur:82000000 cpbdur:82000000 q:23.42 tex:116299 mv:7807 misc:1518 imb:37 pmb:995 smb:318 d:- ref:0 ; in:2423 out:2423 type:P dur:82000000 cpbdur:82000000 q:23.47 tex:93175 mv:6728 misc:1369 imb:20 pmb:700 smb:630 d:- ref:0 ; in:2424 out:2424 type:P dur:82000000 cpbdur:82000000 q:23.50 tex:92491 mv:6369 misc:1220 imb:25 pmb:551 smb:774 d:- ref:0 ; in:2425 out:2425 type:P dur:82000000 cpbdur:82000000 q:23.79 tex:97449 mv:7628 misc:1395 imb:29 pmb:808 smb:513 d:- ref:0 ; in:2426 out:2426 type:P dur:82000000 cpbdur:82000000 q:23.77 tex:87785 mv:7119 misc:1360 imb:17 pmb:723 smb:610 d:- ref:0 ; in:2427 out:2427 type:P dur:82000000 cpbdur:82000000 q:23.79 tex:85162 mv:6664 misc:1382 imb:22 pmb:706 smb:622 d:- ref:0 ; in:2428 out:2428 type:P dur:82000000 cpbdur:82000000 q:23.48 tex:103877 mv:7136 misc:1523 imb:43 pmb:842 smb:465 d:- ref:0 ; in:2429 out:2429 type:P dur:82000000 cpbdur:82000000 q:23.29 tex:85184 mv:5913 misc:1223 imb:32 pmb:535 smb:783 d:- ref:0 ; in:2430 out:2430 type:P dur:82000000 cpbdur:82000000 q:24.04 tex:106561 mv:7783 misc:1416 imb:40 pmb:847 smb:463 d:- ref:0 ; in:2431 out:2431 type:P dur:82000000 cpbdur:82000000 q:23.81 tex:81095 mv:6353 misc:1272 imb:30 pmb:587 smb:733 d:- ref:0 ; in:2432 out:2432 type:P dur:82000000 cpbdur:82000000 q:23.62 tex:79581 mv:6586 misc:1313 imb:16 pmb:692 smb:642 d:- ref:0 ; in:2433 out:2433 type:P dur:82000000 cpbdur:82000000 q:23.44 tex:101529 mv:7267 misc:1532 imb:30 pmb:901 smb:419 d:- ref:0 ; in:2434 out:2434 type:P dur:82000000 cpbdur:82000000 q:23.66 tex:85604 mv:6707 misc:1345 imb:21 pmb:713 smb:616 d:- ref:0 ; in:2435 out:2435 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:75486 mv:6062 misc:1164 imb:16 pmb:550 smb:784 d:- ref:0 ; in:2436 out:2436 type:P dur:82000000 cpbdur:82000000 q:23.74 tex:77753 mv:6041 misc:1022 imb:20 pmb:467 smb:863 d:- ref:0 ; in:2437 out:2437 type:P dur:82000000 cpbdur:82000000 q:23.45 tex:93013 mv:6648 misc:1419 imb:18 pmb:710 smb:622 d:- ref:0 ; in:2438 out:2438 type:P dur:82000000 cpbdur:82000000 q:23.38 tex:86058 mv:6206 misc:1224 imb:17 pmb:556 smb:777 d:- ref:0 ; in:2439 out:2439 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:87831 mv:6157 misc:1108 imb:21 pmb:509 smb:820 d:- ref:0 ; in:2440 out:2440 type:P dur:82000000 cpbdur:82000000 q:23.64 tex:80567 mv:6552 misc:1209 imb:31 pmb:572 smb:747 d:- ref:0 ; in:2441 out:2441 type:P dur:82000000 cpbdur:82000000 q:23.79 tex:90039 mv:6864 misc:1297 imb:28 pmb:696 smb:626 d:- ref:0 ; in:2442 out:2442 type:P dur:82000000 cpbdur:82000000 q:23.89 tex:93240 mv:7068 misc:1364 imb:33 pmb:730 smb:587 d:- ref:0 ; in:2443 out:2443 type:P dur:82000000 cpbdur:82000000 q:23.75 tex:78423 mv:6371 misc:1230 imb:23 pmb:591 smb:736 d:- ref:0 ; in:2444 out:2444 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:78151 mv:6563 misc:1230 imb:34 pmb:579 smb:737 d:- ref:0 ; in:2445 out:2445 type:P dur:82000000 cpbdur:82000000 q:23.91 tex:100125 mv:7558 misc:1405 imb:33 pmb:820 smb:497 d:- ref:0 ; in:2446 out:2446 type:P dur:82000000 cpbdur:82000000 q:23.84 tex:87584 mv:7160 misc:1352 imb:19 pmb:722 smb:609 d:- ref:0 ; in:2447 out:2447 type:P dur:82000000 cpbdur:82000000 q:23.72 tex:78051 mv:6085 misc:1232 imb:19 pmb:597 smb:734 d:- ref:0 ; in:2448 out:2448 type:P dur:82000000 cpbdur:82000000 q:23.64 tex:72894 mv:5699 misc:967 imb:14 pmb:473 smb:863 d:- ref:0 ; in:2449 out:2449 type:P dur:82000000 cpbdur:82000000 q:23.91 tex:90789 mv:7025 misc:1346 imb:16 pmb:759 smb:575 d:- ref:0 ; in:2450 out:2450 type:P dur:82000000 cpbdur:82000000 q:23.91 tex:87827 mv:6900 misc:1281 imb:24 pmb:696 smb:630 d:- ref:0 ; in:2451 out:2451 type:P dur:82000000 cpbdur:82000000 q:23.87 tex:80339 mv:6143 misc:1126 imb:21 pmb:549 smb:780 d:- ref:0 ; in:2452 out:2452 type:P dur:82000000 cpbdur:82000000 q:23.57 tex:74304 mv:5745 misc:967 imb:17 pmb:459 smb:874 d:- ref:0 ; in:2453 out:2453 type:P dur:82000000 cpbdur:82000000 q:23.49 tex:99987 mv:6992 misc:1485 imb:25 pmb:808 smb:517 d:- ref:0 ; in:2454 out:2454 type:P dur:82000000 cpbdur:82000000 q:23.41 tex:91108 mv:6266 misc:1210 imb:33 pmb:566 smb:751 d:- ref:0 ; in:2455 out:2455 type:P dur:82000000 cpbdur:82000000 q:23.31 tex:84316 mv:5661 misc:1079 imb:26 pmb:483 smb:841 d:- ref:0 ; in:2456 out:2456 type:P dur:82000000 cpbdur:82000000 q:23.54 tex:85433 mv:6369 misc:1278 imb:13 pmb:649 smb:688 d:- ref:0 ; in:2457 out:2457 type:P dur:82000000 cpbdur:82000000 q:23.69 tex:84885 mv:6135 misc:1252 imb:24 pmb:607 smb:719 d:- ref:0 ; in:2458 out:2458 type:P dur:82000000 cpbdur:82000000 q:23.60 tex:74897 mv:6007 misc:1032 imb:13 pmb:469 smb:868 d:- ref:0 ; in:2459 out:2459 type:P dur:82000000 cpbdur:82000000 q:23.61 tex:75112 mv:5755 misc:949 imb:24 pmb:439 smb:887 d:- ref:0 ; in:2460 out:2460 type:P dur:82000000 cpbdur:82000000 q:23.52 tex:72938 mv:5492 misc:962 imb:19 pmb:448 smb:883 d:- ref:0 ; in:2461 out:2461 type:P dur:82000000 cpbdur:82000000 q:23.47 tex:91278 mv:6348 misc:1350 imb:15 pmb:652 smb:683 d:- ref:0 ; in:2462 out:2462 type:P dur:82000000 cpbdur:82000000 q:23.61 tex:82503 mv:6320 misc:1161 imb:15 pmb:570 smb:765 d:- ref:0 ; in:2463 out:2463 type:P dur:82000000 cpbdur:82000000 q:23.69 tex:81518 mv:6522 misc:1248 imb:14 pmb:614 smb:722 d:- ref:0 ; in:2464 out:2464 type:P dur:82000000 cpbdur:82000000 q:23.92 tex:100577 mv:7393 misc:1374 imb:22 pmb:791 smb:537 d:- ref:0 ; in:2465 out:2465 type:P dur:82000000 cpbdur:82000000 q:23.53 tex:69507 mv:5807 misc:1086 imb:21 pmb:479 smb:850 d:- ref:0 ; in:2466 out:2466 type:P dur:82000000 cpbdur:82000000 q:23.44 tex:102558 mv:6992 misc:1474 imb:37 pmb:818 smb:495 d:- ref:0 ; in:2467 out:2467 type:P dur:82000000 cpbdur:82000000 q:23.31 tex:85233 mv:6374 misc:1321 imb:29 pmb:602 smb:719 d:- ref:0 ; in:2468 out:2468 type:P dur:82000000 cpbdur:82000000 q:23.48 tex:105142 mv:7374 misc:1388 imb:19 pmb:782 smb:549 d:- ref:0 ; in:2469 out:2469 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:77639 mv:6266 misc:1183 imb:26 pmb:572 smb:752 d:- ref:0 ; in:2470 out:2470 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:76565 mv:5996 misc:999 imb:23 pmb:476 smb:851 d:- ref:0 ; in:2471 out:2471 type:P dur:82000000 cpbdur:82000000 q:23.61 tex:76250 mv:6237 misc:1193 imb:17 pmb:579 smb:754 d:- ref:0 ; in:2472 out:2472 type:P dur:82000000 cpbdur:82000000 q:23.70 tex:85943 mv:6594 misc:1247 imb:28 pmb:618 smb:704 d:- ref:0 ; in:2473 out:2473 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:78086 mv:6390 misc:1260 imb:29 pmb:624 smb:697 d:- ref:0 ; in:2474 out:2474 type:P dur:82000000 cpbdur:82000000 q:23.35 tex:98462 mv:7307 misc:1455 imb:31 pmb:843 smb:476 d:- ref:0 ; in:2475 out:2475 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:81260 mv:6715 misc:1369 imb:23 pmb:701 smb:626 d:- ref:0 ; in:2476 out:2476 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:104638 mv:7167 misc:1451 imb:40 pmb:827 smb:483 d:- ref:0 ; in:2477 out:2477 type:P dur:82000000 cpbdur:82000000 q:23.64 tex:87626 mv:6814 misc:1400 imb:24 pmb:778 smb:548 d:- ref:0 ; in:2478 out:2478 type:P dur:82000000 cpbdur:82000000 q:23.66 tex:93557 mv:7124 misc:1415 imb:42 pmb:750 smb:558 d:- ref:0 ; in:2479 out:2479 type:P dur:82000000 cpbdur:82000000 q:24.35 tex:140675 mv:9149 misc:1440 imb:73 pmb:961 smb:316 d:- ref:0 ; in:2480 out:2480 type:P dur:82000000 cpbdur:82000000 q:24.90 tex:136063 mv:10014 misc:1435 imb:76 pmb:996 smb:278 d:- ref:0 ; in:2481 out:2481 type:P dur:82000000 cpbdur:82000000 q:24.77 tex:104160 mv:8104 misc:1392 imb:34 pmb:904 smb:412 d:- ref:0 ; in:2482 out:2482 type:P dur:82000000 cpbdur:82000000 q:24.47 tex:105870 mv:7343 misc:1419 imb:27 pmb:831 smb:492 d:- ref:0 ; in:2483 out:2483 type:P dur:82000000 cpbdur:82000000 q:24.47 tex:112391 mv:7703 misc:1402 imb:19 pmb:873 smb:458 d:- ref:0 ; in:2484 out:2484 type:P dur:82000000 cpbdur:82000000 q:24.79 tex:119879 mv:8463 misc:1442 imb:39 pmb:937 smb:374 d:- ref:0 ; in:2485 out:2485 type:P dur:82000000 cpbdur:82000000 q:24.31 tex:100471 mv:7199 misc:1482 imb:27 pmb:831 smb:492 d:- ref:0 ; in:2486 out:2486 type:P dur:82000000 cpbdur:82000000 q:23.96 tex:81137 mv:6439 misc:1296 imb:13 pmb:619 smb:718 d:- ref:0 ; in:2487 out:2487 type:P dur:82000000 cpbdur:82000000 q:24.81 tex:136193 mv:9992 misc:1431 imb:56 pmb:1002 smb:292 d:- ref:0 ; in:2488 out:2488 type:P dur:82000000 cpbdur:82000000 q:24.48 tex:105603 mv:7394 misc:1459 imb:29 pmb:854 smb:467 d:- ref:0 ; in:2489 out:2489 type:P dur:82000000 cpbdur:82000000 q:28.48 tex:377376 mv:17519 misc:1417 imb:1087 pmb:263 smb:0 d:- ref:0 ; in:2490 out:2490 type:P dur:82000000 cpbdur:82000000 q:28.20 tex:93919 mv:4646 misc:1363 imb:9 pmb:856 smb:485 d:- ref:0 ; in:2491 out:2491 type:P dur:82000000 cpbdur:82000000 q:27.07 tex:111009 mv:4887 misc:1368 imb:11 pmb:919 smb:420 d:- ref:0 ; in:2492 out:2492 type:P dur:82000000 cpbdur:82000000 q:26.41 tex:135407 mv:5642 misc:1359 imb:11 pmb:970 smb:369 d:- ref:0 ; in:2493 out:2493 type:P dur:82000000 cpbdur:82000000 q:26.02 tex:124761 mv:5542 misc:1417 imb:13 pmb:992 smb:345 d:- ref:0 ; in:2494 out:2494 type:P dur:82000000 cpbdur:82000000 q:25.64 tex:121659 mv:5370 misc:1403 imb:18 pmb:942 smb:390 d:- ref:0 ; in:2495 out:2495 type:P dur:82000000 cpbdur:82000000 q:25.46 tex:158911 mv:6100 misc:1469 imb:52 pmb:1078 smb:220 d:- ref:0 ; in:2496 out:2496 type:P dur:82000000 cpbdur:82000000 q:25.22 tex:137436 mv:5235 misc:1433 imb:30 pmb:1041 smb:279 d:- ref:0 ; in:2497 out:2497 type:P dur:82000000 cpbdur:82000000 q:25.46 tex:164471 mv:5498 misc:1367 imb:9 pmb:980 smb:361 d:- ref:0 ; in:2498 out:2498 type:P dur:82000000 cpbdur:82000000 q:24.95 tex:111436 mv:3977 misc:1347 imb:11 pmb:873 smb:466 d:- ref:0 ; in:2499 out:2499 type:P dur:82000000 cpbdur:82000000 q:24.57 tex:115532 mv:4449 misc:1403 imb:12 pmb:1009 smb:329 d:- ref:0 ; in:2500 out:2500 type:I dur:82000000 cpbdur:82000000 q:21.91 tex:593202 mv:14412 misc:370 imb:1350 pmb:0 smb:0 d:- ref:; in:2501 out:2501 type:P dur:82000000 cpbdur:82000000 q:28.28 tex:56937 mv:2808 misc:1135 imb:1 pmb:612 smb:737 d:- ref:0 ; in:2502 out:2502 type:P dur:82000000 cpbdur:82000000 q:27.14 tex:90117 mv:4741 misc:1342 imb:9 pmb:897 smb:444 d:- ref:0 ; in:2503 out:2503 type:P dur:82000000 cpbdur:82000000 q:25.82 tex:73497 mv:3631 misc:1392 imb:5 pmb:879 smb:466 d:- ref:0 ; in:2504 out:2504 type:P dur:82000000 cpbdur:82000000 q:25.45 tex:135967 mv:5334 misc:1387 imb:14 pmb:970 smb:366 d:- ref:0 ; in:2505 out:2505 type:P dur:82000000 cpbdur:82000000 q:25.46 tex:141914 mv:5360 misc:1366 imb:17 pmb:940 smb:393 d:- ref:0 ; in:2506 out:2506 type:P dur:82000000 cpbdur:82000000 q:25.19 tex:120227 mv:4855 misc:1406 imb:6 pmb:973 smb:371 d:- ref:0 ; in:2507 out:2507 type:P dur:82000000 cpbdur:82000000 q:25.56 tex:135055 mv:6356 misc:1397 imb:13 pmb:992 smb:345 d:- ref:0 ; in:2508 out:2508 type:P dur:82000000 cpbdur:82000000 q:25.68 tex:138231 mv:6279 misc:1378 imb:14 pmb:969 smb:367 d:- ref:0 ; in:2509 out:2509 type:P dur:82000000 cpbdur:82000000 q:25.73 tex:136775 mv:6049 misc:1368 imb:16 pmb:981 smb:353 d:- ref:0 ; in:2510 out:2510 type:P dur:82000000 cpbdur:82000000 q:25.74 tex:145181 mv:6191 misc:1372 imb:11 pmb:983 smb:356 d:- ref:0 ; in:2511 out:2511 type:P dur:82000000 cpbdur:82000000 q:25.43 tex:148821 mv:5944 misc:1419 imb:13 pmb:1040 smb:297 d:- ref:0 ; in:2512 out:2512 type:P dur:82000000 cpbdur:82000000 q:25.65 tex:135257 mv:5826 misc:1389 imb:12 pmb:956 smb:382 d:- ref:0 ; in:2513 out:2513 type:P dur:82000000 cpbdur:82000000 q:25.65 tex:137501 mv:5964 misc:1407 imb:16 pmb:976 smb:358 d:- ref:0 ; in:2514 out:2514 type:P dur:82000000 cpbdur:82000000 q:25.77 tex:147106 mv:6306 misc:1380 imb:18 pmb:980 smb:352 d:- ref:0 ; in:2515 out:2515 type:P dur:82000000 cpbdur:82000000 q:25.68 tex:139721 mv:5966 misc:1393 imb:12 pmb:996 smb:342 d:- ref:0 ; in:2516 out:2516 type:P dur:82000000 cpbdur:82000000 q:25.66 tex:136193 mv:5570 misc:1389 imb:17 pmb:968 smb:365 d:- ref:0 ; in:2517 out:2517 type:P dur:82000000 cpbdur:82000000 q:25.70 tex:140368 mv:6269 misc:1403 imb:14 pmb:1005 smb:331 d:- ref:0 ; in:2518 out:2518 type:P dur:82000000 cpbdur:82000000 q:25.23 tex:143823 mv:5170 misc:1415 imb:29 pmb:1014 smb:307 d:- ref:0 ; in:2519 out:2519 type:P dur:82000000 cpbdur:82000000 q:25.82 tex:144408 mv:7109 misc:1371 imb:11 pmb:1013 smb:326 d:- ref:0 ; in:2520 out:2520 type:P dur:82000000 cpbdur:82000000 q:25.55 tex:109997 mv:5329 misc:1426 imb:11 pmb:981 smb:358 d:- ref:0 ; in:2521 out:2521 type:P dur:82000000 cpbdur:82000000 q:25.67 tex:139269 mv:6364 misc:1391 imb:16 pmb:1006 smb:328 d:- ref:0 ; in:2522 out:2522 type:P dur:82000000 cpbdur:82000000 q:25.81 tex:144773 mv:7118 misc:1405 imb:31 pmb:1012 smb:307 d:- ref:0 ; in:2523 out:2523 type:P dur:82000000 cpbdur:82000000 q:25.69 tex:132464 mv:5880 misc:1400 imb:12 pmb:984 smb:354 d:- ref:0 ; in:2524 out:2524 type:P dur:82000000 cpbdur:82000000 q:25.81 tex:137110 mv:6531 misc:1383 imb:12 pmb:987 smb:351 d:- ref:0 ; in:2525 out:2525 type:P dur:82000000 cpbdur:82000000 q:25.73 tex:127417 mv:6035 misc:1428 imb:19 pmb:993 smb:338 d:- ref:0 ; in:2526 out:2526 type:P dur:82000000 cpbdur:82000000 q:25.44 tex:157028 mv:6068 misc:1448 imb:29 pmb:1078 smb:243 d:- ref:0 ; in:2527 out:2527 type:P dur:82000000 cpbdur:82000000 q:25.59 tex:130958 mv:5659 misc:1367 imb:11 pmb:969 smb:370 d:- ref:0 ; in:2528 out:2528 type:P dur:82000000 cpbdur:82000000 q:25.46 tex:161540 mv:6151 misc:1421 imb:22 pmb:1053 smb:275 d:- ref:0 ; in:2529 out:2529 type:P dur:82000000 cpbdur:82000000 q:25.65 tex:133713 mv:6127 misc:1384 imb:11 pmb:971 smb:368 d:- ref:0 ; in:2530 out:2530 type:P dur:82000000 cpbdur:82000000 q:25.67 tex:145821 mv:6473 misc:1378 imb:12 pmb:991 smb:347 d:- ref:0 ; in:2531 out:2531 type:P dur:82000000 cpbdur:82000000 q:25.78 tex:142043 mv:6908 misc:1393 imb:11 pmb:1008 smb:331 d:- ref:0 ; in:2532 out:2532 type:P dur:82000000 cpbdur:82000000 q:25.69 tex:124251 mv:5763 misc:1394 imb:13 pmb:981 smb:356 d:- ref:0 ; in:2533 out:2533 type:P dur:82000000 cpbdur:82000000 q:25.62 tex:134632 mv:6080 misc:1400 imb:18 pmb:1000 smb:332 d:- ref:0 ; in:2534 out:2534 type:P dur:82000000 cpbdur:82000000 q:25.58 tex:135087 mv:5855 misc:1386 imb:9 pmb:995 smb:346 d:- ref:0 ; in:2535 out:2535 type:P dur:82000000 cpbdur:82000000 q:25.71 tex:140047 mv:6655 misc:1402 imb:20 pmb:1009 smb:321 d:- ref:0 ; in:2536 out:2536 type:P dur:82000000 cpbdur:82000000 q:25.70 tex:134067 mv:6460 misc:1417 imb:12 pmb:1012 smb:326 d:- ref:0 ; in:2537 out:2537 type:P dur:82000000 cpbdur:82000000 q:25.58 tex:121632 mv:5637 misc:1379 imb:9 pmb:953 smb:388 d:- ref:0 ; in:2538 out:2538 type:P dur:82000000 cpbdur:82000000 q:25.84 tex:138388 mv:6926 misc:1422 imb:12 pmb:1032 smb:306 d:- ref:0 ; in:2539 out:2539 type:P dur:82000000 cpbdur:82000000 q:25.64 tex:126460 mv:5800 misc:1412 imb:11 pmb:998 smb:341 d:- ref:0 ; in:2540 out:2540 type:P dur:82000000 cpbdur:82000000 q:25.24 tex:156623 mv:5796 misc:1453 imb:28 pmb:1076 smb:246 d:- ref:0 ; in:2541 out:2541 type:P dur:82000000 cpbdur:82000000 q:25.63 tex:139329 mv:5949 misc:1386 imb:7 pmb:983 smb:360 d:- ref:0 ; in:2542 out:2542 type:P dur:82000000 cpbdur:82000000 q:25.71 tex:148523 mv:6453 misc:1392 imb:10 pmb:997 smb:343 d:- ref:0 ; in:2543 out:2543 type:P dur:82000000 cpbdur:82000000 q:25.72 tex:141883 mv:6188 misc:1401 imb:10 pmb:996 smb:344 d:- ref:0 ; in:2544 out:2544 type:P dur:82000000 cpbdur:82000000 q:25.79 tex:150868 mv:6835 misc:1417 imb:12 pmb:1019 smb:319 d:- ref:0 ; in:2545 out:2545 type:P dur:82000000 cpbdur:82000000 q:25.51 tex:126429 mv:5553 misc:1426 imb:12 pmb:1019 smb:319 d:- ref:0 ; in:2546 out:2546 type:P dur:82000000 cpbdur:82000000 q:25.74 tex:143871 mv:6667 misc:1406 imb:23 pmb:1013 smb:314 d:- ref:0 ; in:2547 out:2547 type:P dur:82000000 cpbdur:82000000 q:25.80 tex:143985 mv:7206 misc:1417 imb:27 pmb:1046 smb:277 d:- ref:0 ; in:2548 out:2548 type:P dur:82000000 cpbdur:82000000 q:25.79 tex:139385 mv:6924 misc:1467 imb:49 pmb:1000 smb:301 d:- ref:0 ; in:2549 out:2549 type:P dur:82000000 cpbdur:82000000 q:25.54 tex:129518 mv:6190 misc:1436 imb:59 pmb:1016 smb:275 d:- ref:0 ; in:2550 out:2550 type:P dur:82000000 cpbdur:82000000 q:25.48 tex:180594 mv:7246 misc:1456 imb:84 pmb:1088 smb:178 d:- ref:0 ; in:2551 out:2551 type:P dur:82000000 cpbdur:82000000 q:25.68 tex:138312 mv:6262 misc:1394 imb:9 pmb:1000 smb:341 d:- ref:0 ; in:2552 out:2552 type:P dur:82000000 cpbdur:82000000 q:25.83 tex:141644 mv:6640 misc:1396 imb:10 pmb:1004 smb:336 d:- ref:0 ; in:2553 out:2553 type:P dur:82000000 cpbdur:82000000 q:25.12 tex:125842 mv:5144 misc:1446 imb:24 pmb:1046 smb:280 d:- ref:0 ; in:2554 out:2554 type:P dur:82000000 cpbdur:82000000 q:25.61 tex:136720 mv:6370 misc:1398 imb:17 pmb:966 smb:367 d:- ref:0 ; in:2555 out:2555 type:P dur:82000000 cpbdur:82000000 q:25.33 tex:145332 mv:5861 misc:1447 imb:27 pmb:1061 smb:262 d:- ref:0 ; in:2556 out:2556 type:P dur:82000000 cpbdur:82000000 q:25.59 tex:135894 mv:6683 misc:1391 imb:18 pmb:995 smb:337 d:- ref:0 ; in:2557 out:2557 type:P dur:82000000 cpbdur:82000000 q:25.28 tex:151526 mv:5827 misc:1423 imb:29 pmb:1055 smb:266 d:- ref:0 ; in:2558 out:2558 type:P dur:82000000 cpbdur:82000000 q:25.67 tex:133296 mv:6326 misc:1402 imb:12 pmb:966 smb:372 d:- ref:0 ; in:2559 out:2559 type:P dur:82000000 cpbdur:82000000 q:25.63 tex:127191 mv:5466 misc:1383 imb:18 pmb:952 smb:380 d:- ref:0 ; in:2560 out:2560 type:P dur:82000000 cpbdur:82000000 q:25.66 tex:134334 mv:6627 misc:1439 imb:55 pmb:1031 smb:264 d:- ref:0 ; in:2561 out:2561 type:P dur:82000000 cpbdur:82000000 q:25.87 tex:143659 mv:7572 misc:1457 imb:80 pmb:1016 smb:254 d:- ref:0 ; in:2562 out:2562 type:P dur:82000000 cpbdur:82000000 q:25.49 tex:154664 mv:6653 misc:1467 imb:104 pmb:1059 smb:187 d:- ref:0 ; in:2563 out:2563 type:P dur:82000000 cpbdur:82000000 q:25.78 tex:139341 mv:6631 misc:1420 imb:19 pmb:1003 smb:328 d:- ref:0 ; in:2564 out:2564 type:P dur:82000000 cpbdur:82000000 q:25.82 tex:137464 mv:6826 misc:1398 imb:11 pmb:1024 smb:315 d:- ref:0 ; in:2565 out:2565 type:P dur:82000000 cpbdur:82000000 q:25.89 tex:133965 mv:6621 misc:1398 imb:12 pmb:973 smb:365 d:- ref:0 ; in:2566 out:2566 type:P dur:82000000 cpbdur:82000000 q:25.74 tex:125987 mv:5867 misc:1418 imb:11 pmb:1001 smb:338 d:- ref:0 ; in:2567 out:2567 type:P dur:82000000 cpbdur:82000000 q:25.64 tex:133250 mv:5956 misc:1378 imb:14 pmb:956 smb:380 d:- ref:0 ; in:2568 out:2568 type:P dur:82000000 cpbdur:82000000 q:25.22 tex:150620 mv:5853 misc:1431 imb:34 pmb:1067 smb:249 d:- ref:0 ; in:2569 out:2569 type:P dur:82000000 cpbdur:82000000 q:25.39 tex:153236 mv:5455 misc:1317 imb:6 pmb:953 smb:391 d:- ref:0 ; in:2570 out:2570 type:P dur:82000000 cpbdur:82000000 q:25.41 tex:150881 mv:5944 misc:1431 imb:15 pmb:1032 smb:303 d:- ref:0 ; in:2571 out:2571 type:P dur:82000000 cpbdur:82000000 q:25.60 tex:132649 mv:6568 misc:1383 imb:14 pmb:1000 smb:336 d:- ref:0 ; in:2572 out:2572 type:P dur:82000000 cpbdur:82000000 q:25.36 tex:150698 mv:6096 misc:1390 imb:18 pmb:1040 smb:292 d:- ref:0 ; in:2573 out:2573 type:P dur:82000000 cpbdur:82000000 q:25.17 tex:144882 mv:5461 misc:1409 imb:16 pmb:1025 smb:309 d:- ref:0 ; in:2574 out:2574 type:P dur:82000000 cpbdur:82000000 q:25.44 tex:161503 mv:6500 misc:1405 imb:13 pmb:1026 smb:311 d:- ref:0 ; in:2575 out:2575 type:P dur:82000000 cpbdur:82000000 q:25.54 tex:128524 mv:6022 misc:1390 imb:4 pmb:970 smb:376 d:- ref:0 ; in:2576 out:2576 type:P dur:82000000 cpbdur:82000000 q:25.37 tex:153705 mv:5905 misc:1422 imb:15 pmb:1037 smb:298 d:- ref:0 ; in:2577 out:2577 type:P dur:82000000 cpbdur:82000000 q:25.29 tex:150526 mv:5915 misc:1431 imb:41 pmb:1035 smb:274 d:- ref:0 ; in:2578 out:2578 type:P dur:82000000 cpbdur:82000000 q:25.41 tex:157579 mv:6225 misc:1412 imb:22 pmb:999 smb:329 d:- ref:0 ; in:2579 out:2579 type:P dur:82000000 cpbdur:82000000 q:25.63 tex:130156 mv:6610 misc:1426 imb:6 pmb:986 smb:358 d:- ref:0 ; in:2580 out:2580 type:P dur:82000000 cpbdur:82000000 q:25.55 tex:125811 mv:5733 misc:1384 imb:7 pmb:915 smb:428 d:- ref:0 ; in:2581 out:2581 type:P dur:82000000 cpbdur:82000000 q:25.37 tex:150307 mv:6288 misc:1445 imb:54 pmb:1070 smb:226 d:- ref:0 ; in:2582 out:2582 type:P dur:82000000 cpbdur:82000000 q:25.58 tex:127527 mv:6401 misc:1376 imb:24 pmb:955 smb:371 d:- ref:0 ; in:2583 out:2583 type:P dur:82000000 cpbdur:82000000 q:25.52 tex:123811 mv:5726 misc:1423 imb:24 pmb:988 smb:338 d:- ref:0 ; in:2584 out:2584 type:P dur:82000000 cpbdur:82000000 q:25.34 tex:156480 mv:5993 misc:1455 imb:34 pmb:1043 smb:273 d:- ref:0 ; in:2585 out:2585 type:P dur:82000000 cpbdur:82000000 q:25.47 tex:164086 mv:6586 misc:1424 imb:17 pmb:1016 smb:317 d:- ref:0 ; in:2586 out:2586 type:P dur:82000000 cpbdur:82000000 q:25.14 tex:132336 mv:4960 misc:1416 imb:10 pmb:962 smb:378 d:- ref:0 ; in:2587 out:2587 type:P dur:82000000 cpbdur:82000000 q:25.49 tex:159316 mv:7024 misc:1412 imb:25 pmb:1038 smb:287 d:- ref:0 ; in:2588 out:2588 type:P dur:82000000 cpbdur:82000000 q:25.54 tex:120513 mv:6008 misc:1375 imb:20 pmb:968 smb:362 d:- ref:0 ; in:2589 out:2589 type:P dur:82000000 cpbdur:82000000 q:25.37 tex:158283 mv:6586 misc:1435 imb:15 pmb:1050 smb:285 d:- ref:0 ; in:2590 out:2590 type:P dur:82000000 cpbdur:82000000 q:24.96 tex:125361 mv:4811 misc:1388 imb:6 pmb:965 smb:379 d:- ref:0 ; in:2591 out:2591 type:P dur:82000000 cpbdur:82000000 q:25.24 tex:155601 mv:6813 misc:1410 imb:23 pmb:1025 smb:302 d:- ref:0 ; in:2592 out:2592 type:P dur:82000000 cpbdur:82000000 q:24.79 tex:118413 mv:5162 misc:1441 imb:19 pmb:1006 smb:325 d:- ref:0 ; in:2593 out:2593 type:P dur:82000000 cpbdur:82000000 q:25.42 tex:154451 mv:7025 misc:1412 imb:21 pmb:1027 smb:302 d:- ref:0 ; in:2594 out:2594 type:P dur:82000000 cpbdur:82000000 q:25.00 tex:106750 mv:4885 misc:1437 imb:18 pmb:975 smb:357 d:- ref:0 ; in:2595 out:2595 type:P dur:82000000 cpbdur:82000000 q:25.48 tex:154527 mv:7094 misc:1419 imb:17 pmb:1050 smb:283 d:- ref:0 ; in:2596 out:2596 type:P dur:82000000 cpbdur:82000000 q:25.02 tex:111629 mv:5024 misc:1427 imb:7 pmb:1006 smb:337 d:- ref:0 ; in:2597 out:2597 type:P dur:82000000 cpbdur:82000000 q:25.42 tex:151629 mv:6949 misc:1414 imb:17 pmb:1023 smb:310 d:- ref:0 ; in:2598 out:2598 type:P dur:82000000 cpbdur:82000000 q:25.29 tex:132289 mv:5614 misc:1433 imb:14 pmb:966 smb:370 d:- ref:0 ; in:2599 out:2599 type:P dur:82000000 cpbdur:82000000 q:25.41 tex:150382 mv:6383 misc:1411 imb:15 pmb:1035 smb:300 d:- ref:0 ; in:2600 out:2600 type:P dur:82000000 cpbdur:82000000 q:25.34 tex:139972 mv:6102 misc:1390 imb:12 pmb:996 smb:342 d:- ref:0 ; in:2601 out:2601 type:P dur:82000000 cpbdur:82000000 q:25.52 tex:130718 mv:6875 misc:1391 imb:17 pmb:985 smb:348 d:- ref:0 ; in:2602 out:2602 type:P dur:82000000 cpbdur:82000000 q:24.81 tex:109887 mv:4770 misc:1423 imb:10 pmb:1002 smb:338 d:- ref:0 ; in:2603 out:2603 type:P dur:82000000 cpbdur:82000000 q:25.21 tex:151294 mv:6265 misc:1409 imb:21 pmb:997 smb:332 d:- ref:0 ; in:2604 out:2604 type:P dur:82000000 cpbdur:82000000 q:25.19 tex:141251 mv:5829 misc:1408 imb:5 pmb:1021 smb:324 d:- ref:0 ; in:2605 out:2605 type:P dur:82000000 cpbdur:82000000 q:25.46 tex:146244 mv:6710 misc:1430 imb:17 pmb:1014 smb:319 d:- ref:0 ; in:2606 out:2606 type:P dur:82000000 cpbdur:82000000 q:25.24 tex:131230 mv:5572 misc:1446 imb:14 pmb:1014 smb:322 d:- ref:0 ; in:2607 out:2607 type:P dur:82000000 cpbdur:82000000 q:24.18 tex:78292 mv:3956 misc:1504 imb:37 pmb:952 smb:361 d:- ref:0 ; in:2608 out:2608 type:P dur:82000000 cpbdur:82000000 q:24.76 tex:135156 mv:6183 misc:1437 imb:15 pmb:1013 smb:322 d:- ref:0 ; in:2609 out:2609 type:P dur:82000000 cpbdur:82000000 q:26.33 tex:158552 mv:13965 misc:1419 imb:1299 pmb:51 smb:0 d:- ref:0 ; in:2610 out:2610 type:P dur:82000000 cpbdur:82000000 q:24.78 tex:37952 mv:6956 misc:1452 imb:122 pmb:572 smb:656 d:- ref:0 ; in:2611 out:2611 type:P dur:82000000 cpbdur:82000000 q:23.60 tex:39919 mv:7194 misc:1447 imb:146 pmb:616 smb:588 d:- ref:0 ; in:2612 out:2612 type:P dur:82000000 cpbdur:82000000 q:22.55 tex:41950 mv:5935 misc:1491 imb:153 pmb:669 smb:528 d:- ref:0 ; in:2613 out:2613 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:56632 mv:7846 misc:1546 imb:247 pmb:752 smb:351 d:- ref:0 ; in:2614 out:2614 type:P dur:82000000 cpbdur:82000000 q:21.17 tex:57091 mv:6640 misc:1517 imb:170 pmb:776 smb:404 d:- ref:0 ; in:2615 out:2615 type:P dur:82000000 cpbdur:82000000 q:21.34 tex:59248 mv:7779 misc:1509 imb:179 pmb:771 smb:400 d:- ref:0 ; in:2616 out:2616 type:P dur:82000000 cpbdur:82000000 q:21.30 tex:57147 mv:7359 misc:1502 imb:150 pmb:721 smb:479 d:- ref:0 ; in:2617 out:2617 type:P dur:82000000 cpbdur:82000000 q:21.22 tex:50716 mv:7095 misc:1525 imb:204 pmb:737 smb:409 d:- ref:0 ; in:2618 out:2618 type:P dur:82000000 cpbdur:82000000 q:20.81 tex:40449 mv:6114 misc:1501 imb:164 pmb:706 smb:480 d:- ref:0 ; in:2619 out:2619 type:P dur:82000000 cpbdur:82000000 q:20.87 tex:38544 mv:6470 misc:1530 imb:178 pmb:700 smb:472 d:- ref:0 ; in:2620 out:2620 type:P dur:82000000 cpbdur:82000000 q:21.53 tex:57007 mv:7947 misc:1494 imb:203 pmb:697 smb:450 d:- ref:0 ; in:2621 out:2621 type:P dur:82000000 cpbdur:82000000 q:20.88 tex:45110 mv:6936 misc:1530 imb:199 pmb:764 smb:387 d:- ref:0 ; in:2622 out:2622 type:P dur:82000000 cpbdur:82000000 q:21.55 tex:58230 mv:8275 misc:1487 imb:193 pmb:713 smb:444 d:- ref:0 ; in:2623 out:2623 type:P dur:82000000 cpbdur:82000000 q:21.26 tex:60979 mv:7527 misc:1534 imb:212 pmb:775 smb:363 d:- ref:0 ; in:2624 out:2624 type:P dur:82000000 cpbdur:82000000 q:21.45 tex:63422 mv:7558 misc:1516 imb:196 pmb:716 smb:438 d:- ref:0 ; in:2625 out:2625 type:P dur:82000000 cpbdur:82000000 q:21.11 tex:50164 mv:5894 misc:1534 imb:138 pmb:730 smb:482 d:- ref:0 ; in:2626 out:2626 type:P dur:82000000 cpbdur:82000000 q:21.48 tex:65998 mv:8594 misc:1504 imb:236 pmb:798 smb:316 d:- ref:0 ; in:2627 out:2627 type:P dur:82000000 cpbdur:82000000 q:21.44 tex:65399 mv:6897 misc:1536 imb:154 pmb:763 smb:433 d:- ref:0 ; in:2628 out:2628 type:P dur:82000000 cpbdur:82000000 q:21.91 tex:69025 mv:8222 misc:1505 imb:164 pmb:778 smb:408 d:- ref:0 ; in:2629 out:2629 type:P dur:82000000 cpbdur:82000000 q:21.70 tex:58686 mv:6902 misc:1508 imb:168 pmb:734 smb:448 d:- ref:0 ; in:2630 out:2630 type:P dur:82000000 cpbdur:82000000 q:22.04 tex:68892 mv:8252 misc:1512 imb:211 pmb:778 smb:361 d:- ref:0 ; in:2631 out:2631 type:P dur:82000000 cpbdur:82000000 q:21.44 tex:60123 mv:7076 misc:1537 imb:198 pmb:810 smb:342 d:- ref:0 ; in:2632 out:2632 type:P dur:82000000 cpbdur:82000000 q:21.69 tex:64663 mv:7421 misc:1508 imb:151 pmb:783 smb:416 d:- ref:0 ; in:2633 out:2633 type:P dur:82000000 cpbdur:82000000 q:21.40 tex:72301 mv:7487 misc:1516 imb:254 pmb:833 smb:263 d:- ref:0 ; in:2634 out:2634 type:P dur:82000000 cpbdur:82000000 q:21.91 tex:82392 mv:7693 misc:1499 imb:154 pmb:755 smb:441 d:- ref:0 ; in:2635 out:2635 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:62862 mv:6434 misc:1528 imb:189 pmb:752 smb:409 d:- ref:0 ; in:2636 out:2636 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:81709 mv:7074 misc:1529 imb:167 pmb:770 smb:413 d:- ref:0 ; in:2637 out:2637 type:P dur:82000000 cpbdur:82000000 q:21.55 tex:61904 mv:6222 misc:1522 imb:174 pmb:754 smb:422 d:- ref:0 ; in:2638 out:2638 type:P dur:82000000 cpbdur:82000000 q:21.56 tex:78332 mv:7132 misc:1520 imb:175 pmb:802 smb:373 d:- ref:0 ; in:2639 out:2639 type:P dur:82000000 cpbdur:82000000 q:21.76 tex:71692 mv:7035 misc:1489 imb:176 pmb:787 smb:387 d:- ref:0 ; in:2640 out:2640 type:P dur:82000000 cpbdur:82000000 q:22.64 tex:89711 mv:7955 misc:1494 imb:173 pmb:765 smb:412 d:- ref:0 ; in:2641 out:2641 type:P dur:82000000 cpbdur:82000000 q:22.65 tex:73361 mv:7103 misc:1496 imb:163 pmb:775 smb:412 d:- ref:0 ; in:2642 out:2642 type:P dur:82000000 cpbdur:82000000 q:22.77 tex:73655 mv:6866 misc:1511 imb:209 pmb:742 smb:399 d:- ref:0 ; in:2643 out:2643 type:P dur:82000000 cpbdur:82000000 q:22.44 tex:84412 mv:7259 misc:1513 imb:221 pmb:813 smb:316 d:- ref:0 ; in:2644 out:2644 type:P dur:82000000 cpbdur:82000000 q:22.33 tex:79258 mv:6626 misc:1516 imb:139 pmb:850 smb:361 d:- ref:0 ; in:2645 out:2645 type:P dur:82000000 cpbdur:82000000 q:22.52 tex:65809 mv:5728 misc:1495 imb:108 pmb:726 smb:516 d:- ref:0 ; in:2646 out:2646 type:P dur:82000000 cpbdur:82000000 q:22.37 tex:91365 mv:6838 misc:1517 imb:174 pmb:846 smb:330 d:- ref:0 ; in:2647 out:2647 type:P dur:82000000 cpbdur:82000000 q:22.54 tex:62116 mv:5599 misc:1501 imb:102 pmb:735 smb:513 d:- ref:0 ; in:2648 out:2648 type:P dur:82000000 cpbdur:82000000 q:22.91 tex:93123 mv:7110 misc:1511 imb:133 pmb:804 smb:413 d:- ref:0 ; in:2649 out:2649 type:P dur:82000000 cpbdur:82000000 q:22.88 tex:74363 mv:6217 misc:1484 imb:136 pmb:773 smb:441 d:- ref:0 ; in:2650 out:2650 type:P dur:82000000 cpbdur:82000000 q:22.97 tex:88896 mv:6695 misc:1481 imb:130 pmb:787 smb:433 d:- ref:0 ; in:2651 out:2651 type:P dur:82000000 cpbdur:82000000 q:23.00 tex:81038 mv:6774 misc:1492 imb:164 pmb:802 smb:384 d:- ref:0 ; in:2652 out:2652 type:P dur:82000000 cpbdur:82000000 q:23.00 tex:85338 mv:6148 misc:1490 imb:101 pmb:818 smb:431 d:- ref:0 ; in:2653 out:2653 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:75708 mv:5701 misc:1495 imb:136 pmb:799 smb:415 d:- ref:0 ; in:2654 out:2654 type:P dur:82000000 cpbdur:82000000 q:23.00 tex:94974 mv:6884 misc:1478 imb:120 pmb:834 smb:396 d:- ref:0 ; in:2655 out:2655 type:P dur:82000000 cpbdur:82000000 q:22.89 tex:85877 mv:6454 misc:1501 imb:116 pmb:846 smb:388 d:- ref:0 ; in:2656 out:2656 type:P dur:82000000 cpbdur:82000000 q:23.05 tex:86766 mv:6693 misc:1493 imb:141 pmb:849 smb:360 d:- ref:0 ; in:2657 out:2657 type:P dur:82000000 cpbdur:82000000 q:22.78 tex:65797 mv:5901 misc:1518 imb:130 pmb:825 smb:395 d:- ref:0 ; in:2658 out:2658 type:P dur:82000000 cpbdur:82000000 q:23.13 tex:94817 mv:6576 misc:1487 imb:144 pmb:832 smb:374 d:- ref:0 ; in:2659 out:2659 type:P dur:82000000 cpbdur:82000000 q:23.93 tex:98612 mv:8976 misc:1484 imb:116 pmb:870 smb:364 d:- ref:0 ; in:2660 out:2660 type:P dur:82000000 cpbdur:82000000 q:23.62 tex:84307 mv:6514 misc:1491 imb:103 pmb:852 smb:395 d:- ref:0 ; in:2661 out:2661 type:P dur:82000000 cpbdur:82000000 q:23.29 tex:83470 mv:6655 misc:1531 imb:128 pmb:889 smb:333 d:- ref:0 ; in:2662 out:2662 type:P dur:82000000 cpbdur:82000000 q:23.53 tex:89092 mv:6975 misc:1485 imb:70 pmb:879 smb:401 d:- ref:0 ; in:2663 out:2663 type:P dur:82000000 cpbdur:82000000 q:23.18 tex:88120 mv:6116 misc:1492 imb:127 pmb:914 smb:309 d:- ref:0 ; in:2664 out:2664 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:96002 mv:7491 misc:1467 imb:90 pmb:891 smb:369 d:- ref:0 ; in:2665 out:2665 type:P dur:82000000 cpbdur:82000000 q:23.20 tex:96451 mv:5792 misc:1493 imb:96 pmb:924 smb:330 d:- ref:0 ; in:2666 out:2666 type:P dur:82000000 cpbdur:82000000 q:23.65 tex:97350 mv:7702 misc:1468 imb:73 pmb:894 smb:383 d:- ref:0 ; in:2667 out:2667 type:P dur:82000000 cpbdur:82000000 q:22.99 tex:78039 mv:4826 misc:1487 imb:79 pmb:906 smb:365 d:- ref:0 ; in:2668 out:2668 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:79805 mv:4805 misc:1486 imb:47 pmb:849 smb:454 d:- ref:0 ; in:2669 out:2669 type:P dur:82000000 cpbdur:82000000 q:22.40 tex:100217 mv:5113 misc:1494 imb:78 pmb:931 smb:341 d:- ref:0 ; in:2670 out:2670 type:P dur:82000000 cpbdur:82000000 q:21.25 tex:70483 mv:3518 misc:1519 imb:49 pmb:926 smb:375 d:- ref:0 ; in:2671 out:2671 type:P dur:82000000 cpbdur:82000000 q:19.05 tex:129076 mv:4187 misc:1497 imb:68 pmb:1077 smb:205 d:- ref:0 ; in:2672 out:2672 type:P dur:82000000 cpbdur:82000000 q:18.38 tex:75868 mv:3408 misc:1540 imb:33 pmb:976 smb:341 d:- ref:0 ; in:2673 out:2673 type:P dur:82000000 cpbdur:82000000 q:17.71 tex:39313 mv:1697 misc:1238 imb:5 pmb:475 smb:870 d:- ref:0 ; in:2674 out:2674 type:P dur:82000000 cpbdur:82000000 q:18.47 tex:71624 mv:2974 misc:1506 imb:9 pmb:812 smb:529 d:- ref:0 ; in:2675 out:2675 type:P dur:82000000 cpbdur:82000000 q:18.21 tex:50749 mv:2293 misc:1494 imb:7 pmb:697 smb:646 d:- ref:0 ; in:2676 out:2676 type:P dur:82000000 cpbdur:82000000 q:18.11 tex:49143 mv:2389 misc:1556 imb:13 pmb:715 smb:622 d:- ref:0 ; in:2677 out:2677 type:P dur:82000000 cpbdur:82000000 q:18.26 tex:54977 mv:2504 misc:1551 imb:10 pmb:748 smb:592 d:- ref:0 ; in:2678 out:2678 type:P dur:82000000 cpbdur:82000000 q:18.08 tex:44915 mv:2799 misc:1574 imb:30 pmb:783 smb:537 d:- ref:0 ; in:2679 out:2679 type:P dur:82000000 cpbdur:82000000 q:16.18 tex:157501 mv:4034 misc:1481 imb:39 pmb:1198 smb:113 d:- ref:0 ; in:2680 out:2680 type:P dur:82000000 cpbdur:82000000 q:16.94 tex:45643 mv:2841 misc:1596 imb:12 pmb:877 smb:461 d:- ref:0 ; in:2681 out:2681 type:P dur:82000000 cpbdur:82000000 q:20.94 tex:409509 mv:17121 misc:1418 imb:1145 pmb:205 smb:0 d:- ref:0 ; in:2682 out:2682 type:P dur:82000000 cpbdur:82000000 q:24.94 tex:20344 mv:1447 misc:1081 imb:2 pmb:381 smb:967 d:- ref:0 ; in:2683 out:2683 type:P dur:82000000 cpbdur:82000000 q:23.17 tex:12706 mv:1257 misc:1181 imb:2 pmb:391 smb:957 d:- ref:0 ; in:2684 out:2684 type:P dur:82000000 cpbdur:82000000 q:21.55 tex:26299 mv:2765 misc:1440 imb:75 pmb:639 smb:636 d:- ref:0 ; in:2685 out:2685 type:P dur:82000000 cpbdur:82000000 q:19.20 tex:83071 mv:4189 misc:1540 imb:82 pmb:977 smb:291 d:- ref:0 ; in:2686 out:2686 type:P dur:82000000 cpbdur:82000000 q:17.79 tex:37578 mv:3104 misc:1550 imb:40 pmb:828 smb:482 d:- ref:0 ; in:2687 out:2687 type:P dur:82000000 cpbdur:82000000 q:15.69 tex:132447 mv:4051 misc:1494 imb:30 pmb:1203 smb:117 d:- ref:0 ; in:2688 out:2688 type:P dur:82000000 cpbdur:82000000 q:15.62 tex:23383 mv:2231 misc:1522 imb:22 pmb:643 smb:685 d:- ref:0 ; in:2689 out:2689 type:P dur:82000000 cpbdur:82000000 q:15.60 tex:29001 mv:2083 misc:1492 imb:22 pmb:577 smb:751 d:- ref:0 ; in:2690 out:2690 type:P dur:82000000 cpbdur:82000000 q:17.23 tex:35834 mv:3604 misc:1578 imb:68 pmb:900 smb:382 d:- ref:0 ; in:2691 out:2691 type:P dur:82000000 cpbdur:82000000 q:16.17 tex:38915 mv:3073 misc:1612 imb:42 pmb:845 smb:463 d:- ref:0 ; in:2692 out:2692 type:P dur:82000000 cpbdur:82000000 q:16.65 tex:23802 mv:2905 misc:1565 imb:45 pmb:747 smb:558 d:- ref:0 ; in:2693 out:2693 type:P dur:82000000 cpbdur:82000000 q:16.80 tex:21166 mv:3269 misc:1581 imb:88 pmb:671 smb:591 d:- ref:0 ; in:2694 out:2694 type:P dur:82000000 cpbdur:82000000 q:15.40 tex:54953 mv:4776 misc:1575 imb:68 pmb:984 smb:298 d:- ref:0 ; in:2695 out:2695 type:P dur:82000000 cpbdur:82000000 q:15.83 tex:23245 mv:3092 misc:1599 imb:60 pmb:728 smb:562 d:- ref:0 ; in:2696 out:2696 type:P dur:82000000 cpbdur:82000000 q:14.22 tex:62011 mv:4105 misc:1564 imb:39 pmb:1023 smb:288 d:- ref:0 ; in:2697 out:2697 type:P dur:82000000 cpbdur:82000000 q:15.87 tex:19428 mv:2816 misc:1572 imb:69 pmb:634 smb:647 d:- ref:0 ; in:2698 out:2698 type:P dur:82000000 cpbdur:82000000 q:15.24 tex:14362 mv:3046 misc:1520 imb:74 pmb:492 smb:784 d:- ref:0 ; in:2699 out:2699 type:P dur:82000000 cpbdur:82000000 q:14.04 tex:26976 mv:3172 misc:1596 imb:35 pmb:718 smb:597 d:- ref:0 ; in:2700 out:2700 type:P dur:82000000 cpbdur:82000000 q:16.58 tex:19858 mv:3925 misc:1593 imb:150 pmb:655 smb:545 d:- ref:0 ; in:2701 out:2701 type:P dur:82000000 cpbdur:82000000 q:15.88 tex:23724 mv:3261 misc:1591 imb:88 pmb:713 smb:549 d:- ref:0 ; in:2702 out:2702 type:P dur:82000000 cpbdur:82000000 q:15.12 tex:20038 mv:3203 misc:1527 imb:61 pmb:559 smb:730 d:- ref:0 ; in:2703 out:2703 type:P dur:82000000 cpbdur:82000000 q:15.84 tex:20438 mv:2782 misc:1596 imb:69 pmb:618 smb:663 d:- ref:0 ; in:2704 out:2704 type:P dur:82000000 cpbdur:82000000 q:14.83 tex:13901 mv:2052 misc:1399 imb:33 pmb:418 smb:899 d:- ref:0 ; in:2705 out:2705 type:P dur:82000000 cpbdur:82000000 q:15.84 tex:24234 mv:2754 misc:1564 imb:47 pmb:694 smb:609 d:- ref:0 ; in:2706 out:2706 type:P dur:82000000 cpbdur:82000000 q:16.80 tex:21995 mv:3557 misc:1616 imb:93 pmb:755 smb:502 d:- ref:0 ; in:2707 out:2707 type:P dur:82000000 cpbdur:82000000 q:15.65 tex:24777 mv:2873 misc:1598 imb:42 pmb:733 smb:575 d:- ref:0 ; in:2708 out:2708 type:P dur:82000000 cpbdur:82000000 q:15.96 tex:19773 mv:2687 misc:1532 imb:79 pmb:557 smb:714 d:- ref:0 ; in:2709 out:2709 type:P dur:82000000 cpbdur:82000000 q:14.73 tex:16032 mv:2899 misc:1509 imb:43 pmb:537 smb:770 d:- ref:0 ; in:2710 out:2710 type:P dur:82000000 cpbdur:82000000 q:15.46 tex:17876 mv:2954 misc:1490 imb:57 pmb:524 smb:769 d:- ref:0 ; in:2711 out:2711 type:P dur:82000000 cpbdur:82000000 q:15.41 tex:16713 mv:3085 misc:1418 imb:90 pmb:447 smb:813 d:- ref:0 ; in:2712 out:2712 type:P dur:82000000 cpbdur:82000000 q:16.84 tex:21309 mv:3607 misc:1580 imb:94 pmb:713 smb:543 d:- ref:0 ; in:2713 out:2713 type:P dur:82000000 cpbdur:82000000 q:15.80 tex:24154 mv:3082 misc:1556 imb:75 pmb:686 smb:589 d:- ref:0 ; in:2714 out:2714 type:P dur:82000000 cpbdur:82000000 q:15.50 tex:15026 mv:3255 misc:1487 imb:82 pmb:501 smb:767 d:- ref:0 ; in:2715 out:2715 type:P dur:82000000 cpbdur:82000000 q:14.84 tex:13080 mv:2151 misc:1385 imb:40 pmb:385 smb:925 d:- ref:0 ; in:2716 out:2716 type:P dur:82000000 cpbdur:82000000 q:15.53 tex:16855 mv:2507 misc:1558 imb:54 pmb:579 smb:717 d:- ref:0 ; in:2717 out:2717 type:P dur:82000000 cpbdur:82000000 q:17.51 tex:15952 mv:3782 misc:1530 imb:112 pmb:610 smb:628 d:- ref:0 ; in:2718 out:2718 type:P dur:82000000 cpbdur:82000000 q:19.49 tex:47002 mv:7931 misc:1499 imb:341 pmb:863 smb:146 d:- ref:0 ; in:2719 out:2719 type:P dur:82000000 cpbdur:82000000 q:20.70 tex:45694 mv:7168 misc:1466 imb:291 pmb:886 smb:173 d:- ref:0 ; in:2720 out:2720 type:P dur:82000000 cpbdur:82000000 q:21.74 tex:58891 mv:8912 misc:1421 imb:403 pmb:904 smb:43 d:- ref:0 ; in:2721 out:2721 type:P dur:82000000 cpbdur:82000000 q:21.60 tex:48110 mv:7654 misc:1484 imb:274 pmb:928 smb:148 d:- ref:0 ; in:2722 out:2722 type:P dur:82000000 cpbdur:82000000 q:21.96 tex:66458 mv:8472 misc:1454 imb:337 pmb:926 smb:87 d:- ref:0 ; in:2723 out:2723 type:P dur:82000000 cpbdur:82000000 q:21.87 tex:59747 mv:8008 misc:1485 imb:249 pmb:924 smb:177 d:- ref:0 ; in:2724 out:2724 type:P dur:82000000 cpbdur:82000000 q:21.86 tex:60726 mv:7948 misc:1486 imb:219 pmb:948 smb:183 d:- ref:0 ; in:2725 out:2725 type:P dur:82000000 cpbdur:82000000 q:21.85 tex:65274 mv:6749 misc:1465 imb:128 pmb:1031 smb:191 d:- ref:0 ; in:2726 out:2726 type:P dur:82000000 cpbdur:82000000 q:21.71 tex:64994 mv:5636 misc:1458 imb:88 pmb:1002 smb:260 d:- ref:0 ; in:2727 out:2727 type:P dur:82000000 cpbdur:82000000 q:21.73 tex:70194 mv:5887 misc:1439 imb:75 pmb:983 smb:292 d:- ref:0 ; in:2728 out:2728 type:P dur:82000000 cpbdur:82000000 q:21.67 tex:69791 mv:5216 misc:1441 imb:57 pmb:1010 smb:283 d:- ref:0 ; in:2729 out:2729 type:P dur:82000000 cpbdur:82000000 q:21.93 tex:81040 mv:5789 misc:1475 imb:83 pmb:1013 smb:254 d:- ref:0 ; in:2730 out:2730 type:P dur:82000000 cpbdur:82000000 q:22.12 tex:83784 mv:5764 misc:1436 imb:49 pmb:1032 smb:269 d:- ref:0 ; in:2731 out:2731 type:P dur:82000000 cpbdur:82000000 q:22.06 tex:81641 mv:5091 misc:1452 imb:53 pmb:1019 smb:278 d:- ref:0 ; in:2732 out:2732 type:P dur:82000000 cpbdur:82000000 q:22.30 tex:91894 mv:5681 misc:1401 imb:42 pmb:1011 smb:297 d:- ref:0 ; in:2733 out:2733 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:93235 mv:5574 misc:1439 imb:46 pmb:1002 smb:302 d:- ref:0 ; in:2734 out:2734 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:79055 mv:5303 misc:1394 imb:50 pmb:967 smb:333 d:- ref:0 ; in:2735 out:2735 type:P dur:82000000 cpbdur:82000000 q:22.40 tex:101010 mv:5098 misc:1428 imb:61 pmb:1052 smb:237 d:- ref:0 ; in:2736 out:2736 type:P dur:82000000 cpbdur:82000000 q:22.34 tex:92710 mv:5050 misc:1464 imb:71 pmb:1068 smb:211 d:- ref:0 ; in:2737 out:2737 type:P dur:82000000 cpbdur:82000000 q:22.36 tex:88935 mv:5379 misc:1470 imb:105 pmb:1093 smb:152 d:- ref:0 ; in:2738 out:2738 type:P dur:82000000 cpbdur:82000000 q:22.51 tex:72220 mv:5268 misc:1472 imb:125 pmb:1082 smb:143 d:- ref:0 ; in:2739 out:2739 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:86052 mv:6585 misc:1435 imb:184 pmb:1137 smb:29 d:- ref:0 ; in:2740 out:2740 type:P dur:82000000 cpbdur:82000000 q:22.33 tex:105872 mv:6712 misc:1424 imb:159 pmb:1170 smb:21 d:- ref:0 ; in:2741 out:2741 type:P dur:82000000 cpbdur:82000000 q:22.11 tex:72078 mv:6916 misc:1454 imb:153 pmb:1144 smb:53 d:- ref:0 ; in:2742 out:2742 type:P dur:82000000 cpbdur:82000000 q:21.06 tex:68990 mv:4614 misc:1484 imb:54 pmb:1154 smb:142 d:- ref:0 ; in:2743 out:2743 type:P dur:82000000 cpbdur:82000000 q:20.19 tex:77488 mv:4181 misc:1515 imb:48 pmb:1115 smb:187 d:- ref:0 ; in:2744 out:2744 type:P dur:82000000 cpbdur:82000000 q:18.96 tex:95784 mv:4336 misc:1480 imb:24 pmb:1206 smb:120 d:- ref:0 ; in:2745 out:2745 type:P dur:82000000 cpbdur:82000000 q:17.16 tex:117427 mv:3960 misc:1469 imb:11 pmb:1228 smb:111 d:- ref:0 ; in:2746 out:2746 type:P dur:82000000 cpbdur:82000000 q:18.20 tex:34157 mv:3722 misc:1585 imb:43 pmb:902 smb:405 d:- ref:0 ; in:2747 out:2747 type:P dur:82000000 cpbdur:82000000 q:21.37 tex:65428 mv:6553 misc:1475 imb:158 pmb:1089 smb:103 d:- ref:0 ; in:2748 out:2748 type:P dur:82000000 cpbdur:82000000 q:23.72 tex:83693 mv:7248 misc:1499 imb:195 pmb:994 smb:161 d:- ref:0 ; in:2749 out:2749 type:P dur:82000000 cpbdur:82000000 q:24.17 tex:100833 mv:6446 misc:1489 imb:183 pmb:1000 smb:167 d:- ref:0 ; in:2750 out:2750 type:I dur:82000000 cpbdur:82000000 q:17.71 tex:638168 mv:15292 misc:380 imb:1350 pmb:0 smb:0 d:- ref:; in:2751 out:2751 type:P dur:82000000 cpbdur:82000000 q:26.78 tex:22445 mv:985 misc:594 imb:11 pmb:221 smb:1118 d:- ref:0 ; in:2752 out:2752 type:P dur:82000000 cpbdur:82000000 q:25.46 tex:48255 mv:1717 misc:924 imb:49 pmb:279 smb:1022 d:- ref:0 ; in:2753 out:2753 type:P dur:82000000 cpbdur:82000000 q:24.45 tex:55900 mv:2233 misc:1243 imb:58 pmb:409 smb:883 d:- ref:0 ; in:2754 out:2754 type:P dur:82000000 cpbdur:82000000 q:23.75 tex:56511 mv:2942 misc:1291 imb:77 pmb:476 smb:797 d:- ref:0 ; in:2755 out:2755 type:P dur:82000000 cpbdur:82000000 q:22.75 tex:45345 mv:3288 misc:1511 imb:40 pmb:730 smb:580 d:- ref:0 ; in:2756 out:2756 type:P dur:82000000 cpbdur:82000000 q:22.98 tex:54194 mv:2447 misc:1231 imb:31 pmb:459 smb:860 d:- ref:0 ; in:2757 out:2757 type:P dur:82000000 cpbdur:82000000 q:23.03 tex:61438 mv:2582 misc:1164 imb:60 pmb:436 smb:854 d:- ref:0 ; in:2758 out:2758 type:P dur:82000000 cpbdur:82000000 q:22.94 tex:61737 mv:2369 misc:1238 imb:47 pmb:459 smb:844 d:- ref:0 ; in:2759 out:2759 type:P dur:82000000 cpbdur:82000000 q:22.52 tex:56498 mv:1423 misc:887 imb:14 pmb:309 smb:1027 d:- ref:0 ; in:2760 out:2760 type:P dur:82000000 cpbdur:82000000 q:22.80 tex:59504 mv:1952 misc:1088 imb:26 pmb:406 smb:918 d:- ref:0 ; in:2761 out:2761 type:P dur:82000000 cpbdur:82000000 q:23.10 tex:61704 mv:2762 misc:1342 imb:62 pmb:514 smb:774 d:- ref:0 ; in:2762 out:2762 type:P dur:82000000 cpbdur:82000000 q:22.96 tex:64509 mv:4013 misc:1478 imb:82 pmb:701 smb:567 d:- ref:0 ; in:2763 out:2763 type:P dur:82000000 cpbdur:82000000 q:21.80 tex:52730 mv:4203 misc:1547 imb:69 pmb:897 smb:384 d:- ref:0 ; in:2764 out:2764 type:P dur:82000000 cpbdur:82000000 q:22.09 tex:54221 mv:3104 misc:1491 imb:41 pmb:724 smb:585 d:- ref:0 ; in:2765 out:2765 type:P dur:82000000 cpbdur:82000000 q:22.72 tex:55007 mv:2459 misc:1238 imb:46 pmb:477 smb:827 d:- ref:0 ; in:2766 out:2766 type:P dur:82000000 cpbdur:82000000 q:22.90 tex:70241 mv:3360 misc:1407 imb:58 pmb:686 smb:606 d:- ref:0 ; in:2767 out:2767 type:P dur:82000000 cpbdur:82000000 q:22.85 tex:69760 mv:3068 misc:1388 imb:36 pmb:704 smb:610 d:- ref:0 ; in:2768 out:2768 type:P dur:82000000 cpbdur:82000000 q:22.92 tex:71222 mv:2416 misc:1242 imb:24 pmb:548 smb:778 d:- ref:0 ; in:2769 out:2769 type:P dur:82000000 cpbdur:82000000 q:23.18 tex:82200 mv:3349 misc:1411 imb:46 pmb:741 smb:563 d:- ref:0 ; in:2770 out:2770 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:67461 mv:3433 misc:1402 imb:64 pmb:659 smb:627 d:- ref:0 ; in:2771 out:2771 type:P dur:82000000 cpbdur:82000000 q:24.35 tex:103474 mv:9750 misc:1416 imb:257 pmb:1088 smb:5 d:- ref:0 ; in:2772 out:2772 type:P dur:82000000 cpbdur:82000000 q:23.05 tex:54455 mv:4637 misc:1468 imb:75 pmb:1061 smb:214 d:- ref:0 ; in:2773 out:2773 type:P dur:82000000 cpbdur:82000000 q:22.18 tex:87703 mv:6395 misc:1438 imb:144 pmb:1167 smb:39 d:- ref:0 ; in:2774 out:2774 type:P dur:82000000 cpbdur:82000000 q:20.03 tex:77677 mv:3675 misc:1472 imb:10 pmb:1115 smb:225 d:- ref:0 ; in:2775 out:2775 type:P dur:82000000 cpbdur:82000000 q:18.64 tex:87681 mv:4430 misc:1457 imb:32 pmb:1198 smb:120 d:- ref:0 ; in:2776 out:2776 type:P dur:82000000 cpbdur:82000000 q:17.89 tex:60716 mv:3966 misc:1558 imb:31 pmb:1096 smb:223 d:- ref:0 ; in:2777 out:2777 type:P dur:82000000 cpbdur:82000000 q:17.81 tex:39056 mv:3451 misc:1573 imb:29 pmb:909 smb:412 d:- ref:0 ; in:2778 out:2778 type:P dur:82000000 cpbdur:82000000 q:16.09 tex:161445 mv:4156 misc:1447 imb:21 pmb:1262 smb:67 d:- ref:0 ; in:2779 out:2779 type:P dur:82000000 cpbdur:82000000 q:16.66 tex:28195 mv:3177 misc:1596 imb:15 pmb:933 smb:402 d:- ref:0 ; in:2780 out:2780 type:P dur:82000000 cpbdur:82000000 q:16.85 tex:29703 mv:3182 misc:1603 imb:31 pmb:852 smb:467 d:- ref:0 ; in:2781 out:2781 type:P dur:82000000 cpbdur:82000000 q:17.60 tex:29967 mv:3211 misc:1582 imb:38 pmb:835 smb:477 d:- ref:0 ; in:2782 out:2782 type:P dur:82000000 cpbdur:82000000 q:15.71 tex:59892 mv:3654 misc:1566 imb:18 pmb:1116 smb:216 d:- ref:0 ; in:2783 out:2783 type:P dur:82000000 cpbdur:82000000 q:15.80 tex:38956 mv:2638 misc:1598 imb:7 pmb:828 smb:515 d:- ref:0 ; in:2784 out:2784 type:P dur:82000000 cpbdur:82000000 q:15.27 tex:58527 mv:2895 misc:1570 imb:5 pmb:879 smb:466 d:- ref:0 ; in:2785 out:2785 type:P dur:82000000 cpbdur:82000000 q:19.27 tex:195059 mv:15332 misc:1417 imb:1276 pmb:74 smb:0 d:- ref:0 ; in:2786 out:2786 type:P dur:82000000 cpbdur:82000000 q:21.55 tex:1302 mv:147 misc:343 imb:0 pmb:37 smb:1313 d:- ref:0 ; in:2787 out:2787 type:P dur:82000000 cpbdur:82000000 q:19.43 tex:7798 mv:1085 misc:1053 imb:2 pmb:287 smb:1061 d:- ref:0 ; in:2788 out:2788 type:P dur:82000000 cpbdur:82000000 q:17.98 tex:8433 mv:1278 misc:1193 imb:13 pmb:330 smb:1007 d:- ref:0 ; in:2789 out:2789 type:P dur:82000000 cpbdur:82000000 q:16.50 tex:52692 mv:3534 misc:1494 imb:32 pmb:978 smb:340 d:- ref:0 ; in:2790 out:2790 type:P dur:82000000 cpbdur:82000000 q:15.73 tex:12203 mv:1622 misc:1159 imb:38 pmb:316 smb:996 d:- ref:0 ; in:2791 out:2791 type:P dur:82000000 cpbdur:82000000 q:19.73 tex:59444 mv:12117 misc:1447 imb:235 pmb:827 smb:288 d:- ref:0 ; in:2792 out:2792 type:P dur:82000000 cpbdur:82000000 q:19.59 tex:12832 mv:3634 misc:1358 imb:103 pmb:444 smb:803 d:- ref:0 ; in:2793 out:2793 type:P dur:82000000 cpbdur:82000000 q:21.38 tex:54437 mv:12997 misc:1494 imb:224 pmb:847 smb:279 d:- ref:0 ; in:2794 out:2794 type:P dur:82000000 cpbdur:82000000 q:20.10 tex:20419 mv:4199 misc:1486 imb:101 pmb:613 smb:636 d:- ref:0 ; in:2795 out:2795 type:P dur:82000000 cpbdur:82000000 q:21.78 tex:56418 mv:14210 misc:1468 imb:251 pmb:900 smb:199 d:- ref:0 ; in:2796 out:2796 type:P dur:82000000 cpbdur:82000000 q:20.33 tex:31948 mv:4269 misc:1551 imb:82 pmb:773 smb:495 d:- ref:0 ; in:2797 out:2797 type:P dur:82000000 cpbdur:82000000 q:21.71 tex:50426 mv:12950 misc:1480 imb:185 pmb:894 smb:271 d:- ref:0 ; in:2798 out:2798 type:P dur:82000000 cpbdur:82000000 q:20.65 tex:27854 mv:5118 misc:1532 imb:91 pmb:746 smb:513 d:- ref:0 ; in:2799 out:2799 type:P dur:82000000 cpbdur:82000000 q:22.31 tex:72108 mv:15272 misc:1460 imb:287 pmb:896 smb:167 d:- ref:0 ; in:2800 out:2800 type:P dur:82000000 cpbdur:82000000 q:21.17 tex:33795 mv:5175 misc:1510 imb:73 pmb:815 smb:462 d:- ref:0 ; in:2801 out:2801 type:P dur:82000000 cpbdur:82000000 q:22.33 tex:69540 mv:14696 misc:1476 imb:227 pmb:920 smb:203 d:- ref:0 ; in:2802 out:2802 type:P dur:82000000 cpbdur:82000000 q:20.58 tex:20671 mv:3598 misc:1507 imb:59 pmb:650 smb:641 d:- ref:0 ; in:2803 out:2803 type:P dur:82000000 cpbdur:82000000 q:22.33 tex:73812 mv:14682 misc:1458 imb:220 pmb:928 smb:202 d:- ref:0 ; in:2804 out:2804 type:P dur:82000000 cpbdur:82000000 q:20.74 tex:23954 mv:3916 misc:1498 imb:47 pmb:710 smb:593 d:- ref:0 ; in:2805 out:2805 type:P dur:82000000 cpbdur:82000000 q:22.45 tex:85662 mv:14272 misc:1482 imb:235 pmb:896 smb:219 d:- ref:0 ; in:2806 out:2806 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:36276 mv:3165 misc:1535 imb:43 pmb:773 smb:534 d:- ref:0 ; in:2807 out:2807 type:P dur:82000000 cpbdur:82000000 q:19.21 tex:58362 mv:4761 misc:1541 imb:73 pmb:1009 smb:268 d:- ref:0 ; in:2808 out:2808 type:P dur:82000000 cpbdur:82000000 q:17.14 tex:71670 mv:3763 misc:1519 imb:36 pmb:1051 smb:263 d:- ref:0 ; in:2809 out:2809 type:P dur:82000000 cpbdur:82000000 q:17.47 tex:40486 mv:3776 misc:1578 imb:38 pmb:962 smb:350 d:- ref:0 ; in:2810 out:2810 type:P dur:82000000 cpbdur:82000000 q:16.22 tex:62428 mv:4003 misc:1529 imb:40 pmb:1111 smb:199 d:- ref:0 ; in:2811 out:2811 type:P dur:82000000 cpbdur:82000000 q:14.70 tex:42827 mv:3638 misc:1615 imb:43 pmb:838 smb:469 d:- ref:0 ; in:2812 out:2812 type:P dur:82000000 cpbdur:82000000 q:15.79 tex:23986 mv:2538 misc:1580 imb:23 pmb:696 smb:631 d:- ref:0 ; in:2813 out:2813 type:P dur:82000000 cpbdur:82000000 q:16.20 tex:37379 mv:2465 misc:1468 imb:14 pmb:661 smb:675 d:- ref:0 ; in:2814 out:2814 type:P dur:82000000 cpbdur:82000000 q:16.00 tex:23365 mv:1814 misc:1205 imb:20 pmb:376 smb:954 d:- ref:0 ; in:2815 out:2815 type:P dur:82000000 cpbdur:82000000 q:20.00 tex:91572 mv:13908 misc:1472 imb:196 pmb:930 smb:224 d:- ref:0 ; in:2816 out:2816 type:P dur:82000000 cpbdur:82000000 q:19.97 tex:17439 mv:2802 misc:1295 imb:23 pmb:504 smb:823 d:- ref:0 ; in:2817 out:2817 type:P dur:82000000 cpbdur:82000000 q:21.75 tex:63095 mv:12261 misc:1436 imb:160 pmb:821 smb:369 d:- ref:0 ; in:2818 out:2818 type:P dur:82000000 cpbdur:82000000 q:20.25 tex:34357 mv:3814 misc:1541 imb:52 pmb:750 smb:548 d:- ref:0 ; in:2819 out:2819 type:P dur:82000000 cpbdur:82000000 q:21.85 tex:63776 mv:12953 misc:1463 imb:175 pmb:849 smb:326 d:- ref:0 ; in:2820 out:2820 type:P dur:82000000 cpbdur:82000000 q:20.11 tex:32876 mv:3542 misc:1534 imb:51 pmb:742 smb:557 d:- ref:0 ; in:2821 out:2821 type:P dur:82000000 cpbdur:82000000 q:21.80 tex:62628 mv:12551 misc:1461 imb:160 pmb:839 smb:351 d:- ref:0 ; in:2822 out:2822 type:P dur:82000000 cpbdur:82000000 q:20.13 tex:35111 mv:3536 misc:1513 imb:52 pmb:758 smb:540 d:- ref:0 ; in:2823 out:2823 type:P dur:82000000 cpbdur:82000000 q:21.90 tex:66024 mv:13353 misc:1495 imb:194 pmb:893 smb:263 d:- ref:0 ; in:2824 out:2824 type:P dur:82000000 cpbdur:82000000 q:19.91 tex:33506 mv:2973 misc:1489 imb:33 pmb:739 smb:578 d:- ref:0 ; in:2825 out:2825 type:P dur:82000000 cpbdur:82000000 q:19.01 tex:54521 mv:5064 misc:1535 imb:75 pmb:1034 smb:241 d:- ref:0 ; in:2826 out:2826 type:P dur:82000000 cpbdur:82000000 q:17.01 tex:62976 mv:3745 misc:1519 imb:30 pmb:1055 smb:265 d:- ref:0 ; in:2827 out:2827 type:P dur:82000000 cpbdur:82000000 q:16.70 tex:24520 mv:3069 misc:1619 imb:28 pmb:845 smb:477 d:- ref:0 ; in:2828 out:2828 type:P dur:82000000 cpbdur:82000000 q:15.18 tex:89692 mv:4760 misc:1532 imb:52 pmb:1104 smb:194 d:- ref:0 ; in:2829 out:2829 type:P dur:82000000 cpbdur:82000000 q:15.87 tex:28407 mv:3436 misc:1605 imb:37 pmb:942 smb:371 d:- ref:0 ; in:2830 out:2830 type:P dur:82000000 cpbdur:82000000 q:14.36 tex:60716 mv:4277 misc:1567 imb:34 pmb:1049 smb:267 d:- ref:0 ; in:2831 out:2831 type:P dur:82000000 cpbdur:82000000 q:15.81 tex:24009 mv:2882 misc:1597 imb:40 pmb:736 smb:574 d:- ref:0 ; in:2832 out:2832 type:P dur:82000000 cpbdur:82000000 q:14.41 tex:33554 mv:3372 misc:1610 imb:38 pmb:782 smb:530 d:- ref:0 ; in:2833 out:2833 type:P dur:82000000 cpbdur:82000000 q:15.59 tex:18373 mv:2728 misc:1611 imb:43 pmb:682 smb:625 d:- ref:0 ; in:2834 out:2834 type:P dur:82000000 cpbdur:82000000 q:14.57 tex:12395 mv:2407 misc:1430 imb:36 pmb:447 smb:867 d:- ref:0 ; in:2835 out:2835 type:P dur:82000000 cpbdur:82000000 q:16.05 tex:23530 mv:2920 misc:1614 imb:38 pmb:742 smb:570 d:- ref:0 ; in:2836 out:2836 type:P dur:82000000 cpbdur:82000000 q:15.01 tex:14194 mv:2392 misc:1422 imb:33 pmb:452 smb:865 d:- ref:0 ; in:2837 out:2837 type:P dur:82000000 cpbdur:82000000 q:17.05 tex:22038 mv:3281 misc:1585 imb:32 pmb:819 smb:499 d:- ref:0 ; in:2838 out:2838 type:P dur:82000000 cpbdur:82000000 q:15.53 tex:23235 mv:2949 misc:1584 imb:30 pmb:785 smb:535 d:- ref:0 ; in:2839 out:2839 type:P dur:82000000 cpbdur:82000000 q:16.17 tex:19820 mv:2565 misc:1575 imb:29 pmb:651 smb:670 d:- ref:0 ; in:2840 out:2840 type:P dur:82000000 cpbdur:82000000 q:15.33 tex:18561 mv:3128 misc:1559 imb:53 pmb:612 smb:685 d:- ref:0 ; in:2841 out:2841 type:P dur:82000000 cpbdur:82000000 q:14.00 tex:42694 mv:3294 misc:1572 imb:27 pmb:878 smb:445 d:- ref:0 ; in:2842 out:2842 type:P dur:82000000 cpbdur:82000000 q:15.43 tex:17995 mv:2643 misc:1506 imb:48 pmb:505 smb:797 d:- ref:0 ; in:2843 out:2843 type:P dur:82000000 cpbdur:82000000 q:14.51 tex:9876 mv:1547 misc:1273 imb:23 pmb:309 smb:1018 d:- ref:0 ; in:2844 out:2844 type:P dur:82000000 cpbdur:82000000 q:16.68 tex:20290 mv:3099 misc:1587 imb:25 pmb:757 smb:568 d:- ref:0 ; in:2845 out:2845 type:P dur:82000000 cpbdur:82000000 q:16.09 tex:28431 mv:3287 misc:1602 imb:26 pmb:879 smb:445 d:- ref:0 ; in:2846 out:2846 type:P dur:82000000 cpbdur:82000000 q:14.99 tex:30623 mv:3486 misc:1563 imb:51 pmb:696 smb:603 d:- ref:0 ; in:2847 out:2847 type:P dur:82000000 cpbdur:82000000 q:15.49 tex:18330 mv:3346 misc:1588 imb:53 pmb:596 smb:701 d:- ref:0 ; in:2848 out:2848 type:P dur:82000000 cpbdur:82000000 q:14.35 tex:35209 mv:3144 misc:1599 imb:27 pmb:826 smb:497 d:- ref:0 ; in:2849 out:2849 type:P dur:82000000 cpbdur:82000000 q:15.59 tex:17828 mv:2640 misc:1596 imb:34 pmb:686 smb:630 d:- ref:0 ; in:2850 out:2850 type:P dur:82000000 cpbdur:82000000 q:14.50 tex:10921 mv:1966 misc:1329 imb:39 pmb:356 smb:955 d:- ref:0 ; in:2851 out:2851 type:P dur:82000000 cpbdur:82000000 q:15.91 tex:22193 mv:2606 misc:1553 imb:35 pmb:662 smb:653 d:- ref:0 ; in:2852 out:2852 type:P dur:82000000 cpbdur:82000000 q:16.12 tex:30655 mv:2412 misc:1485 imb:26 pmb:590 smb:734 d:- ref:0 ; in:2853 out:2853 type:P dur:82000000 cpbdur:82000000 q:17.58 tex:22784 mv:3259 misc:1573 imb:21 pmb:747 smb:582 d:- ref:0 ; in:2854 out:2854 type:P dur:82000000 cpbdur:82000000 q:16.34 tex:50542 mv:3498 misc:1568 imb:25 pmb:950 smb:375 d:- ref:0 ; in:2855 out:2855 type:P dur:82000000 cpbdur:82000000 q:16.76 tex:17684 mv:2684 misc:1600 imb:19 pmb:768 smb:563 d:- ref:0 ; in:2856 out:2856 type:P dur:82000000 cpbdur:82000000 q:14.97 tex:36266 mv:3561 misc:1589 imb:21 pmb:851 smb:478 d:- ref:0 ; in:2857 out:2857 type:P dur:82000000 cpbdur:82000000 q:18.97 tex:355581 mv:16968 misc:1419 imb:1192 pmb:158 smb:0 d:- ref:0 ; in:2858 out:2858 type:P dur:82000000 cpbdur:82000000 q:22.97 tex:116171 mv:8212 misc:1313 imb:422 pmb:468 smb:460 d:- ref:0 ; in:2859 out:2859 type:P dur:82000000 cpbdur:82000000 q:24.42 tex:52083 mv:5845 misc:1280 imb:128 pmb:587 smb:635 d:- ref:0 ; in:2860 out:2860 type:P dur:82000000 cpbdur:82000000 q:25.31 tex:121650 mv:8111 misc:1311 imb:356 pmb:525 smb:469 d:- ref:0 ; in:2861 out:2861 type:P dur:82000000 cpbdur:82000000 q:26.18 tex:136015 mv:9118 misc:1299 imb:438 pmb:400 smb:512 d:- ref:0 ; in:2862 out:2862 type:P dur:82000000 cpbdur:82000000 q:26.18 tex:113851 mv:8391 misc:1310 imb:322 pmb:541 smb:487 d:- ref:0 ; in:2863 out:2863 type:P dur:82000000 cpbdur:82000000 q:24.85 tex:63553 mv:5344 misc:1375 imb:146 pmb:652 smb:552 d:- ref:0 ; in:2864 out:2864 type:P dur:82000000 cpbdur:82000000 q:25.54 tex:109512 mv:7784 misc:1320 imb:304 pmb:526 smb:520 d:- ref:0 ; in:2865 out:2865 type:P dur:82000000 cpbdur:82000000 q:26.14 tex:135986 mv:8566 misc:1288 imb:373 pmb:466 smb:511 d:- ref:0 ; in:2866 out:2866 type:P dur:82000000 cpbdur:82000000 q:26.02 tex:107282 mv:6964 misc:1314 imb:259 pmb:544 smb:547 d:- ref:0 ; in:2867 out:2867 type:P dur:82000000 cpbdur:82000000 q:24.42 tex:65395 mv:4707 misc:1442 imb:136 pmb:711 smb:503 d:- ref:0 ; in:2868 out:2868 type:P dur:82000000 cpbdur:82000000 q:25.38 tex:131335 mv:8034 misc:1295 imb:289 pmb:578 smb:483 d:- ref:0 ; in:2869 out:2869 type:P dur:82000000 cpbdur:82000000 q:26.17 tex:138342 mv:9249 misc:1297 imb:320 pmb:535 smb:495 d:- ref:0 ; in:2870 out:2870 type:P dur:82000000 cpbdur:82000000 q:26.10 tex:118570 mv:7751 misc:1287 imb:227 pmb:625 smb:498 d:- ref:0 ; in:2871 out:2871 type:P dur:82000000 cpbdur:82000000 q:24.68 tex:61437 mv:5009 misc:1370 imb:113 pmb:687 smb:550 d:- ref:0 ; in:2872 out:2872 type:P dur:82000000 cpbdur:82000000 q:25.91 tex:128785 mv:8544 misc:1351 imb:357 pmb:582 smb:411 d:- ref:0 ; in:2873 out:2873 type:P dur:82000000 cpbdur:82000000 q:27.00 tex:161415 mv:9727 misc:1346 imb:484 pmb:437 smb:429 d:- ref:0 ; in:2874 out:2874 type:P dur:82000000 cpbdur:82000000 q:27.03 tex:139133 mv:8807 misc:1356 imb:356 pmb:603 smb:391 d:- ref:0 ; in:2875 out:2875 type:P dur:82000000 cpbdur:82000000 q:25.59 tex:61350 mv:4825 misc:1369 imb:133 pmb:631 smb:586 d:- ref:0 ; in:2876 out:2876 type:P dur:82000000 cpbdur:82000000 q:26.72 tex:150502 mv:9422 misc:1364 imb:464 pmb:524 smb:362 d:- ref:0 ; in:2877 out:2877 type:P dur:82000000 cpbdur:82000000 q:27.59 tex:166613 mv:11182 misc:1365 imb:546 pmb:454 smb:350 d:- ref:0 ; in:2878 out:2878 type:P dur:82000000 cpbdur:82000000 q:27.44 tex:146915 mv:9523 misc:1394 imb:482 pmb:551 smb:317 d:- ref:0 ; in:2879 out:2879 type:P dur:82000000 cpbdur:82000000 q:25.90 tex:58266 mv:5203 misc:1363 imb:135 pmb:621 smb:594 d:- ref:0 ; in:2880 out:2880 type:P dur:82000000 cpbdur:82000000 q:26.67 tex:135135 mv:8280 misc:1345 imb:373 pmb:552 smb:425 d:- ref:0 ; in:2881 out:2881 type:P dur:82000000 cpbdur:82000000 q:27.44 tex:172822 mv:10864 misc:1362 imb:465 pmb:502 smb:383 d:- ref:0 ; in:2882 out:2882 type:P dur:82000000 cpbdur:82000000 q:27.29 tex:138755 mv:9185 misc:1348 imb:321 pmb:617 smb:412 d:- ref:0 ; in:2883 out:2883 type:P dur:82000000 cpbdur:82000000 q:25.85 tex:69829 mv:4762 misc:1337 imb:82 pmb:654 smb:614 d:- ref:0 ; in:2884 out:2884 type:P dur:82000000 cpbdur:82000000 q:26.83 tex:147308 mv:8586 misc:1322 imb:390 pmb:554 smb:406 d:- ref:0 ; in:2885 out:2885 type:P dur:82000000 cpbdur:82000000 q:27.67 tex:170320 mv:11397 misc:1323 imb:454 pmb:513 smb:383 d:- ref:0 ; in:2886 out:2886 type:P dur:82000000 cpbdur:82000000 q:27.51 tex:137381 mv:8214 misc:1301 imb:326 pmb:578 smb:446 d:- ref:0 ; in:2887 out:2887 type:P dur:82000000 cpbdur:82000000 q:25.98 tex:81366 mv:5242 misc:1376 imb:127 pmb:702 smb:521 d:- ref:0 ; in:2888 out:2888 type:P dur:82000000 cpbdur:82000000 q:25.56 tex:93204 mv:5846 misc:1374 imb:185 pmb:654 smb:511 d:- ref:0 ; in:2889 out:2889 type:P dur:82000000 cpbdur:82000000 q:25.60 tex:111638 mv:7104 misc:1370 imb:185 pmb:610 smb:555 d:- ref:0 ; in:2890 out:2890 type:P dur:82000000 cpbdur:82000000 q:25.12 tex:113800 mv:6222 misc:1394 imb:175 pmb:704 smb:471 d:- ref:0 ; in:2891 out:2891 type:P dur:82000000 cpbdur:82000000 q:23.67 tex:57387 mv:3758 misc:1375 imb:37 pmb:664 smb:649 d:- ref:0 ; in:2892 out:2892 type:P dur:82000000 cpbdur:82000000 q:24.45 tex:111187 mv:6054 misc:1399 imb:172 pmb:680 smb:498 d:- ref:0 ; in:2893 out:2893 type:P dur:82000000 cpbdur:82000000 q:25.08 tex:121673 mv:7376 misc:1399 imb:220 pmb:612 smb:518 d:- ref:0 ; in:2894 out:2894 type:P dur:82000000 cpbdur:82000000 q:24.97 tex:99140 mv:5983 misc:1365 imb:142 pmb:627 smb:581 d:- ref:0 ; in:2895 out:2895 type:P dur:82000000 cpbdur:82000000 q:23.26 tex:76927 mv:4478 misc:1427 imb:107 pmb:764 smb:479 d:- ref:0 ; in:2896 out:2896 type:P dur:82000000 cpbdur:82000000 q:24.04 tex:90635 mv:5248 misc:1333 imb:104 pmb:628 smb:618 d:- ref:0 ; in:2897 out:2897 type:P dur:82000000 cpbdur:82000000 q:24.93 tex:123104 mv:7555 misc:1381 imb:186 pmb:635 smb:529 d:- ref:0 ; in:2898 out:2898 type:P dur:82000000 cpbdur:82000000 q:24.91 tex:105594 mv:6490 misc:1396 imb:135 pmb:682 smb:533 d:- ref:0 ; in:2899 out:2899 type:P dur:82000000 cpbdur:82000000 q:23.36 tex:74822 mv:4598 misc:1460 imb:113 pmb:758 smb:479 d:- ref:0 ; in:2900 out:2900 type:P dur:82000000 cpbdur:82000000 q:24.24 tex:107363 mv:6003 misc:1346 imb:142 pmb:651 smb:557 d:- ref:0 ; in:2901 out:2901 type:P dur:82000000 cpbdur:82000000 q:25.08 tex:121984 mv:7388 misc:1364 imb:189 pmb:642 smb:519 d:- ref:0 ; in:2902 out:2902 type:P dur:82000000 cpbdur:82000000 q:24.99 tex:106085 mv:5916 misc:1367 imb:125 pmb:688 smb:537 d:- ref:0 ; in:2903 out:2903 type:P dur:82000000 cpbdur:82000000 q:23.76 tex:56685 mv:4337 misc:1338 imb:59 pmb:655 smb:636 d:- ref:0 ; in:2904 out:2904 type:P dur:82000000 cpbdur:82000000 q:24.30 tex:93952 mv:5184 misc:1392 imb:150 pmb:618 smb:582 d:- ref:0 ; in:2905 out:2905 type:P dur:82000000 cpbdur:82000000 q:25.03 tex:119799 mv:7078 misc:1355 imb:196 pmb:578 smb:576 d:- ref:0 ; in:2906 out:2906 type:P dur:82000000 cpbdur:82000000 q:25.15 tex:106538 mv:6290 misc:1388 imb:142 pmb:678 smb:530 d:- ref:0 ; in:2907 out:2907 type:P dur:82000000 cpbdur:82000000 q:24.02 tex:71182 mv:4698 misc:1360 imb:49 pmb:722 smb:579 d:- ref:0 ; in:2908 out:2908 type:P dur:82000000 cpbdur:82000000 q:24.47 tex:102929 mv:5588 misc:1339 imb:127 pmb:664 smb:559 d:- ref:0 ; in:2909 out:2909 type:P dur:82000000 cpbdur:82000000 q:25.13 tex:123992 mv:7356 misc:1364 imb:153 pmb:644 smb:553 d:- ref:0 ; in:2910 out:2910 type:P dur:82000000 cpbdur:82000000 q:25.01 tex:103708 mv:5719 misc:1389 imb:128 pmb:673 smb:549 d:- ref:0 ; in:2911 out:2911 type:P dur:82000000 cpbdur:82000000 q:23.54 tex:48107 mv:4103 misc:1398 imb:68 pmb:613 smb:669 d:- ref:0 ; in:2912 out:2912 type:P dur:82000000 cpbdur:82000000 q:24.20 tex:100558 mv:5533 misc:1341 imb:131 pmb:633 smb:586 d:- ref:0 ; in:2913 out:2913 type:P dur:82000000 cpbdur:82000000 q:24.90 tex:115054 mv:7265 misc:1345 imb:170 pmb:585 smb:595 d:- ref:0 ; in:2914 out:2914 type:P dur:82000000 cpbdur:82000000 q:24.84 tex:100610 mv:5837 misc:1353 imb:133 pmb:631 smb:586 d:- ref:0 ; in:2915 out:2915 type:P dur:82000000 cpbdur:82000000 q:23.57 tex:58474 mv:4187 misc:1347 imb:40 pmb:671 smb:639 d:- ref:0 ; in:2916 out:2916 type:P dur:82000000 cpbdur:82000000 q:24.34 tex:105197 mv:6238 misc:1373 imb:160 pmb:666 smb:524 d:- ref:0 ; in:2917 out:2917 type:P dur:82000000 cpbdur:82000000 q:25.15 tex:127923 mv:7725 misc:1368 imb:198 pmb:645 smb:507 d:- ref:0 ; in:2918 out:2918 type:P dur:82000000 cpbdur:82000000 q:25.10 tex:104896 mv:6259 misc:1381 imb:132 pmb:681 smb:537 d:- ref:0 ; in:2919 out:2919 type:P dur:82000000 cpbdur:82000000 q:23.73 tex:54648 mv:4238 misc:1378 imb:50 pmb:688 smb:612 d:- ref:0 ; in:2920 out:2920 type:P dur:82000000 cpbdur:82000000 q:24.26 tex:96677 mv:5548 misc:1327 imb:102 pmb:662 smb:586 d:- ref:0 ; in:2921 out:2921 type:P dur:82000000 cpbdur:82000000 q:25.11 tex:129416 mv:7754 misc:1398 imb:166 pmb:684 smb:500 d:- ref:0 ; in:2922 out:2922 type:P dur:82000000 cpbdur:82000000 q:25.02 tex:108730 mv:6172 misc:1378 imb:116 pmb:698 smb:536 d:- ref:0 ; in:2923 out:2923 type:P dur:82000000 cpbdur:82000000 q:23.48 tex:76716 mv:4182 misc:1422 imb:63 pmb:766 smb:521 d:- ref:0 ; in:2924 out:2924 type:P dur:82000000 cpbdur:82000000 q:24.39 tex:105742 mv:5805 misc:1389 imb:141 pmb:667 smb:542 d:- ref:0 ; in:2925 out:2925 type:P dur:82000000 cpbdur:82000000 q:25.10 tex:123322 mv:7421 misc:1353 imb:156 pmb:645 smb:549 d:- ref:0 ; in:2926 out:2926 type:P dur:82000000 cpbdur:82000000 q:25.06 tex:107156 mv:6107 misc:1385 imb:135 pmb:695 smb:520 d:- ref:0 ; in:2927 out:2927 type:P dur:82000000 cpbdur:82000000 q:23.75 tex:59289 mv:4634 misc:1373 imb:54 pmb:684 smb:612 d:- ref:0 ; in:2928 out:2928 type:P dur:82000000 cpbdur:82000000 q:24.30 tex:102390 mv:5753 misc:1385 imb:138 pmb:677 smb:535 d:- ref:0 ; in:2929 out:2929 type:P dur:82000000 cpbdur:82000000 q:25.10 tex:128979 mv:8006 misc:1391 imb:200 pmb:690 smb:460 d:- ref:0 ; in:2930 out:2930 type:P dur:82000000 cpbdur:82000000 q:25.11 tex:109287 mv:6499 misc:1374 imb:140 pmb:689 smb:521 d:- ref:0 ; in:2931 out:2931 type:P dur:82000000 cpbdur:82000000 q:23.76 tex:56189 mv:4153 misc:1378 imb:42 pmb:705 smb:603 d:- ref:0 ; in:2932 out:2932 type:P dur:82000000 cpbdur:82000000 q:24.35 tex:101915 mv:5932 misc:1377 imb:106 pmb:696 smb:548 d:- ref:0 ; in:2933 out:2933 type:P dur:82000000 cpbdur:82000000 q:25.02 tex:121938 mv:7462 misc:1376 imb:152 pmb:650 smb:548 d:- ref:0 ; in:2934 out:2934 type:P dur:82000000 cpbdur:82000000 q:24.82 tex:100173 mv:5398 misc:1381 imb:104 pmb:652 smb:594 d:- ref:0 ; in:2935 out:2935 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:79910 mv:4845 misc:1429 imb:88 pmb:785 smb:477 d:- ref:0 ; in:2936 out:2936 type:P dur:82000000 cpbdur:82000000 q:24.26 tex:101157 mv:5950 misc:1365 imb:136 pmb:674 smb:540 d:- ref:0 ; in:2937 out:2937 type:P dur:82000000 cpbdur:82000000 q:25.01 tex:116820 mv:7577 misc:1371 imb:168 pmb:621 smb:561 d:- ref:0 ; in:2938 out:2938 type:P dur:82000000 cpbdur:82000000 q:24.96 tex:109028 mv:6538 misc:1378 imb:121 pmb:730 smb:499 d:- ref:0 ; in:2939 out:2939 type:P dur:82000000 cpbdur:82000000 q:23.63 tex:54645 mv:3972 misc:1391 imb:31 pmb:706 smb:613 d:- ref:0 ; in:2940 out:2940 type:P dur:82000000 cpbdur:82000000 q:24.31 tex:104254 mv:6277 misc:1381 imb:144 pmb:695 smb:511 d:- ref:0 ; in:2941 out:2941 type:P dur:82000000 cpbdur:82000000 q:25.17 tex:130816 mv:8738 misc:1414 imb:187 pmb:712 smb:451 d:- ref:0 ; in:2942 out:2942 type:P dur:82000000 cpbdur:82000000 q:25.16 tex:111605 mv:6559 misc:1404 imb:126 pmb:745 smb:479 d:- ref:0 ; in:2943 out:2943 type:P dur:82000000 cpbdur:82000000 q:24.04 tex:64121 mv:5058 misc:1445 imb:100 pmb:716 smb:534 d:- ref:0 ; in:2944 out:2944 type:P dur:82000000 cpbdur:82000000 q:25.95 tex:147999 mv:8503 misc:1418 imb:281 pmb:701 smb:368 d:- ref:0 ; in:2945 out:2945 type:P dur:82000000 cpbdur:82000000 q:27.14 tex:179495 mv:10843 misc:1406 imb:414 pmb:589 smb:347 d:- ref:0 ; in:2946 out:2946 type:P dur:82000000 cpbdur:82000000 q:27.09 tex:142715 mv:8648 misc:1405 imb:285 pmb:700 smb:365 d:- ref:0 ; in:2947 out:2947 type:P dur:82000000 cpbdur:82000000 q:25.80 tex:75513 mv:5942 misc:1425 imb:165 pmb:742 smb:443 d:- ref:0 ; in:2948 out:2948 type:P dur:82000000 cpbdur:82000000 q:26.80 tex:148087 mv:9329 misc:1384 imb:372 pmb:659 smb:319 d:- ref:0 ; in:2949 out:2949 type:P dur:82000000 cpbdur:82000000 q:27.62 tex:171001 mv:11302 misc:1393 imb:435 pmb:580 smb:335 d:- ref:0 ; in:2950 out:2950 type:P dur:82000000 cpbdur:82000000 q:27.50 tex:154335 mv:9177 misc:1400 imb:357 pmb:667 smb:326 d:- ref:0 ; in:2951 out:2951 type:P dur:82000000 cpbdur:82000000 q:26.10 tex:72330 mv:6067 misc:1443 imb:147 pmb:741 smb:462 d:- ref:0 ; in:2952 out:2952 type:P dur:82000000 cpbdur:82000000 q:26.76 tex:137007 mv:8376 misc:1401 imb:301 pmb:694 smb:355 d:- ref:0 ; in:2953 out:2953 type:P dur:82000000 cpbdur:82000000 q:27.65 tex:174830 mv:11087 misc:1403 imb:380 pmb:609 smb:361 d:- ref:0 ; in:2954 out:2954 type:P dur:82000000 cpbdur:82000000 q:27.62 tex:145354 mv:9290 misc:1396 imb:291 pmb:718 smb:341 d:- ref:0 ; in:2955 out:2955 type:P dur:82000000 cpbdur:82000000 q:26.46 tex:105851 mv:7163 misc:1426 imb:210 pmb:813 smb:327 d:- ref:0 ; in:2956 out:2956 type:P dur:82000000 cpbdur:82000000 q:27.44 tex:178980 mv:10291 misc:1409 imb:478 pmb:653 smb:219 d:- ref:0 ; in:2957 out:2957 type:P dur:82000000 cpbdur:82000000 q:28.29 tex:202901 mv:12064 misc:1395 imb:576 pmb:558 smb:216 d:- ref:0 ; in:2958 out:2958 type:P dur:82000000 cpbdur:82000000 q:28.08 tex:155280 mv:10429 misc:1411 imb:460 pmb:683 smb:207 d:- ref:0 ; in:2959 out:2959 type:P dur:82000000 cpbdur:82000000 q:26.55 tex:68199 mv:6461 misc:1428 imb:119 pmb:801 smb:430 d:- ref:0 ; in:2960 out:2960 type:P dur:82000000 cpbdur:82000000 q:27.46 tex:177187 mv:9853 misc:1408 imb:433 pmb:651 smb:266 d:- ref:0 ; in:2961 out:2961 type:P dur:82000000 cpbdur:82000000 q:28.26 tex:200320 mv:11205 misc:1387 imb:518 pmb:551 smb:281 d:- ref:0 ; in:2962 out:2962 type:P dur:82000000 cpbdur:82000000 q:28.01 tex:149704 mv:9201 misc:1399 imb:397 pmb:653 smb:300 d:- ref:0 ; in:2963 out:2963 type:P dur:82000000 cpbdur:82000000 q:26.56 tex:71023 mv:5412 misc:1405 imb:150 pmb:732 smb:468 d:- ref:0 ; in:2964 out:2964 type:P dur:82000000 cpbdur:82000000 q:27.26 tex:163700 mv:9151 misc:1373 imb:402 pmb:605 smb:343 d:- ref:0 ; in:2965 out:2965 type:P dur:82000000 cpbdur:82000000 q:27.85 tex:172829 mv:10796 misc:1367 imb:532 pmb:462 smb:356 d:- ref:0 ; in:2966 out:2966 type:P dur:82000000 cpbdur:82000000 q:27.61 tex:133840 mv:9351 misc:1361 imb:428 pmb:537 smb:385 d:- ref:0 ; in:2967 out:2967 type:P dur:82000000 cpbdur:82000000 q:26.23 tex:83613 mv:6526 misc:1373 imb:144 pmb:724 smb:482 d:- ref:0 ; in:2968 out:2968 type:P dur:82000000 cpbdur:82000000 q:26.45 tex:132162 mv:8274 misc:1364 imb:333 pmb:612 smb:405 d:- ref:0 ; in:2969 out:2969 type:P dur:82000000 cpbdur:82000000 q:26.98 tex:146264 mv:9476 misc:1372 imb:511 pmb:410 smb:429 d:- ref:0 ; in:2970 out:2970 type:P dur:82000000 cpbdur:82000000 q:26.61 tex:108249 mv:8859 misc:1364 imb:447 pmb:467 smb:436 d:- ref:0 ; in:2971 out:2971 type:P dur:82000000 cpbdur:82000000 q:25.39 tex:80032 mv:7186 misc:1422 imb:220 pmb:650 smb:480 d:- ref:0 ; in:2972 out:2972 type:P dur:82000000 cpbdur:82000000 q:25.78 tex:104969 mv:9030 misc:1361 imb:448 pmb:508 smb:394 d:- ref:0 ; in:2973 out:2973 type:P dur:82000000 cpbdur:82000000 q:26.40 tex:137540 mv:10001 misc:1339 imb:506 pmb:409 smb:435 d:- ref:0 ; in:2974 out:2974 type:P dur:82000000 cpbdur:82000000 q:26.26 tex:108626 mv:8174 misc:1344 imb:365 pmb:514 smb:471 d:- ref:0 ; in:2975 out:2975 type:P dur:82000000 cpbdur:82000000 q:25.07 tex:72867 mv:6469 misc:1376 imb:163 pmb:703 smb:484 d:- ref:0 ; in:2976 out:2976 type:P dur:82000000 cpbdur:82000000 q:26.09 tex:132377 mv:9089 misc:1318 imb:400 pmb:519 smb:431 d:- ref:0 ; in:2977 out:2977 type:P dur:82000000 cpbdur:82000000 q:26.75 tex:144101 mv:9576 misc:1323 imb:429 pmb:416 smb:505 d:- ref:0 ; in:2978 out:2978 type:P dur:82000000 cpbdur:82000000 q:26.75 tex:126428 mv:8295 misc:1333 imb:285 pmb:607 smb:458 d:- ref:0 ; in:2979 out:2979 type:P dur:82000000 cpbdur:82000000 q:25.21 tex:80711 mv:5040 misc:1433 imb:116 pmb:782 smb:452 d:- ref:0 ; in:2980 out:2980 type:P dur:82000000 cpbdur:82000000 q:26.25 tex:136957 mv:8241 misc:1386 imb:340 pmb:629 smb:381 d:- ref:0 ; in:2981 out:2981 type:P dur:82000000 cpbdur:82000000 q:27.27 tex:176514 mv:9921 misc:1381 imb:418 pmb:549 smb:383 d:- ref:0 ; in:2982 out:2982 type:P dur:82000000 cpbdur:82000000 q:27.39 tex:151003 mv:7342 misc:1391 imb:232 pmb:688 smb:430 d:- ref:0 ; in:2983 out:2983 type:P dur:82000000 cpbdur:82000000 q:25.85 tex:62115 mv:4845 misc:1456 imb:61 pmb:785 smb:504 d:- ref:0 ; in:2984 out:2984 type:P dur:82000000 cpbdur:82000000 q:27.18 tex:170982 mv:10063 misc:1475 imb:450 pmb:707 smb:193 d:- ref:0 ; in:2985 out:2985 type:P dur:82000000 cpbdur:82000000 q:28.22 tex:209926 mv:13807 misc:1435 imb:654 pmb:539 smb:157 d:- ref:0 ; in:2986 out:2986 type:P dur:82000000 cpbdur:82000000 q:28.42 tex:185251 mv:10458 misc:1427 imb:455 pmb:676 smb:219 d:- ref:0 ; in:2987 out:2987 type:P dur:82000000 cpbdur:82000000 q:26.75 tex:68532 mv:4656 misc:1484 imb:54 pmb:814 smb:482 d:- ref:0 ; in:2988 out:2988 type:P dur:82000000 cpbdur:82000000 q:27.93 tex:193128 mv:11305 misc:1447 imb:532 pmb:693 smb:125 d:- ref:0 ; in:2989 out:2989 type:P dur:82000000 cpbdur:82000000 q:28.72 tex:203441 mv:13705 misc:1446 imb:597 pmb:629 smb:124 d:- ref:0 ; in:2990 out:2990 type:P dur:82000000 cpbdur:82000000 q:28.84 tex:180394 mv:11134 misc:1448 imb:459 pmb:740 smb:151 d:- ref:0 ; in:2991 out:2991 type:P dur:82000000 cpbdur:82000000 q:27.13 tex:95092 mv:5146 misc:1458 imb:51 pmb:926 smb:373 d:- ref:0 ; in:2992 out:2992 type:P dur:82000000 cpbdur:82000000 q:27.86 tex:170938 mv:9939 misc:1443 imb:368 pmb:761 smb:221 d:- ref:0 ; in:2993 out:2993 type:P dur:82000000 cpbdur:82000000 q:28.66 tex:201806 mv:13326 misc:1436 imb:607 pmb:560 smb:183 d:- ref:0 ; in:2994 out:2994 type:P dur:82000000 cpbdur:82000000 q:28.73 tex:178122 mv:10694 misc:1448 imb:382 pmb:762 smb:206 d:- ref:0 ; in:2995 out:2995 type:P dur:82000000 cpbdur:82000000 q:27.25 tex:112446 mv:6323 misc:1447 imb:90 pmb:955 smb:305 d:- ref:0 ; in:2996 out:2996 type:P dur:82000000 cpbdur:82000000 q:28.04 tex:181804 mv:10442 misc:1458 imb:427 pmb:730 smb:193 d:- ref:0 ; in:2997 out:2997 type:P dur:82000000 cpbdur:82000000 q:28.75 tex:205599 mv:13926 misc:1451 imb:567 pmb:636 smb:147 d:- ref:0 ; in:2998 out:2998 type:P dur:82000000 cpbdur:82000000 q:28.64 tex:165695 mv:10319 misc:1458 imb:377 pmb:775 smb:198 d:- ref:0 ; in:2999 out:2999 type:P dur:82000000 cpbdur:82000000 q:27.09 tex:103556 mv:6231 misc:1477 imb:100 pmb:987 smb:263 d:- ref:0 ; in:3000 out:3000 type:I dur:82000000 cpbdur:82000000 q:24.39 tex:400973 mv:14768 misc:371 imb:1350 pmb:0 smb:0 d:- ref:; in:3001 out:3001 type:P dur:82000000 cpbdur:82000000 q:29.20 tex:188961 mv:13683 misc:1452 imb:721 pmb:523 smb:106 d:- ref:0 ; in:3002 out:3002 type:P dur:82000000 cpbdur:82000000 q:29.02 tex:176489 mv:12365 misc:1434 imb:591 pmb:635 smb:124 d:- ref:0 ; in:3003 out:3003 type:P dur:82000000 cpbdur:82000000 q:27.40 tex:92372 mv:5693 misc:1471 imb:92 pmb:885 smb:373 d:- ref:0 ; in:3004 out:3004 type:P dur:82000000 cpbdur:82000000 q:27.68 tex:149781 mv:9582 misc:1429 imb:423 pmb:688 smb:239 d:- ref:0 ; in:3005 out:3005 type:P dur:82000000 cpbdur:82000000 q:28.14 tex:184058 mv:12628 misc:1434 imb:560 pmb:568 smb:222 d:- ref:0 ; in:3006 out:3006 type:P dur:82000000 cpbdur:82000000 q:28.00 tex:152015 mv:10692 misc:1445 imb:420 pmb:674 smb:256 d:- ref:0 ; in:3007 out:3007 type:P dur:82000000 cpbdur:82000000 q:26.30 tex:79140 mv:5240 misc:1492 imb:102 pmb:842 smb:406 d:- ref:0 ; in:3008 out:3008 type:P dur:82000000 cpbdur:82000000 q:26.85 tex:136998 mv:8619 misc:1455 imb:299 pmb:773 smb:278 d:- ref:0 ; in:3009 out:3009 type:P dur:82000000 cpbdur:82000000 q:27.38 tex:167394 mv:11375 misc:1463 imb:420 pmb:657 smb:273 d:- ref:0 ; in:3010 out:3010 type:P dur:82000000 cpbdur:82000000 q:27.19 tex:136714 mv:9215 misc:1471 imb:307 pmb:719 smb:324 d:- ref:0 ; in:3011 out:3011 type:P dur:82000000 cpbdur:82000000 q:25.89 tex:80571 mv:6598 misc:1511 imb:101 pmb:854 smb:395 d:- ref:0 ; in:3012 out:3012 type:P dur:82000000 cpbdur:82000000 q:26.68 tex:140533 mv:9550 misc:1461 imb:386 pmb:680 smb:284 d:- ref:0 ; in:3013 out:3013 type:P dur:82000000 cpbdur:82000000 q:27.33 tex:170237 mv:11904 misc:1435 imb:462 pmb:616 smb:272 d:- ref:0 ; in:3014 out:3014 type:P dur:82000000 cpbdur:82000000 q:27.18 tex:141515 mv:8932 misc:1465 imb:325 pmb:688 smb:337 d:- ref:0 ; in:3015 out:3015 type:P dur:82000000 cpbdur:82000000 q:25.61 tex:58791 mv:5004 misc:1469 imb:99 pmb:784 smb:467 d:- ref:0 ; in:3016 out:3016 type:P dur:82000000 cpbdur:82000000 q:27.37 tex:205941 mv:12895 misc:1436 imb:668 pmb:613 smb:69 d:- ref:0 ; in:3017 out:3017 type:P dur:82000000 cpbdur:82000000 q:28.28 tex:216004 mv:14259 misc:1449 imb:741 pmb:513 smb:96 d:- ref:0 ; in:3018 out:3018 type:P dur:82000000 cpbdur:82000000 q:28.53 tex:176058 mv:12527 misc:1447 imb:625 pmb:623 smb:102 d:- ref:0 ; in:3019 out:3019 type:P dur:82000000 cpbdur:82000000 q:26.88 tex:87180 mv:5412 misc:1472 imb:79 pmb:872 smb:399 d:- ref:0 ; in:3020 out:3020 type:P dur:82000000 cpbdur:82000000 q:27.87 tex:194884 mv:13206 misc:1438 imb:734 pmb:560 smb:56 d:- ref:0 ; in:3021 out:3021 type:P dur:82000000 cpbdur:82000000 q:28.14 tex:181773 mv:14768 misc:1427 imb:930 pmb:344 smb:76 d:- ref:0 ; in:3022 out:3022 type:P dur:82000000 cpbdur:82000000 q:27.95 tex:144078 mv:12336 misc:1418 imb:826 pmb:444 smb:80 d:- ref:0 ; in:3023 out:3023 type:P dur:82000000 cpbdur:82000000 q:26.19 tex:63301 mv:3937 misc:1290 imb:97 pmb:607 smb:646 d:- ref:0 ; in:3024 out:3024 type:P dur:82000000 cpbdur:82000000 q:26.82 tex:143545 mv:11564 misc:1419 imb:788 pmb:426 smb:136 d:- ref:0 ; in:3025 out:3025 type:P dur:82000000 cpbdur:82000000 q:27.10 tex:142442 mv:13687 misc:1415 imb:926 pmb:287 smb:137 d:- ref:0 ; in:3026 out:3026 type:P dur:82000000 cpbdur:82000000 q:27.00 tex:123997 mv:11827 misc:1384 imb:919 pmb:305 smb:126 d:- ref:0 ; in:3027 out:3027 type:P dur:82000000 cpbdur:82000000 q:25.63 tex:54734 mv:4609 misc:1169 imb:197 pmb:423 smb:730 d:- ref:0 ; in:3028 out:3028 type:P dur:82000000 cpbdur:82000000 q:26.22 tex:123901 mv:12182 misc:1421 imb:1017 pmb:332 smb:1 d:- ref:0 ; in:3029 out:3029 type:P dur:82000000 cpbdur:82000000 q:26.75 tex:132026 mv:13817 misc:1421 imb:1188 pmb:143 smb:19 d:- ref:0 ; in:3030 out:3030 type:P dur:82000000 cpbdur:82000000 q:26.46 tex:103653 mv:13238 misc:1421 imb:1178 pmb:146 smb:26 d:- ref:0 ; in:3031 out:3031 type:P dur:82000000 cpbdur:82000000 q:25.00 tex:40484 mv:7332 misc:1456 imb:595 pmb:352 smb:403 d:- ref:0 ; in:3032 out:3032 type:P dur:82000000 cpbdur:82000000 q:25.55 tex:90294 mv:12032 misc:1426 imb:1159 pmb:142 smb:49 d:- ref:0 ; in:3033 out:3033 type:P dur:82000000 cpbdur:82000000 q:25.88 tex:88207 mv:13186 misc:1423 imb:1144 pmb:168 smb:38 d:- ref:0 ; in:3034 out:3034 type:P dur:82000000 cpbdur:82000000 q:25.64 tex:74357 mv:11599 misc:1420 imb:1149 pmb:181 smb:20 d:- ref:0 ; in:3035 out:3035 type:P dur:82000000 cpbdur:82000000 q:23.70 tex:27620 mv:2896 misc:1100 imb:134 pmb:308 smb:908 d:- ref:0 ; in:3036 out:3036 type:P dur:82000000 cpbdur:82000000 q:24.43 tex:83335 mv:10525 misc:1380 imb:959 pmb:197 smb:194 d:- ref:0 ; in:3037 out:3037 type:P dur:82000000 cpbdur:82000000 q:24.56 tex:72090 mv:12811 misc:1435 imb:1143 pmb:139 smb:68 d:- ref:0 ; in:3038 out:3038 type:P dur:82000000 cpbdur:82000000 q:24.40 tex:63557 mv:10505 misc:1410 imb:1053 pmb:119 smb:178 d:- ref:0 ; in:3039 out:3039 type:P dur:82000000 cpbdur:82000000 q:23.42 tex:40792 mv:6970 misc:1438 imb:561 pmb:398 smb:391 d:- ref:0 ; in:3040 out:3040 type:P dur:82000000 cpbdur:82000000 q:24.16 tex:78557 mv:12376 misc:1419 imb:1228 pmb:120 smb:2 d:- ref:0 ; in:3041 out:3041 type:P dur:82000000 cpbdur:82000000 q:24.96 tex:111764 mv:14657 misc:1419 imb:1193 pmb:157 smb:0 d:- ref:0 ; in:3042 out:3042 type:P dur:82000000 cpbdur:82000000 q:26.08 tex:135795 mv:13206 misc:1415 imb:1090 pmb:256 smb:4 d:- ref:0 ; in:3043 out:3043 type:P dur:82000000 cpbdur:82000000 q:25.20 tex:78599 mv:5923 misc:1334 imb:163 pmb:581 smb:606 d:- ref:0 ; in:3044 out:3044 type:P dur:82000000 cpbdur:82000000 q:26.41 tex:143591 mv:12420 misc:1429 imb:1011 pmb:308 smb:31 d:- ref:0 ; in:3045 out:3045 type:P dur:82000000 cpbdur:82000000 q:27.20 tex:156677 mv:12966 misc:1429 imb:1012 pmb:282 smb:56 d:- ref:0 ; in:3046 out:3046 type:P dur:82000000 cpbdur:82000000 q:27.26 tex:137219 mv:11881 misc:1436 imb:860 pmb:425 smb:65 d:- ref:0 ; in:3047 out:3047 type:P dur:82000000 cpbdur:82000000 q:25.62 tex:52390 mv:4824 misc:1290 imb:48 pmb:636 smb:666 d:- ref:0 ; in:3048 out:3048 type:P dur:82000000 cpbdur:82000000 q:24.70 tex:72438 mv:5771 misc:1303 imb:126 pmb:661 smb:563 d:- ref:0 ; in:3049 out:3049 type:P dur:82000000 cpbdur:82000000 q:24.22 tex:77082 mv:5643 misc:1323 imb:180 pmb:631 smb:539 d:- ref:0 ; in:3050 out:3050 type:P dur:82000000 cpbdur:82000000 q:23.85 tex:69349 mv:6641 misc:1402 imb:271 pmb:685 smb:394 d:- ref:0 ; in:3051 out:3051 type:P dur:82000000 cpbdur:82000000 q:24.01 tex:92610 mv:10906 misc:1420 imb:670 pmb:670 smb:10 d:- ref:0 ; in:3052 out:3052 type:P dur:82000000 cpbdur:82000000 q:23.43 tex:78785 mv:8463 misc:1456 imb:383 pmb:761 smb:206 d:- ref:0 ; in:3053 out:3053 type:P dur:82000000 cpbdur:82000000 q:22.79 tex:69639 mv:6357 misc:1420 imb:212 pmb:735 smb:403 d:- ref:0 ; in:3054 out:3054 type:P dur:82000000 cpbdur:82000000 q:21.55 tex:66464 mv:4793 misc:1455 imb:139 pmb:723 smb:488 d:- ref:0 ; in:3055 out:3055 type:P dur:82000000 cpbdur:82000000 q:21.27 tex:93649 mv:5067 misc:1452 imb:119 pmb:761 smb:470 d:- ref:0 ; in:3056 out:3056 type:P dur:82000000 cpbdur:82000000 q:21.57 tex:65472 mv:4429 misc:1323 imb:34 pmb:689 smb:627 d:- ref:0 ; in:3057 out:3057 type:P dur:82000000 cpbdur:82000000 q:20.98 tex:52263 mv:3337 misc:1392 imb:53 pmb:665 smb:632 d:- ref:0 ; in:3058 out:3058 type:P dur:82000000 cpbdur:82000000 q:20.60 tex:55132 mv:3478 misc:1350 imb:47 pmb:642 smb:661 d:- ref:0 ; in:3059 out:3059 type:P dur:82000000 cpbdur:82000000 q:21.24 tex:82756 mv:4760 misc:1340 imb:43 pmb:714 smb:593 d:- ref:0 ; in:3060 out:3060 type:P dur:82000000 cpbdur:82000000 q:21.36 tex:68961 mv:4370 misc:1309 imb:38 pmb:690 smb:622 d:- ref:0 ; in:3061 out:3061 type:P dur:82000000 cpbdur:82000000 q:20.76 tex:53748 mv:3311 misc:1389 imb:50 pmb:663 smb:637 d:- ref:0 ; in:3062 out:3062 type:P dur:82000000 cpbdur:82000000 q:20.58 tex:63051 mv:4022 misc:1335 imb:44 pmb:670 smb:636 d:- ref:0 ; in:3063 out:3063 type:P dur:82000000 cpbdur:82000000 q:20.77 tex:72776 mv:4257 misc:1311 imb:23 pmb:681 smb:646 d:- ref:0 ; in:3064 out:3064 type:P dur:82000000 cpbdur:82000000 q:21.32 tex:71386 mv:5046 misc:1384 imb:55 pmb:730 smb:565 d:- ref:0 ; in:3065 out:3065 type:P dur:82000000 cpbdur:82000000 q:20.53 tex:43579 mv:3003 misc:1338 imb:45 pmb:603 smb:702 d:- ref:0 ; in:3066 out:3066 type:P dur:82000000 cpbdur:82000000 q:21.19 tex:79207 mv:5250 misc:1423 imb:106 pmb:744 smb:500 d:- ref:0 ; in:3067 out:3067 type:P dur:82000000 cpbdur:82000000 q:23.17 tex:66270 mv:5712 misc:1474 imb:304 pmb:566 smb:480 d:- ref:0 ; in:3068 out:3068 type:P dur:82000000 cpbdur:82000000 q:22.65 tex:66077 mv:6258 misc:1449 imb:207 pmb:702 smb:441 d:- ref:0 ; in:3069 out:3069 type:P dur:82000000 cpbdur:82000000 q:22.15 tex:71383 mv:6581 misc:1476 imb:301 pmb:793 smb:256 d:- ref:0 ; in:3070 out:3070 type:P dur:82000000 cpbdur:82000000 q:22.06 tex:74961 mv:7916 misc:1459 imb:498 pmb:746 smb:106 d:- ref:0 ; in:3071 out:3071 type:P dur:82000000 cpbdur:82000000 q:22.50 tex:99788 mv:8990 misc:1470 imb:377 pmb:788 smb:185 d:- ref:0 ; in:3072 out:3072 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:81447 mv:8047 misc:1426 imb:276 pmb:733 smb:341 d:- ref:0 ; in:3073 out:3073 type:P dur:82000000 cpbdur:82000000 q:24.14 tex:87784 mv:8580 misc:1484 imb:455 pmb:682 smb:213 d:- ref:0 ; in:3074 out:3074 type:P dur:82000000 cpbdur:82000000 q:24.04 tex:77321 mv:5559 misc:1328 imb:141 pmb:617 smb:592 d:- ref:0 ; in:3075 out:3075 type:P dur:82000000 cpbdur:82000000 q:23.47 tex:78104 mv:6250 misc:1342 imb:138 pmb:694 smb:518 d:- ref:0 ; in:3076 out:3076 type:P dur:82000000 cpbdur:82000000 q:23.84 tex:77440 mv:5996 misc:1356 imb:134 pmb:646 smb:570 d:- ref:0 ; in:3077 out:3077 type:P dur:82000000 cpbdur:82000000 q:24.66 tex:88254 mv:6234 misc:1320 imb:164 pmb:586 smb:600 d:- ref:0 ; in:3078 out:3078 type:P dur:82000000 cpbdur:82000000 q:24.74 tex:75146 mv:5241 misc:1357 imb:156 pmb:541 smb:653 d:- ref:0 ; in:3079 out:3079 type:P dur:82000000 cpbdur:82000000 q:24.39 tex:77042 mv:7802 misc:1404 imb:299 pmb:714 smb:337 d:- ref:0 ; in:3080 out:3080 type:P dur:82000000 cpbdur:82000000 q:23.44 tex:69760 mv:6856 misc:1472 imb:277 pmb:762 smb:311 d:- ref:0 ; in:3081 out:3081 type:P dur:82000000 cpbdur:82000000 q:22.71 tex:56927 mv:5387 misc:1478 imb:176 pmb:735 smb:439 d:- ref:0 ; in:3082 out:3082 type:P dur:82000000 cpbdur:82000000 q:21.30 tex:76801 mv:5536 misc:1495 imb:211 pmb:838 smb:301 d:- ref:0 ; in:3083 out:3083 type:P dur:82000000 cpbdur:82000000 q:21.76 tex:83030 mv:4840 misc:1370 imb:32 pmb:746 smb:572 d:- ref:0 ; in:3084 out:3084 type:P dur:82000000 cpbdur:82000000 q:21.73 tex:71702 mv:4886 misc:1316 imb:31 pmb:692 smb:627 d:- ref:0 ; in:3085 out:3085 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:67190 mv:4699 misc:1319 imb:25 pmb:679 smb:646 d:- ref:0 ; in:3086 out:3086 type:P dur:82000000 cpbdur:82000000 q:21.01 tex:57848 mv:3863 misc:1409 imb:57 pmb:705 smb:588 d:- ref:0 ; in:3087 out:3087 type:P dur:82000000 cpbdur:82000000 q:21.09 tex:74693 mv:4150 misc:1317 imb:29 pmb:664 smb:657 d:- ref:0 ; in:3088 out:3088 type:P dur:82000000 cpbdur:82000000 q:21.69 tex:71431 mv:5373 misc:1380 imb:68 pmb:695 smb:587 d:- ref:0 ; in:3089 out:3089 type:P dur:82000000 cpbdur:82000000 q:21.75 tex:66943 mv:4796 misc:1333 imb:51 pmb:658 smb:641 d:- ref:0 ; in:3090 out:3090 type:P dur:82000000 cpbdur:82000000 q:21.31 tex:67004 mv:4891 misc:1497 imb:131 pmb:747 smb:472 d:- ref:0 ; in:3091 out:3091 type:P dur:82000000 cpbdur:82000000 q:21.32 tex:76949 mv:4762 misc:1409 imb:74 pmb:738 smb:538 d:- ref:0 ; in:3092 out:3092 type:P dur:82000000 cpbdur:82000000 q:21.45 tex:72088 mv:4605 misc:1395 imb:40 pmb:711 smb:599 d:- ref:0 ; in:3093 out:3093 type:P dur:82000000 cpbdur:82000000 q:21.30 tex:69770 mv:4742 misc:1328 imb:49 pmb:724 smb:577 d:- ref:0 ; in:3094 out:3094 type:P dur:82000000 cpbdur:82000000 q:21.10 tex:59598 mv:4141 misc:1365 imb:33 pmb:693 smb:624 d:- ref:0 ; in:3095 out:3095 type:P dur:82000000 cpbdur:82000000 q:21.37 tex:79658 mv:4895 misc:1383 imb:45 pmb:729 smb:576 d:- ref:0 ; in:3096 out:3096 type:P dur:82000000 cpbdur:82000000 q:21.37 tex:72073 mv:4680 misc:1335 imb:35 pmb:710 smb:605 d:- ref:0 ; in:3097 out:3097 type:P dur:82000000 cpbdur:82000000 q:21.88 tex:70612 mv:5110 misc:1358 imb:41 pmb:728 smb:581 d:- ref:0 ; in:3098 out:3098 type:P dur:82000000 cpbdur:82000000 q:21.89 tex:70713 mv:5688 misc:1407 imb:89 pmb:738 smb:523 d:- ref:0 ; in:3099 out:3099 type:P dur:82000000 cpbdur:82000000 q:21.29 tex:70502 mv:4884 misc:1446 imb:89 pmb:748 smb:513 d:- ref:0 ; in:3100 out:3100 type:P dur:82000000 cpbdur:82000000 q:21.77 tex:73877 mv:5481 misc:1418 imb:49 pmb:765 smb:536 d:- ref:0 ; in:3101 out:3101 type:P dur:82000000 cpbdur:82000000 q:21.28 tex:69491 mv:4553 misc:1420 imb:77 pmb:751 smb:522 d:- ref:0 ; in:3102 out:3102 type:P dur:82000000 cpbdur:82000000 q:21.95 tex:77093 mv:6217 misc:1354 imb:78 pmb:757 smb:515 d:- ref:0 ; in:3103 out:3103 type:P dur:82000000 cpbdur:82000000 q:25.14 tex:115710 mv:14042 misc:1416 imb:1268 pmb:82 smb:0 d:- ref:0 ; in:3104 out:3104 type:P dur:82000000 cpbdur:82000000 q:23.31 tex:21050 mv:2934 misc:1024 imb:12 pmb:448 smb:890 d:- ref:0 ; in:3105 out:3105 type:P dur:82000000 cpbdur:82000000 q:21.49 tex:37970 mv:3772 misc:1370 imb:57 pmb:714 smb:579 d:- ref:0 ; in:3106 out:3106 type:P dur:82000000 cpbdur:82000000 q:19.83 tex:22636 mv:1993 misc:1235 imb:21 pmb:521 smb:808 d:- ref:0 ; in:3107 out:3107 type:P dur:82000000 cpbdur:82000000 q:18.93 tex:46872 mv:3593 misc:1407 imb:29 pmb:771 smb:550 d:- ref:0 ; in:3108 out:3108 type:P dur:82000000 cpbdur:82000000 q:18.83 tex:33310 mv:3275 misc:1255 imb:22 pmb:563 smb:765 d:- ref:0 ; in:3109 out:3109 type:P dur:82000000 cpbdur:82000000 q:18.26 tex:30693 mv:2639 misc:1252 imb:6 pmb:573 smb:771 d:- ref:0 ; in:3110 out:3110 type:P dur:82000000 cpbdur:82000000 q:19.98 tex:42321 mv:5731 misc:1172 imb:55 pmb:549 smb:746 d:- ref:0 ; in:3111 out:3111 type:P dur:82000000 cpbdur:82000000 q:19.07 tex:28828 mv:3155 misc:1337 imb:19 pmb:655 smb:676 d:- ref:0 ; in:3112 out:3112 type:P dur:82000000 cpbdur:82000000 q:20.52 tex:43025 mv:6464 misc:1175 imb:79 pmb:540 smb:731 d:- ref:0 ; in:3113 out:3113 type:P dur:82000000 cpbdur:82000000 q:19.76 tex:26967 mv:2885 misc:1116 imb:12 pmb:495 smb:843 d:- ref:0 ; in:3114 out:3114 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:42442 mv:6550 misc:1272 imb:98 pmb:550 smb:702 d:- ref:0 ; in:3115 out:3115 type:P dur:82000000 cpbdur:82000000 q:18.91 tex:26593 mv:3361 misc:1430 imb:24 pmb:705 smb:621 d:- ref:0 ; in:3116 out:3116 type:P dur:82000000 cpbdur:82000000 q:19.86 tex:35894 mv:5686 misc:1244 imb:50 pmb:586 smb:714 d:- ref:0 ; in:3117 out:3117 type:P dur:82000000 cpbdur:82000000 q:19.21 tex:37115 mv:3783 misc:1302 imb:24 pmb:659 smb:667 d:- ref:0 ; in:3118 out:3118 type:P dur:82000000 cpbdur:82000000 q:19.96 tex:32775 mv:5648 misc:1129 imb:27 pmb:548 smb:775 d:- ref:0 ; in:3119 out:3119 type:P dur:82000000 cpbdur:82000000 q:18.89 tex:29665 mv:3019 misc:1268 imb:10 pmb:599 smb:741 d:- ref:0 ; in:3120 out:3120 type:P dur:82000000 cpbdur:82000000 q:18.81 tex:33727 mv:2921 misc:1072 imb:9 pmb:485 smb:856 d:- ref:0 ; in:3121 out:3121 type:P dur:82000000 cpbdur:82000000 q:17.90 tex:22189 mv:2722 misc:1345 imb:25 pmb:560 smb:765 d:- ref:0 ; in:3122 out:3122 type:P dur:82000000 cpbdur:82000000 q:20.86 tex:47472 mv:9438 misc:1210 imb:107 pmb:732 smb:511 d:- ref:0 ; in:3123 out:3123 type:P dur:82000000 cpbdur:82000000 q:20.12 tex:28687 mv:3760 misc:1249 imb:38 pmb:604 smb:708 d:- ref:0 ; in:3124 out:3124 type:P dur:82000000 cpbdur:82000000 q:20.27 tex:33841 mv:4666 misc:1149 imb:36 pmb:512 smb:802 d:- ref:0 ; in:3125 out:3125 type:P dur:82000000 cpbdur:82000000 q:19.95 tex:27168 mv:3396 misc:1140 imb:16 pmb:512 smb:822 d:- ref:0 ; in:3126 out:3126 type:P dur:82000000 cpbdur:82000000 q:20.69 tex:33150 mv:6589 misc:1269 imb:89 pmb:641 smb:620 d:- ref:0 ; in:3127 out:3127 type:P dur:82000000 cpbdur:82000000 q:19.71 tex:22656 mv:2977 misc:1231 imb:9 pmb:561 smb:780 d:- ref:0 ; in:3128 out:3128 type:P dur:82000000 cpbdur:82000000 q:19.90 tex:28384 mv:4065 misc:1159 imb:25 pmb:483 smb:842 d:- ref:0 ; in:3129 out:3129 type:P dur:82000000 cpbdur:82000000 q:18.60 tex:31623 mv:3434 misc:1335 imb:27 pmb:678 smb:645 d:- ref:0 ; in:3130 out:3130 type:P dur:82000000 cpbdur:82000000 q:18.14 tex:27615 mv:2791 misc:1314 imb:22 pmb:643 smb:685 d:- ref:0 ; in:3131 out:3131 type:P dur:82000000 cpbdur:82000000 q:17.98 tex:24995 mv:2975 misc:1334 imb:43 pmb:507 smb:800 d:- ref:0 ; in:3132 out:3132 type:P dur:82000000 cpbdur:82000000 q:17.54 tex:17510 mv:2317 misc:1269 imb:51 pmb:381 smb:918 d:- ref:0 ; in:3133 out:3133 type:P dur:82000000 cpbdur:82000000 q:17.59 tex:17379 mv:2320 misc:1333 imb:26 pmb:458 smb:866 d:- ref:0 ; in:3134 out:3134 type:P dur:82000000 cpbdur:82000000 q:17.12 tex:36428 mv:3754 misc:1522 imb:72 pmb:808 smb:470 d:- ref:0 ; in:3135 out:3135 type:P dur:82000000 cpbdur:82000000 q:18.31 tex:32856 mv:2653 misc:1243 imb:16 pmb:533 smb:801 d:- ref:0 ; in:3136 out:3136 type:P dur:82000000 cpbdur:82000000 q:17.79 tex:16920 mv:1795 misc:1157 imb:9 pmb:375 smb:966 d:- ref:0 ; in:3137 out:3137 type:P dur:82000000 cpbdur:82000000 q:18.52 tex:26544 mv:2889 misc:1311 imb:28 pmb:527 smb:795 d:- ref:0 ; in:3138 out:3138 type:P dur:82000000 cpbdur:82000000 q:18.08 tex:24262 mv:2335 misc:1155 imb:13 pmb:447 smb:890 d:- ref:0 ; in:3139 out:3139 type:P dur:82000000 cpbdur:82000000 q:22.08 tex:495536 mv:18577 misc:1415 imb:1111 pmb:239 smb:0 d:- ref:0 ; in:3140 out:3140 type:P dur:82000000 cpbdur:82000000 q:26.08 tex:54101 mv:6294 misc:1461 imb:30 pmb:816 smb:504 d:- ref:0 ; in:3141 out:3141 type:P dur:82000000 cpbdur:82000000 q:25.82 tex:54599 mv:4874 misc:1439 imb:23 pmb:752 smb:575 d:- ref:0 ; in:3142 out:3142 type:P dur:82000000 cpbdur:82000000 q:24.74 tex:74172 mv:5713 misc:1507 imb:65 pmb:929 smb:356 d:- ref:0 ; in:3143 out:3143 type:P dur:82000000 cpbdur:82000000 q:23.76 tex:68736 mv:4653 misc:1491 imb:28 pmb:845 smb:477 d:- ref:0 ; in:3144 out:3144 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:95767 mv:4986 misc:1511 imb:31 pmb:892 smb:427 d:- ref:0 ; in:3145 out:3145 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:74711 mv:5254 misc:1491 imb:25 pmb:878 smb:447 d:- ref:0 ; in:3146 out:3146 type:P dur:82000000 cpbdur:82000000 q:23.18 tex:84663 mv:4882 misc:1527 imb:31 pmb:928 smb:391 d:- ref:0 ; in:3147 out:3147 type:P dur:82000000 cpbdur:82000000 q:22.86 tex:73856 mv:3971 misc:1397 imb:19 pmb:713 smb:618 d:- ref:0 ; in:3148 out:3148 type:P dur:82000000 cpbdur:82000000 q:22.79 tex:81096 mv:4755 misc:1413 imb:36 pmb:807 smb:507 d:- ref:0 ; in:3149 out:3149 type:P dur:82000000 cpbdur:82000000 q:22.30 tex:91193 mv:4885 misc:1546 imb:27 pmb:955 smb:368 d:- ref:0 ; in:3150 out:3150 type:P dur:82000000 cpbdur:82000000 q:22.92 tex:83525 mv:5153 misc:1474 imb:20 pmb:841 smb:489 d:- ref:0 ; in:3151 out:3151 type:P dur:82000000 cpbdur:82000000 q:23.01 tex:86330 mv:4361 misc:1389 imb:20 pmb:755 smb:575 d:- ref:0 ; in:3152 out:3152 type:P dur:82000000 cpbdur:82000000 q:23.03 tex:91157 mv:4814 misc:1413 imb:30 pmb:770 smb:550 d:- ref:0 ; in:3153 out:3153 type:P dur:82000000 cpbdur:82000000 q:23.10 tex:86874 mv:4836 misc:1474 imb:11 pmb:824 smb:515 d:- ref:0 ; in:3154 out:3154 type:P dur:82000000 cpbdur:82000000 q:23.09 tex:83221 mv:4678 misc:1453 imb:16 pmb:792 smb:542 d:- ref:0 ; in:3155 out:3155 type:P dur:82000000 cpbdur:82000000 q:23.08 tex:96017 mv:4914 misc:1461 imb:17 pmb:830 smb:503 d:- ref:0 ; in:3156 out:3156 type:P dur:82000000 cpbdur:82000000 q:22.76 tex:85665 mv:4434 misc:1421 imb:22 pmb:768 smb:560 d:- ref:0 ; in:3157 out:3157 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:87264 mv:4212 misc:1372 imb:17 pmb:730 smb:603 d:- ref:0 ; in:3158 out:3158 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:88101 mv:4326 misc:1397 imb:9 pmb:794 smb:547 d:- ref:0 ; in:3159 out:3159 type:P dur:82000000 cpbdur:82000000 q:23.14 tex:95184 mv:5525 misc:1451 imb:29 pmb:847 smb:474 d:- ref:0 ; in:3160 out:3160 type:P dur:82000000 cpbdur:82000000 q:23.43 tex:103698 mv:5683 misc:1451 imb:28 pmb:857 smb:465 d:- ref:0 ; in:3161 out:3161 type:P dur:82000000 cpbdur:82000000 q:23.34 tex:87612 mv:4986 misc:1434 imb:16 pmb:792 smb:542 d:- ref:0 ; in:3162 out:3162 type:P dur:82000000 cpbdur:82000000 q:23.57 tex:82634 mv:5588 misc:1450 imb:17 pmb:840 smb:493 d:- ref:0 ; in:3163 out:3163 type:P dur:82000000 cpbdur:82000000 q:23.19 tex:84758 mv:4506 misc:1464 imb:18 pmb:830 smb:502 d:- ref:0 ; in:3164 out:3164 type:P dur:82000000 cpbdur:82000000 q:23.09 tex:98339 mv:4493 misc:1440 imb:22 pmb:817 smb:511 d:- ref:0 ; in:3165 out:3165 type:P dur:82000000 cpbdur:82000000 q:22.79 tex:94440 mv:4381 misc:1419 imb:22 pmb:789 smb:539 d:- ref:0 ; in:3166 out:3166 type:P dur:82000000 cpbdur:82000000 q:22.93 tex:92381 mv:5149 misc:1422 imb:15 pmb:805 smb:530 d:- ref:0 ; in:3167 out:3167 type:P dur:82000000 cpbdur:82000000 q:23.26 tex:98714 mv:5534 misc:1440 imb:22 pmb:838 smb:490 d:- ref:0 ; in:3168 out:3168 type:P dur:82000000 cpbdur:82000000 q:23.19 tex:90391 mv:5177 misc:1440 imb:19 pmb:831 smb:500 d:- ref:0 ; in:3169 out:3169 type:P dur:82000000 cpbdur:82000000 q:23.19 tex:92086 mv:4467 misc:1391 imb:12 pmb:751 smb:587 d:- ref:0 ; in:3170 out:3170 type:P dur:82000000 cpbdur:82000000 q:22.73 tex:74669 mv:3671 misc:1372 imb:9 pmb:687 smb:654 d:- ref:0 ; in:3171 out:3171 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:87511 mv:4473 misc:1464 imb:14 pmb:843 smb:493 d:- ref:0 ; in:3172 out:3172 type:P dur:82000000 cpbdur:82000000 q:22.86 tex:99704 mv:5304 misc:1448 imb:23 pmb:852 smb:475 d:- ref:0 ; in:3173 out:3173 type:P dur:82000000 cpbdur:82000000 q:22.85 tex:91927 mv:4600 misc:1441 imb:20 pmb:766 smb:564 d:- ref:0 ; in:3174 out:3174 type:P dur:82000000 cpbdur:82000000 q:22.37 tex:101608 mv:5550 misc:1514 imb:41 pmb:1006 smb:303 d:- ref:0 ; in:3175 out:3175 type:P dur:82000000 cpbdur:82000000 q:22.40 tex:93328 mv:4514 misc:1478 imb:10 pmb:854 smb:486 d:- ref:0 ; in:3176 out:3176 type:P dur:82000000 cpbdur:82000000 q:22.33 tex:94406 mv:4873 misc:1505 imb:25 pmb:877 smb:448 d:- ref:0 ; in:3177 out:3177 type:P dur:82000000 cpbdur:82000000 q:22.50 tex:79932 mv:4227 misc:1433 imb:15 pmb:783 smb:552 d:- ref:0 ; in:3178 out:3178 type:P dur:82000000 cpbdur:82000000 q:22.61 tex:90825 mv:4630 misc:1401 imb:5 pmb:790 smb:555 d:- ref:0 ; in:3179 out:3179 type:P dur:82000000 cpbdur:82000000 q:22.61 tex:81628 mv:4287 misc:1437 imb:15 pmb:773 smb:562 d:- ref:0 ; in:3180 out:3180 type:P dur:82000000 cpbdur:82000000 q:22.54 tex:91018 mv:4194 misc:1412 imb:7 pmb:788 smb:555 d:- ref:0 ; in:3181 out:3181 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:87883 mv:4694 misc:1423 imb:11 pmb:784 smb:555 d:- ref:0 ; in:3182 out:3182 type:P dur:82000000 cpbdur:82000000 q:22.92 tex:91003 mv:5019 misc:1474 imb:29 pmb:887 smb:434 d:- ref:0 ; in:3183 out:3183 type:P dur:82000000 cpbdur:82000000 q:22.71 tex:80152 mv:3818 misc:1398 imb:15 pmb:718 smb:617 d:- ref:0 ; in:3184 out:3184 type:P dur:82000000 cpbdur:82000000 q:22.71 tex:90520 mv:4740 misc:1460 imb:15 pmb:814 smb:521 d:- ref:0 ; in:3185 out:3185 type:P dur:82000000 cpbdur:82000000 q:22.61 tex:90664 mv:3784 misc:1416 imb:10 pmb:750 smb:590 d:- ref:0 ; in:3186 out:3186 type:P dur:82000000 cpbdur:82000000 q:22.64 tex:91993 mv:4150 misc:1417 imb:12 pmb:776 smb:562 d:- ref:0 ; in:3187 out:3187 type:P dur:82000000 cpbdur:82000000 q:22.88 tex:87288 mv:4876 misc:1500 imb:22 pmb:860 smb:468 d:- ref:0 ; in:3188 out:3188 type:P dur:82000000 cpbdur:82000000 q:22.84 tex:86366 mv:4271 misc:1435 imb:11 pmb:769 smb:570 d:- ref:0 ; in:3189 out:3189 type:P dur:82000000 cpbdur:82000000 q:22.71 tex:76553 mv:4166 misc:1473 imb:14 pmb:758 smb:578 d:- ref:0 ; in:3190 out:3190 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:82244 mv:4827 misc:1481 imb:19 pmb:851 smb:480 d:- ref:0 ; in:3191 out:3191 type:P dur:82000000 cpbdur:82000000 q:22.60 tex:89873 mv:4332 misc:1443 imb:10 pmb:782 smb:558 d:- ref:0 ; in:3192 out:3192 type:P dur:82000000 cpbdur:82000000 q:22.82 tex:88681 mv:4563 misc:1484 imb:19 pmb:807 smb:524 d:- ref:0 ; in:3193 out:3193 type:P dur:82000000 cpbdur:82000000 q:22.88 tex:89947 mv:4210 misc:1435 imb:23 pmb:770 smb:557 d:- ref:0 ; in:3194 out:3194 type:P dur:82000000 cpbdur:82000000 q:22.67 tex:73194 mv:4268 misc:1490 imb:17 pmb:794 smb:539 d:- ref:0 ; in:3195 out:3195 type:P dur:82000000 cpbdur:82000000 q:22.60 tex:81676 mv:3864 misc:1420 imb:7 pmb:728 smb:615 d:- ref:0 ; in:3196 out:3196 type:P dur:82000000 cpbdur:82000000 q:22.94 tex:95411 mv:5073 misc:1420 imb:13 pmb:815 smb:522 d:- ref:0 ; in:3197 out:3197 type:P dur:82000000 cpbdur:82000000 q:22.92 tex:89054 mv:4504 misc:1458 imb:24 pmb:818 smb:508 d:- ref:0 ; in:3198 out:3198 type:P dur:82000000 cpbdur:82000000 q:22.73 tex:93389 mv:4056 misc:1403 imb:10 pmb:778 smb:562 d:- ref:0 ; in:3199 out:3199 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:86503 mv:4408 misc:1449 imb:23 pmb:788 smb:539 d:- ref:0 ; in:3200 out:3200 type:P dur:82000000 cpbdur:82000000 q:22.68 tex:91363 mv:4214 misc:1455 imb:17 pmb:846 smb:487 d:- ref:0 ; in:3201 out:3201 type:P dur:82000000 cpbdur:82000000 q:22.61 tex:97069 mv:4392 misc:1435 imb:14 pmb:822 smb:514 d:- ref:0 ; in:3202 out:3202 type:P dur:82000000 cpbdur:82000000 q:22.84 tex:101439 mv:4887 misc:1426 imb:17 pmb:847 smb:486 d:- ref:0 ; in:3203 out:3203 type:P dur:82000000 cpbdur:82000000 q:23.03 tex:91924 mv:5293 misc:1487 imb:29 pmb:843 smb:478 d:- ref:0 ; in:3204 out:3204 type:P dur:82000000 cpbdur:82000000 q:23.21 tex:95678 mv:5517 misc:1485 imb:28 pmb:869 smb:453 d:- ref:0 ; in:3205 out:3205 type:P dur:82000000 cpbdur:82000000 q:22.79 tex:77134 mv:3780 misc:1366 imb:15 pmb:706 smb:629 d:- ref:0 ; in:3206 out:3206 type:P dur:82000000 cpbdur:82000000 q:23.19 tex:93651 mv:5268 misc:1457 imb:24 pmb:860 smb:466 d:- ref:0 ; in:3207 out:3207 type:P dur:82000000 cpbdur:82000000 q:23.34 tex:95144 mv:5016 misc:1480 imb:22 pmb:838 smb:490 d:- ref:0 ; in:3208 out:3208 type:P dur:82000000 cpbdur:82000000 q:23.21 tex:87380 mv:5185 misc:1467 imb:21 pmb:829 smb:500 d:- ref:0 ; in:3209 out:3209 type:P dur:82000000 cpbdur:82000000 q:22.90 tex:78289 mv:3732 misc:1347 imb:14 pmb:686 smb:650 d:- ref:0 ; in:3210 out:3210 type:P dur:82000000 cpbdur:82000000 q:22.73 tex:86007 mv:4176 misc:1425 imb:13 pmb:798 smb:539 d:- ref:0 ; in:3211 out:3211 type:P dur:82000000 cpbdur:82000000 q:22.77 tex:99326 mv:4630 misc:1460 imb:17 pmb:850 smb:483 d:- ref:0 ; in:3212 out:3212 type:P dur:82000000 cpbdur:82000000 q:22.67 tex:92080 mv:4430 misc:1474 imb:19 pmb:846 smb:485 d:- ref:0 ; in:3213 out:3213 type:P dur:82000000 cpbdur:82000000 q:22.43 tex:126117 mv:5186 misc:1521 imb:40 pmb:1004 smb:306 d:- ref:0 ; in:3214 out:3214 type:P dur:82000000 cpbdur:82000000 q:22.82 tex:90493 mv:4391 misc:1452 imb:6 pmb:795 smb:549 d:- ref:0 ; in:3215 out:3215 type:P dur:82000000 cpbdur:82000000 q:22.88 tex:95768 mv:4332 misc:1444 imb:11 pmb:802 smb:537 d:- ref:0 ; in:3216 out:3216 type:P dur:82000000 cpbdur:82000000 q:22.79 tex:91433 mv:4458 misc:1445 imb:8 pmb:796 smb:546 d:- ref:0 ; in:3217 out:3217 type:P dur:82000000 cpbdur:82000000 q:22.55 tex:73894 mv:3715 misc:1431 imb:13 pmb:749 smb:588 d:- ref:0 ; in:3218 out:3218 type:P dur:82000000 cpbdur:82000000 q:22.67 tex:91934 mv:4517 misc:1445 imb:25 pmb:811 smb:514 d:- ref:0 ; in:3219 out:3219 type:P dur:82000000 cpbdur:82000000 q:22.33 tex:116283 mv:5194 misc:1507 imb:36 pmb:998 smb:316 d:- ref:0 ; in:3220 out:3220 type:P dur:82000000 cpbdur:82000000 q:22.81 tex:89245 mv:4446 misc:1437 imb:18 pmb:782 smb:550 d:- ref:0 ; in:3221 out:3221 type:P dur:82000000 cpbdur:82000000 q:22.83 tex:88802 mv:4811 misc:1459 imb:10 pmb:843 smb:497 d:- ref:0 ; in:3222 out:3222 type:P dur:82000000 cpbdur:82000000 q:22.56 tex:84369 mv:4123 misc:1436 imb:10 pmb:781 smb:559 d:- ref:0 ; in:3223 out:3223 type:P dur:82000000 cpbdur:82000000 q:22.67 tex:86510 mv:4285 misc:1461 imb:18 pmb:801 smb:531 d:- ref:0 ; in:3224 out:3224 type:P dur:82000000 cpbdur:82000000 q:22.77 tex:93461 mv:4344 misc:1459 imb:14 pmb:808 smb:528 d:- ref:0 ; in:3225 out:3225 type:P dur:82000000 cpbdur:82000000 q:22.73 tex:89349 mv:4468 misc:1455 imb:16 pmb:796 smb:538 d:- ref:0 ; in:3226 out:3226 type:P dur:82000000 cpbdur:82000000 q:22.83 tex:87284 mv:4491 misc:1433 imb:16 pmb:777 smb:557 d:- ref:0 ; in:3227 out:3227 type:P dur:82000000 cpbdur:82000000 q:22.52 tex:76538 mv:3735 misc:1447 imb:9 pmb:769 smb:572 d:- ref:0 ; in:3228 out:3228 type:P dur:82000000 cpbdur:82000000 q:22.58 tex:94656 mv:4591 misc:1497 imb:17 pmb:847 smb:486 d:- ref:0 ; in:3229 out:3229 type:P dur:82000000 cpbdur:82000000 q:22.50 tex:93574 mv:4063 misc:1411 imb:15 pmb:793 smb:542 d:- ref:0 ; in:3230 out:3230 type:P dur:82000000 cpbdur:82000000 q:22.64 tex:87165 mv:4404 misc:1447 imb:6 pmb:820 smb:524 d:- ref:0 ; in:3231 out:3231 type:P dur:82000000 cpbdur:82000000 q:22.52 tex:75425 mv:4146 misc:1493 imb:8 pmb:786 smb:556 d:- ref:0 ; in:3232 out:3232 type:P dur:82000000 cpbdur:82000000 q:22.71 tex:91949 mv:5061 misc:1478 imb:21 pmb:907 smb:422 d:- ref:0 ; in:3233 out:3233 type:P dur:82000000 cpbdur:82000000 q:22.61 tex:97244 mv:4291 misc:1441 imb:9 pmb:845 smb:496 d:- ref:0 ; in:3234 out:3234 type:P dur:82000000 cpbdur:82000000 q:22.61 tex:88235 mv:4768 misc:1501 imb:16 pmb:858 smb:476 d:- ref:0 ; in:3235 out:3235 type:P dur:82000000 cpbdur:82000000 q:22.50 tex:87857 mv:4603 misc:1460 imb:20 pmb:839 smb:491 d:- ref:0 ; in:3236 out:3236 type:P dur:82000000 cpbdur:82000000 q:22.75 tex:87583 mv:4398 misc:1435 imb:18 pmb:776 smb:556 d:- ref:0 ; in:3237 out:3237 type:P dur:82000000 cpbdur:82000000 q:23.04 tex:90259 mv:5074 misc:1491 imb:23 pmb:884 smb:443 d:- ref:0 ; in:3238 out:3238 type:P dur:82000000 cpbdur:82000000 q:23.52 tex:87789 mv:5599 misc:1460 imb:17 pmb:863 smb:470 d:- ref:0 ; in:3239 out:3239 type:P dur:82000000 cpbdur:82000000 q:23.40 tex:97919 mv:5308 misc:1501 imb:14 pmb:910 smb:426 d:- ref:0 ; in:3240 out:3240 type:P dur:82000000 cpbdur:82000000 q:22.88 tex:71176 mv:3624 misc:1448 imb:12 pmb:714 smb:624 d:- ref:0 ; in:3241 out:3241 type:P dur:82000000 cpbdur:82000000 q:22.50 tex:107959 mv:4875 misc:1558 imb:31 pmb:983 smb:336 d:- ref:0 ; in:3242 out:3242 type:P dur:82000000 cpbdur:82000000 q:22.78 tex:90023 mv:4165 misc:1436 imb:22 pmb:783 smb:545 d:- ref:0 ; in:3243 out:3243 type:P dur:82000000 cpbdur:82000000 q:22.39 tex:110615 mv:4638 misc:1515 imb:15 pmb:944 smb:391 d:- ref:0 ; in:3244 out:3244 type:P dur:82000000 cpbdur:82000000 q:22.71 tex:76937 mv:4395 misc:1460 imb:7 pmb:793 smb:550 d:- ref:0 ; in:3245 out:3245 type:P dur:82000000 cpbdur:82000000 q:23.12 tex:93454 mv:4897 misc:1513 imb:26 pmb:877 smb:447 d:- ref:0 ; in:3246 out:3246 type:P dur:82000000 cpbdur:82000000 q:23.36 tex:94672 mv:5052 misc:1468 imb:18 pmb:860 smb:472 d:- ref:0 ; in:3247 out:3247 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:84543 mv:4931 misc:1366 imb:26 pmb:761 smb:563 d:- ref:0 ; in:3248 out:3248 type:P dur:82000000 cpbdur:82000000 q:22.88 tex:86116 mv:4112 misc:1460 imb:21 pmb:826 smb:503 d:- ref:0 ; in:3249 out:3249 type:P dur:82000000 cpbdur:82000000 q:22.82 tex:87075 mv:4756 misc:1505 imb:26 pmb:848 smb:476 d:- ref:0 ; in:3250 out:3250 type:I dur:82000000 cpbdur:82000000 q:19.92 tex:578777 mv:14932 misc:371 imb:1350 pmb:0 smb:0 d:- ref:; in:3251 out:3251 type:P dur:82000000 cpbdur:82000000 q:26.82 tex:37596 mv:2779 misc:1257 imb:1 pmb:541 smb:808 d:- ref:0 ; in:3252 out:3252 type:P dur:82000000 cpbdur:82000000 q:25.73 tex:49097 mv:3247 misc:1344 imb:4 pmb:627 smb:719 d:- ref:0 ; in:3253 out:3253 type:P dur:82000000 cpbdur:82000000 q:24.54 tex:71584 mv:4405 misc:1451 imb:6 pmb:803 smb:541 d:- ref:0 ; in:3254 out:3254 type:P dur:82000000 cpbdur:82000000 q:23.85 tex:74787 mv:4489 misc:1444 imb:5 pmb:763 smb:582 d:- ref:0 ; in:3255 out:3255 type:P dur:82000000 cpbdur:82000000 q:23.67 tex:82589 mv:5039 misc:1420 imb:10 pmb:793 smb:547 d:- ref:0 ; in:3256 out:3256 type:P dur:82000000 cpbdur:82000000 q:23.21 tex:87301 mv:4513 misc:1498 imb:8 pmb:855 smb:487 d:- ref:0 ; in:3257 out:3257 type:P dur:82000000 cpbdur:82000000 q:23.04 tex:85086 mv:4607 misc:1475 imb:12 pmb:841 smb:497 d:- ref:0 ; in:3258 out:3258 type:P dur:82000000 cpbdur:82000000 q:23.01 tex:95692 mv:4732 misc:1464 imb:6 pmb:850 smb:494 d:- ref:0 ; in:3259 out:3259 type:P dur:82000000 cpbdur:82000000 q:23.35 tex:96500 mv:5501 misc:1479 imb:22 pmb:849 smb:479 d:- ref:0 ; in:3260 out:3260 type:P dur:82000000 cpbdur:82000000 q:23.27 tex:84397 mv:4562 misc:1433 imb:21 pmb:788 smb:541 d:- ref:0 ; in:3261 out:3261 type:P dur:82000000 cpbdur:82000000 q:23.23 tex:92472 mv:4470 misc:1442 imb:18 pmb:778 smb:554 d:- ref:0 ; in:3262 out:3262 type:P dur:82000000 cpbdur:82000000 q:23.34 tex:94622 mv:5427 misc:1471 imb:24 pmb:891 smb:435 d:- ref:0 ; in:3263 out:3263 type:P dur:82000000 cpbdur:82000000 q:22.97 tex:76518 mv:3683 misc:1415 imb:9 pmb:711 smb:630 d:- ref:0 ; in:3264 out:3264 type:P dur:82000000 cpbdur:82000000 q:22.65 tex:69682 mv:3880 misc:1438 imb:7 pmb:736 smb:607 d:- ref:0 ; in:3265 out:3265 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:108066 mv:5073 misc:1525 imb:39 pmb:977 smb:334 d:- ref:0 ; in:3266 out:3266 type:P dur:82000000 cpbdur:82000000 q:22.37 tex:88716 mv:4499 misc:1481 imb:13 pmb:845 smb:492 d:- ref:0 ; in:3267 out:3267 type:P dur:82000000 cpbdur:82000000 q:22.66 tex:85736 mv:4313 misc:1463 imb:9 pmb:821 smb:520 d:- ref:0 ; in:3268 out:3268 type:P dur:82000000 cpbdur:82000000 q:22.91 tex:102209 mv:4954 misc:1437 imb:14 pmb:858 smb:478 d:- ref:0 ; in:3269 out:3269 type:P dur:82000000 cpbdur:82000000 q:22.65 tex:83396 mv:3654 misc:1390 imb:9 pmb:714 smb:627 d:- ref:0 ; in:3270 out:3270 type:P dur:82000000 cpbdur:82000000 q:23.01 tex:95322 mv:5315 misc:1475 imb:21 pmb:893 smb:436 d:- ref:0 ; in:3271 out:3271 type:P dur:82000000 cpbdur:82000000 q:22.61 tex:78987 mv:3544 misc:1445 imb:7 pmb:756 smb:587 d:- ref:0 ; in:3272 out:3272 type:P dur:82000000 cpbdur:82000000 q:22.72 tex:93329 mv:4706 misc:1453 imb:9 pmb:834 smb:507 d:- ref:0 ; in:3273 out:3273 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:89074 mv:4435 misc:1379 imb:11 pmb:723 smb:616 d:- ref:0 ; in:3274 out:3274 type:P dur:82000000 cpbdur:82000000 q:22.67 tex:81796 mv:4430 misc:1470 imb:13 pmb:794 smb:543 d:- ref:0 ; in:3275 out:3275 type:P dur:82000000 cpbdur:82000000 q:22.68 tex:93929 mv:4599 misc:1464 imb:20 pmb:847 smb:483 d:- ref:0 ; in:3276 out:3276 type:P dur:82000000 cpbdur:82000000 q:22.76 tex:88392 mv:4789 misc:1435 imb:7 pmb:819 smb:524 d:- ref:0 ; in:3277 out:3277 type:P dur:82000000 cpbdur:82000000 q:22.50 tex:109070 mv:5416 misc:1522 imb:34 pmb:1008 smb:308 d:- ref:0 ; in:3278 out:3278 type:P dur:82000000 cpbdur:82000000 q:22.68 tex:72586 mv:4062 misc:1464 imb:22 pmb:766 smb:562 d:- ref:0 ; in:3279 out:3279 type:P dur:82000000 cpbdur:82000000 q:22.71 tex:80850 mv:4104 misc:1422 imb:18 pmb:738 smb:594 d:- ref:0 ; in:3280 out:3280 type:P dur:82000000 cpbdur:82000000 q:22.94 tex:95421 mv:5614 misc:1493 imb:28 pmb:900 smb:422 d:- ref:0 ; in:3281 out:3281 type:P dur:82000000 cpbdur:82000000 q:22.35 tex:100400 mv:5070 misc:1522 imb:38 pmb:992 smb:320 d:- ref:0 ; in:3282 out:3282 type:P dur:82000000 cpbdur:82000000 q:22.56 tex:78466 mv:4017 misc:1405 imb:9 pmb:765 smb:576 d:- ref:0 ; in:3283 out:3283 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:87935 mv:4398 misc:1451 imb:11 pmb:784 smb:555 d:- ref:0 ; in:3284 out:3284 type:P dur:82000000 cpbdur:82000000 q:22.52 tex:90154 mv:4275 misc:1475 imb:20 pmb:835 smb:495 d:- ref:0 ; in:3285 out:3285 type:P dur:82000000 cpbdur:82000000 q:22.51 tex:77719 mv:3861 misc:1396 imb:9 pmb:719 smb:622 d:- ref:0 ; in:3286 out:3286 type:P dur:82000000 cpbdur:82000000 q:22.67 tex:90295 mv:4513 misc:1456 imb:22 pmb:811 smb:517 d:- ref:0 ; in:3287 out:3287 type:P dur:82000000 cpbdur:82000000 q:23.03 tex:100885 mv:4563 misc:1456 imb:12 pmb:835 smb:503 d:- ref:0 ; in:3288 out:3288 type:P dur:82000000 cpbdur:82000000 q:22.91 tex:83312 mv:4088 misc:1440 imb:10 pmb:778 smb:562 d:- ref:0 ; in:3289 out:3289 type:P dur:82000000 cpbdur:82000000 q:22.72 tex:81615 mv:3918 misc:1419 imb:20 pmb:764 smb:566 d:- ref:0 ; in:3290 out:3290 type:P dur:82000000 cpbdur:82000000 q:23.06 tex:97196 mv:5049 misc:1475 imb:25 pmb:869 smb:456 d:- ref:0 ; in:3291 out:3291 type:P dur:82000000 cpbdur:82000000 q:22.81 tex:81463 mv:3938 misc:1455 imb:10 pmb:748 smb:592 d:- ref:0 ; in:3292 out:3292 type:P dur:82000000 cpbdur:82000000 q:23.20 tex:104020 mv:5184 misc:1476 imb:7 pmb:898 smb:445 d:- ref:0 ; in:3293 out:3293 type:P dur:82000000 cpbdur:82000000 q:23.09 tex:89336 mv:4200 misc:1472 imb:18 pmb:790 smb:542 d:- ref:0 ; in:3294 out:3294 type:P dur:82000000 cpbdur:82000000 q:23.40 tex:94705 mv:5509 misc:1498 imb:30 pmb:929 smb:391 d:- ref:0 ; in:3295 out:3295 type:P dur:82000000 cpbdur:82000000 q:22.95 tex:77634 mv:4397 misc:1473 imb:17 pmb:807 smb:526 d:- ref:0 ; in:3296 out:3296 type:P dur:82000000 cpbdur:82000000 q:22.91 tex:87742 mv:5143 misc:1499 imb:53 pmb:919 smb:378 d:- ref:0 ; in:3297 out:3297 type:P dur:82000000 cpbdur:82000000 q:23.18 tex:103243 mv:5112 misc:1453 imb:23 pmb:860 smb:467 d:- ref:0 ; in:3298 out:3298 type:P dur:82000000 cpbdur:82000000 q:23.39 tex:105126 mv:5586 misc:1472 imb:14 pmb:914 smb:422 d:- ref:0 ; in:3299 out:3299 type:P dur:82000000 cpbdur:82000000 q:23.45 tex:97639 mv:4982 misc:1451 imb:14 pmb:838 smb:498 d:- ref:0 ; in:3300 out:3300 type:P dur:82000000 cpbdur:82000000 q:23.72 tex:88315 mv:5392 misc:1485 imb:9 pmb:854 smb:487 d:- ref:0 ; in:3301 out:3301 type:P dur:82000000 cpbdur:82000000 q:23.43 tex:97866 mv:4987 misc:1507 imb:27 pmb:893 smb:430 d:- ref:0 ; in:3302 out:3302 type:P dur:82000000 cpbdur:82000000 q:23.52 tex:92378 mv:4855 misc:1311 imb:17 pmb:763 smb:570 d:- ref:0 ; in:3303 out:3303 type:P dur:82000000 cpbdur:82000000 q:23.17 tex:91135 mv:4440 misc:1457 imb:21 pmb:828 smb:501 d:- ref:0 ; in:3304 out:3304 type:P dur:82000000 cpbdur:82000000 q:23.24 tex:97359 mv:5111 misc:1466 imb:18 pmb:877 smb:455 d:- ref:0 ; in:3305 out:3305 type:P dur:82000000 cpbdur:82000000 q:23.07 tex:94511 mv:4592 misc:1449 imb:6 pmb:824 smb:520 d:- ref:0 ; in:3306 out:3306 type:P dur:82000000 cpbdur:82000000 q:23.74 tex:98441 mv:6584 misc:1503 imb:27 pmb:954 smb:369 d:- ref:0 ; in:3307 out:3307 type:P dur:82000000 cpbdur:82000000 q:27.74 tex:412154 mv:19738 misc:1420 imb:998 pmb:352 smb:0 d:- ref:0 ; in:3308 out:3308 type:P dur:82000000 cpbdur:82000000 q:29.00 tex:98741 mv:9644 misc:1439 imb:49 pmb:966 smb:335 d:- ref:0 ; in:3309 out:3309 type:P dur:82000000 cpbdur:82000000 q:27.93 tex:103760 mv:8227 misc:1485 imb:17 pmb:973 smb:360 d:- ref:0 ; in:3310 out:3310 type:P dur:82000000 cpbdur:82000000 q:27.89 tex:151543 mv:11990 misc:1467 imb:66 pmb:1032 smb:252 d:- ref:0 ; in:3311 out:3311 type:P dur:82000000 cpbdur:82000000 q:27.21 tex:130955 mv:8423 misc:1486 imb:34 pmb:1055 smb:261 d:- ref:0 ; in:3312 out:3312 type:P dur:82000000 cpbdur:82000000 q:26.92 tex:122258 mv:8930 misc:1476 imb:42 pmb:1024 smb:284 d:- ref:0 ; in:3313 out:3313 type:P dur:82000000 cpbdur:82000000 q:27.28 tex:158212 mv:10642 misc:1466 imb:72 pmb:968 smb:310 d:- ref:0 ; in:3314 out:3314 type:P dur:82000000 cpbdur:82000000 q:27.21 tex:151522 mv:10178 misc:1468 imb:56 pmb:1062 smb:232 d:- ref:0 ; in:3315 out:3315 type:P dur:82000000 cpbdur:82000000 q:27.15 tex:150236 mv:10586 misc:1442 imb:49 pmb:1044 smb:257 d:- ref:0 ; in:3316 out:3316 type:P dur:82000000 cpbdur:82000000 q:27.48 tex:164298 mv:11350 misc:1472 imb:61 pmb:1002 smb:287 d:- ref:0 ; in:3317 out:3317 type:P dur:82000000 cpbdur:82000000 q:26.80 tex:101114 mv:6429 misc:1345 imb:15 pmb:727 smb:608 d:- ref:0 ; in:3318 out:3318 type:P dur:82000000 cpbdur:82000000 q:26.44 tex:127605 mv:7663 misc:1484 imb:29 pmb:957 smb:364 d:- ref:0 ; in:3319 out:3319 type:P dur:82000000 cpbdur:82000000 q:27.11 tex:155219 mv:10056 misc:1413 imb:58 pmb:848 smb:444 d:- ref:0 ; in:3320 out:3320 type:P dur:82000000 cpbdur:82000000 q:26.61 tex:94688 mv:6769 misc:1423 imb:20 pmb:745 smb:585 d:- ref:0 ; in:3321 out:3321 type:P dur:82000000 cpbdur:82000000 q:26.46 tex:144376 mv:8325 misc:1459 imb:33 pmb:1021 smb:296 d:- ref:0 ; in:3322 out:3322 type:P dur:82000000 cpbdur:82000000 q:27.14 tex:149907 mv:10449 misc:1396 imb:35 pmb:883 smb:432 d:- ref:0 ; in:3323 out:3323 type:P dur:82000000 cpbdur:82000000 q:26.79 tex:114375 mv:7313 misc:1408 imb:14 pmb:871 smb:465 d:- ref:0 ; in:3324 out:3324 type:P dur:82000000 cpbdur:82000000 q:26.46 tex:127241 mv:7582 misc:1473 imb:24 pmb:918 smb:408 d:- ref:0 ; in:3325 out:3325 type:P dur:82000000 cpbdur:82000000 q:26.99 tex:141136 mv:9172 misc:1276 imb:56 pmb:712 smb:582 d:- ref:0 ; in:3326 out:3326 type:P dur:82000000 cpbdur:82000000 q:26.59 tex:96991 mv:6778 misc:1351 imb:17 pmb:734 smb:599 d:- ref:0 ; in:3327 out:3327 type:P dur:82000000 cpbdur:82000000 q:26.35 tex:130485 mv:7715 misc:1456 imb:28 pmb:937 smb:385 d:- ref:0 ; in:3328 out:3328 type:P dur:82000000 cpbdur:82000000 q:26.77 tex:134467 mv:9681 misc:1388 imb:52 pmb:795 smb:503 d:- ref:0 ; in:3329 out:3329 type:P dur:82000000 cpbdur:82000000 q:26.64 tex:125705 mv:8652 misc:1451 imb:49 pmb:942 smb:359 d:- ref:0 ; in:3330 out:3330 type:P dur:82000000 cpbdur:82000000 q:26.65 tex:123669 mv:9071 misc:1412 imb:50 pmb:931 smb:369 d:- ref:0 ; in:3331 out:3331 type:P dur:82000000 cpbdur:82000000 q:27.09 tex:152579 mv:10902 misc:1407 imb:81 pmb:972 smb:297 d:- ref:0 ; in:3332 out:3332 type:P dur:82000000 cpbdur:82000000 q:27.05 tex:138648 mv:9686 misc:1442 imb:51 pmb:1000 smb:299 d:- ref:0 ; in:3333 out:3333 type:P dur:82000000 cpbdur:82000000 q:26.48 tex:119394 mv:7253 misc:1457 imb:17 pmb:915 smb:418 d:- ref:0 ; in:3334 out:3334 type:P dur:82000000 cpbdur:82000000 q:26.88 tex:141707 mv:10062 misc:1423 imb:48 pmb:896 smb:406 d:- ref:0 ; in:3335 out:3335 type:P dur:82000000 cpbdur:82000000 q:26.33 tex:108832 mv:6935 misc:1449 imb:25 pmb:813 smb:512 d:- ref:0 ; in:3336 out:3336 type:P dur:82000000 cpbdur:82000000 q:26.30 tex:131749 mv:8255 misc:1396 imb:26 pmb:929 smb:395 d:- ref:0 ; in:3337 out:3337 type:P dur:82000000 cpbdur:82000000 q:26.86 tex:145872 mv:10745 misc:1415 imb:70 pmb:929 smb:351 d:- ref:0 ; in:3338 out:3338 type:P dur:82000000 cpbdur:82000000 q:26.50 tex:119237 mv:7376 misc:1459 imb:32 pmb:848 smb:470 d:- ref:0 ; in:3339 out:3339 type:P dur:82000000 cpbdur:82000000 q:26.12 tex:103052 mv:6840 misc:1380 imb:19 pmb:760 smb:571 d:- ref:0 ; in:3340 out:3340 type:P dur:82000000 cpbdur:82000000 q:26.65 tex:127242 mv:8970 misc:1332 imb:46 pmb:748 smb:556 d:- ref:0 ; in:3341 out:3341 type:P dur:82000000 cpbdur:82000000 q:26.33 tex:125510 mv:7701 misc:1413 imb:29 pmb:933 smb:388 d:- ref:0 ; in:3342 out:3342 type:P dur:82000000 cpbdur:82000000 q:26.21 tex:125386 mv:7523 misc:1451 imb:15 pmb:925 smb:410 d:- ref:0 ; in:3343 out:3343 type:P dur:82000000 cpbdur:82000000 q:27.08 tex:164402 mv:11607 misc:1439 imb:67 pmb:1033 smb:250 d:- ref:0 ; in:3344 out:3344 type:P dur:82000000 cpbdur:82000000 q:26.74 tex:107920 mv:7463 misc:1409 imb:22 pmb:833 smb:495 d:- ref:0 ; in:3345 out:3345 type:P dur:82000000 cpbdur:82000000 q:26.33 tex:123818 mv:7593 misc:1469 imb:22 pmb:941 smb:387 d:- ref:0 ; in:3346 out:3346 type:P dur:82000000 cpbdur:82000000 q:26.97 tex:143548 mv:10017 misc:1387 imb:45 pmb:863 smb:442 d:- ref:0 ; in:3347 out:3347 type:P dur:82000000 cpbdur:82000000 q:26.73 tex:120929 mv:8420 misc:1427 imb:23 pmb:954 smb:373 d:- ref:0 ; in:3348 out:3348 type:P dur:82000000 cpbdur:82000000 q:26.52 tex:112417 mv:8021 misc:1394 imb:25 pmb:851 smb:474 d:- ref:0 ; in:3349 out:3349 type:P dur:82000000 cpbdur:82000000 q:27.01 tex:148957 mv:10280 misc:1387 imb:66 pmb:872 smb:412 d:- ref:0 ; in:3350 out:3350 type:P dur:82000000 cpbdur:82000000 q:26.49 tex:118266 mv:7214 misc:1472 imb:23 pmb:884 smb:443 d:- ref:0 ; in:3351 out:3351 type:P dur:82000000 cpbdur:82000000 q:26.28 tex:126719 mv:8005 misc:1380 imb:35 pmb:885 smb:430 d:- ref:0 ; in:3352 out:3352 type:P dur:82000000 cpbdur:82000000 q:27.09 tex:156050 mv:11065 misc:1429 imb:51 pmb:951 smb:348 d:- ref:0 ; in:3353 out:3353 type:P dur:82000000 cpbdur:82000000 q:26.43 tex:112143 mv:7154 misc:1455 imb:18 pmb:876 smb:456 d:- ref:0 ; in:3354 out:3354 type:P dur:82000000 cpbdur:82000000 q:26.10 tex:94600 mv:6167 misc:1249 imb:15 pmb:579 smb:756 d:- ref:0 ; in:3355 out:3355 type:P dur:82000000 cpbdur:82000000 q:26.84 tex:141554 mv:9663 misc:1335 imb:46 pmb:761 smb:543 d:- ref:0 ; in:3356 out:3356 type:P dur:82000000 cpbdur:82000000 q:26.66 tex:115115 mv:7816 misc:1413 imb:15 pmb:874 smb:461 d:- ref:0 ; in:3357 out:3357 type:P dur:82000000 cpbdur:82000000 q:26.48 tex:136052 mv:8115 misc:1457 imb:21 pmb:971 smb:358 d:- ref:0 ; in:3358 out:3358 type:P dur:82000000 cpbdur:82000000 q:27.12 tex:143588 mv:9674 misc:1330 imb:32 pmb:784 smb:534 d:- ref:0 ; in:3359 out:3359 type:P dur:82000000 cpbdur:82000000 q:26.91 tex:133621 mv:8869 misc:1462 imb:39 pmb:995 smb:316 d:- ref:0 ; in:3360 out:3360 type:P dur:82000000 cpbdur:82000000 q:26.96 tex:147202 mv:10277 misc:1433 imb:66 pmb:1025 smb:259 d:- ref:0 ; in:3361 out:3361 type:P dur:82000000 cpbdur:82000000 q:27.45 tex:170096 mv:11850 misc:1422 imb:89 pmb:1002 smb:259 d:- ref:0 ; in:3362 out:3362 type:P dur:82000000 cpbdur:82000000 q:26.85 tex:102340 mv:7091 misc:1393 imb:26 pmb:787 smb:537 d:- ref:0 ; in:3363 out:3363 type:P dur:82000000 cpbdur:82000000 q:26.49 tex:129179 mv:7964 misc:1465 imb:32 pmb:946 smb:372 d:- ref:0 ; in:3364 out:3364 type:P dur:82000000 cpbdur:82000000 q:27.04 tex:147451 mv:10633 misc:1436 imb:63 pmb:947 smb:340 d:- ref:0 ; in:3365 out:3365 type:P dur:82000000 cpbdur:82000000 q:26.61 tex:100676 mv:6746 misc:1378 imb:17 pmb:742 smb:591 d:- ref:0 ; in:3366 out:3366 type:P dur:82000000 cpbdur:82000000 q:26.19 tex:109804 mv:6838 misc:1430 imb:21 pmb:800 smb:529 d:- ref:0 ; in:3367 out:3367 type:P dur:82000000 cpbdur:82000000 q:26.84 tex:137715 mv:9496 misc:1357 imb:52 pmb:778 smb:520 d:- ref:0 ; in:3368 out:3368 type:P dur:82000000 cpbdur:82000000 q:26.33 tex:108974 mv:6479 misc:1379 imb:13 pmb:767 smb:570 d:- ref:0 ; in:3369 out:3369 type:P dur:82000000 cpbdur:82000000 q:26.11 tex:101867 mv:6600 misc:1373 imb:11 pmb:742 smb:597 d:- ref:0 ; in:3370 out:3370 type:P dur:82000000 cpbdur:82000000 q:26.96 tex:154382 mv:10894 misc:1412 imb:58 pmb:964 smb:328 d:- ref:0 ; in:3371 out:3371 type:P dur:82000000 cpbdur:82000000 q:26.65 tex:111355 mv:7645 misc:1400 imb:27 pmb:857 smb:466 d:- ref:0 ; in:3372 out:3372 type:P dur:82000000 cpbdur:82000000 q:26.21 tex:107075 mv:6889 misc:1412 imb:22 pmb:779 smb:549 d:- ref:0 ; in:3373 out:3373 type:P dur:82000000 cpbdur:82000000 q:26.85 tex:145298 mv:10039 misc:1423 imb:58 pmb:921 smb:371 d:- ref:0 ; in:3374 out:3374 type:P dur:82000000 cpbdur:82000000 q:26.52 tex:108107 mv:7136 misc:1341 imb:16 pmb:780 smb:554 d:- ref:0 ; in:3375 out:3375 type:P dur:82000000 cpbdur:82000000 q:26.48 tex:144317 mv:8833 misc:1426 imb:44 pmb:989 smb:317 d:- ref:0 ; in:3376 out:3376 type:P dur:82000000 cpbdur:82000000 q:26.91 tex:139010 mv:10064 misc:1366 imb:55 pmb:852 smb:443 d:- ref:0 ; in:3377 out:3377 type:P dur:82000000 cpbdur:82000000 q:26.58 tex:110249 mv:7383 misc:1424 imb:25 pmb:861 smb:464 d:- ref:0 ; in:3378 out:3378 type:P dur:82000000 cpbdur:82000000 q:26.64 tex:135207 mv:9658 misc:1479 imb:47 pmb:1030 smb:273 d:- ref:0 ; in:3379 out:3379 type:P dur:82000000 cpbdur:82000000 q:27.10 tex:154373 mv:10929 misc:1442 imb:69 pmb:997 smb:284 d:- ref:0 ; in:3380 out:3380 type:P dur:82000000 cpbdur:82000000 q:26.58 tex:94556 mv:6861 misc:1351 imb:25 pmb:715 smb:610 d:- ref:0 ; in:3381 out:3381 type:P dur:82000000 cpbdur:82000000 q:26.07 tex:109757 mv:7022 misc:1461 imb:12 pmb:872 smb:466 d:- ref:0 ; in:3382 out:3382 type:P dur:82000000 cpbdur:82000000 q:26.77 tex:142011 mv:10071 misc:1382 imb:48 pmb:841 smb:461 d:- ref:0 ; in:3383 out:3383 type:P dur:82000000 cpbdur:82000000 q:26.29 tex:112132 mv:6746 misc:1394 imb:15 pmb:798 smb:537 d:- ref:0 ; in:3384 out:3384 type:P dur:82000000 cpbdur:82000000 q:26.17 tex:115867 mv:7468 misc:1425 imb:25 pmb:874 smb:451 d:- ref:0 ; in:3385 out:3385 type:P dur:82000000 cpbdur:82000000 q:26.80 tex:149992 mv:10492 misc:1404 imb:77 pmb:922 smb:351 d:- ref:0 ; in:3386 out:3386 type:P dur:82000000 cpbdur:82000000 q:26.83 tex:125203 mv:8555 misc:1418 imb:43 pmb:919 smb:388 d:- ref:0 ; in:3387 out:3387 type:P dur:82000000 cpbdur:82000000 q:26.62 tex:110242 mv:7981 misc:1361 imb:30 pmb:863 smb:457 d:- ref:0 ; in:3388 out:3388 type:P dur:82000000 cpbdur:82000000 q:27.18 tex:155904 mv:10710 misc:1426 imb:49 pmb:982 smb:319 d:- ref:0 ; in:3389 out:3389 type:P dur:82000000 cpbdur:82000000 q:26.58 tex:100597 mv:7198 misc:1389 imb:21 pmb:776 smb:553 d:- ref:0 ; in:3390 out:3390 type:P dur:82000000 cpbdur:82000000 q:26.08 tex:107013 mv:6671 misc:1460 imb:12 pmb:795 smb:543 d:- ref:0 ; in:3391 out:3391 type:P dur:82000000 cpbdur:82000000 q:26.92 tex:146579 mv:9650 misc:1363 imb:42 pmb:784 smb:524 d:- ref:0 ; in:3392 out:3392 type:P dur:82000000 cpbdur:82000000 q:26.51 tex:92603 mv:6350 misc:1351 imb:13 pmb:678 smb:659 d:- ref:0 ; in:3393 out:3393 type:P dur:82000000 cpbdur:82000000 q:26.04 tex:105990 mv:6700 misc:1430 imb:19 pmb:792 smb:539 d:- ref:0 ; in:3394 out:3394 type:P dur:82000000 cpbdur:82000000 q:27.10 tex:164898 mv:11475 misc:1395 imb:62 pmb:983 smb:305 d:- ref:0 ; in:3395 out:3395 type:P dur:82000000 cpbdur:82000000 q:26.99 tex:137523 mv:9281 misc:1404 imb:36 pmb:973 smb:341 d:- ref:0 ; in:3396 out:3396 type:P dur:82000000 cpbdur:82000000 q:26.55 tex:99909 mv:7079 misc:1348 imb:21 pmb:757 smb:572 d:- ref:0 ; in:3397 out:3397 type:P dur:82000000 cpbdur:82000000 q:27.00 tex:143242 mv:9642 misc:1356 imb:51 pmb:798 smb:501 d:- ref:0 ; in:3398 out:3398 type:P dur:82000000 cpbdur:82000000 q:26.88 tex:128929 mv:9146 misc:1445 imb:30 pmb:970 smb:350 d:- ref:0 ; in:3399 out:3399 type:P dur:82000000 cpbdur:82000000 q:26.72 tex:113537 mv:8929 misc:1446 imb:29 pmb:919 smb:402 d:- ref:0 ; in:3400 out:3400 type:P dur:82000000 cpbdur:82000000 q:27.23 tex:164021 mv:11633 misc:1434 imb:79 pmb:1003 smb:268 d:- ref:0 ; in:3401 out:3401 type:P dur:82000000 cpbdur:82000000 q:26.98 tex:134936 mv:9525 misc:1443 imb:54 pmb:995 smb:301 d:- ref:0 ; in:3402 out:3402 type:P dur:82000000 cpbdur:82000000 q:27.04 tex:143122 mv:10245 misc:1441 imb:50 pmb:1041 smb:259 d:- ref:0 ; in:3403 out:3403 type:P dur:82000000 cpbdur:82000000 q:27.17 tex:142295 mv:9593 misc:1408 imb:46 pmb:875 smb:429 d:- ref:0 ; in:3404 out:3404 type:P dur:82000000 cpbdur:82000000 q:26.55 tex:95812 mv:6687 misc:1365 imb:12 pmb:755 smb:583 d:- ref:0 ; in:3405 out:3405 type:P dur:82000000 cpbdur:82000000 q:26.19 tex:112362 mv:7282 misc:1460 imb:22 pmb:888 smb:440 d:- ref:0 ; in:3406 out:3406 type:P dur:82000000 cpbdur:82000000 q:27.00 tex:160685 mv:11347 misc:1440 imb:73 pmb:989 smb:288 d:- ref:0 ; in:3407 out:3407 type:P dur:82000000 cpbdur:82000000 q:26.48 tex:120654 mv:6906 misc:1440 imb:21 pmb:836 smb:493 d:- ref:0 ; in:3408 out:3408 type:P dur:82000000 cpbdur:82000000 q:26.56 tex:125008 mv:9339 misc:1453 imb:56 pmb:961 smb:333 d:- ref:0 ; in:3409 out:3409 type:P dur:82000000 cpbdur:82000000 q:26.87 tex:138237 mv:9363 misc:1400 imb:48 pmb:869 smb:433 d:- ref:0 ; in:3410 out:3410 type:P dur:82000000 cpbdur:82000000 q:26.89 tex:141558 mv:9970 misc:1408 imb:51 pmb:994 smb:305 d:- ref:0 ; in:3411 out:3411 type:P dur:82000000 cpbdur:82000000 q:26.74 tex:121088 mv:8357 misc:1403 imb:30 pmb:909 smb:411 d:- ref:0 ; in:3412 out:3412 type:P dur:82000000 cpbdur:82000000 q:27.07 tex:145616 mv:10099 misc:1405 imb:54 pmb:905 smb:391 d:- ref:0 ; in:3413 out:3413 type:P dur:82000000 cpbdur:82000000 q:26.66 tex:104177 mv:7098 misc:1389 imb:20 pmb:802 smb:528 d:- ref:0 ; in:3414 out:3414 type:P dur:82000000 cpbdur:82000000 q:26.40 tex:132913 mv:8034 misc:1469 imb:39 pmb:960 smb:351 d:- ref:0 ; in:3415 out:3415 type:P dur:82000000 cpbdur:82000000 q:27.23 tex:170989 mv:12191 misc:1452 imb:72 pmb:1075 smb:203 d:- ref:0 ; in:3416 out:3416 type:P dur:82000000 cpbdur:82000000 q:27.08 tex:137937 mv:9607 misc:1432 imb:53 pmb:1019 smb:278 d:- ref:0 ; in:3417 out:3417 type:P dur:82000000 cpbdur:82000000 q:26.69 tex:119529 mv:8093 misc:1426 imb:17 pmb:961 smb:372 d:- ref:0 ; in:3418 out:3418 type:P dur:82000000 cpbdur:82000000 q:27.25 tex:153349 mv:10877 misc:1414 imb:39 pmb:929 smb:382 d:- ref:0 ; in:3419 out:3419 type:P dur:82000000 cpbdur:82000000 q:26.86 tex:116099 mv:7879 misc:1438 imb:14 pmb:885 smb:451 d:- ref:0 ; in:3420 out:3420 type:P dur:82000000 cpbdur:82000000 q:26.37 tex:111163 mv:7037 misc:1448 imb:17 pmb:819 smb:514 d:- ref:0 ; in:3421 out:3421 type:P dur:82000000 cpbdur:82000000 q:27.02 tex:146848 mv:9962 misc:1398 imb:55 pmb:852 smb:443 d:- ref:0 ; in:3422 out:3422 type:P dur:82000000 cpbdur:82000000 q:26.79 tex:121113 mv:8011 misc:1428 imb:31 pmb:899 smb:420 d:- ref:0 ; in:3423 out:3423 type:P dur:82000000 cpbdur:82000000 q:26.81 tex:133407 mv:9092 misc:1405 imb:49 pmb:986 smb:315 d:- ref:0 ; in:3424 out:3424 type:P dur:82000000 cpbdur:82000000 q:27.38 tex:168654 mv:11690 misc:1440 imb:71 pmb:1014 smb:265 d:- ref:0 ; in:3425 out:3425 type:P dur:82000000 cpbdur:82000000 q:26.83 tex:104589 mv:7263 misc:1420 imb:25 pmb:867 smb:458 d:- ref:0 ; in:3426 out:3426 type:P dur:82000000 cpbdur:82000000 q:26.45 tex:127023 mv:7746 misc:1479 imb:27 pmb:950 smb:373 d:- ref:0 ; in:3427 out:3427 type:P dur:82000000 cpbdur:82000000 q:27.01 tex:144411 mv:9802 misc:1403 imb:48 pmb:840 smb:462 d:- ref:0 ; in:3428 out:3428 type:P dur:82000000 cpbdur:82000000 q:26.52 tex:91324 mv:6367 misc:1341 imb:20 pmb:653 smb:677 d:- ref:0 ; in:3429 out:3429 type:P dur:82000000 cpbdur:82000000 q:26.36 tex:134372 mv:8280 misc:1436 imb:26 pmb:992 smb:332 d:- ref:0 ; in:3430 out:3430 type:P dur:82000000 cpbdur:82000000 q:26.90 tex:144603 mv:9932 misc:1361 imb:50 pmb:838 smb:462 d:- ref:0 ; in:3431 out:3431 type:P dur:82000000 cpbdur:82000000 q:26.44 tex:113836 mv:7207 misc:1477 imb:25 pmb:875 smb:450 d:- ref:0 ; in:3432 out:3432 type:P dur:82000000 cpbdur:82000000 q:26.35 tex:125872 mv:8010 misc:1470 imb:38 pmb:922 smb:390 d:- ref:0 ; in:3433 out:3433 type:P dur:82000000 cpbdur:82000000 q:26.88 tex:137766 mv:9635 misc:1391 imb:58 pmb:803 smb:489 d:- ref:0 ; in:3434 out:3434 type:P dur:82000000 cpbdur:82000000 q:26.71 tex:108138 mv:7592 misc:1494 imb:33 pmb:844 smb:473 d:- ref:0 ; in:3435 out:3435 type:P dur:82000000 cpbdur:82000000 q:26.46 tex:130316 mv:8151 misc:1461 imb:31 pmb:959 smb:360 d:- ref:0 ; in:3436 out:3436 type:P dur:82000000 cpbdur:82000000 q:26.90 tex:142819 mv:10295 misc:1422 imb:54 pmb:923 smb:373 d:- ref:0 ; in:3437 out:3437 type:P dur:82000000 cpbdur:82000000 q:26.59 tex:111047 mv:7935 misc:1434 imb:15 pmb:917 smb:418 d:- ref:0 ; in:3438 out:3438 type:P dur:82000000 cpbdur:82000000 q:26.76 tex:137799 mv:9383 misc:1418 imb:37 pmb:997 smb:316 d:- ref:0 ; in:3439 out:3439 type:P dur:82000000 cpbdur:82000000 q:27.12 tex:151163 mv:10305 misc:1428 imb:62 pmb:935 smb:353 d:- ref:0 ; in:3440 out:3440 type:P dur:82000000 cpbdur:82000000 q:26.66 tex:101570 mv:6798 misc:1328 imb:15 pmb:734 smb:601 d:- ref:0 ; in:3441 out:3441 type:P dur:82000000 cpbdur:82000000 q:26.19 tex:106729 mv:6679 misc:1424 imb:14 pmb:789 smb:547 d:- ref:0 ; in:3442 out:3442 type:P dur:82000000 cpbdur:82000000 q:26.90 tex:156163 mv:10791 misc:1422 imb:74 pmb:957 smb:319 d:- ref:0 ; in:3443 out:3443 type:P dur:82000000 cpbdur:82000000 q:26.57 tex:104809 mv:7460 misc:1387 imb:19 pmb:834 smb:497 d:- ref:0 ; in:3444 out:3444 type:P dur:82000000 cpbdur:82000000 q:26.32 tex:120831 mv:7682 misc:1471 imb:15 pmb:920 smb:415 d:- ref:0 ; in:3445 out:3445 type:P dur:82000000 cpbdur:82000000 q:26.78 tex:133500 mv:9498 misc:1402 imb:52 pmb:820 smb:478 d:- ref:0 ; in:3446 out:3446 type:P dur:82000000 cpbdur:82000000 q:26.43 tex:124502 mv:7454 misc:1436 imb:21 pmb:892 smb:437 d:- ref:0 ; in:3447 out:3447 type:P dur:82000000 cpbdur:82000000 q:26.20 tex:111196 mv:7345 misc:1395 imb:18 pmb:815 smb:517 d:- ref:0 ; in:3448 out:3448 type:P dur:82000000 cpbdur:82000000 q:26.91 tex:138142 mv:10102 misc:1356 imb:49 pmb:830 smb:471 d:- ref:0 ; in:3449 out:3449 type:P dur:82000000 cpbdur:82000000 q:26.51 tex:106175 mv:7550 misc:1371 imb:24 pmb:840 smb:486 d:- ref:0 ; in:3450 out:3450 type:P dur:82000000 cpbdur:82000000 q:26.10 tex:107531 mv:7022 misc:1423 imb:23 pmb:790 smb:537 d:- ref:0 ; in:3451 out:3451 type:P dur:82000000 cpbdur:82000000 q:26.67 tex:131494 mv:9064 misc:1234 imb:39 pmb:716 smb:595 d:- ref:0 ; in:3452 out:3452 type:P dur:82000000 cpbdur:82000000 q:26.17 tex:106998 mv:6693 misc:1437 imb:11 pmb:807 smb:532 d:- ref:0 ; in:3453 out:3453 type:P dur:82000000 cpbdur:82000000 q:26.56 tex:128726 mv:9099 misc:1415 imb:41 pmb:955 smb:354 d:- ref:0 ; in:3454 out:3454 type:P dur:82000000 cpbdur:82000000 q:27.21 tex:155508 mv:10701 misc:1407 imb:44 pmb:931 smb:375 d:- ref:0 ; in:3455 out:3455 type:P dur:82000000 cpbdur:82000000 q:26.81 tex:122835 mv:7954 misc:1403 imb:22 pmb:950 smb:378 d:- ref:0 ; in:3456 out:3456 type:P dur:82000000 cpbdur:82000000 q:26.85 tex:135522 mv:9331 misc:1459 imb:43 pmb:1017 smb:290 d:- ref:0 ; in:3457 out:3457 type:P dur:82000000 cpbdur:82000000 q:27.22 tex:158091 mv:10659 misc:1426 imb:73 pmb:951 smb:326 d:- ref:0 ; in:3458 out:3458 type:P dur:82000000 cpbdur:82000000 q:26.98 tex:129669 mv:8618 misc:1433 imb:27 pmb:942 smb:381 d:- ref:0 ; in:3459 out:3459 type:P dur:82000000 cpbdur:82000000 q:26.27 tex:100006 mv:6545 misc:1441 imb:16 pmb:741 smb:593 d:- ref:0 ; in:3460 out:3460 type:P dur:82000000 cpbdur:82000000 q:27.13 tex:175001 mv:12142 misc:1425 imb:88 pmb:1012 smb:250 d:- ref:0 ; in:3461 out:3461 type:P dur:82000000 cpbdur:82000000 q:27.20 tex:154010 mv:10840 misc:1438 imb:68 pmb:1050 smb:232 d:- ref:0 ; in:3462 out:3462 type:P dur:82000000 cpbdur:82000000 q:27.10 tex:139027 mv:9368 misc:1437 imb:49 pmb:1010 smb:291 d:- ref:0 ; in:3463 out:3463 type:P dur:82000000 cpbdur:82000000 q:27.67 tex:155374 mv:12658 misc:1432 imb:72 pmb:1024 smb:254 d:- ref:0 ; in:3464 out:3464 type:P dur:82000000 cpbdur:82000000 q:27.37 tex:155184 mv:10919 misc:1473 imb:81 pmb:1099 smb:170 d:- ref:0 ; in:3465 out:3465 type:P dur:82000000 cpbdur:82000000 q:27.18 tex:129419 mv:9744 misc:1493 imb:38 pmb:1068 smb:244 d:- ref:0 ; in:3466 out:3466 type:P dur:82000000 cpbdur:82000000 q:27.54 tex:148635 mv:11640 misc:1461 imb:50 pmb:986 smb:314 d:- ref:0 ; in:3467 out:3467 type:P dur:82000000 cpbdur:82000000 q:27.28 tex:156540 mv:10817 misc:1475 imb:69 pmb:1099 smb:182 d:- ref:0 ; in:3468 out:3468 type:P dur:82000000 cpbdur:82000000 q:27.05 tex:133447 mv:9301 misc:1468 imb:32 pmb:997 smb:321 d:- ref:0 ; in:3469 out:3469 type:P dur:82000000 cpbdur:82000000 q:27.42 tex:166012 mv:11497 misc:1435 imb:73 pmb:985 smb:292 d:- ref:0 ; in:3470 out:3470 type:P dur:82000000 cpbdur:82000000 q:26.78 tex:98055 mv:6872 misc:1409 imb:30 pmb:728 smb:592 d:- ref:0 ; in:3471 out:3471 type:P dur:82000000 cpbdur:82000000 q:26.43 tex:124292 mv:8324 misc:1496 imb:50 pmb:938 smb:362 d:- ref:0 ; in:3472 out:3472 type:P dur:82000000 cpbdur:82000000 q:26.98 tex:151972 mv:10975 misc:1437 imb:84 pmb:937 smb:329 d:- ref:0 ; in:3473 out:3473 type:P dur:82000000 cpbdur:82000000 q:26.77 tex:121160 mv:8970 misc:1494 imb:45 pmb:934 smb:371 d:- ref:0 ; in:3474 out:3474 type:P dur:82000000 cpbdur:82000000 q:26.22 tex:114473 mv:7526 misc:1505 imb:24 pmb:910 smb:416 d:- ref:0 ; in:3475 out:3475 type:P dur:82000000 cpbdur:82000000 q:26.79 tex:137765 mv:10708 misc:1423 imb:80 pmb:856 smb:414 d:- ref:0 ; in:3476 out:3476 type:P dur:82000000 cpbdur:82000000 q:26.45 tex:122687 mv:7919 misc:1442 imb:30 pmb:925 smb:395 d:- ref:0 ; in:3477 out:3477 type:P dur:82000000 cpbdur:82000000 q:26.88 tex:132211 mv:10491 misc:1466 imb:124 pmb:923 smb:303 d:- ref:0 ; in:3478 out:3478 type:P dur:82000000 cpbdur:82000000 q:27.02 tex:140567 mv:10879 misc:1434 imb:75 pmb:933 smb:342 d:- ref:0 ; in:3479 out:3479 type:P dur:82000000 cpbdur:82000000 q:27.03 tex:124346 mv:9904 misc:1430 imb:151 pmb:762 smb:437 d:- ref:0 ; in:3480 out:3480 type:P dur:82000000 cpbdur:82000000 q:26.43 tex:114453 mv:7867 misc:1472 imb:38 pmb:945 smb:367 d:- ref:0 ; in:3481 out:3481 type:P dur:82000000 cpbdur:82000000 q:27.42 tex:163700 mv:12618 misc:1410 imb:255 pmb:784 smb:311 d:- ref:0 ; in:3482 out:3482 type:P dur:82000000 cpbdur:82000000 q:26.76 tex:94763 mv:6806 misc:1367 imb:35 pmb:690 smb:625 d:- ref:0 ; in:3483 out:3483 type:P dur:82000000 cpbdur:82000000 q:27.26 tex:155005 mv:10866 misc:1417 imb:157 pmb:850 smb:343 d:- ref:0 ; in:3484 out:3484 type:P dur:82000000 cpbdur:82000000 q:27.43 tex:145161 mv:11942 misc:1393 imb:87 pmb:862 smb:401 d:- ref:0 ; in:3485 out:3485 type:P dur:82000000 cpbdur:82000000 q:27.34 tex:149940 mv:9034 misc:1418 imb:107 pmb:796 smb:447 d:- ref:0 ; in:3486 out:3486 type:P dur:82000000 cpbdur:82000000 q:26.52 tex:85720 mv:6363 misc:1341 imb:21 pmb:647 smb:682 d:- ref:0 ; in:3487 out:3487 type:P dur:82000000 cpbdur:82000000 q:27.50 tex:172020 mv:14274 misc:1434 imb:168 pmb:888 smb:294 d:- ref:0 ; in:3488 out:3488 type:P dur:82000000 cpbdur:82000000 q:26.90 tex:125936 mv:8914 misc:1494 imb:77 pmb:974 smb:299 d:- ref:0 ; in:3489 out:3489 type:P dur:82000000 cpbdur:82000000 q:26.51 tex:118527 mv:8873 misc:1432 imb:46 pmb:927 smb:377 d:- ref:0 ; in:3490 out:3490 type:P dur:82000000 cpbdur:82000000 q:27.29 tex:166788 mv:13632 misc:1436 imb:134 pmb:934 smb:282 d:- ref:0 ; in:3491 out:3491 type:P dur:82000000 cpbdur:82000000 q:26.67 tex:112403 mv:8527 misc:1422 imb:45 pmb:891 smb:414 d:- ref:0 ; in:3492 out:3492 type:P dur:82000000 cpbdur:82000000 q:26.13 tex:110138 mv:7659 misc:1483 imb:39 pmb:895 smb:416 d:- ref:0 ; in:3493 out:3493 type:P dur:82000000 cpbdur:82000000 q:27.32 tex:181214 mv:14484 misc:1406 imb:210 pmb:956 smb:184 d:- ref:0 ; in:3494 out:3494 type:P dur:82000000 cpbdur:82000000 q:26.66 tex:107317 mv:8130 misc:1425 imb:58 pmb:852 smb:440 d:- ref:0 ; in:3495 out:3495 type:P dur:82000000 cpbdur:82000000 q:26.19 tex:115397 mv:7993 misc:1466 imb:64 pmb:949 smb:337 d:- ref:0 ; in:3496 out:3496 type:P dur:82000000 cpbdur:82000000 q:27.14 tex:162405 mv:13807 misc:1420 imb:128 pmb:919 smb:303 d:- ref:0 ; in:3497 out:3497 type:P dur:82000000 cpbdur:82000000 q:26.29 tex:106289 mv:7568 misc:1423 imb:23 pmb:898 smb:429 d:- ref:0 ; in:3498 out:3498 type:P dur:82000000 cpbdur:82000000 q:26.07 tex:117951 mv:8858 misc:1423 imb:52 pmb:928 smb:370 d:- ref:0 ; in:3499 out:3499 type:P dur:82000000 cpbdur:82000000 q:26.93 tex:152361 mv:12688 misc:1407 imb:96 pmb:884 smb:370 d:- ref:0 ; in:3500 out:3500 type:I dur:82000000 cpbdur:82000000 q:23.90 tex:489599 mv:14286 misc:371 imb:1350 pmb:0 smb:0 d:- ref:; in:3501 out:3501 type:P dur:82000000 cpbdur:82000000 q:28.75 tex:43527 mv:5237 misc:772 imb:3 pmb:381 smb:966 d:- ref:0 ; in:3502 out:3502 type:P dur:82000000 cpbdur:82000000 q:28.23 tex:129119 mv:12020 misc:1405 imb:111 pmb:836 smb:403 d:- ref:0 ; in:3503 out:3503 type:P dur:82000000 cpbdur:82000000 q:27.19 tex:93706 mv:7496 misc:1422 imb:17 pmb:838 smb:495 d:- ref:0 ; in:3504 out:3504 type:P dur:82000000 cpbdur:82000000 q:26.31 tex:99531 mv:7378 misc:1395 imb:32 pmb:828 smb:490 d:- ref:0 ; in:3505 out:3505 type:P dur:82000000 cpbdur:82000000 q:26.88 tex:145114 mv:12280 misc:1414 imb:86 pmb:882 smb:382 d:- ref:0 ; in:3506 out:3506 type:P dur:82000000 cpbdur:82000000 q:26.37 tex:118258 mv:8280 misc:1414 imb:51 pmb:916 smb:383 d:- ref:0 ; in:3507 out:3507 type:P dur:82000000 cpbdur:82000000 q:26.06 tex:113163 mv:8323 misc:1402 imb:39 pmb:879 smb:432 d:- ref:0 ; in:3508 out:3508 type:P dur:82000000 cpbdur:82000000 q:26.84 tex:150101 mv:13316 misc:1399 imb:135 pmb:924 smb:291 d:- ref:0 ; in:3509 out:3509 type:P dur:82000000 cpbdur:82000000 q:26.47 tex:127346 mv:9330 misc:1420 imb:46 pmb:946 smb:358 d:- ref:0 ; in:3510 out:3510 type:P dur:82000000 cpbdur:82000000 q:26.26 tex:124388 mv:8821 misc:1383 imb:42 pmb:881 smb:427 d:- ref:0 ; in:3511 out:3511 type:P dur:82000000 cpbdur:82000000 q:26.94 tex:146768 mv:11921 misc:1391 imb:113 pmb:831 smb:406 d:- ref:0 ; in:3512 out:3512 type:P dur:82000000 cpbdur:82000000 q:26.35 tex:112623 mv:7677 misc:1420 imb:23 pmb:885 smb:442 d:- ref:0 ; in:3513 out:3513 type:P dur:82000000 cpbdur:82000000 q:26.01 tex:102326 mv:7167 misc:1355 imb:23 pmb:781 smb:546 d:- ref:0 ; in:3514 out:3514 type:P dur:82000000 cpbdur:82000000 q:27.14 tex:165740 mv:13594 misc:1402 imb:114 pmb:918 smb:318 d:- ref:0 ; in:3515 out:3515 type:P dur:82000000 cpbdur:82000000 q:26.33 tex:99274 mv:6660 misc:1394 imb:15 pmb:748 smb:587 d:- ref:0 ; in:3516 out:3516 type:P dur:82000000 cpbdur:82000000 q:25.77 tex:85481 mv:6180 misc:1227 imb:9 pmb:576 smb:765 d:- ref:0 ; in:3517 out:3517 type:P dur:82000000 cpbdur:82000000 q:27.09 tex:164311 mv:12953 misc:1368 imb:143 pmb:805 smb:402 d:- ref:0 ; in:3518 out:3518 type:P dur:82000000 cpbdur:82000000 q:26.29 tex:100574 mv:6809 misc:1409 imb:24 pmb:781 smb:545 d:- ref:0 ; in:3519 out:3519 type:P dur:82000000 cpbdur:82000000 q:25.93 tex:101817 mv:7461 misc:1410 imb:36 pmb:825 smb:489 d:- ref:0 ; in:3520 out:3520 type:P dur:82000000 cpbdur:82000000 q:27.18 tex:167748 mv:12873 misc:1403 imb:111 pmb:841 smb:398 d:- ref:0 ; in:3521 out:3521 type:P dur:82000000 cpbdur:82000000 q:26.33 tex:102956 mv:6857 misc:1435 imb:25 pmb:821 smb:504 d:- ref:0 ; in:3522 out:3522 type:P dur:82000000 cpbdur:82000000 q:26.02 tex:112124 mv:7879 misc:1445 imb:31 pmb:853 smb:466 d:- ref:0 ; in:3523 out:3523 type:P dur:82000000 cpbdur:82000000 q:27.23 tex:173463 mv:13573 misc:1452 imb:113 pmb:925 smb:312 d:- ref:0 ; in:3524 out:3524 type:P dur:82000000 cpbdur:82000000 q:26.66 tex:101058 mv:7770 misc:1452 imb:36 pmb:878 smb:436 d:- ref:0 ; in:3525 out:3525 type:P dur:82000000 cpbdur:82000000 q:26.21 tex:122958 mv:7934 misc:1468 imb:31 pmb:940 smb:379 d:- ref:0 ; in:3526 out:3526 type:P dur:82000000 cpbdur:82000000 q:27.68 tex:191401 mv:15402 misc:1453 imb:242 pmb:908 smb:200 d:- ref:0 ; in:3527 out:3527 type:P dur:82000000 cpbdur:82000000 q:26.93 tex:117468 mv:8198 misc:1462 imb:44 pmb:940 smb:366 d:- ref:0 ; in:3528 out:3528 type:P dur:82000000 cpbdur:82000000 q:26.32 tex:110222 mv:7483 misc:1471 imb:34 pmb:909 smb:407 d:- ref:0 ; in:3529 out:3529 type:P dur:82000000 cpbdur:82000000 q:27.54 tex:181902 mv:14714 misc:1448 imb:199 pmb:886 smb:265 d:- ref:0 ; in:3530 out:3530 type:P dur:82000000 cpbdur:82000000 q:26.68 tex:100736 mv:7362 misc:1486 imb:47 pmb:860 smb:443 d:- ref:0 ; in:3531 out:3531 type:P dur:82000000 cpbdur:82000000 q:25.92 tex:100226 mv:7006 misc:1504 imb:14 pmb:884 smb:452 d:- ref:0 ; in:3532 out:3532 type:P dur:82000000 cpbdur:82000000 q:27.57 tex:185391 mv:14967 misc:1450 imb:182 pmb:959 smb:209 d:- ref:0 ; in:3533 out:3533 type:P dur:82000000 cpbdur:82000000 q:26.91 tex:126060 mv:9375 misc:1461 imb:61 pmb:1025 smb:264 d:- ref:0 ; in:3534 out:3534 type:P dur:82000000 cpbdur:82000000 q:26.44 tex:128307 mv:8268 misc:1481 imb:28 pmb:972 smb:350 d:- ref:0 ; in:3535 out:3535 type:P dur:82000000 cpbdur:82000000 q:27.91 tex:190549 mv:15032 misc:1475 imb:179 pmb:926 smb:245 d:- ref:0 ; in:3536 out:3536 type:P dur:82000000 cpbdur:82000000 q:27.06 tex:115843 mv:7743 misc:1470 imb:30 pmb:935 smb:385 d:- ref:0 ; in:3537 out:3537 type:P dur:82000000 cpbdur:82000000 q:26.79 tex:128376 mv:9497 misc:1455 imb:45 pmb:1009 smb:296 d:- ref:0 ; in:3538 out:3538 type:P dur:82000000 cpbdur:82000000 q:28.18 tex:213375 mv:16664 misc:1449 imb:211 pmb:978 smb:161 d:- ref:0 ; in:3539 out:3539 type:P dur:82000000 cpbdur:82000000 q:27.36 tex:131960 mv:8904 misc:1464 imb:45 pmb:1018 smb:287 d:- ref:0 ; in:3540 out:3540 type:P dur:82000000 cpbdur:82000000 q:26.74 tex:107298 mv:8205 misc:1457 imb:29 pmb:901 smb:420 d:- ref:0 ; in:3541 out:3541 type:P dur:82000000 cpbdur:82000000 q:28.17 tex:216406 mv:16316 misc:1454 imb:270 pmb:962 smb:118 d:- ref:0 ; in:3542 out:3542 type:P dur:82000000 cpbdur:82000000 q:27.40 tex:136962 mv:10222 misc:1464 imb:56 pmb:1052 smb:242 d:- ref:0 ; in:3543 out:3543 type:P dur:82000000 cpbdur:82000000 q:26.96 tex:128952 mv:10148 misc:1452 imb:56 pmb:1008 smb:286 d:- ref:0 ; in:3544 out:3544 type:P dur:82000000 cpbdur:82000000 q:28.24 tex:216842 mv:16778 misc:1452 imb:260 pmb:950 smb:140 d:- ref:0 ; in:3545 out:3545 type:P dur:82000000 cpbdur:82000000 q:27.11 tex:105354 mv:7646 misc:1496 imb:24 pmb:946 smb:380 d:- ref:0 ; in:3546 out:3546 type:P dur:82000000 cpbdur:82000000 q:26.37 tex:116126 mv:7673 misc:1529 imb:54 pmb:975 smb:321 d:- ref:0 ; in:3547 out:3547 type:P dur:82000000 cpbdur:82000000 q:28.20 tex:231638 mv:16260 misc:1454 imb:306 pmb:940 smb:104 d:- ref:0 ; in:3548 out:3548 type:P dur:82000000 cpbdur:82000000 q:27.39 tex:127894 mv:9566 misc:1476 imb:54 pmb:1062 smb:234 d:- ref:0 ; in:3549 out:3549 type:P dur:82000000 cpbdur:82000000 q:26.68 tex:105298 mv:8189 misc:1465 imb:37 pmb:927 smb:386 d:- ref:0 ; in:3550 out:3550 type:P dur:82000000 cpbdur:82000000 q:27.98 tex:203306 mv:15511 misc:1439 imb:236 pmb:943 smb:171 d:- ref:0 ; in:3551 out:3551 type:P dur:82000000 cpbdur:82000000 q:26.98 tex:104875 mv:7461 misc:1504 imb:26 pmb:941 smb:383 d:- ref:0 ; in:3552 out:3552 type:P dur:82000000 cpbdur:82000000 q:26.19 tex:115860 mv:7547 misc:1497 imb:25 pmb:951 smb:374 d:- ref:0 ; in:3553 out:3553 type:P dur:82000000 cpbdur:82000000 q:27.77 tex:192905 mv:14655 misc:1464 imb:172 pmb:933 smb:245 d:- ref:0 ; in:3554 out:3554 type:P dur:82000000 cpbdur:82000000 q:26.90 tex:110964 mv:8104 misc:1508 imb:33 pmb:1008 smb:309 d:- ref:0 ; in:3555 out:3555 type:P dur:82000000 cpbdur:82000000 q:26.06 tex:106147 mv:7462 misc:1511 imb:46 pmb:944 smb:360 d:- ref:0 ; in:3556 out:3556 type:P dur:82000000 cpbdur:82000000 q:27.79 tex:192037 mv:14910 misc:1469 imb:175 pmb:970 smb:205 d:- ref:0 ; in:3557 out:3557 type:P dur:82000000 cpbdur:82000000 q:26.94 tex:107291 mv:7579 misc:1474 imb:27 pmb:1015 smb:308 d:- ref:0 ; in:3558 out:3558 type:P dur:82000000 cpbdur:82000000 q:26.55 tex:112340 mv:8250 misc:1458 imb:42 pmb:964 smb:344 d:- ref:0 ; in:3559 out:3559 type:P dur:82000000 cpbdur:82000000 q:28.01 tex:204860 mv:14709 misc:1447 imb:194 pmb:933 smb:223 d:- ref:0 ; in:3560 out:3560 type:P dur:82000000 cpbdur:82000000 q:27.26 tex:131885 mv:9050 misc:1481 imb:50 pmb:1058 smb:242 d:- ref:0 ; in:3561 out:3561 type:P dur:82000000 cpbdur:82000000 q:26.68 tex:103808 mv:8141 misc:1475 imb:26 pmb:935 smb:389 d:- ref:0 ; in:3562 out:3562 type:P dur:82000000 cpbdur:82000000 q:27.84 tex:185151 mv:14637 misc:1452 imb:159 pmb:1015 smb:176 d:- ref:0 ; in:3563 out:3563 type:P dur:82000000 cpbdur:82000000 q:26.97 tex:117705 mv:8361 misc:1526 imb:46 pmb:1017 smb:287 d:- ref:0 ; in:3564 out:3564 type:P dur:82000000 cpbdur:82000000 q:26.42 tex:124674 mv:8423 misc:1511 imb:32 pmb:1013 smb:305 d:- ref:0 ; in:3565 out:3565 type:P dur:82000000 cpbdur:82000000 q:27.52 tex:166144 mv:13313 misc:1455 imb:145 pmb:949 smb:256 d:- ref:0 ; in:3566 out:3566 type:P dur:82000000 cpbdur:82000000 q:26.64 tex:99704 mv:7672 misc:1480 imb:32 pmb:962 smb:356 d:- ref:0 ; in:3567 out:3567 type:P dur:82000000 cpbdur:82000000 q:26.40 tex:144681 mv:9851 misc:1452 imb:75 pmb:1049 smb:226 d:- ref:0 ; in:3568 out:3568 type:P dur:82000000 cpbdur:82000000 q:27.35 tex:176928 mv:14141 misc:1451 imb:170 pmb:959 smb:221 d:- ref:0 ; in:3569 out:3569 type:P dur:82000000 cpbdur:82000000 q:26.56 tex:87239 mv:6912 misc:1449 imb:21 pmb:784 smb:545 d:- ref:0 ; in:3570 out:3570 type:P dur:82000000 cpbdur:82000000 q:26.23 tex:129747 mv:9070 misc:1495 imb:52 pmb:1000 smb:298 d:- ref:0 ; in:3571 out:3571 type:P dur:82000000 cpbdur:82000000 q:27.26 tex:181792 mv:13769 misc:1455 imb:217 pmb:941 smb:192 d:- ref:0 ; in:3572 out:3572 type:P dur:82000000 cpbdur:82000000 q:26.98 tex:127433 mv:10050 misc:1445 imb:60 pmb:996 smb:294 d:- ref:0 ; in:3573 out:3573 type:P dur:82000000 cpbdur:82000000 q:26.62 tex:110162 mv:9365 misc:1441 imb:55 pmb:953 smb:342 d:- ref:0 ; in:3574 out:3574 type:P dur:82000000 cpbdur:82000000 q:27.30 tex:170784 mv:13640 misc:1448 imb:138 pmb:974 smb:238 d:- ref:0 ; in:3575 out:3575 type:P dur:82000000 cpbdur:82000000 q:26.73 tex:104189 mv:8588 misc:1471 imb:45 pmb:954 smb:351 d:- ref:0 ; in:3576 out:3576 type:P dur:82000000 cpbdur:82000000 q:26.36 tex:125537 mv:8742 misc:1433 imb:60 pmb:974 smb:316 d:- ref:0 ; in:3577 out:3577 type:P dur:82000000 cpbdur:82000000 q:27.04 tex:161702 mv:13574 misc:1444 imb:162 pmb:962 smb:226 d:- ref:0 ; in:3578 out:3578 type:P dur:82000000 cpbdur:82000000 q:26.57 tex:106922 mv:8372 misc:1458 imb:39 pmb:864 smb:447 d:- ref:0 ; in:3579 out:3579 type:P dur:82000000 cpbdur:82000000 q:25.85 tex:91598 mv:7134 misc:1484 imb:26 pmb:820 smb:504 d:- ref:0 ; in:3580 out:3580 type:P dur:82000000 cpbdur:82000000 q:26.64 tex:149380 mv:11897 misc:1451 imb:131 pmb:853 smb:366 d:- ref:0 ; in:3581 out:3581 type:P dur:82000000 cpbdur:82000000 q:26.17 tex:113604 mv:8277 misc:1463 imb:58 pmb:941 smb:351 d:- ref:0 ; in:3582 out:3582 type:P dur:82000000 cpbdur:82000000 q:26.07 tex:127686 mv:9041 misc:1409 imb:70 pmb:925 smb:355 d:- ref:0 ; in:3583 out:3583 type:P dur:82000000 cpbdur:82000000 q:26.68 tex:144840 mv:11933 misc:1451 imb:117 pmb:923 smb:310 d:- ref:0 ; in:3584 out:3584 type:P dur:82000000 cpbdur:82000000 q:26.16 tex:103654 mv:7941 misc:1485 imb:42 pmb:895 smb:413 d:- ref:0 ; in:3585 out:3585 type:P dur:82000000 cpbdur:82000000 q:25.57 tex:78170 mv:6069 misc:1265 imb:15 pmb:569 smb:766 d:- ref:0 ; in:3586 out:3586 type:P dur:82000000 cpbdur:82000000 q:26.41 tex:170616 mv:12135 misc:1465 imb:138 pmb:971 smb:241 d:- ref:0 ; in:3587 out:3587 type:P dur:82000000 cpbdur:82000000 q:26.04 tex:102810 mv:7603 misc:1395 imb:23 pmb:835 smb:492 d:- ref:0 ; in:3588 out:3588 type:P dur:82000000 cpbdur:82000000 q:25.67 tex:87232 mv:6960 misc:1424 imb:35 pmb:712 smb:603 d:- ref:0 ; in:3589 out:3589 type:P dur:82000000 cpbdur:82000000 q:26.44 tex:158804 mv:11438 misc:1478 imb:192 pmb:946 smb:212 d:- ref:0 ; in:3590 out:3590 type:P dur:82000000 cpbdur:82000000 q:26.38 tex:130091 mv:11629 misc:1504 imb:143 pmb:979 smb:228 d:- ref:0 ; in:3591 out:3591 type:P dur:82000000 cpbdur:82000000 q:25.96 tex:97342 mv:8288 misc:1458 imb:57 pmb:880 smb:413 d:- ref:0 ; in:3592 out:3592 type:P dur:82000000 cpbdur:82000000 q:26.54 tex:142857 mv:11720 misc:1447 imb:172 pmb:920 smb:258 d:- ref:0 ; in:3593 out:3593 type:P dur:82000000 cpbdur:82000000 q:25.87 tex:95548 mv:7280 misc:1452 imb:27 pmb:852 smb:471 d:- ref:0 ; in:3594 out:3594 type:P dur:82000000 cpbdur:82000000 q:26.06 tex:128614 mv:10185 misc:1449 imb:81 pmb:955 smb:314 d:- ref:0 ; in:3595 out:3595 type:P dur:82000000 cpbdur:82000000 q:26.63 tex:141285 mv:12259 misc:1488 imb:229 pmb:979 smb:142 d:- ref:0 ; in:3596 out:3596 type:P dur:82000000 cpbdur:82000000 q:26.47 tex:138293 mv:10083 misc:1456 imb:87 pmb:981 smb:282 d:- ref:0 ; in:3597 out:3597 type:P dur:82000000 cpbdur:82000000 q:26.29 tex:116657 mv:9335 misc:1464 imb:88 pmb:909 smb:353 d:- ref:0 ; in:3598 out:3598 type:P dur:82000000 cpbdur:82000000 q:26.77 tex:151285 mv:12478 misc:1485 imb:170 pmb:984 smb:196 d:- ref:0 ; in:3599 out:3599 type:P dur:82000000 cpbdur:82000000 q:26.31 tex:121249 mv:8215 misc:1472 imb:44 pmb:905 smb:401 d:- ref:0 ; in:3600 out:3600 type:P dur:82000000 cpbdur:82000000 q:26.14 tex:125855 mv:8722 misc:1399 imb:54 pmb:888 smb:408 d:- ref:0 ; in:3601 out:3601 type:P dur:82000000 cpbdur:82000000 q:26.51 tex:134193 mv:10196 misc:1459 imb:140 pmb:870 smb:340 d:- ref:0 ; in:3602 out:3602 type:P dur:82000000 cpbdur:82000000 q:25.89 tex:97487 mv:6979 misc:1454 imb:30 pmb:787 smb:533 d:- ref:0 ; in:3603 out:3603 type:P dur:82000000 cpbdur:82000000 q:25.62 tex:93088 mv:6891 misc:1437 imb:23 pmb:743 smb:584 d:- ref:0 ; in:3604 out:3604 type:P dur:82000000 cpbdur:82000000 q:26.11 tex:143254 mv:10436 misc:1446 imb:147 pmb:864 smb:339 d:- ref:0 ; in:3605 out:3605 type:P dur:82000000 cpbdur:82000000 q:25.88 tex:99488 mv:7235 misc:1437 imb:21 pmb:827 smb:502 d:- ref:0 ; in:3606 out:3606 type:P dur:82000000 cpbdur:82000000 q:25.80 tex:110949 mv:8207 misc:1404 imb:46 pmb:855 smb:449 d:- ref:0 ; in:3607 out:3607 type:P dur:82000000 cpbdur:82000000 q:26.50 tex:141972 mv:10782 misc:1470 imb:130 pmb:918 smb:302 d:- ref:0 ; in:3608 out:3608 type:P dur:82000000 cpbdur:82000000 q:26.21 tex:118654 mv:8467 misc:1447 imb:42 pmb:925 smb:383 d:- ref:0 ; in:3609 out:3609 type:P dur:82000000 cpbdur:82000000 q:26.16 tex:129499 mv:9062 misc:1399 imb:58 pmb:870 smb:422 d:- ref:0 ; in:3610 out:3610 type:P dur:82000000 cpbdur:82000000 q:26.75 tex:148344 mv:10926 misc:1466 imb:111 pmb:918 smb:321 d:- ref:0 ; in:3611 out:3611 type:P dur:82000000 cpbdur:82000000 q:26.15 tex:104565 mv:7059 misc:1392 imb:24 pmb:767 smb:559 d:- ref:0 ; in:3612 out:3612 type:P dur:82000000 cpbdur:82000000 q:25.83 tex:93712 mv:7066 misc:1382 imb:17 pmb:716 smb:617 d:- ref:0 ; in:3613 out:3613 type:P dur:82000000 cpbdur:82000000 q:26.51 tex:145777 mv:10836 misc:1443 imb:152 pmb:908 smb:290 d:- ref:0 ; in:3614 out:3614 type:P dur:82000000 cpbdur:82000000 q:26.16 tex:113042 mv:8119 misc:1431 imb:44 pmb:887 smb:419 d:- ref:0 ; in:3615 out:3615 type:P dur:82000000 cpbdur:82000000 q:25.79 tex:95992 mv:7398 misc:1370 imb:34 pmb:748 smb:568 d:- ref:0 ; in:3616 out:3616 type:P dur:82000000 cpbdur:82000000 q:26.17 tex:139845 mv:10234 misc:1457 imb:147 pmb:830 smb:373 d:- ref:0 ; in:3617 out:3617 type:P dur:82000000 cpbdur:82000000 q:25.75 tex:86041 mv:6477 misc:1346 imb:16 pmb:661 smb:673 d:- ref:0 ; in:3618 out:3618 type:P dur:82000000 cpbdur:82000000 q:25.44 tex:122682 mv:8303 misc:1487 imb:43 pmb:971 smb:336 d:- ref:0 ; in:3619 out:3619 type:P dur:82000000 cpbdur:82000000 q:26.11 tex:137509 mv:9987 misc:1456 imb:102 pmb:843 smb:405 d:- ref:0 ; in:3620 out:3620 type:P dur:82000000 cpbdur:82000000 q:25.84 tex:95230 mv:7041 misc:1361 imb:19 pmb:701 smb:630 d:- ref:0 ; in:3621 out:3621 type:P dur:82000000 cpbdur:82000000 q:25.46 tex:112504 mv:7353 misc:1503 imb:19 pmb:907 smb:424 d:- ref:0 ; in:3622 out:3622 type:P dur:82000000 cpbdur:82000000 q:26.23 tex:149273 mv:10703 misc:1464 imb:109 pmb:901 smb:340 d:- ref:0 ; in:3623 out:3623 type:P dur:82000000 cpbdur:82000000 q:26.15 tex:121071 mv:8738 misc:1399 imb:43 pmb:900 smb:407 d:- ref:0 ; in:3624 out:3624 type:P dur:82000000 cpbdur:82000000 q:25.70 tex:87969 mv:6352 misc:1343 imb:28 pmb:636 smb:686 d:- ref:0 ; in:3625 out:3625 type:P dur:82000000 cpbdur:82000000 q:26.26 tex:146121 mv:10002 misc:1461 imb:132 pmb:838 smb:380 d:- ref:0 ; in:3626 out:3626 type:P dur:82000000 cpbdur:82000000 q:26.24 tex:121057 mv:9085 misc:1434 imb:61 pmb:903 smb:386 d:- ref:0 ; in:3627 out:3627 type:P dur:82000000 cpbdur:82000000 q:25.87 tex:100920 mv:7406 misc:1386 imb:26 pmb:780 smb:544 d:- ref:0 ; in:3628 out:3628 type:P dur:82000000 cpbdur:82000000 q:26.35 tex:143716 mv:10034 misc:1458 imb:120 pmb:910 smb:320 d:- ref:0 ; in:3629 out:3629 type:P dur:82000000 cpbdur:82000000 q:25.85 tex:96471 mv:7539 misc:1414 imb:27 pmb:783 smb:540 d:- ref:0 ; in:3630 out:3630 type:P dur:82000000 cpbdur:82000000 q:25.62 tex:89197 mv:6870 misc:1397 imb:28 pmb:738 smb:584 d:- ref:0 ; in:3631 out:3631 type:P dur:82000000 cpbdur:82000000 q:26.22 tex:142020 mv:10158 misc:1462 imb:115 pmb:866 smb:369 d:- ref:0 ; in:3632 out:3632 type:P dur:82000000 cpbdur:82000000 q:26.25 tex:122151 mv:8430 misc:1403 imb:56 pmb:846 smb:448 d:- ref:0 ; in:3633 out:3633 type:P dur:82000000 cpbdur:82000000 q:26.10 tex:111207 mv:8395 misc:1430 imb:54 pmb:843 smb:453 d:- ref:0 ; in:3634 out:3634 type:P dur:82000000 cpbdur:82000000 q:26.67 tex:149906 mv:12119 misc:1447 imb:141 pmb:959 smb:250 d:- ref:0 ; in:3635 out:3635 type:P dur:82000000 cpbdur:82000000 q:26.30 tex:123646 mv:8960 misc:1442 imb:42 pmb:940 smb:368 d:- ref:0 ; in:3636 out:3636 type:P dur:82000000 cpbdur:82000000 q:26.21 tex:123338 mv:9048 misc:1382 imb:54 pmb:860 smb:436 d:- ref:0 ; in:3637 out:3637 type:P dur:82000000 cpbdur:82000000 q:26.63 tex:140230 mv:11493 misc:1469 imb:127 pmb:957 smb:266 d:- ref:0 ; in:3638 out:3638 type:P dur:82000000 cpbdur:82000000 q:25.93 tex:97706 mv:7078 misc:1400 imb:25 pmb:760 smb:565 d:- ref:0 ; in:3639 out:3639 type:P dur:82000000 cpbdur:82000000 q:25.47 tex:124390 mv:8191 misc:1483 imb:48 pmb:1003 smb:299 d:- ref:0 ; in:3640 out:3640 type:P dur:82000000 cpbdur:82000000 q:26.10 tex:135876 mv:10131 misc:1441 imb:121 pmb:801 smb:428 d:- ref:0 ; in:3641 out:3641 type:P dur:82000000 cpbdur:82000000 q:25.75 tex:95341 mv:7240 misc:1395 imb:26 pmb:768 smb:556 d:- ref:0 ; in:3642 out:3642 type:P dur:82000000 cpbdur:82000000 q:25.96 tex:126561 mv:9231 misc:1416 imb:50 pmb:909 smb:391 d:- ref:0 ; in:3643 out:3643 type:P dur:82000000 cpbdur:82000000 q:26.62 tex:146086 mv:11723 misc:1447 imb:154 pmb:943 smb:253 d:- ref:0 ; in:3644 out:3644 type:P dur:82000000 cpbdur:82000000 q:26.39 tex:132493 mv:9414 misc:1413 imb:47 pmb:938 smb:365 d:- ref:0 ; in:3645 out:3645 type:P dur:82000000 cpbdur:82000000 q:25.98 tex:96239 mv:7348 misc:1381 imb:22 pmb:788 smb:540 d:- ref:0 ; in:3646 out:3646 type:P dur:82000000 cpbdur:82000000 q:26.51 tex:137116 mv:10828 misc:1480 imb:108 pmb:876 smb:366 d:- ref:0 ; in:3647 out:3647 type:P dur:82000000 cpbdur:82000000 q:25.99 tex:101602 mv:7068 misc:1402 imb:26 pmb:786 smb:538 d:- ref:0 ; in:3648 out:3648 type:P dur:82000000 cpbdur:82000000 q:25.80 tex:103211 mv:7579 misc:1418 imb:22 pmb:827 smb:501 d:- ref:0 ; in:3649 out:3649 type:P dur:82000000 cpbdur:82000000 q:26.37 tex:155893 mv:10486 misc:1469 imb:139 pmb:908 smb:303 d:- ref:0 ; in:3650 out:3650 type:P dur:82000000 cpbdur:82000000 q:25.79 tex:82934 mv:6410 misc:1280 imb:17 pmb:602 smb:731 d:- ref:0 ; in:3651 out:3651 type:P dur:82000000 cpbdur:82000000 q:25.38 tex:123587 mv:7727 misc:1478 imb:47 pmb:981 smb:322 d:- ref:0 ; in:3652 out:3652 type:P dur:82000000 cpbdur:82000000 q:26.18 tex:151073 mv:11396 misc:1451 imb:150 pmb:922 smb:278 d:- ref:0 ; in:3653 out:3653 type:P dur:82000000 cpbdur:82000000 q:26.06 tex:111727 mv:8112 misc:1417 imb:55 pmb:854 smb:441 d:- ref:0 ; in:3654 out:3654 type:P dur:82000000 cpbdur:82000000 q:26.00 tex:108842 mv:8117 misc:1409 imb:47 pmb:839 smb:464 d:- ref:0 ; in:3655 out:3655 type:P dur:82000000 cpbdur:82000000 q:26.64 tex:140643 mv:11258 misc:1459 imb:122 pmb:928 smb:300 d:- ref:0 ; in:3656 out:3656 type:P dur:82000000 cpbdur:82000000 q:26.40 tex:137708 mv:9611 misc:1393 imb:49 pmb:929 smb:372 d:- ref:0 ; in:3657 out:3657 type:P dur:82000000 cpbdur:82000000 q:26.31 tex:125157 mv:8977 misc:1362 imb:41 pmb:867 smb:442 d:- ref:0 ; in:3658 out:3658 type:P dur:82000000 cpbdur:82000000 q:26.93 tex:155680 mv:12341 misc:1459 imb:158 pmb:939 smb:253 d:- ref:0 ; in:3659 out:3659 type:P dur:82000000 cpbdur:82000000 q:26.64 tex:118575 mv:8817 misc:1384 imb:40 pmb:893 smb:417 d:- ref:0 ; in:3660 out:3660 type:P dur:82000000 cpbdur:82000000 q:26.28 tex:116862 mv:8079 misc:1475 imb:32 pmb:889 smb:429 d:- ref:0 ; in:3661 out:3661 type:P dur:82000000 cpbdur:82000000 q:26.78 tex:151637 mv:12695 misc:1492 imb:248 pmb:947 smb:155 d:- ref:0 ; in:3662 out:3662 type:P dur:82000000 cpbdur:82000000 q:26.22 tex:107901 mv:7784 misc:1467 imb:34 pmb:884 smb:432 d:- ref:0 ; in:3663 out:3663 type:P dur:82000000 cpbdur:82000000 q:26.16 tex:129732 mv:9887 misc:1421 imb:63 pmb:943 smb:344 d:- ref:0 ; in:3664 out:3664 type:P dur:82000000 cpbdur:82000000 q:26.60 tex:140766 mv:11505 misc:1449 imb:159 pmb:917 smb:274 d:- ref:0 ; in:3665 out:3665 type:P dur:82000000 cpbdur:82000000 q:26.01 tex:100320 mv:7416 misc:1440 imb:27 pmb:824 smb:499 d:- ref:0 ; in:3666 out:3666 type:P dur:82000000 cpbdur:82000000 q:25.62 tex:84523 mv:6767 misc:1366 imb:21 pmb:667 smb:662 d:- ref:0 ; in:3667 out:3667 type:P dur:82000000 cpbdur:82000000 q:26.21 tex:144379 mv:10349 misc:1472 imb:121 pmb:897 smb:332 d:- ref:0 ; in:3668 out:3668 type:P dur:82000000 cpbdur:82000000 q:26.22 tex:124566 mv:8900 misc:1414 imb:54 pmb:888 smb:408 d:- ref:0 ; in:3669 out:3669 type:P dur:82000000 cpbdur:82000000 q:26.10 tex:124488 mv:9413 misc:1419 imb:59 pmb:925 smb:366 d:- ref:0 ; in:3670 out:3670 type:P dur:82000000 cpbdur:82000000 q:26.41 tex:149939 mv:10629 misc:1488 imb:110 pmb:939 smb:301 d:- ref:0 ; in:3671 out:3671 type:P dur:82000000 cpbdur:82000000 q:25.99 tex:106414 mv:7801 misc:1441 imb:25 pmb:863 smb:462 d:- ref:0 ; in:3672 out:3672 type:P dur:82000000 cpbdur:82000000 q:25.94 tex:115438 mv:8620 misc:1430 imb:59 pmb:888 smb:403 d:- ref:0 ; in:3673 out:3673 type:P dur:82000000 cpbdur:82000000 q:26.49 tex:167963 mv:12432 misc:1461 imb:172 pmb:972 smb:206 d:- ref:0 ; in:3674 out:3674 type:P dur:82000000 cpbdur:82000000 q:25.96 tex:90064 mv:6345 misc:1223 imb:30 pmb:565 smb:755 d:- ref:0 ; in:3675 out:3675 type:P dur:82000000 cpbdur:82000000 q:26.02 tex:126995 mv:9072 misc:1389 imb:47 pmb:914 smb:389 d:- ref:0 ; in:3676 out:3676 type:P dur:82000000 cpbdur:82000000 q:26.36 tex:145259 mv:10415 misc:1438 imb:141 pmb:905 smb:304 d:- ref:0 ; in:3677 out:3677 type:P dur:82000000 cpbdur:82000000 q:25.87 tex:91295 mv:7046 misc:1411 imb:26 pmb:760 smb:564 d:- ref:0 ; in:3678 out:3678 type:P dur:82000000 cpbdur:82000000 q:25.72 tex:99764 mv:7344 misc:1388 imb:24 pmb:820 smb:506 d:- ref:0 ; in:3679 out:3679 type:P dur:82000000 cpbdur:82000000 q:26.24 tex:139951 mv:9762 misc:1455 imb:106 pmb:866 smb:378 d:- ref:0 ; in:3680 out:3680 type:P dur:82000000 cpbdur:82000000 q:26.00 tex:94372 mv:6984 misc:1420 imb:21 pmb:718 smb:611 d:- ref:0 ; in:3681 out:3681 type:P dur:82000000 cpbdur:82000000 q:25.86 tex:107170 mv:8018 misc:1380 imb:24 pmb:868 smb:458 d:- ref:0 ; in:3682 out:3682 type:P dur:82000000 cpbdur:82000000 q:26.35 tex:150117 mv:10303 misc:1476 imb:102 pmb:879 smb:369 d:- ref:0 ; in:3683 out:3683 type:P dur:82000000 cpbdur:82000000 q:25.92 tex:97878 mv:7427 misc:1431 imb:20 pmb:795 smb:535 d:- ref:0 ; in:3684 out:3684 type:P dur:82000000 cpbdur:82000000 q:25.73 tex:96838 mv:7354 misc:1384 imb:19 pmb:736 smb:595 d:- ref:0 ; in:3685 out:3685 type:P dur:82000000 cpbdur:82000000 q:26.32 tex:146168 mv:10559 misc:1473 imb:124 pmb:905 smb:321 d:- ref:0 ; in:3686 out:3686 type:P dur:82000000 cpbdur:82000000 q:26.06 tex:108684 mv:8092 misc:1440 imb:27 pmb:886 smb:437 d:- ref:0 ; in:3687 out:3687 type:P dur:82000000 cpbdur:82000000 q:25.63 tex:81754 mv:6476 misc:1298 imb:23 pmb:620 smb:707 d:- ref:0 ; in:3688 out:3688 type:P dur:82000000 cpbdur:82000000 q:26.29 tex:155059 mv:11469 misc:1448 imb:146 pmb:937 smb:267 d:- ref:0 ; in:3689 out:3689 type:P dur:82000000 cpbdur:82000000 q:25.93 tex:96786 mv:7663 misc:1423 imb:35 pmb:793 smb:522 d:- ref:0 ; in:3690 out:3690 type:P dur:82000000 cpbdur:82000000 q:25.67 tex:92380 mv:7283 misc:1377 imb:18 pmb:745 smb:587 d:- ref:0 ; in:3691 out:3691 type:P dur:82000000 cpbdur:82000000 q:26.51 tex:148667 mv:12066 misc:1451 imb:155 pmb:950 smb:245 d:- ref:0 ; in:3692 out:3692 type:P dur:82000000 cpbdur:82000000 q:25.92 tex:99104 mv:7103 misc:1433 imb:17 pmb:829 smb:504 d:- ref:0 ; in:3693 out:3693 type:P dur:82000000 cpbdur:82000000 q:25.65 tex:87630 mv:6905 misc:1401 imb:23 pmb:725 smb:602 d:- ref:0 ; in:3694 out:3694 type:P dur:82000000 cpbdur:82000000 q:26.46 tex:162281 mv:11425 misc:1470 imb:139 pmb:935 smb:276 d:- ref:0 ; in:3695 out:3695 type:P dur:82000000 cpbdur:82000000 q:26.19 tex:114858 mv:8488 misc:1398 imb:47 pmb:866 smb:437 d:- ref:0 ; in:3696 out:3696 type:P dur:82000000 cpbdur:82000000 q:25.90 tex:104434 mv:7752 misc:1438 imb:31 pmb:840 smb:479 d:- ref:0 ; in:3697 out:3697 type:P dur:82000000 cpbdur:82000000 q:26.48 tex:159335 mv:11371 misc:1462 imb:170 pmb:927 smb:253 d:- ref:0 ; in:3698 out:3698 type:P dur:82000000 cpbdur:82000000 q:25.97 tex:92057 mv:6964 misc:1419 imb:23 pmb:730 smb:597 d:- ref:0 ; in:3699 out:3699 type:P dur:82000000 cpbdur:82000000 q:25.73 tex:98896 mv:7454 misc:1418 imb:28 pmb:810 smb:512 d:- ref:0 ; in:3700 out:3700 type:P dur:82000000 cpbdur:82000000 q:26.24 tex:144866 mv:10408 misc:1470 imb:131 pmb:884 smb:335 d:- ref:0 ; in:3701 out:3701 type:P dur:82000000 cpbdur:82000000 q:25.87 tex:93210 mv:6845 misc:1409 imb:21 pmb:753 smb:576 d:- ref:0 ; in:3702 out:3702 type:P dur:82000000 cpbdur:82000000 q:25.81 tex:108396 mv:7751 misc:1405 imb:30 pmb:845 smb:475 d:- ref:0 ; in:3703 out:3703 type:P dur:82000000 cpbdur:82000000 q:26.33 tex:144363 mv:10060 misc:1449 imb:105 pmb:860 smb:385 d:- ref:0 ; in:3704 out:3704 type:P dur:82000000 cpbdur:82000000 q:26.04 tex:104597 mv:7759 misc:1444 imb:34 pmb:827 smb:489 d:- ref:0 ; in:3705 out:3705 type:P dur:82000000 cpbdur:82000000 q:25.76 tex:94910 mv:6975 misc:1379 imb:22 pmb:751 smb:577 d:- ref:0 ; in:3706 out:3706 type:P dur:82000000 cpbdur:82000000 q:26.41 tex:148812 mv:10381 misc:1447 imb:103 pmb:897 smb:350 d:- ref:0 ; in:3707 out:3707 type:P dur:82000000 cpbdur:82000000 q:26.27 tex:121106 mv:8162 misc:1380 imb:35 pmb:860 smb:455 d:- ref:0 ; in:3708 out:3708 type:P dur:82000000 cpbdur:82000000 q:26.27 tex:127075 mv:9469 misc:1384 imb:53 pmb:903 smb:394 d:- ref:0 ; in:3709 out:3709 type:P dur:82000000 cpbdur:82000000 q:26.47 tex:145487 mv:10497 misc:1464 imb:126 pmb:851 smb:373 d:- ref:0 ; in:3710 out:3710 type:P dur:82000000 cpbdur:82000000 q:26.29 tex:125173 mv:8890 misc:1393 imb:48 pmb:898 smb:404 d:- ref:0 ; in:3711 out:3711 type:P dur:82000000 cpbdur:82000000 q:25.65 tex:81130 mv:6442 misc:1348 imb:26 pmb:636 smb:688 d:- ref:0 ; in:3712 out:3712 type:P dur:82000000 cpbdur:82000000 q:26.15 tex:140849 mv:10533 misc:1458 imb:140 pmb:883 smb:327 d:- ref:0 ; in:3713 out:3713 type:P dur:82000000 cpbdur:82000000 q:26.18 tex:128535 mv:9985 misc:1432 imb:77 pmb:929 smb:344 d:- ref:0 ; in:3714 out:3714 type:P dur:82000000 cpbdur:82000000 q:25.93 tex:105667 mv:7945 misc:1396 imb:40 pmb:809 smb:501 d:- ref:0 ; in:3715 out:3715 type:P dur:82000000 cpbdur:82000000 q:26.30 tex:137903 mv:10143 misc:1434 imb:112 pmb:843 smb:395 d:- ref:0 ; in:3716 out:3716 type:P dur:82000000 cpbdur:82000000 q:26.13 tex:114568 mv:8370 misc:1390 imb:32 pmb:852 smb:466 d:- ref:0 ; in:3717 out:3717 type:P dur:82000000 cpbdur:82000000 q:25.77 tex:93127 mv:7209 misc:1424 imb:25 pmb:793 smb:532 d:- ref:0 ; in:3718 out:3718 type:P dur:82000000 cpbdur:82000000 q:26.29 tex:147475 mv:10713 misc:1484 imb:99 pmb:923 smb:328 d:- ref:0 ; in:3719 out:3719 type:P dur:82000000 cpbdur:82000000 q:26.02 tex:108128 mv:7899 misc:1413 imb:33 pmb:853 smb:464 d:- ref:0 ; in:3720 out:3720 type:P dur:82000000 cpbdur:82000000 q:26.11 tex:126675 mv:9097 misc:1420 imb:60 pmb:907 smb:383 d:- ref:0 ; in:3721 out:3721 type:P dur:82000000 cpbdur:82000000 q:26.54 tex:138121 mv:10638 misc:1457 imb:158 pmb:910 smb:282 d:- ref:0 ; in:3722 out:3722 type:P dur:82000000 cpbdur:82000000 q:26.08 tex:102370 mv:7178 misc:1420 imb:38 pmb:762 smb:550 d:- ref:0 ; in:3723 out:3723 type:P dur:82000000 cpbdur:82000000 q:25.56 tex:79451 mv:5924 misc:1297 imb:22 pmb:590 smb:738 d:- ref:0 ; in:3724 out:3724 type:P dur:82000000 cpbdur:82000000 q:26.20 tex:149902 mv:10875 misc:1447 imb:149 pmb:915 smb:286 d:- ref:0 ; in:3725 out:3725 type:P dur:82000000 cpbdur:82000000 q:25.70 tex:83913 mv:6682 misc:1397 imb:32 pmb:668 smb:650 d:- ref:0 ; in:3726 out:3726 type:P dur:82000000 cpbdur:82000000 q:25.51 tex:89368 mv:6608 misc:1352 imb:23 pmb:676 smb:651 d:- ref:0 ; in:3727 out:3727 type:P dur:82000000 cpbdur:82000000 q:26.25 tex:150816 mv:10632 misc:1472 imb:135 pmb:912 smb:303 d:- ref:0 ; in:3728 out:3728 type:P dur:82000000 cpbdur:82000000 q:26.17 tex:108071 mv:7954 misc:1431 imb:35 pmb:822 smb:493 d:- ref:0 ; in:3729 out:3729 type:P dur:82000000 cpbdur:82000000 q:25.94 tex:107779 mv:8090 misc:1395 imb:40 pmb:842 smb:468 d:- ref:0 ; in:3730 out:3730 type:P dur:82000000 cpbdur:82000000 q:26.58 tex:148541 mv:11745 misc:1466 imb:126 pmb:953 smb:271 d:- ref:0 ; in:3731 out:3731 type:P dur:82000000 cpbdur:82000000 q:25.91 tex:96318 mv:6953 misc:1433 imb:16 pmb:797 smb:537 d:- ref:0 ; in:3732 out:3732 type:P dur:82000000 cpbdur:82000000 q:25.80 tex:106090 mv:7619 misc:1427 imb:30 pmb:803 smb:517 d:- ref:0 ; in:3733 out:3733 type:P dur:82000000 cpbdur:82000000 q:26.41 tex:158323 mv:11288 misc:1453 imb:133 pmb:938 smb:279 d:- ref:0 ; in:3734 out:3734 type:P dur:82000000 cpbdur:82000000 q:26.30 tex:128297 mv:9188 misc:1387 imb:47 pmb:898 smb:405 d:- ref:0 ; in:3735 out:3735 type:P dur:82000000 cpbdur:82000000 q:25.75 tex:87155 mv:6896 misc:1381 imb:30 pmb:702 smb:618 d:- ref:0 ; in:3736 out:3736 type:P dur:82000000 cpbdur:82000000 q:26.23 tex:140226 mv:10536 misc:1430 imb:138 pmb:822 smb:390 d:- ref:0 ; in:3737 out:3737 type:P dur:82000000 cpbdur:82000000 q:26.04 tex:114419 mv:8504 misc:1461 imb:32 pmb:910 smb:408 d:- ref:0 ; in:3738 out:3738 type:P dur:82000000 cpbdur:82000000 q:25.96 tex:110572 mv:8932 misc:1432 imb:50 pmb:890 smb:410 d:- ref:0 ; in:3739 out:3739 type:P dur:82000000 cpbdur:82000000 q:26.43 tex:147940 mv:10413 misc:1479 imb:105 pmb:929 smb:316 d:- ref:0 ; in:3740 out:3740 type:P dur:82000000 cpbdur:82000000 q:26.32 tex:128315 mv:9177 misc:1412 imb:57 pmb:933 smb:360 d:- ref:0 ; in:3741 out:3741 type:P dur:82000000 cpbdur:82000000 q:26.26 tex:117254 mv:8955 misc:1359 imb:39 pmb:867 smb:444 d:- ref:0 ; in:3742 out:3742 type:P dur:82000000 cpbdur:82000000 q:26.73 tex:143041 mv:11394 misc:1461 imb:105 pmb:950 smb:295 d:- ref:0 ; in:3743 out:3743 type:P dur:82000000 cpbdur:82000000 q:26.19 tex:106538 mv:7700 misc:1434 imb:29 pmb:874 smb:447 d:- ref:0 ; in:3744 out:3744 type:P dur:82000000 cpbdur:82000000 q:25.80 tex:91311 mv:6940 misc:1405 imb:18 pmb:728 smb:604 d:- ref:0 ; in:3745 out:3745 type:P dur:82000000 cpbdur:82000000 q:26.33 tex:156007 mv:10652 misc:1469 imb:138 pmb:914 smb:298 d:- ref:0 ; in:3746 out:3746 type:P dur:82000000 cpbdur:82000000 q:26.08 tex:108845 mv:7956 misc:1423 imb:29 pmb:854 smb:467 d:- ref:0 ; in:3747 out:3747 type:P dur:82000000 cpbdur:82000000 q:25.80 tex:98106 mv:7351 misc:1431 imb:32 pmb:785 smb:533 d:- ref:0 ; in:3748 out:3748 type:P dur:82000000 cpbdur:82000000 q:26.14 tex:136892 mv:10150 misc:1438 imb:133 pmb:826 smb:391 d:- ref:0 ; in:3749 out:3749 type:P dur:82000000 cpbdur:82000000 q:25.95 tex:105784 mv:8008 misc:1432 imb:31 pmb:866 smb:453 d:- ref:0 ; in:3750 out:3750 type:I dur:82000000 cpbdur:82000000 q:23.20 tex:502588 mv:14568 misc:372 imb:1350 pmb:0 smb:0 d:- ref:; in:3751 out:3751 type:P dur:82000000 cpbdur:82000000 q:29.04 tex:96634 mv:9736 misc:1422 imb:87 pmb:832 smb:431 d:- ref:0 ; in:3752 out:3752 type:P dur:82000000 cpbdur:82000000 q:27.75 tex:84605 mv:7616 misc:1427 imb:34 pmb:822 smb:494 d:- ref:0 ; in:3753 out:3753 type:P dur:82000000 cpbdur:82000000 q:26.80 tex:92450 mv:7328 misc:1446 imb:20 pmb:854 smb:476 d:- ref:0 ; in:3754 out:3754 type:P dur:82000000 cpbdur:82000000 q:26.86 tex:136687 mv:10180 misc:1469 imb:110 pmb:852 smb:388 d:- ref:0 ; in:3755 out:3755 type:P dur:82000000 cpbdur:82000000 q:26.13 tex:95730 mv:6822 misc:1440 imb:15 pmb:782 smb:553 d:- ref:0 ; in:3756 out:3756 type:P dur:82000000 cpbdur:82000000 q:25.99 tex:108367 mv:8196 misc:1413 imb:37 pmb:834 smb:479 d:- ref:0 ; in:3757 out:3757 type:P dur:82000000 cpbdur:82000000 q:26.56 tex:143050 mv:10872 misc:1462 imb:143 pmb:918 smb:289 d:- ref:0 ; in:3758 out:3758 type:P dur:82000000 cpbdur:82000000 q:25.98 tex:101259 mv:7078 misc:1423 imb:31 pmb:822 smb:497 d:- ref:0 ; in:3759 out:3759 type:P dur:82000000 cpbdur:82000000 q:26.02 tex:117781 mv:8606 misc:1421 imb:51 pmb:872 smb:427 d:- ref:0 ; in:3760 out:3760 type:P dur:82000000 cpbdur:82000000 q:26.46 tex:151054 mv:11463 misc:1443 imb:147 pmb:923 smb:280 d:- ref:0 ; in:3761 out:3761 type:P dur:82000000 cpbdur:82000000 q:26.11 tex:104141 mv:7858 misc:1401 imb:36 pmb:844 smb:470 d:- ref:0 ; in:3762 out:3762 type:P dur:82000000 cpbdur:82000000 q:25.89 tex:102101 mv:8596 misc:1503 imb:59 pmb:890 smb:401 d:- ref:0 ; in:3763 out:3763 type:P dur:82000000 cpbdur:82000000 q:26.57 tex:142396 mv:13519 misc:1477 imb:296 pmb:965 smb:89 d:- ref:0 ; in:3764 out:3764 type:P dur:82000000 cpbdur:82000000 q:26.11 tex:106196 mv:7840 misc:1428 imb:25 pmb:818 smb:507 d:- ref:0 ; in:3765 out:3765 type:P dur:82000000 cpbdur:82000000 q:25.86 tex:97080 mv:7393 misc:1463 imb:36 pmb:783 smb:531 d:- ref:0 ; in:3766 out:3766 type:P dur:82000000 cpbdur:82000000 q:26.27 tex:146289 mv:10295 misc:1480 imb:121 pmb:865 smb:364 d:- ref:0 ; in:3767 out:3767 type:P dur:82000000 cpbdur:82000000 q:26.23 tex:125019 mv:9195 misc:1434 imb:51 pmb:927 smb:372 d:- ref:0 ; in:3768 out:3768 type:P dur:82000000 cpbdur:82000000 q:26.15 tex:122438 mv:8923 misc:1399 imb:56 pmb:889 smb:405 d:- ref:0 ; in:3769 out:3769 type:P dur:82000000 cpbdur:82000000 q:26.61 tex:140086 mv:11161 misc:1441 imb:184 pmb:875 smb:291 d:- ref:0 ; in:3770 out:3770 type:P dur:82000000 cpbdur:82000000 q:26.09 tex:105511 mv:7286 misc:1419 imb:37 pmb:774 smb:539 d:- ref:0 ; in:3771 out:3771 type:P dur:82000000 cpbdur:82000000 q:26.19 tex:127529 mv:9655 misc:1392 imb:83 pmb:883 smb:384 d:- ref:0 ; in:3772 out:3772 type:P dur:82000000 cpbdur:82000000 q:26.46 tex:151462 mv:11571 misc:1439 imb:148 pmb:913 smb:289 d:- ref:0 ; in:3773 out:3773 type:P dur:82000000 cpbdur:82000000 q:26.34 tex:122351 mv:9691 misc:1414 imb:84 pmb:851 smb:415 d:- ref:0 ; in:3774 out:3774 type:P dur:82000000 cpbdur:82000000 q:26.08 tex:108049 mv:8290 misc:1413 imb:63 pmb:818 smb:469 d:- ref:0 ; in:3775 out:3775 type:P dur:82000000 cpbdur:82000000 q:26.48 tex:145914 mv:11400 misc:1462 imb:172 pmb:888 smb:290 d:- ref:0 ; in:3776 out:3776 type:P dur:82000000 cpbdur:82000000 q:26.25 tex:112166 mv:9130 misc:1472 imb:62 pmb:868 smb:420 d:- ref:0 ; in:3777 out:3777 type:P dur:82000000 cpbdur:82000000 q:26.14 tex:112178 mv:9927 misc:1439 imb:161 pmb:749 smb:440 d:- ref:0 ; in:3778 out:3778 type:P dur:82000000 cpbdur:82000000 q:26.14 tex:128938 mv:10725 misc:1497 imb:134 pmb:909 smb:307 d:- ref:0 ; in:3779 out:3779 type:P dur:82000000 cpbdur:82000000 q:26.30 tex:134008 mv:12193 misc:1487 imb:198 pmb:957 smb:195 d:- ref:0 ; in:3780 out:3780 type:P dur:82000000 cpbdur:82000000 q:26.07 tex:116631 mv:10450 misc:1479 imb:75 pmb:980 smb:295 d:- ref:0 ; in:3781 out:3781 type:P dur:82000000 cpbdur:82000000 q:26.45 tex:158645 mv:12459 misc:1464 imb:216 pmb:961 smb:173 d:- ref:0 ; in:3782 out:3782 type:P dur:82000000 cpbdur:82000000 q:25.83 tex:89385 mv:7140 misc:1387 imb:27 pmb:740 smb:583 d:- ref:0 ; in:3783 out:3783 type:P dur:82000000 cpbdur:82000000 q:26.02 tex:119329 mv:9193 misc:1422 imb:120 pmb:787 smb:443 d:- ref:0 ; in:3784 out:3784 type:P dur:82000000 cpbdur:82000000 q:25.83 tex:116305 mv:8856 misc:1423 imb:62 pmb:860 smb:428 d:- ref:0 ; in:3785 out:3785 type:P dur:82000000 cpbdur:82000000 q:26.39 tex:144318 mv:9279 misc:1435 imb:91 pmb:841 smb:418 d:- ref:0 ; in:3786 out:3786 type:P dur:82000000 cpbdur:82000000 q:25.85 tex:92781 mv:7854 misc:1477 imb:53 pmb:826 smb:471 d:- ref:0 ; in:3787 out:3787 type:P dur:82000000 cpbdur:82000000 q:26.10 tex:153467 mv:9533 misc:1480 imb:117 pmb:1011 smb:222 d:- ref:0 ; in:3788 out:3788 type:P dur:82000000 cpbdur:82000000 q:25.75 tex:99282 mv:7983 misc:1463 imb:48 pmb:885 smb:417 d:- ref:0 ; in:3789 out:3789 type:P dur:82000000 cpbdur:82000000 q:25.98 tex:139946 mv:11028 misc:1450 imb:114 pmb:1056 smb:180 d:- ref:0 ; in:3790 out:3790 type:P dur:82000000 cpbdur:82000000 q:25.96 tex:124693 mv:9573 misc:1462 imb:71 pmb:979 smb:300 d:- ref:0 ; in:3791 out:3791 type:P dur:82000000 cpbdur:82000000 q:25.85 tex:113181 mv:9474 misc:1481 imb:94 pmb:1012 smb:244 d:- ref:0 ; in:3792 out:3792 type:P dur:82000000 cpbdur:82000000 q:25.56 tex:101877 mv:8374 misc:1501 imb:82 pmb:882 smb:386 d:- ref:0 ; in:3793 out:3793 type:P dur:82000000 cpbdur:82000000 q:25.65 tex:120422 mv:10184 misc:1482 imb:114 pmb:1032 smb:204 d:- ref:0 ; in:3794 out:3794 type:P dur:82000000 cpbdur:82000000 q:25.60 tex:113221 mv:9116 misc:1487 imb:92 pmb:1016 smb:242 d:- ref:0 ; in:3795 out:3795 type:P dur:82000000 cpbdur:82000000 q:25.42 tex:145189 mv:9434 misc:1473 imb:86 pmb:1082 smb:182 d:- ref:0 ; in:3796 out:3796 type:P dur:82000000 cpbdur:82000000 q:25.00 tex:103686 mv:6920 misc:1322 imb:17 pmb:736 smb:597 d:- ref:0 ; in:3797 out:3797 type:P dur:82000000 cpbdur:82000000 q:24.86 tex:84953 mv:6152 misc:1335 imb:22 pmb:634 smb:694 d:- ref:0 ; in:3798 out:3798 type:P dur:82000000 cpbdur:82000000 q:24.76 tex:99534 mv:6621 misc:1261 imb:15 pmb:679 smb:656 d:- ref:0 ; in:3799 out:3799 type:P dur:82000000 cpbdur:82000000 q:24.99 tex:113777 mv:7445 misc:1346 imb:30 pmb:799 smb:521 d:- ref:0 ; in:3800 out:3800 type:P dur:82000000 cpbdur:82000000 q:24.91 tex:100922 mv:6807 misc:1199 imb:20 pmb:683 smb:647 d:- ref:0 ; in:3801 out:3801 type:P dur:82000000 cpbdur:82000000 q:25.19 tex:127008 mv:8289 misc:1383 imb:40 pmb:877 smb:433 d:- ref:0 ; in:3802 out:3802 type:P dur:82000000 cpbdur:82000000 q:25.30 tex:120484 mv:7825 misc:1227 imb:31 pmb:767 smb:552 d:- ref:0 ; in:3803 out:3803 type:P dur:82000000 cpbdur:82000000 q:24.97 tex:91617 mv:5884 misc:1131 imb:11 pmb:548 smb:791 d:- ref:0 ; in:3804 out:3804 type:P dur:82000000 cpbdur:82000000 q:25.11 tex:117984 mv:7646 misc:1266 imb:32 pmb:772 smb:546 d:- ref:0 ; in:3805 out:3805 type:P dur:82000000 cpbdur:82000000 q:24.92 tex:99847 mv:6653 misc:1172 imb:24 pmb:669 smb:657 d:- ref:0 ; in:3806 out:3806 type:P dur:82000000 cpbdur:82000000 q:24.80 tex:93982 mv:6785 misc:1313 imb:21 pmb:705 smb:624 d:- ref:0 ; in:3807 out:3807 type:P dur:82000000 cpbdur:82000000 q:24.49 tex:100482 mv:6881 misc:1469 imb:30 pmb:805 smb:515 d:- ref:0 ; in:3808 out:3808 type:P dur:82000000 cpbdur:82000000 q:24.64 tex:97495 mv:7072 misc:1217 imb:20 pmb:684 smb:646 d:- ref:0 ; in:3809 out:3809 type:P dur:82000000 cpbdur:82000000 q:24.58 tex:93601 mv:6555 misc:1148 imb:17 pmb:649 smb:684 d:- ref:0 ; in:3810 out:3810 type:P dur:82000000 cpbdur:82000000 q:24.95 tex:119211 mv:7703 misc:1222 imb:33 pmb:777 smb:540 d:- ref:0 ; in:3811 out:3811 type:P dur:82000000 cpbdur:82000000 q:24.87 tex:102889 mv:7213 misc:1162 imb:22 pmb:719 smb:609 d:- ref:0 ; in:3812 out:3812 type:P dur:82000000 cpbdur:82000000 q:24.87 tex:97374 mv:6728 misc:1242 imb:20 pmb:676 smb:654 d:- ref:0 ; in:3813 out:3813 type:P dur:82000000 cpbdur:82000000 q:24.53 tex:78102 mv:5714 misc:1048 imb:8 pmb:496 smb:846 d:- ref:0 ; in:3814 out:3814 type:P dur:82000000 cpbdur:82000000 q:24.27 tex:89769 mv:6349 misc:1314 imb:9 pmb:637 smb:704 d:- ref:0 ; in:3815 out:3815 type:P dur:82000000 cpbdur:82000000 q:25.11 tex:139361 mv:8654 misc:1257 imb:61 pmb:810 smb:479 d:- ref:0 ; in:3816 out:3816 type:P dur:82000000 cpbdur:82000000 q:25.68 tex:121501 mv:8595 misc:1224 imb:64 pmb:795 smb:491 d:- ref:0 ; in:3817 out:3817 type:P dur:82000000 cpbdur:82000000 q:25.70 tex:102964 mv:6587 misc:1185 imb:20 pmb:701 smb:629 d:- ref:0 ; in:3818 out:3818 type:P dur:82000000 cpbdur:82000000 q:25.98 tex:120611 mv:7281 misc:1260 imb:34 pmb:751 smb:565 d:- ref:0 ; in:3819 out:3819 type:P dur:82000000 cpbdur:82000000 q:25.84 tex:116249 mv:7565 misc:1234 imb:33 pmb:815 smb:502 d:- ref:0 ; in:3820 out:3820 type:P dur:82000000 cpbdur:82000000 q:25.50 tex:103145 mv:7779 misc:1172 imb:36 pmb:767 smb:547 d:- ref:0 ; in:3821 out:3821 type:P dur:82000000 cpbdur:82000000 q:25.41 tex:139521 mv:8996 misc:1363 imb:30 pmb:930 smb:390 d:- ref:0 ; in:3822 out:3822 type:P dur:82000000 cpbdur:82000000 q:24.94 tex:86579 mv:6004 misc:1177 imb:11 pmb:572 smb:767 d:- ref:0 ; in:3823 out:3823 type:P dur:82000000 cpbdur:82000000 q:25.03 tex:107885 mv:7157 misc:1254 imb:22 pmb:747 smb:581 d:- ref:0 ; in:3824 out:3824 type:P dur:82000000 cpbdur:82000000 q:24.99 tex:97588 mv:6465 misc:1211 imb:11 pmb:623 smb:716 d:- ref:0 ; in:3825 out:3825 type:P dur:82000000 cpbdur:82000000 q:24.98 tex:112255 mv:7396 misc:1173 imb:21 pmb:756 smb:573 d:- ref:0 ; in:3826 out:3826 type:P dur:82000000 cpbdur:82000000 q:24.91 tex:105797 mv:7161 misc:1218 imb:27 pmb:717 smb:606 d:- ref:0 ; in:3827 out:3827 type:P dur:82000000 cpbdur:82000000 q:24.71 tex:85939 mv:5975 misc:1158 imb:14 pmb:569 smb:767 d:- ref:0 ; in:3828 out:3828 type:P dur:82000000 cpbdur:82000000 q:24.81 tex:110181 mv:7177 misc:1186 imb:35 pmb:719 smb:596 d:- ref:0 ; in:3829 out:3829 type:P dur:82000000 cpbdur:82000000 q:24.55 tex:84123 mv:6115 misc:1138 imb:16 pmb:561 smb:773 d:- ref:0 ; in:3830 out:3830 type:P dur:82000000 cpbdur:82000000 q:24.46 tex:100202 mv:6734 misc:1376 imb:16 pmb:736 smb:598 d:- ref:0 ; in:3831 out:3831 type:P dur:82000000 cpbdur:82000000 q:24.34 tex:88637 mv:6094 misc:1181 imb:16 pmb:568 smb:766 d:- ref:0 ; in:3832 out:3832 type:P dur:82000000 cpbdur:82000000 q:24.80 tex:109468 mv:7465 misc:1203 imb:21 pmb:747 smb:582 d:- ref:0 ; in:3833 out:3833 type:P dur:82000000 cpbdur:82000000 q:24.56 tex:85240 mv:5651 misc:1029 imb:15 pmb:495 smb:840 d:- ref:0 ; in:3834 out:3834 type:P dur:82000000 cpbdur:82000000 q:24.98 tex:122603 mv:8372 misc:1177 imb:31 pmb:792 smb:527 d:- ref:0 ; in:3835 out:3835 type:P dur:82000000 cpbdur:82000000 q:24.79 tex:98282 mv:6361 misc:1125 imb:14 pmb:677 smb:659 d:- ref:0 ; in:3836 out:3836 type:P dur:82000000 cpbdur:82000000 q:24.92 tex:106055 mv:6991 misc:1186 imb:26 pmb:721 smb:603 d:- ref:0 ; in:3837 out:3837 type:P dur:82000000 cpbdur:82000000 q:25.02 tex:106034 mv:7087 misc:1127 imb:23 pmb:697 smb:630 d:- ref:0 ; in:3838 out:3838 type:P dur:82000000 cpbdur:82000000 q:25.14 tex:113426 mv:7853 misc:1161 imb:27 pmb:741 smb:582 d:- ref:0 ; in:3839 out:3839 type:P dur:82000000 cpbdur:82000000 q:25.23 tex:116046 mv:7740 misc:1174 imb:29 pmb:756 smb:565 d:- ref:0 ; in:3840 out:3840 type:P dur:82000000 cpbdur:82000000 q:25.18 tex:112098 mv:7339 misc:1179 imb:18 pmb:719 smb:613 d:- ref:0 ; in:3841 out:3841 type:P dur:82000000 cpbdur:82000000 q:24.68 tex:82584 mv:5397 misc:1051 imb:10 pmb:497 smb:843 d:- ref:0 ; in:3842 out:3842 type:P dur:82000000 cpbdur:82000000 q:24.94 tex:113802 mv:7316 misc:1186 imb:36 pmb:710 smb:604 d:- ref:0 ; in:3843 out:3843 type:P dur:82000000 cpbdur:82000000 q:24.93 tex:105607 mv:6971 misc:1158 imb:24 pmb:689 smb:637 d:- ref:0 ; in:3844 out:3844 type:P dur:82000000 cpbdur:82000000 q:24.59 tex:84171 mv:6036 misc:1145 imb:16 pmb:582 smb:752 d:- ref:0 ; in:3845 out:3845 type:P dur:82000000 cpbdur:82000000 q:24.74 tex:94383 mv:6319 misc:1090 imb:12 pmb:635 smb:703 d:- ref:0 ; in:3846 out:3846 type:P dur:82000000 cpbdur:82000000 q:24.77 tex:98437 mv:6853 misc:1142 imb:24 pmb:643 smb:683 d:- ref:0 ; in:3847 out:3847 type:P dur:82000000 cpbdur:82000000 q:24.66 tex:85149 mv:5785 misc:1058 imb:14 pmb:517 smb:819 d:- ref:0 ; in:3848 out:3848 type:P dur:82000000 cpbdur:82000000 q:24.85 tex:107535 mv:7183 misc:1178 imb:19 pmb:727 smb:604 d:- ref:0 ; in:3849 out:3849 type:P dur:82000000 cpbdur:82000000 q:24.82 tex:97334 mv:6404 misc:1118 imb:7 pmb:644 smb:699 d:- ref:0 ; in:3850 out:3850 type:P dur:82000000 cpbdur:82000000 q:24.75 tex:84297 mv:6170 misc:1149 imb:15 pmb:554 smb:781 d:- ref:0 ; in:3851 out:3851 type:P dur:82000000 cpbdur:82000000 q:24.70 tex:92518 mv:6551 misc:1179 imb:38 pmb:625 smb:687 d:- ref:0 ; in:3852 out:3852 type:P dur:82000000 cpbdur:82000000 q:24.72 tex:93706 mv:7138 misc:1220 imb:40 pmb:700 smb:610 d:- ref:0 ; in:3853 out:3853 type:P dur:82000000 cpbdur:82000000 q:24.57 tex:91497 mv:6124 misc:1139 imb:20 pmb:622 smb:708 d:- ref:0 ; in:3854 out:3854 type:P dur:82000000 cpbdur:82000000 q:24.54 tex:86254 mv:5986 misc:1160 imb:22 pmb:580 smb:748 d:- ref:0 ; in:3855 out:3855 type:P dur:82000000 cpbdur:82000000 q:24.40 tex:105724 mv:6803 misc:1337 imb:24 pmb:747 smb:579 d:- ref:0 ; in:3856 out:3856 type:P dur:82000000 cpbdur:82000000 q:24.71 tex:103056 mv:7104 misc:1160 imb:32 pmb:702 smb:616 d:- ref:0 ; in:3857 out:3857 type:P dur:82000000 cpbdur:82000000 q:24.69 tex:99750 mv:6734 misc:1092 imb:18 pmb:660 smb:672 d:- ref:0 ; in:3858 out:3858 type:P dur:82000000 cpbdur:82000000 q:24.65 tex:90008 mv:6299 misc:1117 imb:18 pmb:591 smb:741 d:- ref:0 ; in:3859 out:3859 type:P dur:82000000 cpbdur:82000000 q:24.66 tex:101001 mv:6646 misc:1105 imb:16 pmb:702 smb:632 d:- ref:0 ; in:3860 out:3860 type:P dur:82000000 cpbdur:82000000 q:24.92 tex:112308 mv:7305 misc:1187 imb:32 pmb:731 smb:587 d:- ref:0 ; in:3861 out:3861 type:P dur:82000000 cpbdur:82000000 q:24.89 tex:105129 mv:7170 misc:1133 imb:24 pmb:710 smb:616 d:- ref:0 ; in:3862 out:3862 type:P dur:82000000 cpbdur:82000000 q:25.05 tex:124046 mv:8080 misc:1194 imb:27 pmb:808 smb:515 d:- ref:0 ; in:3863 out:3863 type:P dur:82000000 cpbdur:82000000 q:25.03 tex:116555 mv:7262 misc:1159 imb:20 pmb:736 smb:594 d:- ref:0 ; in:3864 out:3864 type:P dur:82000000 cpbdur:82000000 q:24.82 tex:95102 mv:6525 misc:1157 imb:19 pmb:641 smb:690 d:- ref:0 ; in:3865 out:3865 type:P dur:82000000 cpbdur:82000000 q:24.78 tex:98125 mv:6854 misc:1157 imb:25 pmb:728 smb:597 d:- ref:0 ; in:3866 out:3866 type:P dur:82000000 cpbdur:82000000 q:24.89 tex:110405 mv:6867 misc:1144 imb:37 pmb:679 smb:634 d:- ref:0 ; in:3867 out:3867 type:P dur:82000000 cpbdur:82000000 q:24.65 tex:86657 mv:5815 misc:1096 imb:17 pmb:563 smb:770 d:- ref:0 ; in:3868 out:3868 type:P dur:82000000 cpbdur:82000000 q:24.71 tex:98992 mv:6677 misc:1171 imb:25 pmb:713 smb:612 d:- ref:0 ; in:3869 out:3869 type:P dur:82000000 cpbdur:82000000 q:24.80 tex:107894 mv:7255 misc:1163 imb:20 pmb:733 smb:597 d:- ref:0 ; in:3870 out:3870 type:P dur:82000000 cpbdur:82000000 q:24.63 tex:83360 mv:5625 misc:1087 imb:5 pmb:505 smb:840 d:- ref:0 ; in:3871 out:3871 type:P dur:82000000 cpbdur:82000000 q:24.86 tex:105895 mv:7087 misc:1178 imb:27 pmb:731 smb:592 d:- ref:0 ; in:3872 out:3872 type:P dur:82000000 cpbdur:82000000 q:25.14 tex:116488 mv:7414 misc:1178 imb:23 pmb:748 smb:579 d:- ref:0 ; in:3873 out:3873 type:P dur:82000000 cpbdur:82000000 q:24.92 tex:97240 mv:6258 misc:1142 imb:10 pmb:676 smb:664 d:- ref:0 ; in:3874 out:3874 type:P dur:82000000 cpbdur:82000000 q:24.77 tex:87684 mv:6149 misc:1119 imb:12 pmb:589 smb:749 d:- ref:0 ; in:3875 out:3875 type:P dur:82000000 cpbdur:82000000 q:24.62 tex:85293 mv:5775 misc:1012 imb:6 pmb:493 smb:851 d:- ref:0 ; in:3876 out:3876 type:P dur:82000000 cpbdur:82000000 q:24.96 tex:117513 mv:7627 misc:1132 imb:31 pmb:723 smb:596 d:- ref:0 ; in:3877 out:3877 type:P dur:82000000 cpbdur:82000000 q:24.92 tex:104140 mv:6869 misc:1095 imb:20 pmb:673 smb:657 d:- ref:0 ; in:3878 out:3878 type:P dur:82000000 cpbdur:82000000 q:24.80 tex:92724 mv:6686 misc:1198 imb:22 pmb:650 smb:678 d:- ref:0 ; in:3879 out:3879 type:P dur:82000000 cpbdur:82000000 q:24.78 tex:93155 mv:6808 misc:1165 imb:24 pmb:662 smb:664 d:- ref:0 ; in:3880 out:3880 type:P dur:82000000 cpbdur:82000000 q:24.78 tex:96831 mv:6741 misc:1108 imb:15 pmb:641 smb:694 d:- ref:0 ; in:3881 out:3881 type:P dur:82000000 cpbdur:82000000 q:24.86 tex:106054 mv:7006 misc:1148 imb:29 pmb:702 smb:619 d:- ref:0 ; in:3882 out:3882 type:P dur:82000000 cpbdur:82000000 q:25.24 tex:130975 mv:8696 misc:1177 imb:51 pmb:786 smb:513 d:- ref:0 ; in:3883 out:3883 type:P dur:82000000 cpbdur:82000000 q:25.33 tex:120532 mv:8007 misc:1141 imb:36 pmb:769 smb:545 d:- ref:0 ; in:3884 out:3884 type:P dur:82000000 cpbdur:82000000 q:25.18 tex:107225 mv:7093 misc:1202 imb:22 pmb:739 smb:589 d:- ref:0 ; in:3885 out:3885 type:P dur:82000000 cpbdur:82000000 q:25.03 tex:97856 mv:6663 misc:1185 imb:18 pmb:695 smb:637 d:- ref:0 ; in:3886 out:3886 type:P dur:82000000 cpbdur:82000000 q:25.14 tex:110594 mv:7355 misc:1227 imb:21 pmb:751 smb:578 d:- ref:0 ; in:3887 out:3887 type:P dur:82000000 cpbdur:82000000 q:25.01 tex:93585 mv:6566 misc:1177 imb:24 pmb:632 smb:694 d:- ref:0 ; in:3888 out:3888 type:P dur:82000000 cpbdur:82000000 q:24.89 tex:98643 mv:6360 misc:1141 imb:17 pmb:616 smb:717 d:- ref:0 ; in:3889 out:3889 type:P dur:82000000 cpbdur:82000000 q:24.78 tex:94939 mv:6253 misc:1168 imb:25 pmb:649 smb:676 d:- ref:0 ; in:3890 out:3890 type:P dur:82000000 cpbdur:82000000 q:24.90 tex:109658 mv:7018 misc:1180 imb:29 pmb:722 smb:599 d:- ref:0 ; in:3891 out:3891 type:P dur:82000000 cpbdur:82000000 q:25.02 tex:108664 mv:7240 misc:1168 imb:30 pmb:736 smb:584 d:- ref:0 ; in:3892 out:3892 type:P dur:82000000 cpbdur:82000000 q:24.92 tex:103558 mv:6975 misc:1163 imb:19 pmb:713 smb:618 d:- ref:0 ; in:3893 out:3893 type:P dur:82000000 cpbdur:82000000 q:25.00 tex:96028 mv:6574 misc:1158 imb:17 pmb:674 smb:659 d:- ref:0 ; in:3894 out:3894 type:P dur:82000000 cpbdur:82000000 q:24.87 tex:94174 mv:6372 misc:1118 imb:12 pmb:590 smb:748 d:- ref:0 ; in:3895 out:3895 type:P dur:82000000 cpbdur:82000000 q:24.84 tex:91243 mv:6083 misc:1130 imb:11 pmb:587 smb:752 d:- ref:0 ; in:3896 out:3896 type:P dur:82000000 cpbdur:82000000 q:24.74 tex:88446 mv:6077 misc:1117 imb:11 pmb:563 smb:776 d:- ref:0 ; in:3897 out:3897 type:P dur:82000000 cpbdur:82000000 q:24.94 tex:110007 mv:7063 misc:1138 imb:11 pmb:729 smb:610 d:- ref:0 ; in:3898 out:3898 type:P dur:82000000 cpbdur:82000000 q:24.87 tex:93992 mv:6308 misc:1140 imb:13 pmb:600 smb:737 d:- ref:0 ; in:3899 out:3899 type:P dur:82000000 cpbdur:82000000 q:24.82 tex:92236 mv:6181 misc:1071 imb:12 pmb:553 smb:785 d:- ref:0 ; in:3900 out:3900 type:P dur:82000000 cpbdur:82000000 q:24.75 tex:91848 mv:6280 misc:1120 imb:13 pmb:582 smb:755 d:- ref:0 ; in:3901 out:3901 type:P dur:82000000 cpbdur:82000000 q:24.83 tex:107882 mv:6907 misc:1115 imb:21 pmb:699 smb:630 d:- ref:0 ; in:3902 out:3902 type:P dur:82000000 cpbdur:82000000 q:24.87 tex:103035 mv:6898 misc:1115 imb:23 pmb:666 smb:661 d:- ref:0 ; in:3903 out:3903 type:P dur:82000000 cpbdur:82000000 q:24.51 tex:78845 mv:5747 misc:1080 imb:20 pmb:485 smb:845 d:- ref:0 ; in:3904 out:3904 type:P dur:82000000 cpbdur:82000000 q:24.61 tex:91180 mv:6481 misc:1131 imb:20 pmb:601 smb:729 d:- ref:0 ; in:3905 out:3905 type:P dur:82000000 cpbdur:82000000 q:24.68 tex:107708 mv:7077 misc:1143 imb:15 pmb:701 smb:634 d:- ref:0 ; in:3906 out:3906 type:P dur:82000000 cpbdur:82000000 q:24.63 tex:91458 mv:6356 misc:1154 imb:16 pmb:608 smb:726 d:- ref:0 ; in:3907 out:3907 type:P dur:82000000 cpbdur:82000000 q:24.58 tex:99308 mv:6527 misc:1109 imb:15 pmb:677 smb:658 d:- ref:0 ; in:3908 out:3908 type:P dur:82000000 cpbdur:82000000 q:24.85 tex:105423 mv:6979 misc:1126 imb:16 pmb:689 smb:645 d:- ref:0 ; in:3909 out:3909 type:P dur:82000000 cpbdur:82000000 q:24.98 tex:115965 mv:7161 misc:1114 imb:25 pmb:727 smb:598 d:- ref:0 ; in:3910 out:3910 type:P dur:82000000 cpbdur:82000000 q:25.04 tex:118432 mv:7540 misc:1156 imb:19 pmb:746 smb:585 d:- ref:0 ; in:3911 out:3911 type:P dur:82000000 cpbdur:82000000 q:24.95 tex:100391 mv:6588 misc:1149 imb:20 pmb:650 smb:680 d:- ref:0 ; in:3912 out:3912 type:P dur:82000000 cpbdur:82000000 q:24.81 tex:95127 mv:6325 misc:1116 imb:17 pmb:625 smb:708 d:- ref:0 ; in:3913 out:3913 type:P dur:82000000 cpbdur:82000000 q:25.06 tex:121902 mv:7943 misc:1115 imb:39 pmb:759 smb:552 d:- ref:0 ; in:3914 out:3914 type:P dur:82000000 cpbdur:82000000 q:24.92 tex:95035 mv:6274 misc:1139 imb:33 pmb:554 smb:763 d:- ref:0 ; in:3915 out:3915 type:P dur:82000000 cpbdur:82000000 q:25.21 tex:129437 mv:8212 misc:1135 imb:37 pmb:760 smb:553 d:- ref:0 ; in:3916 out:3916 type:P dur:82000000 cpbdur:82000000 q:25.10 tex:113931 mv:7200 misc:1133 imb:25 pmb:714 smb:611 d:- ref:0 ; in:3917 out:3917 type:P dur:82000000 cpbdur:82000000 q:24.90 tex:99242 mv:6534 misc:1096 imb:15 pmb:640 smb:695 d:- ref:0 ; in:3918 out:3918 type:P dur:82000000 cpbdur:82000000 q:24.81 tex:94037 mv:6186 misc:1089 imb:14 pmb:610 smb:726 d:- ref:0 ; in:3919 out:3919 type:P dur:82000000 cpbdur:82000000 q:25.06 tex:116290 mv:7195 misc:1139 imb:33 pmb:721 smb:596 d:- ref:0 ; in:3920 out:3920 type:P dur:82000000 cpbdur:82000000 q:24.97 tex:90895 mv:5840 misc:993 imb:12 pmb:488 smb:850 d:- ref:0 ; in:3921 out:3921 type:P dur:82000000 cpbdur:82000000 q:25.18 tex:116372 mv:7760 misc:1140 imb:23 pmb:740 smb:587 d:- ref:0 ; in:3922 out:3922 type:P dur:82000000 cpbdur:82000000 q:25.30 tex:126571 mv:7571 misc:1154 imb:32 pmb:755 smb:563 d:- ref:0 ; in:3923 out:3923 type:P dur:82000000 cpbdur:82000000 q:24.98 tex:91496 mv:6038 misc:1146 imb:11 pmb:594 smb:745 d:- ref:0 ; in:3924 out:3924 type:P dur:82000000 cpbdur:82000000 q:25.23 tex:119910 mv:7679 misc:1115 imb:39 pmb:723 smb:588 d:- ref:0 ; in:3925 out:3925 type:P dur:82000000 cpbdur:82000000 q:25.15 tex:114927 mv:7177 misc:1120 imb:26 pmb:727 smb:597 d:- ref:0 ; in:3926 out:3926 type:P dur:82000000 cpbdur:82000000 q:24.91 tex:89941 mv:6341 misc:1102 imb:16 pmb:587 smb:747 d:- ref:0 ; in:3927 out:3927 type:P dur:82000000 cpbdur:82000000 q:24.64 tex:81205 mv:6187 misc:1096 imb:18 pmb:527 smb:805 d:- ref:0 ; in:3928 out:3928 type:P dur:82000000 cpbdur:82000000 q:24.68 tex:88682 mv:6206 misc:1104 imb:9 pmb:564 smb:777 d:- ref:0 ; in:3929 out:3929 type:P dur:82000000 cpbdur:82000000 q:24.86 tex:114297 mv:7117 misc:1114 imb:17 pmb:711 smb:622 d:- ref:0 ; in:3930 out:3930 type:P dur:82000000 cpbdur:82000000 q:24.64 tex:82721 mv:5827 misc:1068 imb:16 pmb:487 smb:847 d:- ref:0 ; in:3931 out:3931 type:P dur:82000000 cpbdur:82000000 q:24.70 tex:93345 mv:6191 misc:1152 imb:14 pmb:647 smb:689 d:- ref:0 ; in:3932 out:3932 type:P dur:82000000 cpbdur:82000000 q:24.98 tex:111949 mv:7711 misc:1188 imb:36 pmb:763 smb:551 d:- ref:0 ; in:3933 out:3933 type:P dur:82000000 cpbdur:82000000 q:24.93 tex:102703 mv:6956 misc:1141 imb:24 pmb:674 smb:652 d:- ref:0 ; in:3934 out:3934 type:P dur:82000000 cpbdur:82000000 q:24.85 tex:91553 mv:6398 misc:1177 imb:16 pmb:626 smb:708 d:- ref:0 ; in:3935 out:3935 type:P dur:82000000 cpbdur:82000000 q:25.00 tex:109715 mv:7549 misc:1176 imb:38 pmb:743 smb:569 d:- ref:0 ; in:3936 out:3936 type:P dur:82000000 cpbdur:82000000 q:24.91 tex:97842 mv:6792 misc:1174 imb:25 pmb:656 smb:669 d:- ref:0 ; in:3937 out:3937 type:P dur:82000000 cpbdur:82000000 q:24.71 tex:93743 mv:6442 misc:1199 imb:27 pmb:702 smb:621 d:- ref:0 ; in:3938 out:3938 type:P dur:82000000 cpbdur:82000000 q:24.98 tex:120178 mv:7844 misc:1202 imb:43 pmb:784 smb:523 d:- ref:0 ; in:3939 out:3939 type:P dur:82000000 cpbdur:82000000 q:24.86 tex:104295 mv:7164 misc:1229 imb:42 pmb:734 smb:574 d:- ref:0 ; in:3940 out:3940 type:P dur:82000000 cpbdur:82000000 q:24.65 tex:92442 mv:6524 misc:1170 imb:22 pmb:648 smb:680 d:- ref:0 ; in:3941 out:3941 type:P dur:82000000 cpbdur:82000000 q:24.75 tex:97042 mv:6757 misc:1153 imb:20 pmb:695 smb:635 d:- ref:0 ; in:3942 out:3942 type:P dur:82000000 cpbdur:82000000 q:24.84 tex:105361 mv:7187 misc:1196 imb:34 pmb:737 smb:579 d:- ref:0 ; in:3943 out:3943 type:P dur:82000000 cpbdur:82000000 q:24.72 tex:86557 mv:5999 misc:1100 imb:24 pmb:553 smb:773 d:- ref:0 ; in:3944 out:3944 type:P dur:82000000 cpbdur:82000000 q:24.86 tex:106623 mv:7210 misc:1119 imb:20 pmb:720 smb:610 d:- ref:0 ; in:3945 out:3945 type:P dur:82000000 cpbdur:82000000 q:24.82 tex:97845 mv:6716 misc:1135 imb:8 pmb:668 smb:674 d:- ref:0 ; in:3946 out:3946 type:P dur:82000000 cpbdur:82000000 q:24.65 tex:81264 mv:5952 misc:1104 imb:12 pmb:502 smb:836 d:- ref:0 ; in:3947 out:3947 type:P dur:82000000 cpbdur:82000000 q:24.83 tex:93349 mv:6551 misc:1180 imb:40 pmb:639 smb:671 d:- ref:0 ; in:3948 out:3948 type:P dur:82000000 cpbdur:82000000 q:24.73 tex:92179 mv:6695 misc:1150 imb:19 pmb:647 smb:684 d:- ref:0 ; in:3949 out:3949 type:P dur:82000000 cpbdur:82000000 q:24.63 tex:93043 mv:6233 misc:1116 imb:23 pmb:631 smb:696 d:- ref:0 ; in:3950 out:3950 type:P dur:82000000 cpbdur:82000000 q:24.59 tex:86529 mv:6100 misc:1139 imb:17 pmb:586 smb:747 d:- ref:0 ; in:3951 out:3951 type:P dur:82000000 cpbdur:82000000 q:24.43 tex:105693 mv:6704 misc:1259 imb:25 pmb:712 smb:613 d:- ref:0 ; in:3952 out:3952 type:P dur:82000000 cpbdur:82000000 q:24.71 tex:103957 mv:6979 misc:1104 imb:28 pmb:683 smb:639 d:- ref:0 ; in:3953 out:3953 type:P dur:82000000 cpbdur:82000000 q:24.71 tex:99262 mv:6666 misc:1072 imb:18 pmb:654 smb:678 d:- ref:0 ; in:3954 out:3954 type:P dur:82000000 cpbdur:82000000 q:24.68 tex:91204 mv:6314 misc:1122 imb:18 pmb:584 smb:748 d:- ref:0 ; in:3955 out:3955 type:P dur:82000000 cpbdur:82000000 q:24.69 tex:101004 mv:6652 misc:1112 imb:24 pmb:700 smb:626 d:- ref:0 ; in:3956 out:3956 type:P dur:82000000 cpbdur:82000000 q:24.92 tex:112105 mv:7021 misc:1162 imb:23 pmb:723 smb:604 d:- ref:0 ; in:3957 out:3957 type:P dur:82000000 cpbdur:82000000 q:24.92 tex:105684 mv:7145 misc:1123 imb:20 pmb:717 smb:613 d:- ref:0 ; in:3958 out:3958 type:P dur:82000000 cpbdur:82000000 q:25.06 tex:123105 mv:7944 misc:1175 imb:26 pmb:790 smb:534 d:- ref:0 ; in:3959 out:3959 type:P dur:82000000 cpbdur:82000000 q:25.03 tex:116078 mv:7413 misc:1141 imb:21 pmb:733 smb:596 d:- ref:0 ; in:3960 out:3960 type:P dur:82000000 cpbdur:82000000 q:24.81 tex:94867 mv:6573 misc:1144 imb:28 pmb:625 smb:697 d:- ref:0 ; in:3961 out:3961 type:P dur:82000000 cpbdur:82000000 q:24.77 tex:98716 mv:6573 misc:1135 imb:27 pmb:701 smb:622 d:- ref:0 ; in:3962 out:3962 type:P dur:82000000 cpbdur:82000000 q:24.88 tex:108391 mv:6964 misc:1149 imb:37 pmb:672 smb:641 d:- ref:0 ; in:3963 out:3963 type:P dur:82000000 cpbdur:82000000 q:24.65 tex:86347 mv:5675 misc:1098 imb:17 pmb:551 smb:782 d:- ref:0 ; in:3964 out:3964 type:P dur:82000000 cpbdur:82000000 q:24.71 tex:97876 mv:6756 misc:1160 imb:16 pmb:706 smb:628 d:- ref:0 ; in:3965 out:3965 type:P dur:82000000 cpbdur:82000000 q:24.78 tex:107006 mv:7026 misc:1168 imb:21 pmb:716 smb:613 d:- ref:0 ; in:3966 out:3966 type:P dur:82000000 cpbdur:82000000 q:24.60 tex:84062 mv:5784 misc:1050 imb:12 pmb:504 smb:834 d:- ref:0 ; in:3967 out:3967 type:P dur:82000000 cpbdur:82000000 q:24.85 tex:107295 mv:6901 misc:1164 imb:32 pmb:717 smb:601 d:- ref:0 ; in:3968 out:3968 type:P dur:82000000 cpbdur:82000000 q:25.10 tex:116153 mv:7233 misc:1150 imb:22 pmb:737 smb:591 d:- ref:0 ; in:3969 out:3969 type:P dur:82000000 cpbdur:82000000 q:24.92 tex:97988 mv:6393 misc:1147 imb:14 pmb:665 smb:671 d:- ref:0 ; in:3970 out:3970 type:P dur:82000000 cpbdur:82000000 q:24.78 tex:88875 mv:6115 misc:1122 imb:10 pmb:591 smb:749 d:- ref:0 ; in:3971 out:3971 type:P dur:82000000 cpbdur:82000000 q:24.59 tex:85220 mv:5824 misc:1028 imb:15 pmb:500 smb:835 d:- ref:0 ; in:3972 out:3972 type:P dur:82000000 cpbdur:82000000 q:24.95 tex:117669 mv:7594 misc:1113 imb:33 pmb:722 smb:595 d:- ref:0 ; in:3973 out:3973 type:P dur:82000000 cpbdur:82000000 q:24.91 tex:104158 mv:6765 misc:1077 imb:21 pmb:659 smb:670 d:- ref:0 ; in:3974 out:3974 type:P dur:82000000 cpbdur:82000000 q:24.79 tex:93164 mv:6537 misc:1171 imb:31 pmb:631 smb:688 d:- ref:0 ; in:3975 out:3975 type:P dur:82000000 cpbdur:82000000 q:24.73 tex:91798 mv:6526 misc:1116 imb:25 pmb:638 smb:687 d:- ref:0 ; in:3976 out:3976 type:P dur:82000000 cpbdur:82000000 q:24.81 tex:96258 mv:6737 misc:1141 imb:20 pmb:653 smb:677 d:- ref:0 ; in:3977 out:3977 type:P dur:82000000 cpbdur:82000000 q:24.87 tex:106241 mv:7057 misc:1134 imb:28 pmb:707 smb:615 d:- ref:0 ; in:3978 out:3978 type:P dur:82000000 cpbdur:82000000 q:25.25 tex:128920 mv:8723 misc:1189 imb:52 pmb:779 smb:519 d:- ref:0 ; in:3979 out:3979 type:P dur:82000000 cpbdur:82000000 q:25.29 tex:120606 mv:7910 misc:1140 imb:38 pmb:760 smb:552 d:- ref:0 ; in:3980 out:3980 type:P dur:82000000 cpbdur:82000000 q:25.22 tex:110198 mv:7307 misc:1199 imb:40 pmb:757 smb:553 d:- ref:0 ; in:3981 out:3981 type:P dur:82000000 cpbdur:82000000 q:24.99 tex:97434 mv:6376 misc:1126 imb:11 pmb:640 smb:699 d:- ref:0 ; in:3982 out:3982 type:P dur:82000000 cpbdur:82000000 q:25.15 tex:110733 mv:7186 misc:1177 imb:21 pmb:736 smb:593 d:- ref:0 ; in:3983 out:3983 type:P dur:82000000 cpbdur:82000000 q:24.99 tex:92367 mv:6393 misc:1160 imb:20 pmb:597 smb:733 d:- ref:0 ; in:3984 out:3984 type:P dur:82000000 cpbdur:82000000 q:24.95 tex:97503 mv:6445 misc:1148 imb:22 pmb:631 smb:697 d:- ref:0 ; in:3985 out:3985 type:P dur:82000000 cpbdur:82000000 q:24.81 tex:95721 mv:6067 misc:1108 imb:17 pmb:619 smb:714 d:- ref:0 ; in:3986 out:3986 type:P dur:82000000 cpbdur:82000000 q:24.95 tex:109970 mv:6893 misc:1209 imb:28 pmb:733 smb:589 d:- ref:0 ; in:3987 out:3987 type:P dur:82000000 cpbdur:82000000 q:24.99 tex:110371 mv:7081 misc:1164 imb:30 pmb:725 smb:595 d:- ref:0 ; in:3988 out:3988 type:P dur:82000000 cpbdur:82000000 q:24.93 tex:103095 mv:7011 misc:1174 imb:32 pmb:717 smb:601 d:- ref:0 ; in:3989 out:3989 type:P dur:82000000 cpbdur:82000000 q:24.96 tex:98407 mv:6390 misc:1155 imb:15 pmb:654 smb:681 d:- ref:0 ; in:3990 out:3990 type:P dur:82000000 cpbdur:82000000 q:24.89 tex:96556 mv:6640 misc:1156 imb:14 pmb:644 smb:692 d:- ref:0 ; in:3991 out:3991 type:P dur:82000000 cpbdur:82000000 q:24.81 tex:93742 mv:6128 misc:1106 imb:15 pmb:576 smb:759 d:- ref:0 ; in:3992 out:3992 type:P dur:82000000 cpbdur:82000000 q:24.77 tex:88458 mv:5997 misc:1105 imb:7 pmb:579 smb:764 d:- ref:0 ; in:3993 out:3993 type:P dur:82000000 cpbdur:82000000 q:24.93 tex:111587 mv:6991 misc:1126 imb:11 pmb:717 smb:622 d:- ref:0 ; in:3994 out:3994 type:P dur:82000000 cpbdur:82000000 q:24.81 tex:95215 mv:6372 misc:1085 imb:14 pmb:588 smb:748 d:- ref:0 ; in:3995 out:3995 type:P dur:82000000 cpbdur:82000000 q:24.81 tex:91459 mv:6178 misc:1051 imb:12 pmb:558 smb:780 d:- ref:0 ; in:3996 out:3996 type:P dur:82000000 cpbdur:82000000 q:24.72 tex:92285 mv:6206 misc:1045 imb:18 pmb:540 smb:792 d:- ref:0 ; in:3997 out:3997 type:P dur:82000000 cpbdur:82000000 q:24.79 tex:108460 mv:6818 misc:1130 imb:23 pmb:706 smb:621 d:- ref:0 ; in:3998 out:3998 type:P dur:82000000 cpbdur:82000000 q:24.86 tex:104342 mv:6873 misc:1145 imb:27 pmb:691 smb:632 d:- ref:0 ; in:3999 out:3999 type:P dur:82000000 cpbdur:82000000 q:24.46 tex:92294 mv:5793 misc:1209 imb:21 pmb:573 smb:756 d:- ref:0 ; in:4000 out:4000 type:I dur:82000000 cpbdur:82000000 q:21.94 tex:602710 mv:14924 misc:374 imb:1350 pmb:0 smb:0 d:- ref:; in:4001 out:4001 type:P dur:82000000 cpbdur:82000000 q:28.46 tex:60656 mv:6511 misc:1073 imb:9 pmb:621 smb:720 d:- ref:0 ; in:4002 out:4002 type:P dur:82000000 cpbdur:82000000 q:27.08 tex:67113 mv:6192 misc:1111 imb:16 pmb:566 smb:768 d:- ref:0 ; in:4003 out:4003 type:P dur:82000000 cpbdur:82000000 q:26.02 tex:82682 mv:6425 misc:1109 imb:12 pmb:663 smb:675 d:- ref:0 ; in:4004 out:4004 type:P dur:82000000 cpbdur:82000000 q:25.60 tex:87211 mv:6882 misc:1099 imb:15 pmb:642 smb:693 d:- ref:0 ; in:4005 out:4005 type:P dur:82000000 cpbdur:82000000 q:25.38 tex:119979 mv:7393 misc:1196 imb:25 pmb:757 smb:568 d:- ref:0 ; in:4006 out:4006 type:P dur:82000000 cpbdur:82000000 q:25.26 tex:117702 mv:7701 misc:1213 imb:24 pmb:769 smb:557 d:- ref:0 ; in:4007 out:4007 type:P dur:82000000 cpbdur:82000000 q:25.04 tex:98252 mv:6690 misc:1186 imb:26 pmb:646 smb:678 d:- ref:0 ; in:4008 out:4008 type:P dur:82000000 cpbdur:82000000 q:24.87 tex:94534 mv:6466 misc:1144 imb:19 pmb:618 smb:713 d:- ref:0 ; in:4009 out:4009 type:P dur:82000000 cpbdur:82000000 q:25.07 tex:118318 mv:7791 misc:1139 imb:37 pmb:751 smb:562 d:- ref:0 ; in:4010 out:4010 type:P dur:82000000 cpbdur:82000000 q:24.95 tex:95128 mv:6419 misc:1141 imb:25 pmb:603 smb:722 d:- ref:0 ; in:4011 out:4011 type:P dur:82000000 cpbdur:82000000 q:25.24 tex:127145 mv:8297 misc:1158 imb:37 pmb:773 smb:540 d:- ref:0 ; in:4012 out:4012 type:P dur:82000000 cpbdur:82000000 q:25.12 tex:113843 mv:7090 misc:1123 imb:20 pmb:708 smb:622 d:- ref:0 ; in:4013 out:4013 type:P dur:82000000 cpbdur:82000000 q:24.91 tex:99077 mv:6572 misc:1127 imb:24 pmb:646 smb:680 d:- ref:0 ; in:4014 out:4014 type:P dur:82000000 cpbdur:82000000 q:24.89 tex:101358 mv:6452 misc:1294 imb:15 pmb:730 smb:605 d:- ref:0 ; in:4015 out:4015 type:P dur:82000000 cpbdur:82000000 q:27.45 tex:188064 mv:14836 misc:1420 imb:1272 pmb:78 smb:0 d:- ref:0 ; in:4016 out:4016 type:P dur:82000000 cpbdur:82000000 q:25.91 tex:47281 mv:3595 misc:1252 imb:24 pmb:533 smb:793 d:- ref:0 ; in:4017 out:4017 type:P dur:82000000 cpbdur:82000000 q:24.85 tex:64064 mv:4625 misc:1407 imb:55 pmb:643 smb:652 d:- ref:0 ; in:4018 out:4018 type:P dur:82000000 cpbdur:82000000 q:24.64 tex:83266 mv:4937 misc:1357 imb:87 pmb:491 smb:772 d:- ref:0 ; in:4019 out:4019 type:P dur:82000000 cpbdur:82000000 q:22.43 tex:75946 mv:4799 misc:1527 imb:159 pmb:905 smb:286 d:- ref:0 ; in:4020 out:4020 type:P dur:82000000 cpbdur:82000000 q:21.02 tex:36223 mv:3421 misc:1540 imb:75 pmb:807 smb:468 d:- ref:0 ; in:4021 out:4021 type:P dur:82000000 cpbdur:82000000 q:22.96 tex:95344 mv:4141 misc:1155 imb:45 pmb:433 smb:872 d:- ref:0 ; in:4022 out:4022 type:P dur:82000000 cpbdur:82000000 q:20.96 tex:52794 mv:2894 misc:1480 imb:50 pmb:706 smb:594 d:- ref:0 ; in:4023 out:4023 type:P dur:82000000 cpbdur:82000000 q:19.54 tex:32906 mv:2891 misc:1571 imb:60 pmb:715 smb:575 d:- ref:0 ; in:4024 out:4024 type:P dur:82000000 cpbdur:82000000 q:22.72 tex:97325 mv:4614 misc:1149 imb:51 pmb:418 smb:881 d:- ref:0 ; in:4025 out:4025 type:P dur:82000000 cpbdur:82000000 q:20.78 tex:44801 mv:1968 misc:1303 imb:32 pmb:504 smb:814 d:- ref:0 ; in:4026 out:4026 type:P dur:82000000 cpbdur:82000000 q:19.44 tex:87121 mv:4671 misc:1536 imb:89 pmb:1065 smb:196 d:- ref:0 ; in:4027 out:4027 type:P dur:82000000 cpbdur:82000000 q:22.76 tex:97284 mv:4186 misc:1058 imb:49 pmb:378 smb:923 d:- ref:0 ; in:4028 out:4028 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:52842 mv:2078 misc:1184 imb:25 pmb:432 smb:893 d:- ref:0 ; in:4029 out:4029 type:P dur:82000000 cpbdur:82000000 q:20.39 tex:50393 mv:2427 misc:1428 imb:60 pmb:569 smb:721 d:- ref:0 ; in:4030 out:4030 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:89611 mv:3906 misc:1123 imb:31 pmb:420 smb:899 d:- ref:0 ; in:4031 out:4031 type:P dur:82000000 cpbdur:82000000 q:20.63 tex:40501 mv:2231 misc:1380 imb:46 pmb:535 smb:769 d:- ref:0 ; in:4032 out:4032 type:P dur:82000000 cpbdur:82000000 q:19.72 tex:32603 mv:2339 misc:1442 imb:40 pmb:569 smb:741 d:- ref:0 ; in:4033 out:4033 type:P dur:82000000 cpbdur:82000000 q:22.80 tex:100859 mv:4228 misc:1073 imb:43 pmb:398 smb:909 d:- ref:0 ; in:4034 out:4034 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:42724 mv:2017 misc:1339 imb:39 pmb:509 smb:802 d:- ref:0 ; in:4035 out:4035 type:P dur:82000000 cpbdur:82000000 q:19.62 tex:31464 mv:2337 misc:1463 imb:43 pmb:547 smb:760 d:- ref:0 ; in:4036 out:4036 type:P dur:82000000 cpbdur:82000000 q:22.66 tex:97016 mv:4082 misc:1094 imb:40 pmb:406 smb:904 d:- ref:0 ; in:4037 out:4037 type:P dur:82000000 cpbdur:82000000 q:20.62 tex:42840 mv:1890 misc:1294 imb:31 pmb:484 smb:835 d:- ref:0 ; in:4038 out:4038 type:P dur:82000000 cpbdur:82000000 q:19.39 tex:75842 mv:4372 misc:1554 imb:62 pmb:998 smb:290 d:- ref:0 ; in:4039 out:4039 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:95724 mv:4222 misc:1070 imb:50 pmb:386 smb:914 d:- ref:0 ; in:4040 out:4040 type:P dur:82000000 cpbdur:82000000 q:20.55 tex:38302 mv:1732 misc:1254 imb:19 pmb:468 smb:863 d:- ref:0 ; in:4041 out:4041 type:P dur:82000000 cpbdur:82000000 q:19.22 tex:64934 mv:3828 misc:1558 imb:91 pmb:844 smb:415 d:- ref:0 ; in:4042 out:4042 type:P dur:82000000 cpbdur:82000000 q:22.94 tex:104553 mv:4558 misc:1121 imb:37 pmb:412 smb:901 d:- ref:0 ; in:4043 out:4043 type:P dur:82000000 cpbdur:82000000 q:20.86 tex:42740 mv:1769 misc:1243 imb:21 pmb:475 smb:854 d:- ref:0 ; in:4044 out:4044 type:P dur:82000000 cpbdur:82000000 q:19.62 tex:28030 mv:1830 misc:1324 imb:33 pmb:462 smb:855 d:- ref:0 ; in:4045 out:4045 type:P dur:82000000 cpbdur:82000000 q:22.72 tex:93116 mv:3842 misc:1066 imb:41 pmb:388 smb:921 d:- ref:0 ; in:4046 out:4046 type:P dur:82000000 cpbdur:82000000 q:20.65 tex:42759 mv:1736 misc:1233 imb:25 pmb:468 smb:857 d:- ref:0 ; in:4047 out:4047 type:P dur:82000000 cpbdur:82000000 q:19.12 tex:66556 mv:3940 misc:1568 imb:67 pmb:910 smb:373 d:- ref:0 ; in:4048 out:4048 type:P dur:82000000 cpbdur:82000000 q:22.71 tex:98127 mv:4305 misc:1096 imb:50 pmb:409 smb:891 d:- ref:0 ; in:4049 out:4049 type:P dur:82000000 cpbdur:82000000 q:20.51 tex:39422 mv:1632 misc:1186 imb:18 pmb:448 smb:884 d:- ref:0 ; in:4050 out:4050 type:P dur:82000000 cpbdur:82000000 q:19.24 tex:66164 mv:3438 misc:1566 imb:55 pmb:842 smb:453 d:- ref:0 ; in:4051 out:4051 type:P dur:82000000 cpbdur:82000000 q:22.51 tex:94152 mv:3762 misc:1062 imb:42 pmb:398 smb:910 d:- ref:0 ; in:4052 out:4052 type:P dur:82000000 cpbdur:82000000 q:20.99 tex:51538 mv:1762 misc:1260 imb:17 pmb:472 smb:861 d:- ref:0 ; in:4053 out:4053 type:P dur:82000000 cpbdur:82000000 q:19.88 tex:28766 mv:2070 misc:1356 imb:36 pmb:500 smb:814 d:- ref:0 ; in:4054 out:4054 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:96809 mv:4060 misc:1083 imb:50 pmb:400 smb:900 d:- ref:0 ; in:4055 out:4055 type:P dur:82000000 cpbdur:82000000 q:20.84 tex:44987 mv:1877 misc:1280 imb:29 pmb:491 smb:830 d:- ref:0 ; in:4056 out:4056 type:P dur:82000000 cpbdur:82000000 q:19.48 tex:68110 mv:4201 misc:1561 imb:83 pmb:915 smb:352 d:- ref:0 ; in:4057 out:4057 type:P dur:82000000 cpbdur:82000000 q:22.92 tex:100583 mv:4306 misc:1047 imb:52 pmb:380 smb:918 d:- ref:0 ; in:4058 out:4058 type:P dur:82000000 cpbdur:82000000 q:21.40 tex:55034 mv:1926 misc:1200 imb:19 pmb:472 smb:859 d:- ref:0 ; in:4059 out:4059 type:P dur:82000000 cpbdur:82000000 q:20.12 tex:31021 mv:1793 misc:1306 imb:26 pmb:451 smb:873 d:- ref:0 ; in:4060 out:4060 type:P dur:82000000 cpbdur:82000000 q:22.63 tex:89388 mv:4007 misc:1101 imb:41 pmb:409 smb:900 d:- ref:0 ; in:4061 out:4061 type:P dur:82000000 cpbdur:82000000 q:20.66 tex:41985 mv:1839 misc:1248 imb:27 pmb:479 smb:844 d:- ref:0 ; in:4062 out:4062 type:P dur:82000000 cpbdur:82000000 q:19.85 tex:36801 mv:2118 misc:1409 imb:33 pmb:526 smb:791 d:- ref:0 ; in:4063 out:4063 type:P dur:82000000 cpbdur:82000000 q:22.86 tex:101454 mv:4507 misc:1087 imb:39 pmb:401 smb:910 d:- ref:0 ; in:4064 out:4064 type:P dur:82000000 cpbdur:82000000 q:21.74 tex:41831 mv:2008 misc:1337 imb:24 pmb:508 smb:818 d:- ref:0 ; in:4065 out:4065 type:P dur:82000000 cpbdur:82000000 q:19.91 tex:48604 mv:2579 misc:1433 imb:52 pmb:611 smb:687 d:- ref:0 ; in:4066 out:4066 type:P dur:82000000 cpbdur:82000000 q:22.96 tex:99307 mv:4472 misc:1109 imb:44 pmb:416 smb:890 d:- ref:0 ; in:4067 out:4067 type:P dur:82000000 cpbdur:82000000 q:20.91 tex:43510 mv:2109 misc:1349 imb:45 pmb:511 smb:794 d:- ref:0 ; in:4068 out:4068 type:P dur:82000000 cpbdur:82000000 q:19.73 tex:29256 mv:1984 misc:1344 imb:36 pmb:498 smb:816 d:- ref:0 ; in:4069 out:4069 type:P dur:82000000 cpbdur:82000000 q:22.72 tex:99136 mv:4270 misc:1130 imb:57 pmb:396 smb:897 d:- ref:0 ; in:4070 out:4070 type:P dur:82000000 cpbdur:82000000 q:21.01 tex:49684 mv:2325 misc:1343 imb:55 pmb:523 smb:772 d:- ref:0 ; in:4071 out:4071 type:P dur:82000000 cpbdur:82000000 q:19.50 tex:67984 mv:3874 misc:1590 imb:49 pmb:920 smb:381 d:- ref:0 ; in:4072 out:4072 type:P dur:82000000 cpbdur:82000000 q:22.89 tex:103306 mv:4558 misc:1072 imb:47 pmb:396 smb:907 d:- ref:0 ; in:4073 out:4073 type:P dur:82000000 cpbdur:82000000 q:20.93 tex:44996 mv:1983 misc:1309 imb:35 pmb:495 smb:820 d:- ref:0 ; in:4074 out:4074 type:P dur:82000000 cpbdur:82000000 q:19.65 tex:28715 mv:1749 misc:1336 imb:19 pmb:485 smb:846 d:- ref:0 ; in:4075 out:4075 type:P dur:82000000 cpbdur:82000000 q:22.71 tex:97833 mv:4174 misc:1065 imb:41 pmb:392 smb:917 d:- ref:0 ; in:4076 out:4076 type:P dur:82000000 cpbdur:82000000 q:20.97 tex:49624 mv:1997 misc:1267 imb:39 pmb:479 smb:832 d:- ref:0 ; in:4077 out:4077 type:P dur:82000000 cpbdur:82000000 q:19.61 tex:23634 mv:2485 misc:1409 imb:82 pmb:491 smb:777 d:- ref:0 ; in:4078 out:4078 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:97895 mv:4262 misc:1083 imb:35 pmb:400 smb:915 d:- ref:0 ; in:4079 out:4079 type:P dur:82000000 cpbdur:82000000 q:20.93 tex:51468 mv:2044 misc:1288 imb:32 pmb:498 smb:820 d:- ref:0 ; in:4080 out:4080 type:P dur:82000000 cpbdur:82000000 q:19.68 tex:30550 mv:2003 misc:1359 imb:39 pmb:481 smb:830 d:- ref:0 ; in:4081 out:4081 type:P dur:82000000 cpbdur:82000000 q:22.48 tex:106270 mv:3957 misc:1141 imb:46 pmb:419 smb:885 d:- ref:0 ; in:4082 out:4082 type:P dur:82000000 cpbdur:82000000 q:21.11 tex:41290 mv:2039 misc:1271 imb:46 pmb:451 smb:853 d:- ref:0 ; in:4083 out:4083 type:P dur:82000000 cpbdur:82000000 q:19.63 tex:22719 mv:2264 misc:1393 imb:55 pmb:504 smb:791 d:- ref:0 ; in:4084 out:4084 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:96369 mv:4693 misc:1066 imb:47 pmb:393 smb:910 d:- ref:0 ; in:4085 out:4085 type:P dur:82000000 cpbdur:82000000 q:22.79 tex:62063 mv:4226 misc:1359 imb:39 pmb:618 smb:693 d:- ref:0 ; in:4086 out:4086 type:P dur:82000000 cpbdur:82000000 q:22.90 tex:71430 mv:4525 misc:1285 imb:30 pmb:585 smb:735 d:- ref:0 ; in:4087 out:4087 type:P dur:82000000 cpbdur:82000000 q:26.62 tex:197550 mv:15255 misc:1419 imb:1237 pmb:113 smb:0 d:- ref:0 ; in:4088 out:4088 type:P dur:82000000 cpbdur:82000000 q:24.57 tex:32092 mv:2063 misc:1309 imb:14 pmb:561 smb:775 d:- ref:0 ; in:4089 out:4089 type:P dur:82000000 cpbdur:82000000 q:22.45 tex:78321 mv:3850 misc:1477 imb:118 pmb:852 smb:380 d:- ref:0 ; in:4090 out:4090 type:P dur:82000000 cpbdur:82000000 q:21.68 tex:53311 mv:2930 misc:1375 imb:74 pmb:576 smb:700 d:- ref:0 ; in:4091 out:4091 type:P dur:82000000 cpbdur:82000000 q:21.77 tex:72734 mv:4644 misc:1350 imb:43 pmb:626 smb:681 d:- ref:0 ; in:4092 out:4092 type:P dur:82000000 cpbdur:82000000 q:21.46 tex:71047 mv:4684 misc:1453 imb:89 pmb:682 smb:579 d:- ref:0 ; in:4093 out:4093 type:P dur:82000000 cpbdur:82000000 q:19.87 tex:38209 mv:2347 misc:1396 imb:36 pmb:565 smb:749 d:- ref:0 ; in:4094 out:4094 type:P dur:82000000 cpbdur:82000000 q:18.83 tex:64440 mv:3670 misc:1530 imb:82 pmb:886 smb:382 d:- ref:0 ; in:4095 out:4095 type:P dur:82000000 cpbdur:82000000 q:19.26 tex:65090 mv:2271 misc:1327 imb:15 pmb:545 smb:790 d:- ref:0 ; in:4096 out:4096 type:P dur:82000000 cpbdur:82000000 q:21.17 tex:78144 mv:4738 misc:1350 imb:59 pmb:642 smb:649 d:- ref:0 ; in:4097 out:4097 type:P dur:82000000 cpbdur:82000000 q:21.59 tex:62382 mv:4128 misc:1210 imb:14 pmb:564 smb:772 d:- ref:0 ; in:4098 out:4098 type:P dur:82000000 cpbdur:82000000 q:20.90 tex:47435 mv:3676 misc:1481 imb:133 pmb:598 smb:619 d:- ref:0 ; in:4099 out:4099 type:P dur:82000000 cpbdur:82000000 q:21.05 tex:66880 mv:3870 misc:1370 imb:51 pmb:638 smb:661 d:- ref:0 ; in:4100 out:4100 type:P dur:82000000 cpbdur:82000000 q:20.22 tex:43315 mv:2572 misc:1401 imb:53 pmb:568 smb:729 d:- ref:0 ; in:4101 out:4101 type:P dur:82000000 cpbdur:82000000 q:19.42 tex:58081 mv:3754 misc:1517 imb:78 pmb:790 smb:482 d:- ref:0 ; in:4102 out:4102 type:P dur:82000000 cpbdur:82000000 q:19.76 tex:37952 mv:2507 misc:1269 imb:32 pmb:485 smb:833 d:- ref:0 ; in:4103 out:4103 type:P dur:82000000 cpbdur:82000000 q:19.69 tex:31686 mv:2585 misc:1305 imb:59 pmb:455 smb:836 d:- ref:0 ; in:4104 out:4104 type:P dur:82000000 cpbdur:82000000 q:19.63 tex:32245 mv:2563 misc:1416 imb:79 pmb:495 smb:776 d:- ref:0 ; in:4105 out:4105 type:P dur:82000000 cpbdur:82000000 q:20.91 tex:72091 mv:4914 misc:1427 imb:116 pmb:640 smb:594 d:- ref:0 ; in:4106 out:4106 type:P dur:82000000 cpbdur:82000000 q:21.38 tex:71287 mv:4743 misc:1346 imb:65 pmb:617 smb:668 d:- ref:0 ; in:4107 out:4107 type:P dur:82000000 cpbdur:82000000 q:20.82 tex:47364 mv:1897 misc:1187 imb:7 pmb:443 smb:900 d:- ref:0 ; in:4108 out:4108 type:P dur:82000000 cpbdur:82000000 q:20.98 tex:56452 mv:3140 misc:1264 imb:25 pmb:546 smb:779 d:- ref:0 ; in:4109 out:4109 type:P dur:82000000 cpbdur:82000000 q:21.37 tex:71468 mv:4541 misc:1279 imb:33 pmb:597 smb:720 d:- ref:0 ; in:4110 out:4110 type:P dur:82000000 cpbdur:82000000 q:21.41 tex:61052 mv:4245 misc:1223 imb:18 pmb:577 smb:755 d:- ref:0 ; in:4111 out:4111 type:P dur:82000000 cpbdur:82000000 q:21.42 tex:63604 mv:4104 misc:1188 imb:16 pmb:578 smb:756 d:- ref:0 ; in:4112 out:4112 type:P dur:82000000 cpbdur:82000000 q:21.75 tex:58685 mv:4343 misc:1284 imb:25 pmb:591 smb:734 d:- ref:0 ; in:4113 out:4113 type:P dur:82000000 cpbdur:82000000 q:20.94 tex:46329 mv:2075 misc:1316 imb:21 pmb:507 smb:822 d:- ref:0 ; in:4114 out:4114 type:P dur:82000000 cpbdur:82000000 q:20.58 tex:51113 mv:2677 misc:1162 imb:15 pmb:475 smb:860 d:- ref:0 ; in:4115 out:4115 type:P dur:82000000 cpbdur:82000000 q:19.93 tex:48596 mv:2381 misc:1287 imb:19 pmb:539 smb:792 d:- ref:0 ; in:4116 out:4116 type:P dur:82000000 cpbdur:82000000 q:20.15 tex:51321 mv:2544 misc:1239 imb:8 pmb:474 smb:868 d:- ref:0 ; in:4117 out:4117 type:P dur:82000000 cpbdur:82000000 q:20.10 tex:46826 mv:2286 misc:1160 imb:6 pmb:438 smb:906 d:- ref:0 ; in:4118 out:4118 type:P dur:82000000 cpbdur:82000000 q:19.05 tex:50421 mv:3469 misc:1518 imb:68 pmb:765 smb:517 d:- ref:0 ; in:4119 out:4119 type:P dur:82000000 cpbdur:82000000 q:23.05 tex:128894 mv:10622 misc:1252 imb:399 pmb:418 smb:533 d:- ref:0 ; in:4120 out:4120 type:P dur:82000000 cpbdur:82000000 q:22.05 tex:38795 mv:3200 misc:1357 imb:91 pmb:508 smb:751 d:- ref:0 ; in:4121 out:4121 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:47051 mv:3367 misc:1478 imb:107 pmb:599 smb:644 d:- ref:0 ; in:4122 out:4122 type:P dur:82000000 cpbdur:82000000 q:24.27 tex:122588 mv:8703 misc:1181 imb:309 pmb:371 smb:670 d:- ref:0 ; in:4123 out:4123 type:P dur:82000000 cpbdur:82000000 q:22.43 tex:52583 mv:2637 misc:1284 imb:66 pmb:517 smb:767 d:- ref:0 ; in:4124 out:4124 type:P dur:82000000 cpbdur:82000000 q:21.09 tex:46352 mv:2742 misc:1346 imb:47 pmb:548 smb:755 d:- ref:0 ; in:4125 out:4125 type:P dur:82000000 cpbdur:82000000 q:24.69 tex:128232 mv:9921 misc:1255 imb:319 pmb:455 smb:576 d:- ref:0 ; in:4126 out:4126 type:P dur:82000000 cpbdur:82000000 q:23.23 tex:61007 mv:3325 misc:1300 imb:50 pmb:547 smb:753 d:- ref:0 ; in:4127 out:4127 type:P dur:82000000 cpbdur:82000000 q:21.52 tex:38136 mv:2974 misc:1394 imb:87 pmb:554 smb:709 d:- ref:0 ; in:4128 out:4128 type:P dur:82000000 cpbdur:82000000 q:24.62 tex:125390 mv:10226 misc:1248 imb:252 pmb:474 smb:624 d:- ref:0 ; in:4129 out:4129 type:P dur:82000000 cpbdur:82000000 q:23.26 tex:57661 mv:3441 misc:1306 imb:78 pmb:567 smb:705 d:- ref:0 ; in:4130 out:4130 type:P dur:82000000 cpbdur:82000000 q:22.33 tex:61633 mv:4371 misc:1380 imb:100 pmb:551 smb:699 d:- ref:0 ; in:4131 out:4131 type:P dur:82000000 cpbdur:82000000 q:21.97 tex:72262 mv:3932 misc:1342 imb:89 pmb:558 smb:703 d:- ref:0 ; in:4132 out:4132 type:P dur:82000000 cpbdur:82000000 q:21.73 tex:50385 mv:4079 misc:1392 imb:140 pmb:449 smb:761 d:- ref:0 ; in:4133 out:4133 type:P dur:82000000 cpbdur:82000000 q:20.69 tex:48505 mv:4013 misc:1522 imb:168 pmb:623 smb:559 d:- ref:0 ; in:4134 out:4134 type:P dur:82000000 cpbdur:82000000 q:21.68 tex:72084 mv:5309 misc:1287 imb:56 pmb:593 smb:701 d:- ref:0 ; in:4135 out:4135 type:P dur:82000000 cpbdur:82000000 q:20.89 tex:61988 mv:3365 misc:1391 imb:51 pmb:595 smb:704 d:- ref:0 ; in:4136 out:4136 type:P dur:82000000 cpbdur:82000000 q:19.65 tex:44692 mv:2078 misc:1342 imb:33 pmb:518 smb:799 d:- ref:0 ; in:4137 out:4137 type:P dur:82000000 cpbdur:82000000 q:20.10 tex:55765 mv:3784 misc:1451 imb:103 pmb:606 smb:641 d:- ref:0 ; in:4138 out:4138 type:P dur:82000000 cpbdur:82000000 q:19.94 tex:51300 mv:2479 misc:1333 imb:54 pmb:497 smb:799 d:- ref:0 ; in:4139 out:4139 type:P dur:82000000 cpbdur:82000000 q:20.36 tex:58302 mv:4753 misc:1393 imb:71 pmb:657 smb:622 d:- ref:0 ; in:4140 out:4140 type:P dur:82000000 cpbdur:82000000 q:20.50 tex:38491 mv:3985 misc:1332 imb:43 pmb:609 smb:698 d:- ref:0 ; in:4141 out:4141 type:P dur:82000000 cpbdur:82000000 q:20.42 tex:56987 mv:3599 misc:1438 imb:88 pmb:599 smb:663 d:- ref:0 ; in:4142 out:4142 type:P dur:82000000 cpbdur:82000000 q:19.25 tex:65171 mv:4688 misc:1557 imb:134 pmb:840 smb:376 d:- ref:0 ; in:4143 out:4143 type:P dur:82000000 cpbdur:82000000 q:19.30 tex:56052 mv:3619 misc:1497 imb:68 pmb:679 smb:603 d:- ref:0 ; in:4144 out:4144 type:P dur:82000000 cpbdur:82000000 q:19.57 tex:50318 mv:2808 misc:1362 imb:58 pmb:548 smb:744 d:- ref:0 ; in:4145 out:4145 type:P dur:82000000 cpbdur:82000000 q:19.91 tex:47616 mv:2842 misc:1230 imb:45 pmb:496 smb:809 d:- ref:0 ; in:4146 out:4146 type:P dur:82000000 cpbdur:82000000 q:19.69 tex:39309 mv:2434 misc:1321 imb:50 pmb:492 smb:808 d:- ref:0 ; in:4147 out:4147 type:P dur:82000000 cpbdur:82000000 q:19.72 tex:36307 mv:2758 misc:1359 imb:65 pmb:470 smb:815 d:- ref:0 ; in:4148 out:4148 type:P dur:82000000 cpbdur:82000000 q:19.25 tex:53556 mv:4577 misc:1555 imb:137 pmb:765 smb:448 d:- ref:0 ; in:4149 out:4149 type:P dur:82000000 cpbdur:82000000 q:18.88 tex:37759 mv:2327 misc:1410 imb:39 pmb:519 smb:792 d:- ref:0 ; in:4150 out:4150 type:P dur:82000000 cpbdur:82000000 q:19.40 tex:44303 mv:6338 misc:1583 imb:289 pmb:816 smb:245 d:- ref:0 ; in:4151 out:4151 type:P dur:82000000 cpbdur:82000000 q:19.11 tex:48354 mv:3350 misc:1424 imb:73 pmb:618 smb:659 d:- ref:0 ; in:4152 out:4152 type:P dur:82000000 cpbdur:82000000 q:17.92 tex:32149 mv:2803 misc:1544 imb:64 pmb:609 smb:677 d:- ref:0 ; in:4153 out:4153 type:P dur:82000000 cpbdur:82000000 q:17.23 tex:61151 mv:3922 misc:1559 imb:83 pmb:920 smb:347 d:- ref:0 ; in:4154 out:4154 type:P dur:82000000 cpbdur:82000000 q:18.31 tex:42093 mv:2243 misc:1440 imb:23 pmb:557 smb:770 d:- ref:0 ; in:4155 out:4155 type:P dur:82000000 cpbdur:82000000 q:16.97 tex:30568 mv:2407 misc:1537 imb:19 pmb:691 smb:640 d:- ref:0 ; in:4156 out:4156 type:P dur:82000000 cpbdur:82000000 q:17.51 tex:36129 mv:1476 misc:1139 imb:1 pmb:380 smb:969 d:- ref:0 ; in:4157 out:4157 type:P dur:82000000 cpbdur:82000000 q:17.63 tex:26636 mv:1959 misc:1389 imb:22 pmb:523 smb:805 d:- ref:0 ; in:4158 out:4158 type:P dur:82000000 cpbdur:82000000 q:21.63 tex:335383 mv:16056 misc:1417 imb:1250 pmb:100 smb:0 d:- ref:0 ; in:4159 out:4159 type:P dur:82000000 cpbdur:82000000 q:25.16 tex:37652 mv:4631 misc:1453 imb:67 pmb:645 smb:638 d:- ref:0 ; in:4160 out:4160 type:P dur:82000000 cpbdur:82000000 q:24.20 tex:43854 mv:5069 misc:1453 imb:26 pmb:707 smb:617 d:- ref:0 ; in:4161 out:4161 type:P dur:82000000 cpbdur:82000000 q:24.57 tex:86862 mv:8606 misc:1436 imb:154 pmb:688 smb:508 d:- ref:0 ; in:4162 out:4162 type:P dur:82000000 cpbdur:82000000 q:22.64 tex:38585 mv:2931 misc:1508 imb:27 pmb:763 smb:560 d:- ref:0 ; in:4163 out:4163 type:P dur:82000000 cpbdur:82000000 q:20.83 tex:68621 mv:4210 misc:1529 imb:86 pmb:1002 smb:262 d:- ref:0 ; in:4164 out:4164 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:107652 mv:8079 misc:1205 imb:203 pmb:509 smb:638 d:- ref:0 ; in:4165 out:4165 type:P dur:82000000 cpbdur:82000000 q:22.04 tex:44211 mv:2892 misc:1449 imb:38 pmb:726 smb:586 d:- ref:0 ; in:4166 out:4166 type:P dur:82000000 cpbdur:82000000 q:20.29 tex:67996 mv:3354 misc:1474 imb:32 pmb:944 smb:374 d:- ref:0 ; in:4167 out:4167 type:P dur:82000000 cpbdur:82000000 q:23.31 tex:103029 mv:7969 misc:1282 imb:157 pmb:549 smb:644 d:- ref:0 ; in:4168 out:4168 type:P dur:82000000 cpbdur:82000000 q:21.93 tex:54062 mv:2798 misc:1452 imb:17 pmb:662 smb:671 d:- ref:0 ; in:4169 out:4169 type:P dur:82000000 cpbdur:82000000 q:20.76 tex:49169 mv:3097 misc:1526 imb:23 pmb:793 smb:534 d:- ref:0 ; in:4170 out:4170 type:P dur:82000000 cpbdur:82000000 q:23.05 tex:92134 mv:7987 misc:1183 imb:182 pmb:497 smb:671 d:- ref:0 ; in:4171 out:4171 type:P dur:82000000 cpbdur:82000000 q:21.57 tex:46495 mv:2274 misc:1295 imb:20 pmb:538 smb:792 d:- ref:0 ; in:4172 out:4172 type:P dur:82000000 cpbdur:82000000 q:20.59 tex:52350 mv:2825 misc:1473 imb:27 pmb:675 smb:648 d:- ref:0 ; in:4173 out:4173 type:P dur:82000000 cpbdur:82000000 q:23.23 tex:98756 mv:8240 misc:1188 imb:194 pmb:496 smb:660 d:- ref:0 ; in:4174 out:4174 type:P dur:82000000 cpbdur:82000000 q:21.93 tex:45894 mv:2939 misc:1423 imb:57 pmb:681 smb:612 d:- ref:0 ; in:4175 out:4175 type:P dur:82000000 cpbdur:82000000 q:20.68 tex:46864 mv:3181 misc:1483 imb:66 pmb:729 smb:555 d:- ref:0 ; in:4176 out:4176 type:P dur:82000000 cpbdur:82000000 q:23.42 tex:113345 mv:9242 misc:1325 imb:232 pmb:584 smb:534 d:- ref:0 ; in:4177 out:4177 type:P dur:82000000 cpbdur:82000000 q:21.59 tex:36180 mv:2537 misc:1499 imb:20 pmb:671 smb:659 d:- ref:0 ; in:4178 out:4178 type:P dur:82000000 cpbdur:82000000 q:19.99 tex:64195 mv:3357 misc:1504 imb:47 pmb:931 smb:372 d:- ref:0 ; in:4179 out:4179 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:95189 mv:7966 misc:1173 imb:178 pmb:514 smb:658 d:- ref:0 ; in:4180 out:4180 type:P dur:82000000 cpbdur:82000000 q:21.45 tex:65702 mv:2890 misc:1384 imb:55 pmb:710 smb:585 d:- ref:0 ; in:4181 out:4181 type:P dur:82000000 cpbdur:82000000 q:19.73 tex:34306 mv:2068 misc:1442 imb:5 pmb:648 smb:697 d:- ref:0 ; in:4182 out:4182 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:103084 mv:8406 misc:1246 imb:151 pmb:550 smb:649 d:- ref:0 ; in:4183 out:4183 type:P dur:82000000 cpbdur:82000000 q:23.31 tex:75713 mv:6161 misc:1486 imb:89 pmb:849 smb:412 d:- ref:0 ; in:4184 out:4184 type:P dur:82000000 cpbdur:82000000 q:23.25 tex:76180 mv:7603 misc:1489 imb:135 pmb:877 smb:338 d:- ref:0 ; in:4185 out:4185 type:P dur:82000000 cpbdur:82000000 q:24.51 tex:92270 mv:10312 misc:1442 imb:227 pmb:732 smb:391 d:- ref:0 ; in:4186 out:4186 type:P dur:82000000 cpbdur:82000000 q:23.44 tex:71786 mv:6478 misc:1448 imb:93 pmb:866 smb:391 d:- ref:0 ; in:4187 out:4187 type:P dur:82000000 cpbdur:82000000 q:22.65 tex:44168 mv:4518 misc:1474 imb:92 pmb:734 smb:524 d:- ref:0 ; in:4188 out:4188 type:P dur:82000000 cpbdur:82000000 q:24.07 tex:94139 mv:9823 misc:1430 imb:187 pmb:733 smb:430 d:- ref:0 ; in:4189 out:4189 type:P dur:82000000 cpbdur:82000000 q:23.37 tex:65568 mv:5751 misc:1465 imb:114 pmb:827 smb:409 d:- ref:0 ; in:4190 out:4190 type:P dur:82000000 cpbdur:82000000 q:22.85 tex:56261 mv:5310 misc:1453 imb:77 pmb:792 smb:481 d:- ref:0 ; in:4191 out:4191 type:P dur:82000000 cpbdur:82000000 q:24.20 tex:80321 mv:9090 misc:1405 imb:194 pmb:704 smb:452 d:- ref:0 ; in:4192 out:4192 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:40464 mv:3945 misc:1479 imb:68 pmb:735 smb:547 d:- ref:0 ; in:4193 out:4193 type:P dur:82000000 cpbdur:82000000 q:22.18 tex:72925 mv:6095 misc:1412 imb:110 pmb:893 smb:347 d:- ref:0 ; in:4194 out:4194 type:P dur:82000000 cpbdur:82000000 q:23.24 tex:78807 mv:8031 misc:1426 imb:188 pmb:665 smb:497 d:- ref:0 ; in:4195 out:4195 type:P dur:82000000 cpbdur:82000000 q:22.48 tex:68119 mv:6336 misc:1433 imb:101 pmb:820 smb:429 d:- ref:0 ; in:4196 out:4196 type:P dur:82000000 cpbdur:82000000 q:22.18 tex:60345 mv:6394 misc:1421 imb:108 pmb:806 smb:436 d:- ref:0 ; in:4197 out:4197 type:P dur:82000000 cpbdur:82000000 q:23.26 tex:71998 mv:7807 misc:1363 imb:152 pmb:645 smb:553 d:- ref:0 ; in:4198 out:4198 type:P dur:82000000 cpbdur:82000000 q:22.52 tex:42143 mv:5276 misc:1381 imb:88 pmb:706 smb:556 d:- ref:0 ; in:4199 out:4199 type:P dur:82000000 cpbdur:82000000 q:21.86 tex:51447 mv:5207 misc:1386 imb:102 pmb:763 smb:485 d:- ref:0 ; in:4200 out:4200 type:P dur:82000000 cpbdur:82000000 q:22.78 tex:65054 mv:7275 misc:1335 imb:158 pmb:653 smb:539 d:- ref:0 ; in:4201 out:4201 type:P dur:82000000 cpbdur:82000000 q:22.16 tex:60072 mv:5992 misc:1368 imb:102 pmb:772 smb:476 d:- ref:0 ; in:4202 out:4202 type:P dur:82000000 cpbdur:82000000 q:21.60 tex:44522 mv:4633 misc:1381 imb:110 pmb:683 smb:557 d:- ref:0 ; in:4203 out:4203 type:P dur:82000000 cpbdur:82000000 q:22.45 tex:72346 mv:7234 misc:1340 imb:157 pmb:660 smb:533 d:- ref:0 ; in:4204 out:4204 type:P dur:82000000 cpbdur:82000000 q:21.58 tex:34516 mv:4339 misc:1345 imb:74 pmb:649 smb:627 d:- ref:0 ; in:4205 out:4205 type:P dur:82000000 cpbdur:82000000 q:21.06 tex:58501 mv:5476 misc:1343 imb:115 pmb:760 smb:475 d:- ref:0 ; in:4206 out:4206 type:P dur:82000000 cpbdur:82000000 q:21.96 tex:56052 mv:5864 misc:1332 imb:161 pmb:562 smb:627 d:- ref:0 ; in:4207 out:4207 type:P dur:82000000 cpbdur:82000000 q:21.70 tex:55327 mv:6712 misc:1409 imb:244 pmb:726 smb:380 d:- ref:0 ; in:4208 out:4208 type:P dur:82000000 cpbdur:82000000 q:21.24 tex:54962 mv:5263 misc:1359 imb:221 pmb:703 smb:426 d:- ref:0 ; in:4209 out:4209 type:P dur:82000000 cpbdur:82000000 q:22.17 tex:64037 mv:5409 misc:1250 imb:117 pmb:567 smb:666 d:- ref:0 ; in:4210 out:4210 type:P dur:82000000 cpbdur:82000000 q:21.64 tex:47874 mv:4827 misc:1227 imb:80 pmb:607 smb:663 d:- ref:0 ; in:4211 out:4211 type:P dur:82000000 cpbdur:82000000 q:21.16 tex:54925 mv:4933 misc:1254 imb:69 pmb:721 smb:560 d:- ref:0 ; in:4212 out:4212 type:P dur:82000000 cpbdur:82000000 q:21.83 tex:58473 mv:6000 misc:1231 imb:96 pmb:614 smb:640 d:- ref:0 ; in:4213 out:4213 type:P dur:82000000 cpbdur:82000000 q:21.43 tex:57694 mv:4987 misc:1223 imb:89 pmb:667 smb:594 d:- ref:0 ; in:4214 out:4214 type:P dur:82000000 cpbdur:82000000 q:21.17 tex:54160 mv:4960 misc:1240 imb:61 pmb:688 smb:601 d:- ref:0 ; in:4215 out:4215 type:P dur:82000000 cpbdur:82000000 q:21.44 tex:58350 mv:4706 misc:1216 imb:96 pmb:590 smb:664 d:- ref:0 ; in:4216 out:4216 type:P dur:82000000 cpbdur:82000000 q:20.92 tex:45888 mv:4160 misc:1240 imb:62 pmb:632 smb:656 d:- ref:0 ; in:4217 out:4217 type:P dur:82000000 cpbdur:82000000 q:20.92 tex:55217 mv:5164 misc:1211 imb:63 pmb:682 smb:605 d:- ref:0 ; in:4218 out:4218 type:P dur:82000000 cpbdur:82000000 q:20.84 tex:52292 mv:4470 misc:1198 imb:82 pmb:564 smb:704 d:- ref:0 ; in:4219 out:4219 type:P dur:82000000 cpbdur:82000000 q:20.97 tex:60886 mv:5287 misc:1219 imb:72 pmb:669 smb:609 d:- ref:0 ; in:4220 out:4220 type:P dur:82000000 cpbdur:82000000 q:21.08 tex:59889 mv:5265 misc:1206 imb:79 pmb:681 smb:590 d:- ref:0 ; in:4221 out:4221 type:P dur:82000000 cpbdur:82000000 q:21.23 tex:60785 mv:4703 misc:1232 imb:105 pmb:579 smb:666 d:- ref:0 ; in:4222 out:4222 type:P dur:82000000 cpbdur:82000000 q:21.18 tex:57309 mv:4889 misc:1194 imb:74 pmb:675 smb:601 d:- ref:0 ; in:4223 out:4223 type:P dur:82000000 cpbdur:82000000 q:21.10 tex:61695 mv:5484 misc:1237 imb:82 pmb:670 smb:598 d:- ref:0 ; in:4224 out:4224 type:P dur:82000000 cpbdur:82000000 q:21.35 tex:63338 mv:5620 misc:1194 imb:87 pmb:670 smb:593 d:- ref:0 ; in:4225 out:4225 type:P dur:82000000 cpbdur:82000000 q:21.17 tex:55074 mv:4967 misc:1239 imb:68 pmb:643 smb:639 d:- ref:0 ; in:4226 out:4226 type:P dur:82000000 cpbdur:82000000 q:21.34 tex:59826 mv:5141 misc:1185 imb:66 pmb:685 smb:599 d:- ref:0 ; in:4227 out:4227 type:P dur:82000000 cpbdur:82000000 q:21.01 tex:58131 mv:4770 misc:1219 imb:89 pmb:650 smb:611 d:- ref:0 ; in:4228 out:4228 type:P dur:82000000 cpbdur:82000000 q:21.06 tex:54028 mv:4608 misc:1212 imb:87 pmb:674 smb:589 d:- ref:0 ; in:4229 out:4229 type:P dur:82000000 cpbdur:82000000 q:21.10 tex:64749 mv:5157 misc:1206 imb:77 pmb:687 smb:586 d:- ref:0 ; in:4230 out:4230 type:P dur:82000000 cpbdur:82000000 q:21.34 tex:63252 mv:5001 misc:1227 imb:90 pmb:653 smb:607 d:- ref:0 ; in:4231 out:4231 type:P dur:82000000 cpbdur:82000000 q:21.04 tex:54342 mv:4630 misc:1196 imb:68 pmb:652 smb:630 d:- ref:0 ; in:4232 out:4232 type:P dur:82000000 cpbdur:82000000 q:21.38 tex:70067 mv:5790 misc:1199 imb:100 pmb:704 smb:546 d:- ref:0 ; in:4233 out:4233 type:P dur:82000000 cpbdur:82000000 q:22.01 tex:64711 mv:5731 misc:1182 imb:79 pmb:643 smb:628 d:- ref:0 ; in:4234 out:4234 type:P dur:82000000 cpbdur:82000000 q:21.96 tex:65426 mv:5927 misc:1159 imb:78 pmb:691 smb:581 d:- ref:0 ; in:4235 out:4235 type:P dur:82000000 cpbdur:82000000 q:21.86 tex:67166 mv:5860 misc:1158 imb:54 pmb:708 smb:588 d:- ref:0 ; in:4236 out:4236 type:P dur:82000000 cpbdur:82000000 q:22.56 tex:61648 mv:6300 misc:1156 imb:90 pmb:656 smb:604 d:- ref:0 ; in:4237 out:4237 type:P dur:82000000 cpbdur:82000000 q:21.85 tex:64421 mv:5042 misc:1177 imb:71 pmb:726 smb:553 d:- ref:0 ; in:4238 out:4238 type:P dur:82000000 cpbdur:82000000 q:21.50 tex:53704 mv:4253 misc:1179 imb:68 pmb:675 smb:607 d:- ref:0 ; in:4239 out:4239 type:P dur:82000000 cpbdur:82000000 q:21.97 tex:62757 mv:5398 misc:1213 imb:90 pmb:696 smb:564 d:- ref:0 ; in:4240 out:4240 type:P dur:82000000 cpbdur:82000000 q:21.99 tex:74665 mv:6385 misc:1174 imb:87 pmb:727 smb:536 d:- ref:0 ; in:4241 out:4241 type:P dur:82000000 cpbdur:82000000 q:21.76 tex:58875 mv:5388 misc:1193 imb:60 pmb:700 smb:590 d:- ref:0 ; in:4242 out:4242 type:P dur:82000000 cpbdur:82000000 q:22.00 tex:70039 mv:5402 misc:1191 imb:90 pmb:684 smb:576 d:- ref:0 ; in:4243 out:4243 type:P dur:82000000 cpbdur:82000000 q:22.08 tex:76713 mv:5708 misc:1179 imb:54 pmb:724 smb:572 d:- ref:0 ; in:4244 out:4244 type:P dur:82000000 cpbdur:82000000 q:21.73 tex:56520 mv:4834 misc:1238 imb:69 pmb:698 smb:583 d:- ref:0 ; in:4245 out:4245 type:P dur:82000000 cpbdur:82000000 q:22.32 tex:83707 mv:6587 misc:1218 imb:96 pmb:757 smb:497 d:- ref:0 ; in:4246 out:4246 type:P dur:82000000 cpbdur:82000000 q:22.04 tex:64007 mv:4942 misc:1195 imb:66 pmb:758 smb:526 d:- ref:0 ; in:4247 out:4247 type:P dur:82000000 cpbdur:82000000 q:21.93 tex:77481 mv:5388 misc:1211 imb:52 pmb:772 smb:526 d:- ref:0 ; in:4248 out:4248 type:P dur:82000000 cpbdur:82000000 q:21.56 tex:46021 mv:4635 misc:1256 imb:80 pmb:725 smb:545 d:- ref:0 ; in:4249 out:4249 type:P dur:82000000 cpbdur:82000000 q:21.85 tex:80943 mv:5660 misc:1261 imb:54 pmb:796 smb:500 d:- ref:0 ; in:4250 out:4250 type:I dur:82000000 cpbdur:82000000 q:18.83 tex:351741 mv:12424 misc:379 imb:1350 pmb:0 smb:0 d:- ref:; in:4251 out:4251 type:P dur:82000000 cpbdur:82000000 q:25.05 tex:26573 mv:2781 misc:1110 imb:25 pmb:421 smb:904 d:- ref:0 ; in:4252 out:4252 type:P dur:82000000 cpbdur:82000000 q:23.99 tex:47000 mv:5259 misc:1197 imb:35 pmb:687 smb:628 d:- ref:0 ; in:4253 out:4253 type:P dur:82000000 cpbdur:82000000 q:23.12 tex:59149 mv:5103 misc:1252 imb:61 pmb:763 smb:526 d:- ref:0 ; in:4254 out:4254 type:P dur:82000000 cpbdur:82000000 q:23.01 tex:74660 mv:6489 misc:1219 imb:79 pmb:819 smb:452 d:- ref:0 ; in:4255 out:4255 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:67720 mv:5841 misc:1247 imb:78 pmb:803 smb:469 d:- ref:0 ; in:4256 out:4256 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:73769 mv:6010 misc:1229 imb:96 pmb:856 smb:398 d:- ref:0 ; in:4257 out:4257 type:P dur:82000000 cpbdur:82000000 q:21.78 tex:70999 mv:4549 misc:1260 imb:88 pmb:879 smb:383 d:- ref:0 ; in:4258 out:4258 type:P dur:82000000 cpbdur:82000000 q:22.32 tex:88395 mv:6069 misc:1264 imb:34 pmb:865 smb:451 d:- ref:0 ; in:4259 out:4259 type:P dur:82000000 cpbdur:82000000 q:21.96 tex:54200 mv:4003 misc:1309 imb:44 pmb:739 smb:567 d:- ref:0 ; in:4260 out:4260 type:P dur:82000000 cpbdur:82000000 q:22.75 tex:64211 mv:7076 misc:1313 imb:170 pmb:790 smb:390 d:- ref:0 ; in:4261 out:4261 type:P dur:82000000 cpbdur:82000000 q:22.24 tex:72064 mv:5542 misc:1346 imb:82 pmb:878 smb:390 d:- ref:0 ; in:4262 out:4262 type:P dur:82000000 cpbdur:82000000 q:22.08 tex:61686 mv:4818 misc:1344 imb:74 pmb:824 smb:452 d:- ref:0 ; in:4263 out:4263 type:P dur:82000000 cpbdur:82000000 q:22.24 tex:88563 mv:5799 misc:1342 imb:51 pmb:879 smb:420 d:- ref:0 ; in:4264 out:4264 type:P dur:82000000 cpbdur:82000000 q:21.42 tex:51618 mv:3788 misc:1386 imb:57 pmb:844 smb:449 d:- ref:0 ; in:4265 out:4265 type:P dur:82000000 cpbdur:82000000 q:22.25 tex:93232 mv:6385 misc:1335 imb:54 pmb:891 smb:405 d:- ref:0 ; in:4266 out:4266 type:P dur:82000000 cpbdur:82000000 q:21.32 tex:51772 mv:3945 misc:1395 imb:68 pmb:821 smb:461 d:- ref:0 ; in:4267 out:4267 type:P dur:82000000 cpbdur:82000000 q:20.37 tex:65363 mv:3969 misc:1396 imb:56 pmb:949 smb:345 d:- ref:0 ; in:4268 out:4268 type:P dur:82000000 cpbdur:82000000 q:22.03 tex:93535 mv:6385 misc:1376 imb:54 pmb:903 smb:393 d:- ref:0 ; in:4269 out:4269 type:P dur:82000000 cpbdur:82000000 q:22.60 tex:69627 mv:5815 misc:1390 imb:53 pmb:813 smb:484 d:- ref:0 ; in:4270 out:4270 type:P dur:82000000 cpbdur:82000000 q:21.68 tex:47952 mv:4077 misc:1459 imb:78 pmb:819 smb:453 d:- ref:0 ; in:4271 out:4271 type:P dur:82000000 cpbdur:82000000 q:21.89 tex:66614 mv:4754 misc:1440 imb:48 pmb:888 smb:414 d:- ref:0 ; in:4272 out:4272 type:P dur:82000000 cpbdur:82000000 q:22.61 tex:72979 mv:6586 misc:1411 imb:65 pmb:884 smb:401 d:- ref:0 ; in:4273 out:4273 type:P dur:82000000 cpbdur:82000000 q:22.89 tex:76840 mv:6493 misc:1435 imb:81 pmb:903 smb:366 d:- ref:0 ; in:4274 out:4274 type:P dur:82000000 cpbdur:82000000 q:21.74 tex:51881 mv:4738 misc:1477 imb:91 pmb:888 smb:371 d:- ref:0 ; in:4275 out:4275 type:P dur:82000000 cpbdur:82000000 q:21.32 tex:73424 mv:5822 misc:1466 imb:109 pmb:1028 smb:213 d:- ref:0 ; in:4276 out:4276 type:P dur:82000000 cpbdur:82000000 q:22.24 tex:88419 mv:6445 misc:1472 imb:69 pmb:947 smb:334 d:- ref:0 ; in:4277 out:4277 type:P dur:82000000 cpbdur:82000000 q:22.23 tex:75316 mv:5605 misc:1479 imb:70 pmb:919 smb:361 d:- ref:0 ; in:4278 out:4278 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:65341 mv:6027 misc:1456 imb:70 pmb:859 smb:421 d:- ref:0 ; in:4279 out:4279 type:P dur:82000000 cpbdur:82000000 q:22.50 tex:55063 mv:5007 misc:1490 imb:87 pmb:817 smb:446 d:- ref:0 ; in:4280 out:4280 type:P dur:82000000 cpbdur:82000000 q:21.50 tex:51460 mv:4473 misc:1499 imb:58 pmb:935 smb:357 d:- ref:0 ; in:4281 out:4281 type:P dur:82000000 cpbdur:82000000 q:22.49 tex:95469 mv:6196 misc:1471 imb:45 pmb:958 smb:347 d:- ref:0 ; in:4282 out:4282 type:P dur:82000000 cpbdur:82000000 q:21.25 tex:55706 mv:4185 misc:1477 imb:34 pmb:987 smb:329 d:- ref:0 ; in:4283 out:4283 type:P dur:82000000 cpbdur:82000000 q:20.78 tex:46552 mv:3722 misc:1494 imb:33 pmb:916 smb:401 d:- ref:0 ; in:4284 out:4284 type:P dur:82000000 cpbdur:82000000 q:20.25 tex:58419 mv:3680 misc:1525 imb:41 pmb:954 smb:355 d:- ref:0 ; in:4285 out:4285 type:P dur:82000000 cpbdur:82000000 q:18.49 tex:108882 mv:4170 misc:1484 imb:21 pmb:1184 smb:145 d:- ref:0 ; in:4286 out:4286 type:P dur:82000000 cpbdur:82000000 q:19.39 tex:64464 mv:3168 misc:1536 imb:13 pmb:874 smb:463 d:- ref:0 ; in:4287 out:4287 type:P dur:82000000 cpbdur:82000000 q:18.99 tex:35888 mv:1423 misc:985 imb:2 pmb:357 smb:991 d:- ref:0 ; in:4288 out:4288 type:P dur:82000000 cpbdur:82000000 q:17.82 tex:30332 mv:2086 misc:1478 imb:9 pmb:608 smb:733 d:- ref:0 ; in:4289 out:4289 type:P dur:82000000 cpbdur:82000000 q:18.36 tex:54434 mv:2516 misc:1458 imb:3 pmb:726 smb:621 d:- ref:0 ; in:4290 out:4290 type:P dur:82000000 cpbdur:82000000 q:22.36 tex:366006 mv:17027 misc:1415 imb:1143 pmb:207 smb:0 d:- ref:0 ; in:4291 out:4291 type:P dur:82000000 cpbdur:82000000 q:25.72 tex:54631 mv:4597 misc:1292 imb:87 pmb:611 smb:652 d:- ref:0 ; in:4292 out:4292 type:P dur:82000000 cpbdur:82000000 q:24.80 tex:73730 mv:6044 misc:1378 imb:195 pmb:668 smb:487 d:- ref:0 ; in:4293 out:4293 type:P dur:82000000 cpbdur:82000000 q:24.33 tex:94495 mv:7659 misc:1462 imb:353 pmb:705 smb:292 d:- ref:0 ; in:4294 out:4294 type:P dur:82000000 cpbdur:82000000 q:23.43 tex:85851 mv:5887 misc:1438 imb:243 pmb:743 smb:364 d:- ref:0 ; in:4295 out:4295 type:P dur:82000000 cpbdur:82000000 q:22.09 tex:75798 mv:4583 misc:1483 imb:140 pmb:789 smb:421 d:- ref:0 ; in:4296 out:4296 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:51791 mv:3070 misc:1443 imb:61 pmb:614 smb:675 d:- ref:0 ; in:4297 out:4297 type:P dur:82000000 cpbdur:82000000 q:20.53 tex:54164 mv:4347 misc:1513 imb:159 pmb:825 smb:366 d:- ref:0 ; in:4298 out:4298 type:P dur:82000000 cpbdur:82000000 q:18.90 tex:110028 mv:4288 misc:1484 imb:85 pmb:992 smb:273 d:- ref:0 ; in:4299 out:4299 type:P dur:82000000 cpbdur:82000000 q:20.23 tex:60902 mv:2549 misc:1365 imb:20 pmb:595 smb:735 d:- ref:0 ; in:4300 out:4300 type:P dur:82000000 cpbdur:82000000 q:18.71 tex:41345 mv:2367 misc:1448 imb:19 pmb:651 smb:680 d:- ref:0 ; in:4301 out:4301 type:P dur:82000000 cpbdur:82000000 q:18.06 tex:48357 mv:3257 misc:1530 imb:47 pmb:835 smb:468 d:- ref:0 ; in:4302 out:4302 type:P dur:82000000 cpbdur:82000000 q:19.89 tex:65982 mv:2138 misc:1136 imb:14 pmb:420 smb:916 d:- ref:0 ; in:4303 out:4303 type:P dur:82000000 cpbdur:82000000 q:19.28 tex:50760 mv:3082 misc:1502 imb:49 pmb:772 smb:529 d:- ref:0 ; in:4304 out:4304 type:P dur:82000000 cpbdur:82000000 q:17.95 tex:39492 mv:2485 misc:1471 imb:29 pmb:671 smb:650 d:- ref:0 ; in:4305 out:4305 type:P dur:82000000 cpbdur:82000000 q:19.94 tex:52954 mv:2706 misc:1340 imb:32 pmb:526 smb:792 d:- ref:0 ; in:4306 out:4306 type:P dur:82000000 cpbdur:82000000 q:19.98 tex:58322 mv:2840 misc:1294 imb:44 pmb:574 smb:732 d:- ref:0 ; in:4307 out:4307 type:P dur:82000000 cpbdur:82000000 q:18.91 tex:56867 mv:3196 misc:1489 imb:35 pmb:778 smb:537 d:- ref:0 ; in:4308 out:4308 type:P dur:82000000 cpbdur:82000000 q:20.01 tex:50558 mv:2365 misc:1317 imb:32 pmb:487 smb:831 d:- ref:0 ; in:4309 out:4309 type:P dur:82000000 cpbdur:82000000 q:18.54 tex:41149 mv:2653 misc:1446 imb:32 pmb:649 smb:669 d:- ref:0 ; in:4310 out:4310 type:P dur:82000000 cpbdur:82000000 q:18.78 tex:51942 mv:2966 misc:1436 imb:36 pmb:684 smb:630 d:- ref:0 ; in:4311 out:4311 type:P dur:82000000 cpbdur:82000000 q:19.27 tex:50084 mv:2125 misc:1119 imb:21 pmb:371 smb:958 d:- ref:0 ; in:4312 out:4312 type:P dur:82000000 cpbdur:82000000 q:18.83 tex:31115 mv:2558 misc:1415 imb:35 pmb:564 smb:751 d:- ref:0 ; in:4313 out:4313 type:P dur:82000000 cpbdur:82000000 q:17.31 tex:80238 mv:3647 misc:1507 imb:41 pmb:991 smb:318 d:- ref:0 ; in:4314 out:4314 type:P dur:82000000 cpbdur:82000000 q:19.61 tex:45278 mv:2208 misc:1322 imb:22 pmb:458 smb:870 d:- ref:0 ; in:4315 out:4315 type:P dur:82000000 cpbdur:82000000 q:17.92 tex:35888 mv:2435 misc:1493 imb:21 pmb:669 smb:660 d:- ref:0 ; in:4316 out:4316 type:P dur:82000000 cpbdur:82000000 q:18.16 tex:36113 mv:2579 misc:1492 imb:29 pmb:643 smb:678 d:- ref:0 ; in:4317 out:4317 type:P dur:82000000 cpbdur:82000000 q:19.99 tex:67628 mv:2228 misc:1152 imb:14 pmb:420 smb:916 d:- ref:0 ; in:4318 out:4318 type:P dur:82000000 cpbdur:82000000 q:19.83 tex:37848 mv:2383 misc:1353 imb:20 pmb:597 smb:733 d:- ref:0 ; in:4319 out:4319 type:P dur:82000000 cpbdur:82000000 q:18.02 tex:51492 mv:3027 misc:1489 imb:42 pmb:773 smb:535 d:- ref:0 ; in:4320 out:4320 type:P dur:82000000 cpbdur:82000000 q:19.68 tex:41475 mv:2284 misc:1321 imb:50 pmb:418 smb:882 d:- ref:0 ; in:4321 out:4321 type:P dur:82000000 cpbdur:82000000 q:18.61 tex:46045 mv:3507 misc:1496 imb:68 pmb:715 smb:567 d:- ref:0 ; in:4322 out:4322 type:P dur:82000000 cpbdur:82000000 q:18.98 tex:49344 mv:4125 misc:1507 imb:117 pmb:717 smb:516 d:- ref:0 ; in:4323 out:4323 type:P dur:82000000 cpbdur:82000000 q:19.84 tex:62824 mv:2671 misc:1265 imb:29 pmb:523 smb:798 d:- ref:0 ; in:4324 out:4324 type:P dur:82000000 cpbdur:82000000 q:19.23 tex:52585 mv:3129 misc:1494 imb:57 pmb:723 smb:570 d:- ref:0 ; in:4325 out:4325 type:P dur:82000000 cpbdur:82000000 q:18.66 tex:35232 mv:1825 misc:1327 imb:10 pmb:491 smb:849 d:- ref:0 ; in:4326 out:4326 type:P dur:82000000 cpbdur:82000000 q:19.96 tex:45369 mv:2111 misc:1264 imb:25 pmb:409 smb:916 d:- ref:0 ; in:4327 out:4327 type:P dur:82000000 cpbdur:82000000 q:18.92 tex:43958 mv:2818 misc:1512 imb:42 pmb:658 smb:650 d:- ref:0 ; in:4328 out:4328 type:P dur:82000000 cpbdur:82000000 q:18.01 tex:35338 mv:2720 misc:1510 imb:34 pmb:736 smb:580 d:- ref:0 ; in:4329 out:4329 type:P dur:82000000 cpbdur:82000000 q:19.64 tex:44195 mv:1999 misc:1222 imb:19 pmb:389 smb:942 d:- ref:0 ; in:4330 out:4330 type:P dur:82000000 cpbdur:82000000 q:18.38 tex:41374 mv:2578 misc:1504 imb:25 pmb:682 smb:643 d:- ref:0 ; in:4331 out:4331 type:P dur:82000000 cpbdur:82000000 q:17.82 tex:25906 mv:2129 misc:1461 imb:30 pmb:567 smb:753 d:- ref:0 ; in:4332 out:4332 type:P dur:82000000 cpbdur:82000000 q:19.43 tex:58528 mv:2746 misc:1430 imb:36 pmb:566 smb:748 d:- ref:0 ; in:4333 out:4333 type:P dur:82000000 cpbdur:82000000 q:18.92 tex:35334 mv:2611 misc:1479 imb:52 pmb:643 smb:655 d:- ref:0 ; in:4334 out:4334 type:P dur:82000000 cpbdur:82000000 q:18.94 tex:45614 mv:3132 misc:1470 imb:56 pmb:724 smb:570 d:- ref:0 ; in:4335 out:4335 type:P dur:82000000 cpbdur:82000000 q:20.57 tex:62139 mv:3014 misc:1407 imb:29 pmb:592 smb:729 d:- ref:0 ; in:4336 out:4336 type:P dur:82000000 cpbdur:82000000 q:18.94 tex:47194 mv:2992 misc:1534 imb:59 pmb:716 smb:575 d:- ref:0 ; in:4337 out:4337 type:P dur:82000000 cpbdur:82000000 q:18.31 tex:35989 mv:2584 misc:1515 imb:33 pmb:664 smb:653 d:- ref:0 ; in:4338 out:4338 type:P dur:82000000 cpbdur:82000000 q:21.12 tex:83191 mv:3430 misc:1299 imb:20 pmb:606 smb:724 d:- ref:0 ; in:4339 out:4339 type:P dur:82000000 cpbdur:82000000 q:21.50 tex:70852 mv:3848 misc:1404 imb:96 pmb:642 smb:612 d:- ref:0 ; in:4340 out:4340 type:P dur:82000000 cpbdur:82000000 q:20.45 tex:39004 mv:2935 misc:1437 imb:95 pmb:601 smb:654 d:- ref:0 ; in:4341 out:4341 type:P dur:82000000 cpbdur:82000000 q:21.39 tex:59290 mv:5243 misc:1507 imb:242 pmb:659 smb:449 d:- ref:0 ; in:4342 out:4342 type:P dur:82000000 cpbdur:82000000 q:20.39 tex:53905 mv:3885 misc:1498 imb:137 pmb:731 smb:482 d:- ref:0 ; in:4343 out:4343 type:P dur:82000000 cpbdur:82000000 q:19.73 tex:32123 mv:3339 misc:1522 imb:127 pmb:613 smb:610 d:- ref:0 ; in:4344 out:4344 type:P dur:82000000 cpbdur:82000000 q:19.91 tex:51923 mv:2515 misc:1282 imb:32 pmb:495 smb:823 d:- ref:0 ; in:4345 out:4345 type:P dur:82000000 cpbdur:82000000 q:19.41 tex:63011 mv:4324 misc:1513 imb:107 pmb:910 smb:333 d:- ref:0 ; in:4346 out:4346 type:P dur:82000000 cpbdur:82000000 q:17.72 tex:31317 mv:2313 misc:1442 imb:14 pmb:665 smb:671 d:- ref:0 ; in:4347 out:4347 type:P dur:82000000 cpbdur:82000000 q:21.44 tex:103702 mv:3652 misc:1358 imb:23 pmb:700 smb:627 d:- ref:0 ; in:4348 out:4348 type:P dur:82000000 cpbdur:82000000 q:21.15 tex:49075 mv:2196 misc:1305 imb:9 pmb:562 smb:779 d:- ref:0 ; in:4349 out:4349 type:P dur:82000000 cpbdur:82000000 q:20.08 tex:41540 mv:2430 misc:1358 imb:35 pmb:572 smb:743 d:- ref:0 ; in:4350 out:4350 type:P dur:82000000 cpbdur:82000000 q:20.64 tex:51107 mv:2816 misc:1373 imb:53 pmb:498 smb:799 d:- ref:0 ; in:4351 out:4351 type:P dur:82000000 cpbdur:82000000 q:19.28 tex:61176 mv:3670 misc:1514 imb:79 pmb:808 smb:463 d:- ref:0 ; in:4352 out:4352 type:P dur:82000000 cpbdur:82000000 q:19.85 tex:50097 mv:3253 misc:1394 imb:60 pmb:613 smb:677 d:- ref:0 ; in:4353 out:4353 type:P dur:82000000 cpbdur:82000000 q:20.40 tex:71250 mv:3048 misc:1350 imb:28 pmb:620 smb:702 d:- ref:0 ; in:4354 out:4354 type:P dur:82000000 cpbdur:82000000 q:19.23 tex:45262 mv:3376 misc:1522 imb:48 pmb:842 smb:460 d:- ref:0 ; in:4355 out:4355 type:P dur:82000000 cpbdur:82000000 q:17.51 tex:28797 mv:2370 misc:1529 imb:34 pmb:656 smb:660 d:- ref:0 ; in:4356 out:4356 type:P dur:82000000 cpbdur:82000000 q:18.80 tex:40948 mv:2052 misc:1360 imb:24 pmb:424 smb:902 d:- ref:0 ; in:4357 out:4357 type:P dur:82000000 cpbdur:82000000 q:17.06 tex:61452 mv:3376 misc:1500 imb:34 pmb:964 smb:352 d:- ref:0 ; in:4358 out:4358 type:P dur:82000000 cpbdur:82000000 q:17.50 tex:23864 mv:2589 misc:1515 imb:49 pmb:603 smb:698 d:- ref:0 ; in:4359 out:4359 type:P dur:82000000 cpbdur:82000000 q:20.21 tex:59147 mv:5652 misc:1513 imb:285 pmb:694 smb:371 d:- ref:0 ; in:4360 out:4360 type:P dur:82000000 cpbdur:82000000 q:20.29 tex:43777 mv:5195 misc:1524 imb:248 pmb:783 smb:319 d:- ref:0 ; in:4361 out:4361 type:P dur:82000000 cpbdur:82000000 q:20.39 tex:46889 mv:5738 misc:1493 imb:297 pmb:766 smb:287 d:- ref:0 ; in:4362 out:4362 type:P dur:82000000 cpbdur:82000000 q:20.29 tex:55102 mv:2944 misc:1386 imb:62 pmb:546 smb:742 d:- ref:0 ; in:4363 out:4363 type:P dur:82000000 cpbdur:82000000 q:19.23 tex:55993 mv:4044 misc:1507 imb:95 pmb:894 smb:361 d:- ref:0 ; in:4364 out:4364 type:P dur:82000000 cpbdur:82000000 q:18.48 tex:47574 mv:3536 misc:1530 imb:52 pmb:824 smb:474 d:- ref:0 ; in:4365 out:4365 type:P dur:82000000 cpbdur:82000000 q:19.32 tex:42561 mv:2061 misc:1314 imb:23 pmb:405 smb:922 d:- ref:0 ; in:4366 out:4366 type:P dur:82000000 cpbdur:82000000 q:17.86 tex:27596 mv:1938 misc:1418 imb:20 pmb:526 smb:804 d:- ref:0 ; in:4367 out:4367 type:P dur:82000000 cpbdur:82000000 q:17.66 tex:22083 mv:2119 misc:1446 imb:38 pmb:491 smb:821 d:- ref:0 ; in:4368 out:4368 type:P dur:82000000 cpbdur:82000000 q:19.15 tex:46982 mv:2732 misc:1382 imb:55 pmb:482 smb:813 d:- ref:0 ; in:4369 out:4369 type:P dur:82000000 cpbdur:82000000 q:19.63 tex:26568 mv:3627 misc:1541 imb:151 pmb:631 smb:568 d:- ref:0 ; in:4370 out:4370 type:P dur:82000000 cpbdur:82000000 q:20.09 tex:49422 mv:4381 misc:1517 imb:170 pmb:721 smb:459 d:- ref:0 ; in:4371 out:4371 type:P dur:82000000 cpbdur:82000000 q:21.27 tex:70507 mv:6763 misc:1474 imb:351 pmb:761 smb:238 d:- ref:0 ; in:4372 out:4372 type:P dur:82000000 cpbdur:82000000 q:21.28 tex:64961 mv:3911 misc:1464 imb:106 pmb:751 smb:493 d:- ref:0 ; in:4373 out:4373 type:P dur:82000000 cpbdur:82000000 q:20.54 tex:35350 mv:3256 misc:1450 imb:134 pmb:502 smb:714 d:- ref:0 ; in:4374 out:4374 type:P dur:82000000 cpbdur:82000000 q:22.91 tex:99284 mv:6167 misc:1205 imb:108 pmb:465 smb:777 d:- ref:0 ; in:4375 out:4375 type:P dur:82000000 cpbdur:82000000 q:21.36 tex:49946 mv:2731 misc:1467 imb:58 pmb:683 smb:609 d:- ref:0 ; in:4376 out:4376 type:P dur:82000000 cpbdur:82000000 q:19.60 tex:39365 mv:2184 misc:1387 imb:25 pmb:618 smb:707 d:- ref:0 ; in:4377 out:4377 type:P dur:82000000 cpbdur:82000000 q:22.26 tex:98911 mv:5271 misc:1202 imb:61 pmb:483 smb:806 d:- ref:0 ; in:4378 out:4378 type:P dur:82000000 cpbdur:82000000 q:21.05 tex:42640 mv:2555 misc:1429 imb:37 pmb:627 smb:686 d:- ref:0 ; in:4379 out:4379 type:P dur:82000000 cpbdur:82000000 q:21.70 tex:68950 mv:3694 misc:1468 imb:67 pmb:738 smb:545 d:- ref:0 ; in:4380 out:4380 type:P dur:82000000 cpbdur:82000000 q:23.25 tex:96486 mv:6787 misc:1311 imb:113 pmb:571 smb:666 d:- ref:0 ; in:4381 out:4381 type:P dur:82000000 cpbdur:82000000 q:21.62 tex:38818 mv:3236 misc:1474 imb:109 pmb:612 smb:629 d:- ref:0 ; in:4382 out:4382 type:P dur:82000000 cpbdur:82000000 q:21.78 tex:73531 mv:4056 misc:1373 imb:80 pmb:694 smb:576 d:- ref:0 ; in:4383 out:4383 type:P dur:82000000 cpbdur:82000000 q:22.89 tex:90202 mv:5476 misc:1194 imb:64 pmb:528 smb:758 d:- ref:0 ; in:4384 out:4384 type:P dur:82000000 cpbdur:82000000 q:21.41 tex:58369 mv:3032 misc:1463 imb:67 pmb:726 smb:557 d:- ref:0 ; in:4385 out:4385 type:P dur:82000000 cpbdur:82000000 q:19.59 tex:35057 mv:2312 misc:1455 imb:30 pmb:646 smb:674 d:- ref:0 ; in:4386 out:4386 type:P dur:82000000 cpbdur:82000000 q:22.79 tex:103143 mv:6018 misc:1311 imb:70 pmb:624 smb:656 d:- ref:0 ; in:4387 out:4387 type:P dur:82000000 cpbdur:82000000 q:21.07 tex:60210 mv:3202 misc:1460 imb:69 pmb:734 smb:547 d:- ref:0 ; in:4388 out:4388 type:P dur:82000000 cpbdur:82000000 q:20.53 tex:38463 mv:3001 misc:1440 imb:89 pmb:583 smb:678 d:- ref:0 ; in:4389 out:4389 type:P dur:82000000 cpbdur:82000000 q:20.61 tex:57499 mv:2952 misc:1325 imb:51 pmb:544 smb:755 d:- ref:0 ; in:4390 out:4390 type:P dur:82000000 cpbdur:82000000 q:19.38 tex:83972 mv:4575 misc:1509 imb:121 pmb:953 smb:276 d:- ref:0 ; in:4391 out:4391 type:P dur:82000000 cpbdur:82000000 q:18.50 tex:26700 mv:2734 misc:1510 imb:69 pmb:594 smb:687 d:- ref:0 ; in:4392 out:4392 type:P dur:82000000 cpbdur:82000000 q:19.64 tex:48902 mv:2211 misc:1311 imb:15 pmb:489 smb:846 d:- ref:0 ; in:4393 out:4393 type:P dur:82000000 cpbdur:82000000 q:19.22 tex:57226 mv:3722 misc:1532 imb:68 pmb:836 smb:446 d:- ref:0 ; in:4394 out:4394 type:P dur:82000000 cpbdur:82000000 q:19.72 tex:25374 mv:4238 misc:1524 imb:220 pmb:596 smb:534 d:- ref:0 ; in:4395 out:4395 type:P dur:82000000 cpbdur:82000000 q:21.78 tex:72185 mv:8459 misc:1412 imb:439 pmb:837 smb:74 d:- ref:0 ; in:4396 out:4396 type:P dur:82000000 cpbdur:82000000 q:20.99 tex:41692 mv:5274 misc:1514 imb:254 pmb:758 smb:338 d:- ref:0 ; in:4397 out:4397 type:P dur:82000000 cpbdur:82000000 q:19.85 tex:29574 mv:3380 misc:1510 imb:103 pmb:660 smb:587 d:- ref:0 ; in:4398 out:4398 type:P dur:82000000 cpbdur:82000000 q:21.85 tex:91265 mv:4531 misc:1396 imb:38 pmb:701 smb:611 d:- ref:0 ; in:4399 out:4399 type:P dur:82000000 cpbdur:82000000 q:19.93 tex:45478 mv:2458 misc:1424 imb:29 pmb:688 smb:633 d:- ref:0 ; in:4400 out:4400 type:P dur:82000000 cpbdur:82000000 q:19.19 tex:51853 mv:3767 misc:1508 imb:74 pmb:887 smb:389 d:- ref:0 ; in:4401 out:4401 type:P dur:82000000 cpbdur:82000000 q:20.84 tex:77623 mv:3378 misc:1335 imb:32 pmb:580 smb:738 d:- ref:0 ; in:4402 out:4402 type:P dur:82000000 cpbdur:82000000 q:19.15 tex:55454 mv:2797 misc:1445 imb:28 pmb:759 smb:563 d:- ref:0 ; in:4403 out:4403 type:P dur:82000000 cpbdur:82000000 q:18.18 tex:41265 mv:2987 misc:1524 imb:35 pmb:801 smb:514 d:- ref:0 ; in:4404 out:4404 type:P dur:82000000 cpbdur:82000000 q:19.33 tex:53054 mv:3227 misc:1447 imb:38 pmb:645 smb:667 d:- ref:0 ; in:4405 out:4405 type:P dur:82000000 cpbdur:82000000 q:18.44 tex:33635 mv:3014 misc:1535 imb:47 pmb:732 smb:571 d:- ref:0 ; in:4406 out:4406 type:P dur:82000000 cpbdur:82000000 q:17.85 tex:28839 mv:2513 misc:1496 imb:30 pmb:623 smb:697 d:- ref:0 ; in:4407 out:4407 type:P dur:82000000 cpbdur:82000000 q:18.97 tex:45863 mv:2655 misc:1418 imb:30 pmb:555 smb:765 d:- ref:0 ; in:4408 out:4408 type:P dur:82000000 cpbdur:82000000 q:18.72 tex:33368 mv:2713 misc:1503 imb:44 pmb:659 smb:647 d:- ref:0 ; in:4409 out:4409 type:P dur:82000000 cpbdur:82000000 q:17.05 tex:67230 mv:3471 misc:1523 imb:34 pmb:993 smb:323 d:- ref:0 ; in:4410 out:4410 type:P dur:82000000 cpbdur:82000000 q:18.72 tex:41325 mv:2491 misc:1424 imb:30 pmb:501 smb:819 d:- ref:0 ; in:4411 out:4411 type:P dur:82000000 cpbdur:82000000 q:17.45 tex:41558 mv:2758 misc:1572 imb:31 pmb:770 smb:549 d:- ref:0 ; in:4412 out:4412 type:P dur:82000000 cpbdur:82000000 q:18.03 tex:36591 mv:2732 misc:1509 imb:42 pmb:648 smb:660 d:- ref:0 ; in:4413 out:4413 type:P dur:82000000 cpbdur:82000000 q:19.92 tex:71795 mv:2881 misc:1324 imb:27 pmb:589 smb:734 d:- ref:0 ; in:4414 out:4414 type:P dur:82000000 cpbdur:82000000 q:19.65 tex:37081 mv:2602 misc:1389 imb:42 pmb:598 smb:710 d:- ref:0 ; in:4415 out:4415 type:P dur:82000000 cpbdur:82000000 q:18.59 tex:54805 mv:3218 misc:1497 imb:37 pmb:772 smb:541 d:- ref:0 ; in:4416 out:4416 type:P dur:82000000 cpbdur:82000000 q:19.74 tex:49661 mv:2276 misc:1279 imb:37 pmb:442 smb:871 d:- ref:0 ; in:4417 out:4417 type:P dur:82000000 cpbdur:82000000 q:18.71 tex:36180 mv:2705 misc:1459 imb:44 pmb:607 smb:699 d:- ref:0 ; in:4418 out:4418 type:P dur:82000000 cpbdur:82000000 q:18.00 tex:31478 mv:2658 misc:1544 imb:27 pmb:698 smb:625 d:- ref:0 ; in:4419 out:4419 type:P dur:82000000 cpbdur:82000000 q:19.82 tex:50385 mv:2964 misc:1331 imb:48 pmb:540 smb:762 d:- ref:0 ; in:4420 out:4420 type:P dur:82000000 cpbdur:82000000 q:19.51 tex:44358 mv:2504 misc:1338 imb:28 pmb:590 smb:732 d:- ref:0 ; in:4421 out:4421 type:P dur:82000000 cpbdur:82000000 q:19.69 tex:40888 mv:2447 misc:1265 imb:48 pmb:461 smb:841 d:- ref:0 ; in:4422 out:4422 type:P dur:82000000 cpbdur:82000000 q:20.76 tex:68507 mv:3465 misc:1308 imb:66 pmb:555 smb:729 d:- ref:0 ; in:4423 out:4423 type:P dur:82000000 cpbdur:82000000 q:20.06 tex:30252 mv:2262 misc:1454 imb:45 pmb:572 smb:733 d:- ref:0 ; in:4424 out:4424 type:P dur:82000000 cpbdur:82000000 q:18.92 tex:51245 mv:3636 misc:1543 imb:78 pmb:834 smb:438 d:- ref:0 ; in:4425 out:4425 type:P dur:82000000 cpbdur:82000000 q:19.82 tex:43488 mv:2527 misc:1313 imb:31 pmb:461 smb:858 d:- ref:0 ; in:4426 out:4426 type:P dur:82000000 cpbdur:82000000 q:18.29 tex:51694 mv:2963 misc:1503 imb:34 pmb:811 smb:505 d:- ref:0 ; in:4427 out:4427 type:P dur:82000000 cpbdur:82000000 q:18.73 tex:45858 mv:2521 misc:1445 imb:33 pmb:597 smb:720 d:- ref:0 ; in:4428 out:4428 type:P dur:82000000 cpbdur:82000000 q:20.63 tex:66334 mv:3675 misc:1319 imb:61 pmb:587 smb:702 d:- ref:0 ; in:4429 out:4429 type:P dur:82000000 cpbdur:82000000 q:19.74 tex:29288 mv:2112 misc:1384 imb:20 pmb:560 smb:770 d:- ref:0 ; in:4430 out:4430 type:P dur:82000000 cpbdur:82000000 q:18.33 tex:58974 mv:3400 misc:1498 imb:40 pmb:892 smb:418 d:- ref:0 ; in:4431 out:4431 type:P dur:82000000 cpbdur:82000000 q:20.02 tex:58154 mv:2594 misc:1340 imb:26 pmb:518 smb:806 d:- ref:0 ; in:4432 out:4432 type:P dur:82000000 cpbdur:82000000 q:18.80 tex:35625 mv:2720 misc:1511 imb:45 pmb:664 smb:641 d:- ref:0 ; in:4433 out:4433 type:P dur:82000000 cpbdur:82000000 q:18.29 tex:37034 mv:3174 misc:1544 imb:49 pmb:788 smb:513 d:- ref:0 ; in:4434 out:4434 type:P dur:82000000 cpbdur:82000000 q:19.01 tex:46690 mv:2400 misc:1358 imb:48 pmb:464 smb:838 d:- ref:0 ; in:4435 out:4435 type:P dur:82000000 cpbdur:82000000 q:18.69 tex:29287 mv:2195 misc:1446 imb:22 pmb:569 smb:759 d:- ref:0 ; in:4436 out:4436 type:P dur:82000000 cpbdur:82000000 q:17.66 tex:27328 mv:2135 misc:1433 imb:8 pmb:585 smb:757 d:- ref:0 ; in:4437 out:4437 type:P dur:82000000 cpbdur:82000000 q:20.27 tex:66008 mv:3263 misc:1369 imb:43 pmb:625 smb:682 d:- ref:0 ; in:4438 out:4438 type:P dur:82000000 cpbdur:82000000 q:19.20 tex:47138 mv:3183 misc:1495 imb:51 pmb:733 smb:566 d:- ref:0 ; in:4439 out:4439 type:P dur:82000000 cpbdur:82000000 q:19.35 tex:46307 mv:2553 misc:1484 imb:22 pmb:665 smb:663 d:- ref:0 ; in:4440 out:4440 type:P dur:82000000 cpbdur:82000000 q:19.72 tex:35400 mv:2177 misc:1255 imb:40 pmb:383 smb:927 d:- ref:0 ; in:4441 out:4441 type:P dur:82000000 cpbdur:82000000 q:18.86 tex:44768 mv:3423 misc:1537 imb:77 pmb:697 smb:576 d:- ref:0 ; in:4442 out:4442 type:P dur:82000000 cpbdur:82000000 q:18.72 tex:28635 mv:2499 misc:1482 imb:35 pmb:593 smb:722 d:- ref:0 ; in:4443 out:4443 type:P dur:82000000 cpbdur:82000000 q:19.62 tex:50946 mv:2377 misc:1277 imb:22 pmb:483 smb:845 d:- ref:0 ; in:4444 out:4444 type:P dur:82000000 cpbdur:82000000 q:18.41 tex:47593 mv:3300 misc:1547 imb:52 pmb:868 smb:430 d:- ref:0 ; in:4445 out:4445 type:P dur:82000000 cpbdur:82000000 q:17.57 tex:13508 mv:1695 misc:1389 imb:25 pmb:443 smb:882 d:- ref:0 ; in:4446 out:4446 type:P dur:82000000 cpbdur:82000000 q:18.89 tex:49315 mv:2526 misc:1399 imb:29 pmb:494 smb:827 d:- ref:0 ; in:4447 out:4447 type:P dur:82000000 cpbdur:82000000 q:18.41 tex:32657 mv:2812 misc:1523 imb:45 pmb:690 smb:615 d:- ref:0 ; in:4448 out:4448 type:P dur:82000000 cpbdur:82000000 q:19.80 tex:54360 mv:2739 misc:1397 imb:27 pmb:665 smb:658 d:- ref:0 ; in:4449 out:4449 type:P dur:82000000 cpbdur:82000000 q:19.87 tex:48992 mv:2254 misc:1258 imb:21 pmb:434 smb:895 d:- ref:0 ; in:4450 out:4450 type:P dur:82000000 cpbdur:82000000 q:21.57 tex:81929 mv:3125 misc:1346 imb:13 pmb:663 smb:674 d:- ref:0 ; in:4451 out:4451 type:P dur:82000000 cpbdur:82000000 q:21.08 tex:43411 mv:2509 misc:1400 imb:17 pmb:625 smb:708 d:- ref:0 ; in:4452 out:4452 type:P dur:82000000 cpbdur:82000000 q:21.46 tex:73571 mv:3461 misc:1384 imb:23 pmb:653 smb:674 d:- ref:0 ; in:4453 out:4453 type:P dur:82000000 cpbdur:82000000 q:19.49 tex:51337 mv:3266 misc:1509 imb:55 pmb:824 smb:471 d:- ref:0 ; in:4454 out:4454 type:P dur:82000000 cpbdur:82000000 q:19.09 tex:34031 mv:2228 misc:1429 imb:27 pmb:558 smb:765 d:- ref:0 ; in:4455 out:4455 type:P dur:82000000 cpbdur:82000000 q:20.19 tex:61893 mv:2923 misc:1312 imb:41 pmb:531 smb:778 d:- ref:0 ; in:4456 out:4456 type:P dur:82000000 cpbdur:82000000 q:23.21 tex:103624 mv:7111 misc:1161 imb:125 pmb:489 smb:736 d:- ref:0 ; in:4457 out:4457 type:P dur:82000000 cpbdur:82000000 q:21.43 tex:61166 mv:3060 misc:1478 imb:69 pmb:702 smb:579 d:- ref:0 ; in:4458 out:4458 type:P dur:82000000 cpbdur:82000000 q:21.20 tex:54579 mv:3130 misc:1403 imb:59 pmb:540 smb:751 d:- ref:0 ; in:4459 out:4459 type:P dur:82000000 cpbdur:82000000 q:23.20 tex:96443 mv:6740 misc:1185 imb:86 pmb:478 smb:786 d:- ref:0 ; in:4460 out:4460 type:P dur:82000000 cpbdur:82000000 q:21.55 tex:35401 mv:1962 misc:1333 imb:19 pmb:532 smb:799 d:- ref:0 ; in:4461 out:4461 type:P dur:82000000 cpbdur:82000000 q:23.64 tex:98569 mv:7078 misc:1193 imb:116 pmb:476 smb:758 d:- ref:0 ; in:4462 out:4462 type:P dur:82000000 cpbdur:82000000 q:22.27 tex:75656 mv:3367 misc:1409 imb:66 pmb:707 smb:577 d:- ref:0 ; in:4463 out:4463 type:P dur:82000000 cpbdur:82000000 q:21.34 tex:60860 mv:3259 misc:1473 imb:58 pmb:687 smb:605 d:- ref:0 ; in:4464 out:4464 type:P dur:82000000 cpbdur:82000000 q:23.42 tex:108405 mv:7104 misc:1171 imb:98 pmb:486 smb:766 d:- ref:0 ; in:4465 out:4465 type:P dur:82000000 cpbdur:82000000 q:22.00 tex:49326 mv:2343 misc:1347 imb:42 pmb:557 smb:751 d:- ref:0 ; in:4466 out:4466 type:P dur:82000000 cpbdur:82000000 q:20.57 tex:46817 mv:2681 misc:1414 imb:47 pmb:627 smb:676 d:- ref:0 ; in:4467 out:4467 type:P dur:82000000 cpbdur:82000000 q:21.23 tex:72784 mv:3417 misc:1471 imb:58 pmb:689 smb:603 d:- ref:0 ; in:4468 out:4468 type:P dur:82000000 cpbdur:82000000 q:22.63 tex:98469 mv:5643 misc:1344 imb:125 pmb:683 smb:542 d:- ref:0 ; in:4469 out:4469 type:P dur:82000000 cpbdur:82000000 q:23.01 tex:84838 mv:5347 misc:1367 imb:98 pmb:721 smb:531 d:- ref:0 ; in:4470 out:4470 type:P dur:82000000 cpbdur:82000000 q:26.94 tex:206282 mv:15350 misc:1416 imb:1216 pmb:134 smb:0 d:- ref:0 ; in:4471 out:4471 type:P dur:82000000 cpbdur:82000000 q:25.24 tex:55937 mv:3820 misc:1339 imb:45 pmb:718 smb:587 d:- ref:0 ; in:4472 out:4472 type:P dur:82000000 cpbdur:82000000 q:24.11 tex:69847 mv:4547 misc:1366 imb:48 pmb:759 smb:543 d:- ref:0 ; in:4473 out:4473 type:P dur:82000000 cpbdur:82000000 q:24.59 tex:101289 mv:7193 misc:1366 imb:154 pmb:725 smb:471 d:- ref:0 ; in:4474 out:4474 type:P dur:82000000 cpbdur:82000000 q:22.67 tex:53067 mv:3206 misc:1463 imb:67 pmb:768 smb:515 d:- ref:0 ; in:4475 out:4475 type:P dur:82000000 cpbdur:82000000 q:20.87 tex:79820 mv:4016 misc:1508 imb:95 pmb:956 smb:299 d:- ref:0 ; in:4476 out:4476 type:P dur:82000000 cpbdur:82000000 q:22.17 tex:77833 mv:4057 misc:1302 imb:80 pmb:479 smb:791 d:- ref:0 ; in:4477 out:4477 type:P dur:82000000 cpbdur:82000000 q:20.90 tex:47329 mv:2571 misc:1404 imb:36 pmb:631 smb:683 d:- ref:0 ; in:4478 out:4478 type:P dur:82000000 cpbdur:82000000 q:20.51 tex:50762 mv:2678 misc:1392 imb:62 pmb:564 smb:724 d:- ref:0 ; in:4479 out:4479 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:85104 mv:5001 misc:1167 imb:102 pmb:521 smb:727 d:- ref:0 ; in:4480 out:4480 type:P dur:82000000 cpbdur:82000000 q:21.43 tex:64554 mv:2603 misc:1315 imb:22 pmb:663 smb:665 d:- ref:0 ; in:4481 out:4481 type:P dur:82000000 cpbdur:82000000 q:19.81 tex:38566 mv:2535 misc:1459 imb:47 pmb:671 smb:632 d:- ref:0 ; in:4482 out:4482 type:P dur:82000000 cpbdur:82000000 q:22.27 tex:91256 mv:4587 misc:1157 imb:71 pmb:501 smb:778 d:- ref:0 ; in:4483 out:4483 type:P dur:82000000 cpbdur:82000000 q:21.08 tex:39418 mv:2074 misc:1252 imb:8 pmb:556 smb:786 d:- ref:0 ; in:4484 out:4484 type:P dur:82000000 cpbdur:82000000 q:19.88 tex:42064 mv:2574 misc:1482 imb:32 pmb:690 smb:628 d:- ref:0 ; in:4485 out:4485 type:P dur:82000000 cpbdur:82000000 q:22.14 tex:83946 mv:4313 misc:1061 imb:67 pmb:417 smb:866 d:- ref:0 ; in:4486 out:4486 type:P dur:82000000 cpbdur:82000000 q:20.92 tex:38745 mv:1981 misc:1186 imb:17 pmb:475 smb:858 d:- ref:0 ; in:4487 out:4487 type:P dur:82000000 cpbdur:82000000 q:20.05 tex:48120 mv:2374 misc:1346 imb:24 pmb:648 smb:678 d:- ref:0 ; in:4488 out:4488 type:P dur:82000000 cpbdur:82000000 q:22.46 tex:102091 mv:5350 misc:1207 imb:110 pmb:570 smb:670 d:- ref:0 ; in:4489 out:4489 type:P dur:82000000 cpbdur:82000000 q:21.27 tex:45019 mv:2575 misc:1286 imb:52 pmb:561 smb:737 d:- ref:0 ; in:4490 out:4490 type:P dur:82000000 cpbdur:82000000 q:20.98 tex:51917 mv:2552 misc:1331 imb:52 pmb:564 smb:734 d:- ref:0 ; in:4491 out:4491 type:P dur:82000000 cpbdur:82000000 q:21.85 tex:73131 mv:3808 misc:1141 imb:92 pmb:464 smb:794 d:- ref:0 ; in:4492 out:4492 type:P dur:82000000 cpbdur:82000000 q:20.35 tex:55890 mv:2505 misc:1349 imb:19 pmb:671 smb:660 d:- ref:0 ; in:4493 out:4493 type:P dur:82000000 cpbdur:82000000 q:19.23 tex:64366 mv:3852 misc:1502 imb:57 pmb:934 smb:359 d:- ref:0 ; in:4494 out:4494 type:P dur:82000000 cpbdur:82000000 q:20.55 tex:52136 mv:2775 misc:1177 imb:54 pmb:373 smb:923 d:- ref:0 ; in:4495 out:4495 type:P dur:82000000 cpbdur:82000000 q:19.36 tex:45874 mv:2505 misc:1461 imb:25 pmb:635 smb:690 d:- ref:0 ; in:4496 out:4496 type:P dur:82000000 cpbdur:82000000 q:18.53 tex:22893 mv:2123 misc:1456 imb:24 pmb:559 smb:767 d:- ref:0 ; in:4497 out:4497 type:P dur:82000000 cpbdur:82000000 q:19.33 tex:45225 mv:2044 misc:1059 imb:45 pmb:294 smb:1011 d:- ref:0 ; in:4498 out:4498 type:P dur:82000000 cpbdur:82000000 q:18.40 tex:39559 mv:2950 misc:1547 imb:39 pmb:774 smb:537 d:- ref:0 ; in:4499 out:4499 type:P dur:82000000 cpbdur:82000000 q:16.59 tex:56794 mv:3280 misc:1534 imb:21 pmb:964 smb:365 d:- ref:0 ; in:4500 out:4500 type:I dur:82000000 cpbdur:82000000 q:17.69 tex:371024 mv:14618 misc:374 imb:1350 pmb:0 smb:0 d:- ref:; in:4501 out:4501 type:P dur:82000000 cpbdur:82000000 q:20.59 tex:13776 mv:821 misc:923 imb:2 pmb:247 smb:1101 d:- ref:0 ; in:4502 out:4502 type:P dur:82000000 cpbdur:82000000 q:22.33 tex:23216 mv:1456 misc:1056 imb:13 pmb:372 smb:965 d:- ref:0 ; in:4503 out:4503 type:P dur:82000000 cpbdur:82000000 q:21.51 tex:33971 mv:2022 misc:1023 imb:46 pmb:358 smb:946 d:- ref:0 ; in:4504 out:4504 type:P dur:82000000 cpbdur:82000000 q:19.63 tex:23175 mv:1651 misc:1246 imb:18 pmb:483 smb:849 d:- ref:0 ; in:4505 out:4505 type:P dur:82000000 cpbdur:82000000 q:18.72 tex:30661 mv:3072 misc:1515 imb:60 pmb:728 smb:562 d:- ref:0 ; in:4506 out:4506 type:P dur:82000000 cpbdur:82000000 q:19.03 tex:37998 mv:2126 misc:1420 imb:16 pmb:562 smb:772 d:- ref:0 ; in:4507 out:4507 type:P dur:82000000 cpbdur:82000000 q:17.46 tex:52101 mv:3558 misc:1565 imb:43 pmb:962 smb:345 d:- ref:0 ; in:4508 out:4508 type:P dur:82000000 cpbdur:82000000 q:17.93 tex:30329 mv:2372 misc:1467 imb:32 pmb:598 smb:720 d:- ref:0 ; in:4509 out:4509 type:P dur:82000000 cpbdur:82000000 q:17.74 tex:21355 mv:1206 misc:1135 imb:18 pmb:274 smb:1058 d:- ref:0 ; in:4510 out:4510 type:P dur:82000000 cpbdur:82000000 q:16.10 tex:71239 mv:3907 misc:1518 imb:29 pmb:1137 smb:184 d:- ref:0 ; in:4511 out:4511 type:P dur:82000000 cpbdur:82000000 q:17.64 tex:28798 mv:2234 misc:1456 imb:22 pmb:596 smb:732 d:- ref:0 ; in:4512 out:4512 type:P dur:82000000 cpbdur:82000000 q:18.93 tex:43274 mv:1866 misc:1140 imb:29 pmb:344 smb:977 d:- ref:0 ; in:4513 out:4513 type:P dur:82000000 cpbdur:82000000 q:17.28 tex:31505 mv:2497 misc:1542 imb:26 pmb:687 smb:637 d:- ref:0 ; in:4514 out:4514 type:P dur:82000000 cpbdur:82000000 q:18.33 tex:48141 mv:2185 misc:1298 imb:10 pmb:599 smb:741 d:- ref:0 ; in:4515 out:4515 type:P dur:82000000 cpbdur:82000000 q:20.74 tex:56496 mv:2250 misc:1182 imb:42 pmb:376 smb:932 d:- ref:0 ; in:4516 out:4516 type:P dur:82000000 cpbdur:82000000 q:18.90 tex:28613 mv:1960 misc:1379 imb:20 pmb:544 smb:786 d:- ref:0 ; in:4517 out:4517 type:P dur:82000000 cpbdur:82000000 q:18.42 tex:29333 mv:2476 misc:1479 imb:30 pmb:626 smb:694 d:- ref:0 ; in:4518 out:4518 type:P dur:82000000 cpbdur:82000000 q:20.66 tex:62107 mv:2843 misc:1082 imb:39 pmb:357 smb:954 d:- ref:0 ; in:4519 out:4519 type:P dur:82000000 cpbdur:82000000 q:18.78 tex:35250 mv:2037 misc:1329 imb:23 pmb:563 smb:764 d:- ref:0 ; in:4520 out:4520 type:P dur:82000000 cpbdur:82000000 q:19.36 tex:57277 mv:2520 misc:1323 imb:34 pmb:594 smb:722 d:- ref:0 ; in:4521 out:4521 type:P dur:82000000 cpbdur:82000000 q:21.51 tex:72364 mv:3342 misc:1062 imb:52 pmb:382 smb:916 d:- ref:0 ; in:4522 out:4522 type:P dur:82000000 cpbdur:82000000 q:20.67 tex:51593 mv:2357 misc:1114 imb:12 pmb:499 smb:839 d:- ref:0 ; in:4523 out:4523 type:P dur:82000000 cpbdur:82000000 q:20.18 tex:51515 mv:2353 misc:1276 imb:17 pmb:615 smb:718 d:- ref:0 ; in:4524 out:4524 type:P dur:82000000 cpbdur:82000000 q:22.85 tex:96219 mv:6426 misc:1147 imb:92 pmb:622 smb:636 d:- ref:0 ; in:4525 out:4525 type:P dur:82000000 cpbdur:82000000 q:22.64 tex:71012 mv:4003 misc:1185 imb:20 pmb:675 smb:655 d:- ref:0 ; in:4526 out:4526 type:P dur:82000000 cpbdur:82000000 q:26.37 tex:197381 mv:15176 misc:1419 imb:1218 pmb:132 smb:0 d:- ref:0 ; in:4527 out:4527 type:P dur:82000000 cpbdur:82000000 q:24.15 tex:24536 mv:1540 misc:1244 imb:8 pmb:422 smb:920 d:- ref:0 ; in:4528 out:4528 type:P dur:82000000 cpbdur:82000000 q:21.96 tex:63966 mv:3343 misc:1483 imb:72 pmb:829 smb:449 d:- ref:0 ; in:4529 out:4529 type:P dur:82000000 cpbdur:82000000 q:20.55 tex:38828 mv:3087 misc:1557 imb:77 pmb:749 smb:524 d:- ref:0 ; in:4530 out:4530 type:P dur:82000000 cpbdur:82000000 q:21.99 tex:87633 mv:4890 misc:1357 imb:75 pmb:604 smb:671 d:- ref:0 ; in:4531 out:4531 type:P dur:82000000 cpbdur:82000000 q:21.57 tex:57068 mv:3329 misc:1267 imb:72 pmb:519 smb:759 d:- ref:0 ; in:4532 out:4532 type:P dur:82000000 cpbdur:82000000 q:21.56 tex:55676 mv:3332 misc:1328 imb:68 pmb:546 smb:736 d:- ref:0 ; in:4533 out:4533 type:P dur:82000000 cpbdur:82000000 q:21.80 tex:80729 mv:4275 misc:1220 imb:64 pmb:541 smb:745 d:- ref:0 ; in:4534 out:4534 type:P dur:82000000 cpbdur:82000000 q:21.57 tex:57728 mv:3386 misc:1270 imb:54 pmb:538 smb:758 d:- ref:0 ; in:4535 out:4535 type:P dur:82000000 cpbdur:82000000 q:22.52 tex:76938 mv:4910 misc:1232 imb:77 pmb:538 smb:735 d:- ref:0 ; in:4536 out:4536 type:P dur:82000000 cpbdur:82000000 q:22.44 tex:80515 mv:3873 misc:1276 imb:29 pmb:549 smb:772 d:- ref:0 ; in:4537 out:4537 type:P dur:82000000 cpbdur:82000000 q:21.05 tex:38981 mv:2719 misc:1468 imb:48 pmb:611 smb:691 d:- ref:0 ; in:4538 out:4538 type:P dur:82000000 cpbdur:82000000 q:20.82 tex:45751 mv:2331 misc:1134 imb:34 pmb:335 smb:981 d:- ref:0 ; in:4539 out:4539 type:P dur:82000000 cpbdur:82000000 q:19.49 tex:82931 mv:4187 misc:1546 imb:75 pmb:971 smb:304 d:- ref:0 ; in:4540 out:4540 type:P dur:82000000 cpbdur:82000000 q:18.75 tex:32079 mv:2436 misc:1493 imb:23 pmb:630 smb:697 d:- ref:0 ; in:4541 out:4541 type:P dur:82000000 cpbdur:82000000 q:20.28 tex:79026 mv:3071 misc:1287 imb:26 pmb:575 smb:749 d:- ref:0 ; in:4542 out:4542 type:P dur:82000000 cpbdur:82000000 q:21.01 tex:67421 mv:3035 misc:1176 imb:22 pmb:511 smb:817 d:- ref:0 ; in:4543 out:4543 type:P dur:82000000 cpbdur:82000000 q:20.57 tex:43239 mv:2706 misc:1343 imb:34 pmb:544 smb:772 d:- ref:0 ; in:4544 out:4544 type:P dur:82000000 cpbdur:82000000 q:20.86 tex:61892 mv:3259 misc:1289 imb:63 pmb:559 smb:728 d:- ref:0 ; in:4545 out:4545 type:P dur:82000000 cpbdur:82000000 q:19.84 tex:39159 mv:2157 misc:1276 imb:25 pmb:505 smb:820 d:- ref:0 ; in:4546 out:4546 type:P dur:82000000 cpbdur:82000000 q:20.96 tex:77180 mv:4001 misc:1347 imb:59 pmb:603 smb:688 d:- ref:0 ; in:4547 out:4547 type:P dur:82000000 cpbdur:82000000 q:21.05 tex:65290 mv:3519 misc:1303 imb:53 pmb:557 smb:740 d:- ref:0 ; in:4548 out:4548 type:P dur:82000000 cpbdur:82000000 q:19.07 tex:52476 mv:3184 misc:1548 imb:32 pmb:826 smb:492 d:- ref:0 ; in:4549 out:4549 type:P dur:82000000 cpbdur:82000000 q:19.97 tex:61780 mv:2793 misc:1315 imb:29 pmb:555 smb:766 d:- ref:0 ; in:4550 out:4550 type:P dur:82000000 cpbdur:82000000 q:19.76 tex:42497 mv:2278 misc:1289 imb:18 pmb:512 smb:820 d:- ref:0 ; in:4551 out:4551 type:P dur:82000000 cpbdur:82000000 q:18.96 tex:42499 mv:3031 misc:1534 imb:54 pmb:709 smb:587 d:- ref:0 ; in:4552 out:4552 type:P dur:82000000 cpbdur:82000000 q:19.97 tex:62622 mv:2754 misc:1224 imb:37 pmb:520 smb:793 d:- ref:0 ; in:4553 out:4553 type:P dur:82000000 cpbdur:82000000 q:21.26 tex:78940 mv:4096 misc:1308 imb:65 pmb:576 smb:709 d:- ref:0 ; in:4554 out:4554 type:P dur:82000000 cpbdur:82000000 q:20.12 tex:36279 mv:1899 misc:1238 imb:28 pmb:449 smb:873 d:- ref:0 ; in:4555 out:4555 type:P dur:82000000 cpbdur:82000000 q:21.00 tex:73073 mv:3538 misc:1317 imb:59 pmb:574 smb:717 d:- ref:0 ; in:4556 out:4556 type:P dur:82000000 cpbdur:82000000 q:21.16 tex:62783 mv:3432 misc:1369 imb:75 pmb:556 smb:719 d:- ref:0 ; in:4557 out:4557 type:P dur:82000000 cpbdur:82000000 q:21.23 tex:69333 mv:3248 misc:1267 imb:53 pmb:564 smb:733 d:- ref:0 ; in:4558 out:4558 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:44139 mv:2421 misc:1344 imb:43 pmb:535 smb:772 d:- ref:0 ; in:4559 out:4559 type:P dur:82000000 cpbdur:82000000 q:21.01 tex:72185 mv:4214 misc:1233 imb:61 pmb:554 smb:735 d:- ref:0 ; in:4560 out:4560 type:P dur:82000000 cpbdur:82000000 q:21.39 tex:60712 mv:4308 misc:1284 imb:61 pmb:592 smb:697 d:- ref:0 ; in:4561 out:4561 type:P dur:82000000 cpbdur:82000000 q:21.05 tex:47359 mv:2926 misc:1339 imb:60 pmb:546 smb:744 d:- ref:0 ; in:4562 out:4562 type:P dur:82000000 cpbdur:82000000 q:20.75 tex:62462 mv:3244 misc:1326 imb:85 pmb:548 smb:717 d:- ref:0 ; in:4563 out:4563 type:P dur:82000000 cpbdur:82000000 q:20.04 tex:55244 mv:2514 misc:1338 imb:34 pmb:562 smb:754 d:- ref:0 ; in:4564 out:4564 type:P dur:82000000 cpbdur:82000000 q:20.40 tex:60243 mv:3522 misc:1427 imb:88 pmb:588 smb:674 d:- ref:0 ; in:4565 out:4565 type:P dur:82000000 cpbdur:82000000 q:20.68 tex:55886 mv:3157 misc:1245 imb:53 pmb:515 smb:782 d:- ref:0 ; in:4566 out:4566 type:P dur:82000000 cpbdur:82000000 q:21.31 tex:71955 mv:3206 misc:1295 imb:48 pmb:570 smb:732 d:- ref:0 ; in:4567 out:4567 type:P dur:82000000 cpbdur:82000000 q:20.59 tex:56834 mv:2607 misc:1223 imb:38 pmb:525 smb:787 d:- ref:0 ; in:4568 out:4568 type:P dur:82000000 cpbdur:82000000 q:20.50 tex:58665 mv:3824 misc:1359 imb:27 pmb:648 smb:675 d:- ref:0 ; in:4569 out:4569 type:P dur:82000000 cpbdur:82000000 q:20.66 tex:49906 mv:3625 misc:1309 imb:36 pmb:585 smb:729 d:- ref:0 ; in:4570 out:4570 type:P dur:82000000 cpbdur:82000000 q:21.16 tex:71949 mv:4097 misc:1290 imb:64 pmb:581 smb:705 d:- ref:0 ; in:4571 out:4571 type:P dur:82000000 cpbdur:82000000 q:19.50 tex:62175 mv:3568 misc:1529 imb:61 pmb:830 smb:459 d:- ref:0 ; in:4572 out:4572 type:P dur:82000000 cpbdur:82000000 q:20.94 tex:79690 mv:4430 misc:1296 imb:62 pmb:588 smb:700 d:- ref:0 ; in:4573 out:4573 type:P dur:82000000 cpbdur:82000000 q:21.25 tex:62553 mv:4381 misc:1322 imb:60 pmb:601 smb:689 d:- ref:0 ; in:4574 out:4574 type:P dur:82000000 cpbdur:82000000 q:20.05 tex:40593 mv:1741 misc:1282 imb:15 pmb:465 smb:870 d:- ref:0 ; in:4575 out:4575 type:P dur:82000000 cpbdur:82000000 q:21.12 tex:82757 mv:4153 misc:1322 imb:63 pmb:589 smb:698 d:- ref:0 ; in:4576 out:4576 type:P dur:82000000 cpbdur:82000000 q:20.90 tex:55319 mv:2801 misc:1248 imb:30 pmb:533 smb:787 d:- ref:0 ; in:4577 out:4577 type:P dur:82000000 cpbdur:82000000 q:20.36 tex:61791 mv:2591 misc:1234 imb:46 pmb:517 smb:787 d:- ref:0 ; in:4578 out:4578 type:P dur:82000000 cpbdur:82000000 q:20.54 tex:54989 mv:2781 misc:1302 imb:16 pmb:539 smb:795 d:- ref:0 ; in:4579 out:4579 type:P dur:82000000 cpbdur:82000000 q:20.37 tex:52940 mv:2673 misc:1259 imb:27 pmb:523 smb:800 d:- ref:0 ; in:4580 out:4580 type:P dur:82000000 cpbdur:82000000 q:20.94 tex:63928 mv:3114 misc:1334 imb:32 pmb:570 smb:748 d:- ref:0 ; in:4581 out:4581 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:56212 mv:2663 misc:1261 imb:31 pmb:527 smb:792 d:- ref:0 ; in:4582 out:4582 type:P dur:82000000 cpbdur:82000000 q:21.03 tex:65105 mv:2990 misc:1209 imb:30 pmb:504 smb:816 d:- ref:0 ; in:4583 out:4583 type:P dur:82000000 cpbdur:82000000 q:19.43 tex:48457 mv:2960 misc:1527 imb:33 pmb:780 smb:537 d:- ref:0 ; in:4584 out:4584 type:P dur:82000000 cpbdur:82000000 q:19.72 tex:45268 mv:2433 misc:1235 imb:15 pmb:465 smb:870 d:- ref:0 ; in:4585 out:4585 type:P dur:82000000 cpbdur:82000000 q:19.44 tex:48826 mv:2968 misc:1422 imb:27 pmb:592 smb:731 d:- ref:0 ; in:4586 out:4586 type:P dur:82000000 cpbdur:82000000 q:18.82 tex:21945 mv:2501 misc:1426 imb:52 pmb:491 smb:807 d:- ref:0 ; in:4587 out:4587 type:P dur:82000000 cpbdur:82000000 q:18.40 tex:52825 mv:2918 misc:1505 imb:40 pmb:702 smb:608 d:- ref:0 ; in:4588 out:4588 type:P dur:82000000 cpbdur:82000000 q:20.58 tex:78198 mv:3601 misc:1321 imb:67 pmb:579 smb:704 d:- ref:0 ; in:4589 out:4589 type:P dur:82000000 cpbdur:82000000 q:22.11 tex:87888 mv:6946 misc:1406 imb:114 pmb:692 smb:544 d:- ref:0 ; in:4590 out:4590 type:P dur:82000000 cpbdur:82000000 q:21.46 tex:71751 mv:3395 misc:1334 imb:58 pmb:601 smb:691 d:- ref:0 ; in:4591 out:4591 type:P dur:82000000 cpbdur:82000000 q:21.25 tex:72838 mv:3374 misc:1348 imb:52 pmb:600 smb:698 d:- ref:0 ; in:4592 out:4592 type:P dur:82000000 cpbdur:82000000 q:22.41 tex:88638 mv:6376 misc:1330 imb:121 pmb:620 smb:609 d:- ref:0 ; in:4593 out:4593 type:P dur:82000000 cpbdur:82000000 q:20.88 tex:35800 mv:2568 misc:1384 imb:60 pmb:532 smb:758 d:- ref:0 ; in:4594 out:4594 type:P dur:82000000 cpbdur:82000000 q:20.12 tex:49835 mv:3148 misc:1425 imb:97 pmb:634 smb:619 d:- ref:0 ; in:4595 out:4595 type:P dur:82000000 cpbdur:82000000 q:20.18 tex:54881 mv:2917 misc:1410 imb:51 pmb:587 smb:712 d:- ref:0 ; in:4596 out:4596 type:P dur:82000000 cpbdur:82000000 q:20.55 tex:62203 mv:3266 misc:1291 imb:54 pmb:552 smb:744 d:- ref:0 ; in:4597 out:4597 type:P dur:82000000 cpbdur:82000000 q:20.25 tex:51570 mv:3074 misc:1284 imb:66 pmb:536 smb:748 d:- ref:0 ; in:4598 out:4598 type:P dur:82000000 cpbdur:82000000 q:19.00 tex:39653 mv:3179 misc:1568 imb:52 pmb:817 smb:481 d:- ref:0 ; in:4599 out:4599 type:P dur:82000000 cpbdur:82000000 q:17.20 tex:73466 mv:3663 misc:1559 imb:54 pmb:987 smb:309 d:- ref:0 ; in:4600 out:4600 type:P dur:82000000 cpbdur:82000000 q:19.64 tex:62442 mv:2697 misc:1349 imb:51 pmb:573 smb:726 d:- ref:0 ; in:4601 out:4601 type:P dur:82000000 cpbdur:82000000 q:19.63 tex:39303 mv:2013 misc:1116 imb:30 pmb:435 smb:885 d:- ref:0 ; in:4602 out:4602 type:P dur:82000000 cpbdur:82000000 q:18.89 tex:44442 mv:2843 misc:1499 imb:42 pmb:667 smb:641 d:- ref:0 ; in:4603 out:4603 type:P dur:82000000 cpbdur:82000000 q:19.01 tex:39688 mv:2566 misc:1442 imb:25 pmb:560 smb:765 d:- ref:0 ; in:4604 out:4604 type:P dur:82000000 cpbdur:82000000 q:18.80 tex:33106 mv:2154 misc:1244 imb:17 pmb:456 smb:877 d:- ref:0 ; in:4605 out:4605 type:P dur:82000000 cpbdur:82000000 q:18.62 tex:38715 mv:1935 misc:1238 imb:2 pmb:465 smb:883 d:- ref:0 ; in:4606 out:4606 type:P dur:82000000 cpbdur:82000000 q:19.64 tex:47156 mv:2610 misc:1410 imb:46 pmb:572 smb:732 d:- ref:0 ; in:4607 out:4607 type:P dur:82000000 cpbdur:82000000 q:20.11 tex:57538 mv:3076 misc:1258 imb:39 pmb:516 smb:795 d:- ref:0 ; in:4608 out:4608 type:P dur:82000000 cpbdur:82000000 q:19.53 tex:42020 mv:1717 misc:1111 imb:25 pmb:397 smb:928 d:- ref:0 ; in:4609 out:4609 type:P dur:82000000 cpbdur:82000000 q:20.23 tex:62435 mv:2689 misc:1220 imb:38 pmb:493 smb:819 d:- ref:0 ; in:4610 out:4610 type:P dur:82000000 cpbdur:82000000 q:18.88 tex:28705 mv:2891 misc:1532 imb:50 pmb:703 smb:597 d:- ref:0 ; in:4611 out:4611 type:P dur:82000000 cpbdur:82000000 q:17.55 tex:26955 mv:2224 misc:1477 imb:20 pmb:598 smb:732 d:- ref:0 ; in:4612 out:4612 type:P dur:82000000 cpbdur:82000000 q:19.78 tex:72799 mv:2547 misc:1158 imb:26 pmb:473 smb:851 d:- ref:0 ; in:4613 out:4613 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:66161 mv:2405 misc:1122 imb:28 pmb:451 smb:871 d:- ref:0 ; in:4614 out:4614 type:P dur:82000000 cpbdur:82000000 q:18.99 tex:19362 mv:1812 misc:1394 imb:18 pmb:518 smb:814 d:- ref:0 ; in:4615 out:4615 type:P dur:82000000 cpbdur:82000000 q:17.28 tex:58115 mv:3282 misc:1579 imb:26 pmb:950 smb:374 d:- ref:0 ; in:4616 out:4616 type:P dur:82000000 cpbdur:82000000 q:21.28 tex:339046 mv:16527 misc:1419 imb:1177 pmb:173 smb:0 d:- ref:0 ; in:4617 out:4617 type:P dur:82000000 cpbdur:82000000 q:25.15 tex:44553 mv:4668 misc:1379 imb:8 pmb:622 smb:720 d:- ref:0 ; in:4618 out:4618 type:P dur:82000000 cpbdur:82000000 q:23.97 tex:49777 mv:4646 misc:1457 imb:26 pmb:690 smb:634 d:- ref:0 ; in:4619 out:4619 type:P dur:82000000 cpbdur:82000000 q:23.58 tex:66558 mv:5311 misc:1395 imb:46 pmb:677 smb:627 d:- ref:0 ; in:4620 out:4620 type:P dur:82000000 cpbdur:82000000 q:22.82 tex:56064 mv:4364 misc:1468 imb:84 pmb:722 smb:544 d:- ref:0 ; in:4621 out:4621 type:P dur:82000000 cpbdur:82000000 q:22.52 tex:57951 mv:4757 misc:1452 imb:74 pmb:659 smb:617 d:- ref:0 ; in:4622 out:4622 type:P dur:82000000 cpbdur:82000000 q:22.94 tex:68366 mv:7311 misc:1507 imb:370 pmb:715 smb:265 d:- ref:0 ; in:4623 out:4623 type:P dur:82000000 cpbdur:82000000 q:21.29 tex:68044 mv:4708 misc:1544 imb:164 pmb:862 smb:324 d:- ref:0 ; in:4624 out:4624 type:P dur:82000000 cpbdur:82000000 q:21.45 tex:71708 mv:4930 misc:1546 imb:110 pmb:772 smb:468 d:- ref:0 ; in:4625 out:4625 type:P dur:82000000 cpbdur:82000000 q:22.17 tex:74789 mv:3794 misc:1369 imb:56 pmb:600 smb:694 d:- ref:0 ; in:4626 out:4626 type:P dur:82000000 cpbdur:82000000 q:21.35 tex:55603 mv:3053 misc:1416 imb:48 pmb:597 smb:705 d:- ref:0 ; in:4627 out:4627 type:P dur:82000000 cpbdur:82000000 q:20.66 tex:46076 mv:2202 misc:1346 imb:14 pmb:540 smb:796 d:- ref:0 ; in:4628 out:4628 type:P dur:82000000 cpbdur:82000000 q:21.60 tex:66790 mv:3579 misc:1351 imb:47 pmb:573 smb:730 d:- ref:0 ; in:4629 out:4629 type:P dur:82000000 cpbdur:82000000 q:21.56 tex:57758 mv:3717 misc:1341 imb:21 pmb:595 smb:734 d:- ref:0 ; in:4630 out:4630 type:P dur:82000000 cpbdur:82000000 q:20.64 tex:44881 mv:2546 misc:1397 imb:23 pmb:562 smb:765 d:- ref:0 ; in:4631 out:4631 type:P dur:82000000 cpbdur:82000000 q:21.11 tex:56497 mv:3111 misc:1384 imb:53 pmb:547 smb:750 d:- ref:0 ; in:4632 out:4632 type:P dur:82000000 cpbdur:82000000 q:19.41 tex:76209 mv:4051 misc:1556 imb:71 pmb:939 smb:340 d:- ref:0 ; in:4633 out:4633 type:P dur:82000000 cpbdur:82000000 q:18.64 tex:23232 mv:2143 misc:1465 imb:47 pmb:493 smb:810 d:- ref:0 ; in:4634 out:4634 type:P dur:82000000 cpbdur:82000000 q:20.68 tex:68166 mv:3412 misc:1350 imb:44 pmb:548 smb:758 d:- ref:0 ; in:4635 out:4635 type:P dur:82000000 cpbdur:82000000 q:20.09 tex:57752 mv:2455 misc:1321 imb:13 pmb:581 smb:756 d:- ref:0 ; in:4636 out:4636 type:P dur:82000000 cpbdur:82000000 q:20.75 tex:60979 mv:3471 misc:1334 imb:8 pmb:601 smb:741 d:- ref:0 ; in:4637 out:4637 type:P dur:82000000 cpbdur:82000000 q:21.75 tex:66254 mv:3999 misc:1307 imb:38 pmb:531 smb:781 d:- ref:0 ; in:4638 out:4638 type:P dur:82000000 cpbdur:82000000 q:21.83 tex:64877 mv:4269 misc:1374 imb:31 pmb:657 smb:662 d:- ref:0 ; in:4639 out:4639 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:54447 mv:2916 misc:1437 imb:55 pmb:656 smb:639 d:- ref:0 ; in:4640 out:4640 type:P dur:82000000 cpbdur:82000000 q:21.50 tex:78149 mv:4302 misc:1453 imb:64 pmb:656 smb:630 d:- ref:0 ; in:4641 out:4641 type:P dur:82000000 cpbdur:82000000 q:21.50 tex:53610 mv:3952 misc:1430 imb:48 pmb:634 smb:668 d:- ref:0 ; in:4642 out:4642 type:P dur:82000000 cpbdur:82000000 q:19.98 tex:45200 mv:3412 misc:1540 imb:102 pmb:706 smb:542 d:- ref:0 ; in:4643 out:4643 type:P dur:82000000 cpbdur:82000000 q:21.49 tex:75166 mv:4303 misc:1435 imb:78 pmb:609 smb:663 d:- ref:0 ; in:4644 out:4644 type:P dur:82000000 cpbdur:82000000 q:20.24 tex:42142 mv:2205 misc:1341 imb:36 pmb:535 smb:779 d:- ref:0 ; in:4645 out:4645 type:P dur:82000000 cpbdur:82000000 q:19.52 tex:31081 mv:2083 misc:1380 imb:35 pmb:499 smb:816 d:- ref:0 ; in:4646 out:4646 type:P dur:82000000 cpbdur:82000000 q:19.88 tex:38126 mv:1789 misc:1061 imb:40 pmb:293 smb:1017 d:- ref:0 ; in:4647 out:4647 type:P dur:82000000 cpbdur:82000000 q:19.72 tex:44131 mv:2168 misc:1333 imb:23 pmb:516 smb:811 d:- ref:0 ; in:4648 out:4648 type:P dur:82000000 cpbdur:82000000 q:20.97 tex:78373 mv:4116 misc:1359 imb:22 pmb:658 smb:670 d:- ref:0 ; in:4649 out:4649 type:P dur:82000000 cpbdur:82000000 q:22.28 tex:79864 mv:4368 misc:1360 imb:36 pmb:608 smb:706 d:- ref:0 ; in:4650 out:4650 type:P dur:82000000 cpbdur:82000000 q:20.37 tex:38426 mv:2124 misc:1402 imb:20 pmb:606 smb:724 d:- ref:0 ; in:4651 out:4651 type:P dur:82000000 cpbdur:82000000 q:19.41 tex:63566 mv:3795 misc:1559 imb:70 pmb:873 smb:407 d:- ref:0 ; in:4652 out:4652 type:P dur:82000000 cpbdur:82000000 q:21.80 tex:78324 mv:4239 misc:1261 imb:52 pmb:549 smb:749 d:- ref:0 ; in:4653 out:4653 type:P dur:82000000 cpbdur:82000000 q:20.46 tex:47072 mv:2359 misc:1401 imb:30 pmb:583 smb:737 d:- ref:0 ; in:4654 out:4654 type:P dur:82000000 cpbdur:82000000 q:19.56 tex:26097 mv:1788 misc:1339 imb:33 pmb:426 smb:891 d:- ref:0 ; in:4655 out:4655 type:P dur:82000000 cpbdur:82000000 q:20.76 tex:65663 mv:3283 misc:1318 imb:35 pmb:541 smb:774 d:- ref:0 ; in:4656 out:4656 type:P dur:82000000 cpbdur:82000000 q:19.73 tex:34177 mv:2279 misc:1408 imb:40 pmb:543 smb:767 d:- ref:0 ; in:4657 out:4657 type:P dur:82000000 cpbdur:82000000 q:19.27 tex:62035 mv:3498 misc:1531 imb:43 pmb:826 smb:481 d:- ref:0 ; in:4658 out:4658 type:P dur:82000000 cpbdur:82000000 q:20.18 tex:50385 mv:2633 misc:1246 imb:28 pmb:447 smb:875 d:- ref:0 ; in:4659 out:4659 type:P dur:82000000 cpbdur:82000000 q:20.75 tex:53451 mv:3591 misc:1414 imb:49 pmb:635 smb:666 d:- ref:0 ; in:4660 out:4660 type:P dur:82000000 cpbdur:82000000 q:20.64 tex:42787 mv:3262 misc:1439 imb:84 pmb:558 smb:708 d:- ref:0 ; in:4661 out:4661 type:P dur:82000000 cpbdur:82000000 q:22.40 tex:89444 mv:9023 misc:1453 imb:505 pmb:735 smb:110 d:- ref:0 ; in:4662 out:4662 type:P dur:82000000 cpbdur:82000000 q:21.95 tex:49058 mv:4238 misc:1496 imb:82 pmb:708 smb:560 d:- ref:0 ; in:4663 out:4663 type:P dur:82000000 cpbdur:82000000 q:21.39 tex:54811 mv:4391 misc:1526 imb:85 pmb:763 smb:502 d:- ref:0 ; in:4664 out:4664 type:P dur:82000000 cpbdur:82000000 q:21.11 tex:34527 mv:3413 misc:1420 imb:105 pmb:443 smb:802 d:- ref:0 ; in:4665 out:4665 type:P dur:82000000 cpbdur:82000000 q:21.41 tex:66620 mv:5437 misc:1503 imb:131 pmb:745 smb:474 d:- ref:0 ; in:4666 out:4666 type:P dur:82000000 cpbdur:82000000 q:21.78 tex:73366 mv:4936 misc:1418 imb:81 pmb:674 smb:595 d:- ref:0 ; in:4667 out:4667 type:P dur:82000000 cpbdur:82000000 q:22.38 tex:78768 mv:5724 misc:1404 imb:66 pmb:648 smb:636 d:- ref:0 ; in:4668 out:4668 type:P dur:82000000 cpbdur:82000000 q:22.09 tex:70080 mv:4301 misc:1331 imb:15 pmb:649 smb:686 d:- ref:0 ; in:4669 out:4669 type:P dur:82000000 cpbdur:82000000 q:22.01 tex:62637 mv:4122 misc:1401 imb:20 pmb:668 smb:662 d:- ref:0 ; in:4670 out:4670 type:P dur:82000000 cpbdur:82000000 q:23.42 tex:95849 mv:7853 misc:1306 imb:122 pmb:597 smb:631 d:- ref:0 ; in:4671 out:4671 type:P dur:82000000 cpbdur:82000000 q:22.78 tex:62260 mv:4875 misc:1369 imb:27 pmb:671 smb:652 d:- ref:0 ; in:4672 out:4672 type:P dur:82000000 cpbdur:82000000 q:22.41 tex:79811 mv:5338 misc:1451 imb:43 pmb:748 smb:559 d:- ref:0 ; in:4673 out:4673 type:P dur:82000000 cpbdur:82000000 q:23.49 tex:85035 mv:6872 misc:1229 imb:128 pmb:486 smb:736 d:- ref:0 ; in:4674 out:4674 type:P dur:82000000 cpbdur:82000000 q:22.08 tex:56433 mv:2812 misc:1371 imb:38 pmb:616 smb:696 d:- ref:0 ; in:4675 out:4675 type:P dur:82000000 cpbdur:82000000 q:21.08 tex:54645 mv:3204 misc:1471 imb:49 pmb:686 smb:615 d:- ref:0 ; in:4676 out:4676 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:102756 mv:7927 misc:1357 imb:166 pmb:591 smb:593 d:- ref:0 ; in:4677 out:4677 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:56259 mv:4019 misc:1354 imb:25 pmb:615 smb:710 d:- ref:0 ; in:4678 out:4678 type:P dur:82000000 cpbdur:82000000 q:21.75 tex:57720 mv:3678 misc:1482 imb:67 pmb:696 smb:587 d:- ref:0 ; in:4679 out:4679 type:P dur:82000000 cpbdur:82000000 q:23.29 tex:92643 mv:7226 misc:1251 imb:146 pmb:536 smb:668 d:- ref:0 ; in:4680 out:4680 type:P dur:82000000 cpbdur:82000000 q:21.46 tex:55343 mv:3070 misc:1499 imb:75 pmb:686 smb:589 d:- ref:0 ; in:4681 out:4681 type:P dur:82000000 cpbdur:82000000 q:21.31 tex:67700 mv:3911 misc:1429 imb:50 pmb:683 smb:617 d:- ref:0 ; in:4682 out:4682 type:P dur:82000000 cpbdur:82000000 q:22.15 tex:75311 mv:4343 misc:1330 imb:52 pmb:577 smb:721 d:- ref:0 ; in:4683 out:4683 type:P dur:82000000 cpbdur:82000000 q:21.20 tex:50268 mv:2575 misc:1381 imb:31 pmb:579 smb:740 d:- ref:0 ; in:4684 out:4684 type:P dur:82000000 cpbdur:82000000 q:20.58 tex:46316 mv:2546 misc:1282 imb:16 pmb:516 smb:818 d:- ref:0 ; in:4685 out:4685 type:P dur:82000000 cpbdur:82000000 q:21.30 tex:59145 mv:3477 misc:1394 imb:51 pmb:573 smb:726 d:- ref:0 ; in:4686 out:4686 type:P dur:82000000 cpbdur:82000000 q:21.43 tex:66664 mv:4139 misc:1469 imb:85 pmb:665 smb:600 d:- ref:0 ; in:4687 out:4687 type:P dur:82000000 cpbdur:82000000 q:21.46 tex:70813 mv:3840 misc:1387 imb:62 pmb:634 smb:654 d:- ref:0 ; in:4688 out:4688 type:P dur:82000000 cpbdur:82000000 q:21.89 tex:56304 mv:4380 misc:1516 imb:136 pmb:630 smb:584 d:- ref:0 ; in:4689 out:4689 type:P dur:82000000 cpbdur:82000000 q:20.63 tex:34617 mv:3550 misc:1529 imb:127 pmb:618 smb:605 d:- ref:0 ; in:4690 out:4690 type:P dur:82000000 cpbdur:82000000 q:19.69 tex:45317 mv:3331 misc:1512 imb:84 pmb:691 smb:575 d:- ref:0 ; in:4691 out:4691 type:P dur:82000000 cpbdur:82000000 q:21.71 tex:74457 mv:4751 misc:1408 imb:65 pmb:619 smb:666 d:- ref:0 ; in:4692 out:4692 type:P dur:82000000 cpbdur:82000000 q:22.01 tex:68833 mv:5122 misc:1373 imb:39 pmb:674 smb:637 d:- ref:0 ; in:4693 out:4693 type:P dur:82000000 cpbdur:82000000 q:21.94 tex:65504 mv:4733 misc:1411 imb:40 pmb:697 smb:613 d:- ref:0 ; in:4694 out:4694 type:P dur:82000000 cpbdur:82000000 q:25.90 tex:171432 mv:13959 misc:1417 imb:1231 pmb:119 smb:0 d:- ref:0 ; in:4695 out:4695 type:P dur:82000000 cpbdur:82000000 q:23.89 tex:32073 mv:1812 misc:1163 imb:16 pmb:446 smb:888 d:- ref:0 ; in:4696 out:4696 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:71700 mv:4285 misc:1447 imb:120 pmb:751 smb:479 d:- ref:0 ; in:4697 out:4697 type:P dur:82000000 cpbdur:82000000 q:21.30 tex:53683 mv:4061 misc:1520 imb:102 pmb:739 smb:509 d:- ref:0 ; in:4698 out:4698 type:P dur:82000000 cpbdur:82000000 q:19.80 tex:43254 mv:2227 misc:1351 imb:23 pmb:583 smb:744 d:- ref:0 ; in:4699 out:4699 type:P dur:82000000 cpbdur:82000000 q:19.87 tex:46052 mv:2684 misc:1360 imb:43 pmb:546 smb:761 d:- ref:0 ; in:4700 out:4700 type:P dur:82000000 cpbdur:82000000 q:19.32 tex:61978 mv:3706 misc:1540 imb:73 pmb:836 smb:441 d:- ref:0 ; in:4701 out:4701 type:P dur:82000000 cpbdur:82000000 q:17.94 tex:41511 mv:2618 misc:1519 imb:38 pmb:702 smb:610 d:- ref:0 ; in:4702 out:4702 type:P dur:82000000 cpbdur:82000000 q:18.58 tex:41788 mv:2667 misc:1529 imb:44 pmb:647 smb:659 d:- ref:0 ; in:4703 out:4703 type:P dur:82000000 cpbdur:82000000 q:18.73 tex:36483 mv:2411 misc:1394 imb:39 pmb:537 smb:774 d:- ref:0 ; in:4704 out:4704 type:P dur:82000000 cpbdur:82000000 q:17.46 tex:64963 mv:3741 misc:1544 imb:68 pmb:949 smb:333 d:- ref:0 ; in:4705 out:4705 type:P dur:82000000 cpbdur:82000000 q:16.89 tex:19658 mv:2105 misc:1493 imb:26 pmb:587 smb:737 d:- ref:0 ; in:4706 out:4706 type:P dur:82000000 cpbdur:82000000 q:17.87 tex:29606 mv:2362 misc:1480 imb:49 pmb:542 smb:759 d:- ref:0 ; in:4707 out:4707 type:P dur:82000000 cpbdur:82000000 q:17.71 tex:23909 mv:1880 misc:1379 imb:37 pmb:430 smb:883 d:- ref:0 ; in:4708 out:4708 type:P dur:82000000 cpbdur:82000000 q:16.88 tex:29881 mv:2675 misc:1596 imb:45 pmb:687 smb:618 d:- ref:0 ; in:4709 out:4709 type:P dur:82000000 cpbdur:82000000 q:17.83 tex:26413 mv:2289 misc:1498 imb:44 pmb:551 smb:755 d:- ref:0 ; in:4710 out:4710 type:P dur:82000000 cpbdur:82000000 q:17.67 tex:37073 mv:1547 misc:1244 imb:9 pmb:417 smb:924 d:- ref:0 ; in:4711 out:4711 type:P dur:82000000 cpbdur:82000000 q:17.84 tex:24315 mv:2386 misc:1491 imb:56 pmb:574 smb:720 d:- ref:0 ; in:4712 out:4712 type:P dur:82000000 cpbdur:82000000 q:17.60 tex:32752 mv:1795 misc:1341 imb:33 pmb:455 smb:862 d:- ref:0 ; in:4713 out:4713 type:P dur:82000000 cpbdur:82000000 q:16.59 tex:46781 mv:2982 misc:1581 imb:48 pmb:806 smb:496 d:- ref:0 ; in:4714 out:4714 type:P dur:82000000 cpbdur:82000000 q:17.32 tex:28633 mv:2865 misc:1590 imb:47 pmb:729 smb:574 d:- ref:0 ; in:4715 out:4715 type:P dur:82000000 cpbdur:82000000 q:16.68 tex:15477 mv:1855 misc:1452 imb:31 pmb:489 smb:830 d:- ref:0 ; in:4716 out:4716 type:P dur:82000000 cpbdur:82000000 q:15.40 tex:73483 mv:5022 misc:1575 imb:72 pmb:1024 smb:254 d:- ref:0 ; in:4717 out:4717 type:P dur:82000000 cpbdur:82000000 q:16.92 tex:23430 mv:2188 misc:1502 imb:36 pmb:578 smb:736 d:- ref:0 ; in:4718 out:4718 type:P dur:82000000 cpbdur:82000000 q:16.12 tex:34311 mv:3118 misc:1611 imb:43 pmb:834 smb:473 d:- ref:0 ; in:4719 out:4719 type:P dur:82000000 cpbdur:82000000 q:17.34 tex:29037 mv:3124 misc:1607 imb:68 pmb:730 smb:552 d:- ref:0 ; in:4720 out:4720 type:P dur:82000000 cpbdur:82000000 q:17.12 tex:38277 mv:2049 misc:1386 imb:33 pmb:501 smb:816 d:- ref:0 ; in:4721 out:4721 type:P dur:82000000 cpbdur:82000000 q:17.67 tex:21287 mv:2068 misc:1437 imb:53 pmb:486 smb:811 d:- ref:0 ; in:4722 out:4722 type:P dur:82000000 cpbdur:82000000 q:17.34 tex:30655 mv:2565 misc:1556 imb:58 pmb:605 smb:687 d:- ref:0 ; in:4723 out:4723 type:P dur:82000000 cpbdur:82000000 q:17.03 tex:33418 mv:2101 misc:1425 imb:38 pmb:523 smb:789 d:- ref:0 ; in:4724 out:4724 type:P dur:82000000 cpbdur:82000000 q:17.63 tex:19319 mv:2035 misc:1414 imb:45 pmb:485 smb:820 d:- ref:0 ; in:4725 out:4725 type:P dur:82000000 cpbdur:82000000 q:16.30 tex:42812 mv:3707 misc:1593 imb:64 pmb:971 smb:315 d:- ref:0 ; in:4726 out:4726 type:P dur:82000000 cpbdur:82000000 q:17.12 tex:22213 mv:2794 misc:1625 imb:56 pmb:694 smb:600 d:- ref:0 ; in:4727 out:4727 type:P dur:82000000 cpbdur:82000000 q:15.89 tex:24611 mv:2602 misc:1611 imb:28 pmb:750 smb:572 d:- ref:0 ; in:4728 out:4728 type:P dur:82000000 cpbdur:82000000 q:16.79 tex:15638 mv:2734 misc:1572 imb:60 pmb:644 smb:646 d:- ref:0 ; in:4729 out:4729 type:P dur:82000000 cpbdur:82000000 q:16.41 tex:40850 mv:3039 misc:1615 imb:45 pmb:803 smb:502 d:- ref:0 ; in:4730 out:4730 type:P dur:82000000 cpbdur:82000000 q:17.81 tex:24182 mv:2381 misc:1525 imb:62 pmb:529 smb:759 d:- ref:0 ; in:4731 out:4731 type:P dur:82000000 cpbdur:82000000 q:18.27 tex:35125 mv:1987 misc:1328 imb:30 pmb:473 smb:847 d:- ref:0 ; in:4732 out:4732 type:P dur:82000000 cpbdur:82000000 q:16.98 tex:30974 mv:2968 misc:1586 imb:83 pmb:664 smb:603 d:- ref:0 ; in:4733 out:4733 type:P dur:82000000 cpbdur:82000000 q:17.26 tex:23749 mv:3075 misc:1592 imb:82 pmb:683 smb:585 d:- ref:0 ; in:4734 out:4734 type:P dur:82000000 cpbdur:82000000 q:16.25 tex:40067 mv:3527 misc:1582 imb:50 pmb:955 smb:345 d:- ref:0 ; in:4735 out:4735 type:P dur:82000000 cpbdur:82000000 q:17.25 tex:25197 mv:3122 misc:1593 imb:76 pmb:730 smb:544 d:- ref:0 ; in:4736 out:4736 type:P dur:82000000 cpbdur:82000000 q:16.29 tex:39185 mv:3038 misc:1601 imb:46 pmb:818 smb:486 d:- ref:0 ; in:4737 out:4737 type:P dur:82000000 cpbdur:82000000 q:16.96 tex:17795 mv:2739 misc:1578 imb:61 pmb:679 smb:610 d:- ref:0 ; in:4738 out:4738 type:P dur:82000000 cpbdur:82000000 q:15.82 tex:26187 mv:2905 misc:1612 imb:44 pmb:773 smb:533 d:- ref:0 ; in:4739 out:4739 type:P dur:82000000 cpbdur:82000000 q:18.24 tex:41036 mv:2440 misc:1484 imb:32 pmb:592 smb:726 d:- ref:0 ; in:4740 out:4740 type:P dur:82000000 cpbdur:82000000 q:16.91 tex:20095 mv:2215 misc:1546 imb:39 pmb:581 smb:730 d:- ref:0 ; in:4741 out:4741 type:P dur:82000000 cpbdur:82000000 q:18.49 tex:45196 mv:2545 misc:1467 imb:48 pmb:575 smb:727 d:- ref:0 ; in:4742 out:4742 type:P dur:82000000 cpbdur:82000000 q:18.90 tex:34887 mv:2192 misc:1377 imb:38 pmb:470 smb:842 d:- ref:0 ; in:4743 out:4743 type:P dur:82000000 cpbdur:82000000 q:18.01 tex:29910 mv:2041 misc:1361 imb:43 pmb:473 smb:834 d:- ref:0 ; in:4744 out:4744 type:P dur:82000000 cpbdur:82000000 q:17.94 tex:19887 mv:2193 misc:1456 imb:60 pmb:485 smb:805 d:- ref:0 ; in:4745 out:4745 type:P dur:82000000 cpbdur:82000000 q:18.55 tex:39328 mv:2034 misc:1294 imb:23 pmb:470 smb:857 d:- ref:0 ; in:4746 out:4746 type:P dur:82000000 cpbdur:82000000 q:17.13 tex:39741 mv:3157 misc:1558 imb:66 pmb:777 smb:507 d:- ref:0 ; in:4747 out:4747 type:P dur:82000000 cpbdur:82000000 q:17.65 tex:18792 mv:2175 misc:1497 imb:48 pmb:499 smb:803 d:- ref:0 ; in:4748 out:4748 type:P dur:82000000 cpbdur:82000000 q:16.46 tex:51884 mv:3970 misc:1578 imb:65 pmb:1014 smb:271 d:- ref:0 ; in:4749 out:4749 type:P dur:82000000 cpbdur:82000000 q:18.17 tex:37216 mv:2368 misc:1488 imb:33 pmb:594 smb:723 d:- ref:0 ; in:4750 out:4750 type:I dur:82000000 cpbdur:82000000 q:14.80 tex:424472 mv:14786 misc:382 imb:1350 pmb:0 smb:0 d:- ref:; in:4751 out:4751 type:P dur:82000000 cpbdur:82000000 q:22.17 tex:12936 mv:531 misc:717 imb:0 pmb:163 smb:1187 d:- ref:0 ; in:4752 out:4752 type:P dur:82000000 cpbdur:82000000 q:21.86 tex:9842 mv:648 misc:798 imb:2 pmb:184 smb:1164 d:- ref:0 ; in:4753 out:4753 type:P dur:82000000 cpbdur:82000000 q:20.16 tex:12716 mv:914 misc:994 imb:6 pmb:262 smb:1082 d:- ref:0 ; in:4754 out:4754 type:P dur:82000000 cpbdur:82000000 q:19.63 tex:16953 mv:1137 misc:1110 imb:25 pmb:295 smb:1030 d:- ref:0 ; in:4755 out:4755 type:P dur:82000000 cpbdur:82000000 q:18.40 tex:33722 mv:2938 misc:1556 imb:85 pmb:632 smb:633 d:- ref:0 ; in:4756 out:4756 type:P dur:82000000 cpbdur:82000000 q:18.54 tex:28585 mv:2239 misc:1368 imb:46 pmb:455 smb:849 d:- ref:0 ; in:4757 out:4757 type:P dur:82000000 cpbdur:82000000 q:18.44 tex:30072 mv:2304 misc:1376 imb:52 pmb:452 smb:846 d:- ref:0 ; in:4758 out:4758 type:P dur:82000000 cpbdur:82000000 q:18.41 tex:23760 mv:2432 misc:1504 imb:73 pmb:502 smb:775 d:- ref:0 ; in:4759 out:4759 type:P dur:82000000 cpbdur:82000000 q:17.58 tex:13240 mv:1442 misc:1230 imb:59 pmb:266 smb:1025 d:- ref:0 ; in:4760 out:4760 type:P dur:82000000 cpbdur:82000000 q:18.98 tex:46697 mv:3624 misc:1479 imb:117 pmb:602 smb:631 d:- ref:0 ; in:4761 out:4761 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:43832 mv:7970 misc:1542 imb:451 pmb:662 smb:237 d:- ref:0 ; in:4762 out:4762 type:P dur:82000000 cpbdur:82000000 q:20.24 tex:38309 mv:5231 misc:1516 imb:223 pmb:651 smb:476 d:- ref:0 ; in:4763 out:4763 type:P dur:82000000 cpbdur:82000000 q:19.93 tex:33011 mv:4658 misc:1571 imb:225 pmb:654 smb:471 d:- ref:0 ; in:4764 out:4764 type:P dur:82000000 cpbdur:82000000 q:19.81 tex:34057 mv:3679 misc:1560 imb:155 pmb:599 smb:596 d:- ref:0 ; in:4765 out:4765 type:P dur:82000000 cpbdur:82000000 q:18.98 tex:46993 mv:3923 misc:1532 imb:90 pmb:793 smb:467 d:- ref:0 ; in:4766 out:4766 type:P dur:82000000 cpbdur:82000000 q:18.88 tex:29612 mv:2727 misc:1517 imb:57 pmb:643 smb:650 d:- ref:0 ; in:4767 out:4767 type:P dur:82000000 cpbdur:82000000 q:18.21 tex:40997 mv:3055 misc:1564 imb:56 pmb:737 smb:557 d:- ref:0 ; in:4768 out:4768 type:P dur:82000000 cpbdur:82000000 q:19.19 tex:47105 mv:3656 misc:1527 imb:91 pmb:686 smb:573 d:- ref:0 ; in:4769 out:4769 type:P dur:82000000 cpbdur:82000000 q:19.16 tex:47967 mv:2633 misc:1400 imb:39 pmb:545 smb:766 d:- ref:0 ; in:4770 out:4770 type:P dur:82000000 cpbdur:82000000 q:19.99 tex:50193 mv:2704 misc:1343 imb:55 pmb:520 smb:775 d:- ref:0 ; in:4771 out:4771 type:P dur:82000000 cpbdur:82000000 q:19.91 tex:40722 mv:2348 misc:1274 imb:44 pmb:486 smb:820 d:- ref:0 ; in:4772 out:4772 type:P dur:82000000 cpbdur:82000000 q:20.55 tex:49898 mv:3325 misc:1353 imb:58 pmb:553 smb:739 d:- ref:0 ; in:4773 out:4773 type:P dur:82000000 cpbdur:82000000 q:20.06 tex:38123 mv:3080 misc:1445 imb:111 pmb:538 smb:701 d:- ref:0 ; in:4774 out:4774 type:P dur:82000000 cpbdur:82000000 q:19.49 tex:61298 mv:4993 misc:1581 imb:171 pmb:825 smb:354 d:- ref:0 ; in:4775 out:4775 type:P dur:82000000 cpbdur:82000000 q:19.37 tex:38182 mv:3578 misc:1528 imb:107 pmb:698 smb:545 d:- ref:0 ; in:4776 out:4776 type:P dur:82000000 cpbdur:82000000 q:18.95 tex:39107 mv:2559 misc:1390 imb:61 pmb:525 smb:764 d:- ref:0 ; in:4777 out:4777 type:P dur:82000000 cpbdur:82000000 q:18.00 tex:39967 mv:2907 misc:1542 imb:75 pmb:659 smb:616 d:- ref:0 ; in:4778 out:4778 type:P dur:82000000 cpbdur:82000000 q:18.64 tex:45604 mv:3090 misc:1490 imb:65 pmb:662 smb:623 d:- ref:0 ; in:4779 out:4779 type:P dur:82000000 cpbdur:82000000 q:18.80 tex:40253 mv:3398 misc:1549 imb:76 pmb:730 smb:544 d:- ref:0 ; in:4780 out:4780 type:P dur:82000000 cpbdur:82000000 q:18.43 tex:49827 mv:4528 misc:1557 imb:179 pmb:728 smb:443 d:- ref:0 ; in:4781 out:4781 type:P dur:82000000 cpbdur:82000000 q:18.87 tex:43492 mv:4275 misc:1585 imb:139 pmb:755 smb:456 d:- ref:0 ; in:4782 out:4782 type:P dur:82000000 cpbdur:82000000 q:19.19 tex:42785 mv:4418 misc:1565 imb:144 pmb:748 smb:458 d:- ref:0 ; in:4783 out:4783 type:P dur:82000000 cpbdur:82000000 q:18.53 tex:35167 mv:2120 misc:1297 imb:38 pmb:452 smb:860 d:- ref:0 ; in:4784 out:4784 type:P dur:82000000 cpbdur:82000000 q:19.14 tex:41467 mv:3138 misc:1307 imb:116 pmb:518 smb:716 d:- ref:0 ; in:4785 out:4785 type:P dur:82000000 cpbdur:82000000 q:20.33 tex:46387 mv:7835 misc:1522 imb:462 pmb:659 smb:229 d:- ref:0 ; in:4786 out:4786 type:P dur:82000000 cpbdur:82000000 q:20.26 tex:38126 mv:5586 misc:1544 imb:280 pmb:612 smb:458 d:- ref:0 ; in:4787 out:4787 type:P dur:82000000 cpbdur:82000000 q:19.90 tex:23942 mv:5395 misc:1567 imb:314 pmb:603 smb:433 d:- ref:0 ; in:4788 out:4788 type:P dur:82000000 cpbdur:82000000 q:18.61 tex:38793 mv:3773 misc:1554 imb:94 pmb:785 smb:471 d:- ref:0 ; in:4789 out:4789 type:P dur:82000000 cpbdur:82000000 q:19.44 tex:59845 mv:4298 misc:1529 imb:109 pmb:754 smb:487 d:- ref:0 ; in:4790 out:4790 type:P dur:82000000 cpbdur:82000000 q:18.71 tex:30031 mv:1718 misc:1251 imb:14 pmb:438 smb:898 d:- ref:0 ; in:4791 out:4791 type:P dur:82000000 cpbdur:82000000 q:18.66 tex:28269 mv:2879 misc:1524 imb:58 pmb:651 smb:641 d:- ref:0 ; in:4792 out:4792 type:P dur:82000000 cpbdur:82000000 q:18.16 tex:35579 mv:2457 misc:1492 imb:40 pmb:595 smb:715 d:- ref:0 ; in:4793 out:4793 type:P dur:82000000 cpbdur:82000000 q:17.56 tex:27316 mv:1677 misc:1327 imb:22 pmb:435 smb:893 d:- ref:0 ; in:4794 out:4794 type:P dur:82000000 cpbdur:82000000 q:19.12 tex:50965 mv:2728 misc:1419 imb:34 pmb:612 smb:704 d:- ref:0 ; in:4795 out:4795 type:P dur:82000000 cpbdur:82000000 q:17.75 tex:22967 mv:1814 misc:1387 imb:25 pmb:476 smb:849 d:- ref:0 ; in:4796 out:4796 type:P dur:82000000 cpbdur:82000000 q:17.63 tex:18185 mv:2435 misc:1524 imb:54 pmb:559 smb:737 d:- ref:0 ; in:4797 out:4797 type:P dur:82000000 cpbdur:82000000 q:16.64 tex:40819 mv:3132 misc:1569 imb:43 pmb:848 smb:459 d:- ref:0 ; in:4798 out:4798 type:P dur:82000000 cpbdur:82000000 q:17.18 tex:28820 mv:3042 misc:1626 imb:59 pmb:764 smb:527 d:- ref:0 ; in:4799 out:4799 type:P dur:82000000 cpbdur:82000000 q:16.81 tex:25712 mv:2136 misc:1512 imb:26 pmb:586 smb:738 d:- ref:0 ; in:4800 out:4800 type:P dur:82000000 cpbdur:82000000 q:17.76 tex:21724 mv:2613 misc:1535 imb:67 pmb:589 smb:694 d:- ref:0 ; in:4801 out:4801 type:P dur:82000000 cpbdur:82000000 q:17.79 tex:27930 mv:2808 misc:1374 imb:80 pmb:514 smb:756 d:- ref:0 ; in:4802 out:4802 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:177921 mv:10101 misc:1226 imb:499 pmb:309 smb:542 d:- ref:0 ; in:4803 out:4803 type:P dur:82000000 cpbdur:82000000 q:22.58 tex:15565 mv:1232 misc:1051 imb:12 pmb:308 smb:1030 d:- ref:0 ; in:4804 out:4804 type:P dur:82000000 cpbdur:82000000 q:20.83 tex:32102 mv:3040 misc:1442 imb:116 pmb:586 smb:648 d:- ref:0 ; in:4805 out:4805 type:P dur:82000000 cpbdur:82000000 q:24.09 tex:138445 mv:9396 misc:1127 imb:294 pmb:422 smb:634 d:- ref:0 ; in:4806 out:4806 type:P dur:82000000 cpbdur:82000000 q:23.13 tex:61990 mv:4133 misc:1301 imb:73 pmb:587 smb:690 d:- ref:0 ; in:4807 out:4807 type:P dur:82000000 cpbdur:82000000 q:22.26 tex:67330 mv:5688 misc:1406 imb:97 pmb:668 smb:585 d:- ref:0 ; in:4808 out:4808 type:P dur:82000000 cpbdur:82000000 q:23.66 tex:68434 mv:13072 misc:1414 imb:1336 pmb:14 smb:0 d:- ref:0 ; in:4809 out:4809 type:P dur:82000000 cpbdur:82000000 q:21.88 tex:21272 mv:2462 misc:1194 imb:57 pmb:388 smb:905 d:- ref:0 ; in:4810 out:4810 type:P dur:82000000 cpbdur:82000000 q:21.17 tex:29732 mv:5121 misc:1555 imb:203 pmb:617 smb:530 d:- ref:0 ; in:4811 out:4811 type:P dur:82000000 cpbdur:82000000 q:20.60 tex:17040 mv:5202 misc:1534 imb:301 pmb:534 smb:515 d:- ref:0 ; in:4812 out:4812 type:P dur:82000000 cpbdur:82000000 q:21.98 tex:59789 mv:10191 misc:1468 imb:633 pmb:519 smb:198 d:- ref:0 ; in:4813 out:4813 type:P dur:82000000 cpbdur:82000000 q:20.83 tex:22550 mv:5378 misc:1520 imb:257 pmb:582 smb:511 d:- ref:0 ; in:4814 out:4814 type:P dur:82000000 cpbdur:82000000 q:23.10 tex:94857 mv:6177 misc:1310 imb:403 pmb:265 smb:682 d:- ref:0 ; in:4815 out:4815 type:P dur:82000000 cpbdur:82000000 q:21.02 tex:26586 mv:3548 misc:1506 imb:173 pmb:582 smb:595 d:- ref:0 ; in:4816 out:4816 type:P dur:82000000 cpbdur:82000000 q:25.00 tex:167796 mv:8179 misc:1161 imb:480 pmb:209 smb:661 d:- ref:0 ; in:4817 out:4817 type:P dur:82000000 cpbdur:82000000 q:23.06 tex:30939 mv:2012 misc:1377 imb:48 pmb:448 smb:854 d:- ref:0 ; in:4818 out:4818 type:P dur:82000000 cpbdur:82000000 q:25.52 tex:146810 mv:10592 misc:1198 imb:434 pmb:342 smb:574 d:- ref:0 ; in:4819 out:4819 type:P dur:82000000 cpbdur:82000000 q:23.78 tex:49891 mv:2719 misc:1310 imb:37 pmb:559 smb:754 d:- ref:0 ; in:4820 out:4820 type:P dur:82000000 cpbdur:82000000 q:22.28 tex:75283 mv:4154 misc:1507 imb:116 pmb:762 smb:472 d:- ref:0 ; in:4821 out:4821 type:P dur:82000000 cpbdur:82000000 q:25.26 tex:149213 mv:10468 misc:1207 imb:270 pmb:462 smb:618 d:- ref:0 ; in:4822 out:4822 type:P dur:82000000 cpbdur:82000000 q:23.13 tex:39761 mv:1864 misc:1263 imb:34 pmb:484 smb:832 d:- ref:0 ; in:4823 out:4823 type:P dur:82000000 cpbdur:82000000 q:21.21 tex:68979 mv:4323 misc:1506 imb:162 pmb:807 smb:381 d:- ref:0 ; in:4824 out:4824 type:P dur:82000000 cpbdur:82000000 q:25.21 tex:181047 mv:12151 misc:1402 imb:862 pmb:215 smb:273 d:- ref:0 ; in:4825 out:4825 type:P dur:82000000 cpbdur:82000000 q:23.41 tex:27368 mv:3168 misc:1456 imb:141 pmb:482 smb:727 d:- ref:0 ; in:4826 out:4826 type:P dur:82000000 cpbdur:82000000 q:21.63 tex:39394 mv:4237 misc:1553 imb:181 pmb:717 smb:452 d:- ref:0 ; in:4827 out:4827 type:P dur:82000000 cpbdur:82000000 q:23.57 tex:93620 mv:8692 misc:1320 imb:628 pmb:174 smb:548 d:- ref:0 ; in:4828 out:4828 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:26486 mv:2984 misc:1434 imb:104 pmb:508 smb:738 d:- ref:0 ; in:4829 out:4829 type:P dur:82000000 cpbdur:82000000 q:23.26 tex:77581 mv:7742 misc:1349 imb:528 pmb:210 smb:612 d:- ref:0 ; in:4830 out:4830 type:P dur:82000000 cpbdur:82000000 q:21.31 tex:24194 mv:3840 misc:1494 imb:209 pmb:514 smb:627 d:- ref:0 ; in:4831 out:4831 type:P dur:82000000 cpbdur:82000000 q:19.46 tex:47045 mv:4605 misc:1510 imb:136 pmb:791 smb:423 d:- ref:0 ; in:4832 out:4832 type:P dur:82000000 cpbdur:82000000 q:21.62 tex:52567 mv:10555 misc:1462 imb:1111 pmb:119 smb:120 d:- ref:0 ; in:4833 out:4833 type:P dur:82000000 cpbdur:82000000 q:19.61 tex:10311 mv:1290 misc:911 imb:46 pmb:206 smb:1098 d:- ref:0 ; in:4834 out:4834 type:P dur:82000000 cpbdur:82000000 q:21.32 tex:45260 mv:8163 misc:1345 imb:682 pmb:161 smb:507 d:- ref:0 ; in:4835 out:4835 type:P dur:82000000 cpbdur:82000000 q:19.78 tex:10783 mv:2103 misc:1234 imb:97 pmb:321 smb:932 d:- ref:0 ; in:4836 out:4836 type:P dur:82000000 cpbdur:82000000 q:20.46 tex:37260 mv:7143 misc:1509 imb:474 pmb:441 smb:435 d:- ref:0 ; in:4837 out:4837 type:P dur:82000000 cpbdur:82000000 q:19.74 tex:27385 mv:2894 misc:1201 imb:106 pmb:368 smb:876 d:- ref:0 ; in:4838 out:4838 type:P dur:82000000 cpbdur:82000000 q:19.99 tex:27020 mv:4813 misc:1383 imb:183 pmb:545 smb:622 d:- ref:0 ; in:4839 out:4839 type:P dur:82000000 cpbdur:82000000 q:23.99 tex:355024 mv:17246 misc:1418 imb:1186 pmb:164 smb:0 d:- ref:0 ; in:4840 out:4840 type:P dur:82000000 cpbdur:82000000 q:26.25 tex:41291 mv:3035 misc:1290 imb:19 pmb:595 smb:736 d:- ref:0 ; in:4841 out:4841 type:P dur:82000000 cpbdur:82000000 q:25.48 tex:88305 mv:6227 misc:1452 imb:44 pmb:953 smb:353 d:- ref:0 ; in:4842 out:4842 type:P dur:82000000 cpbdur:82000000 q:24.37 tex:69830 mv:4270 misc:1508 imb:35 pmb:932 smb:383 d:- ref:0 ; in:4843 out:4843 type:P dur:82000000 cpbdur:82000000 q:22.89 tex:57607 mv:3639 misc:1514 imb:36 pmb:951 smb:363 d:- ref:0 ; in:4844 out:4844 type:P dur:82000000 cpbdur:82000000 q:21.21 tex:109700 mv:4398 misc:1486 imb:33 pmb:1200 smb:117 d:- ref:0 ; in:4845 out:4845 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:95233 mv:3581 misc:1506 imb:20 pmb:879 smb:451 d:- ref:0 ; in:4846 out:4846 type:P dur:82000000 cpbdur:82000000 q:20.92 tex:65301 mv:2928 misc:1547 imb:10 pmb:880 smb:460 d:- ref:0 ; in:4847 out:4847 type:P dur:82000000 cpbdur:82000000 q:20.75 tex:49542 mv:2454 misc:1492 imb:8 pmb:712 smb:630 d:- ref:0 ; in:4848 out:4848 type:P dur:82000000 cpbdur:82000000 q:22.14 tex:93701 mv:4104 misc:1427 imb:22 pmb:794 smb:534 d:- ref:0 ; in:4849 out:4849 type:P dur:82000000 cpbdur:82000000 q:22.44 tex:87922 mv:3234 misc:1372 imb:11 pmb:840 smb:499 d:- ref:0 ; in:4850 out:4850 type:P dur:82000000 cpbdur:82000000 q:20.89 tex:51376 mv:2832 misc:1488 imb:8 pmb:880 smb:462 d:- ref:0 ; in:4851 out:4851 type:P dur:82000000 cpbdur:82000000 q:22.35 tex:71707 mv:2838 misc:1391 imb:20 pmb:668 smb:662 d:- ref:0 ; in:4852 out:4852 type:P dur:82000000 cpbdur:82000000 q:21.30 tex:40244 mv:2485 misc:1519 imb:11 pmb:735 smb:604 d:- ref:0 ; in:4853 out:4853 type:P dur:82000000 cpbdur:82000000 q:22.33 tex:84362 mv:3510 misc:1448 imb:35 pmb:776 smb:539 d:- ref:0 ; in:4854 out:4854 type:P dur:82000000 cpbdur:82000000 q:22.86 tex:63683 mv:2941 misc:1232 imb:34 pmb:529 smb:787 d:- ref:0 ; in:4855 out:4855 type:P dur:82000000 cpbdur:82000000 q:21.57 tex:33122 mv:2196 misc:1474 imb:8 pmb:656 smb:686 d:- ref:0 ; in:4856 out:4856 type:P dur:82000000 cpbdur:82000000 q:19.88 tex:74162 mv:3394 misc:1508 imb:12 pmb:1072 smb:266 d:- ref:0 ; in:4857 out:4857 type:P dur:82000000 cpbdur:82000000 q:21.40 tex:71503 mv:2927 misc:1434 imb:10 pmb:725 smb:615 d:- ref:0 ; in:4858 out:4858 type:P dur:82000000 cpbdur:82000000 q:21.23 tex:66918 mv:2888 misc:1498 imb:8 pmb:836 smb:506 d:- ref:0 ; in:4859 out:4859 type:P dur:82000000 cpbdur:82000000 q:21.06 tex:60451 mv:2283 misc:1402 imb:8 pmb:673 smb:669 d:- ref:0 ; in:4860 out:4860 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:72368 mv:2939 misc:1341 imb:7 pmb:683 smb:660 d:- ref:0 ; in:4861 out:4861 type:P dur:82000000 cpbdur:82000000 q:22.07 tex:44010 mv:2376 misc:1430 imb:6 pmb:680 smb:664 d:- ref:0 ; in:4862 out:4862 type:P dur:82000000 cpbdur:82000000 q:20.60 tex:37766 mv:2346 misc:1488 imb:11 pmb:708 smb:631 d:- ref:0 ; in:4863 out:4863 type:P dur:82000000 cpbdur:82000000 q:21.85 tex:66603 mv:3085 misc:1400 imb:23 pmb:641 smb:686 d:- ref:0 ; in:4864 out:4864 type:P dur:82000000 cpbdur:82000000 q:20.85 tex:42033 mv:2478 misc:1481 imb:13 pmb:706 smb:631 d:- ref:0 ; in:4865 out:4865 type:P dur:82000000 cpbdur:82000000 q:21.01 tex:51276 mv:2818 misc:1514 imb:16 pmb:744 smb:590 d:- ref:0 ; in:4866 out:4866 type:P dur:82000000 cpbdur:82000000 q:21.82 tex:61879 mv:2214 misc:1131 imb:15 pmb:492 smb:843 d:- ref:0 ; in:4867 out:4867 type:P dur:82000000 cpbdur:82000000 q:21.58 tex:43423 mv:1877 misc:1196 imb:9 pmb:481 smb:860 d:- ref:0 ; in:4868 out:4868 type:P dur:82000000 cpbdur:82000000 q:20.58 tex:39734 mv:2493 misc:1485 imb:6 pmb:735 smb:609 d:- ref:0 ; in:4869 out:4869 type:P dur:82000000 cpbdur:82000000 q:20.90 tex:49801 mv:2294 misc:1433 imb:9 pmb:618 smb:723 d:- ref:0 ; in:4870 out:4870 type:P dur:82000000 cpbdur:82000000 q:19.98 tex:56421 mv:2938 misc:1521 imb:8 pmb:930 smb:412 d:- ref:0 ; in:4871 out:4871 type:P dur:82000000 cpbdur:82000000 q:19.34 tex:103144 mv:4088 misc:1496 imb:10 pmb:1218 smb:122 d:- ref:0 ; in:4872 out:4872 type:P dur:82000000 cpbdur:82000000 q:20.23 tex:40514 mv:1880 misc:1374 imb:5 pmb:474 smb:871 d:- ref:0 ; in:4873 out:4873 type:P dur:82000000 cpbdur:82000000 q:20.15 tex:45389 mv:1992 misc:1331 imb:9 pmb:554 smb:787 d:- ref:0 ; in:4874 out:4874 type:P dur:82000000 cpbdur:82000000 q:20.26 tex:50251 mv:2495 misc:1470 imb:12 pmb:681 smb:657 d:- ref:0 ; in:4875 out:4875 type:P dur:82000000 cpbdur:82000000 q:21.55 tex:60378 mv:2493 misc:1241 imb:23 pmb:515 smb:812 d:- ref:0 ; in:4876 out:4876 type:P dur:82000000 cpbdur:82000000 q:20.37 tex:42053 mv:2392 misc:1499 imb:9 pmb:756 smb:585 d:- ref:0 ; in:4877 out:4877 type:P dur:82000000 cpbdur:82000000 q:19.76 tex:30440 mv:1714 misc:1294 imb:7 pmb:478 smb:865 d:- ref:0 ; in:4878 out:4878 type:P dur:82000000 cpbdur:82000000 q:20.40 tex:47557 mv:2132 misc:1447 imb:4 pmb:550 smb:796 d:- ref:0 ; in:4879 out:4879 type:P dur:82000000 cpbdur:82000000 q:19.84 tex:32432 mv:1632 misc:1240 imb:9 pmb:454 smb:887 d:- ref:0 ; in:4880 out:4880 type:P dur:82000000 cpbdur:82000000 q:18.56 tex:62282 mv:3758 misc:1544 imb:6 pmb:1142 smb:202 d:- ref:0 ; in:4881 out:4881 type:P dur:82000000 cpbdur:82000000 q:20.29 tex:44262 mv:1776 misc:1210 imb:6 pmb:396 smb:948 d:- ref:0 ; in:4882 out:4882 type:P dur:82000000 cpbdur:82000000 q:18.54 tex:29707 mv:2303 misc:1566 imb:8 pmb:689 smb:653 d:- ref:0 ; in:4883 out:4883 type:P dur:82000000 cpbdur:82000000 q:20.07 tex:53650 mv:2255 misc:1423 imb:8 pmb:645 smb:697 d:- ref:0 ; in:4884 out:4884 type:P dur:82000000 cpbdur:82000000 q:21.74 tex:82789 mv:3104 misc:1331 imb:10 pmb:766 smb:574 d:- ref:0 ; in:4885 out:4885 type:P dur:82000000 cpbdur:82000000 q:21.58 tex:45721 mv:3251 misc:1484 imb:35 pmb:815 smb:500 d:- ref:0 ; in:4886 out:4886 type:P dur:82000000 cpbdur:82000000 q:21.15 tex:61252 mv:5235 misc:1505 imb:137 pmb:1089 smb:124 d:- ref:0 ; in:4887 out:4887 type:P dur:82000000 cpbdur:82000000 q:23.57 tex:103026 mv:7707 misc:1467 imb:230 pmb:975 smb:145 d:- ref:0 ; in:4888 out:4888 type:P dur:82000000 cpbdur:82000000 q:22.35 tex:91036 mv:5281 misc:1459 imb:106 pmb:1163 smb:81 d:- ref:0 ; in:4889 out:4889 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:46185 mv:4337 misc:1542 imb:78 pmb:1033 smb:239 d:- ref:0 ; in:4890 out:4890 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:43721 mv:2851 misc:1532 imb:17 pmb:657 smb:676 d:- ref:0 ; in:4891 out:4891 type:P dur:82000000 cpbdur:82000000 q:19.70 tex:72322 mv:3771 misc:1507 imb:16 pmb:1147 smb:187 d:- ref:0 ; in:4892 out:4892 type:P dur:82000000 cpbdur:82000000 q:19.07 tex:88292 mv:4189 misc:1503 imb:11 pmb:1209 smb:130 d:- ref:0 ; in:4893 out:4893 type:P dur:82000000 cpbdur:82000000 q:20.18 tex:54354 mv:2398 misc:1336 imb:5 pmb:588 smb:757 d:- ref:0 ; in:4894 out:4894 type:P dur:82000000 cpbdur:82000000 q:21.31 tex:75773 mv:5230 misc:1525 imb:80 pmb:956 smb:314 d:- ref:0 ; in:4895 out:4895 type:P dur:82000000 cpbdur:82000000 q:22.56 tex:86713 mv:5209 misc:1446 imb:67 pmb:875 smb:408 d:- ref:0 ; in:4896 out:4896 type:P dur:82000000 cpbdur:82000000 q:23.52 tex:94716 mv:6254 misc:1478 imb:63 pmb:920 smb:367 d:- ref:0 ; in:4897 out:4897 type:P dur:82000000 cpbdur:82000000 q:24.03 tex:109486 mv:8225 misc:1489 imb:126 pmb:1003 smb:221 d:- ref:0 ; in:4898 out:4898 type:P dur:82000000 cpbdur:82000000 q:23.91 tex:88941 mv:6473 misc:1474 imb:103 pmb:963 smb:284 d:- ref:0 ; in:4899 out:4899 type:P dur:82000000 cpbdur:82000000 q:24.15 tex:101077 mv:7384 misc:1475 imb:125 pmb:1012 smb:213 d:- ref:0 ; in:4900 out:4900 type:P dur:82000000 cpbdur:82000000 q:23.13 tex:74286 mv:6131 misc:1495 imb:148 pmb:1011 smb:191 d:- ref:0 ; in:4901 out:4901 type:P dur:82000000 cpbdur:82000000 q:23.78 tex:107681 mv:7548 misc:1435 imb:104 pmb:992 smb:254 d:- ref:0 ; in:4902 out:4902 type:P dur:82000000 cpbdur:82000000 q:23.54 tex:76157 mv:5934 misc:1501 imb:91 pmb:928 smb:331 d:- ref:0 ; in:4903 out:4903 type:P dur:82000000 cpbdur:82000000 q:23.95 tex:106463 mv:7095 misc:1466 imb:104 pmb:1005 smb:241 d:- ref:0 ; in:4904 out:4904 type:P dur:82000000 cpbdur:82000000 q:24.17 tex:114905 mv:6917 misc:1474 imb:90 pmb:1021 smb:239 d:- ref:0 ; in:4905 out:4905 type:P dur:82000000 cpbdur:82000000 q:23.64 tex:65173 mv:5461 misc:1502 imb:76 pmb:923 smb:351 d:- ref:0 ; in:4906 out:4906 type:P dur:82000000 cpbdur:82000000 q:23.73 tex:94861 mv:6467 misc:1472 imb:95 pmb:1021 smb:234 d:- ref:0 ; in:4907 out:4907 type:P dur:82000000 cpbdur:82000000 q:24.10 tex:110556 mv:7068 misc:1480 imb:106 pmb:1024 smb:220 d:- ref:0 ; in:4908 out:4908 type:P dur:82000000 cpbdur:82000000 q:24.49 tex:113400 mv:7614 misc:1450 imb:94 pmb:1030 smb:226 d:- ref:0 ; in:4909 out:4909 type:P dur:82000000 cpbdur:82000000 q:24.07 tex:90124 mv:6227 misc:1489 imb:102 pmb:1015 smb:233 d:- ref:0 ; in:4910 out:4910 type:P dur:82000000 cpbdur:82000000 q:23.93 tex:107459 mv:6649 misc:1468 imb:82 pmb:1075 smb:193 d:- ref:0 ; in:4911 out:4911 type:P dur:82000000 cpbdur:82000000 q:24.10 tex:113318 mv:7323 misc:1463 imb:94 pmb:1059 smb:197 d:- ref:0 ; in:4912 out:4912 type:P dur:82000000 cpbdur:82000000 q:23.58 tex:94545 mv:7014 misc:1497 imb:114 pmb:1034 smb:202 d:- ref:0 ; in:4913 out:4913 type:P dur:82000000 cpbdur:82000000 q:24.03 tex:105467 mv:6573 misc:1472 imb:70 pmb:1043 smb:237 d:- ref:0 ; in:4914 out:4914 type:P dur:82000000 cpbdur:82000000 q:24.42 tex:118311 mv:7343 misc:1482 imb:83 pmb:1087 smb:180 d:- ref:0 ; in:4915 out:4915 type:P dur:82000000 cpbdur:82000000 q:24.46 tex:124041 mv:7442 misc:1469 imb:88 pmb:1106 smb:156 d:- ref:0 ; in:4916 out:4916 type:P dur:82000000 cpbdur:82000000 q:24.39 tex:98915 mv:6551 misc:1478 imb:82 pmb:1055 smb:213 d:- ref:0 ; in:4917 out:4917 type:P dur:82000000 cpbdur:82000000 q:24.77 tex:124113 mv:9008 misc:1463 imb:91 pmb:1084 smb:175 d:- ref:0 ; in:4918 out:4918 type:P dur:82000000 cpbdur:82000000 q:24.22 tex:103374 mv:6979 misc:1463 imb:113 pmb:1107 smb:130 d:- ref:0 ; in:4919 out:4919 type:P dur:82000000 cpbdur:82000000 q:23.34 tex:117686 mv:5707 misc:1455 imb:71 pmb:1135 smb:144 d:- ref:0 ; in:4920 out:4920 type:P dur:82000000 cpbdur:82000000 q:24.15 tex:111565 mv:7189 misc:1470 imb:72 pmb:1091 smb:187 d:- ref:0 ; in:4921 out:4921 type:P dur:82000000 cpbdur:82000000 q:24.32 tex:103944 mv:6984 misc:1472 imb:64 pmb:1076 smb:210 d:- ref:0 ; in:4922 out:4922 type:P dur:82000000 cpbdur:82000000 q:23.86 tex:92649 mv:5781 misc:1482 imb:56 pmb:1093 smb:201 d:- ref:0 ; in:4923 out:4923 type:P dur:82000000 cpbdur:82000000 q:24.32 tex:106663 mv:6541 misc:1492 imb:77 pmb:1063 smb:210 d:- ref:0 ; in:4924 out:4924 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:53713 mv:4798 misc:1537 imb:70 pmb:958 smb:322 d:- ref:0 ; in:4925 out:4925 type:P dur:82000000 cpbdur:82000000 q:23.58 tex:98440 mv:5792 misc:1488 imb:70 pmb:1014 smb:266 d:- ref:0 ; in:4926 out:4926 type:P dur:82000000 cpbdur:82000000 q:23.34 tex:108813 mv:6440 misc:1483 imb:83 pmb:1110 smb:157 d:- ref:0 ; in:4927 out:4927 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:106169 mv:6108 misc:1483 imb:89 pmb:1116 smb:145 d:- ref:0 ; in:4928 out:4928 type:P dur:82000000 cpbdur:82000000 q:23.01 tex:93984 mv:5400 misc:1472 imb:63 pmb:1114 smb:173 d:- ref:0 ; in:4929 out:4929 type:P dur:82000000 cpbdur:82000000 q:24.01 tex:117087 mv:7542 misc:1467 imb:53 pmb:1098 smb:199 d:- ref:0 ; in:4930 out:4930 type:P dur:82000000 cpbdur:82000000 q:24.09 tex:105045 mv:6569 misc:1474 imb:84 pmb:1051 smb:215 d:- ref:0 ; in:4931 out:4931 type:P dur:82000000 cpbdur:82000000 q:24.36 tex:111286 mv:6917 misc:1485 imb:68 pmb:1087 smb:195 d:- ref:0 ; in:4932 out:4932 type:P dur:82000000 cpbdur:82000000 q:24.14 tex:87905 mv:6215 misc:1504 imb:74 pmb:1061 smb:215 d:- ref:0 ; in:4933 out:4933 type:P dur:82000000 cpbdur:82000000 q:24.32 tex:123700 mv:7279 misc:1485 imb:71 pmb:1093 smb:186 d:- ref:0 ; in:4934 out:4934 type:P dur:82000000 cpbdur:82000000 q:24.66 tex:116577 mv:7743 misc:1488 imb:61 pmb:1083 smb:206 d:- ref:0 ; in:4935 out:4935 type:P dur:82000000 cpbdur:82000000 q:24.38 tex:108225 mv:7101 misc:1482 imb:83 pmb:1143 smb:124 d:- ref:0 ; in:4936 out:4936 type:P dur:82000000 cpbdur:82000000 q:24.18 tex:113960 mv:7030 misc:1466 imb:60 pmb:1128 smb:162 d:- ref:0 ; in:4937 out:4937 type:P dur:82000000 cpbdur:82000000 q:24.30 tex:126456 mv:7605 misc:1459 imb:56 pmb:1137 smb:157 d:- ref:0 ; in:4938 out:4938 type:P dur:82000000 cpbdur:82000000 q:24.12 tex:104805 mv:6413 misc:1470 imb:77 pmb:1145 smb:128 d:- ref:0 ; in:4939 out:4939 type:P dur:82000000 cpbdur:82000000 q:23.89 tex:93762 mv:5731 misc:1475 imb:87 pmb:1119 smb:144 d:- ref:0 ; in:4940 out:4940 type:P dur:82000000 cpbdur:82000000 q:23.95 tex:121035 mv:6273 misc:1468 imb:45 pmb:1155 smb:150 d:- ref:0 ; in:4941 out:4941 type:P dur:82000000 cpbdur:82000000 q:24.39 tex:120539 mv:6928 misc:1469 imb:63 pmb:1144 smb:143 d:- ref:0 ; in:4942 out:4942 type:P dur:82000000 cpbdur:82000000 q:24.02 tex:103681 mv:6269 misc:1482 imb:63 pmb:1129 smb:158 d:- ref:0 ; in:4943 out:4943 type:P dur:82000000 cpbdur:82000000 q:24.55 tex:120113 mv:7796 misc:1459 imb:39 pmb:1124 smb:187 d:- ref:0 ; in:4944 out:4944 type:P dur:82000000 cpbdur:82000000 q:24.31 tex:110231 mv:6948 misc:1461 imb:64 pmb:1146 smb:140 d:- ref:0 ; in:4945 out:4945 type:P dur:82000000 cpbdur:82000000 q:24.03 tex:112927 mv:6069 misc:1476 imb:59 pmb:1119 smb:172 d:- ref:0 ; in:4946 out:4946 type:P dur:82000000 cpbdur:82000000 q:24.38 tex:123227 mv:7454 misc:1471 imb:68 pmb:1134 smb:148 d:- ref:0 ; in:4947 out:4947 type:P dur:82000000 cpbdur:82000000 q:24.54 tex:96486 mv:6682 misc:1472 imb:52 pmb:1102 smb:196 d:- ref:0 ; in:4948 out:4948 type:P dur:82000000 cpbdur:82000000 q:24.79 tex:124882 mv:8067 misc:1459 imb:52 pmb:1109 smb:189 d:- ref:0 ; in:4949 out:4949 type:P dur:82000000 cpbdur:82000000 q:24.51 tex:100875 mv:6964 misc:1465 imb:51 pmb:1106 smb:193 d:- ref:0 ; in:4950 out:4950 type:P dur:82000000 cpbdur:82000000 q:23.81 tex:76532 mv:5659 misc:1481 imb:73 pmb:1101 smb:176 d:- ref:0 ; in:4951 out:4951 type:P dur:82000000 cpbdur:82000000 q:24.22 tex:134971 mv:7022 misc:1463 imb:52 pmb:1140 smb:158 d:- ref:0 ; in:4952 out:4952 type:P dur:82000000 cpbdur:82000000 q:23.08 tex:95072 mv:5576 misc:1464 imb:56 pmb:1164 smb:130 d:- ref:0 ; in:4953 out:4953 type:P dur:82000000 cpbdur:82000000 q:24.08 tex:121143 mv:7158 misc:1467 imb:69 pmb:1126 smb:155 d:- ref:0 ; in:4954 out:4954 type:P dur:82000000 cpbdur:82000000 q:23.99 tex:89829 mv:5920 misc:1467 imb:64 pmb:1098 smb:188 d:- ref:0 ; in:4955 out:4955 type:P dur:82000000 cpbdur:82000000 q:23.48 tex:105663 mv:6104 misc:1457 imb:68 pmb:1146 smb:136 d:- ref:0 ; in:4956 out:4956 type:P dur:82000000 cpbdur:82000000 q:24.23 tex:115987 mv:7346 misc:1467 imb:64 pmb:1102 smb:184 d:- ref:0 ; in:4957 out:4957 type:P dur:82000000 cpbdur:82000000 q:22.88 tex:70901 mv:5835 misc:1488 imb:93 pmb:1083 smb:174 d:- ref:0 ; in:4958 out:4958 type:P dur:82000000 cpbdur:82000000 q:21.88 tex:84218 mv:6120 misc:1454 imb:69 pmb:1182 smb:99 d:- ref:0 ; in:4959 out:4959 type:P dur:82000000 cpbdur:82000000 q:23.38 tex:116054 mv:6393 misc:1457 imb:59 pmb:1115 smb:176 d:- ref:0 ; in:4960 out:4960 type:P dur:82000000 cpbdur:82000000 q:22.54 tex:64287 mv:5567 misc:1490 imb:67 pmb:1075 smb:208 d:- ref:0 ; in:4961 out:4961 type:P dur:82000000 cpbdur:82000000 q:23.96 tex:127685 mv:7835 misc:1456 imb:60 pmb:1099 smb:191 d:- ref:0 ; in:4962 out:4962 type:P dur:82000000 cpbdur:82000000 q:24.12 tex:110907 mv:7801 misc:1460 imb:83 pmb:1081 smb:186 d:- ref:0 ; in:4963 out:4963 type:P dur:82000000 cpbdur:82000000 q:23.29 tex:105319 mv:5788 misc:1469 imb:83 pmb:1088 smb:179 d:- ref:0 ; in:4964 out:4964 type:P dur:82000000 cpbdur:82000000 q:23.75 tex:93111 mv:7298 misc:1463 imb:77 pmb:1038 smb:235 d:- ref:0 ; in:4965 out:4965 type:P dur:82000000 cpbdur:82000000 q:23.22 tex:90184 mv:6152 misc:1472 imb:72 pmb:1080 smb:198 d:- ref:0 ; in:4966 out:4966 type:P dur:82000000 cpbdur:82000000 q:23.47 tex:114425 mv:6797 misc:1466 imb:113 pmb:1089 smb:148 d:- ref:0 ; in:4967 out:4967 type:P dur:82000000 cpbdur:82000000 q:23.52 tex:88476 mv:6667 misc:1457 imb:57 pmb:1029 smb:264 d:- ref:0 ; in:4968 out:4968 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:97192 mv:6705 misc:1463 imb:87 pmb:1081 smb:182 d:- ref:0 ; in:4969 out:4969 type:P dur:82000000 cpbdur:82000000 q:24.12 tex:109355 mv:7676 misc:1425 imb:65 pmb:1036 smb:249 d:- ref:0 ; in:4970 out:4970 type:P dur:82000000 cpbdur:82000000 q:24.48 tex:116816 mv:7279 misc:1425 imb:75 pmb:1013 smb:262 d:- ref:0 ; in:4971 out:4971 type:P dur:82000000 cpbdur:82000000 q:23.39 tex:71719 mv:6439 misc:1466 imb:119 pmb:1041 smb:190 d:- ref:0 ; in:4972 out:4972 type:P dur:82000000 cpbdur:82000000 q:23.10 tex:72113 mv:5559 misc:1472 imb:83 pmb:979 smb:288 d:- ref:0 ; in:4973 out:4973 type:P dur:82000000 cpbdur:82000000 q:23.88 tex:104010 mv:7872 misc:1358 imb:63 pmb:994 smb:293 d:- ref:0 ; in:4974 out:4974 type:P dur:82000000 cpbdur:82000000 q:24.01 tex:94769 mv:7175 misc:1456 imb:80 pmb:971 smb:299 d:- ref:0 ; in:4975 out:4975 type:P dur:82000000 cpbdur:82000000 q:22.63 tex:63051 mv:5692 misc:1457 imb:104 pmb:986 smb:260 d:- ref:0 ; in:4976 out:4976 type:P dur:82000000 cpbdur:82000000 q:22.22 tex:92475 mv:6911 misc:1462 imb:120 pmb:1063 smb:167 d:- ref:0 ; in:4977 out:4977 type:P dur:82000000 cpbdur:82000000 q:23.44 tex:119224 mv:7065 misc:1423 imb:82 pmb:969 smb:299 d:- ref:0 ; in:4978 out:4978 type:P dur:82000000 cpbdur:82000000 q:23.90 tex:90356 mv:6227 misc:1393 imb:68 pmb:915 smb:367 d:- ref:0 ; in:4979 out:4979 type:P dur:82000000 cpbdur:82000000 q:23.56 tex:86658 mv:6168 misc:1414 imb:90 pmb:928 smb:332 d:- ref:0 ; in:4980 out:4980 type:P dur:82000000 cpbdur:82000000 q:23.99 tex:108942 mv:7934 misc:1388 imb:97 pmb:952 smb:301 d:- ref:0 ; in:4981 out:4981 type:P dur:82000000 cpbdur:82000000 q:24.07 tex:96132 mv:7019 misc:1417 imb:96 pmb:923 smb:331 d:- ref:0 ; in:4982 out:4982 type:P dur:82000000 cpbdur:82000000 q:23.68 tex:67278 mv:5831 misc:1419 imb:86 pmb:891 smb:373 d:- ref:0 ; in:4983 out:4983 type:P dur:82000000 cpbdur:82000000 q:23.12 tex:88750 mv:6145 misc:1441 imb:124 pmb:965 smb:261 d:- ref:0 ; in:4984 out:4984 type:P dur:82000000 cpbdur:82000000 q:23.60 tex:94308 mv:7036 misc:1384 imb:78 pmb:886 smb:386 d:- ref:0 ; in:4985 out:4985 type:P dur:82000000 cpbdur:82000000 q:22.86 tex:83533 mv:6111 misc:1436 imb:107 pmb:941 smb:302 d:- ref:0 ; in:4986 out:4986 type:P dur:82000000 cpbdur:82000000 q:23.49 tex:114092 mv:7599 misc:1389 imb:99 pmb:937 smb:314 d:- ref:0 ; in:4987 out:4987 type:P dur:82000000 cpbdur:82000000 q:23.67 tex:80318 mv:6233 misc:1385 imb:73 pmb:881 smb:396 d:- ref:0 ; in:4988 out:4988 type:P dur:82000000 cpbdur:82000000 q:23.40 tex:81218 mv:6308 misc:1434 imb:132 pmb:906 smb:312 d:- ref:0 ; in:4989 out:4989 type:P dur:82000000 cpbdur:82000000 q:22.31 tex:61267 mv:6457 misc:1436 imb:128 pmb:933 smb:289 d:- ref:0 ; in:4990 out:4990 type:P dur:82000000 cpbdur:82000000 q:21.75 tex:56886 mv:6121 misc:1473 imb:129 pmb:899 smb:322 d:- ref:0 ; in:4991 out:4991 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:76078 mv:5141 misc:1341 imb:59 pmb:807 smb:484 d:- ref:0 ; in:4992 out:4992 type:P dur:82000000 cpbdur:82000000 q:23.07 tex:77534 mv:6040 misc:1378 imb:118 pmb:818 smb:414 d:- ref:0 ; in:4993 out:4993 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:63768 mv:6241 misc:1479 imb:141 pmb:901 smb:308 d:- ref:0 ; in:4994 out:4994 type:P dur:82000000 cpbdur:82000000 q:23.34 tex:98742 mv:6954 misc:1352 imb:88 pmb:800 smb:462 d:- ref:0 ; in:4995 out:4995 type:P dur:82000000 cpbdur:82000000 q:23.07 tex:63414 mv:6192 misc:1418 imb:123 pmb:808 smb:419 d:- ref:0 ; in:4996 out:4996 type:P dur:82000000 cpbdur:82000000 q:22.81 tex:44960 mv:5547 misc:1405 imb:131 pmb:755 smb:464 d:- ref:0 ; in:4997 out:4997 type:P dur:82000000 cpbdur:82000000 q:22.95 tex:72165 mv:6424 misc:1411 imb:159 pmb:772 smb:419 d:- ref:0 ; in:4998 out:4998 type:P dur:82000000 cpbdur:82000000 q:22.08 tex:68773 mv:6547 misc:1448 imb:166 pmb:837 smb:347 d:- ref:0 ; in:4999 out:4999 type:P dur:82000000 cpbdur:82000000 q:22.66 tex:67607 mv:5847 misc:1354 imb:107 pmb:725 smb:518 d:- ref:0 ; in:5000 out:5000 type:I dur:82000000 cpbdur:82000000 q:20.26 tex:295256 mv:13274 misc:374 imb:1350 pmb:0 smb:0 d:- ref:; in:5001 out:5001 type:P dur:82000000 cpbdur:82000000 q:24.53 tex:7941 mv:2871 misc:996 imb:18 pmb:319 smb:1013 d:- ref:0 ; in:5002 out:5002 type:P dur:82000000 cpbdur:82000000 q:23.84 tex:42464 mv:5217 misc:1247 imb:99 pmb:603 smb:648 d:- ref:0 ; in:5003 out:5003 type:P dur:82000000 cpbdur:82000000 q:23.38 tex:66527 mv:6455 misc:1418 imb:158 pmb:693 smb:499 d:- ref:0 ; in:5004 out:5004 type:P dur:82000000 cpbdur:82000000 q:23.35 tex:71722 mv:6771 misc:1371 imb:160 pmb:663 smb:527 d:- ref:0 ; in:5005 out:5005 type:P dur:82000000 cpbdur:82000000 q:22.91 tex:55178 mv:5753 misc:1349 imb:118 pmb:629 smb:603 d:- ref:0 ; in:5006 out:5006 type:P dur:82000000 cpbdur:82000000 q:22.43 tex:52512 mv:7511 misc:1449 imb:250 pmb:733 smb:367 d:- ref:0 ; in:5007 out:5007 type:P dur:82000000 cpbdur:82000000 q:21.86 tex:40188 mv:5568 misc:1372 imb:130 pmb:672 smb:548 d:- ref:0 ; in:5008 out:5008 type:P dur:82000000 cpbdur:82000000 q:22.10 tex:59164 mv:7209 misc:1419 imb:191 pmb:655 smb:504 d:- ref:0 ; in:5009 out:5009 type:P dur:82000000 cpbdur:82000000 q:21.44 tex:41910 mv:6462 misc:1460 imb:212 pmb:704 smb:434 d:- ref:0 ; in:5010 out:5010 type:P dur:82000000 cpbdur:82000000 q:21.73 tex:51071 mv:5571 misc:1262 imb:109 pmb:575 smb:666 d:- ref:0 ; in:5011 out:5011 type:P dur:82000000 cpbdur:82000000 q:21.43 tex:44460 mv:6721 misc:1435 imb:218 pmb:663 smb:469 d:- ref:0 ; in:5012 out:5012 type:P dur:82000000 cpbdur:82000000 q:22.16 tex:59651 mv:6804 misc:1401 imb:190 pmb:616 smb:544 d:- ref:0 ; in:5013 out:5013 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:42728 mv:5865 misc:1375 imb:149 pmb:591 smb:610 d:- ref:0 ; in:5014 out:5014 type:P dur:82000000 cpbdur:82000000 q:20.87 tex:28339 mv:4228 misc:1537 imb:187 pmb:628 smb:535 d:- ref:0 ; in:5015 out:5015 type:P dur:82000000 cpbdur:82000000 q:19.25 tex:61388 mv:4104 misc:1524 imb:83 pmb:852 smb:415 d:- ref:0 ; in:5016 out:5016 type:P dur:82000000 cpbdur:82000000 q:19.16 tex:29955 mv:3438 misc:1559 imb:59 pmb:730 smb:561 d:- ref:0 ; in:5017 out:5017 type:P dur:82000000 cpbdur:82000000 q:17.85 tex:28441 mv:2284 misc:1451 imb:19 pmb:610 smb:721 d:- ref:0 ; in:5018 out:5018 type:P dur:82000000 cpbdur:82000000 q:18.41 tex:31180 mv:3673 misc:1587 imb:80 pmb:745 smb:525 d:- ref:0 ; in:5019 out:5019 type:P dur:82000000 cpbdur:82000000 q:18.22 tex:39803 mv:1713 misc:1180 imb:12 pmb:457 smb:881 d:- ref:0 ; in:5020 out:5020 type:P dur:82000000 cpbdur:82000000 q:18.33 tex:27588 mv:3646 misc:1542 imb:104 pmb:684 smb:562 d:- ref:0 ; in:5021 out:5021 type:P dur:82000000 cpbdur:82000000 q:17.55 tex:14720 mv:1996 misc:1444 imb:46 pmb:440 smb:864 d:- ref:0 ; in:5022 out:5022 type:P dur:82000000 cpbdur:82000000 q:17.64 tex:38045 mv:2037 misc:1254 imb:26 pmb:475 smb:849 d:- ref:0 ; in:5023 out:5023 type:P dur:82000000 cpbdur:82000000 q:19.01 tex:37782 mv:3977 misc:1585 imb:79 pmb:781 smb:490 d:- ref:0 ; in:5024 out:5024 type:P dur:82000000 cpbdur:82000000 q:17.25 tex:52034 mv:3548 misc:1586 imb:18 pmb:1016 smb:316 d:- ref:0 ; in:5025 out:5025 type:P dur:82000000 cpbdur:82000000 q:18.25 tex:30026 mv:3265 misc:1613 imb:36 pmb:827 smb:487 d:- ref:0 ; in:5026 out:5026 type:P dur:82000000 cpbdur:82000000 q:16.63 tex:30740 mv:2627 misc:1593 imb:4 pmb:825 smb:521 d:- ref:0 ; in:5027 out:5027 type:P dur:82000000 cpbdur:82000000 q:20.63 tex:191893 mv:15285 misc:1414 imb:1271 pmb:79 smb:0 d:- ref:0 ; in:5028 out:5028 type:P dur:82000000 cpbdur:82000000 q:23.27 tex:35211 mv:7237 misc:1408 imb:242 pmb:559 smb:549 d:- ref:0 ; in:5029 out:5029 type:P dur:82000000 cpbdur:82000000 q:22.48 tex:43694 mv:7690 misc:1544 imb:264 pmb:690 smb:396 d:- ref:0 ; in:5030 out:5030 type:P dur:82000000 cpbdur:82000000 q:22.02 tex:41074 mv:8402 misc:1524 imb:310 pmb:734 smb:306 d:- ref:0 ; in:5031 out:5031 type:P dur:82000000 cpbdur:82000000 q:21.12 tex:31919 mv:5642 misc:1551 imb:180 pmb:722 smb:448 d:- ref:0 ; in:5032 out:5032 type:P dur:82000000 cpbdur:82000000 q:20.82 tex:37279 mv:5480 misc:1529 imb:160 pmb:702 smb:488 d:- ref:0 ; in:5033 out:5033 type:P dur:82000000 cpbdur:82000000 q:20.41 tex:48863 mv:5338 misc:1495 imb:141 pmb:726 smb:483 d:- ref:0 ; in:5034 out:5034 type:P dur:82000000 cpbdur:82000000 q:20.50 tex:36031 mv:4225 misc:1456 imb:80 pmb:643 smb:627 d:- ref:0 ; in:5035 out:5035 type:P dur:82000000 cpbdur:82000000 q:20.16 tex:32224 mv:4536 misc:1520 imb:94 pmb:726 smb:530 d:- ref:0 ; in:5036 out:5036 type:P dur:82000000 cpbdur:82000000 q:19.69 tex:29725 mv:3982 misc:1493 imb:83 pmb:680 smb:587 d:- ref:0 ; in:5037 out:5037 type:P dur:82000000 cpbdur:82000000 q:19.56 tex:25647 mv:3608 misc:1465 imb:48 pmb:602 smb:700 d:- ref:0 ; in:5038 out:5038 type:P dur:82000000 cpbdur:82000000 q:20.40 tex:43854 mv:5070 misc:1516 imb:94 pmb:776 smb:480 d:- ref:0 ; in:5039 out:5039 type:P dur:82000000 cpbdur:82000000 q:20.67 tex:42028 mv:5189 misc:1431 imb:76 pmb:661 smb:613 d:- ref:0 ; in:5040 out:5040 type:P dur:82000000 cpbdur:82000000 q:20.20 tex:32359 mv:4274 misc:1543 imb:93 pmb:704 smb:553 d:- ref:0 ; in:5041 out:5041 type:P dur:82000000 cpbdur:82000000 q:19.98 tex:32538 mv:3815 misc:1471 imb:65 pmb:693 smb:592 d:- ref:0 ; in:5042 out:5042 type:P dur:82000000 cpbdur:82000000 q:19.85 tex:26386 mv:3626 misc:1452 imb:48 pmb:656 smb:646 d:- ref:0 ; in:5043 out:5043 type:P dur:82000000 cpbdur:82000000 q:20.30 tex:38805 mv:4638 misc:1517 imb:106 pmb:756 smb:488 d:- ref:0 ; in:5044 out:5044 type:P dur:82000000 cpbdur:82000000 q:20.74 tex:48707 mv:4589 misc:1456 imb:104 pmb:675 smb:571 d:- ref:0 ; in:5045 out:5045 type:P dur:82000000 cpbdur:82000000 q:21.00 tex:53606 mv:5377 misc:1465 imb:94 pmb:725 smb:531 d:- ref:0 ; in:5046 out:5046 type:P dur:82000000 cpbdur:82000000 q:20.18 tex:38085 mv:4226 misc:1529 imb:77 pmb:772 smb:501 d:- ref:0 ; in:5047 out:5047 type:P dur:82000000 cpbdur:82000000 q:20.43 tex:47820 mv:4326 misc:1462 imb:59 pmb:752 smb:539 d:- ref:0 ; in:5048 out:5048 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:41526 mv:4496 misc:1506 imb:62 pmb:764 smb:524 d:- ref:0 ; in:5049 out:5049 type:P dur:82000000 cpbdur:82000000 q:20.23 tex:43915 mv:3991 misc:1510 imb:55 pmb:771 smb:524 d:- ref:0 ; in:5050 out:5050 type:P dur:82000000 cpbdur:82000000 q:20.20 tex:31893 mv:4206 misc:1525 imb:85 pmb:756 smb:509 d:- ref:0 ; in:5051 out:5051 type:P dur:82000000 cpbdur:82000000 q:19.89 tex:34305 mv:3692 misc:1515 imb:60 pmb:730 smb:560 d:- ref:0 ; in:5052 out:5052 type:P dur:82000000 cpbdur:82000000 q:20.43 tex:45563 mv:5191 misc:1558 imb:105 pmb:831 smb:414 d:- ref:0 ; in:5053 out:5053 type:P dur:82000000 cpbdur:82000000 q:20.50 tex:41909 mv:3996 misc:1431 imb:47 pmb:702 smb:601 d:- ref:0 ; in:5054 out:5054 type:P dur:82000000 cpbdur:82000000 q:20.44 tex:44846 mv:4544 misc:1514 imb:93 pmb:794 smb:463 d:- ref:0 ; in:5055 out:5055 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:45543 mv:4482 misc:1503 imb:65 pmb:782 smb:503 d:- ref:0 ; in:5056 out:5056 type:P dur:82000000 cpbdur:82000000 q:19.96 tex:33559 mv:3826 misc:1495 imb:56 pmb:744 smb:550 d:- ref:0 ; in:5057 out:5057 type:P dur:82000000 cpbdur:82000000 q:20.62 tex:48065 mv:4188 misc:1443 imb:47 pmb:714 smb:589 d:- ref:0 ; in:5058 out:5058 type:P dur:82000000 cpbdur:82000000 q:20.62 tex:35682 mv:3870 misc:1456 imb:47 pmb:700 smb:603 d:- ref:0 ; in:5059 out:5059 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:51750 mv:4256 misc:1498 imb:68 pmb:834 smb:448 d:- ref:0 ; in:5060 out:5060 type:P dur:82000000 cpbdur:82000000 q:20.41 tex:48857 mv:4326 misc:1497 imb:56 pmb:826 smb:468 d:- ref:0 ; in:5061 out:5061 type:P dur:82000000 cpbdur:82000000 q:20.33 tex:45159 mv:4533 misc:1436 imb:38 pmb:817 smb:495 d:- ref:0 ; in:5062 out:5062 type:P dur:82000000 cpbdur:82000000 q:20.36 tex:44088 mv:3873 misc:1495 imb:51 pmb:793 smb:506 d:- ref:0 ; in:5063 out:5063 type:P dur:82000000 cpbdur:82000000 q:21.10 tex:63136 mv:4999 misc:1465 imb:56 pmb:787 smb:507 d:- ref:0 ; in:5064 out:5064 type:P dur:82000000 cpbdur:82000000 q:20.15 tex:42742 mv:4076 misc:1510 imb:63 pmb:854 smb:433 d:- ref:0 ; in:5065 out:5065 type:P dur:82000000 cpbdur:82000000 q:20.11 tex:34452 mv:3759 misc:1501 imb:46 pmb:751 smb:553 d:- ref:0 ; in:5066 out:5066 type:P dur:82000000 cpbdur:82000000 q:19.89 tex:42113 mv:4172 misc:1507 imb:56 pmb:842 smb:452 d:- ref:0 ; in:5067 out:5067 type:P dur:82000000 cpbdur:82000000 q:20.22 tex:44556 mv:4219 misc:1497 imb:57 pmb:801 smb:492 d:- ref:0 ; in:5068 out:5068 type:P dur:82000000 cpbdur:82000000 q:19.87 tex:29955 mv:3765 misc:1544 imb:47 pmb:769 smb:534 d:- ref:0 ; in:5069 out:5069 type:P dur:82000000 cpbdur:82000000 q:19.49 tex:66970 mv:5670 misc:1520 imb:86 pmb:1086 smb:178 d:- ref:0 ; in:5070 out:5070 type:P dur:82000000 cpbdur:82000000 q:20.67 tex:48897 mv:4506 misc:1437 imb:31 pmb:762 smb:557 d:- ref:0 ; in:5071 out:5071 type:P dur:82000000 cpbdur:82000000 q:20.42 tex:42442 mv:3884 misc:1498 imb:45 pmb:776 smb:529 d:- ref:0 ; in:5072 out:5072 type:P dur:82000000 cpbdur:82000000 q:19.99 tex:41851 mv:4010 misc:1499 imb:49 pmb:836 smb:465 d:- ref:0 ; in:5073 out:5073 type:P dur:82000000 cpbdur:82000000 q:20.11 tex:41151 mv:3901 misc:1500 imb:48 pmb:803 smb:499 d:- ref:0 ; in:5074 out:5074 type:P dur:82000000 cpbdur:82000000 q:20.16 tex:47135 mv:4142 misc:1523 imb:37 pmb:870 smb:443 d:- ref:0 ; in:5075 out:5075 type:P dur:82000000 cpbdur:82000000 q:20.06 tex:43689 mv:4157 misc:1506 imb:43 pmb:879 smb:428 d:- ref:0 ; in:5076 out:5076 type:P dur:82000000 cpbdur:82000000 q:20.58 tex:52251 mv:3991 misc:1454 imb:45 pmb:811 smb:494 d:- ref:0 ; in:5077 out:5077 type:P dur:82000000 cpbdur:82000000 q:21.37 tex:85233 mv:4967 misc:1504 imb:70 pmb:903 smb:377 d:- ref:0 ; in:5078 out:5078 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:56045 mv:4008 misc:1419 imb:25 pmb:756 smb:569 d:- ref:0 ; in:5079 out:5079 type:P dur:82000000 cpbdur:82000000 q:21.50 tex:75192 mv:4806 misc:1506 imb:58 pmb:926 smb:366 d:- ref:0 ; in:5080 out:5080 type:P dur:82000000 cpbdur:82000000 q:20.98 tex:40273 mv:3570 misc:1493 imb:43 pmb:774 smb:533 d:- ref:0 ; in:5081 out:5081 type:P dur:82000000 cpbdur:82000000 q:20.45 tex:56719 mv:4449 misc:1528 imb:69 pmb:941 smb:340 d:- ref:0 ; in:5082 out:5082 type:P dur:82000000 cpbdur:82000000 q:20.17 tex:42792 mv:3892 misc:1540 imb:55 pmb:862 smb:433 d:- ref:0 ; in:5083 out:5083 type:P dur:82000000 cpbdur:82000000 q:19.57 tex:41194 mv:3935 misc:1519 imb:36 pmb:913 smb:401 d:- ref:0 ; in:5084 out:5084 type:P dur:82000000 cpbdur:82000000 q:20.51 tex:59630 mv:3996 misc:1470 imb:32 pmb:832 smb:486 d:- ref:0 ; in:5085 out:5085 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:65345 mv:4266 misc:1501 imb:57 pmb:932 smb:361 d:- ref:0 ; in:5086 out:5086 type:P dur:82000000 cpbdur:82000000 q:20.28 tex:64696 mv:4056 misc:1496 imb:45 pmb:930 smb:375 d:- ref:0 ; in:5087 out:5087 type:P dur:82000000 cpbdur:82000000 q:20.33 tex:55450 mv:4152 misc:1526 imb:54 pmb:888 smb:408 d:- ref:0 ; in:5088 out:5088 type:P dur:82000000 cpbdur:82000000 q:20.08 tex:59224 mv:4196 misc:1516 imb:43 pmb:954 smb:353 d:- ref:0 ; in:5089 out:5089 type:P dur:82000000 cpbdur:82000000 q:21.86 tex:91159 mv:5508 misc:1445 imb:24 pmb:858 smb:468 d:- ref:0 ; in:5090 out:5090 type:P dur:82000000 cpbdur:82000000 q:21.16 tex:58049 mv:4794 misc:1549 imb:75 pmb:966 smb:309 d:- ref:0 ; in:5091 out:5091 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:74882 mv:4579 misc:1459 imb:23 pmb:903 smb:424 d:- ref:0 ; in:5092 out:5092 type:P dur:82000000 cpbdur:82000000 q:21.01 tex:54850 mv:4411 misc:1531 imb:57 pmb:905 smb:388 d:- ref:0 ; in:5093 out:5093 type:P dur:82000000 cpbdur:82000000 q:21.05 tex:54894 mv:4695 misc:1523 imb:75 pmb:939 smb:336 d:- ref:0 ; in:5094 out:5094 type:P dur:82000000 cpbdur:82000000 q:21.29 tex:62475 mv:4297 misc:1516 imb:50 pmb:917 smb:383 d:- ref:0 ; in:5095 out:5095 type:P dur:82000000 cpbdur:82000000 q:20.81 tex:57590 mv:4302 misc:1516 imb:46 pmb:962 smb:342 d:- ref:0 ; in:5096 out:5096 type:P dur:82000000 cpbdur:82000000 q:20.90 tex:56622 mv:4196 misc:1510 imb:38 pmb:892 smb:420 d:- ref:0 ; in:5097 out:5097 type:P dur:82000000 cpbdur:82000000 q:21.33 tex:84071 mv:4794 misc:1487 imb:53 pmb:954 smb:343 d:- ref:0 ; in:5098 out:5098 type:P dur:82000000 cpbdur:82000000 q:21.58 tex:50967 mv:3926 misc:1459 imb:23 pmb:814 smb:513 d:- ref:0 ; in:5099 out:5099 type:P dur:82000000 cpbdur:82000000 q:21.19 tex:50714 mv:4160 misc:1510 imb:47 pmb:900 smb:403 d:- ref:0 ; in:5100 out:5100 type:P dur:82000000 cpbdur:82000000 q:21.20 tex:61345 mv:4720 misc:1519 imb:47 pmb:944 smb:359 d:- ref:0 ; in:5101 out:5101 type:P dur:82000000 cpbdur:82000000 q:20.88 tex:63358 mv:4288 misc:1490 imb:39 pmb:956 smb:355 d:- ref:0 ; in:5102 out:5102 type:P dur:82000000 cpbdur:82000000 q:20.63 tex:38457 mv:3739 misc:1548 imb:35 pmb:841 smb:474 d:- ref:0 ; in:5103 out:5103 type:P dur:82000000 cpbdur:82000000 q:20.34 tex:71121 mv:4499 misc:1524 imb:47 pmb:1013 smb:290 d:- ref:0 ; in:5104 out:5104 type:P dur:82000000 cpbdur:82000000 q:20.63 tex:49610 mv:3944 misc:1510 imb:43 pmb:870 smb:437 d:- ref:0 ; in:5105 out:5105 type:P dur:82000000 cpbdur:82000000 q:20.42 tex:64105 mv:4665 misc:1502 imb:35 pmb:1027 smb:288 d:- ref:0 ; in:5106 out:5106 type:P dur:82000000 cpbdur:82000000 q:21.92 tex:86644 mv:5372 misc:1448 imb:29 pmb:916 smb:405 d:- ref:0 ; in:5107 out:5107 type:P dur:82000000 cpbdur:82000000 q:21.26 tex:69966 mv:4449 misc:1521 imb:43 pmb:989 smb:318 d:- ref:0 ; in:5108 out:5108 type:P dur:82000000 cpbdur:82000000 q:20.68 tex:57989 mv:4220 misc:1527 imb:39 pmb:1012 smb:299 d:- ref:0 ; in:5109 out:5109 type:P dur:82000000 cpbdur:82000000 q:20.96 tex:73677 mv:4280 misc:1507 imb:20 pmb:964 smb:366 d:- ref:0 ; in:5110 out:5110 type:P dur:82000000 cpbdur:82000000 q:21.09 tex:65812 mv:4797 misc:1511 imb:59 pmb:1029 smb:262 d:- ref:0 ; in:5111 out:5111 type:P dur:82000000 cpbdur:82000000 q:22.25 tex:97405 mv:5312 misc:1491 imb:17 pmb:992 smb:341 d:- ref:0 ; in:5112 out:5112 type:P dur:82000000 cpbdur:82000000 q:21.98 tex:75976 mv:4605 misc:1491 imb:30 pmb:941 smb:379 d:- ref:0 ; in:5113 out:5113 type:P dur:82000000 cpbdur:82000000 q:21.40 tex:60276 mv:4458 misc:1506 imb:48 pmb:1068 smb:234 d:- ref:0 ; in:5114 out:5114 type:P dur:82000000 cpbdur:82000000 q:20.93 tex:44453 mv:3993 misc:1554 imb:23 pmb:877 smb:450 d:- ref:0 ; in:5115 out:5115 type:P dur:82000000 cpbdur:82000000 q:21.43 tex:75602 mv:4685 misc:1521 imb:46 pmb:1017 smb:287 d:- ref:0 ; in:5116 out:5116 type:P dur:82000000 cpbdur:82000000 q:22.04 tex:66774 mv:4472 misc:1506 imb:26 pmb:952 smb:372 d:- ref:0 ; in:5117 out:5117 type:P dur:82000000 cpbdur:82000000 q:22.23 tex:93215 mv:4633 misc:1512 imb:37 pmb:979 smb:334 d:- ref:0 ; in:5118 out:5118 type:P dur:82000000 cpbdur:82000000 q:21.85 tex:62761 mv:4059 misc:1516 imb:23 pmb:977 smb:350 d:- ref:0 ; in:5119 out:5119 type:P dur:82000000 cpbdur:82000000 q:21.38 tex:65374 mv:4260 misc:1510 imb:33 pmb:1058 smb:259 d:- ref:0 ; in:5120 out:5120 type:P dur:82000000 cpbdur:82000000 q:21.21 tex:82960 mv:4785 misc:1495 imb:41 pmb:1109 smb:200 d:- ref:0 ; in:5121 out:5121 type:P dur:82000000 cpbdur:82000000 q:21.34 tex:85104 mv:4301 misc:1507 imb:28 pmb:1031 smb:291 d:- ref:0 ; in:5122 out:5122 type:P dur:82000000 cpbdur:82000000 q:20.71 tex:66648 mv:4128 misc:1520 imb:26 pmb:1072 smb:252 d:- ref:0 ; in:5123 out:5123 type:P dur:82000000 cpbdur:82000000 q:21.35 tex:93261 mv:4451 misc:1504 imb:31 pmb:1041 smb:278 d:- ref:0 ; in:5124 out:5124 type:P dur:82000000 cpbdur:82000000 q:21.25 tex:86082 mv:4254 misc:1496 imb:23 pmb:1094 smb:233 d:- ref:0 ; in:5125 out:5125 type:P dur:82000000 cpbdur:82000000 q:22.43 tex:112499 mv:4823 misc:1486 imb:32 pmb:1003 smb:315 d:- ref:0 ; in:5126 out:5126 type:P dur:82000000 cpbdur:82000000 q:21.27 tex:63896 mv:4454 misc:1506 imb:30 pmb:1104 smb:216 d:- ref:0 ; in:5127 out:5127 type:P dur:82000000 cpbdur:82000000 q:21.21 tex:55464 mv:3990 misc:1562 imb:36 pmb:976 smb:338 d:- ref:0 ; in:5128 out:5128 type:P dur:82000000 cpbdur:82000000 q:20.74 tex:45612 mv:3972 misc:1560 imb:42 pmb:944 smb:364 d:- ref:0 ; in:5129 out:5129 type:P dur:82000000 cpbdur:82000000 q:20.35 tex:75120 mv:4778 misc:1510 imb:37 pmb:1156 smb:157 d:- ref:0 ; in:5130 out:5130 type:P dur:82000000 cpbdur:82000000 q:20.75 tex:47361 mv:3699 misc:1556 imb:19 pmb:893 smb:438 d:- ref:0 ; in:5131 out:5131 type:P dur:82000000 cpbdur:82000000 q:20.36 tex:70857 mv:4444 misc:1539 imb:39 pmb:1110 smb:201 d:- ref:0 ; in:5132 out:5132 type:P dur:82000000 cpbdur:82000000 q:20.27 tex:56177 mv:4103 misc:1568 imb:34 pmb:997 smb:319 d:- ref:0 ; in:5133 out:5133 type:P dur:82000000 cpbdur:82000000 q:19.63 tex:52135 mv:3922 misc:1543 imb:26 pmb:1042 smb:282 d:- ref:0 ; in:5134 out:5134 type:P dur:82000000 cpbdur:82000000 q:20.93 tex:74809 mv:4080 misc:1495 imb:26 pmb:988 smb:336 d:- ref:0 ; in:5135 out:5135 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:63215 mv:4082 misc:1519 imb:26 pmb:938 smb:386 d:- ref:0 ; in:5136 out:5136 type:P dur:82000000 cpbdur:82000000 q:21.92 tex:63810 mv:4520 misc:1534 imb:28 pmb:1026 smb:296 d:- ref:0 ; in:5137 out:5137 type:P dur:82000000 cpbdur:82000000 q:22.07 tex:82552 mv:4607 misc:1537 imb:35 pmb:1041 smb:274 d:- ref:0 ; in:5138 out:5138 type:P dur:82000000 cpbdur:82000000 q:21.96 tex:61961 mv:4327 misc:1552 imb:47 pmb:951 smb:352 d:- ref:0 ; in:5139 out:5139 type:P dur:82000000 cpbdur:82000000 q:21.67 tex:66013 mv:4487 misc:1540 imb:35 pmb:1069 smb:246 d:- ref:0 ; in:5140 out:5140 type:P dur:82000000 cpbdur:82000000 q:21.02 tex:53546 mv:4018 misc:1564 imb:40 pmb:1030 smb:280 d:- ref:0 ; in:5141 out:5141 type:P dur:82000000 cpbdur:82000000 q:20.98 tex:70837 mv:4785 misc:1522 imb:38 pmb:1107 smb:205 d:- ref:0 ; in:5142 out:5142 type:P dur:82000000 cpbdur:82000000 q:20.84 tex:63736 mv:4343 misc:1513 imb:29 pmb:1103 smb:218 d:- ref:0 ; in:5143 out:5143 type:P dur:82000000 cpbdur:82000000 q:22.30 tex:112921 mv:5233 misc:1510 imb:45 pmb:1041 smb:264 d:- ref:0 ; in:5144 out:5144 type:P dur:82000000 cpbdur:82000000 q:21.80 tex:58259 mv:3921 misc:1540 imb:20 pmb:981 smb:349 d:- ref:0 ; in:5145 out:5145 type:P dur:82000000 cpbdur:82000000 q:22.57 tex:83185 mv:4651 misc:1508 imb:37 pmb:959 smb:354 d:- ref:0 ; in:5146 out:5146 type:P dur:82000000 cpbdur:82000000 q:22.18 tex:82451 mv:4847 misc:1510 imb:50 pmb:1123 smb:177 d:- ref:0 ; in:5147 out:5147 type:P dur:82000000 cpbdur:82000000 q:21.73 tex:56278 mv:3992 misc:1546 imb:33 pmb:994 smb:323 d:- ref:0 ; in:5148 out:5148 type:P dur:82000000 cpbdur:82000000 q:21.05 tex:67187 mv:4524 misc:1513 imb:64 pmb:1136 smb:150 d:- ref:0 ; in:5149 out:5149 type:P dur:82000000 cpbdur:82000000 q:21.70 tex:70117 mv:4120 misc:1539 imb:31 pmb:944 smb:375 d:- ref:0 ; in:5150 out:5150 type:P dur:82000000 cpbdur:82000000 q:21.87 tex:77993 mv:4768 misc:1551 imb:40 pmb:1034 smb:276 d:- ref:0 ; in:5151 out:5151 type:P dur:82000000 cpbdur:82000000 q:21.33 tex:79653 mv:4434 misc:1521 imb:47 pmb:1116 smb:187 d:- ref:0 ; in:5152 out:5152 type:P dur:82000000 cpbdur:82000000 q:21.09 tex:53698 mv:4120 misc:1550 imb:36 pmb:998 smb:316 d:- ref:0 ; in:5153 out:5153 type:P dur:82000000 cpbdur:82000000 q:20.53 tex:54859 mv:4294 misc:1543 imb:40 pmb:1084 smb:226 d:- ref:0 ; in:5154 out:5154 type:P dur:82000000 cpbdur:82000000 q:22.89 tex:110450 mv:6289 misc:1501 imb:38 pmb:989 smb:323 d:- ref:0 ; in:5155 out:5155 type:P dur:82000000 cpbdur:82000000 q:23.00 tex:90060 mv:4451 misc:1497 imb:26 pmb:959 smb:365 d:- ref:0 ; in:5156 out:5156 type:P dur:82000000 cpbdur:82000000 q:22.26 tex:73974 mv:4218 misc:1504 imb:39 pmb:1046 smb:265 d:- ref:0 ; in:5157 out:5157 type:P dur:82000000 cpbdur:82000000 q:23.11 tex:97873 mv:3893 misc:1450 imb:27 pmb:841 smb:482 d:- ref:0 ; in:5158 out:5158 type:P dur:82000000 cpbdur:82000000 q:23.55 tex:74949 mv:3564 misc:1423 imb:12 pmb:772 smb:566 d:- ref:0 ; in:5159 out:5159 type:P dur:82000000 cpbdur:82000000 q:22.26 tex:70948 mv:4305 misc:1547 imb:48 pmb:1029 smb:273 d:- ref:0 ; in:5160 out:5160 type:P dur:82000000 cpbdur:82000000 q:20.98 tex:57601 mv:4253 misc:1506 imb:39 pmb:1099 smb:212 d:- ref:0 ; in:5161 out:5161 type:P dur:82000000 cpbdur:82000000 q:22.89 tex:107583 mv:4566 misc:1427 imb:16 pmb:900 smb:434 d:- ref:0 ; in:5162 out:5162 type:P dur:82000000 cpbdur:82000000 q:21.46 tex:79769 mv:4000 misc:1511 imb:23 pmb:1100 smb:227 d:- ref:0 ; in:5163 out:5163 type:P dur:82000000 cpbdur:82000000 q:20.40 tex:80224 mv:3504 misc:1544 imb:16 pmb:1006 smb:328 d:- ref:0 ; in:5164 out:5164 type:P dur:82000000 cpbdur:82000000 q:21.44 tex:94836 mv:4062 misc:1518 imb:38 pmb:952 smb:360 d:- ref:0 ; in:5165 out:5165 type:P dur:82000000 cpbdur:82000000 q:19.81 tex:37447 mv:2421 misc:1524 imb:8 pmb:729 smb:613 d:- ref:0 ; in:5166 out:5166 type:P dur:82000000 cpbdur:82000000 q:18.75 tex:97690 mv:4090 misc:1492 imb:16 pmb:1216 smb:118 d:- ref:0 ; in:5167 out:5167 type:P dur:82000000 cpbdur:82000000 q:16.63 tex:139573 mv:4068 misc:1455 imb:15 pmb:1278 smb:57 d:- ref:0 ; in:5168 out:5168 type:P dur:82000000 cpbdur:82000000 q:16.53 tex:40457 mv:2996 misc:1627 imb:7 pmb:930 smb:413 d:- ref:0 ; in:5169 out:5169 type:P dur:82000000 cpbdur:82000000 q:17.97 tex:49872 mv:2870 misc:1554 imb:4 pmb:846 smb:500 d:- ref:0 ; in:5170 out:5170 type:P dur:82000000 cpbdur:82000000 q:19.54 tex:57501 mv:3003 misc:1512 imb:6 pmb:831 smb:513 d:- ref:0 ; in:5171 out:5171 type:P dur:82000000 cpbdur:82000000 q:19.57 tex:37304 mv:2530 misc:1550 imb:7 pmb:776 smb:567 d:- ref:0 ; in:5172 out:5172 type:P dur:82000000 cpbdur:82000000 q:18.94 tex:75361 mv:3593 misc:1566 imb:14 pmb:1039 smb:297 d:- ref:0 ; in:5173 out:5173 type:P dur:82000000 cpbdur:82000000 q:17.93 tex:49232 mv:3309 misc:1579 imb:10 pmb:1015 smb:325 d:- ref:0 ; in:5174 out:5174 type:P dur:82000000 cpbdur:82000000 q:17.03 tex:79775 mv:3793 misc:1520 imb:11 pmb:1201 smb:138 d:- ref:0 ; in:5175 out:5175 type:P dur:82000000 cpbdur:82000000 q:17.23 tex:45554 mv:3072 misc:1606 imb:5 pmb:956 smb:389 d:- ref:0 ; in:5176 out:5176 type:P dur:82000000 cpbdur:82000000 q:19.09 tex:50466 mv:3049 misc:1605 imb:11 pmb:875 smb:464 d:- ref:0 ; in:5177 out:5177 type:P dur:82000000 cpbdur:82000000 q:18.32 tex:49326 mv:2441 misc:1561 imb:1 pmb:751 smb:598 d:- ref:0 ; in:5178 out:5178 type:P dur:82000000 cpbdur:82000000 q:18.23 tex:40781 mv:2420 misc:1551 imb:4 pmb:732 smb:614 d:- ref:0 ; in:5179 out:5179 type:P dur:82000000 cpbdur:82000000 q:17.75 tex:25635 mv:1564 misc:1305 imb:0 pmb:458 smb:892 d:- ref:0 ; in:5180 out:5180 type:P dur:82000000 cpbdur:82000000 q:17.58 tex:29436 mv:2355 misc:1601 imb:6 pmb:711 smb:633 d:- ref:0 ; in:5181 out:5181 type:P dur:82000000 cpbdur:82000000 q:16.46 tex:150599 mv:4079 misc:1434 imb:2 pmb:1325 smb:23 d:- ref:0 ; in:5182 out:5182 type:P dur:82000000 cpbdur:82000000 q:18.66 tex:60592 mv:3066 misc:1566 imb:1 pmb:930 smb:419 d:- ref:0 ; in:5183 out:5183 type:P dur:82000000 cpbdur:82000000 q:22.66 tex:412522 mv:17394 misc:1412 imb:1092 pmb:258 smb:0 d:- ref:0 ; in:5184 out:5184 type:P dur:82000000 cpbdur:82000000 q:26.13 tex:3738 mv:441 misc:685 imb:0 pmb:147 smb:1203 d:- ref:0 ; in:5185 out:5185 type:P dur:82000000 cpbdur:82000000 q:24.14 tex:16070 mv:1218 misc:1024 imb:0 pmb:400 smb:950 d:- ref:0 ; in:5186 out:5186 type:P dur:82000000 cpbdur:82000000 q:22.11 tex:55083 mv:2638 misc:1415 imb:24 pmb:732 smb:594 d:- ref:0 ; in:5187 out:5187 type:P dur:82000000 cpbdur:82000000 q:20.10 tex:96148 mv:3475 misc:1529 imb:19 pmb:1015 smb:316 d:- ref:0 ; in:5188 out:5188 type:P dur:82000000 cpbdur:82000000 q:18.46 tex:134856 mv:4275 misc:1477 imb:9 pmb:1257 smb:84 d:- ref:0 ; in:5189 out:5189 type:P dur:82000000 cpbdur:82000000 q:18.55 tex:35886 mv:2309 misc:1493 imb:8 pmb:679 smb:663 d:- ref:0 ; in:5190 out:5190 type:P dur:82000000 cpbdur:82000000 q:19.02 tex:46403 mv:3146 misc:1579 imb:17 pmb:886 smb:447 d:- ref:0 ; in:5191 out:5191 type:P dur:82000000 cpbdur:82000000 q:17.02 tex:82302 mv:4090 misc:1504 imb:23 pmb:1204 smb:123 d:- ref:0 ; in:5192 out:5192 type:P dur:82000000 cpbdur:82000000 q:18.38 tex:42617 mv:2643 misc:1540 imb:13 pmb:759 smb:578 d:- ref:0 ; in:5193 out:5193 type:P dur:82000000 cpbdur:82000000 q:16.74 tex:33413 mv:2655 misc:1612 imb:3 pmb:829 smb:518 d:- ref:0 ; in:5194 out:5194 type:P dur:82000000 cpbdur:82000000 q:18.96 tex:52117 mv:2249 misc:1418 imb:5 pmb:675 smb:670 d:- ref:0 ; in:5195 out:5195 type:P dur:82000000 cpbdur:82000000 q:18.45 tex:30314 mv:1855 misc:1407 imb:8 pmb:539 smb:803 d:- ref:0 ; in:5196 out:5196 type:P dur:82000000 cpbdur:82000000 q:18.18 tex:24187 mv:2891 misc:1594 imb:25 pmb:757 smb:568 d:- ref:0 ; in:5197 out:5197 type:P dur:82000000 cpbdur:82000000 q:16.58 tex:39847 mv:3161 misc:1608 imb:6 pmb:983 smb:361 d:- ref:0 ; in:5198 out:5198 type:P dur:82000000 cpbdur:82000000 q:17.41 tex:38113 mv:3154 misc:1605 imb:12 pmb:922 smb:416 d:- ref:0 ; in:5199 out:5199 type:P dur:82000000 cpbdur:82000000 q:16.37 tex:93497 mv:3791 misc:1504 imb:5 pmb:1223 smb:122 d:- ref:0 ; in:5200 out:5200 type:P dur:82000000 cpbdur:82000000 q:17.27 tex:37674 mv:2674 misc:1588 imb:2 pmb:840 smb:508 d:- ref:0 ; in:5201 out:5201 type:P dur:82000000 cpbdur:82000000 q:18.33 tex:35160 mv:1736 misc:1368 imb:3 pmb:542 smb:805 d:- ref:0 ; in:5202 out:5202 type:P dur:82000000 cpbdur:82000000 q:19.88 tex:46623 mv:1699 misc:1182 imb:3 pmb:539 smb:808 d:- ref:0 ; in:5203 out:5203 type:P dur:82000000 cpbdur:82000000 q:19.43 tex:55570 mv:2509 misc:1457 imb:9 pmb:733 smb:608 d:- ref:0 ; in:5204 out:5204 type:P dur:82000000 cpbdur:82000000 q:19.23 tex:32355 mv:1693 misc:1296 imb:1 pmb:527 smb:822 d:- ref:0 ; in:5205 out:5205 type:P dur:82000000 cpbdur:82000000 q:18.98 tex:37485 mv:2007 misc:1388 imb:6 pmb:591 smb:753 d:- ref:0 ; in:5206 out:5206 type:P dur:82000000 cpbdur:82000000 q:18.71 tex:28088 mv:1918 misc:1394 imb:7 pmb:576 smb:767 d:- ref:0 ; in:5207 out:5207 type:P dur:82000000 cpbdur:82000000 q:18.18 tex:30598 mv:2549 misc:1533 imb:10 pmb:749 smb:591 d:- ref:0 ; in:5208 out:5208 type:P dur:82000000 cpbdur:82000000 q:18.38 tex:34277 mv:2501 misc:1518 imb:11 pmb:721 smb:618 d:- ref:0 ; in:5209 out:5209 type:P dur:82000000 cpbdur:82000000 q:17.96 tex:21302 mv:2587 misc:1575 imb:13 pmb:715 smb:622 d:- ref:0 ; in:5210 out:5210 type:P dur:82000000 cpbdur:82000000 q:18.88 tex:42947 mv:3762 misc:1571 imb:51 pmb:882 smb:417 d:- ref:0 ; in:5211 out:5211 type:P dur:82000000 cpbdur:82000000 q:17.61 tex:30176 mv:2074 misc:1534 imb:8 pmb:612 smb:730 d:- ref:0 ; in:5212 out:5212 type:P dur:82000000 cpbdur:82000000 q:18.27 tex:52076 mv:2738 misc:1538 imb:9 pmb:794 smb:547 d:- ref:0 ; in:5213 out:5213 type:P dur:82000000 cpbdur:82000000 q:19.14 tex:60075 mv:2496 misc:1445 imb:10 pmb:738 smb:602 d:- ref:0 ; in:5214 out:5214 type:P dur:82000000 cpbdur:82000000 q:18.83 tex:39150 mv:2299 misc:1455 imb:7 pmb:671 smb:672 d:- ref:0 ; in:5215 out:5215 type:P dur:82000000 cpbdur:82000000 q:18.49 tex:40814 mv:3167 misc:1595 imb:16 pmb:889 smb:445 d:- ref:0 ; in:5216 out:5216 type:P dur:82000000 cpbdur:82000000 q:16.98 tex:54683 mv:3349 misc:1552 imb:3 pmb:1031 smb:316 d:- ref:0 ; in:5217 out:5217 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:62081 mv:1924 misc:1219 imb:2 pmb:592 smb:756 d:- ref:0 ; in:5218 out:5218 type:P dur:82000000 cpbdur:82000000 q:22.33 tex:105136 mv:2668 misc:1028 imb:0 pmb:608 smb:742 d:- ref:0 ; in:5219 out:5219 type:P dur:82000000 cpbdur:82000000 q:21.11 tex:34880 mv:1921 misc:1271 imb:11 pmb:561 smb:778 d:- ref:0 ; in:5220 out:5220 type:P dur:82000000 cpbdur:82000000 q:22.53 tex:73350 mv:2352 misc:986 imb:2 pmb:542 smb:806 d:- ref:0 ; in:5221 out:5221 type:P dur:82000000 cpbdur:82000000 q:22.02 tex:72955 mv:2076 misc:1193 imb:4 pmb:630 smb:716 d:- ref:0 ; in:5222 out:5222 type:P dur:82000000 cpbdur:82000000 q:21.13 tex:38893 mv:1894 misc:1229 imb:6 pmb:584 smb:760 d:- ref:0 ; in:5223 out:5223 type:P dur:82000000 cpbdur:82000000 q:19.84 tex:26233 mv:1864 misc:1295 imb:8 pmb:564 smb:778 d:- ref:0 ; in:5224 out:5224 type:P dur:82000000 cpbdur:82000000 q:18.34 tex:65880 mv:3517 misc:1555 imb:18 pmb:993 smb:339 d:- ref:0 ; in:5225 out:5225 type:P dur:82000000 cpbdur:82000000 q:19.34 tex:64276 mv:2317 misc:1351 imb:7 pmb:711 smb:632 d:- ref:0 ; in:5226 out:5226 type:P dur:82000000 cpbdur:82000000 q:20.93 tex:67637 mv:2386 misc:1297 imb:8 pmb:648 smb:694 d:- ref:0 ; in:5227 out:5227 type:P dur:82000000 cpbdur:82000000 q:20.06 tex:42825 mv:1784 misc:1247 imb:1 pmb:570 smb:779 d:- ref:0 ; in:5228 out:5228 type:P dur:82000000 cpbdur:82000000 q:19.11 tex:60896 mv:3328 misc:1552 imb:13 pmb:906 smb:431 d:- ref:0 ; in:5229 out:5229 type:P dur:82000000 cpbdur:82000000 q:19.54 tex:36467 mv:1492 misc:1065 imb:1 pmb:442 smb:907 d:- ref:0 ; in:5230 out:5230 type:P dur:82000000 cpbdur:82000000 q:19.05 tex:49238 mv:2277 misc:1421 imb:3 pmb:687 smb:660 d:- ref:0 ; in:5231 out:5231 type:P dur:82000000 cpbdur:82000000 q:23.05 tex:308572 mv:14895 misc:1413 imb:1297 pmb:53 smb:0 d:- ref:0 ; in:5232 out:5232 type:P dur:82000000 cpbdur:82000000 q:25.93 tex:62664 mv:4530 misc:1302 imb:48 pmb:598 smb:704 d:- ref:0 ; in:5233 out:5233 type:P dur:82000000 cpbdur:82000000 q:24.99 tex:61314 mv:5431 misc:1407 imb:67 pmb:711 smb:572 d:- ref:0 ; in:5234 out:5234 type:P dur:82000000 cpbdur:82000000 q:23.84 tex:54746 mv:4732 misc:1410 imb:75 pmb:708 smb:567 d:- ref:0 ; in:5235 out:5235 type:P dur:82000000 cpbdur:82000000 q:22.24 tex:73332 mv:5532 misc:1456 imb:129 pmb:910 smb:311 d:- ref:0 ; in:5236 out:5236 type:P dur:82000000 cpbdur:82000000 q:22.11 tex:59860 mv:5119 misc:1437 imb:124 pmb:747 smb:479 d:- ref:0 ; in:5237 out:5237 type:P dur:82000000 cpbdur:82000000 q:21.85 tex:59314 mv:4068 misc:1354 imb:76 pmb:640 smb:634 d:- ref:0 ; in:5238 out:5238 type:P dur:82000000 cpbdur:82000000 q:21.11 tex:62130 mv:4773 misc:1449 imb:80 pmb:805 smb:465 d:- ref:0 ; in:5239 out:5239 type:P dur:82000000 cpbdur:82000000 q:20.66 tex:35440 mv:3337 misc:1351 imb:44 pmb:587 smb:719 d:- ref:0 ; in:5240 out:5240 type:P dur:82000000 cpbdur:82000000 q:20.48 tex:71342 mv:4277 misc:1421 imb:41 pmb:859 smb:450 d:- ref:0 ; in:5241 out:5241 type:P dur:82000000 cpbdur:82000000 q:20.61 tex:47443 mv:3668 misc:1385 imb:45 pmb:708 smb:597 d:- ref:0 ; in:5242 out:5242 type:P dur:82000000 cpbdur:82000000 q:20.56 tex:40845 mv:3593 misc:1378 imb:47 pmb:671 smb:632 d:- ref:0 ; in:5243 out:5243 type:P dur:82000000 cpbdur:82000000 q:20.47 tex:56894 mv:4204 misc:1462 imb:72 pmb:808 smb:470 d:- ref:0 ; in:5244 out:5244 type:P dur:82000000 cpbdur:82000000 q:20.55 tex:41874 mv:3238 misc:1360 imb:48 pmb:610 smb:692 d:- ref:0 ; in:5245 out:5245 type:P dur:82000000 cpbdur:82000000 q:20.46 tex:52164 mv:3602 misc:1418 imb:56 pmb:706 smb:588 d:- ref:0 ; in:5246 out:5246 type:P dur:82000000 cpbdur:82000000 q:20.50 tex:41919 mv:3293 misc:1332 imb:55 pmb:641 smb:654 d:- ref:0 ; in:5247 out:5247 type:P dur:82000000 cpbdur:82000000 q:20.95 tex:54369 mv:3444 misc:1371 imb:54 pmb:682 smb:614 d:- ref:0 ; in:5248 out:5248 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:78977 mv:4366 misc:1265 imb:55 pmb:740 smb:555 d:- ref:0 ; in:5249 out:5249 type:P dur:82000000 cpbdur:82000000 q:21.53 tex:50146 mv:3810 misc:1364 imb:58 pmb:704 smb:588 d:- ref:0 ; in:5250 out:5250 type:I dur:82000000 cpbdur:82000000 q:17.83 tex:480501 mv:14076 misc:375 imb:1350 pmb:0 smb:0 d:- ref:; in:5251 out:5251 type:P dur:82000000 cpbdur:82000000 q:25.53 tex:7172 mv:1271 misc:749 imb:22 pmb:229 smb:1099 d:- ref:0 ; in:5252 out:5252 type:P dur:82000000 cpbdur:82000000 q:23.92 tex:27102 mv:2485 misc:997 imb:52 pmb:395 smb:903 d:- ref:0 ; in:5253 out:5253 type:P dur:82000000 cpbdur:82000000 q:22.85 tex:36197 mv:2796 misc:1119 imb:59 pmb:472 smb:819 d:- ref:0 ; in:5254 out:5254 type:P dur:82000000 cpbdur:82000000 q:22.33 tex:64459 mv:3491 misc:1314 imb:53 pmb:677 smb:620 d:- ref:0 ; in:5255 out:5255 type:P dur:82000000 cpbdur:82000000 q:22.01 tex:48965 mv:3308 misc:1255 imb:71 pmb:592 smb:687 d:- ref:0 ; in:5256 out:5256 type:P dur:82000000 cpbdur:82000000 q:21.51 tex:42551 mv:2886 misc:1179 imb:45 pmb:534 smb:771 d:- ref:0 ; in:5257 out:5257 type:P dur:82000000 cpbdur:82000000 q:21.30 tex:53983 mv:3410 misc:1367 imb:85 pmb:684 smb:581 d:- ref:0 ; in:5258 out:5258 type:P dur:82000000 cpbdur:82000000 q:21.04 tex:49197 mv:2963 misc:1224 imb:48 pmb:571 smb:731 d:- ref:0 ; in:5259 out:5259 type:P dur:82000000 cpbdur:82000000 q:21.37 tex:70233 mv:3707 misc:1316 imb:82 pmb:699 smb:569 d:- ref:0 ; in:5260 out:5260 type:P dur:82000000 cpbdur:82000000 q:21.33 tex:58735 mv:3432 misc:1329 imb:71 pmb:674 smb:605 d:- ref:0 ; in:5261 out:5261 type:P dur:82000000 cpbdur:82000000 q:21.17 tex:51485 mv:3133 misc:1294 imb:64 pmb:661 smb:625 d:- ref:0 ; in:5262 out:5262 type:P dur:82000000 cpbdur:82000000 q:21.37 tex:57813 mv:3284 misc:1287 imb:70 pmb:600 smb:680 d:- ref:0 ; in:5263 out:5263 type:P dur:82000000 cpbdur:82000000 q:21.43 tex:58006 mv:3438 misc:1324 imb:86 pmb:672 smb:592 d:- ref:0 ; in:5264 out:5264 type:P dur:82000000 cpbdur:82000000 q:21.65 tex:52866 mv:3449 misc:1333 imb:101 pmb:609 smb:640 d:- ref:0 ; in:5265 out:5265 type:P dur:82000000 cpbdur:82000000 q:22.15 tex:86022 mv:4148 misc:1318 imb:89 pmb:730 smb:531 d:- ref:0 ; in:5266 out:5266 type:P dur:82000000 cpbdur:82000000 q:22.03 tex:52351 mv:3302 misc:1363 imb:125 pmb:594 smb:631 d:- ref:0 ; in:5267 out:5267 type:P dur:82000000 cpbdur:82000000 q:22.10 tex:56818 mv:5127 misc:1455 imb:213 pmb:753 smb:384 d:- ref:0 ; in:5268 out:5268 type:P dur:82000000 cpbdur:82000000 q:21.75 tex:49603 mv:3992 misc:1453 imb:70 pmb:802 smb:478 d:- ref:0 ; in:5269 out:5269 type:P dur:82000000 cpbdur:82000000 q:21.01 tex:52211 mv:4284 misc:1481 imb:138 pmb:916 smb:296 d:- ref:0 ; in:5270 out:5270 type:P dur:82000000 cpbdur:82000000 q:19.40 tex:87921 mv:4035 misc:1492 imb:51 pmb:1025 smb:274 d:- ref:0 ; in:5271 out:5271 type:P dur:82000000 cpbdur:82000000 q:19.80 tex:53420 mv:2968 misc:1396 imb:12 pmb:702 smb:636 d:- ref:0 ; in:5272 out:5272 type:P dur:82000000 cpbdur:82000000 q:19.02 tex:50112 mv:3406 misc:1490 imb:38 pmb:914 smb:398 d:- ref:0 ; in:5273 out:5273 type:P dur:82000000 cpbdur:82000000 q:17.58 tex:34198 mv:2625 misc:1489 imb:14 pmb:733 smb:603 d:- ref:0 ; in:5274 out:5274 type:P dur:82000000 cpbdur:82000000 q:17.49 tex:75367 mv:3859 misc:1526 imb:47 pmb:1085 smb:218 d:- ref:0 ; in:5275 out:5275 type:P dur:82000000 cpbdur:82000000 q:15.84 tex:82545 mv:3678 misc:1521 imb:22 pmb:1118 smb:210 d:- ref:0 ; in:5276 out:5276 type:P dur:82000000 cpbdur:82000000 q:16.41 tex:39731 mv:2722 misc:1579 imb:17 pmb:798 smb:535 d:- ref:0 ; in:5277 out:5277 type:P dur:82000000 cpbdur:82000000 q:15.06 tex:40547 mv:2850 misc:1547 imb:27 pmb:762 smb:561 d:- ref:0 ; in:5278 out:5278 type:P dur:82000000 cpbdur:82000000 q:16.64 tex:27192 mv:2804 misc:1556 imb:25 pmb:744 smb:581 d:- ref:0 ; in:5279 out:5279 type:P dur:82000000 cpbdur:82000000 q:16.57 tex:20089 mv:1993 misc:1406 imb:19 pmb:485 smb:846 d:- ref:0 ; in:5280 out:5280 type:P dur:82000000 cpbdur:82000000 q:16.95 tex:23609 mv:2466 misc:1573 imb:28 pmb:684 smb:638 d:- ref:0 ; in:5281 out:5281 type:P dur:82000000 cpbdur:82000000 q:16.41 tex:44712 mv:3119 misc:1577 imb:22 pmb:869 smb:459 d:- ref:0 ; in:5282 out:5282 type:P dur:82000000 cpbdur:82000000 q:17.13 tex:24716 mv:2471 misc:1549 imb:21 pmb:695 smb:634 d:- ref:0 ; in:5283 out:5283 type:P dur:82000000 cpbdur:82000000 q:19.13 tex:59877 mv:2905 misc:1394 imb:10 pmb:723 smb:617 d:- ref:0 ; in:5284 out:5284 type:P dur:82000000 cpbdur:82000000 q:19.05 tex:44698 mv:2284 misc:1362 imb:7 pmb:620 smb:723 d:- ref:0 ; in:5285 out:5285 type:P dur:82000000 cpbdur:82000000 q:19.00 tex:40950 mv:2384 misc:1426 imb:6 pmb:698 smb:646 d:- ref:0 ; in:5286 out:5286 type:P dur:82000000 cpbdur:82000000 q:19.58 tex:53950 mv:2921 misc:1361 imb:14 pmb:699 smb:637 d:- ref:0 ; in:5287 out:5287 type:P dur:82000000 cpbdur:82000000 q:19.79 tex:49676 mv:2873 misc:1363 imb:12 pmb:713 smb:625 d:- ref:0 ; in:5288 out:5288 type:P dur:82000000 cpbdur:82000000 q:18.23 tex:50764 mv:3040 misc:1492 imb:27 pmb:882 smb:441 d:- ref:0 ; in:5289 out:5289 type:P dur:82000000 cpbdur:82000000 q:16.98 tex:50475 mv:3235 misc:1538 imb:34 pmb:907 smb:409 d:- ref:0 ; in:5290 out:5290 type:P dur:82000000 cpbdur:82000000 q:17.56 tex:25326 mv:2170 misc:1408 imb:6 pmb:578 smb:766 d:- ref:0 ; in:5291 out:5291 type:P dur:82000000 cpbdur:82000000 q:20.21 tex:70560 mv:3328 misc:1392 imb:9 pmb:750 smb:591 d:- ref:0 ; in:5292 out:5292 type:P dur:82000000 cpbdur:82000000 q:19.72 tex:31565 mv:2162 misc:1361 imb:8 pmb:596 smb:746 d:- ref:0 ; in:5293 out:5293 type:P dur:82000000 cpbdur:82000000 q:18.26 tex:51748 mv:3025 misc:1483 imb:37 pmb:837 smb:476 d:- ref:0 ; in:5294 out:5294 type:P dur:82000000 cpbdur:82000000 q:18.29 tex:33589 mv:2403 misc:1448 imb:12 pmb:621 smb:717 d:- ref:0 ; in:5295 out:5295 type:P dur:82000000 cpbdur:82000000 q:17.53 tex:21199 mv:1546 misc:1271 imb:8 pmb:404 smb:938 d:- ref:0 ; in:5296 out:5296 type:P dur:82000000 cpbdur:82000000 q:16.84 tex:41845 mv:3236 misc:1535 imb:36 pmb:902 smb:412 d:- ref:0 ; in:5297 out:5297 type:P dur:82000000 cpbdur:82000000 q:17.42 tex:48193 mv:2718 misc:1505 imb:20 pmb:756 smb:574 d:- ref:0 ; in:5298 out:5298 type:P dur:82000000 cpbdur:82000000 q:16.91 tex:26006 mv:2280 misc:1530 imb:21 pmb:658 smb:671 d:- ref:0 ; in:5299 out:5299 type:P dur:82000000 cpbdur:82000000 q:18.08 tex:39598 mv:3045 misc:1501 imb:30 pmb:717 smb:603 d:- ref:0 ; in:5300 out:5300 type:P dur:82000000 cpbdur:82000000 q:17.60 tex:26630 mv:1905 misc:1377 imb:7 pmb:497 smb:846 d:- ref:0 ; in:5301 out:5301 type:P dur:82000000 cpbdur:82000000 q:18.35 tex:50380 mv:2574 misc:1486 imb:24 pmb:714 smb:612 d:- ref:0 ; in:5302 out:5302 type:P dur:82000000 cpbdur:82000000 q:18.92 tex:62809 mv:2185 misc:1246 imb:7 pmb:535 smb:808 d:- ref:0 ; in:5303 out:5303 type:P dur:82000000 cpbdur:82000000 q:18.68 tex:32179 mv:2242 misc:1427 imb:14 pmb:642 smb:694 d:- ref:0 ; in:5304 out:5304 type:P dur:82000000 cpbdur:82000000 q:18.12 tex:43118 mv:2016 misc:1378 imb:12 pmb:522 smb:816 d:- ref:0 ; in:5305 out:5305 type:P dur:82000000 cpbdur:82000000 q:17.96 tex:39830 mv:1820 misc:1286 imb:4 pmb:476 smb:870 d:- ref:0 ; in:5306 out:5306 type:P dur:82000000 cpbdur:82000000 q:17.85 tex:32772 mv:2029 misc:1383 imb:6 pmb:591 smb:753 d:- ref:0 ; in:5307 out:5307 type:P dur:82000000 cpbdur:82000000 q:21.85 tex:252029 mv:14579 misc:1424 imb:1271 pmb:63 smb:16 d:- ref:0 ; in:5308 out:5308 type:P dur:82000000 cpbdur:82000000 q:23.95 tex:17926 mv:1324 misc:950 imb:6 pmb:304 smb:1040 d:- ref:0 ; in:5309 out:5309 type:P dur:82000000 cpbdur:82000000 q:22.11 tex:33994 mv:1728 misc:1174 imb:13 pmb:462 smb:875 d:- ref:0 ; in:5310 out:5310 type:P dur:82000000 cpbdur:82000000 q:21.51 tex:34084 mv:1899 misc:1113 imb:19 pmb:411 smb:920 d:- ref:0 ; in:5311 out:5311 type:P dur:82000000 cpbdur:82000000 q:20.97 tex:42016 mv:2560 misc:1384 imb:44 pmb:574 smb:732 d:- ref:0 ; in:5312 out:5312 type:P dur:82000000 cpbdur:82000000 q:19.77 tex:34930 mv:2177 misc:1373 imb:25 pmb:587 smb:738 d:- ref:0 ; in:5313 out:5313 type:P dur:82000000 cpbdur:82000000 q:21.71 tex:77983 mv:3379 misc:1334 imb:65 pmb:635 smb:650 d:- ref:0 ; in:5314 out:5314 type:P dur:82000000 cpbdur:82000000 q:19.90 tex:48714 mv:2606 misc:1432 imb:40 pmb:736 smb:574 d:- ref:0 ; in:5315 out:5315 type:P dur:82000000 cpbdur:82000000 q:18.99 tex:56023 mv:3423 misc:1466 imb:50 pmb:917 smb:383 d:- ref:0 ; in:5316 out:5316 type:P dur:82000000 cpbdur:82000000 q:18.37 tex:52161 mv:2937 misc:1470 imb:33 pmb:797 smb:520 d:- ref:0 ; in:5317 out:5317 type:P dur:82000000 cpbdur:82000000 q:17.19 tex:64470 mv:3324 misc:1518 imb:34 pmb:976 smb:340 d:- ref:0 ; in:5318 out:5318 type:P dur:82000000 cpbdur:82000000 q:17.59 tex:29571 mv:1905 misc:1356 imb:24 pmb:531 smb:795 d:- ref:0 ; in:5319 out:5319 type:P dur:82000000 cpbdur:82000000 q:19.43 tex:56201 mv:2529 misc:1438 imb:34 pmb:673 smb:643 d:- ref:0 ; in:5320 out:5320 type:P dur:82000000 cpbdur:82000000 q:19.49 tex:59251 mv:2360 misc:1325 imb:27 pmb:594 smb:729 d:- ref:0 ; in:5321 out:5321 type:P dur:82000000 cpbdur:82000000 q:19.51 tex:26693 mv:1413 misc:1086 imb:18 pmb:355 smb:977 d:- ref:0 ; in:5322 out:5322 type:P dur:82000000 cpbdur:82000000 q:19.26 tex:39572 mv:2264 misc:1356 imb:23 pmb:634 smb:693 d:- ref:0 ; in:5323 out:5323 type:P dur:82000000 cpbdur:82000000 q:19.36 tex:50454 mv:2278 misc:1276 imb:29 pmb:570 smb:751 d:- ref:0 ; in:5324 out:5324 type:P dur:82000000 cpbdur:82000000 q:17.70 tex:23319 mv:1961 misc:1400 imb:13 pmb:587 smb:750 d:- ref:0 ; in:5325 out:5325 type:P dur:82000000 cpbdur:82000000 q:17.55 tex:23720 mv:1974 misc:1410 imb:18 pmb:548 smb:784 d:- ref:0 ; in:5326 out:5326 type:P dur:82000000 cpbdur:82000000 q:16.47 tex:99463 mv:3931 misc:1478 imb:55 pmb:1099 smb:196 d:- ref:0 ; in:5327 out:5327 type:P dur:82000000 cpbdur:82000000 q:16.34 tex:30155 mv:2258 misc:1491 imb:14 pmb:684 smb:652 d:- ref:0 ; in:5328 out:5328 type:P dur:82000000 cpbdur:82000000 q:17.52 tex:28271 mv:1988 misc:1357 imb:13 pmb:606 smb:731 d:- ref:0 ; in:5329 out:5329 type:P dur:82000000 cpbdur:82000000 q:15.99 tex:43549 mv:2603 misc:1496 imb:18 pmb:791 smb:541 d:- ref:0 ; in:5330 out:5330 type:P dur:82000000 cpbdur:82000000 q:16.42 tex:27242 mv:2292 misc:1490 imb:28 pmb:660 smb:662 d:- ref:0 ; in:5331 out:5331 type:P dur:82000000 cpbdur:82000000 q:15.53 tex:14083 mv:1655 misc:1390 imb:39 pmb:417 smb:894 d:- ref:0 ; in:5332 out:5332 type:P dur:82000000 cpbdur:82000000 q:16.14 tex:27113 mv:2172 misc:1475 imb:34 pmb:606 smb:710 d:- ref:0 ; in:5333 out:5333 type:P dur:82000000 cpbdur:82000000 q:17.37 tex:27811 mv:2418 misc:1467 imb:26 pmb:688 smb:636 d:- ref:0 ; in:5334 out:5334 type:P dur:82000000 cpbdur:82000000 q:17.10 tex:30440 mv:1765 misc:1283 imb:10 pmb:531 smb:809 d:- ref:0 ; in:5335 out:5335 type:P dur:82000000 cpbdur:82000000 q:16.77 tex:18378 mv:1888 misc:1358 imb:26 pmb:534 smb:790 d:- ref:0 ; in:5336 out:5336 type:P dur:82000000 cpbdur:82000000 q:15.17 tex:54281 mv:3460 misc:1483 imb:40 pmb:902 smb:408 d:- ref:0 ; in:5337 out:5337 type:P dur:82000000 cpbdur:82000000 q:16.97 tex:26630 mv:1948 misc:1358 imb:12 pmb:580 smb:758 d:- ref:0 ; in:5338 out:5338 type:P dur:82000000 cpbdur:82000000 q:15.98 tex:30387 mv:2306 misc:1483 imb:13 pmb:704 smb:633 d:- ref:0 ; in:5339 out:5339 type:P dur:82000000 cpbdur:82000000 q:16.59 tex:18568 mv:2057 misc:1431 imb:22 pmb:585 smb:743 d:- ref:0 ; in:5340 out:5340 type:P dur:82000000 cpbdur:82000000 q:14.96 tex:32104 mv:2594 misc:1502 imb:29 pmb:710 smb:611 d:- ref:0 ; in:5341 out:5341 type:P dur:82000000 cpbdur:82000000 q:16.07 tex:24076 mv:2347 misc:1513 imb:27 pmb:677 smb:646 d:- ref:0 ; in:5342 out:5342 type:P dur:82000000 cpbdur:82000000 q:15.25 tex:21341 mv:1984 misc:1451 imb:32 pmb:494 smb:824 d:- ref:0 ; in:5343 out:5343 type:P dur:82000000 cpbdur:82000000 q:17.71 tex:25386 mv:1740 misc:1314 imb:12 pmb:510 smb:828 d:- ref:0 ; in:5344 out:5344 type:P dur:82000000 cpbdur:82000000 q:18.84 tex:43451 mv:1744 misc:1197 imb:16 pmb:478 smb:856 d:- ref:0 ; in:5345 out:5345 type:P dur:82000000 cpbdur:82000000 q:18.07 tex:18622 mv:1629 misc:1293 imb:15 pmb:489 smb:846 d:- ref:0 ; in:5346 out:5346 type:P dur:82000000 cpbdur:82000000 q:17.45 tex:38016 mv:2477 misc:1467 imb:31 pmb:709 smb:610 d:- ref:0 ; in:5347 out:5347 type:P dur:82000000 cpbdur:82000000 q:17.82 tex:21894 mv:1591 misc:1251 imb:14 pmb:473 smb:863 d:- ref:0 ; in:5348 out:5348 type:P dur:82000000 cpbdur:82000000 q:16.80 tex:28042 mv:1994 misc:1436 imb:22 pmb:572 smb:756 d:- ref:0 ; in:5349 out:5349 type:P dur:82000000 cpbdur:82000000 q:16.77 tex:16857 mv:1926 misc:1393 imb:29 pmb:528 smb:793 d:- ref:0 ; in:5350 out:5350 type:P dur:82000000 cpbdur:82000000 q:15.18 tex:50040 mv:3568 misc:1536 imb:53 pmb:910 smb:387 d:- ref:0 ; in:5351 out:5351 type:P dur:82000000 cpbdur:82000000 q:16.16 tex:23396 mv:2339 misc:1489 imb:26 pmb:683 smb:641 d:- ref:0 ; in:5352 out:5352 type:P dur:82000000 cpbdur:82000000 q:15.88 tex:26656 mv:1515 misc:1261 imb:11 pmb:465 smb:874 d:- ref:0 ; in:5353 out:5353 type:P dur:82000000 cpbdur:82000000 q:16.85 tex:20579 mv:2073 misc:1444 imb:19 pmb:619 smb:712 d:- ref:0 ; in:5354 out:5354 type:P dur:82000000 cpbdur:82000000 q:16.12 tex:34263 mv:2526 misc:1515 imb:34 pmb:718 smb:598 d:- ref:0 ; in:5355 out:5355 type:P dur:82000000 cpbdur:82000000 q:17.04 tex:20898 mv:2389 misc:1481 imb:43 pmb:625 smb:682 d:- ref:0 ; in:5356 out:5356 type:P dur:82000000 cpbdur:82000000 q:16.59 tex:16303 mv:1638 misc:1355 imb:24 pmb:442 smb:884 d:- ref:0 ; in:5357 out:5357 type:P dur:82000000 cpbdur:82000000 q:16.76 tex:17247 mv:1909 misc:1452 imb:34 pmb:511 smb:805 d:- ref:0 ; in:5358 out:5358 type:P dur:82000000 cpbdur:82000000 q:16.70 tex:26868 mv:1802 misc:1274 imb:20 pmb:508 smb:822 d:- ref:0 ; in:5359 out:5359 type:P dur:82000000 cpbdur:82000000 q:17.03 tex:18444 mv:1883 misc:1425 imb:27 pmb:543 smb:780 d:- ref:0 ; in:5360 out:5360 type:P dur:82000000 cpbdur:82000000 q:16.40 tex:49962 mv:2932 misc:1498 imb:39 pmb:842 smb:469 d:- ref:0 ; in:5361 out:5361 type:P dur:82000000 cpbdur:82000000 q:16.98 tex:25947 mv:1988 misc:1417 imb:9 pmb:610 smb:731 d:- ref:0 ; in:5362 out:5362 type:P dur:82000000 cpbdur:82000000 q:17.43 tex:30943 mv:1934 misc:1355 imb:16 pmb:578 smb:756 d:- ref:0 ; in:5363 out:5363 type:P dur:82000000 cpbdur:82000000 q:19.14 tex:46362 mv:2131 misc:1267 imb:15 pmb:589 smb:746 d:- ref:0 ; in:5364 out:5364 type:P dur:82000000 cpbdur:82000000 q:18.84 tex:42118 mv:1955 misc:1239 imb:8 pmb:563 smb:779 d:- ref:0 ; in:5365 out:5365 type:P dur:82000000 cpbdur:82000000 q:19.58 tex:39541 mv:2552 misc:1323 imb:21 pmb:614 smb:715 d:- ref:0 ; in:5366 out:5366 type:P dur:82000000 cpbdur:82000000 q:18.17 tex:43902 mv:2746 misc:1424 imb:26 pmb:768 smb:556 d:- ref:0 ; in:5367 out:5367 type:P dur:82000000 cpbdur:82000000 q:17.89 tex:28761 mv:2021 misc:1402 imb:15 pmb:553 smb:782 d:- ref:0 ; in:5368 out:5368 type:P dur:82000000 cpbdur:82000000 q:17.47 tex:50691 mv:2997 misc:1480 imb:32 pmb:827 smb:491 d:- ref:0 ; in:5369 out:5369 type:P dur:82000000 cpbdur:82000000 q:16.95 tex:23969 mv:1877 misc:1394 imb:11 pmb:557 smb:782 d:- ref:0 ; in:5370 out:5370 type:P dur:82000000 cpbdur:82000000 q:20.95 tex:351914 mv:15523 misc:1411 imb:1199 pmb:119 smb:32 d:- ref:0 ; in:5371 out:5371 type:P dur:82000000 cpbdur:82000000 q:24.95 tex:29305 mv:2330 misc:981 imb:3 pmb:458 smb:889 d:- ref:0 ; in:5372 out:5372 type:P dur:82000000 cpbdur:82000000 q:23.62 tex:28890 mv:2689 misc:1061 imb:4 pmb:513 smb:833 d:- ref:0 ; in:5373 out:5373 type:P dur:82000000 cpbdur:82000000 q:22.36 tex:44289 mv:3717 misc:1330 imb:42 pmb:745 smb:563 d:- ref:0 ; in:5374 out:5374 type:P dur:82000000 cpbdur:82000000 q:21.23 tex:46778 mv:3622 misc:1416 imb:60 pmb:750 smb:540 d:- ref:0 ; in:5375 out:5375 type:P dur:82000000 cpbdur:82000000 q:20.61 tex:31723 mv:2821 misc:1400 imb:43 pmb:601 smb:706 d:- ref:0 ; in:5376 out:5376 type:P dur:82000000 cpbdur:82000000 q:22.03 tex:83768 mv:4964 misc:1268 imb:49 pmb:768 smb:533 d:- ref:0 ; in:5377 out:5377 type:P dur:82000000 cpbdur:82000000 q:20.54 tex:37315 mv:2855 misc:1414 imb:42 pmb:695 smb:613 d:- ref:0 ; in:5378 out:5378 type:P dur:82000000 cpbdur:82000000 q:19.91 tex:48450 mv:3212 misc:1434 imb:64 pmb:766 smb:520 d:- ref:0 ; in:5379 out:5379 type:P dur:82000000 cpbdur:82000000 q:18.82 tex:71248 mv:4061 misc:1491 imb:60 pmb:971 smb:319 d:- ref:0 ; in:5380 out:5380 type:P dur:82000000 cpbdur:82000000 q:18.51 tex:32903 mv:2371 misc:1390 imb:32 pmb:595 smb:723 d:- ref:0 ; in:5381 out:5381 type:P dur:82000000 cpbdur:82000000 q:18.75 tex:35560 mv:2392 misc:1368 imb:14 pmb:624 smb:712 d:- ref:0 ; in:5382 out:5382 type:P dur:82000000 cpbdur:82000000 q:18.35 tex:52784 mv:3224 misc:1528 imb:43 pmb:818 smb:489 d:- ref:0 ; in:5383 out:5383 type:P dur:82000000 cpbdur:82000000 q:18.99 tex:40552 mv:3070 misc:1474 imb:43 pmb:726 smb:581 d:- ref:0 ; in:5384 out:5384 type:P dur:82000000 cpbdur:82000000 q:18.00 tex:31061 mv:1848 misc:1315 imb:22 pmb:488 smb:840 d:- ref:0 ; in:5385 out:5385 type:P dur:82000000 cpbdur:82000000 q:18.75 tex:36139 mv:2338 misc:1387 imb:13 pmb:624 smb:713 d:- ref:0 ; in:5386 out:5386 type:P dur:82000000 cpbdur:82000000 q:18.30 tex:40295 mv:2573 misc:1396 imb:37 pmb:633 smb:680 d:- ref:0 ; in:5387 out:5387 type:P dur:82000000 cpbdur:82000000 q:19.09 tex:51260 mv:2825 misc:1395 imb:25 pmb:713 smb:612 d:- ref:0 ; in:5388 out:5388 type:P dur:82000000 cpbdur:82000000 q:19.18 tex:49414 mv:3095 misc:1427 imb:54 pmb:709 smb:587 d:- ref:0 ; in:5389 out:5389 type:P dur:82000000 cpbdur:82000000 q:19.10 tex:42800 mv:2800 misc:1424 imb:32 pmb:706 smb:612 d:- ref:0 ; in:5390 out:5390 type:P dur:82000000 cpbdur:82000000 q:19.60 tex:35609 mv:2259 misc:1356 imb:24 pmb:583 smb:743 d:- ref:0 ; in:5391 out:5391 type:P dur:82000000 cpbdur:82000000 q:19.14 tex:47047 mv:3434 misc:1519 imb:85 pmb:726 smb:539 d:- ref:0 ; in:5392 out:5392 type:P dur:82000000 cpbdur:82000000 q:19.34 tex:42137 mv:2488 misc:1391 imb:20 pmb:650 smb:680 d:- ref:0 ; in:5393 out:5393 type:P dur:82000000 cpbdur:82000000 q:18.84 tex:32580 mv:1973 misc:1215 imb:36 pmb:451 smb:863 d:- ref:0 ; in:5394 out:5394 type:P dur:82000000 cpbdur:82000000 q:18.97 tex:34505 mv:2596 misc:1459 imb:47 pmb:630 smb:673 d:- ref:0 ; in:5395 out:5395 type:P dur:82000000 cpbdur:82000000 q:19.81 tex:38298 mv:2165 misc:1281 imb:21 pmb:579 smb:750 d:- ref:0 ; in:5396 out:5396 type:P dur:82000000 cpbdur:82000000 q:19.93 tex:49507 mv:2091 misc:1090 imb:13 pmb:547 smb:790 d:- ref:0 ; in:5397 out:5397 type:P dur:82000000 cpbdur:82000000 q:19.52 tex:27714 mv:1762 misc:1196 imb:16 pmb:488 smb:846 d:- ref:0 ; in:5398 out:5398 type:P dur:82000000 cpbdur:82000000 q:19.97 tex:42920 mv:2537 misc:1271 imb:27 pmb:575 smb:748 d:- ref:0 ; in:5399 out:5399 type:P dur:82000000 cpbdur:82000000 q:19.76 tex:35386 mv:2104 misc:1118 imb:18 pmb:492 smb:840 d:- ref:0 ; in:5400 out:5400 type:P dur:82000000 cpbdur:82000000 q:20.07 tex:44440 mv:2342 misc:1226 imb:25 pmb:598 smb:727 d:- ref:0 ; in:5401 out:5401 type:P dur:82000000 cpbdur:82000000 q:19.82 tex:33991 mv:1937 misc:1208 imb:17 pmb:543 smb:790 d:- ref:0 ; in:5402 out:5402 type:P dur:82000000 cpbdur:82000000 q:19.78 tex:34451 mv:2008 misc:1237 imb:35 pmb:496 smb:819 d:- ref:0 ; in:5403 out:5403 type:P dur:82000000 cpbdur:82000000 q:19.80 tex:34630 mv:1751 misc:1083 imb:23 pmb:469 smb:858 d:- ref:0 ; in:5404 out:5404 type:P dur:82000000 cpbdur:82000000 q:20.76 tex:42043 mv:2367 misc:1254 imb:45 pmb:573 smb:732 d:- ref:0 ; in:5405 out:5405 type:P dur:82000000 cpbdur:82000000 q:20.81 tex:53219 mv:2694 misc:1287 imb:75 pmb:618 smb:657 d:- ref:0 ; in:5406 out:5406 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:52024 mv:5146 misc:1494 imb:161 pmb:810 smb:379 d:- ref:0 ; in:5407 out:5407 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:40185 mv:4224 misc:1503 imb:133 pmb:844 smb:373 d:- ref:0 ; in:5408 out:5408 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:60869 mv:4781 misc:1486 imb:154 pmb:931 smb:265 d:- ref:0 ; in:5409 out:5409 type:P dur:82000000 cpbdur:82000000 q:18.23 tex:74555 mv:3687 misc:1470 imb:56 pmb:973 smb:321 d:- ref:0 ; in:5410 out:5410 type:P dur:82000000 cpbdur:82000000 q:17.48 tex:67760 mv:3917 misc:1507 imb:72 pmb:1035 smb:243 d:- ref:0 ; in:5411 out:5411 type:P dur:82000000 cpbdur:82000000 q:15.85 tex:86216 mv:3491 misc:1493 imb:22 pmb:1077 smb:251 d:- ref:0 ; in:5412 out:5412 type:P dur:82000000 cpbdur:82000000 q:17.68 tex:35118 mv:2352 misc:1386 imb:7 pmb:698 smb:645 d:- ref:0 ; in:5413 out:5413 type:P dur:82000000 cpbdur:82000000 q:16.12 tex:58835 mv:3235 misc:1562 imb:20 pmb:955 smb:375 d:- ref:0 ; in:5414 out:5414 type:P dur:82000000 cpbdur:82000000 q:16.63 tex:24151 mv:2409 misc:1528 imb:22 pmb:697 smb:631 d:- ref:0 ; in:5415 out:5415 type:P dur:82000000 cpbdur:82000000 q:15.13 tex:55600 mv:3604 misc:1548 imb:27 pmb:928 smb:395 d:- ref:0 ; in:5416 out:5416 type:P dur:82000000 cpbdur:82000000 q:16.49 tex:41288 mv:2849 misc:1551 imb:21 pmb:831 smb:498 d:- ref:0 ; in:5417 out:5417 type:P dur:82000000 cpbdur:82000000 q:15.32 tex:25065 mv:2086 misc:1465 imb:19 pmb:516 smb:815 d:- ref:0 ; in:5418 out:5418 type:P dur:82000000 cpbdur:82000000 q:15.91 tex:24444 mv:2328 misc:1580 imb:18 pmb:692 smb:640 d:- ref:0 ; in:5419 out:5419 type:P dur:82000000 cpbdur:82000000 q:17.31 tex:35938 mv:2873 misc:1517 imb:44 pmb:787 smb:519 d:- ref:0 ; in:5420 out:5420 type:P dur:82000000 cpbdur:82000000 q:16.38 tex:36284 mv:2538 misc:1562 imb:24 pmb:748 smb:578 d:- ref:0 ; in:5421 out:5421 type:P dur:82000000 cpbdur:82000000 q:17.23 tex:29643 mv:2485 misc:1512 imb:23 pmb:721 smb:606 d:- ref:0 ; in:5422 out:5422 type:P dur:82000000 cpbdur:82000000 q:16.71 tex:34151 mv:1655 misc:1242 imb:8 pmb:501 smb:841 d:- ref:0 ; in:5423 out:5423 type:P dur:82000000 cpbdur:82000000 q:16.67 tex:23908 mv:2185 misc:1443 imb:15 pmb:621 smb:714 d:- ref:0 ; in:5424 out:5424 type:P dur:82000000 cpbdur:82000000 q:16.72 tex:21880 mv:2175 misc:1473 imb:19 pmb:629 smb:702 d:- ref:0 ; in:5425 out:5425 type:P dur:82000000 cpbdur:82000000 q:15.69 tex:41730 mv:3039 misc:1543 imb:28 pmb:891 smb:431 d:- ref:0 ; in:5426 out:5426 type:P dur:82000000 cpbdur:82000000 q:16.30 tex:30435 mv:2482 misc:1515 imb:25 pmb:688 smb:637 d:- ref:0 ; in:5427 out:5427 type:P dur:82000000 cpbdur:82000000 q:14.94 tex:27625 mv:2513 misc:1534 imb:22 pmb:639 smb:689 d:- ref:0 ; in:5428 out:5428 type:P dur:82000000 cpbdur:82000000 q:15.82 tex:26676 mv:2035 misc:1497 imb:19 pmb:599 smb:732 d:- ref:0 ; in:5429 out:5429 type:P dur:82000000 cpbdur:82000000 q:14.50 tex:15117 mv:1635 misc:1368 imb:12 pmb:411 smb:927 d:- ref:0 ; in:5430 out:5430 type:P dur:82000000 cpbdur:82000000 q:16.34 tex:35633 mv:2519 misc:1512 imb:31 pmb:721 smb:598 d:- ref:0 ; in:5431 out:5431 type:P dur:82000000 cpbdur:82000000 q:15.20 tex:20633 mv:2124 misc:1467 imb:26 pmb:506 smb:818 d:- ref:0 ; in:5432 out:5432 type:P dur:82000000 cpbdur:82000000 q:16.51 tex:20757 mv:2285 misc:1478 imb:19 pmb:671 smb:660 d:- ref:0 ; in:5433 out:5433 type:P dur:82000000 cpbdur:82000000 q:15.21 tex:31557 mv:2669 misc:1558 imb:28 pmb:677 smb:645 d:- ref:0 ; in:5434 out:5434 type:P dur:82000000 cpbdur:82000000 q:15.59 tex:16691 mv:2169 misc:1540 imb:29 pmb:617 smb:704 d:- ref:0 ; in:5435 out:5435 type:P dur:82000000 cpbdur:82000000 q:14.79 tex:20137 mv:1832 misc:1399 imb:19 pmb:476 smb:855 d:- ref:0 ; in:5436 out:5436 type:P dur:82000000 cpbdur:82000000 q:16.12 tex:26538 mv:2122 misc:1484 imb:15 pmb:630 smb:705 d:- ref:0 ; in:5437 out:5437 type:P dur:82000000 cpbdur:82000000 q:16.45 tex:28538 mv:2136 misc:1430 imb:21 pmb:628 smb:701 d:- ref:0 ; in:5438 out:5438 type:P dur:82000000 cpbdur:82000000 q:17.73 tex:28917 mv:2184 misc:1363 imb:16 pmb:644 smb:690 d:- ref:0 ; in:5439 out:5439 type:P dur:82000000 cpbdur:82000000 q:16.25 tex:36580 mv:2940 misc:1568 imb:35 pmb:834 smb:481 d:- ref:0 ; in:5440 out:5440 type:P dur:82000000 cpbdur:82000000 q:16.48 tex:24691 mv:2339 misc:1506 imb:32 pmb:639 smb:679 d:- ref:0 ; in:5441 out:5441 type:P dur:82000000 cpbdur:82000000 q:15.26 tex:26406 mv:2430 misc:1500 imb:31 pmb:608 smb:711 d:- ref:0 ; in:5442 out:5442 type:P dur:82000000 cpbdur:82000000 q:16.25 tex:32142 mv:2322 misc:1488 imb:25 pmb:682 smb:643 d:- ref:0 ; in:5443 out:5443 type:P dur:82000000 cpbdur:82000000 q:17.45 tex:29005 mv:2347 misc:1496 imb:15 pmb:719 smb:616 d:- ref:0 ; in:5444 out:5444 type:P dur:82000000 cpbdur:82000000 q:17.53 tex:30740 mv:1650 misc:1122 imb:6 pmb:476 smb:868 d:- ref:0 ; in:5445 out:5445 type:P dur:82000000 cpbdur:82000000 q:16.45 tex:63384 mv:3307 misc:1549 imb:33 pmb:959 smb:358 d:- ref:0 ; in:5446 out:5446 type:P dur:82000000 cpbdur:82000000 q:16.71 tex:12648 mv:1738 misc:1398 imb:9 pmb:524 smb:817 d:- ref:0 ; in:5447 out:5447 type:P dur:82000000 cpbdur:82000000 q:16.53 tex:25364 mv:1757 misc:1255 imb:10 pmb:505 smb:835 d:- ref:0 ; in:5448 out:5448 type:P dur:82000000 cpbdur:82000000 q:17.37 tex:36487 mv:2245 misc:1332 imb:18 pmb:641 smb:691 d:- ref:0 ; in:5449 out:5449 type:P dur:82000000 cpbdur:82000000 q:18.32 tex:37936 mv:2061 misc:1275 imb:14 pmb:619 smb:717 d:- ref:0 ; in:5450 out:5450 type:P dur:82000000 cpbdur:82000000 q:16.94 tex:25596 mv:2015 misc:1437 imb:16 pmb:591 smb:743 d:- ref:0 ; in:5451 out:5451 type:P dur:82000000 cpbdur:82000000 q:16.21 tex:48411 mv:3330 misc:1531 imb:27 pmb:990 smb:333 d:- ref:0 ; in:5452 out:5452 type:P dur:82000000 cpbdur:82000000 q:15.77 tex:19872 mv:1774 misc:1434 imb:13 pmb:526 smb:811 d:- ref:0 ; in:5453 out:5453 type:P dur:82000000 cpbdur:82000000 q:14.29 tex:81569 mv:3787 misc:1532 imb:12 pmb:1105 smb:233 d:- ref:0 ; in:5454 out:5454 type:P dur:82000000 cpbdur:82000000 q:18.29 tex:566271 mv:17601 misc:1416 imb:1213 pmb:137 smb:0 d:- ref:0 ; in:5455 out:5455 type:P dur:82000000 cpbdur:82000000 q:22.29 tex:156562 mv:4862 misc:1216 imb:44 pmb:778 smb:528 d:- ref:0 ; in:5456 out:5456 type:P dur:82000000 cpbdur:82000000 q:25.50 tex:75154 mv:4647 misc:1207 imb:40 pmb:703 smb:607 d:- ref:0 ; in:5457 out:5457 type:P dur:82000000 cpbdur:82000000 q:25.11 tex:103796 mv:4573 misc:1279 imb:41 pmb:791 smb:518 d:- ref:0 ; in:5458 out:5458 type:P dur:82000000 cpbdur:82000000 q:23.73 tex:53092 mv:3025 misc:1275 imb:23 pmb:741 smb:586 d:- ref:0 ; in:5459 out:5459 type:P dur:82000000 cpbdur:82000000 q:23.56 tex:75990 mv:3906 misc:1352 imb:50 pmb:788 smb:512 d:- ref:0 ; in:5460 out:5460 type:P dur:82000000 cpbdur:82000000 q:24.06 tex:113659 mv:6049 misc:1380 imb:107 pmb:805 smb:438 d:- ref:0 ; in:5461 out:5461 type:P dur:82000000 cpbdur:82000000 q:23.09 tex:68780 mv:4505 misc:1443 imb:104 pmb:813 smb:433 d:- ref:0 ; in:5462 out:5462 type:P dur:82000000 cpbdur:82000000 q:23.79 tex:95553 mv:5129 misc:1294 imb:63 pmb:795 smb:492 d:- ref:0 ; in:5463 out:5463 type:P dur:82000000 cpbdur:82000000 q:24.04 tex:95633 mv:5567 misc:1288 imb:79 pmb:773 smb:498 d:- ref:0 ; in:5464 out:5464 type:P dur:82000000 cpbdur:82000000 q:22.66 tex:46406 mv:3251 misc:1375 imb:46 pmb:765 smb:539 d:- ref:0 ; in:5465 out:5465 type:P dur:82000000 cpbdur:82000000 q:23.73 tex:104643 mv:5651 misc:1322 imb:91 pmb:789 smb:470 d:- ref:0 ; in:5466 out:5466 type:P dur:82000000 cpbdur:82000000 q:22.04 tex:77327 mv:4441 misc:1480 imb:120 pmb:911 smb:319 d:- ref:0 ; in:5467 out:5467 type:P dur:82000000 cpbdur:82000000 q:21.24 tex:70571 mv:4134 misc:1471 imb:70 pmb:914 smb:366 d:- ref:0 ; in:5468 out:5468 type:P dur:82000000 cpbdur:82000000 q:22.17 tex:91492 mv:4035 misc:1297 imb:12 pmb:785 smb:553 d:- ref:0 ; in:5469 out:5469 type:P dur:82000000 cpbdur:82000000 q:23.12 tex:90277 mv:4827 misc:1320 imb:47 pmb:821 smb:482 d:- ref:0 ; in:5470 out:5470 type:P dur:82000000 cpbdur:82000000 q:23.29 tex:87086 mv:4566 misc:1356 imb:78 pmb:774 smb:498 d:- ref:0 ; in:5471 out:5471 type:P dur:82000000 cpbdur:82000000 q:23.66 tex:78632 mv:4273 misc:1319 imb:46 pmb:745 smb:559 d:- ref:0 ; in:5472 out:5472 type:P dur:82000000 cpbdur:82000000 q:23.85 tex:91464 mv:4541 misc:1259 imb:27 pmb:811 smb:512 d:- ref:0 ; in:5473 out:5473 type:P dur:82000000 cpbdur:82000000 q:22.83 tex:56936 mv:3349 misc:1395 imb:45 pmb:771 smb:534 d:- ref:0 ; in:5474 out:5474 type:P dur:82000000 cpbdur:82000000 q:23.36 tex:99714 mv:4885 misc:1329 imb:86 pmb:771 smb:493 d:- ref:0 ; in:5475 out:5475 type:P dur:82000000 cpbdur:82000000 q:22.92 tex:73441 mv:3691 misc:1332 imb:41 pmb:801 smb:508 d:- ref:0 ; in:5476 out:5476 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:83236 mv:4198 misc:1302 imb:50 pmb:794 smb:506 d:- ref:0 ; in:5477 out:5477 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:63502 mv:3954 misc:1304 imb:33 pmb:776 smb:541 d:- ref:0 ; in:5478 out:5478 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:74075 mv:3806 misc:1295 imb:15 pmb:808 smb:527 d:- ref:0 ; in:5479 out:5479 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:86384 mv:5078 misc:1266 imb:60 pmb:746 smb:544 d:- ref:0 ; in:5480 out:5480 type:P dur:82000000 cpbdur:82000000 q:23.30 tex:77228 mv:4302 misc:1326 imb:30 pmb:822 smb:498 d:- ref:0 ; in:5481 out:5481 type:P dur:82000000 cpbdur:82000000 q:23.70 tex:85822 mv:5096 misc:1250 imb:58 pmb:752 smb:540 d:- ref:0 ; in:5482 out:5482 type:P dur:82000000 cpbdur:82000000 q:22.53 tex:41063 mv:3046 misc:1371 imb:31 pmb:708 smb:611 d:- ref:0 ; in:5483 out:5483 type:P dur:82000000 cpbdur:82000000 q:23.35 tex:109398 mv:5105 misc:1289 imb:66 pmb:805 smb:479 d:- ref:0 ; in:5484 out:5484 type:P dur:82000000 cpbdur:82000000 q:22.57 tex:45288 mv:3169 misc:1327 imb:23 pmb:697 smb:630 d:- ref:0 ; in:5485 out:5485 type:P dur:82000000 cpbdur:82000000 q:23.39 tex:108564 mv:5160 misc:1348 imb:98 pmb:810 smb:442 d:- ref:0 ; in:5486 out:5486 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:76929 mv:4658 misc:1253 imb:73 pmb:708 smb:569 d:- ref:0 ; in:5487 out:5487 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:89066 mv:4819 misc:1323 imb:62 pmb:819 smb:469 d:- ref:0 ; in:5488 out:5488 type:P dur:82000000 cpbdur:82000000 q:23.79 tex:88499 mv:5205 misc:1296 imb:69 pmb:781 smb:500 d:- ref:0 ; in:5489 out:5489 type:P dur:82000000 cpbdur:82000000 q:22.64 tex:59024 mv:3437 misc:1395 imb:36 pmb:797 smb:517 d:- ref:0 ; in:5490 out:5490 type:P dur:82000000 cpbdur:82000000 q:23.47 tex:103844 mv:5084 misc:1336 imb:82 pmb:804 smb:464 d:- ref:0 ; in:5491 out:5491 type:P dur:82000000 cpbdur:82000000 q:21.80 tex:51586 mv:3789 misc:1465 imb:61 pmb:861 smb:428 d:- ref:0 ; in:5492 out:5492 type:P dur:82000000 cpbdur:82000000 q:23.29 tex:110895 mv:5050 misc:1295 imb:81 pmb:792 smb:477 d:- ref:0 ; in:5493 out:5493 type:P dur:82000000 cpbdur:82000000 q:22.85 tex:56074 mv:3361 misc:1325 imb:31 pmb:685 smb:634 d:- ref:0 ; in:5494 out:5494 type:P dur:82000000 cpbdur:82000000 q:21.18 tex:66595 mv:4146 misc:1483 imb:100 pmb:932 smb:318 d:- ref:0 ; in:5495 out:5495 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:64582 mv:3748 misc:1358 imb:57 pmb:730 smb:563 d:- ref:0 ; in:5496 out:5496 type:P dur:82000000 cpbdur:82000000 q:21.84 tex:67392 mv:4169 misc:1367 imb:79 pmb:709 smb:562 d:- ref:0 ; in:5497 out:5497 type:P dur:82000000 cpbdur:82000000 q:21.13 tex:57981 mv:3449 misc:1442 imb:44 pmb:835 smb:471 d:- ref:0 ; in:5498 out:5498 type:P dur:82000000 cpbdur:82000000 q:22.92 tex:106444 mv:4962 misc:1290 imb:52 pmb:818 smb:480 d:- ref:0 ; in:5499 out:5499 type:P dur:82000000 cpbdur:82000000 q:22.84 tex:69915 mv:3867 misc:1314 imb:43 pmb:761 smb:546 d:- ref:0 ; in:5500 out:5500 type:I dur:82000000 cpbdur:82000000 q:19.28 tex:495054 mv:14140 misc:374 imb:1350 pmb:0 smb:0 d:- ref:; in:5501 out:5501 type:P dur:82000000 cpbdur:82000000 q:26.58 tex:59461 mv:4196 misc:1215 imb:55 pmb:692 smb:603 d:- ref:0 ; in:5502 out:5502 type:P dur:82000000 cpbdur:82000000 q:25.60 tex:56655 mv:4408 misc:1249 imb:57 pmb:668 smb:625 d:- ref:0 ; in:5503 out:5503 type:P dur:82000000 cpbdur:82000000 q:23.98 tex:39957 mv:2751 misc:1300 imb:5 pmb:693 smb:652 d:- ref:0 ; in:5504 out:5504 type:P dur:82000000 cpbdur:82000000 q:23.62 tex:70708 mv:4033 misc:1283 imb:66 pmb:667 smb:617 d:- ref:0 ; in:5505 out:5505 type:P dur:82000000 cpbdur:82000000 q:22.18 tex:49542 mv:3820 misc:1430 imb:50 pmb:858 smb:442 d:- ref:0 ; in:5506 out:5506 type:P dur:82000000 cpbdur:82000000 q:21.03 tex:38354 mv:3127 misc:1479 imb:40 pmb:757 smb:553 d:- ref:0 ; in:5507 out:5507 type:P dur:82000000 cpbdur:82000000 q:23.03 tex:113515 mv:5523 misc:1274 imb:65 pmb:805 smb:480 d:- ref:0 ; in:5508 out:5508 type:P dur:82000000 cpbdur:82000000 q:22.80 tex:59016 mv:3858 misc:1286 imb:18 pmb:730 smb:602 d:- ref:0 ; in:5509 out:5509 type:P dur:82000000 cpbdur:82000000 q:21.64 tex:41737 mv:3010 misc:1389 imb:25 pmb:748 smb:577 d:- ref:0 ; in:5510 out:5510 type:P dur:82000000 cpbdur:82000000 q:23.25 tex:111514 mv:5743 misc:1303 imb:82 pmb:801 smb:467 d:- ref:0 ; in:5511 out:5511 type:P dur:82000000 cpbdur:82000000 q:22.84 tex:60868 mv:3713 misc:1283 imb:10 pmb:729 smb:611 d:- ref:0 ; in:5512 out:5512 type:P dur:82000000 cpbdur:82000000 q:22.25 tex:70991 mv:3882 misc:1391 imb:40 pmb:840 smb:470 d:- ref:0 ; in:5513 out:5513 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:106858 mv:5222 misc:1296 imb:72 pmb:786 smb:492 d:- ref:0 ; in:5514 out:5514 type:P dur:82000000 cpbdur:82000000 q:22.97 tex:62906 mv:3779 misc:1323 imb:13 pmb:759 smb:578 d:- ref:0 ; in:5515 out:5515 type:P dur:82000000 cpbdur:82000000 q:23.03 tex:69320 mv:4155 misc:1301 imb:77 pmb:609 smb:664 d:- ref:0 ; in:5516 out:5516 type:P dur:82000000 cpbdur:82000000 q:23.53 tex:83984 mv:4880 misc:1280 imb:78 pmb:742 smb:530 d:- ref:0 ; in:5517 out:5517 type:P dur:82000000 cpbdur:82000000 q:23.07 tex:71057 mv:3511 misc:1352 imb:34 pmb:799 smb:517 d:- ref:0 ; in:5518 out:5518 type:P dur:82000000 cpbdur:82000000 q:22.35 tex:82354 mv:3936 misc:1430 imb:49 pmb:880 smb:421 d:- ref:0 ; in:5519 out:5519 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:110850 mv:5467 misc:1275 imb:57 pmb:813 smb:480 d:- ref:0 ; in:5520 out:5520 type:P dur:82000000 cpbdur:82000000 q:23.10 tex:67029 mv:3989 misc:1326 imb:39 pmb:757 smb:554 d:- ref:0 ; in:5521 out:5521 type:P dur:82000000 cpbdur:82000000 q:21.81 tex:49125 mv:3717 misc:1430 imb:52 pmb:821 smb:477 d:- ref:0 ; in:5522 out:5522 type:P dur:82000000 cpbdur:82000000 q:21.75 tex:60499 mv:3904 misc:1429 imb:72 pmb:700 smb:578 d:- ref:0 ; in:5523 out:5523 type:P dur:82000000 cpbdur:82000000 q:21.32 tex:79753 mv:4294 misc:1457 imb:59 pmb:866 smb:425 d:- ref:0 ; in:5524 out:5524 type:P dur:82000000 cpbdur:82000000 q:20.60 tex:37344 mv:3131 misc:1453 imb:43 pmb:715 smb:592 d:- ref:0 ; in:5525 out:5525 type:P dur:82000000 cpbdur:82000000 q:21.70 tex:72989 mv:4010 misc:1361 imb:70 pmb:662 smb:618 d:- ref:0 ; in:5526 out:5526 type:P dur:82000000 cpbdur:82000000 q:22.71 tex:76177 mv:4190 misc:1361 imb:70 pmb:710 smb:570 d:- ref:0 ; in:5527 out:5527 type:P dur:82000000 cpbdur:82000000 q:22.65 tex:74273 mv:4015 misc:1344 imb:58 pmb:775 smb:517 d:- ref:0 ; in:5528 out:5528 type:P dur:82000000 cpbdur:82000000 q:21.94 tex:62824 mv:3781 misc:1419 imb:44 pmb:843 smb:463 d:- ref:0 ; in:5529 out:5529 type:P dur:82000000 cpbdur:82000000 q:22.38 tex:76989 mv:3571 misc:1376 imb:20 pmb:811 smb:519 d:- ref:0 ; in:5530 out:5530 type:P dur:82000000 cpbdur:82000000 q:21.86 tex:61723 mv:3833 misc:1388 imb:49 pmb:759 smb:542 d:- ref:0 ; in:5531 out:5531 type:P dur:82000000 cpbdur:82000000 q:21.28 tex:58434 mv:3648 misc:1486 imb:52 pmb:834 smb:464 d:- ref:0 ; in:5532 out:5532 type:P dur:82000000 cpbdur:82000000 q:22.15 tex:89268 mv:3812 misc:1304 imb:11 pmb:794 smb:545 d:- ref:0 ; in:5533 out:5533 type:P dur:82000000 cpbdur:82000000 q:22.09 tex:74861 mv:3798 misc:1357 imb:32 pmb:804 smb:514 d:- ref:0 ; in:5534 out:5534 type:P dur:82000000 cpbdur:82000000 q:23.32 tex:111349 mv:5412 misc:1319 imb:73 pmb:794 smb:483 d:- ref:0 ; in:5535 out:5535 type:P dur:82000000 cpbdur:82000000 q:21.83 tex:45224 mv:3213 misc:1387 imb:30 pmb:819 smb:501 d:- ref:0 ; in:5536 out:5536 type:P dur:82000000 cpbdur:82000000 q:23.08 tex:101789 mv:4931 misc:1312 imb:97 pmb:715 smb:538 d:- ref:0 ; in:5537 out:5537 type:P dur:82000000 cpbdur:82000000 q:24.37 tex:130897 mv:6170 misc:1285 imb:93 pmb:814 smb:443 d:- ref:0 ; in:5538 out:5538 type:P dur:82000000 cpbdur:82000000 q:28.37 tex:273690 mv:16323 misc:1419 imb:1155 pmb:195 smb:0 d:- ref:0 ; in:5539 out:5539 type:P dur:82000000 cpbdur:82000000 q:27.22 tex:57741 mv:5090 misc:1337 imb:43 pmb:768 smb:539 d:- ref:0 ; in:5540 out:5540 type:P dur:82000000 cpbdur:82000000 q:25.74 tex:61931 mv:4794 misc:1355 imb:50 pmb:784 smb:516 d:- ref:0 ; in:5541 out:5541 type:P dur:82000000 cpbdur:82000000 q:25.06 tex:95959 mv:7225 misc:1440 imb:86 pmb:935 smb:329 d:- ref:0 ; in:5542 out:5542 type:P dur:82000000 cpbdur:82000000 q:24.04 tex:75590 mv:5311 misc:1491 imb:70 pmb:899 smb:381 d:- ref:0 ; in:5543 out:5543 type:P dur:82000000 cpbdur:82000000 q:23.65 tex:87116 mv:5799 misc:1445 imb:62 pmb:907 smb:381 d:- ref:0 ; in:5544 out:5544 type:P dur:82000000 cpbdur:82000000 q:22.83 tex:63926 mv:5006 misc:1508 imb:89 pmb:946 smb:315 d:- ref:0 ; in:5545 out:5545 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:116424 mv:6753 misc:1431 imb:64 pmb:975 smb:311 d:- ref:0 ; in:5546 out:5546 type:P dur:82000000 cpbdur:82000000 q:23.20 tex:89387 mv:5910 misc:1495 imb:67 pmb:1014 smb:269 d:- ref:0 ; in:5547 out:5547 type:P dur:82000000 cpbdur:82000000 q:23.39 tex:104220 mv:5871 misc:1437 imb:54 pmb:949 smb:347 d:- ref:0 ; in:5548 out:5548 type:P dur:82000000 cpbdur:82000000 q:22.79 tex:64539 mv:5177 misc:1516 imb:67 pmb:963 smb:320 d:- ref:0 ; in:5549 out:5549 type:P dur:82000000 cpbdur:82000000 q:23.27 tex:103676 mv:6637 misc:1439 imb:55 pmb:997 smb:298 d:- ref:0 ; in:5550 out:5550 type:P dur:82000000 cpbdur:82000000 q:23.62 tex:82813 mv:6967 misc:1444 imb:45 pmb:927 smb:378 d:- ref:0 ; in:5551 out:5551 type:P dur:82000000 cpbdur:82000000 q:23.01 tex:74738 mv:5320 misc:1510 imb:75 pmb:1022 smb:253 d:- ref:0 ; in:5552 out:5552 type:P dur:82000000 cpbdur:82000000 q:23.16 tex:86339 mv:6417 misc:1492 imb:64 pmb:1021 smb:265 d:- ref:0 ; in:5553 out:5553 type:P dur:82000000 cpbdur:82000000 q:23.60 tex:81140 mv:6660 misc:1432 imb:54 pmb:904 smb:392 d:- ref:0 ; in:5554 out:5554 type:P dur:82000000 cpbdur:82000000 q:23.74 tex:75596 mv:6841 misc:1475 imb:77 pmb:927 smb:346 d:- ref:0 ; in:5555 out:5555 type:P dur:82000000 cpbdur:82000000 q:23.57 tex:79469 mv:6660 misc:1471 imb:83 pmb:950 smb:317 d:- ref:0 ; in:5556 out:5556 type:P dur:82000000 cpbdur:82000000 q:22.94 tex:79800 mv:5805 misc:1507 imb:88 pmb:997 smb:265 d:- ref:0 ; in:5557 out:5557 type:P dur:82000000 cpbdur:82000000 q:22.57 tex:75058 mv:5186 misc:1500 imb:61 pmb:996 smb:293 d:- ref:0 ; in:5558 out:5558 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:76911 mv:5562 misc:1503 imb:67 pmb:950 smb:333 d:- ref:0 ; in:5559 out:5559 type:P dur:82000000 cpbdur:82000000 q:23.04 tex:93253 mv:6120 misc:1475 imb:72 pmb:924 smb:354 d:- ref:0 ; in:5560 out:5560 type:P dur:82000000 cpbdur:82000000 q:23.25 tex:80007 mv:6432 misc:1481 imb:64 pmb:904 smb:382 d:- ref:0 ; in:5561 out:5561 type:P dur:82000000 cpbdur:82000000 q:22.30 tex:74675 mv:5219 misc:1522 imb:70 pmb:1029 smb:251 d:- ref:0 ; in:5562 out:5562 type:P dur:82000000 cpbdur:82000000 q:22.80 tex:74465 mv:5265 misc:1470 imb:53 pmb:863 smb:434 d:- ref:0 ; in:5563 out:5563 type:P dur:82000000 cpbdur:82000000 q:22.08 tex:70649 mv:5577 misc:1510 imb:77 pmb:979 smb:294 d:- ref:0 ; in:5564 out:5564 type:P dur:82000000 cpbdur:82000000 q:22.95 tex:85580 mv:6554 misc:1426 imb:76 pmb:852 smb:422 d:- ref:0 ; in:5565 out:5565 type:P dur:82000000 cpbdur:82000000 q:21.97 tex:73876 mv:5669 misc:1495 imb:77 pmb:989 smb:284 d:- ref:0 ; in:5566 out:5566 type:P dur:82000000 cpbdur:82000000 q:21.67 tex:51078 mv:5676 misc:1518 imb:103 pmb:932 smb:315 d:- ref:0 ; in:5567 out:5567 type:P dur:82000000 cpbdur:82000000 q:21.06 tex:67896 mv:5618 misc:1510 imb:86 pmb:1040 smb:224 d:- ref:0 ; in:5568 out:5568 type:P dur:82000000 cpbdur:82000000 q:22.41 tex:96647 mv:6927 misc:1498 imb:115 pmb:949 smb:286 d:- ref:0 ; in:5569 out:5569 type:P dur:82000000 cpbdur:82000000 q:22.12 tex:68460 mv:5499 misc:1497 imb:78 pmb:895 smb:377 d:- ref:0 ; in:5570 out:5570 type:P dur:82000000 cpbdur:82000000 q:22.95 tex:79433 mv:6843 misc:1444 imb:108 pmb:813 smb:429 d:- ref:0 ; in:5571 out:5571 type:P dur:82000000 cpbdur:82000000 q:22.72 tex:62309 mv:5497 misc:1466 imb:88 pmb:791 smb:471 d:- ref:0 ; in:5572 out:5572 type:P dur:82000000 cpbdur:82000000 q:22.94 tex:80077 mv:6821 misc:1454 imb:96 pmb:825 smb:429 d:- ref:0 ; in:5573 out:5573 type:P dur:82000000 cpbdur:82000000 q:22.39 tex:76029 mv:6255 misc:1500 imb:110 pmb:983 smb:257 d:- ref:0 ; in:5574 out:5574 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:75052 mv:5583 misc:1453 imb:74 pmb:769 smb:507 d:- ref:0 ; in:5575 out:5575 type:P dur:82000000 cpbdur:82000000 q:22.12 tex:65427 mv:5921 misc:1516 imb:114 pmb:969 smb:267 d:- ref:0 ; in:5576 out:5576 type:P dur:82000000 cpbdur:82000000 q:21.36 tex:65171 mv:5347 misc:1514 imb:111 pmb:1001 smb:238 d:- ref:0 ; in:5577 out:5577 type:P dur:82000000 cpbdur:82000000 q:21.49 tex:82448 mv:5880 misc:1504 imb:81 pmb:976 smb:293 d:- ref:0 ; in:5578 out:5578 type:P dur:82000000 cpbdur:82000000 q:21.99 tex:72415 mv:5639 misc:1474 imb:87 pmb:805 smb:458 d:- ref:0 ; in:5579 out:5579 type:P dur:82000000 cpbdur:82000000 q:22.28 tex:82352 mv:6543 misc:1513 imb:107 pmb:873 smb:370 d:- ref:0 ; in:5580 out:5580 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:62805 mv:5820 misc:1439 imb:86 pmb:752 smb:512 d:- ref:0 ; in:5581 out:5581 type:P dur:82000000 cpbdur:82000000 q:22.81 tex:67132 mv:6086 misc:1422 imb:97 pmb:762 smb:491 d:- ref:0 ; in:5582 out:5582 type:P dur:82000000 cpbdur:82000000 q:22.91 tex:72993 mv:7199 misc:1488 imb:129 pmb:801 smb:420 d:- ref:0 ; in:5583 out:5583 type:P dur:82000000 cpbdur:82000000 q:22.99 tex:75152 mv:6692 misc:1412 imb:121 pmb:742 smb:487 d:- ref:0 ; in:5584 out:5584 type:P dur:82000000 cpbdur:82000000 q:22.55 tex:51514 mv:5627 misc:1483 imb:127 pmb:791 smb:432 d:- ref:0 ; in:5585 out:5585 type:P dur:82000000 cpbdur:82000000 q:22.65 tex:73659 mv:6408 misc:1453 imb:118 pmb:802 smb:430 d:- ref:0 ; in:5586 out:5586 type:P dur:82000000 cpbdur:82000000 q:21.94 tex:76080 mv:6072 misc:1520 imb:121 pmb:932 smb:297 d:- ref:0 ; in:5587 out:5587 type:P dur:82000000 cpbdur:82000000 q:21.56 tex:51758 mv:5484 misc:1550 imb:106 pmb:862 smb:382 d:- ref:0 ; in:5588 out:5588 type:P dur:82000000 cpbdur:82000000 q:20.97 tex:64870 mv:5566 misc:1524 imb:85 pmb:988 smb:277 d:- ref:0 ; in:5589 out:5589 type:P dur:82000000 cpbdur:82000000 q:22.07 tex:83195 mv:7281 misc:1508 imb:116 pmb:923 smb:311 d:- ref:0 ; in:5590 out:5590 type:P dur:82000000 cpbdur:82000000 q:22.32 tex:76658 mv:6572 misc:1506 imb:95 pmb:912 smb:343 d:- ref:0 ; in:5591 out:5591 type:P dur:82000000 cpbdur:82000000 q:21.92 tex:58420 mv:5967 misc:1509 imb:102 pmb:891 smb:357 d:- ref:0 ; in:5592 out:5592 type:P dur:82000000 cpbdur:82000000 q:22.54 tex:66596 mv:6226 misc:1450 imb:103 pmb:746 smb:501 d:- ref:0 ; in:5593 out:5593 type:P dur:82000000 cpbdur:82000000 q:21.91 tex:64619 mv:6207 misc:1518 imb:110 pmb:909 smb:331 d:- ref:0 ; in:5594 out:5594 type:P dur:82000000 cpbdur:82000000 q:22.60 tex:68708 mv:6433 misc:1499 imb:111 pmb:823 smb:416 d:- ref:0 ; in:5595 out:5595 type:P dur:82000000 cpbdur:82000000 q:22.38 tex:84223 mv:7253 misc:1484 imb:114 pmb:983 smb:253 d:- ref:0 ; in:5596 out:5596 type:P dur:82000000 cpbdur:82000000 q:22.48 tex:86809 mv:6871 misc:1496 imb:95 pmb:897 smb:358 d:- ref:0 ; in:5597 out:5597 type:P dur:82000000 cpbdur:82000000 q:22.44 tex:69862 mv:6734 misc:1524 imb:105 pmb:950 smb:295 d:- ref:0 ; in:5598 out:5598 type:P dur:82000000 cpbdur:82000000 q:21.90 tex:45122 mv:5319 misc:1511 imb:76 pmb:867 smb:407 d:- ref:0 ; in:5599 out:5599 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:72660 mv:7077 misc:1447 imb:106 pmb:829 smb:415 d:- ref:0 ; in:5600 out:5600 type:P dur:82000000 cpbdur:82000000 q:22.59 tex:57552 mv:5906 misc:1478 imb:79 pmb:862 smb:409 d:- ref:0 ; in:5601 out:5601 type:P dur:82000000 cpbdur:82000000 q:23.01 tex:80702 mv:7968 misc:1466 imb:124 pmb:858 smb:368 d:- ref:0 ; in:5602 out:5602 type:P dur:82000000 cpbdur:82000000 q:23.06 tex:72601 mv:7205 misc:1450 imb:106 pmb:801 smb:443 d:- ref:0 ; in:5603 out:5603 type:P dur:82000000 cpbdur:82000000 q:22.27 tex:59970 mv:6144 misc:1518 imb:112 pmb:962 smb:276 d:- ref:0 ; in:5604 out:5604 type:P dur:82000000 cpbdur:82000000 q:21.95 tex:58838 mv:5630 misc:1500 imb:81 pmb:890 smb:379 d:- ref:0 ; in:5605 out:5605 type:P dur:82000000 cpbdur:82000000 q:22.18 tex:72434 mv:6542 misc:1512 imb:97 pmb:944 smb:309 d:- ref:0 ; in:5606 out:5606 type:P dur:82000000 cpbdur:82000000 q:22.03 tex:73775 mv:6352 misc:1521 imb:101 pmb:886 smb:363 d:- ref:0 ; in:5607 out:5607 type:P dur:82000000 cpbdur:82000000 q:21.59 tex:61263 mv:5608 misc:1513 imb:91 pmb:906 smb:353 d:- ref:0 ; in:5608 out:5608 type:P dur:82000000 cpbdur:82000000 q:22.22 tex:77883 mv:7708 misc:1529 imb:125 pmb:896 smb:329 d:- ref:0 ; in:5609 out:5609 type:P dur:82000000 cpbdur:82000000 q:21.87 tex:61596 mv:5792 misc:1532 imb:75 pmb:880 smb:395 d:- ref:0 ; in:5610 out:5610 type:P dur:82000000 cpbdur:82000000 q:22.31 tex:72703 mv:7078 misc:1499 imb:106 pmb:828 smb:416 d:- ref:0 ; in:5611 out:5611 type:P dur:82000000 cpbdur:82000000 q:22.18 tex:57518 mv:6524 misc:1510 imb:100 pmb:904 smb:346 d:- ref:0 ; in:5612 out:5612 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:79446 mv:7388 misc:1518 imb:129 pmb:838 smb:383 d:- ref:0 ; in:5613 out:5613 type:P dur:82000000 cpbdur:82000000 q:22.39 tex:71493 mv:7041 misc:1506 imb:105 pmb:877 smb:368 d:- ref:0 ; in:5614 out:5614 type:P dur:82000000 cpbdur:82000000 q:22.45 tex:70553 mv:7099 misc:1524 imb:115 pmb:827 smb:408 d:- ref:0 ; in:5615 out:5615 type:P dur:82000000 cpbdur:82000000 q:21.71 tex:37813 mv:5197 misc:1550 imb:103 pmb:793 smb:454 d:- ref:0 ; in:5616 out:5616 type:P dur:82000000 cpbdur:82000000 q:21.91 tex:68480 mv:5857 misc:1471 imb:96 pmb:843 smb:411 d:- ref:0 ; in:5617 out:5617 type:P dur:82000000 cpbdur:82000000 q:21.58 tex:57357 mv:5756 misc:1487 imb:86 pmb:846 smb:418 d:- ref:0 ; in:5618 out:5618 type:P dur:82000000 cpbdur:82000000 q:22.15 tex:71277 mv:6979 misc:1512 imb:112 pmb:841 smb:397 d:- ref:0 ; in:5619 out:5619 type:P dur:82000000 cpbdur:82000000 q:21.16 tex:53606 mv:5705 misc:1553 imb:102 pmb:959 smb:289 d:- ref:0 ; in:5620 out:5620 type:P dur:82000000 cpbdur:82000000 q:22.06 tex:71598 mv:7216 misc:1538 imb:114 pmb:826 smb:410 d:- ref:0 ; in:5621 out:5621 type:P dur:82000000 cpbdur:82000000 q:22.39 tex:73486 mv:7107 misc:1503 imb:110 pmb:815 smb:425 d:- ref:0 ; in:5622 out:5622 type:P dur:82000000 cpbdur:82000000 q:21.48 tex:56422 mv:5808 misc:1546 imb:100 pmb:964 smb:286 d:- ref:0 ; in:5623 out:5623 type:P dur:82000000 cpbdur:82000000 q:22.14 tex:70593 mv:6524 misc:1515 imb:85 pmb:882 smb:383 d:- ref:0 ; in:5624 out:5624 type:P dur:82000000 cpbdur:82000000 q:22.13 tex:69428 mv:6704 misc:1492 imb:108 pmb:838 smb:404 d:- ref:0 ; in:5625 out:5625 type:P dur:82000000 cpbdur:82000000 q:22.25 tex:73895 mv:6797 misc:1492 imb:96 pmb:887 smb:367 d:- ref:0 ; in:5626 out:5626 type:P dur:82000000 cpbdur:82000000 q:21.66 tex:41290 mv:5855 misc:1543 imb:105 pmb:879 smb:366 d:- ref:0 ; in:5627 out:5627 type:P dur:82000000 cpbdur:82000000 q:22.37 tex:84831 mv:7464 misc:1497 imb:104 pmb:896 smb:350 d:- ref:0 ; in:5628 out:5628 type:P dur:82000000 cpbdur:82000000 q:21.44 tex:60574 mv:5894 misc:1524 imb:106 pmb:1012 smb:232 d:- ref:0 ; in:5629 out:5629 type:P dur:82000000 cpbdur:82000000 q:22.43 tex:81733 mv:7580 misc:1511 imb:100 pmb:924 smb:326 d:- ref:0 ; in:5630 out:5630 type:P dur:82000000 cpbdur:82000000 q:22.08 tex:65814 mv:5851 misc:1487 imb:85 pmb:853 smb:412 d:- ref:0 ; in:5631 out:5631 type:P dur:82000000 cpbdur:82000000 q:22.08 tex:76042 mv:6177 misc:1485 imb:109 pmb:865 smb:376 d:- ref:0 ; in:5632 out:5632 type:P dur:82000000 cpbdur:82000000 q:21.80 tex:56840 mv:5974 misc:1538 imb:80 pmb:926 smb:344 d:- ref:0 ; in:5633 out:5633 type:P dur:82000000 cpbdur:82000000 q:21.38 tex:74351 mv:5800 misc:1537 imb:76 pmb:1008 smb:266 d:- ref:0 ; in:5634 out:5634 type:P dur:82000000 cpbdur:82000000 q:21.39 tex:58633 mv:6266 misc:1541 imb:114 pmb:986 smb:250 d:- ref:0 ; in:5635 out:5635 type:P dur:82000000 cpbdur:82000000 q:22.06 tex:71409 mv:6482 misc:1485 imb:79 pmb:816 smb:455 d:- ref:0 ; in:5636 out:5636 type:P dur:82000000 cpbdur:82000000 q:21.16 tex:52557 mv:5218 misc:1545 imb:90 pmb:954 smb:306 d:- ref:0 ; in:5637 out:5637 type:P dur:82000000 cpbdur:82000000 q:22.17 tex:76666 mv:7540 misc:1514 imb:129 pmb:872 smb:349 d:- ref:0 ; in:5638 out:5638 type:P dur:82000000 cpbdur:82000000 q:21.63 tex:51291 mv:5354 misc:1475 imb:101 pmb:798 smb:451 d:- ref:0 ; in:5639 out:5639 type:P dur:82000000 cpbdur:82000000 q:22.06 tex:74452 mv:6451 misc:1481 imb:87 pmb:819 smb:444 d:- ref:0 ; in:5640 out:5640 type:P dur:82000000 cpbdur:82000000 q:21.81 tex:47702 mv:6232 misc:1506 imb:128 pmb:842 smb:380 d:- ref:0 ; in:5641 out:5641 type:P dur:82000000 cpbdur:82000000 q:22.01 tex:63610 mv:6039 misc:1471 imb:94 pmb:791 smb:465 d:- ref:0 ; in:5642 out:5642 type:P dur:82000000 cpbdur:82000000 q:22.07 tex:57483 mv:6081 misc:1500 imb:83 pmb:739 smb:528 d:- ref:0 ; in:5643 out:5643 type:P dur:82000000 cpbdur:82000000 q:21.96 tex:51107 mv:5983 misc:1526 imb:117 pmb:839 smb:394 d:- ref:0 ; in:5644 out:5644 type:P dur:82000000 cpbdur:82000000 q:21.77 tex:55857 mv:5892 misc:1491 imb:100 pmb:760 smb:490 d:- ref:0 ; in:5645 out:5645 type:P dur:82000000 cpbdur:82000000 q:21.33 tex:62454 mv:6240 misc:1522 imb:121 pmb:920 smb:309 d:- ref:0 ; in:5646 out:5646 type:P dur:82000000 cpbdur:82000000 q:21.09 tex:37995 mv:5778 misc:1555 imb:143 pmb:856 smb:351 d:- ref:0 ; in:5647 out:5647 type:P dur:82000000 cpbdur:82000000 q:21.41 tex:64482 mv:6246 misc:1536 imb:149 pmb:854 smb:347 d:- ref:0 ; in:5648 out:5648 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:40233 mv:5353 misc:1566 imb:125 pmb:839 smb:386 d:- ref:0 ; in:5649 out:5649 type:P dur:82000000 cpbdur:82000000 q:21.83 tex:64207 mv:6513 misc:1520 imb:124 pmb:767 smb:459 d:- ref:0 ; in:5650 out:5650 type:P dur:82000000 cpbdur:82000000 q:21.87 tex:56556 mv:5862 misc:1478 imb:116 pmb:716 smb:518 d:- ref:0 ; in:5651 out:5651 type:P dur:82000000 cpbdur:82000000 q:21.77 tex:59708 mv:5468 misc:1480 imb:101 pmb:722 smb:527 d:- ref:0 ; in:5652 out:5652 type:P dur:82000000 cpbdur:82000000 q:21.97 tex:60514 mv:6353 misc:1493 imb:114 pmb:751 smb:485 d:- ref:0 ; in:5653 out:5653 type:P dur:82000000 cpbdur:82000000 q:22.14 tex:63333 mv:5972 misc:1503 imb:96 pmb:752 smb:502 d:- ref:0 ; in:5654 out:5654 type:P dur:82000000 cpbdur:82000000 q:21.47 tex:57876 mv:5945 misc:1547 imb:124 pmb:897 smb:329 d:- ref:0 ; in:5655 out:5655 type:P dur:82000000 cpbdur:82000000 q:21.27 tex:47248 mv:5698 misc:1550 imb:103 pmb:864 smb:383 d:- ref:0 ; in:5656 out:5656 type:P dur:82000000 cpbdur:82000000 q:21.12 tex:46289 mv:5519 misc:1536 imb:120 pmb:841 smb:389 d:- ref:0 ; in:5657 out:5657 type:P dur:82000000 cpbdur:82000000 q:21.74 tex:62769 mv:6250 misc:1453 imb:127 pmb:728 smb:495 d:- ref:0 ; in:5658 out:5658 type:P dur:82000000 cpbdur:82000000 q:20.84 tex:46129 mv:5303 misc:1528 imb:118 pmb:881 smb:351 d:- ref:0 ; in:5659 out:5659 type:P dur:82000000 cpbdur:82000000 q:21.78 tex:60467 mv:6346 misc:1443 imb:101 pmb:734 smb:515 d:- ref:0 ; in:5660 out:5660 type:P dur:82000000 cpbdur:82000000 q:21.55 tex:46771 mv:5575 misc:1478 imb:127 pmb:681 smb:542 d:- ref:0 ; in:5661 out:5661 type:P dur:82000000 cpbdur:82000000 q:21.34 tex:64735 mv:5974 misc:1539 imb:109 pmb:892 smb:349 d:- ref:0 ; in:5662 out:5662 type:P dur:82000000 cpbdur:82000000 q:21.10 tex:37503 mv:5026 misc:1551 imb:109 pmb:818 smb:423 d:- ref:0 ; in:5663 out:5663 type:P dur:82000000 cpbdur:82000000 q:21.57 tex:53458 mv:5606 misc:1472 imb:125 pmb:628 smb:597 d:- ref:0 ; in:5664 out:5664 type:P dur:82000000 cpbdur:82000000 q:20.70 tex:41889 mv:5493 misc:1554 imb:105 pmb:857 smb:388 d:- ref:0 ; in:5665 out:5665 type:P dur:82000000 cpbdur:82000000 q:21.66 tex:61026 mv:6230 misc:1440 imb:124 pmb:744 smb:482 d:- ref:0 ; in:5666 out:5666 type:P dur:82000000 cpbdur:82000000 q:21.78 tex:52096 mv:6043 misc:1501 imb:123 pmb:793 smb:434 d:- ref:0 ; in:5667 out:5667 type:P dur:82000000 cpbdur:82000000 q:22.02 tex:60557 mv:6205 misc:1462 imb:127 pmb:793 smb:430 d:- ref:0 ; in:5668 out:5668 type:P dur:82000000 cpbdur:82000000 q:21.16 tex:52418 mv:5498 misc:1532 imb:137 pmb:916 smb:297 d:- ref:0 ; in:5669 out:5669 type:P dur:82000000 cpbdur:82000000 q:21.80 tex:60194 mv:5892 misc:1466 imb:115 pmb:772 smb:463 d:- ref:0 ; in:5670 out:5670 type:P dur:82000000 cpbdur:82000000 q:21.97 tex:61184 mv:5905 misc:1447 imb:129 pmb:731 smb:490 d:- ref:0 ; in:5671 out:5671 type:P dur:82000000 cpbdur:82000000 q:22.11 tex:69156 mv:6298 misc:1466 imb:121 pmb:786 smb:443 d:- ref:0 ; in:5672 out:5672 type:P dur:82000000 cpbdur:82000000 q:21.93 tex:53761 mv:5751 misc:1512 imb:113 pmb:811 smb:426 d:- ref:0 ; in:5673 out:5673 type:P dur:82000000 cpbdur:82000000 q:22.00 tex:66488 mv:6173 misc:1499 imb:126 pmb:757 smb:467 d:- ref:0 ; in:5674 out:5674 type:P dur:82000000 cpbdur:82000000 q:21.42 tex:61267 mv:5518 misc:1527 imb:104 pmb:902 smb:344 d:- ref:0 ; in:5675 out:5675 type:P dur:82000000 cpbdur:82000000 q:21.14 tex:50040 mv:5126 misc:1538 imb:79 pmb:902 smb:369 d:- ref:0 ; in:5676 out:5676 type:P dur:82000000 cpbdur:82000000 q:21.03 tex:50854 mv:5332 misc:1542 imb:126 pmb:872 smb:352 d:- ref:0 ; in:5677 out:5677 type:P dur:82000000 cpbdur:82000000 q:21.94 tex:74522 mv:6551 misc:1431 imb:139 pmb:789 smb:422 d:- ref:0 ; in:5678 out:5678 type:P dur:82000000 cpbdur:82000000 q:21.07 tex:52169 mv:5357 misc:1506 imb:117 pmb:917 smb:316 d:- ref:0 ; in:5679 out:5679 type:P dur:82000000 cpbdur:82000000 q:22.06 tex:76173 mv:6804 misc:1471 imb:144 pmb:792 smb:414 d:- ref:0 ; in:5680 out:5680 type:P dur:82000000 cpbdur:82000000 q:22.33 tex:71051 mv:6545 misc:1500 imb:143 pmb:777 smb:430 d:- ref:0 ; in:5681 out:5681 type:P dur:82000000 cpbdur:82000000 q:22.55 tex:52239 mv:5983 misc:1498 imb:156 pmb:721 smb:473 d:- ref:0 ; in:5682 out:5682 type:P dur:82000000 cpbdur:82000000 q:22.47 tex:82505 mv:8099 misc:1500 imb:197 pmb:895 smb:258 d:- ref:0 ; in:5683 out:5683 type:P dur:82000000 cpbdur:82000000 q:22.65 tex:60106 mv:6021 misc:1417 imb:164 pmb:683 smb:503 d:- ref:0 ; in:5684 out:5684 type:P dur:82000000 cpbdur:82000000 q:22.17 tex:61514 mv:6827 misc:1491 imb:172 pmb:865 smb:313 d:- ref:0 ; in:5685 out:5685 type:P dur:82000000 cpbdur:82000000 q:22.31 tex:69818 mv:6547 misc:1531 imb:132 pmb:803 smb:415 d:- ref:0 ; in:5686 out:5686 type:P dur:82000000 cpbdur:82000000 q:21.66 tex:31137 mv:4646 misc:1537 imb:99 pmb:768 smb:483 d:- ref:0 ; in:5687 out:5687 type:P dur:82000000 cpbdur:82000000 q:21.93 tex:60325 mv:5559 misc:1500 imb:104 pmb:787 smb:459 d:- ref:0 ; in:5688 out:5688 type:P dur:82000000 cpbdur:82000000 q:21.39 tex:51128 mv:5790 misc:1530 imb:125 pmb:904 smb:321 d:- ref:0 ; in:5689 out:5689 type:P dur:82000000 cpbdur:82000000 q:21.93 tex:67117 mv:6018 misc:1449 imb:131 pmb:720 smb:499 d:- ref:0 ; in:5690 out:5690 type:P dur:82000000 cpbdur:82000000 q:21.15 tex:51546 mv:5305 misc:1533 imb:122 pmb:877 smb:351 d:- ref:0 ; in:5691 out:5691 type:P dur:82000000 cpbdur:82000000 q:21.35 tex:59832 mv:5993 misc:1543 imb:143 pmb:879 smb:328 d:- ref:0 ; in:5692 out:5692 type:P dur:82000000 cpbdur:82000000 q:21.99 tex:69749 mv:6280 misc:1443 imb:161 pmb:716 smb:473 d:- ref:0 ; in:5693 out:5693 type:P dur:82000000 cpbdur:82000000 q:20.95 tex:46446 mv:5735 misc:1547 imb:149 pmb:869 smb:332 d:- ref:0 ; in:5694 out:5694 type:P dur:82000000 cpbdur:82000000 q:22.13 tex:79271 mv:6873 misc:1464 imb:157 pmb:749 smb:444 d:- ref:0 ; in:5695 out:5695 type:P dur:82000000 cpbdur:82000000 q:21.48 tex:52438 mv:5455 misc:1555 imb:130 pmb:887 smb:333 d:- ref:0 ; in:5696 out:5696 type:P dur:82000000 cpbdur:82000000 q:21.69 tex:59019 mv:6014 misc:1463 imb:133 pmb:818 smb:399 d:- ref:0 ; in:5697 out:5697 type:P dur:82000000 cpbdur:82000000 q:22.22 tex:82860 mv:7129 misc:1491 imb:176 pmb:811 smb:363 d:- ref:0 ; in:5698 out:5698 type:P dur:82000000 cpbdur:82000000 q:22.31 tex:66856 mv:7167 misc:1513 imb:178 pmb:827 smb:345 d:- ref:0 ; in:5699 out:5699 type:P dur:82000000 cpbdur:82000000 q:21.90 tex:60722 mv:5944 misc:1486 imb:153 pmb:790 smb:407 d:- ref:0 ; in:5700 out:5700 type:P dur:82000000 cpbdur:82000000 q:22.25 tex:79052 mv:6558 misc:1494 imb:175 pmb:804 smb:371 d:- ref:0 ; in:5701 out:5701 type:P dur:82000000 cpbdur:82000000 q:22.51 tex:62498 mv:5996 misc:1490 imb:162 pmb:720 smb:468 d:- ref:0 ; in:5702 out:5702 type:P dur:82000000 cpbdur:82000000 q:22.17 tex:63685 mv:6897 misc:1498 imb:188 pmb:871 smb:291 d:- ref:0 ; in:5703 out:5703 type:P dur:82000000 cpbdur:82000000 q:21.86 tex:55340 mv:5721 misc:1515 imb:111 pmb:863 smb:376 d:- ref:0 ; in:5704 out:5704 type:P dur:82000000 cpbdur:82000000 q:21.43 tex:67237 mv:5743 misc:1508 imb:139 pmb:935 smb:276 d:- ref:0 ; in:5705 out:5705 type:P dur:82000000 cpbdur:82000000 q:20.91 tex:45658 mv:5865 misc:1525 imb:161 pmb:893 smb:296 d:- ref:0 ; in:5706 out:5706 type:P dur:82000000 cpbdur:82000000 q:20.91 tex:58368 mv:6625 misc:1527 imb:175 pmb:949 smb:226 d:- ref:0 ; in:5707 out:5707 type:P dur:82000000 cpbdur:82000000 q:22.20 tex:81951 mv:8853 misc:1508 imb:240 pmb:871 smb:239 d:- ref:0 ; in:5708 out:5708 type:P dur:82000000 cpbdur:82000000 q:22.09 tex:66687 mv:7534 misc:1515 imb:225 pmb:898 smb:227 d:- ref:0 ; in:5709 out:5709 type:P dur:82000000 cpbdur:82000000 q:22.55 tex:62418 mv:7010 misc:1500 imb:220 pmb:766 smb:364 d:- ref:0 ; in:5710 out:5710 type:P dur:82000000 cpbdur:82000000 q:22.73 tex:73195 mv:7551 misc:1486 imb:263 pmb:791 smb:296 d:- ref:0 ; in:5711 out:5711 type:P dur:82000000 cpbdur:82000000 q:23.11 tex:78347 mv:7720 misc:1477 imb:214 pmb:808 smb:328 d:- ref:0 ; in:5712 out:5712 type:P dur:82000000 cpbdur:82000000 q:23.19 tex:73338 mv:7696 misc:1502 imb:259 pmb:824 smb:267 d:- ref:0 ; in:5713 out:5713 type:P dur:82000000 cpbdur:82000000 q:22.78 tex:57054 mv:6765 misc:1493 imb:175 pmb:889 smb:286 d:- ref:0 ; in:5714 out:5714 type:P dur:82000000 cpbdur:82000000 q:23.37 tex:91545 mv:10015 misc:1488 imb:324 pmb:865 smb:161 d:- ref:0 ; in:5715 out:5715 type:P dur:82000000 cpbdur:82000000 q:22.93 tex:58475 mv:7763 misc:1482 imb:200 pmb:899 smb:251 d:- ref:0 ; in:5716 out:5716 type:P dur:82000000 cpbdur:82000000 q:23.03 tex:67826 mv:8548 misc:1490 imb:230 pmb:920 smb:200 d:- ref:0 ; in:5717 out:5717 type:P dur:82000000 cpbdur:82000000 q:23.44 tex:92435 mv:9491 misc:1482 imb:246 pmb:959 smb:145 d:- ref:0 ; in:5718 out:5718 type:P dur:82000000 cpbdur:82000000 q:23.73 tex:79432 mv:9557 misc:1459 imb:201 pmb:893 smb:256 d:- ref:0 ; in:5719 out:5719 type:P dur:82000000 cpbdur:82000000 q:24.01 tex:87791 mv:10228 misc:1469 imb:206 pmb:932 smb:212 d:- ref:0 ; in:5720 out:5720 type:P dur:82000000 cpbdur:82000000 q:24.37 tex:103923 mv:11220 misc:1465 imb:276 pmb:928 smb:146 d:- ref:0 ; in:5721 out:5721 type:P dur:82000000 cpbdur:82000000 q:24.50 tex:94711 mv:10562 misc:1455 imb:187 pmb:944 smb:219 d:- ref:0 ; in:5722 out:5722 type:P dur:82000000 cpbdur:82000000 q:24.63 tex:84613 mv:11081 misc:1466 imb:185 pmb:983 smb:182 d:- ref:0 ; in:5723 out:5723 type:P dur:82000000 cpbdur:82000000 q:24.78 tex:100816 mv:11071 misc:1457 imb:198 pmb:979 smb:173 d:- ref:0 ; in:5724 out:5724 type:P dur:82000000 cpbdur:82000000 q:24.93 tex:97565 mv:11120 misc:1475 imb:200 pmb:1038 smb:112 d:- ref:0 ; in:5725 out:5725 type:P dur:82000000 cpbdur:82000000 q:25.13 tex:106307 mv:11357 misc:1480 imb:174 pmb:1061 smb:115 d:- ref:0 ; in:5726 out:5726 type:P dur:82000000 cpbdur:82000000 q:25.32 tex:111051 mv:10946 misc:1451 imb:160 pmb:1008 smb:182 d:- ref:0 ; in:5727 out:5727 type:P dur:82000000 cpbdur:82000000 q:25.49 tex:113691 mv:11634 misc:1475 imb:170 pmb:1072 smb:108 d:- ref:0 ; in:5728 out:5728 type:P dur:82000000 cpbdur:82000000 q:25.73 tex:101790 mv:11197 misc:1453 imb:161 pmb:977 smb:212 d:- ref:0 ; in:5729 out:5729 type:P dur:82000000 cpbdur:82000000 q:25.83 tex:106320 mv:11260 misc:1476 imb:145 pmb:1016 smb:189 d:- ref:0 ; in:5730 out:5730 type:P dur:82000000 cpbdur:82000000 q:26.01 tex:113488 mv:12046 misc:1474 imb:205 pmb:1034 smb:111 d:- ref:0 ; in:5731 out:5731 type:P dur:82000000 cpbdur:82000000 q:26.10 tex:114937 mv:11876 misc:1467 imb:160 pmb:1046 smb:144 d:- ref:0 ; in:5732 out:5732 type:P dur:82000000 cpbdur:82000000 q:26.27 tex:121133 mv:12369 misc:1474 imb:185 pmb:1045 smb:120 d:- ref:0 ; in:5733 out:5733 type:P dur:82000000 cpbdur:82000000 q:26.37 tex:116566 mv:11871 misc:1483 imb:164 pmb:1057 smb:129 d:- ref:0 ; in:5734 out:5734 type:P dur:82000000 cpbdur:82000000 q:26.52 tex:113598 mv:12156 misc:1486 imb:173 pmb:1030 smb:147 d:- ref:0 ; in:5735 out:5735 type:P dur:82000000 cpbdur:82000000 q:26.59 tex:119874 mv:12195 misc:1491 imb:163 pmb:1047 smb:140 d:- ref:0 ; in:5736 out:5736 type:P dur:82000000 cpbdur:82000000 q:26.77 tex:132261 mv:12404 misc:1471 imb:198 pmb:1058 smb:94 d:- ref:0 ; in:5737 out:5737 type:P dur:82000000 cpbdur:82000000 q:26.81 tex:132284 mv:11944 misc:1460 imb:174 pmb:1052 smb:124 d:- ref:0 ; in:5738 out:5738 type:P dur:82000000 cpbdur:82000000 q:26.89 tex:135671 mv:12131 misc:1478 imb:141 pmb:1085 smb:124 d:- ref:0 ; in:5739 out:5739 type:P dur:82000000 cpbdur:82000000 q:27.03 tex:140354 mv:11919 misc:1471 imb:151 pmb:1101 smb:98 d:- ref:0 ; in:5740 out:5740 type:P dur:82000000 cpbdur:82000000 q:27.13 tex:148917 mv:12156 misc:1471 imb:174 pmb:1074 smb:102 d:- ref:0 ; in:5741 out:5741 type:P dur:82000000 cpbdur:82000000 q:27.22 tex:152768 mv:12483 misc:1477 imb:135 pmb:1109 smb:106 d:- ref:0 ; in:5742 out:5742 type:P dur:82000000 cpbdur:82000000 q:27.34 tex:156632 mv:12532 misc:1460 imb:153 pmb:1146 smb:51 d:- ref:0 ; in:5743 out:5743 type:P dur:82000000 cpbdur:82000000 q:27.40 tex:161335 mv:12234 misc:1463 imb:140 pmb:1138 smb:72 d:- ref:0 ; in:5744 out:5744 type:P dur:82000000 cpbdur:82000000 q:27.42 tex:162291 mv:11933 misc:1472 imb:145 pmb:1131 smb:74 d:- ref:0 ; in:5745 out:5745 type:P dur:82000000 cpbdur:82000000 q:27.40 tex:158766 mv:11244 misc:1454 imb:139 pmb:1170 smb:41 d:- ref:0 ; in:5746 out:5746 type:P dur:82000000 cpbdur:82000000 q:27.36 tex:159563 mv:11234 misc:1451 imb:128 pmb:1154 smb:68 d:- ref:0 ; in:5747 out:5747 type:P dur:82000000 cpbdur:82000000 q:27.29 tex:153387 mv:10183 misc:1438 imb:110 pmb:1211 smb:29 d:- ref:0 ; in:5748 out:5748 type:P dur:82000000 cpbdur:82000000 q:27.22 tex:153657 mv:9691 misc:1452 imb:103 pmb:1191 smb:56 d:- ref:0 ; in:5749 out:5749 type:P dur:82000000 cpbdur:82000000 q:27.04 tex:145719 mv:8087 misc:1458 imb:81 pmb:1195 smb:74 d:- ref:0 ; in:5750 out:5750 type:I dur:82000000 cpbdur:82000000 q:22.85 tex:496863 mv:15436 misc:373 imb:1350 pmb:0 smb:0 d:- ref:; in:5751 out:5751 type:P dur:82000000 cpbdur:82000000 q:28.36 tex:82907 mv:6638 misc:1479 imb:45 pmb:1094 smb:211 d:- ref:0 ; in:5752 out:5752 type:P dur:82000000 cpbdur:82000000 q:27.58 tex:115565 mv:7722 misc:1433 imb:73 pmb:1250 smb:27 d:- ref:0 ; in:5753 out:5753 type:P dur:82000000 cpbdur:82000000 q:26.91 tex:142443 mv:7025 misc:1444 imb:45 pmb:1263 smb:42 d:- ref:0 ; in:5754 out:5754 type:P dur:82000000 cpbdur:82000000 q:26.43 tex:156846 mv:7078 misc:1428 imb:36 pmb:1296 smb:18 d:- ref:0 ; in:5755 out:5755 type:P dur:82000000 cpbdur:82000000 q:25.79 tex:121435 mv:6575 misc:1470 imb:8 pmb:1221 smb:121 d:- ref:0 ; in:5756 out:5756 type:P dur:82000000 cpbdur:82000000 q:25.56 tex:125486 mv:6603 misc:1463 imb:9 pmb:1263 smb:78 d:- ref:0 ; in:5757 out:5757 type:P dur:82000000 cpbdur:82000000 q:25.13 tex:143905 mv:6066 misc:1461 imb:7 pmb:1288 smb:55 d:- ref:0 ; in:5758 out:5758 type:P dur:82000000 cpbdur:82000000 q:25.18 tex:148008 mv:6413 misc:1467 imb:8 pmb:1257 smb:85 d:- ref:0 ; in:5759 out:5759 type:P dur:82000000 cpbdur:82000000 q:25.10 tex:153704 mv:6422 misc:1466 imb:9 pmb:1242 smb:99 d:- ref:0 ; in:5760 out:5760 type:P dur:82000000 cpbdur:82000000 q:25.17 tex:157328 mv:6664 misc:1456 imb:15 pmb:1270 smb:65 d:- ref:0 ; in:5761 out:5761 type:P dur:82000000 cpbdur:82000000 q:25.03 tex:149094 mv:6178 misc:1456 imb:10 pmb:1234 smb:106 d:- ref:0 ; in:5762 out:5762 type:P dur:82000000 cpbdur:82000000 q:25.03 tex:151356 mv:6568 misc:1452 imb:21 pmb:1252 smb:77 d:- ref:0 ; in:5763 out:5763 type:P dur:82000000 cpbdur:82000000 q:25.06 tex:158821 mv:6896 misc:1443 imb:10 pmb:1264 smb:76 d:- ref:0 ; in:5764 out:5764 type:P dur:82000000 cpbdur:82000000 q:25.16 tex:153281 mv:7298 misc:1477 imb:13 pmb:1254 smb:83 d:- ref:0 ; in:5765 out:5765 type:P dur:82000000 cpbdur:82000000 q:25.02 tex:137469 mv:5864 misc:1451 imb:6 pmb:1222 smb:122 d:- ref:0 ; in:5766 out:5766 type:P dur:82000000 cpbdur:82000000 q:24.96 tex:139838 mv:5765 misc:1477 imb:2 pmb:1215 smb:133 d:- ref:0 ; in:5767 out:5767 type:P dur:82000000 cpbdur:82000000 q:24.90 tex:147123 mv:5964 misc:1465 imb:7 pmb:1226 smb:117 d:- ref:0 ; in:5768 out:5768 type:P dur:82000000 cpbdur:82000000 q:24.95 tex:145291 mv:6196 misc:1473 imb:6 pmb:1220 smb:124 d:- ref:0 ; in:5769 out:5769 type:P dur:82000000 cpbdur:82000000 q:24.83 tex:140126 mv:6270 misc:1476 imb:4 pmb:1234 smb:112 d:- ref:0 ; in:5770 out:5770 type:P dur:82000000 cpbdur:82000000 q:24.94 tex:146332 mv:5746 misc:1450 imb:9 pmb:1220 smb:121 d:- ref:0 ; in:5771 out:5771 type:P dur:82000000 cpbdur:82000000 q:24.93 tex:132002 mv:5841 misc:1485 imb:9 pmb:1183 smb:158 d:- ref:0 ; in:5772 out:5772 type:P dur:82000000 cpbdur:82000000 q:24.92 tex:147031 mv:6665 misc:1464 imb:8 pmb:1231 smb:111 d:- ref:0 ; in:5773 out:5773 type:P dur:82000000 cpbdur:82000000 q:24.87 tex:140818 mv:6077 misc:1457 imb:6 pmb:1225 smb:119 d:- ref:0 ; in:5774 out:5774 type:P dur:82000000 cpbdur:82000000 q:25.14 tex:149425 mv:6805 misc:1466 imb:6 pmb:1249 smb:95 d:- ref:0 ; in:5775 out:5775 type:P dur:82000000 cpbdur:82000000 q:25.11 tex:141722 mv:6150 misc:1472 imb:4 pmb:1226 smb:120 d:- ref:0 ; in:5776 out:5776 type:P dur:82000000 cpbdur:82000000 q:25.09 tex:134924 mv:5504 misc:1468 imb:3 pmb:1186 smb:161 d:- ref:0 ; in:5777 out:5777 type:P dur:82000000 cpbdur:82000000 q:24.96 tex:127887 mv:5445 misc:1484 imb:6 pmb:1205 smb:139 d:- ref:0 ; in:5778 out:5778 type:P dur:82000000 cpbdur:82000000 q:25.34 tex:183728 mv:7136 misc:1440 imb:7 pmb:1282 smb:61 d:- ref:0 ; in:5779 out:5779 type:P dur:82000000 cpbdur:82000000 q:25.16 tex:136521 mv:6004 misc:1475 imb:5 pmb:1196 smb:149 d:- ref:0 ; in:5780 out:5780 type:P dur:82000000 cpbdur:82000000 q:25.08 tex:150585 mv:6325 misc:1458 imb:5 pmb:1241 smb:104 d:- ref:0 ; in:5781 out:5781 type:P dur:82000000 cpbdur:82000000 q:24.94 tex:146366 mv:5852 misc:1470 imb:7 pmb:1240 smb:103 d:- ref:0 ; in:5782 out:5782 type:P dur:82000000 cpbdur:82000000 q:25.02 tex:149995 mv:6007 misc:1462 imb:6 pmb:1223 smb:121 d:- ref:0 ; in:5783 out:5783 type:P dur:82000000 cpbdur:82000000 q:25.05 tex:152394 mv:6728 misc:1446 imb:7 pmb:1262 smb:81 d:- ref:0 ; in:5784 out:5784 type:P dur:82000000 cpbdur:82000000 q:25.04 tex:152676 mv:6441 misc:1451 imb:3 pmb:1249 smb:98 d:- ref:0 ; in:5785 out:5785 type:P dur:82000000 cpbdur:82000000 q:24.96 tex:153806 mv:6604 misc:1454 imb:8 pmb:1248 smb:94 d:- ref:0 ; in:5786 out:5786 type:P dur:82000000 cpbdur:82000000 q:25.08 tex:147167 mv:6404 misc:1469 imb:8 pmb:1230 smb:112 d:- ref:0 ; in:5787 out:5787 type:P dur:82000000 cpbdur:82000000 q:25.15 tex:157001 mv:6690 misc:1445 imb:3 pmb:1264 smb:83 d:- ref:0 ; in:5788 out:5788 type:P dur:82000000 cpbdur:82000000 q:25.03 tex:133607 mv:5712 misc:1489 imb:3 pmb:1202 smb:145 d:- ref:0 ; in:5789 out:5789 type:P dur:82000000 cpbdur:82000000 q:24.97 tex:151306 mv:6304 misc:1454 imb:4 pmb:1228 smb:118 d:- ref:0 ; in:5790 out:5790 type:P dur:82000000 cpbdur:82000000 q:24.95 tex:153484 mv:6498 misc:1458 imb:3 pmb:1258 smb:89 d:- ref:0 ; in:5791 out:5791 type:P dur:82000000 cpbdur:82000000 q:25.01 tex:144775 mv:6417 misc:1464 imb:5 pmb:1193 smb:152 d:- ref:0 ; in:5792 out:5792 type:P dur:82000000 cpbdur:82000000 q:24.91 tex:140696 mv:5789 misc:1467 imb:0 pmb:1221 smb:129 d:- ref:0 ; in:5793 out:5793 type:P dur:82000000 cpbdur:82000000 q:25.09 tex:156181 mv:6312 misc:1459 imb:6 pmb:1240 smb:104 d:- ref:0 ; in:5794 out:5794 type:P dur:82000000 cpbdur:82000000 q:25.02 tex:153016 mv:5827 misc:1453 imb:4 pmb:1247 smb:99 d:- ref:0 ; in:5795 out:5795 type:P dur:82000000 cpbdur:82000000 q:24.99 tex:156942 mv:6461 misc:1445 imb:2 pmb:1233 smb:115 d:- ref:0 ; in:5796 out:5796 type:P dur:82000000 cpbdur:82000000 q:25.00 tex:145503 mv:6009 misc:1472 imb:5 pmb:1223 smb:122 d:- ref:0 ; in:5797 out:5797 type:P dur:82000000 cpbdur:82000000 q:25.08 tex:161099 mv:6411 misc:1458 imb:4 pmb:1257 smb:89 d:- ref:0 ; in:5798 out:5798 type:P dur:82000000 cpbdur:82000000 q:25.04 tex:154478 mv:6172 misc:1462 imb:1 pmb:1236 smb:113 d:- ref:0 ; in:5799 out:5799 type:P dur:82000000 cpbdur:82000000 q:25.02 tex:159621 mv:6417 misc:1450 imb:8 pmb:1267 smb:75 d:- ref:0 ; in:5800 out:5800 type:P dur:82000000 cpbdur:82000000 q:25.06 tex:131533 mv:5185 misc:1482 imb:3 pmb:1143 smb:204 d:- ref:0 ; in:5801 out:5801 type:P dur:82000000 cpbdur:82000000 q:25.05 tex:143894 mv:5643 misc:1447 imb:4 pmb:1187 smb:159 d:- ref:0 ; in:5802 out:5802 type:P dur:82000000 cpbdur:82000000 q:25.05 tex:130640 mv:5404 misc:1468 imb:6 pmb:1166 smb:178 d:- ref:0 ; in:5803 out:5803 type:P dur:82000000 cpbdur:82000000 q:25.12 tex:147795 mv:6152 misc:1469 imb:5 pmb:1210 smb:135 d:- ref:0 ; in:5804 out:5804 type:P dur:82000000 cpbdur:82000000 q:24.96 tex:133115 mv:5507 misc:1466 imb:1 pmb:1201 smb:148 d:- ref:0 ; in:5805 out:5805 type:P dur:82000000 cpbdur:82000000 q:25.11 tex:146753 mv:6152 misc:1471 imb:5 pmb:1220 smb:125 d:- ref:0 ; in:5806 out:5806 type:P dur:82000000 cpbdur:82000000 q:25.15 tex:158297 mv:6162 misc:1453 imb:2 pmb:1238 smb:110 d:- ref:0 ; in:5807 out:5807 type:P dur:82000000 cpbdur:82000000 q:25.05 tex:158769 mv:6423 misc:1456 imb:4 pmb:1259 smb:87 d:- ref:0 ; in:5808 out:5808 type:P dur:82000000 cpbdur:82000000 q:25.06 tex:145745 mv:5435 misc:1484 imb:1 pmb:1205 smb:144 d:- ref:0 ; in:5809 out:5809 type:P dur:82000000 cpbdur:82000000 q:25.09 tex:166801 mv:6184 misc:1447 imb:2 pmb:1234 smb:114 d:- ref:0 ; in:5810 out:5810 type:P dur:82000000 cpbdur:82000000 q:25.08 tex:155240 mv:5873 misc:1471 imb:8 pmb:1235 smb:107 d:- ref:0 ; in:5811 out:5811 type:P dur:82000000 cpbdur:82000000 q:25.11 tex:163156 mv:6094 misc:1430 imb:1 pmb:1244 smb:105 d:- ref:0 ; in:5812 out:5812 type:P dur:82000000 cpbdur:82000000 q:25.20 tex:156661 mv:6344 misc:1459 imb:4 pmb:1246 smb:100 d:- ref:0 ; in:5813 out:5813 type:P dur:82000000 cpbdur:82000000 q:25.12 tex:153282 mv:5832 misc:1454 imb:2 pmb:1250 smb:98 d:- ref:0 ; in:5814 out:5814 type:P dur:82000000 cpbdur:82000000 q:25.25 tex:165984 mv:6411 misc:1453 imb:3 pmb:1263 smb:84 d:- ref:0 ; in:5815 out:5815 type:P dur:82000000 cpbdur:82000000 q:25.22 tex:162008 mv:6223 misc:1449 imb:4 pmb:1249 smb:97 d:- ref:0 ; in:5816 out:5816 type:P dur:82000000 cpbdur:82000000 q:25.12 tex:161027 mv:5883 misc:1442 imb:5 pmb:1259 smb:86 d:- ref:0 ; in:5817 out:5817 type:P dur:82000000 cpbdur:82000000 q:25.19 tex:160420 mv:6547 misc:1457 imb:1 pmb:1249 smb:100 d:- ref:0 ; in:5818 out:5818 type:P dur:82000000 cpbdur:82000000 q:25.11 tex:147414 mv:6108 misc:1446 imb:1 pmb:1198 smb:151 d:- ref:0 ; in:5819 out:5819 type:P dur:82000000 cpbdur:82000000 q:25.21 tex:159592 mv:6676 misc:1436 imb:1 pmb:1250 smb:99 d:- ref:0 ; in:5820 out:5820 type:P dur:82000000 cpbdur:82000000 q:25.22 tex:144334 mv:6064 misc:1466 imb:1 pmb:1218 smb:131 d:- ref:0 ; in:5821 out:5821 type:P dur:82000000 cpbdur:82000000 q:25.19 tex:154966 mv:5777 misc:1441 imb:2 pmb:1221 smb:127 d:- ref:0 ; in:5822 out:5822 type:P dur:82000000 cpbdur:82000000 q:25.29 tex:157816 mv:5976 misc:1464 imb:5 pmb:1226 smb:119 d:- ref:0 ; in:5823 out:5823 type:P dur:82000000 cpbdur:82000000 q:25.19 tex:148889 mv:5615 misc:1448 imb:1 pmb:1211 smb:138 d:- ref:0 ; in:5824 out:5824 type:P dur:82000000 cpbdur:82000000 q:25.14 tex:150911 mv:5793 misc:1464 imb:1 pmb:1241 smb:108 d:- ref:0 ; in:5825 out:5825 type:P dur:82000000 cpbdur:82000000 q:25.15 tex:169012 mv:6569 misc:1419 imb:2 pmb:1255 smb:93 d:- ref:0 ; in:5826 out:5826 type:P dur:82000000 cpbdur:82000000 q:25.22 tex:163424 mv:6392 misc:1456 imb:0 pmb:1264 smb:86 d:- ref:0 ; in:5827 out:5827 type:P dur:82000000 cpbdur:82000000 q:25.27 tex:160828 mv:6382 misc:1446 imb:1 pmb:1224 smb:125 d:- ref:0 ; in:5828 out:5828 type:P dur:82000000 cpbdur:82000000 q:25.26 tex:158363 mv:5773 misc:1448 imb:0 pmb:1241 smb:109 d:- ref:0 ; in:5829 out:5829 type:P dur:82000000 cpbdur:82000000 q:25.27 tex:139343 mv:5214 misc:1483 imb:2 pmb:1168 smb:180 d:- ref:0 ; in:5830 out:5830 type:P dur:82000000 cpbdur:82000000 q:25.27 tex:155184 mv:5924 misc:1452 imb:8 pmb:1240 smb:102 d:- ref:0 ; in:5831 out:5831 type:P dur:82000000 cpbdur:82000000 q:25.33 tex:159780 mv:5727 misc:1429 imb:4 pmb:1253 smb:93 d:- ref:0 ; in:5832 out:5832 type:P dur:82000000 cpbdur:82000000 q:25.21 tex:143906 mv:5736 misc:1478 imb:0 pmb:1216 smb:134 d:- ref:0 ; in:5833 out:5833 type:P dur:82000000 cpbdur:82000000 q:25.32 tex:168648 mv:6702 misc:1426 imb:2 pmb:1268 smb:80 d:- ref:0 ; in:5834 out:5834 type:P dur:82000000 cpbdur:82000000 q:25.27 tex:157602 mv:5856 misc:1454 imb:2 pmb:1248 smb:100 d:- ref:0 ; in:5835 out:5835 type:P dur:82000000 cpbdur:82000000 q:25.33 tex:151825 mv:6036 misc:1459 imb:6 pmb:1238 smb:106 d:- ref:0 ; in:5836 out:5836 type:P dur:82000000 cpbdur:82000000 q:25.38 tex:164732 mv:5913 misc:1451 imb:3 pmb:1257 smb:90 d:- ref:0 ; in:5837 out:5837 type:P dur:82000000 cpbdur:82000000 q:25.23 tex:150492 mv:5546 misc:1458 imb:1 pmb:1242 smb:107 d:- ref:0 ; in:5838 out:5838 type:P dur:82000000 cpbdur:82000000 q:25.28 tex:162714 mv:5984 misc:1454 imb:5 pmb:1240 smb:105 d:- ref:0 ; in:5839 out:5839 type:P dur:82000000 cpbdur:82000000 q:25.34 tex:175318 mv:6472 misc:1434 imb:2 pmb:1268 smb:80 d:- ref:0 ; in:5840 out:5840 type:P dur:82000000 cpbdur:82000000 q:25.33 tex:159185 mv:5995 misc:1452 imb:4 pmb:1265 smb:81 d:- ref:0 ; in:5841 out:5841 type:P dur:82000000 cpbdur:82000000 q:25.24 tex:156857 mv:5524 misc:1459 imb:5 pmb:1226 smb:119 d:- ref:0 ; in:5842 out:5842 type:P dur:82000000 cpbdur:82000000 q:25.29 tex:170687 mv:6160 misc:1433 imb:0 pmb:1248 smb:102 d:- ref:0 ; in:5843 out:5843 type:P dur:82000000 cpbdur:82000000 q:25.25 tex:156861 mv:5834 misc:1457 imb:5 pmb:1252 smb:93 d:- ref:0 ; in:5844 out:5844 type:P dur:82000000 cpbdur:82000000 q:25.24 tex:170856 mv:5788 misc:1444 imb:1 pmb:1256 smb:93 d:- ref:0 ; in:5845 out:5845 type:P dur:82000000 cpbdur:82000000 q:25.27 tex:177859 mv:6218 misc:1419 imb:2 pmb:1270 smb:78 d:- ref:0 ; in:5846 out:5846 type:P dur:82000000 cpbdur:82000000 q:25.32 tex:164771 mv:6345 misc:1452 imb:3 pmb:1251 smb:96 d:- ref:0 ; in:5847 out:5847 type:P dur:82000000 cpbdur:82000000 q:25.32 tex:154453 mv:5987 misc:1440 imb:2 pmb:1205 smb:143 d:- ref:0 ; in:5848 out:5848 type:P dur:82000000 cpbdur:82000000 q:25.30 tex:165586 mv:6022 misc:1448 imb:0 pmb:1266 smb:84 d:- ref:0 ; in:5849 out:5849 type:P dur:82000000 cpbdur:82000000 q:25.31 tex:162894 mv:6164 misc:1438 imb:1 pmb:1252 smb:97 d:- ref:0 ; in:5850 out:5850 type:P dur:82000000 cpbdur:82000000 q:25.35 tex:174487 mv:6297 misc:1440 imb:5 pmb:1263 smb:82 d:- ref:0 ; in:5851 out:5851 type:P dur:82000000 cpbdur:82000000 q:25.28 tex:170873 mv:6192 misc:1439 imb:1 pmb:1240 smb:109 d:- ref:0 ; in:5852 out:5852 type:P dur:82000000 cpbdur:82000000 q:25.35 tex:163637 mv:6479 misc:1460 imb:4 pmb:1267 smb:79 d:- ref:0 ; in:5853 out:5853 type:P dur:82000000 cpbdur:82000000 q:25.41 tex:169159 mv:5767 misc:1410 imb:0 pmb:1209 smb:141 d:- ref:0 ; in:5854 out:5854 type:P dur:82000000 cpbdur:82000000 q:25.47 tex:163146 mv:5741 misc:1465 imb:3 pmb:1229 smb:118 d:- ref:0 ; in:5855 out:5855 type:P dur:82000000 cpbdur:82000000 q:25.48 tex:169193 mv:6245 misc:1442 imb:6 pmb:1257 smb:87 d:- ref:0 ; in:5856 out:5856 type:P dur:82000000 cpbdur:82000000 q:25.40 tex:162224 mv:5692 misc:1444 imb:2 pmb:1252 smb:96 d:- ref:0 ; in:5857 out:5857 type:P dur:82000000 cpbdur:82000000 q:25.36 tex:155720 mv:5645 misc:1451 imb:1 pmb:1241 smb:108 d:- ref:0 ; in:5858 out:5858 type:P dur:82000000 cpbdur:82000000 q:25.38 tex:173976 mv:6122 misc:1438 imb:1 pmb:1262 smb:87 d:- ref:0 ; in:5859 out:5859 type:P dur:82000000 cpbdur:82000000 q:25.29 tex:170161 mv:6035 misc:1460 imb:0 pmb:1257 smb:93 d:- ref:0 ; in:5860 out:5860 type:P dur:82000000 cpbdur:82000000 q:25.36 tex:163952 mv:6153 misc:1455 imb:1 pmb:1233 smb:116 d:- ref:0 ; in:5861 out:5861 type:P dur:82000000 cpbdur:82000000 q:25.41 tex:172361 mv:6731 misc:1444 imb:0 pmb:1249 smb:101 d:- ref:0 ; in:5862 out:5862 type:P dur:82000000 cpbdur:82000000 q:25.35 tex:166741 mv:6172 misc:1447 imb:3 pmb:1258 smb:89 d:- ref:0 ; in:5863 out:5863 type:P dur:82000000 cpbdur:82000000 q:25.36 tex:169748 mv:6105 misc:1451 imb:1 pmb:1257 smb:92 d:- ref:0 ; in:5864 out:5864 type:P dur:82000000 cpbdur:82000000 q:25.46 tex:184896 mv:6796 misc:1428 imb:0 pmb:1280 smb:70 d:- ref:0 ; in:5865 out:5865 type:P dur:82000000 cpbdur:82000000 q:25.34 tex:156847 mv:6203 misc:1462 imb:4 pmb:1243 smb:103 d:- ref:0 ; in:5866 out:5866 type:P dur:82000000 cpbdur:82000000 q:25.40 tex:176188 mv:6605 misc:1439 imb:5 pmb:1259 smb:86 d:- ref:0 ; in:5867 out:5867 type:P dur:82000000 cpbdur:82000000 q:25.34 tex:177585 mv:6148 misc:1443 imb:2 pmb:1268 smb:80 d:- ref:0 ; in:5868 out:5868 type:P dur:82000000 cpbdur:82000000 q:25.36 tex:164275 mv:6046 misc:1447 imb:2 pmb:1246 smb:102 d:- ref:0 ; in:5869 out:5869 type:P dur:82000000 cpbdur:82000000 q:25.46 tex:182612 mv:6513 misc:1435 imb:1 pmb:1275 smb:74 d:- ref:0 ; in:5870 out:5870 type:P dur:82000000 cpbdur:82000000 q:25.46 tex:167549 mv:6267 misc:1448 imb:0 pmb:1257 smb:93 d:- ref:0 ; in:5871 out:5871 type:P dur:82000000 cpbdur:82000000 q:25.45 tex:166920 mv:5788 misc:1420 imb:1 pmb:1188 smb:161 d:- ref:0 ; in:5872 out:5872 type:P dur:82000000 cpbdur:82000000 q:25.43 tex:167967 mv:6113 misc:1440 imb:1 pmb:1237 smb:112 d:- ref:0 ; in:5873 out:5873 type:P dur:82000000 cpbdur:82000000 q:25.49 tex:173529 mv:6257 misc:1430 imb:1 pmb:1261 smb:88 d:- ref:0 ; in:5874 out:5874 type:P dur:82000000 cpbdur:82000000 q:25.51 tex:117779 mv:5578 misc:1459 imb:1 pmb:1156 smb:193 d:- ref:0 ; in:5875 out:5875 type:P dur:82000000 cpbdur:82000000 q:25.47 tex:178848 mv:6485 misc:1435 imb:2 pmb:1271 smb:77 d:- ref:0 ; in:5876 out:5876 type:P dur:82000000 cpbdur:82000000 q:25.54 tex:128794 mv:5990 misc:1464 imb:1 pmb:1188 smb:161 d:- ref:0 ; in:5877 out:5877 type:P dur:82000000 cpbdur:82000000 q:25.45 tex:186184 mv:6141 misc:1443 imb:4 pmb:1289 smb:57 d:- ref:0 ; in:5878 out:5878 type:P dur:82000000 cpbdur:82000000 q:25.40 tex:170723 mv:6020 misc:1441 imb:0 pmb:1258 smb:92 d:- ref:0 ; in:5879 out:5879 type:P dur:82000000 cpbdur:82000000 q:25.44 tex:180561 mv:6348 misc:1427 imb:3 pmb:1258 smb:89 d:- ref:0 ; in:5880 out:5880 type:P dur:82000000 cpbdur:82000000 q:25.52 tex:127275 mv:5574 misc:1471 imb:0 pmb:1146 smb:204 d:- ref:0 ; in:5881 out:5881 type:P dur:82000000 cpbdur:82000000 q:25.53 tex:132285 mv:5490 misc:1457 imb:3 pmb:1144 smb:203 d:- ref:0 ; in:5882 out:5882 type:P dur:82000000 cpbdur:82000000 q:25.50 tex:175692 mv:5923 misc:1433 imb:5 pmb:1301 smb:44 d:- ref:0 ; in:5883 out:5883 type:P dur:82000000 cpbdur:82000000 q:25.52 tex:125203 mv:5550 misc:1455 imb:1 pmb:1198 smb:151 d:- ref:0 ; in:5884 out:5884 type:P dur:82000000 cpbdur:82000000 q:25.59 tex:137815 mv:6241 misc:1464 imb:1 pmb:1211 smb:138 d:- ref:0 ; in:5885 out:5885 type:P dur:82000000 cpbdur:82000000 q:25.58 tex:140380 mv:5824 misc:1436 imb:1 pmb:1226 smb:123 d:- ref:0 ; in:5886 out:5886 type:P dur:82000000 cpbdur:82000000 q:25.69 tex:140428 mv:5936 misc:1468 imb:4 pmb:1244 smb:102 d:- ref:0 ; in:5887 out:5887 type:P dur:82000000 cpbdur:82000000 q:25.59 tex:142892 mv:6120 misc:1436 imb:1 pmb:1210 smb:139 d:- ref:0 ; in:5888 out:5888 type:P dur:82000000 cpbdur:82000000 q:25.60 tex:154300 mv:6561 misc:1427 imb:0 pmb:1257 smb:93 d:- ref:0 ; in:5889 out:5889 type:P dur:82000000 cpbdur:82000000 q:25.56 tex:142758 mv:6412 misc:1454 imb:1 pmb:1206 smb:143 d:- ref:0 ; in:5890 out:5890 type:P dur:82000000 cpbdur:82000000 q:25.56 tex:147782 mv:6468 misc:1446 imb:2 pmb:1248 smb:100 d:- ref:0 ; in:5891 out:5891 type:P dur:82000000 cpbdur:82000000 q:25.45 tex:188958 mv:6281 misc:1433 imb:4 pmb:1309 smb:37 d:- ref:0 ; in:5892 out:5892 type:P dur:82000000 cpbdur:82000000 q:25.48 tex:171498 mv:5662 misc:1448 imb:0 pmb:1250 smb:100 d:- ref:0 ; in:5893 out:5893 type:P dur:82000000 cpbdur:82000000 q:25.50 tex:140584 mv:5975 misc:1441 imb:0 pmb:1203 smb:147 d:- ref:0 ; in:5894 out:5894 type:P dur:82000000 cpbdur:82000000 q:25.59 tex:147997 mv:6552 misc:1451 imb:0 pmb:1252 smb:98 d:- ref:0 ; in:5895 out:5895 type:P dur:82000000 cpbdur:82000000 q:25.59 tex:156081 mv:6315 misc:1436 imb:0 pmb:1235 smb:115 d:- ref:0 ; in:5896 out:5896 type:P dur:82000000 cpbdur:82000000 q:25.62 tex:147803 mv:6344 misc:1445 imb:0 pmb:1236 smb:114 d:- ref:0 ; in:5897 out:5897 type:P dur:82000000 cpbdur:82000000 q:25.60 tex:139381 mv:5798 misc:1453 imb:1 pmb:1144 smb:205 d:- ref:0 ; in:5898 out:5898 type:P dur:82000000 cpbdur:82000000 q:25.55 tex:143652 mv:5682 misc:1442 imb:1 pmb:1224 smb:125 d:- ref:0 ; in:5899 out:5899 type:P dur:82000000 cpbdur:82000000 q:25.62 tex:143765 mv:6043 misc:1464 imb:4 pmb:1207 smb:139 d:- ref:0 ; in:5900 out:5900 type:P dur:82000000 cpbdur:82000000 q:25.54 tex:145379 mv:6237 misc:1456 imb:0 pmb:1231 smb:119 d:- ref:0 ; in:5901 out:5901 type:P dur:82000000 cpbdur:82000000 q:25.54 tex:146771 mv:6208 misc:1461 imb:1 pmb:1216 smb:133 d:- ref:0 ; in:5902 out:5902 type:P dur:82000000 cpbdur:82000000 q:25.58 tex:143952 mv:5956 misc:1444 imb:4 pmb:1218 smb:128 d:- ref:0 ; in:5903 out:5903 type:P dur:82000000 cpbdur:82000000 q:25.59 tex:152113 mv:6248 misc:1439 imb:0 pmb:1226 smb:124 d:- ref:0 ; in:5904 out:5904 type:P dur:82000000 cpbdur:82000000 q:25.59 tex:151172 mv:6624 misc:1436 imb:4 pmb:1238 smb:108 d:- ref:0 ; in:5905 out:5905 type:P dur:82000000 cpbdur:82000000 q:25.62 tex:138418 mv:6018 misc:1468 imb:2 pmb:1172 smb:176 d:- ref:0 ; in:5906 out:5906 type:P dur:82000000 cpbdur:82000000 q:25.68 tex:142538 mv:5810 misc:1452 imb:0 pmb:1200 smb:150 d:- ref:0 ; in:5907 out:5907 type:P dur:82000000 cpbdur:82000000 q:25.57 tex:130548 mv:5668 misc:1440 imb:2 pmb:1184 smb:164 d:- ref:0 ; in:5908 out:5908 type:P dur:82000000 cpbdur:82000000 q:25.75 tex:153610 mv:6117 misc:1433 imb:1 pmb:1235 smb:114 d:- ref:0 ; in:5909 out:5909 type:P dur:82000000 cpbdur:82000000 q:25.58 tex:140659 mv:5794 misc:1435 imb:1 pmb:1204 smb:145 d:- ref:0 ; in:5910 out:5910 type:P dur:82000000 cpbdur:82000000 q:25.63 tex:146117 mv:6291 misc:1440 imb:0 pmb:1225 smb:125 d:- ref:0 ; in:5911 out:5911 type:P dur:82000000 cpbdur:82000000 q:25.61 tex:149591 mv:6342 misc:1443 imb:3 pmb:1256 smb:91 d:- ref:0 ; in:5912 out:5912 type:P dur:82000000 cpbdur:82000000 q:25.66 tex:153012 mv:6491 misc:1441 imb:1 pmb:1247 smb:102 d:- ref:0 ; in:5913 out:5913 type:P dur:82000000 cpbdur:82000000 q:25.63 tex:149189 mv:6345 misc:1442 imb:0 pmb:1211 smb:139 d:- ref:0 ; in:5914 out:5914 type:P dur:82000000 cpbdur:82000000 q:25.67 tex:148373 mv:6312 misc:1459 imb:1 pmb:1226 smb:123 d:- ref:0 ; in:5915 out:5915 type:P dur:82000000 cpbdur:82000000 q:25.61 tex:152071 mv:5981 misc:1428 imb:2 pmb:1237 smb:111 d:- ref:0 ; in:5916 out:5916 type:P dur:82000000 cpbdur:82000000 q:25.62 tex:146789 mv:6226 misc:1449 imb:1 pmb:1242 smb:107 d:- ref:0 ; in:5917 out:5917 type:P dur:82000000 cpbdur:82000000 q:25.62 tex:159082 mv:6206 misc:1432 imb:1 pmb:1270 smb:79 d:- ref:0 ; in:5918 out:5918 type:P dur:82000000 cpbdur:82000000 q:25.73 tex:162248 mv:6572 misc:1444 imb:1 pmb:1266 smb:83 d:- ref:0 ; in:5919 out:5919 type:P dur:82000000 cpbdur:82000000 q:25.46 tex:198348 mv:5898 misc:1442 imb:2 pmb:1292 smb:56 d:- ref:0 ; in:5920 out:5920 type:P dur:82000000 cpbdur:82000000 q:25.63 tex:143574 mv:6092 misc:1446 imb:0 pmb:1206 smb:144 d:- ref:0 ; in:5921 out:5921 type:P dur:82000000 cpbdur:82000000 q:25.68 tex:153697 mv:6585 misc:1438 imb:0 pmb:1267 smb:83 d:- ref:0 ; in:5922 out:5922 type:P dur:82000000 cpbdur:82000000 q:25.77 tex:161146 mv:6677 misc:1441 imb:0 pmb:1241 smb:109 d:- ref:0 ; in:5923 out:5923 type:P dur:82000000 cpbdur:82000000 q:25.89 tex:157292 mv:6577 misc:1443 imb:2 pmb:1247 smb:101 d:- ref:0 ; in:5924 out:5924 type:P dur:82000000 cpbdur:82000000 q:25.70 tex:146910 mv:6091 misc:1455 imb:2 pmb:1201 smb:147 d:- ref:0 ; in:5925 out:5925 type:P dur:82000000 cpbdur:82000000 q:25.48 tex:199932 mv:5971 misc:1433 imb:1 pmb:1313 smb:36 d:- ref:0 ; in:5926 out:5926 type:P dur:82000000 cpbdur:82000000 q:25.07 tex:147478 mv:4773 misc:1389 imb:0 pmb:1043 smb:307 d:- ref:0 ; in:5927 out:5927 type:P dur:82000000 cpbdur:82000000 q:23.72 tex:91631 mv:3488 misc:1521 imb:1 pmb:1148 smb:201 d:- ref:0 ; in:5928 out:5928 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:167744 mv:4091 misc:1437 imb:1 pmb:1295 smb:54 d:- ref:0 ; in:5929 out:5929 type:P dur:82000000 cpbdur:82000000 q:20.77 tex:241531 mv:4166 misc:1423 imb:3 pmb:1340 smb:7 d:- ref:0 ; in:5930 out:5930 type:P dur:82000000 cpbdur:82000000 q:19.38 tex:299975 mv:4112 misc:1425 imb:4 pmb:1340 smb:6 d:- ref:0 ; in:5931 out:5931 type:P dur:82000000 cpbdur:82000000 q:18.37 tex:115000 mv:3756 misc:1508 imb:0 pmb:1248 smb:102 d:- ref:0 ; in:5932 out:5932 type:P dur:82000000 cpbdur:82000000 q:17.78 tex:61530 mv:2751 misc:1599 imb:0 pmb:915 smb:435 d:- ref:0 ; in:5933 out:5933 type:P dur:82000000 cpbdur:82000000 q:17.38 tex:173281 mv:4050 misc:1437 imb:0 pmb:1332 smb:18 d:- ref:0 ; in:5934 out:5934 type:P dur:82000000 cpbdur:82000000 q:17.25 tex:74079 mv:3287 misc:1578 imb:1 pmb:1085 smb:264 d:- ref:0 ; in:5935 out:5935 type:P dur:82000000 cpbdur:82000000 q:17.29 tex:64215 mv:3027 misc:1606 imb:0 pmb:1005 smb:345 d:- ref:0 ; in:5936 out:5936 type:P dur:82000000 cpbdur:82000000 q:17.70 tex:57839 mv:2997 misc:1596 imb:0 pmb:999 smb:351 d:- ref:0 ; in:5937 out:5937 type:P dur:82000000 cpbdur:82000000 q:18.09 tex:66110 mv:3075 misc:1559 imb:0 pmb:1023 smb:327 d:- ref:0 ; in:5938 out:5938 type:P dur:82000000 cpbdur:82000000 q:18.99 tex:81208 mv:3269 misc:1563 imb:1 pmb:1077 smb:272 d:- ref:0 ; in:5939 out:5939 type:P dur:82000000 cpbdur:82000000 q:18.87 tex:56914 mv:2961 misc:1581 imb:0 pmb:987 smb:363 d:- ref:0 ; in:5940 out:5940 type:P dur:82000000 cpbdur:82000000 q:20.30 tex:80103 mv:3246 misc:1523 imb:0 pmb:1078 smb:272 d:- ref:0 ; in:5941 out:5941 type:P dur:82000000 cpbdur:82000000 q:22.07 tex:144381 mv:3828 misc:1463 imb:0 pmb:1098 smb:252 d:- ref:0 ; in:5942 out:5942 type:P dur:82000000 cpbdur:82000000 q:20.68 tex:60448 mv:3264 misc:1544 imb:0 pmb:1088 smb:262 d:- ref:0 ; in:5943 out:5943 type:P dur:82000000 cpbdur:82000000 q:20.14 tex:107252 mv:3651 misc:1481 imb:0 pmb:1211 smb:139 d:- ref:0 ; in:5944 out:5944 type:P dur:82000000 cpbdur:82000000 q:19.94 tex:75028 mv:3350 misc:1566 imb:1 pmb:1098 smb:251 d:- ref:0 ; in:5945 out:5945 type:P dur:82000000 cpbdur:82000000 q:18.07 tex:169410 mv:4053 misc:1433 imb:0 pmb:1337 smb:13 d:- ref:0 ; in:5946 out:5946 type:P dur:82000000 cpbdur:82000000 q:22.07 tex:509974 mv:17703 misc:1411 imb:1175 pmb:175 smb:0 d:- ref:0 ; in:5947 out:5947 type:P dur:82000000 cpbdur:82000000 q:26.07 tex:38490 mv:3843 misc:1435 imb:10 pmb:677 smb:663 d:- ref:0 ; in:5948 out:5948 type:P dur:82000000 cpbdur:82000000 q:25.34 tex:58768 mv:4966 misc:1546 imb:17 pmb:930 smb:403 d:- ref:0 ; in:5949 out:5949 type:P dur:82000000 cpbdur:82000000 q:24.66 tex:79393 mv:5646 misc:1537 imb:27 pmb:1038 smb:285 d:- ref:0 ; in:5950 out:5950 type:P dur:82000000 cpbdur:82000000 q:24.05 tex:76687 mv:5476 misc:1541 imb:26 pmb:1098 smb:226 d:- ref:0 ; in:5951 out:5951 type:P dur:82000000 cpbdur:82000000 q:23.48 tex:109047 mv:5935 misc:1482 imb:35 pmb:1193 smb:122 d:- ref:0 ; in:5952 out:5952 type:P dur:82000000 cpbdur:82000000 q:23.48 tex:106222 mv:6388 misc:1518 imb:28 pmb:1094 smb:228 d:- ref:0 ; in:5953 out:5953 type:P dur:82000000 cpbdur:82000000 q:23.54 tex:73122 mv:5647 misc:1519 imb:17 pmb:985 smb:348 d:- ref:0 ; in:5954 out:5954 type:P dur:82000000 cpbdur:82000000 q:23.54 tex:69590 mv:5134 misc:1532 imb:26 pmb:1008 smb:316 d:- ref:0 ; in:5955 out:5955 type:P dur:82000000 cpbdur:82000000 q:23.50 tex:83336 mv:6218 misc:1518 imb:16 pmb:1046 smb:288 d:- ref:0 ; in:5956 out:5956 type:P dur:82000000 cpbdur:82000000 q:22.72 tex:79536 mv:4697 misc:1519 imb:34 pmb:1097 smb:219 d:- ref:0 ; in:5957 out:5957 type:P dur:82000000 cpbdur:82000000 q:23.22 tex:103559 mv:6539 misc:1502 imb:18 pmb:1085 smb:247 d:- ref:0 ; in:5958 out:5958 type:P dur:82000000 cpbdur:82000000 q:22.92 tex:77675 mv:4647 misc:1518 imb:20 pmb:1021 smb:309 d:- ref:0 ; in:5959 out:5959 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:83346 mv:5279 misc:1519 imb:22 pmb:1037 smb:291 d:- ref:0 ; in:5960 out:5960 type:P dur:82000000 cpbdur:82000000 q:23.17 tex:94196 mv:5872 misc:1532 imb:29 pmb:1104 smb:217 d:- ref:0 ; in:5961 out:5961 type:P dur:82000000 cpbdur:82000000 q:23.29 tex:101349 mv:6249 misc:1522 imb:24 pmb:1107 smb:219 d:- ref:0 ; in:5962 out:5962 type:P dur:82000000 cpbdur:82000000 q:22.95 tex:77809 mv:5169 misc:1518 imb:24 pmb:1031 smb:295 d:- ref:0 ; in:5963 out:5963 type:P dur:82000000 cpbdur:82000000 q:23.11 tex:97819 mv:6033 misc:1500 imb:30 pmb:1077 smb:243 d:- ref:0 ; in:5964 out:5964 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:77352 mv:4913 misc:1543 imb:14 pmb:1081 smb:255 d:- ref:0 ; in:5965 out:5965 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:89170 mv:5568 misc:1494 imb:21 pmb:1084 smb:245 d:- ref:0 ; in:5966 out:5966 type:P dur:82000000 cpbdur:82000000 q:22.50 tex:70824 mv:4650 misc:1526 imb:20 pmb:990 smb:340 d:- ref:0 ; in:5967 out:5967 type:P dur:82000000 cpbdur:82000000 q:22.24 tex:111458 mv:5348 misc:1490 imb:12 pmb:1158 smb:180 d:- ref:0 ; in:5968 out:5968 type:P dur:82000000 cpbdur:82000000 q:22.73 tex:85109 mv:5838 misc:1501 imb:14 pmb:962 smb:374 d:- ref:0 ; in:5969 out:5969 type:P dur:82000000 cpbdur:82000000 q:22.68 tex:74854 mv:5461 misc:1509 imb:24 pmb:1011 smb:315 d:- ref:0 ; in:5970 out:5970 type:P dur:82000000 cpbdur:82000000 q:22.28 tex:98457 mv:4988 misc:1491 imb:22 pmb:1118 smb:210 d:- ref:0 ; in:5971 out:5971 type:P dur:82000000 cpbdur:82000000 q:22.53 tex:69081 mv:5075 misc:1476 imb:15 pmb:871 smb:464 d:- ref:0 ; in:5972 out:5972 type:P dur:82000000 cpbdur:82000000 q:22.66 tex:75109 mv:5109 misc:1478 imb:16 pmb:919 smb:415 d:- ref:0 ; in:5973 out:5973 type:P dur:82000000 cpbdur:82000000 q:21.66 tex:66744 mv:4367 misc:1529 imb:27 pmb:1047 smb:276 d:- ref:0 ; in:5974 out:5974 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:65589 mv:4057 misc:1546 imb:15 pmb:981 smb:354 d:- ref:0 ; in:5975 out:5975 type:P dur:82000000 cpbdur:82000000 q:22.27 tex:102108 mv:6074 misc:1514 imb:20 pmb:1028 smb:302 d:- ref:0 ; in:5976 out:5976 type:P dur:82000000 cpbdur:82000000 q:21.72 tex:61156 mv:4269 misc:1527 imb:13 pmb:989 smb:348 d:- ref:0 ; in:5977 out:5977 type:P dur:82000000 cpbdur:82000000 q:22.40 tex:97117 mv:5820 misc:1503 imb:13 pmb:1060 smb:277 d:- ref:0 ; in:5978 out:5978 type:P dur:82000000 cpbdur:82000000 q:21.06 tex:60754 mv:3963 misc:1547 imb:26 pmb:1067 smb:257 d:- ref:0 ; in:5979 out:5979 type:P dur:82000000 cpbdur:82000000 q:22.07 tex:94431 mv:6058 misc:1503 imb:17 pmb:964 smb:369 d:- ref:0 ; in:5980 out:5980 type:P dur:82000000 cpbdur:82000000 q:22.10 tex:85551 mv:5080 misc:1505 imb:34 pmb:990 smb:326 d:- ref:0 ; in:5981 out:5981 type:P dur:82000000 cpbdur:82000000 q:21.68 tex:62557 mv:4276 misc:1559 imb:25 pmb:966 smb:359 d:- ref:0 ; in:5982 out:5982 type:P dur:82000000 cpbdur:82000000 q:20.89 tex:59269 mv:4126 misc:1525 imb:31 pmb:1074 smb:245 d:- ref:0 ; in:5983 out:5983 type:P dur:82000000 cpbdur:82000000 q:22.00 tex:91012 mv:6080 misc:1508 imb:23 pmb:952 smb:375 d:- ref:0 ; in:5984 out:5984 type:P dur:82000000 cpbdur:82000000 q:22.33 tex:85774 mv:6036 misc:1486 imb:26 pmb:976 smb:348 d:- ref:0 ; in:5985 out:5985 type:P dur:82000000 cpbdur:82000000 q:22.19 tex:62224 mv:4881 misc:1527 imb:28 pmb:957 smb:365 d:- ref:0 ; in:5986 out:5986 type:P dur:82000000 cpbdur:82000000 q:21.94 tex:64516 mv:4922 misc:1538 imb:29 pmb:984 smb:337 d:- ref:0 ; in:5987 out:5987 type:P dur:82000000 cpbdur:82000000 q:22.46 tex:94915 mv:6459 misc:1514 imb:55 pmb:995 smb:300 d:- ref:0 ; in:5988 out:5988 type:P dur:82000000 cpbdur:82000000 q:21.06 tex:58975 mv:3991 misc:1538 imb:35 pmb:1027 smb:288 d:- ref:0 ; in:5989 out:5989 type:P dur:82000000 cpbdur:82000000 q:21.98 tex:79748 mv:5398 misc:1486 imb:23 pmb:934 smb:393 d:- ref:0 ; in:5990 out:5990 type:P dur:82000000 cpbdur:82000000 q:20.90 tex:56874 mv:4007 misc:1503 imb:17 pmb:1045 smb:288 d:- ref:0 ; in:5991 out:5991 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:66005 mv:4743 misc:1500 imb:19 pmb:927 smb:404 d:- ref:0 ; in:5992 out:5992 type:P dur:82000000 cpbdur:82000000 q:21.84 tex:75010 mv:5556 misc:1498 imb:13 pmb:952 smb:385 d:- ref:0 ; in:5993 out:5993 type:P dur:82000000 cpbdur:82000000 q:21.85 tex:74018 mv:5148 misc:1482 imb:21 pmb:944 smb:385 d:- ref:0 ; in:5994 out:5994 type:P dur:82000000 cpbdur:82000000 q:21.58 tex:61567 mv:4189 misc:1492 imb:29 pmb:887 smb:434 d:- ref:0 ; in:5995 out:5995 type:P dur:82000000 cpbdur:82000000 q:21.96 tex:84487 mv:6323 misc:1510 imb:30 pmb:977 smb:343 d:- ref:0 ; in:5996 out:5996 type:P dur:82000000 cpbdur:82000000 q:22.28 tex:78366 mv:6081 misc:1497 imb:37 pmb:999 smb:314 d:- ref:0 ; in:5997 out:5997 type:P dur:82000000 cpbdur:82000000 q:21.23 tex:61555 mv:4460 misc:1537 imb:20 pmb:1036 smb:294 d:- ref:0 ; in:5998 out:5998 type:P dur:82000000 cpbdur:82000000 q:21.41 tex:65889 mv:4724 misc:1539 imb:27 pmb:1014 smb:309 d:- ref:0 ; in:5999 out:5999 type:P dur:82000000 cpbdur:82000000 q:21.88 tex:68213 mv:5197 misc:1462 imb:30 pmb:863 smb:457 d:- ref:0 ; in:6000 out:6000 type:I dur:82000000 cpbdur:82000000 q:19.07 tex:443308 mv:15344 misc:372 imb:1350 pmb:0 smb:0 d:- ref:; in:6001 out:6001 type:P dur:82000000 cpbdur:82000000 q:25.70 tex:30846 mv:4244 misc:1422 imb:11 pmb:668 smb:671 d:- ref:0 ; in:6002 out:6002 type:P dur:82000000 cpbdur:82000000 q:23.88 tex:36977 mv:3271 misc:1480 imb:8 pmb:775 smb:567 d:- ref:0 ; in:6003 out:6003 type:P dur:82000000 cpbdur:82000000 q:23.32 tex:69658 mv:5908 misc:1538 imb:36 pmb:956 smb:358 d:- ref:0 ; in:6004 out:6004 type:P dur:82000000 cpbdur:82000000 q:22.86 tex:63269 mv:5493 misc:1494 imb:33 pmb:917 smb:400 d:- ref:0 ; in:6005 out:6005 type:P dur:82000000 cpbdur:82000000 q:21.98 tex:63871 mv:4538 misc:1527 imb:36 pmb:1032 smb:282 d:- ref:0 ; in:6006 out:6006 type:P dur:82000000 cpbdur:82000000 q:21.18 tex:69129 mv:4394 misc:1533 imb:32 pmb:1086 smb:232 d:- ref:0 ; in:6007 out:6007 type:P dur:82000000 cpbdur:82000000 q:22.00 tex:83038 mv:6595 misc:1519 imb:36 pmb:997 smb:317 d:- ref:0 ; in:6008 out:6008 type:P dur:82000000 cpbdur:82000000 q:22.28 tex:85095 mv:6934 misc:1523 imb:42 pmb:1014 smb:294 d:- ref:0 ; in:6009 out:6009 type:P dur:82000000 cpbdur:82000000 q:21.93 tex:51369 mv:4484 misc:1531 imb:33 pmb:932 smb:385 d:- ref:0 ; in:6010 out:6010 type:P dur:82000000 cpbdur:82000000 q:21.91 tex:66201 mv:5530 misc:1525 imb:46 pmb:1052 smb:252 d:- ref:0 ; in:6011 out:6011 type:P dur:82000000 cpbdur:82000000 q:22.12 tex:72513 mv:5558 misc:1521 imb:45 pmb:936 smb:369 d:- ref:0 ; in:6012 out:6012 type:P dur:82000000 cpbdur:82000000 q:21.43 tex:51183 mv:4128 misc:1537 imb:41 pmb:966 smb:343 d:- ref:0 ; in:6013 out:6013 type:P dur:82000000 cpbdur:82000000 q:21.97 tex:76123 mv:7021 misc:1512 imb:48 pmb:933 smb:369 d:- ref:0 ; in:6014 out:6014 type:P dur:82000000 cpbdur:82000000 q:21.31 tex:54617 mv:4347 misc:1540 imb:36 pmb:1015 smb:299 d:- ref:0 ; in:6015 out:6015 type:P dur:82000000 cpbdur:82000000 q:21.39 tex:71670 mv:5625 misc:1513 imb:38 pmb:1059 smb:253 d:- ref:0 ; in:6016 out:6016 type:P dur:82000000 cpbdur:82000000 q:21.69 tex:65993 mv:6092 misc:1483 imb:29 pmb:902 smb:419 d:- ref:0 ; in:6017 out:6017 type:P dur:82000000 cpbdur:82000000 q:22.15 tex:69380 mv:6636 misc:1504 imb:35 pmb:942 smb:373 d:- ref:0 ; in:6018 out:6018 type:P dur:82000000 cpbdur:82000000 q:20.89 tex:47280 mv:4211 misc:1533 imb:41 pmb:977 smb:332 d:- ref:0 ; in:6019 out:6019 type:P dur:82000000 cpbdur:82000000 q:21.98 tex:74206 mv:6969 misc:1497 imb:39 pmb:971 smb:340 d:- ref:0 ; in:6020 out:6020 type:P dur:82000000 cpbdur:82000000 q:22.10 tex:73561 mv:6894 misc:1529 imb:48 pmb:988 smb:314 d:- ref:0 ; in:6021 out:6021 type:P dur:82000000 cpbdur:82000000 q:21.99 tex:66894 mv:5476 misc:1510 imb:30 pmb:1032 smb:288 d:- ref:0 ; in:6022 out:6022 type:P dur:82000000 cpbdur:82000000 q:20.67 tex:52725 mv:4307 misc:1552 imb:27 pmb:1035 smb:288 d:- ref:0 ; in:6023 out:6023 type:P dur:82000000 cpbdur:82000000 q:21.59 tex:73896 mv:6432 misc:1512 imb:37 pmb:1006 smb:307 d:- ref:0 ; in:6024 out:6024 type:P dur:82000000 cpbdur:82000000 q:20.97 tex:69548 mv:5222 misc:1510 imb:26 pmb:1084 smb:240 d:- ref:0 ; in:6025 out:6025 type:P dur:82000000 cpbdur:82000000 q:21.83 tex:75345 mv:6552 misc:1511 imb:28 pmb:984 smb:338 d:- ref:0 ; in:6026 out:6026 type:P dur:82000000 cpbdur:82000000 q:22.07 tex:81174 mv:6364 misc:1510 imb:45 pmb:1064 smb:241 d:- ref:0 ; in:6027 out:6027 type:P dur:82000000 cpbdur:82000000 q:22.41 tex:90146 mv:6740 misc:1498 imb:41 pmb:1054 smb:255 d:- ref:0 ; in:6028 out:6028 type:P dur:82000000 cpbdur:82000000 q:22.14 tex:56641 mv:4637 misc:1562 imb:34 pmb:941 smb:375 d:- ref:0 ; in:6029 out:6029 type:P dur:82000000 cpbdur:82000000 q:21.98 tex:72167 mv:5913 misc:1520 imb:47 pmb:1053 smb:250 d:- ref:0 ; in:6030 out:6030 type:P dur:82000000 cpbdur:82000000 q:22.03 tex:74326 mv:5708 misc:1518 imb:30 pmb:1064 smb:256 d:- ref:0 ; in:6031 out:6031 type:P dur:82000000 cpbdur:82000000 q:22.47 tex:92302 mv:7407 misc:1523 imb:53 pmb:1067 smb:230 d:- ref:0 ; in:6032 out:6032 type:P dur:82000000 cpbdur:82000000 q:22.17 tex:70249 mv:5293 misc:1538 imb:27 pmb:1055 smb:268 d:- ref:0 ; in:6033 out:6033 type:P dur:82000000 cpbdur:82000000 q:22.85 tex:89721 mv:7587 misc:1500 imb:43 pmb:1065 smb:242 d:- ref:0 ; in:6034 out:6034 type:P dur:82000000 cpbdur:82000000 q:22.53 tex:60259 mv:5433 misc:1540 imb:32 pmb:971 smb:347 d:- ref:0 ; in:6035 out:6035 type:P dur:82000000 cpbdur:82000000 q:22.77 tex:81108 mv:6806 misc:1526 imb:31 pmb:1040 smb:279 d:- ref:0 ; in:6036 out:6036 type:P dur:82000000 cpbdur:82000000 q:22.20 tex:81790 mv:5542 misc:1492 imb:47 pmb:1154 smb:149 d:- ref:0 ; in:6037 out:6037 type:P dur:82000000 cpbdur:82000000 q:22.61 tex:70804 mv:5490 misc:1506 imb:30 pmb:896 smb:424 d:- ref:0 ; in:6038 out:6038 type:P dur:82000000 cpbdur:82000000 q:21.95 tex:59269 mv:4506 misc:1537 imb:24 pmb:1042 smb:284 d:- ref:0 ; in:6039 out:6039 type:P dur:82000000 cpbdur:82000000 q:22.58 tex:74271 mv:6606 misc:1491 imb:33 pmb:958 smb:359 d:- ref:0 ; in:6040 out:6040 type:P dur:82000000 cpbdur:82000000 q:21.70 tex:60885 mv:4279 misc:1540 imb:26 pmb:1039 smb:285 d:- ref:0 ; in:6041 out:6041 type:P dur:82000000 cpbdur:82000000 q:22.76 tex:83819 mv:7149 misc:1496 imb:40 pmb:1061 smb:249 d:- ref:0 ; in:6042 out:6042 type:P dur:82000000 cpbdur:82000000 q:22.02 tex:74860 mv:5051 misc:1505 imb:38 pmb:1135 smb:177 d:- ref:0 ; in:6043 out:6043 type:P dur:82000000 cpbdur:82000000 q:22.63 tex:69170 mv:6269 misc:1497 imb:30 pmb:1015 smb:305 d:- ref:0 ; in:6044 out:6044 type:P dur:82000000 cpbdur:82000000 q:22.82 tex:70811 mv:6548 misc:1505 imb:30 pmb:1008 smb:312 d:- ref:0 ; in:6045 out:6045 type:P dur:82000000 cpbdur:82000000 q:21.92 tex:72622 mv:4711 misc:1499 imb:40 pmb:1123 smb:187 d:- ref:0 ; in:6046 out:6046 type:P dur:82000000 cpbdur:82000000 q:22.29 tex:82337 mv:5835 misc:1500 imb:37 pmb:1079 smb:234 d:- ref:0 ; in:6047 out:6047 type:P dur:82000000 cpbdur:82000000 q:22.73 tex:77914 mv:6810 misc:1508 imb:28 pmb:1016 smb:306 d:- ref:0 ; in:6048 out:6048 type:P dur:82000000 cpbdur:82000000 q:22.30 tex:88689 mv:5733 misc:1506 imb:52 pmb:1087 smb:211 d:- ref:0 ; in:6049 out:6049 type:P dur:82000000 cpbdur:82000000 q:22.45 tex:100995 mv:6530 misc:1483 imb:41 pmb:1110 smb:199 d:- ref:0 ; in:6050 out:6050 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:74583 mv:5025 misc:1488 imb:39 pmb:963 smb:348 d:- ref:0 ; in:6051 out:6051 type:P dur:82000000 cpbdur:82000000 q:22.81 tex:80097 mv:5236 misc:1483 imb:28 pmb:968 smb:354 d:- ref:0 ; in:6052 out:6052 type:P dur:82000000 cpbdur:82000000 q:21.90 tex:69471 mv:4894 misc:1499 imb:44 pmb:1106 smb:200 d:- ref:0 ; in:6053 out:6053 type:P dur:82000000 cpbdur:82000000 q:21.80 tex:66143 mv:4373 misc:1532 imb:32 pmb:1025 smb:293 d:- ref:0 ; in:6054 out:6054 type:P dur:82000000 cpbdur:82000000 q:22.28 tex:105117 mv:6184 misc:1491 imb:37 pmb:1072 smb:241 d:- ref:0 ; in:6055 out:6055 type:P dur:82000000 cpbdur:82000000 q:22.51 tex:72577 mv:5904 misc:1487 imb:26 pmb:980 smb:344 d:- ref:0 ; in:6056 out:6056 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:76217 mv:4916 misc:1515 imb:45 pmb:1078 smb:227 d:- ref:0 ; in:6057 out:6057 type:P dur:82000000 cpbdur:82000000 q:22.45 tex:106515 mv:6797 misc:1512 imb:36 pmb:1073 smb:241 d:- ref:0 ; in:6058 out:6058 type:P dur:82000000 cpbdur:82000000 q:22.43 tex:92984 mv:5519 misc:1497 imb:33 pmb:1043 smb:274 d:- ref:0 ; in:6059 out:6059 type:P dur:82000000 cpbdur:82000000 q:22.72 tex:81554 mv:6008 misc:1454 imb:24 pmb:982 smb:344 d:- ref:0 ; in:6060 out:6060 type:P dur:82000000 cpbdur:82000000 q:23.07 tex:83452 mv:6151 misc:1469 imb:36 pmb:995 smb:319 d:- ref:0 ; in:6061 out:6061 type:P dur:82000000 cpbdur:82000000 q:22.27 tex:76999 mv:4646 misc:1499 imb:52 pmb:1084 smb:214 d:- ref:0 ; in:6062 out:6062 type:P dur:82000000 cpbdur:82000000 q:21.07 tex:63828 mv:4190 misc:1502 imb:44 pmb:1122 smb:184 d:- ref:0 ; in:6063 out:6063 type:P dur:82000000 cpbdur:82000000 q:22.47 tex:107926 mv:6772 misc:1462 imb:31 pmb:1058 smb:261 d:- ref:0 ; in:6064 out:6064 type:P dur:82000000 cpbdur:82000000 q:22.78 tex:77458 mv:5840 misc:1470 imb:29 pmb:950 smb:371 d:- ref:0 ; in:6065 out:6065 type:P dur:82000000 cpbdur:82000000 q:22.44 tex:102027 mv:5947 misc:1482 imb:39 pmb:1113 smb:198 d:- ref:0 ; in:6066 out:6066 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:46807 mv:3747 misc:1558 imb:38 pmb:919 smb:393 d:- ref:0 ; in:6067 out:6067 type:P dur:82000000 cpbdur:82000000 q:22.64 tex:86527 mv:5783 misc:1434 imb:20 pmb:971 smb:359 d:- ref:0 ; in:6068 out:6068 type:P dur:82000000 cpbdur:82000000 q:22.30 tex:74357 mv:5179 misc:1528 imb:71 pmb:1053 smb:226 d:- ref:0 ; in:6069 out:6069 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:76497 mv:5123 misc:1436 imb:29 pmb:937 smb:384 d:- ref:0 ; in:6070 out:6070 type:P dur:82000000 cpbdur:82000000 q:21.81 tex:62773 mv:4288 misc:1531 imb:50 pmb:1018 smb:282 d:- ref:0 ; in:6071 out:6071 type:P dur:82000000 cpbdur:82000000 q:22.61 tex:88651 mv:5943 misc:1422 imb:15 pmb:921 smb:414 d:- ref:0 ; in:6072 out:6072 type:P dur:82000000 cpbdur:82000000 q:22.80 tex:70419 mv:5256 misc:1485 imb:28 pmb:894 smb:428 d:- ref:0 ; in:6073 out:6073 type:P dur:82000000 cpbdur:82000000 q:22.52 tex:75655 mv:5021 misc:1452 imb:25 pmb:929 smb:396 d:- ref:0 ; in:6074 out:6074 type:P dur:82000000 cpbdur:82000000 q:22.46 tex:115100 mv:6262 misc:1502 imb:61 pmb:1088 smb:201 d:- ref:0 ; in:6075 out:6075 type:P dur:82000000 cpbdur:82000000 q:22.90 tex:89974 mv:5879 misc:1451 imb:37 pmb:943 smb:370 d:- ref:0 ; in:6076 out:6076 type:P dur:82000000 cpbdur:82000000 q:22.63 tex:64451 mv:4444 misc:1425 imb:21 pmb:910 smb:419 d:- ref:0 ; in:6077 out:6077 type:P dur:82000000 cpbdur:82000000 q:22.91 tex:86708 mv:6151 misc:1485 imb:38 pmb:935 smb:377 d:- ref:0 ; in:6078 out:6078 type:P dur:82000000 cpbdur:82000000 q:22.16 tex:84076 mv:4792 misc:1524 imb:41 pmb:1024 smb:285 d:- ref:0 ; in:6079 out:6079 type:P dur:82000000 cpbdur:82000000 q:22.57 tex:78414 mv:5190 misc:1436 imb:21 pmb:848 smb:481 d:- ref:0 ; in:6080 out:6080 type:P dur:82000000 cpbdur:82000000 q:21.90 tex:67516 mv:4300 misc:1536 imb:43 pmb:974 smb:333 d:- ref:0 ; in:6081 out:6081 type:P dur:82000000 cpbdur:82000000 q:22.66 tex:87600 mv:4650 misc:1438 imb:26 pmb:886 smb:438 d:- ref:0 ; in:6082 out:6082 type:P dur:82000000 cpbdur:82000000 q:22.29 tex:106217 mv:4987 misc:1508 imb:43 pmb:1031 smb:276 d:- ref:0 ; in:6083 out:6083 type:P dur:82000000 cpbdur:82000000 q:22.77 tex:85146 mv:4949 misc:1465 imb:27 pmb:895 smb:428 d:- ref:0 ; in:6084 out:6084 type:P dur:82000000 cpbdur:82000000 q:22.75 tex:78340 mv:4616 misc:1388 imb:23 pmb:792 smb:535 d:- ref:0 ; in:6085 out:6085 type:P dur:82000000 cpbdur:82000000 q:22.00 tex:83915 mv:4397 misc:1512 imb:46 pmb:991 smb:313 d:- ref:0 ; in:6086 out:6086 type:P dur:82000000 cpbdur:82000000 q:21.31 tex:65281 mv:4059 misc:1564 imb:39 pmb:1051 smb:260 d:- ref:0 ; in:6087 out:6087 type:P dur:82000000 cpbdur:82000000 q:21.31 tex:76150 mv:3722 misc:1528 imb:12 pmb:964 smb:374 d:- ref:0 ; in:6088 out:6088 type:P dur:82000000 cpbdur:82000000 q:20.91 tex:68001 mv:3471 misc:1544 imb:13 pmb:949 smb:388 d:- ref:0 ; in:6089 out:6089 type:P dur:82000000 cpbdur:82000000 q:22.17 tex:108470 mv:4770 misc:1424 imb:6 pmb:868 smb:476 d:- ref:0 ; in:6090 out:6090 type:P dur:82000000 cpbdur:82000000 q:21.75 tex:57730 mv:3637 misc:1513 imb:8 pmb:965 smb:377 d:- ref:0 ; in:6091 out:6091 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:82327 mv:4238 misc:1531 imb:11 pmb:1174 smb:165 d:- ref:0 ; in:6092 out:6092 type:P dur:82000000 cpbdur:82000000 q:18.45 tex:125986 mv:4248 misc:1454 imb:5 pmb:1298 smb:47 d:- ref:0 ; in:6093 out:6093 type:P dur:82000000 cpbdur:82000000 q:17.98 tex:43663 mv:2516 misc:1597 imb:1 pmb:802 smb:547 d:- ref:0 ; in:6094 out:6094 type:P dur:82000000 cpbdur:82000000 q:18.40 tex:60636 mv:3053 misc:1591 imb:3 pmb:979 smb:368 d:- ref:0 ; in:6095 out:6095 type:P dur:82000000 cpbdur:82000000 q:16.66 tex:74100 mv:3537 misc:1547 imb:0 pmb:1177 smb:173 d:- ref:0 ; in:6096 out:6096 type:P dur:82000000 cpbdur:82000000 q:16.69 tex:45560 mv:3024 misc:1616 imb:0 pmb:994 smb:356 d:- ref:0 ; in:6097 out:6097 type:P dur:82000000 cpbdur:82000000 q:17.70 tex:37724 mv:2201 misc:1523 imb:1 pmb:703 smb:646 d:- ref:0 ; in:6098 out:6098 type:P dur:82000000 cpbdur:82000000 q:16.67 tex:39968 mv:2655 misc:1593 imb:0 pmb:873 smb:477 d:- ref:0 ; in:6099 out:6099 type:P dur:82000000 cpbdur:82000000 q:16.77 tex:40781 mv:2855 misc:1612 imb:2 pmb:931 smb:417 d:- ref:0 ; in:6100 out:6100 type:P dur:82000000 cpbdur:82000000 q:18.21 tex:49896 mv:2535 misc:1569 imb:0 pmb:821 smb:529 d:- ref:0 ; in:6101 out:6101 type:P dur:82000000 cpbdur:82000000 q:17.80 tex:26841 mv:2297 misc:1598 imb:2 pmb:743 smb:605 d:- ref:0 ; in:6102 out:6102 type:P dur:82000000 cpbdur:82000000 q:17.68 tex:32500 mv:2597 misc:1631 imb:1 pmb:835 smb:514 d:- ref:0 ; in:6103 out:6103 type:P dur:82000000 cpbdur:82000000 q:17.65 tex:31858 mv:2576 misc:1582 imb:3 pmb:816 smb:531 d:- ref:0 ; in:6104 out:6104 type:P dur:82000000 cpbdur:82000000 q:18.20 tex:50392 mv:2913 misc:1591 imb:3 pmb:931 smb:416 d:- ref:0 ; in:6105 out:6105 type:P dur:82000000 cpbdur:82000000 q:18.27 tex:45221 mv:2610 misc:1577 imb:0 pmb:850 smb:500 d:- ref:0 ; in:6106 out:6106 type:P dur:82000000 cpbdur:82000000 q:18.27 tex:32068 mv:2147 misc:1521 imb:1 pmb:689 smb:660 d:- ref:0 ; in:6107 out:6107 type:P dur:82000000 cpbdur:82000000 q:17.44 tex:77150 mv:3486 misc:1540 imb:0 pmb:1160 smb:190 d:- ref:0 ; in:6108 out:6108 type:P dur:82000000 cpbdur:82000000 q:20.60 tex:63829 mv:2162 misc:1329 imb:1 pmb:616 smb:733 d:- ref:0 ; in:6109 out:6109 type:P dur:82000000 cpbdur:82000000 q:19.04 tex:47752 mv:2402 misc:1470 imb:1 pmb:758 smb:591 d:- ref:0 ; in:6110 out:6110 type:P dur:82000000 cpbdur:82000000 q:20.18 tex:58645 mv:1539 misc:1096 imb:0 pmb:421 smb:929 d:- ref:0 ; in:6111 out:6111 type:P dur:82000000 cpbdur:82000000 q:19.18 tex:39957 mv:1851 misc:1408 imb:0 pmb:597 smb:753 d:- ref:0 ; in:6112 out:6112 type:P dur:82000000 cpbdur:82000000 q:20.51 tex:57337 mv:1751 misc:1160 imb:0 pmb:481 smb:869 d:- ref:0 ; in:6113 out:6113 type:P dur:82000000 cpbdur:82000000 q:19.15 tex:45798 mv:2484 misc:1502 imb:0 pmb:786 smb:564 d:- ref:0 ; in:6114 out:6114 type:P dur:82000000 cpbdur:82000000 q:21.40 tex:53552 mv:11788 misc:1420 imb:1332 pmb:18 smb:0 d:- ref:0 ; in:6115 out:6115 type:P dur:82000000 cpbdur:82000000 q:19.97 tex:12932 mv:2537 misc:819 imb:63 pmb:227 smb:1060 d:- ref:0 ; in:6116 out:6116 type:P dur:82000000 cpbdur:82000000 q:19.58 tex:19141 mv:3736 misc:875 imb:121 pmb:214 smb:1015 d:- ref:0 ; in:6117 out:6117 type:P dur:82000000 cpbdur:82000000 q:18.63 tex:11418 mv:2787 misc:1403 imb:148 pmb:381 smb:821 d:- ref:0 ; in:6118 out:6118 type:P dur:82000000 cpbdur:82000000 q:19.17 tex:28919 mv:4752 misc:1201 imb:150 pmb:350 smb:850 d:- ref:0 ; in:6119 out:6119 type:P dur:82000000 cpbdur:82000000 q:17.82 tex:7671 mv:1524 misc:1101 imb:69 pmb:238 smb:1043 d:- ref:0 ; in:6120 out:6120 type:P dur:82000000 cpbdur:82000000 q:19.31 tex:32885 mv:4315 misc:1176 imb:174 pmb:269 smb:907 d:- ref:0 ; in:6121 out:6121 type:P dur:82000000 cpbdur:82000000 q:17.92 tex:7279 mv:1345 misc:1080 imb:36 pmb:235 smb:1079 d:- ref:0 ; in:6122 out:6122 type:P dur:82000000 cpbdur:82000000 q:19.41 tex:36429 mv:4411 misc:1152 imb:165 pmb:279 smb:906 d:- ref:0 ; in:6123 out:6123 type:P dur:82000000 cpbdur:82000000 q:18.36 tex:6946 mv:1750 misc:1152 imb:67 pmb:266 smb:1017 d:- ref:0 ; in:6124 out:6124 type:P dur:82000000 cpbdur:82000000 q:18.73 tex:24074 mv:3526 misc:944 imb:105 pmb:246 smb:999 d:- ref:0 ; in:6125 out:6125 type:P dur:82000000 cpbdur:82000000 q:17.66 tex:6815 mv:1775 misc:1178 imb:83 pmb:257 smb:1010 d:- ref:0 ; in:6126 out:6126 type:P dur:82000000 cpbdur:82000000 q:18.82 tex:27892 mv:4742 misc:1222 imb:143 pmb:338 smb:869 d:- ref:0 ; in:6127 out:6127 type:P dur:82000000 cpbdur:82000000 q:17.35 tex:17272 mv:2895 misc:1433 imb:121 pmb:455 smb:774 d:- ref:0 ; in:6128 out:6128 type:P dur:82000000 cpbdur:82000000 q:18.55 tex:23193 mv:4364 misc:1083 imb:87 pmb:312 smb:951 d:- ref:0 ; in:6129 out:6129 type:P dur:82000000 cpbdur:82000000 q:17.61 tex:6743 mv:1569 misc:1184 imb:58 pmb:261 smb:1031 d:- ref:0 ; in:6130 out:6130 type:P dur:82000000 cpbdur:82000000 q:18.68 tex:31818 mv:4077 misc:921 imb:126 pmb:227 smb:997 d:- ref:0 ; in:6131 out:6131 type:P dur:82000000 cpbdur:82000000 q:17.84 tex:6296 mv:1469 misc:1163 imb:59 pmb:261 smb:1030 d:- ref:0 ; in:6132 out:6132 type:P dur:82000000 cpbdur:82000000 q:18.82 tex:31974 mv:3632 misc:794 imb:150 pmb:168 smb:1032 d:- ref:0 ; in:6133 out:6133 type:P dur:82000000 cpbdur:82000000 q:17.99 tex:7718 mv:1395 misc:1039 imb:47 pmb:237 smb:1066 d:- ref:0 ; in:6134 out:6134 type:P dur:82000000 cpbdur:82000000 q:18.84 tex:31927 mv:3900 misc:813 imb:119 pmb:196 smb:1035 d:- ref:0 ; in:6135 out:6135 type:P dur:82000000 cpbdur:82000000 q:17.71 tex:6003 mv:1157 misc:1008 imb:33 pmb:223 smb:1094 d:- ref:0 ; in:6136 out:6136 type:P dur:82000000 cpbdur:82000000 q:18.65 tex:27583 mv:4227 misc:950 imb:111 pmb:249 smb:990 d:- ref:0 ; in:6137 out:6137 type:P dur:82000000 cpbdur:82000000 q:17.29 tex:16723 mv:2352 misc:1309 imb:101 pmb:376 smb:873 d:- ref:0 ; in:6138 out:6138 type:P dur:82000000 cpbdur:82000000 q:18.62 tex:24072 mv:4067 misc:1005 imb:118 pmb:279 smb:953 d:- ref:0 ; in:6139 out:6139 type:P dur:82000000 cpbdur:82000000 q:18.04 tex:6878 mv:1697 misc:1169 imb:50 pmb:301 smb:999 d:- ref:0 ; in:6140 out:6140 type:P dur:82000000 cpbdur:82000000 q:18.29 tex:26125 mv:3896 misc:915 imb:88 pmb:266 smb:996 d:- ref:0 ; in:6141 out:6141 type:P dur:82000000 cpbdur:82000000 q:17.63 tex:6769 mv:1339 misc:980 imb:32 pmb:221 smb:1097 d:- ref:0 ; in:6142 out:6142 type:P dur:82000000 cpbdur:82000000 q:18.36 tex:27969 mv:3690 misc:893 imb:106 pmb:230 smb:1014 d:- ref:0 ; in:6143 out:6143 type:P dur:82000000 cpbdur:82000000 q:17.46 tex:9914 mv:2095 misc:1407 imb:105 pmb:361 smb:884 d:- ref:0 ; in:6144 out:6144 type:P dur:82000000 cpbdur:82000000 q:18.76 tex:31212 mv:3868 misc:872 imb:137 pmb:188 smb:1025 d:- ref:0 ; in:6145 out:6145 type:P dur:82000000 cpbdur:82000000 q:17.93 tex:6625 mv:1139 misc:988 imb:38 pmb:211 smb:1101 d:- ref:0 ; in:6146 out:6146 type:P dur:82000000 cpbdur:82000000 q:19.09 tex:34718 mv:3739 misc:823 imb:142 pmb:165 smb:1043 d:- ref:0 ; in:6147 out:6147 type:P dur:82000000 cpbdur:82000000 q:17.92 tex:5388 mv:1369 misc:1035 imb:51 pmb:217 smb:1082 d:- ref:0 ; in:6148 out:6148 type:P dur:82000000 cpbdur:82000000 q:18.68 tex:24744 mv:3411 misc:901 imb:103 pmb:233 smb:1014 d:- ref:0 ; in:6149 out:6149 type:P dur:82000000 cpbdur:82000000 q:17.00 tex:13665 mv:2074 misc:1341 imb:94 pmb:370 smb:886 d:- ref:0 ; in:6150 out:6150 type:P dur:82000000 cpbdur:82000000 q:18.74 tex:26166 mv:4025 misc:1073 imb:110 pmb:285 smb:955 d:- ref:0 ; in:6151 out:6151 type:P dur:82000000 cpbdur:82000000 q:17.19 tex:13618 mv:2145 misc:1269 imb:80 pmb:377 smb:893 d:- ref:0 ; in:6152 out:6152 type:P dur:82000000 cpbdur:82000000 q:18.48 tex:27233 mv:4015 misc:912 imb:97 pmb:259 smb:994 d:- ref:0 ; in:6153 out:6153 type:P dur:82000000 cpbdur:82000000 q:17.47 tex:11402 mv:2521 misc:1381 imb:131 pmb:361 smb:858 d:- ref:0 ; in:6154 out:6154 type:P dur:82000000 cpbdur:82000000 q:18.65 tex:30582 mv:3906 misc:896 imb:126 pmb:218 smb:1006 d:- ref:0 ; in:6155 out:6155 type:P dur:82000000 cpbdur:82000000 q:17.83 tex:6671 mv:1394 misc:1047 imb:51 pmb:236 smb:1063 d:- ref:0 ; in:6156 out:6156 type:P dur:82000000 cpbdur:82000000 q:18.86 tex:31411 mv:3650 misc:819 imb:152 pmb:162 smb:1036 d:- ref:0 ; in:6157 out:6157 type:P dur:82000000 cpbdur:82000000 q:17.95 tex:5792 mv:1099 misc:1013 imb:38 pmb:197 smb:1115 d:- ref:0 ; in:6158 out:6158 type:P dur:82000000 cpbdur:82000000 q:18.80 tex:31409 mv:3940 misc:835 imb:140 pmb:184 smb:1026 d:- ref:0 ; in:6159 out:6159 type:P dur:82000000 cpbdur:82000000 q:17.67 tex:5737 mv:1128 misc:967 imb:32 pmb:222 smb:1096 d:- ref:0 ; in:6160 out:6160 type:P dur:82000000 cpbdur:82000000 q:18.68 tex:25629 mv:4072 misc:947 imb:117 pmb:242 smb:991 d:- ref:0 ; in:6161 out:6161 type:P dur:82000000 cpbdur:82000000 q:18.08 tex:7512 mv:1618 misc:1134 imb:64 pmb:262 smb:1024 d:- ref:0 ; in:6162 out:6162 type:P dur:82000000 cpbdur:82000000 q:18.30 tex:30376 mv:4151 misc:881 imb:129 pmb:237 smb:984 d:- ref:0 ; in:6163 out:6163 type:P dur:82000000 cpbdur:82000000 q:17.38 tex:11281 mv:2264 misc:1335 imb:94 pmb:382 smb:874 d:- ref:0 ; in:6164 out:6164 type:P dur:82000000 cpbdur:82000000 q:18.51 tex:23598 mv:4239 misc:955 imb:111 pmb:275 smb:964 d:- ref:0 ; in:6165 out:6165 type:P dur:82000000 cpbdur:82000000 q:17.00 tex:15008 mv:2011 misc:1245 imb:64 pmb:357 smb:929 d:- ref:0 ; in:6166 out:6166 type:P dur:82000000 cpbdur:82000000 q:18.51 tex:24864 mv:4112 misc:984 imb:122 pmb:250 smb:978 d:- ref:0 ; in:6167 out:6167 type:P dur:82000000 cpbdur:82000000 q:17.02 tex:13618 mv:1923 misc:1251 imb:78 pmb:333 smb:939 d:- ref:0 ; in:6168 out:6168 type:P dur:82000000 cpbdur:82000000 q:18.92 tex:30993 mv:4378 misc:1037 imb:173 pmb:232 smb:945 d:- ref:0 ; in:6169 out:6169 type:P dur:82000000 cpbdur:82000000 q:17.93 tex:16508 mv:2359 misc:877 imb:57 pmb:235 smb:1058 d:- ref:0 ; in:6170 out:6170 type:P dur:82000000 cpbdur:82000000 q:21.93 tex:360681 mv:16156 misc:1411 imb:1252 pmb:98 smb:0 d:- ref:0 ; in:6171 out:6171 type:P dur:82000000 cpbdur:82000000 q:25.51 tex:33850 mv:2922 misc:1284 imb:30 pmb:528 smb:792 d:- ref:0 ; in:6172 out:6172 type:P dur:82000000 cpbdur:82000000 q:24.50 tex:61622 mv:4592 misc:1410 imb:71 pmb:694 smb:585 d:- ref:0 ; in:6173 out:6173 type:P dur:82000000 cpbdur:82000000 q:23.77 tex:77136 mv:4760 misc:1304 imb:26 pmb:692 smb:632 d:- ref:0 ; in:6174 out:6174 type:P dur:82000000 cpbdur:82000000 q:21.99 tex:61325 mv:3444 misc:1495 imb:101 pmb:792 smb:457 d:- ref:0 ; in:6175 out:6175 type:P dur:82000000 cpbdur:82000000 q:20.03 tex:64311 mv:3650 misc:1527 imb:106 pmb:850 smb:394 d:- ref:0 ; in:6176 out:6176 type:P dur:82000000 cpbdur:82000000 q:20.37 tex:60185 mv:3090 misc:1477 imb:66 pmb:708 smb:576 d:- ref:0 ; in:6177 out:6177 type:P dur:82000000 cpbdur:82000000 q:20.11 tex:54813 mv:2897 misc:1450 imb:104 pmb:583 smb:663 d:- ref:0 ; in:6178 out:6178 type:P dur:82000000 cpbdur:82000000 q:18.69 tex:61431 mv:4260 misc:1557 imb:107 pmb:950 smb:293 d:- ref:0 ; in:6179 out:6179 type:P dur:82000000 cpbdur:82000000 q:19.97 tex:52465 mv:2642 misc:1373 imb:23 pmb:592 smb:735 d:- ref:0 ; in:6180 out:6180 type:P dur:82000000 cpbdur:82000000 q:18.88 tex:43715 mv:2719 misc:1542 imb:27 pmb:747 smb:576 d:- ref:0 ; in:6181 out:6181 type:P dur:82000000 cpbdur:82000000 q:19.78 tex:32442 mv:2538 misc:1452 imb:75 pmb:602 smb:673 d:- ref:0 ; in:6182 out:6182 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:56198 mv:5864 misc:1546 imb:335 pmb:692 smb:323 d:- ref:0 ; in:6183 out:6183 type:P dur:82000000 cpbdur:82000000 q:20.23 tex:43445 mv:4404 misc:1543 imb:174 pmb:758 smb:418 d:- ref:0 ; in:6184 out:6184 type:P dur:82000000 cpbdur:82000000 q:20.61 tex:45303 mv:6497 misc:1528 imb:391 pmb:785 smb:174 d:- ref:0 ; in:6185 out:6185 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:65480 mv:3638 misc:1490 imb:95 pmb:720 smb:535 d:- ref:0 ; in:6186 out:6186 type:P dur:82000000 cpbdur:82000000 q:19.64 tex:29780 mv:2227 misc:1513 imb:27 pmb:621 smb:702 d:- ref:0 ; in:6187 out:6187 type:P dur:82000000 cpbdur:82000000 q:19.19 tex:75124 mv:3617 misc:1531 imb:49 pmb:959 smb:342 d:- ref:0 ; in:6188 out:6188 type:P dur:82000000 cpbdur:82000000 q:20.33 tex:45886 mv:4947 misc:1559 imb:245 pmb:715 smb:390 d:- ref:0 ; in:6189 out:6189 type:P dur:82000000 cpbdur:82000000 q:19.57 tex:22958 mv:3323 misc:1447 imb:193 pmb:443 smb:714 d:- ref:0 ; in:6190 out:6190 type:P dur:82000000 cpbdur:82000000 q:19.44 tex:71824 mv:6305 misc:1519 imb:291 pmb:931 smb:128 d:- ref:0 ; in:6191 out:6191 type:P dur:82000000 cpbdur:82000000 q:19.05 tex:32750 mv:2454 misc:1524 imb:41 pmb:576 smb:733 d:- ref:0 ; in:6192 out:6192 type:P dur:82000000 cpbdur:82000000 q:19.32 tex:62451 mv:2666 misc:1491 imb:35 pmb:684 smb:631 d:- ref:0 ; in:6193 out:6193 type:P dur:82000000 cpbdur:82000000 q:17.84 tex:32639 mv:2408 misc:1489 imb:25 pmb:692 smb:633 d:- ref:0 ; in:6194 out:6194 type:P dur:82000000 cpbdur:82000000 q:18.93 tex:39034 mv:2808 misc:1550 imb:62 pmb:622 smb:666 d:- ref:0 ; in:6195 out:6195 type:P dur:82000000 cpbdur:82000000 q:17.36 tex:62630 mv:3584 misc:1554 imb:35 pmb:1042 smb:273 d:- ref:0 ; in:6196 out:6196 type:P dur:82000000 cpbdur:82000000 q:18.23 tex:36060 mv:2654 misc:1582 imb:33 pmb:732 smb:585 d:- ref:0 ; in:6197 out:6197 type:P dur:82000000 cpbdur:82000000 q:18.09 tex:29089 mv:2136 misc:1391 imb:37 pmb:452 smb:861 d:- ref:0 ; in:6198 out:6198 type:P dur:82000000 cpbdur:82000000 q:19.20 tex:52022 mv:3758 misc:1564 imb:93 pmb:804 smb:453 d:- ref:0 ; in:6199 out:6199 type:P dur:82000000 cpbdur:82000000 q:17.96 tex:25678 mv:2235 misc:1519 imb:43 pmb:571 smb:736 d:- ref:0 ; in:6200 out:6200 type:P dur:82000000 cpbdur:82000000 q:19.42 tex:58799 mv:3227 misc:1574 imb:67 pmb:701 smb:582 d:- ref:0 ; in:6201 out:6201 type:P dur:82000000 cpbdur:82000000 q:19.22 tex:40825 mv:2318 misc:1393 imb:44 pmb:552 smb:754 d:- ref:0 ; in:6202 out:6202 type:P dur:82000000 cpbdur:82000000 q:19.12 tex:39537 mv:3262 misc:1561 imb:76 pmb:742 smb:532 d:- ref:0 ; in:6203 out:6203 type:P dur:82000000 cpbdur:82000000 q:19.62 tex:29489 mv:2971 misc:1444 imb:141 pmb:451 smb:758 d:- ref:0 ; in:6204 out:6204 type:P dur:82000000 cpbdur:82000000 q:18.67 tex:41002 mv:4266 misc:1604 imb:157 pmb:820 smb:373 d:- ref:0 ; in:6205 out:6205 type:P dur:82000000 cpbdur:82000000 q:18.01 tex:33981 mv:2955 misc:1560 imb:47 pmb:763 smb:540 d:- ref:0 ; in:6206 out:6206 type:P dur:82000000 cpbdur:82000000 q:19.36 tex:55651 mv:2804 misc:1473 imb:41 pmb:648 smb:661 d:- ref:0 ; in:6207 out:6207 type:P dur:82000000 cpbdur:82000000 q:19.18 tex:57067 mv:2377 misc:1436 imb:23 pmb:653 smb:674 d:- ref:0 ; in:6208 out:6208 type:P dur:82000000 cpbdur:82000000 q:18.91 tex:23783 mv:2379 misc:1534 imb:38 pmb:609 smb:703 d:- ref:0 ; in:6209 out:6209 type:P dur:82000000 cpbdur:82000000 q:18.66 tex:33068 mv:1767 misc:1309 imb:15 pmb:441 smb:894 d:- ref:0 ; in:6210 out:6210 type:P dur:82000000 cpbdur:82000000 q:19.29 tex:43275 mv:3149 misc:1568 imb:65 pmb:755 smb:530 d:- ref:0 ; in:6211 out:6211 type:P dur:82000000 cpbdur:82000000 q:17.40 tex:56741 mv:3404 misc:1551 imb:23 pmb:1034 smb:293 d:- ref:0 ; in:6212 out:6212 type:P dur:82000000 cpbdur:82000000 q:18.54 tex:28757 mv:2573 misc:1510 imb:44 pmb:573 smb:733 d:- ref:0 ; in:6213 out:6213 type:P dur:82000000 cpbdur:82000000 q:17.21 tex:38283 mv:3082 misc:1595 imb:30 pmb:886 smb:434 d:- ref:0 ; in:6214 out:6214 type:P dur:82000000 cpbdur:82000000 q:17.06 tex:31263 mv:2905 misc:1624 imb:29 pmb:831 smb:490 d:- ref:0 ; in:6215 out:6215 type:P dur:82000000 cpbdur:82000000 q:18.58 tex:27589 mv:1826 misc:1345 imb:17 pmb:420 smb:913 d:- ref:0 ; in:6216 out:6216 type:P dur:82000000 cpbdur:82000000 q:18.09 tex:25977 mv:2109 misc:1498 imb:34 pmb:561 smb:755 d:- ref:0 ; in:6217 out:6217 type:P dur:82000000 cpbdur:82000000 q:17.13 tex:42068 mv:3209 misc:1603 imb:47 pmb:869 smb:434 d:- ref:0 ; in:6218 out:6218 type:P dur:82000000 cpbdur:82000000 q:18.76 tex:37648 mv:2409 misc:1519 imb:36 pmb:561 smb:753 d:- ref:0 ; in:6219 out:6219 type:P dur:82000000 cpbdur:82000000 q:17.69 tex:20719 mv:1699 misc:1430 imb:17 pmb:477 smb:856 d:- ref:0 ; in:6220 out:6220 type:P dur:82000000 cpbdur:82000000 q:18.03 tex:35809 mv:3097 misc:1598 imb:64 pmb:749 smb:537 d:- ref:0 ; in:6221 out:6221 type:P dur:82000000 cpbdur:82000000 q:20.18 tex:53405 mv:2894 misc:1501 imb:55 pmb:662 smb:633 d:- ref:0 ; in:6222 out:6222 type:P dur:82000000 cpbdur:82000000 q:19.85 tex:37622 mv:3145 misc:1521 imb:132 pmb:575 smb:643 d:- ref:0 ; in:6223 out:6223 type:P dur:82000000 cpbdur:82000000 q:18.77 tex:52081 mv:4858 misc:1557 imb:162 pmb:926 smb:262 d:- ref:0 ; in:6224 out:6224 type:P dur:82000000 cpbdur:82000000 q:18.64 tex:21070 mv:1977 misc:1449 imb:22 pmb:491 smb:837 d:- ref:0 ; in:6225 out:6225 type:P dur:82000000 cpbdur:82000000 q:17.23 tex:61639 mv:3635 misc:1558 imb:33 pmb:1061 smb:256 d:- ref:0 ; in:6226 out:6226 type:P dur:82000000 cpbdur:82000000 q:17.67 tex:18880 mv:2136 misc:1448 imb:66 pmb:476 smb:808 d:- ref:0 ; in:6227 out:6227 type:P dur:82000000 cpbdur:82000000 q:19.68 tex:54291 mv:2846 misc:1447 imb:64 pmb:614 smb:672 d:- ref:0 ; in:6228 out:6228 type:P dur:82000000 cpbdur:82000000 q:18.50 tex:37584 mv:3703 misc:1585 imb:126 pmb:739 smb:485 d:- ref:0 ; in:6229 out:6229 type:P dur:82000000 cpbdur:82000000 q:17.66 tex:23473 mv:2640 misc:1575 imb:45 pmb:680 smb:625 d:- ref:0 ; in:6230 out:6230 type:P dur:82000000 cpbdur:82000000 q:17.79 tex:26443 mv:2005 misc:1416 imb:38 pmb:451 smb:861 d:- ref:0 ; in:6231 out:6231 type:P dur:82000000 cpbdur:82000000 q:18.10 tex:29040 mv:2819 misc:1581 imb:57 pmb:705 smb:588 d:- ref:0 ; in:6232 out:6232 type:P dur:82000000 cpbdur:82000000 q:16.46 tex:100883 mv:4242 misc:1483 imb:36 pmb:1226 smb:88 d:- ref:0 ; in:6233 out:6233 type:P dur:82000000 cpbdur:82000000 q:17.96 tex:26193 mv:2441 misc:1534 imb:31 pmb:603 smb:716 d:- ref:0 ; in:6234 out:6234 type:P dur:82000000 cpbdur:82000000 q:18.95 tex:51964 mv:2472 misc:1444 imb:25 pmb:604 smb:721 d:- ref:0 ; in:6235 out:6235 type:P dur:82000000 cpbdur:82000000 q:18.79 tex:39950 mv:2532 misc:1454 imb:54 pmb:554 smb:742 d:- ref:0 ; in:6236 out:6236 type:P dur:82000000 cpbdur:82000000 q:18.73 tex:23696 mv:2229 misc:1427 imb:52 pmb:455 smb:843 d:- ref:0 ; in:6237 out:6237 type:P dur:82000000 cpbdur:82000000 q:18.54 tex:35650 mv:1951 misc:1383 imb:23 pmb:547 smb:780 d:- ref:0 ; in:6238 out:6238 type:P dur:82000000 cpbdur:82000000 q:18.90 tex:39360 mv:3165 misc:1563 imb:77 pmb:703 smb:570 d:- ref:0 ; in:6239 out:6239 type:P dur:82000000 cpbdur:82000000 q:18.37 tex:39292 mv:2477 misc:1551 imb:24 pmb:671 smb:655 d:- ref:0 ; in:6240 out:6240 type:P dur:82000000 cpbdur:82000000 q:18.25 tex:32575 mv:2963 misc:1606 imb:60 pmb:715 smb:575 d:- ref:0 ; in:6241 out:6241 type:P dur:82000000 cpbdur:82000000 q:17.35 tex:49457 mv:3356 misc:1587 imb:28 pmb:974 smb:348 d:- ref:0 ; in:6242 out:6242 type:P dur:82000000 cpbdur:82000000 q:17.86 tex:25872 mv:2508 misc:1548 imb:35 pmb:606 smb:709 d:- ref:0 ; in:6243 out:6243 type:P dur:82000000 cpbdur:82000000 q:17.87 tex:23651 mv:2464 misc:1549 imb:46 pmb:628 smb:676 d:- ref:0 ; in:6244 out:6244 type:P dur:82000000 cpbdur:82000000 q:19.34 tex:57589 mv:3175 misc:1580 imb:49 pmb:803 smb:498 d:- ref:0 ; in:6245 out:6245 type:P dur:82000000 cpbdur:82000000 q:19.51 tex:24027 mv:2169 misc:1436 imb:39 pmb:499 smb:812 d:- ref:0 ; in:6246 out:6246 type:P dur:82000000 cpbdur:82000000 q:18.53 tex:39373 mv:3129 misc:1578 imb:67 pmb:745 smb:538 d:- ref:0 ; in:6247 out:6247 type:P dur:82000000 cpbdur:82000000 q:17.62 tex:21947 mv:2590 misc:1607 imb:29 pmb:700 smb:621 d:- ref:0 ; in:6248 out:6248 type:P dur:82000000 cpbdur:82000000 q:18.26 tex:31653 mv:2766 misc:1565 imb:42 pmb:678 smb:630 d:- ref:0 ; in:6249 out:6249 type:P dur:82000000 cpbdur:82000000 q:16.68 tex:38372 mv:3278 misc:1606 imb:28 pmb:950 smb:372 d:- ref:0 ; in:6250 out:6250 type:I dur:82000000 cpbdur:82000000 q:15.43 tex:631249 mv:15510 misc:377 imb:1350 pmb:0 smb:0 d:- ref:; in:6251 out:6251 type:P dur:82000000 cpbdur:82000000 q:20.68 tex:11172 mv:1014 misc:1030 imb:6 pmb:248 smb:1096 d:- ref:0 ; in:6252 out:6252 type:P dur:82000000 cpbdur:82000000 q:22.98 tex:1931 mv:272 misc:621 imb:1 pmb:88 smb:1261 d:- ref:0 ; in:6253 out:6253 type:P dur:82000000 cpbdur:82000000 q:21.36 tex:12209 mv:1389 misc:1330 imb:31 pmb:361 smb:958 d:- ref:0 ; in:6254 out:6254 type:P dur:82000000 cpbdur:82000000 q:21.08 tex:41471 mv:2367 misc:1458 imb:34 pmb:595 smb:721 d:- ref:0 ; in:6255 out:6255 type:P dur:82000000 cpbdur:82000000 q:19.43 tex:56504 mv:4492 misc:1588 imb:151 pmb:904 smb:295 d:- ref:0 ; in:6256 out:6256 type:P dur:82000000 cpbdur:82000000 q:19.02 tex:32939 mv:2540 misc:1577 imb:43 pmb:638 smb:669 d:- ref:0 ; in:6257 out:6257 type:P dur:82000000 cpbdur:82000000 q:20.35 tex:73522 mv:3309 misc:1401 imb:28 pmb:659 smb:663 d:- ref:0 ; in:6258 out:6258 type:P dur:82000000 cpbdur:82000000 q:18.77 tex:38857 mv:2928 misc:1567 imb:45 pmb:756 smb:549 d:- ref:0 ; in:6259 out:6259 type:P dur:82000000 cpbdur:82000000 q:18.74 tex:34541 mv:2585 misc:1546 imb:46 pmb:617 smb:687 d:- ref:0 ; in:6260 out:6260 type:P dur:82000000 cpbdur:82000000 q:19.66 tex:58828 mv:2481 misc:1323 imb:14 pmb:571 smb:765 d:- ref:0 ; in:6261 out:6261 type:P dur:82000000 cpbdur:82000000 q:22.27 tex:104877 mv:5800 misc:1451 imb:119 pmb:700 smb:531 d:- ref:0 ; in:6262 out:6262 type:P dur:82000000 cpbdur:82000000 q:22.66 tex:77828 mv:5154 misc:1370 imb:71 pmb:692 smb:587 d:- ref:0 ; in:6263 out:6263 type:P dur:82000000 cpbdur:82000000 q:22.36 tex:36029 mv:11151 misc:1412 imb:1335 pmb:15 smb:0 d:- ref:0 ; in:6264 out:6264 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:8484 mv:1893 misc:783 imb:66 pmb:189 smb:1095 d:- ref:0 ; in:6265 out:6265 type:P dur:82000000 cpbdur:82000000 q:19.57 tex:12984 mv:3792 misc:968 imb:148 pmb:216 smb:986 d:- ref:0 ; in:6266 out:6266 type:P dur:82000000 cpbdur:82000000 q:18.85 tex:11899 mv:2795 misc:1226 imb:113 pmb:359 smb:878 d:- ref:0 ; in:6267 out:6267 type:P dur:82000000 cpbdur:82000000 q:19.05 tex:20552 mv:4966 misc:1338 imb:242 pmb:318 smb:790 d:- ref:0 ; in:6268 out:6268 type:P dur:82000000 cpbdur:82000000 q:18.40 tex:8863 mv:2288 misc:1297 imb:102 pmb:324 smb:924 d:- ref:0 ; in:6269 out:6269 type:P dur:82000000 cpbdur:82000000 q:18.80 tex:23595 mv:4462 misc:1071 imb:191 pmb:226 smb:933 d:- ref:0 ; in:6270 out:6270 type:P dur:82000000 cpbdur:82000000 q:18.05 tex:7564 mv:1922 misc:1234 imb:76 pmb:296 smb:978 d:- ref:0 ; in:6271 out:6271 type:P dur:82000000 cpbdur:82000000 q:18.88 tex:26699 mv:4283 misc:1090 imb:172 pmb:229 smb:949 d:- ref:0 ; in:6272 out:6272 type:P dur:82000000 cpbdur:82000000 q:18.02 tex:9341 mv:2027 misc:1216 imb:91 pmb:293 smb:966 d:- ref:0 ; in:6273 out:6273 type:P dur:82000000 cpbdur:82000000 q:18.40 tex:21494 mv:4069 misc:1117 imb:156 pmb:279 smb:915 d:- ref:0 ; in:6274 out:6274 type:P dur:82000000 cpbdur:82000000 q:17.49 tex:11902 mv:2537 misc:1417 imb:120 pmb:419 smb:811 d:- ref:0 ; in:6275 out:6275 type:P dur:82000000 cpbdur:82000000 q:18.50 tex:20288 mv:4470 misc:1298 imb:152 pmb:360 smb:838 d:- ref:0 ; in:6276 out:6276 type:P dur:82000000 cpbdur:82000000 q:17.04 tex:13593 mv:2611 misc:1428 imb:97 pmb:447 smb:806 d:- ref:0 ; in:6277 out:6277 type:P dur:82000000 cpbdur:82000000 q:18.11 tex:19809 mv:4460 misc:1179 imb:123 pmb:330 smb:897 d:- ref:0 ; in:6278 out:6278 type:P dur:82000000 cpbdur:82000000 q:16.56 tex:11619 mv:2014 misc:1271 imb:73 pmb:354 smb:923 d:- ref:0 ; in:6279 out:6279 type:P dur:82000000 cpbdur:82000000 q:18.03 tex:24625 mv:4054 misc:1145 imb:138 pmb:288 smb:924 d:- ref:0 ; in:6280 out:6280 type:P dur:82000000 cpbdur:82000000 q:16.86 tex:12495 mv:2538 misc:1391 imb:111 pmb:384 smb:855 d:- ref:0 ; in:6281 out:6281 type:P dur:82000000 cpbdur:82000000 q:18.20 tex:25935 mv:4264 misc:1153 imb:187 pmb:278 smb:885 d:- ref:0 ; in:6282 out:6282 type:P dur:82000000 cpbdur:82000000 q:17.50 tex:5005 mv:1424 misc:1139 imb:61 pmb:228 smb:1061 d:- ref:0 ; in:6283 out:6283 type:P dur:82000000 cpbdur:82000000 q:18.20 tex:27071 mv:4126 misc:1035 imb:158 pmb:234 smb:958 d:- ref:0 ; in:6284 out:6284 type:P dur:82000000 cpbdur:82000000 q:17.47 tex:13374 mv:2724 misc:1454 imb:132 pmb:416 smb:802 d:- ref:0 ; in:6285 out:6285 type:P dur:82000000 cpbdur:82000000 q:17.88 tex:21445 mv:3948 misc:991 imb:123 pmb:248 smb:979 d:- ref:0 ; in:6286 out:6286 type:P dur:82000000 cpbdur:82000000 q:16.92 tex:12229 mv:2031 misc:1156 imb:77 pmb:307 smb:966 d:- ref:0 ; in:6287 out:6287 type:P dur:82000000 cpbdur:82000000 q:18.61 tex:18682 mv:4988 misc:1234 imb:167 pmb:350 smb:833 d:- ref:0 ; in:6288 out:6288 type:P dur:82000000 cpbdur:82000000 q:17.85 tex:12424 mv:2746 misc:990 imb:90 pmb:262 smb:998 d:- ref:0 ; in:6289 out:6289 type:P dur:82000000 cpbdur:82000000 q:18.34 tex:18141 mv:3977 misc:1106 imb:117 pmb:297 smb:936 d:- ref:0 ; in:6290 out:6290 type:P dur:82000000 cpbdur:82000000 q:18.29 tex:12952 mv:3611 misc:1221 imb:135 pmb:319 smb:896 d:- ref:0 ; in:6291 out:6291 type:P dur:82000000 cpbdur:82000000 q:18.19 tex:19253 mv:3605 misc:974 imb:125 pmb:245 smb:980 d:- ref:0 ; in:6292 out:6292 type:P dur:82000000 cpbdur:82000000 q:18.18 tex:10585 mv:3266 misc:1149 imb:115 pmb:300 smb:935 d:- ref:0 ; in:6293 out:6293 type:P dur:82000000 cpbdur:82000000 q:18.50 tex:19831 mv:4070 misc:907 imb:157 pmb:194 smb:999 d:- ref:0 ; in:6294 out:6294 type:P dur:82000000 cpbdur:82000000 q:18.31 tex:10186 mv:3071 misc:1135 imb:99 pmb:295 smb:956 d:- ref:0 ; in:6295 out:6295 type:P dur:82000000 cpbdur:82000000 q:18.79 tex:25053 mv:4013 misc:886 imb:157 pmb:183 smb:1010 d:- ref:0 ; in:6296 out:6296 type:P dur:82000000 cpbdur:82000000 q:18.49 tex:12644 mv:3302 misc:1110 imb:117 pmb:324 smb:909 d:- ref:0 ; in:6297 out:6297 type:P dur:82000000 cpbdur:82000000 q:18.31 tex:22483 mv:3863 misc:926 imb:135 pmb:227 smb:988 d:- ref:0 ; in:6298 out:6298 type:P dur:82000000 cpbdur:82000000 q:18.00 tex:12367 mv:3146 misc:1103 imb:113 pmb:298 smb:939 d:- ref:0 ; in:6299 out:6299 type:P dur:82000000 cpbdur:82000000 q:18.60 tex:16729 mv:4328 misc:1119 imb:130 pmb:304 smb:916 d:- ref:0 ; in:6300 out:6300 type:P dur:82000000 cpbdur:82000000 q:17.56 tex:11105 mv:2509 misc:962 imb:70 pmb:267 smb:1013 d:- ref:0 ; in:6301 out:6301 type:P dur:82000000 cpbdur:82000000 q:17.94 tex:19111 mv:4062 misc:1043 imb:142 pmb:262 smb:946 d:- ref:0 ; in:6302 out:6302 type:P dur:82000000 cpbdur:82000000 q:17.75 tex:11670 mv:2794 misc:1056 imb:93 pmb:272 smb:985 d:- ref:0 ; in:6303 out:6303 type:P dur:82000000 cpbdur:82000000 q:18.17 tex:22461 mv:3819 misc:1008 imb:134 pmb:237 smb:979 d:- ref:0 ; in:6304 out:6304 type:P dur:82000000 cpbdur:82000000 q:17.36 tex:16745 mv:3525 misc:1314 imb:148 pmb:393 smb:809 d:- ref:0 ; in:6305 out:6305 type:P dur:82000000 cpbdur:82000000 q:18.23 tex:20269 mv:3807 misc:1060 imb:127 pmb:265 smb:958 d:- ref:0 ; in:6306 out:6306 type:P dur:82000000 cpbdur:82000000 q:17.35 tex:13937 mv:3028 misc:1243 imb:108 pmb:342 smb:900 d:- ref:0 ; in:6307 out:6307 type:P dur:82000000 cpbdur:82000000 q:18.24 tex:19967 mv:3901 misc:980 imb:148 pmb:229 smb:973 d:- ref:0 ; in:6308 out:6308 type:P dur:82000000 cpbdur:82000000 q:17.63 tex:8404 mv:2158 misc:918 imb:58 pmb:228 smb:1064 d:- ref:0 ; in:6309 out:6309 type:P dur:82000000 cpbdur:82000000 q:17.15 tex:17422 mv:3101 misc:1229 imb:123 pmb:293 smb:934 d:- ref:0 ; in:6310 out:6310 type:P dur:82000000 cpbdur:82000000 q:16.37 tex:15479 mv:3411 misc:1398 imb:149 pmb:415 smb:786 d:- ref:0 ; in:6311 out:6311 type:P dur:82000000 cpbdur:82000000 q:17.76 tex:12804 mv:3651 misc:1249 imb:108 pmb:345 smb:897 d:- ref:0 ; in:6312 out:6312 type:P dur:82000000 cpbdur:82000000 q:16.94 tex:9931 mv:3007 misc:1278 imb:118 pmb:339 smb:893 d:- ref:0 ; in:6313 out:6313 type:P dur:82000000 cpbdur:82000000 q:16.80 tex:16593 mv:2943 misc:1032 imb:90 pmb:241 smb:1019 d:- ref:0 ; in:6314 out:6314 type:P dur:82000000 cpbdur:82000000 q:16.71 tex:8509 mv:2598 misc:1197 imb:85 pmb:304 smb:961 d:- ref:0 ; in:6315 out:6315 type:P dur:82000000 cpbdur:82000000 q:17.63 tex:14984 mv:3079 misc:1025 imb:89 pmb:253 smb:1008 d:- ref:0 ; in:6316 out:6316 type:P dur:82000000 cpbdur:82000000 q:16.66 tex:9886 mv:2649 misc:1153 imb:102 pmb:277 smb:971 d:- ref:0 ; in:6317 out:6317 type:P dur:82000000 cpbdur:82000000 q:17.97 tex:17789 mv:3837 misc:1070 imb:143 pmb:247 smb:960 d:- ref:0 ; in:6318 out:6318 type:P dur:82000000 cpbdur:82000000 q:17.05 tex:10856 mv:2915 misc:1277 imb:125 pmb:313 smb:912 d:- ref:0 ; in:6319 out:6319 type:P dur:82000000 cpbdur:82000000 q:17.72 tex:13999 mv:3121 misc:1040 imb:129 pmb:205 smb:1016 d:- ref:0 ; in:6320 out:6320 type:P dur:82000000 cpbdur:82000000 q:17.34 tex:10846 mv:3361 misc:1345 imb:133 pmb:367 smb:850 d:- ref:0 ; in:6321 out:6321 type:P dur:82000000 cpbdur:82000000 q:16.86 tex:14195 mv:3068 misc:1065 imb:102 pmb:262 smb:986 d:- ref:0 ; in:6322 out:6322 type:P dur:82000000 cpbdur:82000000 q:16.43 tex:16885 mv:3887 misc:1444 imb:188 pmb:421 smb:741 d:- ref:0 ; in:6323 out:6323 type:P dur:82000000 cpbdur:82000000 q:17.47 tex:15104 mv:4013 misc:1363 imb:166 pmb:391 smb:793 d:- ref:0 ; in:6324 out:6324 type:P dur:82000000 cpbdur:82000000 q:17.06 tex:10020 mv:3067 misc:1289 imb:98 pmb:349 smb:903 d:- ref:0 ; in:6325 out:6325 type:P dur:82000000 cpbdur:82000000 q:16.71 tex:13869 mv:3174 misc:1069 imb:79 pmb:276 smb:995 d:- ref:0 ; in:6326 out:6326 type:P dur:82000000 cpbdur:82000000 q:16.45 tex:17448 mv:4371 misc:1485 imb:216 pmb:449 smb:685 d:- ref:0 ; in:6327 out:6327 type:P dur:82000000 cpbdur:82000000 q:17.74 tex:15948 mv:4377 misc:1211 imb:153 pmb:317 smb:880 d:- ref:0 ; in:6328 out:6328 type:P dur:82000000 cpbdur:82000000 q:17.34 tex:10831 mv:3709 misc:1372 imb:172 pmb:371 smb:807 d:- ref:0 ; in:6329 out:6329 type:P dur:82000000 cpbdur:82000000 q:17.28 tex:18069 mv:3952 misc:1131 imb:132 pmb:296 smb:922 d:- ref:0 ; in:6330 out:6330 type:P dur:82000000 cpbdur:82000000 q:17.19 tex:10161 mv:3100 misc:1243 imb:98 pmb:320 smb:932 d:- ref:0 ; in:6331 out:6331 type:P dur:82000000 cpbdur:82000000 q:17.89 tex:15193 mv:4248 misc:1103 imb:153 pmb:256 smb:941 d:- ref:0 ; in:6332 out:6332 type:P dur:82000000 cpbdur:82000000 q:17.45 tex:13779 mv:3804 misc:1329 imb:146 pmb:354 smb:850 d:- ref:0 ; in:6333 out:6333 type:P dur:82000000 cpbdur:82000000 q:17.29 tex:20385 mv:3544 misc:1175 imb:120 pmb:306 smb:924 d:- ref:0 ; in:6334 out:6334 type:P dur:82000000 cpbdur:82000000 q:16.84 tex:11055 mv:2762 misc:1111 imb:81 pmb:286 smb:983 d:- ref:0 ; in:6335 out:6335 type:P dur:82000000 cpbdur:82000000 q:18.03 tex:16576 mv:4137 misc:1183 imb:120 pmb:327 smb:903 d:- ref:0 ; in:6336 out:6336 type:P dur:82000000 cpbdur:82000000 q:17.51 tex:9692 mv:3021 misc:1047 imb:91 pmb:283 smb:976 d:- ref:0 ; in:6337 out:6337 type:P dur:82000000 cpbdur:82000000 q:17.48 tex:25670 mv:5029 misc:1405 imb:178 pmb:401 smb:771 d:- ref:0 ; in:6338 out:6338 type:P dur:82000000 cpbdur:82000000 q:17.46 tex:14527 mv:3618 misc:1383 imb:129 pmb:398 smb:823 d:- ref:0 ; in:6339 out:6339 type:P dur:82000000 cpbdur:82000000 q:17.87 tex:19141 mv:4193 misc:978 imb:87 pmb:297 smb:966 d:- ref:0 ; in:6340 out:6340 type:P dur:82000000 cpbdur:82000000 q:17.97 tex:13637 mv:3294 misc:1181 imb:87 pmb:344 smb:919 d:- ref:0 ; in:6341 out:6341 type:P dur:82000000 cpbdur:82000000 q:18.53 tex:19274 mv:4352 misc:1022 imb:120 pmb:282 smb:948 d:- ref:0 ; in:6342 out:6342 type:P dur:82000000 cpbdur:82000000 q:17.71 tex:13398 mv:3133 misc:1061 imb:100 pmb:289 smb:961 d:- ref:0 ; in:6343 out:6343 type:P dur:82000000 cpbdur:82000000 q:18.44 tex:21750 mv:4602 misc:1104 imb:122 pmb:310 smb:918 d:- ref:0 ; in:6344 out:6344 type:P dur:82000000 cpbdur:82000000 q:18.03 tex:12080 mv:3241 misc:1103 imb:87 pmb:333 smb:930 d:- ref:0 ; in:6345 out:6345 type:P dur:82000000 cpbdur:82000000 q:17.81 tex:18133 mv:4105 misc:1010 imb:82 pmb:315 smb:953 d:- ref:0 ; in:6346 out:6346 type:P dur:82000000 cpbdur:82000000 q:17.27 tex:17967 mv:4020 misc:1317 imb:115 pmb:430 smb:805 d:- ref:0 ; in:6347 out:6347 type:P dur:82000000 cpbdur:82000000 q:18.54 tex:17333 mv:4668 misc:1231 imb:109 pmb:388 smb:853 d:- ref:0 ; in:6348 out:6348 type:P dur:82000000 cpbdur:82000000 q:17.97 tex:15169 mv:3407 misc:1072 imb:75 pmb:353 smb:922 d:- ref:0 ; in:6349 out:6349 type:P dur:82000000 cpbdur:82000000 q:17.88 tex:21927 mv:4347 misc:974 imb:83 pmb:337 smb:930 d:- ref:0 ; in:6350 out:6350 type:P dur:82000000 cpbdur:82000000 q:17.51 tex:12294 mv:3152 misc:1090 imb:59 pmb:362 smb:929 d:- ref:0 ; in:6351 out:6351 type:P dur:82000000 cpbdur:82000000 q:18.38 tex:25242 mv:4778 misc:1148 imb:114 pmb:376 smb:860 d:- ref:0 ; in:6352 out:6352 type:P dur:82000000 cpbdur:82000000 q:17.85 tex:17500 mv:3068 misc:1008 imb:65 pmb:328 smb:957 d:- ref:0 ; in:6353 out:6353 type:P dur:82000000 cpbdur:82000000 q:18.48 tex:25126 mv:4884 misc:1134 imb:90 pmb:382 smb:878 d:- ref:0 ; in:6354 out:6354 type:P dur:82000000 cpbdur:82000000 q:18.32 tex:17574 mv:3390 misc:1124 imb:82 pmb:370 smb:898 d:- ref:0 ; in:6355 out:6355 type:P dur:82000000 cpbdur:82000000 q:18.59 tex:26301 mv:5321 misc:946 imb:90 pmb:351 smb:909 d:- ref:0 ; in:6356 out:6356 type:P dur:82000000 cpbdur:82000000 q:18.40 tex:17647 mv:3771 misc:1222 imb:77 pmb:417 smb:856 d:- ref:0 ; in:6357 out:6357 type:P dur:82000000 cpbdur:82000000 q:18.70 tex:22723 mv:4927 misc:974 imb:59 pmb:377 smb:914 d:- ref:0 ; in:6358 out:6358 type:P dur:82000000 cpbdur:82000000 q:18.42 tex:21742 mv:3815 misc:1043 imb:55 pmb:405 smb:890 d:- ref:0 ; in:6359 out:6359 type:P dur:82000000 cpbdur:82000000 q:19.37 tex:31943 mv:6161 misc:1232 imb:110 pmb:469 smb:771 d:- ref:0 ; in:6360 out:6360 type:P dur:82000000 cpbdur:82000000 q:18.69 tex:16531 mv:3565 misc:1056 imb:53 pmb:393 smb:904 d:- ref:0 ; in:6361 out:6361 type:P dur:82000000 cpbdur:82000000 q:18.95 tex:30173 mv:5527 misc:980 imb:63 pmb:425 smb:862 d:- ref:0 ; in:6362 out:6362 type:P dur:82000000 cpbdur:82000000 q:18.61 tex:17499 mv:3893 misc:1128 imb:66 pmb:427 smb:857 d:- ref:0 ; in:6363 out:6363 type:P dur:82000000 cpbdur:82000000 q:19.17 tex:30732 mv:6175 misc:1133 imb:106 pmb:451 smb:793 d:- ref:0 ; in:6364 out:6364 type:P dur:82000000 cpbdur:82000000 q:18.94 tex:19414 mv:4038 misc:1220 imb:67 pmb:450 smb:833 d:- ref:0 ; in:6365 out:6365 type:P dur:82000000 cpbdur:82000000 q:19.49 tex:35046 mv:6285 misc:1173 imb:113 pmb:457 smb:780 d:- ref:0 ; in:6366 out:6366 type:P dur:82000000 cpbdur:82000000 q:19.25 tex:20685 mv:4586 misc:1241 imb:79 pmb:454 smb:817 d:- ref:0 ; in:6367 out:6367 type:P dur:82000000 cpbdur:82000000 q:19.60 tex:27252 mv:5317 misc:1007 imb:83 pmb:375 smb:892 d:- ref:0 ; in:6368 out:6368 type:P dur:82000000 cpbdur:82000000 q:19.19 tex:23538 mv:4453 misc:1185 imb:74 pmb:473 smb:803 d:- ref:0 ; in:6369 out:6369 type:P dur:82000000 cpbdur:82000000 q:19.56 tex:25188 mv:4949 misc:1047 imb:58 pmb:405 smb:887 d:- ref:0 ; in:6370 out:6370 type:P dur:82000000 cpbdur:82000000 q:19.04 tex:24610 mv:4846 misc:1152 imb:61 pmb:520 smb:769 d:- ref:0 ; in:6371 out:6371 type:P dur:82000000 cpbdur:82000000 q:19.87 tex:27950 mv:5477 misc:1181 imb:98 pmb:419 smb:833 d:- ref:0 ; in:6372 out:6372 type:P dur:82000000 cpbdur:82000000 q:19.25 tex:25253 mv:4992 misc:1307 imb:93 pmb:530 smb:727 d:- ref:0 ; in:6373 out:6373 type:P dur:82000000 cpbdur:82000000 q:19.52 tex:27587 mv:5328 misc:1029 imb:53 pmb:424 smb:873 d:- ref:0 ; in:6374 out:6374 type:P dur:82000000 cpbdur:82000000 q:18.99 tex:26061 mv:4874 misc:1177 imb:75 pmb:532 smb:743 d:- ref:0 ; in:6375 out:6375 type:P dur:82000000 cpbdur:82000000 q:19.88 tex:32448 mv:6047 misc:1137 imb:90 pmb:459 smb:801 d:- ref:0 ; in:6376 out:6376 type:P dur:82000000 cpbdur:82000000 q:19.12 tex:29534 mv:4801 misc:1241 imb:81 pmb:541 smb:728 d:- ref:0 ; in:6377 out:6377 type:P dur:82000000 cpbdur:82000000 q:20.04 tex:36530 mv:6356 misc:1162 imb:102 pmb:454 smb:794 d:- ref:0 ; in:6378 out:6378 type:P dur:82000000 cpbdur:82000000 q:19.37 tex:28255 mv:5155 misc:1278 imb:89 pmb:579 smb:682 d:- ref:0 ; in:6379 out:6379 type:P dur:82000000 cpbdur:82000000 q:20.39 tex:37150 mv:7543 misc:1179 imb:117 pmb:485 smb:748 d:- ref:0 ; in:6380 out:6380 type:P dur:82000000 cpbdur:82000000 q:19.74 tex:18172 mv:4505 misc:1179 imb:80 pmb:471 smb:799 d:- ref:0 ; in:6381 out:6381 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:37809 mv:7591 misc:1216 imb:130 pmb:531 smb:689 d:- ref:0 ; in:6382 out:6382 type:P dur:82000000 cpbdur:82000000 q:19.54 tex:19541 mv:4458 misc:1169 imb:74 pmb:484 smb:792 d:- ref:0 ; in:6383 out:6383 type:P dur:82000000 cpbdur:82000000 q:20.71 tex:40374 mv:8799 misc:1267 imb:164 pmb:547 smb:639 d:- ref:0 ; in:6384 out:6384 type:P dur:82000000 cpbdur:82000000 q:19.80 tex:23237 mv:4194 misc:1225 imb:86 pmb:496 smb:768 d:- ref:0 ; in:6385 out:6385 type:P dur:82000000 cpbdur:82000000 q:20.40 tex:43513 mv:7749 misc:1186 imb:115 pmb:535 smb:700 d:- ref:0 ; in:6386 out:6386 type:P dur:82000000 cpbdur:82000000 q:19.78 tex:21033 mv:4752 misc:1199 imb:93 pmb:490 smb:767 d:- ref:0 ; in:6387 out:6387 type:P dur:82000000 cpbdur:82000000 q:20.37 tex:41736 mv:7464 misc:1192 imb:132 pmb:546 smb:672 d:- ref:0 ; in:6388 out:6388 type:P dur:82000000 cpbdur:82000000 q:19.85 tex:23018 mv:5056 misc:1238 imb:98 pmb:502 smb:750 d:- ref:0 ; in:6389 out:6389 type:P dur:82000000 cpbdur:82000000 q:20.94 tex:45165 mv:8698 misc:1185 imb:167 pmb:540 smb:643 d:- ref:0 ; in:6390 out:6390 type:P dur:82000000 cpbdur:82000000 q:20.11 tex:28111 mv:5025 misc:1216 imb:110 pmb:519 smb:721 d:- ref:0 ; in:6391 out:6391 type:P dur:82000000 cpbdur:82000000 q:20.70 tex:38698 mv:8226 misc:1236 imb:150 pmb:550 smb:650 d:- ref:0 ; in:6392 out:6392 type:P dur:82000000 cpbdur:82000000 q:19.98 tex:26978 mv:4985 misc:1213 imb:123 pmb:521 smb:706 d:- ref:0 ; in:6393 out:6393 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:41347 mv:7249 misc:1228 imb:136 pmb:579 smb:635 d:- ref:0 ; in:6394 out:6394 type:P dur:82000000 cpbdur:82000000 q:19.76 tex:24838 mv:4264 misc:1202 imb:81 pmb:500 smb:769 d:- ref:0 ; in:6395 out:6395 type:P dur:82000000 cpbdur:82000000 q:20.67 tex:39651 mv:8130 misc:1291 imb:187 pmb:564 smb:599 d:- ref:0 ; in:6396 out:6396 type:P dur:82000000 cpbdur:82000000 q:20.00 tex:29096 mv:4954 misc:1206 imb:93 pmb:546 smb:711 d:- ref:0 ; in:6397 out:6397 type:P dur:82000000 cpbdur:82000000 q:20.45 tex:46938 mv:6949 misc:1169 imb:116 pmb:557 smb:677 d:- ref:0 ; in:6398 out:6398 type:P dur:82000000 cpbdur:82000000 q:19.92 tex:24188 mv:4414 misc:1238 imb:66 pmb:520 smb:764 d:- ref:0 ; in:6399 out:6399 type:P dur:82000000 cpbdur:82000000 q:20.43 tex:44700 mv:6920 misc:1180 imb:93 pmb:560 smb:697 d:- ref:0 ; in:6400 out:6400 type:P dur:82000000 cpbdur:82000000 q:20.02 tex:26628 mv:4818 misc:1242 imb:96 pmb:520 smb:734 d:- ref:0 ; in:6401 out:6401 type:P dur:82000000 cpbdur:82000000 q:20.65 tex:42230 mv:7303 misc:1155 imb:96 pmb:549 smb:705 d:- ref:0 ; in:6402 out:6402 type:P dur:82000000 cpbdur:82000000 q:20.06 tex:29200 mv:5111 misc:1289 imb:121 pmb:543 smb:686 d:- ref:0 ; in:6403 out:6403 type:P dur:82000000 cpbdur:82000000 q:21.29 tex:53422 mv:8945 misc:1241 imb:169 pmb:555 smb:626 d:- ref:0 ; in:6404 out:6404 type:P dur:82000000 cpbdur:82000000 q:20.37 tex:31474 mv:4502 misc:1256 imb:92 pmb:550 smb:708 d:- ref:0 ; in:6405 out:6405 type:P dur:82000000 cpbdur:82000000 q:21.04 tex:42937 mv:7938 misc:1245 imb:143 pmb:574 smb:633 d:- ref:0 ; in:6406 out:6406 type:P dur:82000000 cpbdur:82000000 q:20.15 tex:25820 mv:3866 misc:1210 imb:73 pmb:510 smb:767 d:- ref:0 ; in:6407 out:6407 type:P dur:82000000 cpbdur:82000000 q:21.38 tex:55574 mv:9226 misc:1336 imb:197 pmb:596 smb:557 d:- ref:0 ; in:6408 out:6408 type:P dur:82000000 cpbdur:82000000 q:20.40 tex:30534 mv:4519 misc:1227 imb:95 pmb:555 smb:700 d:- ref:0 ; in:6409 out:6409 type:P dur:82000000 cpbdur:82000000 q:21.00 tex:46850 mv:7819 misc:1171 imb:108 pmb:537 smb:705 d:- ref:0 ; in:6410 out:6410 type:P dur:82000000 cpbdur:82000000 q:20.29 tex:30928 mv:4573 misc:1259 imb:92 pmb:519 smb:739 d:- ref:0 ; in:6411 out:6411 type:P dur:82000000 cpbdur:82000000 q:20.91 tex:44323 mv:7319 misc:1254 imb:136 pmb:549 smb:665 d:- ref:0 ; in:6412 out:6412 type:P dur:82000000 cpbdur:82000000 q:20.16 tex:31301 mv:4375 misc:1180 imb:77 pmb:531 smb:742 d:- ref:0 ; in:6413 out:6413 type:P dur:82000000 cpbdur:82000000 q:21.09 tex:46692 mv:8265 misc:1235 imb:161 pmb:541 smb:648 d:- ref:0 ; in:6414 out:6414 type:P dur:82000000 cpbdur:82000000 q:20.37 tex:28526 mv:5010 misc:1288 imb:142 pmb:522 smb:686 d:- ref:0 ; in:6415 out:6415 type:P dur:82000000 cpbdur:82000000 q:20.80 tex:40063 mv:7616 misc:1161 imb:147 pmb:522 smb:681 d:- ref:0 ; in:6416 out:6416 type:P dur:82000000 cpbdur:82000000 q:20.12 tex:27825 mv:4626 misc:1245 imb:117 pmb:490 smb:743 d:- ref:0 ; in:6417 out:6417 type:P dur:82000000 cpbdur:82000000 q:20.60 tex:37735 mv:6871 misc:1218 imb:147 pmb:525 smb:678 d:- ref:0 ; in:6418 out:6418 type:P dur:82000000 cpbdur:82000000 q:19.77 tex:24875 mv:3923 misc:1122 imb:74 pmb:471 smb:805 d:- ref:0 ; in:6419 out:6419 type:P dur:82000000 cpbdur:82000000 q:20.48 tex:41602 mv:7531 misc:1299 imb:202 pmb:527 smb:621 d:- ref:0 ; in:6420 out:6420 type:P dur:82000000 cpbdur:82000000 q:19.69 tex:21046 mv:3580 misc:1158 imb:90 pmb:452 smb:808 d:- ref:0 ; in:6421 out:6421 type:P dur:82000000 cpbdur:82000000 q:20.03 tex:39047 mv:5687 misc:1066 imb:73 pmb:459 smb:818 d:- ref:0 ; in:6422 out:6422 type:P dur:82000000 cpbdur:82000000 q:19.43 tex:32935 mv:4855 misc:1322 imb:99 pmb:593 smb:658 d:- ref:0 ; in:6423 out:6423 type:P dur:82000000 cpbdur:82000000 q:20.17 tex:38526 mv:5633 misc:1137 imb:93 pmb:463 smb:794 d:- ref:0 ; in:6424 out:6424 type:P dur:82000000 cpbdur:82000000 q:19.48 tex:34175 mv:4818 misc:1199 imb:71 pmb:552 smb:727 d:- ref:0 ; in:6425 out:6425 type:P dur:82000000 cpbdur:82000000 q:20.14 tex:38324 mv:5402 misc:1074 imb:54 pmb:446 smb:850 d:- ref:0 ; in:6426 out:6426 type:P dur:82000000 cpbdur:82000000 q:18.84 tex:20601 mv:2505 misc:1302 imb:49 pmb:507 smb:794 d:- ref:0 ; in:6427 out:6427 type:P dur:82000000 cpbdur:82000000 q:20.27 tex:46462 mv:6811 misc:967 imb:85 pmb:453 smb:812 d:- ref:0 ; in:6428 out:6428 type:P dur:82000000 cpbdur:82000000 q:19.27 tex:29029 mv:3128 misc:1259 imb:38 pmb:552 smb:760 d:- ref:0 ; in:6429 out:6429 type:P dur:82000000 cpbdur:82000000 q:20.01 tex:38017 mv:5404 misc:1083 imb:69 pmb:444 smb:837 d:- ref:0 ; in:6430 out:6430 type:P dur:82000000 cpbdur:82000000 q:18.59 tex:25580 mv:2722 misc:1178 imb:25 pmb:526 smb:799 d:- ref:0 ; in:6431 out:6431 type:P dur:82000000 cpbdur:82000000 q:20.45 tex:50385 mv:6398 misc:1209 imb:93 pmb:488 smb:769 d:- ref:0 ; in:6432 out:6432 type:P dur:82000000 cpbdur:82000000 q:18.61 tex:18603 mv:2212 misc:1241 imb:34 pmb:492 smb:824 d:- ref:0 ; in:6433 out:6433 type:P dur:82000000 cpbdur:82000000 q:19.80 tex:41459 mv:5199 misc:950 imb:35 pmb:435 smb:880 d:- ref:0 ; in:6434 out:6434 type:P dur:82000000 cpbdur:82000000 q:18.49 tex:30643 mv:2376 misc:1261 imb:28 pmb:532 smb:790 d:- ref:0 ; in:6435 out:6435 type:P dur:82000000 cpbdur:82000000 q:19.73 tex:37793 mv:5071 misc:1056 imb:60 pmb:445 smb:845 d:- ref:0 ; in:6436 out:6436 type:P dur:82000000 cpbdur:82000000 q:18.38 tex:31134 mv:2691 misc:1175 imb:30 pmb:529 smb:791 d:- ref:0 ; in:6437 out:6437 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:45567 mv:6850 misc:1063 imb:105 pmb:454 smb:791 d:- ref:0 ; in:6438 out:6438 type:P dur:82000000 cpbdur:82000000 q:18.59 tex:18399 mv:2199 misc:1218 imb:29 pmb:461 smb:860 d:- ref:0 ; in:6439 out:6439 type:P dur:82000000 cpbdur:82000000 q:19.89 tex:36663 mv:5870 misc:1107 imb:78 pmb:464 smb:808 d:- ref:0 ; in:6440 out:6440 type:P dur:82000000 cpbdur:82000000 q:18.26 tex:28822 mv:2610 misc:1216 imb:42 pmb:520 smb:788 d:- ref:0 ; in:6441 out:6441 type:P dur:82000000 cpbdur:82000000 q:19.47 tex:41542 mv:5360 misc:1234 imb:63 pmb:520 smb:767 d:- ref:0 ; in:6442 out:6442 type:P dur:82000000 cpbdur:82000000 q:18.27 tex:20762 mv:2300 misc:1170 imb:32 pmb:430 smb:888 d:- ref:0 ; in:6443 out:6443 type:P dur:82000000 cpbdur:82000000 q:19.74 tex:32601 mv:5304 misc:1215 imb:116 pmb:434 smb:800 d:- ref:0 ; in:6444 out:6444 type:P dur:82000000 cpbdur:82000000 q:18.30 tex:29012 mv:3033 misc:1307 imb:71 pmb:555 smb:724 d:- ref:0 ; in:6445 out:6445 type:P dur:82000000 cpbdur:82000000 q:19.31 tex:44445 mv:4948 misc:1007 imb:33 pmb:444 smb:873 d:- ref:0 ; in:6446 out:6446 type:P dur:82000000 cpbdur:82000000 q:18.25 tex:18792 mv:2226 misc:1222 imb:34 pmb:426 smb:890 d:- ref:0 ; in:6447 out:6447 type:P dur:82000000 cpbdur:82000000 q:19.36 tex:43395 mv:5072 misc:1093 imb:37 pmb:480 smb:833 d:- ref:0 ; in:6448 out:6448 type:P dur:82000000 cpbdur:82000000 q:18.39 tex:15017 mv:2054 misc:1297 imb:28 pmb:426 smb:896 d:- ref:0 ; in:6449 out:6449 type:P dur:82000000 cpbdur:82000000 q:19.73 tex:38779 mv:5304 misc:997 imb:62 pmb:426 smb:862 d:- ref:0 ; in:6450 out:6450 type:P dur:82000000 cpbdur:82000000 q:18.54 tex:17055 mv:2378 misc:1231 imb:32 pmb:494 smb:824 d:- ref:0 ; in:6451 out:6451 type:P dur:82000000 cpbdur:82000000 q:20.13 tex:45624 mv:6598 misc:994 imb:78 pmb:448 smb:824 d:- ref:0 ; in:6452 out:6452 type:P dur:82000000 cpbdur:82000000 q:18.77 tex:24054 mv:2724 misc:1214 imb:35 pmb:518 smb:797 d:- ref:0 ; in:6453 out:6453 type:P dur:82000000 cpbdur:82000000 q:20.31 tex:43416 mv:7253 misc:1323 imb:205 pmb:493 smb:652 d:- ref:0 ; in:6454 out:6454 type:P dur:82000000 cpbdur:82000000 q:19.55 tex:15987 mv:5742 misc:1527 imb:478 pmb:378 smb:494 d:- ref:0 ; in:6455 out:6455 type:P dur:82000000 cpbdur:82000000 q:21.90 tex:70829 mv:14256 misc:1419 imb:908 pmb:434 smb:8 d:- ref:0 ; in:6456 out:6456 type:P dur:82000000 cpbdur:82000000 q:22.20 tex:56239 mv:12870 misc:1419 imb:895 pmb:448 smb:7 d:- ref:0 ; in:6457 out:6457 type:P dur:82000000 cpbdur:82000000 q:23.39 tex:82607 mv:14147 misc:1422 imb:990 pmb:353 smb:7 d:- ref:0 ; in:6458 out:6458 type:P dur:82000000 cpbdur:82000000 q:22.75 tex:37629 mv:11826 misc:1441 imb:781 pmb:516 smb:53 d:- ref:0 ; in:6459 out:6459 type:P dur:82000000 cpbdur:82000000 q:23.14 tex:67300 mv:13332 misc:1432 imb:843 pmb:472 smb:35 d:- ref:0 ; in:6460 out:6460 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:38414 mv:11393 misc:1449 imb:794 pmb:483 smb:73 d:- ref:0 ; in:6461 out:6461 type:P dur:82000000 cpbdur:82000000 q:22.96 tex:66095 mv:13808 misc:1425 imb:849 pmb:472 smb:29 d:- ref:0 ; in:6462 out:6462 type:P dur:82000000 cpbdur:82000000 q:22.51 tex:39881 mv:11697 misc:1438 imb:803 pmb:471 smb:76 d:- ref:0 ; in:6463 out:6463 type:P dur:82000000 cpbdur:82000000 q:22.85 tex:61240 mv:13381 misc:1435 imb:851 pmb:465 smb:34 d:- ref:0 ; in:6464 out:6464 type:P dur:82000000 cpbdur:82000000 q:22.53 tex:43523 mv:11500 misc:1449 imb:824 pmb:440 smb:86 d:- ref:0 ; in:6465 out:6465 type:P dur:82000000 cpbdur:82000000 q:23.22 tex:75996 mv:13830 misc:1414 imb:871 pmb:448 smb:31 d:- ref:0 ; in:6466 out:6466 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:41838 mv:11476 misc:1446 imb:799 pmb:462 smb:89 d:- ref:0 ; in:6467 out:6467 type:P dur:82000000 cpbdur:82000000 q:23.04 tex:72105 mv:12835 misc:1436 imb:757 pmb:549 smb:44 d:- ref:0 ; in:6468 out:6468 type:P dur:82000000 cpbdur:82000000 q:22.52 tex:44021 mv:11224 misc:1459 imb:676 pmb:598 smb:76 d:- ref:0 ; in:6469 out:6469 type:P dur:82000000 cpbdur:82000000 q:22.26 tex:62186 mv:11624 misc:1438 imb:613 pmb:694 smb:43 d:- ref:0 ; in:6470 out:6470 type:P dur:82000000 cpbdur:82000000 q:22.30 tex:60555 mv:11441 misc:1444 imb:614 pmb:673 smb:63 d:- ref:0 ; in:6471 out:6471 type:P dur:82000000 cpbdur:82000000 q:22.03 tex:45640 mv:10718 misc:1458 imb:475 pmb:784 smb:91 d:- ref:0 ; in:6472 out:6472 type:P dur:82000000 cpbdur:82000000 q:21.27 tex:48392 mv:6300 misc:1500 imb:251 pmb:752 smb:347 d:- ref:0 ; in:6473 out:6473 type:P dur:82000000 cpbdur:82000000 q:21.10 tex:43309 mv:9769 misc:1474 imb:766 pmb:459 smb:125 d:- ref:0 ; in:6474 out:6474 type:P dur:82000000 cpbdur:82000000 q:19.64 tex:22319 mv:4394 misc:1407 imb:159 pmb:564 smb:627 d:- ref:0 ; in:6475 out:6475 type:P dur:82000000 cpbdur:82000000 q:19.34 tex:54794 mv:6956 misc:1530 imb:184 pmb:922 smb:244 d:- ref:0 ; in:6476 out:6476 type:P dur:82000000 cpbdur:82000000 q:17.18 tex:55915 mv:3340 misc:1561 imb:39 pmb:882 smb:429 d:- ref:0 ; in:6477 out:6477 type:P dur:82000000 cpbdur:82000000 q:17.67 tex:23793 mv:2647 misc:1488 imb:34 pmb:629 smb:687 d:- ref:0 ; in:6478 out:6478 type:P dur:82000000 cpbdur:82000000 q:16.62 tex:28632 mv:2764 misc:1556 imb:30 pmb:716 smb:604 d:- ref:0 ; in:6479 out:6479 type:P dur:82000000 cpbdur:82000000 q:15.43 tex:76541 mv:5116 misc:1559 imb:43 pmb:994 smb:313 d:- ref:0 ; in:6480 out:6480 type:P dur:82000000 cpbdur:82000000 q:16.45 tex:26372 mv:2789 misc:1623 imb:26 pmb:755 smb:569 d:- ref:0 ; in:6481 out:6481 type:P dur:82000000 cpbdur:82000000 q:15.91 tex:16354 mv:1428 misc:1202 imb:17 pmb:346 smb:987 d:- ref:0 ; in:6482 out:6482 type:P dur:82000000 cpbdur:82000000 q:14.60 tex:19407 mv:2720 misc:1457 imb:19 pmb:514 smb:817 d:- ref:0 ; in:6483 out:6483 type:P dur:82000000 cpbdur:82000000 q:17.48 tex:35679 mv:3250 misc:1575 imb:38 pmb:750 smb:562 d:- ref:0 ; in:6484 out:6484 type:P dur:82000000 cpbdur:82000000 q:16.54 tex:15307 mv:1283 misc:1090 imb:9 pmb:293 smb:1048 d:- ref:0 ; in:6485 out:6485 type:P dur:82000000 cpbdur:82000000 q:15.05 tex:32030 mv:4154 misc:1632 imb:30 pmb:820 smb:500 d:- ref:0 ; in:6486 out:6486 type:P dur:82000000 cpbdur:82000000 q:16.38 tex:27692 mv:2522 misc:1554 imb:14 pmb:672 smb:664 d:- ref:0 ; in:6487 out:6487 type:P dur:82000000 cpbdur:82000000 q:14.89 tex:13293 mv:1503 misc:1220 imb:9 pmb:319 smb:1022 d:- ref:0 ; in:6488 out:6488 type:P dur:82000000 cpbdur:82000000 q:18.89 tex:215014 mv:14797 misc:1421 imb:1289 pmb:61 smb:0 d:- ref:0 ; in:6489 out:6489 type:P dur:82000000 cpbdur:82000000 q:22.89 tex:46895 mv:4838 misc:1291 imb:139 pmb:378 smb:833 d:- ref:0 ; in:6490 out:6490 type:P dur:82000000 cpbdur:82000000 q:22.56 tex:48574 mv:5409 misc:1337 imb:223 pmb:389 smb:738 d:- ref:0 ; in:6491 out:6491 type:P dur:82000000 cpbdur:82000000 q:22.08 tex:59495 mv:6303 misc:1434 imb:208 pmb:499 smb:643 d:- ref:0 ; in:6492 out:6492 type:P dur:82000000 cpbdur:82000000 q:22.17 tex:62168 mv:6692 misc:1428 imb:246 pmb:486 smb:618 d:- ref:0 ; in:6493 out:6493 type:P dur:82000000 cpbdur:82000000 q:21.86 tex:53206 mv:5711 misc:1411 imb:161 pmb:521 smb:668 d:- ref:0 ; in:6494 out:6494 type:P dur:82000000 cpbdur:82000000 q:21.91 tex:58383 mv:6052 misc:1429 imb:193 pmb:506 smb:651 d:- ref:0 ; in:6495 out:6495 type:P dur:82000000 cpbdur:82000000 q:21.81 tex:53883 mv:5721 misc:1412 imb:152 pmb:535 smb:663 d:- ref:0 ; in:6496 out:6496 type:P dur:82000000 cpbdur:82000000 q:21.87 tex:60054 mv:6380 misc:1422 imb:198 pmb:562 smb:590 d:- ref:0 ; in:6497 out:6497 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:60592 mv:5937 misc:1415 imb:165 pmb:555 smb:630 d:- ref:0 ; in:6498 out:6498 type:P dur:82000000 cpbdur:82000000 q:21.96 tex:66862 mv:7303 misc:1443 imb:278 pmb:535 smb:537 d:- ref:0 ; in:6499 out:6499 type:P dur:82000000 cpbdur:82000000 q:21.76 tex:60136 mv:5588 misc:1412 imb:160 pmb:556 smb:634 d:- ref:0 ; in:6500 out:6500 type:I dur:82000000 cpbdur:82000000 q:17.28 tex:262275 mv:13406 misc:375 imb:1350 pmb:0 smb:0 d:- ref:; in:6501 out:6501 type:P dur:82000000 cpbdur:82000000 q:23.87 tex:36668 mv:3864 misc:1204 imb:101 pmb:366 smb:883 d:- ref:0 ; in:6502 out:6502 type:P dur:82000000 cpbdur:82000000 q:23.16 tex:52007 mv:5133 misc:1340 imb:158 pmb:451 smb:741 d:- ref:0 ; in:6503 out:6503 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:48681 mv:5157 misc:1330 imb:196 pmb:433 smb:721 d:- ref:0 ; in:6504 out:6504 type:P dur:82000000 cpbdur:82000000 q:22.16 tex:55649 mv:6121 misc:1430 imb:193 pmb:583 smb:574 d:- ref:0 ; in:6505 out:6505 type:P dur:82000000 cpbdur:82000000 q:22.03 tex:53496 mv:5887 misc:1409 imb:128 pmb:597 smb:625 d:- ref:0 ; in:6506 out:6506 type:P dur:82000000 cpbdur:82000000 q:22.12 tex:60671 mv:6076 misc:1373 imb:147 pmb:592 smb:611 d:- ref:0 ; in:6507 out:6507 type:P dur:82000000 cpbdur:82000000 q:21.98 tex:55393 mv:5743 misc:1400 imb:171 pmb:541 smb:638 d:- ref:0 ; in:6508 out:6508 type:P dur:82000000 cpbdur:82000000 q:22.29 tex:61420 mv:6500 misc:1424 imb:191 pmb:548 smb:611 d:- ref:0 ; in:6509 out:6509 type:P dur:82000000 cpbdur:82000000 q:22.26 tex:60806 mv:6386 misc:1456 imb:224 pmb:542 smb:584 d:- ref:0 ; in:6510 out:6510 type:P dur:82000000 cpbdur:82000000 q:22.15 tex:51139 mv:5718 misc:1399 imb:171 pmb:536 smb:643 d:- ref:0 ; in:6511 out:6511 type:P dur:82000000 cpbdur:82000000 q:22.20 tex:57724 mv:5898 misc:1394 imb:164 pmb:522 smb:664 d:- ref:0 ; in:6512 out:6512 type:P dur:82000000 cpbdur:82000000 q:22.05 tex:51146 mv:5996 misc:1498 imb:192 pmb:580 smb:578 d:- ref:0 ; in:6513 out:6513 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:48640 mv:5423 misc:1449 imb:142 pmb:579 smb:629 d:- ref:0 ; in:6514 out:6514 type:P dur:82000000 cpbdur:82000000 q:22.08 tex:56521 mv:6371 misc:1436 imb:194 pmb:521 smb:635 d:- ref:0 ; in:6515 out:6515 type:P dur:82000000 cpbdur:82000000 q:21.96 tex:51541 mv:5185 misc:1298 imb:116 pmb:517 smb:717 d:- ref:0 ; in:6516 out:6516 type:P dur:82000000 cpbdur:82000000 q:21.83 tex:43161 mv:5252 misc:1403 imb:144 pmb:570 smb:636 d:- ref:0 ; in:6517 out:6517 type:P dur:82000000 cpbdur:82000000 q:22.05 tex:59475 mv:5104 misc:1325 imb:161 pmb:490 smb:699 d:- ref:0 ; in:6518 out:6518 type:P dur:82000000 cpbdur:82000000 q:21.84 tex:49561 mv:5420 misc:1363 imb:110 pmb:574 smb:666 d:- ref:0 ; in:6519 out:6519 type:P dur:82000000 cpbdur:82000000 q:21.86 tex:51286 mv:4902 misc:1308 imb:147 pmb:470 smb:733 d:- ref:0 ; in:6520 out:6520 type:P dur:82000000 cpbdur:82000000 q:21.83 tex:44484 mv:6104 misc:1452 imb:210 pmb:576 smb:564 d:- ref:0 ; in:6521 out:6521 type:P dur:82000000 cpbdur:82000000 q:21.97 tex:60332 mv:6237 misc:1399 imb:252 pmb:507 smb:591 d:- ref:0 ; in:6522 out:6522 type:P dur:82000000 cpbdur:82000000 q:21.96 tex:56567 mv:6227 misc:1406 imb:186 pmb:557 smb:607 d:- ref:0 ; in:6523 out:6523 type:P dur:82000000 cpbdur:82000000 q:21.89 tex:49386 mv:5521 misc:1437 imb:197 pmb:517 smb:636 d:- ref:0 ; in:6524 out:6524 type:P dur:82000000 cpbdur:82000000 q:21.91 tex:56272 mv:6541 misc:1435 imb:232 pmb:577 smb:541 d:- ref:0 ; in:6525 out:6525 type:P dur:82000000 cpbdur:82000000 q:21.94 tex:59525 mv:6331 misc:1440 imb:252 pmb:539 smb:559 d:- ref:0 ; in:6526 out:6526 type:P dur:82000000 cpbdur:82000000 q:22.02 tex:71542 mv:6544 misc:1426 imb:241 pmb:528 smb:581 d:- ref:0 ; in:6527 out:6527 type:P dur:82000000 cpbdur:82000000 q:22.02 tex:63686 mv:5759 misc:1435 imb:187 pmb:587 smb:576 d:- ref:0 ; in:6528 out:6528 type:P dur:82000000 cpbdur:82000000 q:22.04 tex:66292 mv:7037 misc:1463 imb:244 pmb:631 smb:475 d:- ref:0 ; in:6529 out:6529 type:P dur:82000000 cpbdur:82000000 q:21.96 tex:59801 mv:5976 misc:1463 imb:206 pmb:586 smb:558 d:- ref:0 ; in:6530 out:6530 type:P dur:82000000 cpbdur:82000000 q:22.09 tex:57988 mv:6163 misc:1425 imb:230 pmb:581 smb:539 d:- ref:0 ; in:6531 out:6531 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:79112 mv:7047 misc:1441 imb:249 pmb:585 smb:516 d:- ref:0 ; in:6532 out:6532 type:P dur:82000000 cpbdur:82000000 q:22.29 tex:70524 mv:5960 misc:1484 imb:185 pmb:620 smb:545 d:- ref:0 ; in:6533 out:6533 type:P dur:82000000 cpbdur:82000000 q:22.60 tex:64500 mv:6168 misc:1364 imb:203 pmb:548 smb:599 d:- ref:0 ; in:6534 out:6534 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:59641 mv:6909 misc:1442 imb:291 pmb:561 smb:498 d:- ref:0 ; in:6535 out:6535 type:P dur:82000000 cpbdur:82000000 q:22.59 tex:61914 mv:6611 misc:1419 imb:264 pmb:555 smb:531 d:- ref:0 ; in:6536 out:6536 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:66926 mv:7164 misc:1478 imb:298 pmb:562 smb:490 d:- ref:0 ; in:6537 out:6537 type:P dur:82000000 cpbdur:82000000 q:22.75 tex:64203 mv:7325 misc:1480 imb:280 pmb:583 smb:487 d:- ref:0 ; in:6538 out:6538 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:64695 mv:7103 misc:1458 imb:257 pmb:573 smb:520 d:- ref:0 ; in:6539 out:6539 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:65285 mv:7107 misc:1392 imb:246 pmb:559 smb:545 d:- ref:0 ; in:6540 out:6540 type:P dur:82000000 cpbdur:82000000 q:22.63 tex:58410 mv:6882 misc:1452 imb:282 pmb:564 smb:504 d:- ref:0 ; in:6541 out:6541 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:67104 mv:6989 misc:1395 imb:252 pmb:569 smb:529 d:- ref:0 ; in:6542 out:6542 type:P dur:82000000 cpbdur:82000000 q:22.71 tex:59420 mv:6992 misc:1436 imb:243 pmb:622 smb:485 d:- ref:0 ; in:6543 out:6543 type:P dur:82000000 cpbdur:82000000 q:22.64 tex:60453 mv:6924 misc:1471 imb:274 pmb:612 smb:464 d:- ref:0 ; in:6544 out:6544 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:64644 mv:7188 misc:1480 imb:270 pmb:588 smb:492 d:- ref:0 ; in:6545 out:6545 type:P dur:82000000 cpbdur:82000000 q:22.40 tex:73186 mv:7146 misc:1516 imb:251 pmb:664 smb:435 d:- ref:0 ; in:6546 out:6546 type:P dur:82000000 cpbdur:82000000 q:22.47 tex:72432 mv:6680 misc:1448 imb:206 pmb:662 smb:482 d:- ref:0 ; in:6547 out:6547 type:P dur:82000000 cpbdur:82000000 q:22.34 tex:67672 mv:6390 misc:1474 imb:205 pmb:632 smb:513 d:- ref:0 ; in:6548 out:6548 type:P dur:82000000 cpbdur:82000000 q:22.60 tex:66835 mv:6232 misc:1349 imb:157 pmb:560 smb:633 d:- ref:0 ; in:6549 out:6549 type:P dur:82000000 cpbdur:82000000 q:20.95 tex:44765 mv:3859 misc:1504 imb:96 pmb:739 smb:515 d:- ref:0 ; in:6550 out:6550 type:P dur:82000000 cpbdur:82000000 q:20.42 tex:57715 mv:3647 misc:1518 imb:56 pmb:799 smb:495 d:- ref:0 ; in:6551 out:6551 type:P dur:82000000 cpbdur:82000000 q:18.55 tex:50480 mv:3944 misc:1544 imb:43 pmb:954 smb:353 d:- ref:0 ; in:6552 out:6552 type:P dur:82000000 cpbdur:82000000 q:18.54 tex:35561 mv:3257 misc:1566 imb:58 pmb:757 smb:535 d:- ref:0 ; in:6553 out:6553 type:P dur:82000000 cpbdur:82000000 q:16.77 tex:75485 mv:3967 misc:1524 imb:39 pmb:1095 smb:216 d:- ref:0 ; in:6554 out:6554 type:P dur:82000000 cpbdur:82000000 q:17.78 tex:35983 mv:2815 misc:1538 imb:29 pmb:675 smb:646 d:- ref:0 ; in:6555 out:6555 type:P dur:82000000 cpbdur:82000000 q:15.77 tex:83034 mv:3933 misc:1513 imb:20 pmb:1189 smb:141 d:- ref:0 ; in:6556 out:6556 type:P dur:82000000 cpbdur:82000000 q:16.19 tex:31772 mv:2718 misc:1590 imb:25 pmb:752 smb:573 d:- ref:0 ; in:6557 out:6557 type:P dur:82000000 cpbdur:82000000 q:15.14 tex:38226 mv:2948 misc:1578 imb:9 pmb:762 smb:579 d:- ref:0 ; in:6558 out:6558 type:P dur:82000000 cpbdur:82000000 q:16.64 tex:27019 mv:2706 misc:1555 imb:22 pmb:732 smb:596 d:- ref:0 ; in:6559 out:6559 type:P dur:82000000 cpbdur:82000000 q:16.40 tex:49996 mv:3041 misc:1579 imb:23 pmb:833 smb:494 d:- ref:0 ; in:6560 out:6560 type:P dur:82000000 cpbdur:82000000 q:17.72 tex:34630 mv:2594 misc:1496 imb:40 pmb:654 smb:656 d:- ref:0 ; in:6561 out:6561 type:P dur:82000000 cpbdur:82000000 q:16.26 tex:47243 mv:3327 misc:1606 imb:27 pmb:965 smb:358 d:- ref:0 ; in:6562 out:6562 type:P dur:82000000 cpbdur:82000000 q:16.80 tex:21594 mv:2759 misc:1591 imb:39 pmb:751 smb:560 d:- ref:0 ; in:6563 out:6563 type:P dur:82000000 cpbdur:82000000 q:15.17 tex:40207 mv:3422 misc:1611 imb:30 pmb:902 smb:418 d:- ref:0 ; in:6564 out:6564 type:P dur:82000000 cpbdur:82000000 q:16.75 tex:26777 mv:2216 misc:1511 imb:20 pmb:600 smb:730 d:- ref:0 ; in:6565 out:6565 type:P dur:82000000 cpbdur:82000000 q:16.78 tex:38083 mv:1984 misc:1373 imb:12 pmb:536 smb:802 d:- ref:0 ; in:6566 out:6566 type:P dur:82000000 cpbdur:82000000 q:18.55 tex:38191 mv:2321 misc:1400 imb:20 pmb:577 smb:753 d:- ref:0 ; in:6567 out:6567 type:P dur:82000000 cpbdur:82000000 q:17.91 tex:30090 mv:1572 misc:1282 imb:7 pmb:434 smb:909 d:- ref:0 ; in:6568 out:6568 type:P dur:82000000 cpbdur:82000000 q:17.87 tex:27568 mv:1286 misc:1018 imb:5 pmb:304 smb:1041 d:- ref:0 ; in:6569 out:6569 type:P dur:82000000 cpbdur:82000000 q:17.29 tex:36415 mv:2511 misc:1554 imb:14 pmb:729 smb:607 d:- ref:0 ; in:6570 out:6570 type:P dur:82000000 cpbdur:82000000 q:17.13 tex:33708 mv:1955 misc:1417 imb:7 pmb:545 smb:798 d:- ref:0 ; in:6571 out:6571 type:P dur:82000000 cpbdur:82000000 q:17.44 tex:39651 mv:2147 misc:1442 imb:10 pmb:595 smb:745 d:- ref:0 ; in:6572 out:6572 type:P dur:82000000 cpbdur:82000000 q:21.44 tex:238815 mv:14478 misc:1419 imb:1266 pmb:84 smb:0 d:- ref:0 ; in:6573 out:6573 type:P dur:82000000 cpbdur:82000000 q:23.43 tex:17695 mv:965 misc:860 imb:0 pmb:265 smb:1085 d:- ref:0 ; in:6574 out:6574 type:P dur:82000000 cpbdur:82000000 q:21.23 tex:15203 mv:1416 misc:1245 imb:11 pmb:394 smb:945 d:- ref:0 ; in:6575 out:6575 type:P dur:82000000 cpbdur:82000000 q:19.77 tex:20133 mv:1594 misc:1161 imb:23 pmb:366 smb:961 d:- ref:0 ; in:6576 out:6576 type:P dur:82000000 cpbdur:82000000 q:18.49 tex:58918 mv:4044 misc:1582 imb:69 pmb:864 smb:417 d:- ref:0 ; in:6577 out:6577 type:P dur:82000000 cpbdur:82000000 q:17.86 tex:15255 mv:3073 misc:1432 imb:74 pmb:507 smb:769 d:- ref:0 ; in:6578 out:6578 type:P dur:82000000 cpbdur:82000000 q:21.46 tex:67964 mv:5707 misc:1209 imb:310 pmb:337 smb:703 d:- ref:0 ; in:6579 out:6579 type:P dur:82000000 cpbdur:82000000 q:20.56 tex:31431 mv:2502 misc:1291 imb:45 pmb:444 smb:861 d:- ref:0 ; in:6580 out:6580 type:P dur:82000000 cpbdur:82000000 q:20.45 tex:41879 mv:2528 misc:1241 imb:43 pmb:448 smb:859 d:- ref:0 ; in:6581 out:6581 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:51392 mv:3064 misc:856 imb:110 pmb:254 smb:986 d:- ref:0 ; in:6582 out:6582 type:P dur:82000000 cpbdur:82000000 q:22.60 tex:52955 mv:3969 misc:956 imb:203 pmb:245 smb:902 d:- ref:0 ; in:6583 out:6583 type:P dur:82000000 cpbdur:82000000 q:21.24 tex:35650 mv:3512 misc:1366 imb:116 pmb:538 smb:696 d:- ref:0 ; in:6584 out:6584 type:P dur:82000000 cpbdur:82000000 q:21.04 tex:41949 mv:3561 misc:1370 imb:122 pmb:487 smb:741 d:- ref:0 ; in:6585 out:6585 type:P dur:82000000 cpbdur:82000000 q:21.21 tex:58019 mv:2739 misc:1130 imb:65 pmb:361 smb:924 d:- ref:0 ; in:6586 out:6586 type:P dur:82000000 cpbdur:82000000 q:20.40 tex:36072 mv:2395 misc:1309 imb:36 pmb:517 smb:797 d:- ref:0 ; in:6587 out:6587 type:P dur:82000000 cpbdur:82000000 q:19.70 tex:44545 mv:1675 misc:1044 imb:17 pmb:385 smb:948 d:- ref:0 ; in:6588 out:6588 type:P dur:82000000 cpbdur:82000000 q:19.00 tex:46746 mv:3919 misc:1575 imb:62 pmb:769 smb:519 d:- ref:0 ; in:6589 out:6589 type:P dur:82000000 cpbdur:82000000 q:17.22 tex:61979 mv:3529 misc:1548 imb:28 pmb:945 smb:377 d:- ref:0 ; in:6590 out:6590 type:P dur:82000000 cpbdur:82000000 q:17.71 tex:23796 mv:2183 misc:1405 imb:30 pmb:503 smb:817 d:- ref:0 ; in:6591 out:6591 type:P dur:82000000 cpbdur:82000000 q:16.92 tex:26505 mv:2733 misc:1554 imb:35 pmb:651 smb:664 d:- ref:0 ; in:6592 out:6592 type:P dur:82000000 cpbdur:82000000 q:17.89 tex:28638 mv:2602 misc:1456 imb:35 pmb:578 smb:737 d:- ref:0 ; in:6593 out:6593 type:P dur:82000000 cpbdur:82000000 q:17.02 tex:27954 mv:2739 misc:1571 imb:41 pmb:671 smb:638 d:- ref:0 ; in:6594 out:6594 type:P dur:82000000 cpbdur:82000000 q:17.27 tex:25134 mv:3032 misc:1562 imb:55 pmb:706 smb:589 d:- ref:0 ; in:6595 out:6595 type:P dur:82000000 cpbdur:82000000 q:15.64 tex:48309 mv:3494 misc:1573 imb:33 pmb:992 smb:325 d:- ref:0 ; in:6596 out:6596 type:P dur:82000000 cpbdur:82000000 q:16.39 tex:26087 mv:2834 misc:1575 imb:44 pmb:722 smb:584 d:- ref:0 ; in:6597 out:6597 type:P dur:82000000 cpbdur:82000000 q:15.64 tex:13471 mv:1777 misc:1376 imb:33 pmb:419 smb:898 d:- ref:0 ; in:6598 out:6598 type:P dur:82000000 cpbdur:82000000 q:16.86 tex:20383 mv:2466 misc:1591 imb:23 pmb:688 smb:639 d:- ref:0 ; in:6599 out:6599 type:P dur:82000000 cpbdur:82000000 q:16.75 tex:27948 mv:1680 misc:1340 imb:10 pmb:476 smb:864 d:- ref:0 ; in:6600 out:6600 type:P dur:82000000 cpbdur:82000000 q:17.91 tex:23344 mv:2282 misc:1390 imb:43 pmb:492 smb:815 d:- ref:0 ; in:6601 out:6601 type:P dur:82000000 cpbdur:82000000 q:17.36 tex:31892 mv:3002 misc:1554 imb:60 pmb:670 smb:620 d:- ref:0 ; in:6602 out:6602 type:P dur:82000000 cpbdur:82000000 q:16.84 tex:21586 mv:2348 misc:1466 imb:45 pmb:492 smb:813 d:- ref:0 ; in:6603 out:6603 type:P dur:82000000 cpbdur:82000000 q:17.99 tex:26792 mv:3639 misc:1553 imb:94 pmb:599 smb:657 d:- ref:0 ; in:6604 out:6604 type:P dur:82000000 cpbdur:82000000 q:17.05 tex:24187 mv:2833 misc:1564 imb:34 pmb:651 smb:665 d:- ref:0 ; in:6605 out:6605 type:P dur:82000000 cpbdur:82000000 q:17.45 tex:34404 mv:2197 misc:1415 imb:16 pmb:537 smb:797 d:- ref:0 ; in:6606 out:6606 type:P dur:82000000 cpbdur:82000000 q:17.89 tex:27594 mv:2943 misc:1527 imb:60 pmb:575 smb:715 d:- ref:0 ; in:6607 out:6607 type:P dur:82000000 cpbdur:82000000 q:16.80 tex:30703 mv:2489 misc:1512 imb:31 pmb:629 smb:690 d:- ref:0 ; in:6608 out:6608 type:P dur:82000000 cpbdur:82000000 q:18.03 tex:31250 mv:3830 misc:1512 imb:96 pmb:600 smb:654 d:- ref:0 ; in:6609 out:6609 type:P dur:82000000 cpbdur:82000000 q:19.29 tex:65446 mv:2742 misc:1292 imb:24 pmb:532 smb:794 d:- ref:0 ; in:6610 out:6610 type:P dur:82000000 cpbdur:82000000 q:18.66 tex:33162 mv:1819 misc:1187 imb:13 pmb:415 smb:922 d:- ref:0 ; in:6611 out:6611 type:P dur:82000000 cpbdur:82000000 q:18.83 tex:32746 mv:2690 misc:1396 imb:46 pmb:504 smb:800 d:- ref:0 ; in:6612 out:6612 type:P dur:82000000 cpbdur:82000000 q:17.76 tex:21018 mv:1781 misc:1345 imb:26 pmb:441 smb:883 d:- ref:0 ; in:6613 out:6613 type:P dur:82000000 cpbdur:82000000 q:16.65 tex:36079 mv:2750 misc:1539 imb:33 pmb:714 smb:603 d:- ref:0 ; in:6614 out:6614 type:P dur:82000000 cpbdur:82000000 q:18.21 tex:34371 mv:2617 misc:1420 imb:44 pmb:503 smb:803 d:- ref:0 ; in:6615 out:6615 type:P dur:82000000 cpbdur:82000000 q:18.20 tex:28145 mv:2665 misc:1382 imb:53 pmb:485 smb:812 d:- ref:0 ; in:6616 out:6616 type:P dur:82000000 cpbdur:82000000 q:19.54 tex:48841 mv:1956 misc:1163 imb:19 pmb:402 smb:929 d:- ref:0 ; in:6617 out:6617 type:P dur:82000000 cpbdur:82000000 q:19.05 tex:44135 mv:3145 misc:1432 imb:57 pmb:587 smb:706 d:- ref:0 ; in:6618 out:6618 type:P dur:82000000 cpbdur:82000000 q:19.01 tex:41107 mv:1702 misc:1151 imb:14 pmb:424 smb:912 d:- ref:0 ; in:6619 out:6619 type:P dur:82000000 cpbdur:82000000 q:19.46 tex:43015 mv:2764 misc:1357 imb:57 pmb:536 smb:757 d:- ref:0 ; in:6620 out:6620 type:P dur:82000000 cpbdur:82000000 q:19.41 tex:31469 mv:4609 misc:1562 imb:99 pmb:641 smb:610 d:- ref:0 ; in:6621 out:6621 type:P dur:82000000 cpbdur:82000000 q:19.55 tex:19997 mv:4451 misc:1560 imb:169 pmb:585 smb:596 d:- ref:0 ; in:6622 out:6622 type:P dur:82000000 cpbdur:82000000 q:18.00 tex:40856 mv:5306 misc:1582 imb:139 pmb:916 smb:295 d:- ref:0 ; in:6623 out:6623 type:P dur:82000000 cpbdur:82000000 q:17.38 tex:50620 mv:4365 misc:1567 imb:75 pmb:941 smb:334 d:- ref:0 ; in:6624 out:6624 type:P dur:82000000 cpbdur:82000000 q:17.57 tex:15605 mv:3066 misc:1561 imb:71 pmb:568 smb:711 d:- ref:0 ; in:6625 out:6625 type:P dur:82000000 cpbdur:82000000 q:16.40 tex:61431 mv:4118 misc:1539 imb:50 pmb:1090 smb:210 d:- ref:0 ; in:6626 out:6626 type:P dur:82000000 cpbdur:82000000 q:18.53 tex:29186 mv:3664 misc:1502 imb:81 pmb:632 smb:637 d:- ref:0 ; in:6627 out:6627 type:P dur:82000000 cpbdur:82000000 q:17.19 tex:26095 mv:3857 misc:1600 imb:54 pmb:861 smb:435 d:- ref:0 ; in:6628 out:6628 type:P dur:82000000 cpbdur:82000000 q:16.30 tex:49019 mv:3990 misc:1591 imb:58 pmb:1014 smb:278 d:- ref:0 ; in:6629 out:6629 type:P dur:82000000 cpbdur:82000000 q:17.92 tex:27979 mv:3402 misc:1547 imb:71 pmb:628 smb:651 d:- ref:0 ; in:6630 out:6630 type:P dur:82000000 cpbdur:82000000 q:18.32 tex:48354 mv:2264 misc:1334 imb:27 pmb:514 smb:809 d:- ref:0 ; in:6631 out:6631 type:P dur:82000000 cpbdur:82000000 q:17.45 tex:35242 mv:2986 misc:1588 imb:31 pmb:744 smb:575 d:- ref:0 ; in:6632 out:6632 type:P dur:82000000 cpbdur:82000000 q:17.37 tex:25000 mv:4133 misc:1595 imb:111 pmb:735 smb:504 d:- ref:0 ; in:6633 out:6633 type:P dur:82000000 cpbdur:82000000 q:16.99 tex:23546 mv:2340 misc:1466 imb:46 pmb:516 smb:788 d:- ref:0 ; in:6634 out:6634 type:P dur:82000000 cpbdur:82000000 q:18.02 tex:32824 mv:2201 misc:1391 imb:20 pmb:519 smb:811 d:- ref:0 ; in:6635 out:6635 type:P dur:82000000 cpbdur:82000000 q:17.56 tex:17517 mv:1237 misc:1062 imb:8 pmb:289 smb:1053 d:- ref:0 ; in:6636 out:6636 type:P dur:82000000 cpbdur:82000000 q:18.27 tex:38253 mv:2238 misc:1389 imb:31 pmb:508 smb:811 d:- ref:0 ; in:6637 out:6637 type:P dur:82000000 cpbdur:82000000 q:18.05 tex:17815 mv:2229 misc:1452 imb:29 pmb:509 smb:812 d:- ref:0 ; in:6638 out:6638 type:P dur:82000000 cpbdur:82000000 q:17.74 tex:27221 mv:1638 misc:1149 imb:32 pmb:336 smb:982 d:- ref:0 ; in:6639 out:6639 type:P dur:82000000 cpbdur:82000000 q:17.76 tex:23884 mv:1786 misc:1362 imb:27 pmb:466 smb:857 d:- ref:0 ; in:6640 out:6640 type:P dur:82000000 cpbdur:82000000 q:17.41 tex:52422 mv:3168 misc:1602 imb:43 pmb:762 smb:545 d:- ref:0 ; in:6641 out:6641 type:P dur:82000000 cpbdur:82000000 q:19.47 tex:62200 mv:2862 misc:1314 imb:24 pmb:538 smb:788 d:- ref:0 ; in:6642 out:6642 type:P dur:82000000 cpbdur:82000000 q:19.40 tex:38537 mv:2156 misc:1203 imb:35 pmb:386 smb:929 d:- ref:0 ; in:6643 out:6643 type:P dur:82000000 cpbdur:82000000 q:19.04 tex:40035 mv:2180 misc:1225 imb:24 pmb:426 smb:900 d:- ref:0 ; in:6644 out:6644 type:P dur:82000000 cpbdur:82000000 q:18.72 tex:17010 mv:1997 misc:1329 imb:40 pmb:379 smb:931 d:- ref:0 ; in:6645 out:6645 type:P dur:82000000 cpbdur:82000000 q:17.47 tex:39209 mv:3715 misc:1588 imb:75 pmb:797 smb:478 d:- ref:0 ; in:6646 out:6646 type:P dur:82000000 cpbdur:82000000 q:17.60 tex:18771 mv:1883 misc:1394 imb:30 pmb:459 smb:861 d:- ref:0 ; in:6647 out:6647 type:P dur:82000000 cpbdur:82000000 q:18.99 tex:45485 mv:2309 misc:1278 imb:34 pmb:491 smb:825 d:- ref:0 ; in:6648 out:6648 type:P dur:82000000 cpbdur:82000000 q:18.84 tex:43696 mv:1828 misc:1276 imb:11 pmb:460 smb:879 d:- ref:0 ; in:6649 out:6649 type:P dur:82000000 cpbdur:82000000 q:19.09 tex:63219 mv:2198 misc:1159 imb:22 pmb:438 smb:890 d:- ref:0 ; in:6650 out:6650 type:P dur:82000000 cpbdur:82000000 q:19.16 tex:30412 mv:2807 misc:1453 imb:78 pmb:481 smb:791 d:- ref:0 ; in:6651 out:6651 type:P dur:82000000 cpbdur:82000000 q:18.71 tex:28009 mv:2523 misc:1324 imb:54 pmb:469 smb:827 d:- ref:0 ; in:6652 out:6652 type:P dur:82000000 cpbdur:82000000 q:18.17 tex:40371 mv:3138 misc:1483 imb:60 pmb:626 smb:664 d:- ref:0 ; in:6653 out:6653 type:P dur:82000000 cpbdur:82000000 q:18.39 tex:24598 mv:2898 misc:1488 imb:70 pmb:552 smb:728 d:- ref:0 ; in:6654 out:6654 type:P dur:82000000 cpbdur:82000000 q:17.20 tex:36495 mv:3280 misc:1601 imb:39 pmb:822 smb:489 d:- ref:0 ; in:6655 out:6655 type:P dur:82000000 cpbdur:82000000 q:17.76 tex:22249 mv:1942 misc:1385 imb:25 pmb:474 smb:851 d:- ref:0 ; in:6656 out:6656 type:P dur:82000000 cpbdur:82000000 q:18.16 tex:29000 mv:2194 misc:1326 imb:38 pmb:434 smb:878 d:- ref:0 ; in:6657 out:6657 type:P dur:82000000 cpbdur:82000000 q:17.03 tex:27731 mv:2995 misc:1578 imb:50 pmb:695 smb:605 d:- ref:0 ; in:6658 out:6658 type:P dur:82000000 cpbdur:82000000 q:17.54 tex:13245 mv:1668 misc:1279 imb:37 pmb:360 smb:953 d:- ref:0 ; in:6659 out:6659 type:P dur:82000000 cpbdur:82000000 q:18.54 tex:32053 mv:2373 misc:1366 imb:49 pmb:461 smb:840 d:- ref:0 ; in:6660 out:6660 type:P dur:82000000 cpbdur:82000000 q:18.55 tex:33491 mv:2390 misc:1287 imb:52 pmb:434 smb:864 d:- ref:0 ; in:6661 out:6661 type:P dur:82000000 cpbdur:82000000 q:19.11 tex:33344 mv:5026 misc:1542 imb:142 pmb:654 smb:554 d:- ref:0 ; in:6662 out:6662 type:P dur:82000000 cpbdur:82000000 q:19.46 tex:51343 mv:3326 misc:1443 imb:69 pmb:614 smb:667 d:- ref:0 ; in:6663 out:6663 type:P dur:82000000 cpbdur:82000000 q:18.12 tex:31464 mv:3193 misc:1535 imb:64 pmb:641 smb:645 d:- ref:0 ; in:6664 out:6664 type:P dur:82000000 cpbdur:82000000 q:17.95 tex:17633 mv:2930 misc:1517 imb:58 pmb:546 smb:746 d:- ref:0 ; in:6665 out:6665 type:P dur:82000000 cpbdur:82000000 q:16.71 tex:28976 mv:3093 misc:1563 imb:37 pmb:777 smb:536 d:- ref:0 ; in:6666 out:6666 type:P dur:82000000 cpbdur:82000000 q:18.04 tex:32907 mv:2606 misc:1471 imb:35 pmb:584 smb:731 d:- ref:0 ; in:6667 out:6667 type:P dur:82000000 cpbdur:82000000 q:19.34 tex:64307 mv:2403 misc:1218 imb:22 pmb:473 smb:855 d:- ref:0 ; in:6668 out:6668 type:P dur:82000000 cpbdur:82000000 q:18.95 tex:23254 mv:2172 misc:1438 imb:27 pmb:520 smb:803 d:- ref:0 ; in:6669 out:6669 type:P dur:82000000 cpbdur:82000000 q:18.05 tex:22802 mv:2611 misc:1451 imb:37 pmb:555 smb:758 d:- ref:0 ; in:6670 out:6670 type:P dur:82000000 cpbdur:82000000 q:18.80 tex:43612 mv:2106 misc:1194 imb:23 pmb:438 smb:889 d:- ref:0 ; in:6671 out:6671 type:P dur:82000000 cpbdur:82000000 q:19.18 tex:49903 mv:2166 misc:1283 imb:23 pmb:474 smb:853 d:- ref:0 ; in:6672 out:6672 type:P dur:82000000 cpbdur:82000000 q:18.93 tex:32904 mv:1999 misc:1313 imb:30 pmb:461 smb:859 d:- ref:0 ; in:6673 out:6673 type:P dur:82000000 cpbdur:82000000 q:19.20 tex:46268 mv:1759 misc:1165 imb:11 pmb:389 smb:950 d:- ref:0 ; in:6674 out:6674 type:P dur:82000000 cpbdur:82000000 q:18.63 tex:27681 mv:1653 misc:1298 imb:16 pmb:423 smb:911 d:- ref:0 ; in:6675 out:6675 type:P dur:82000000 cpbdur:82000000 q:17.69 tex:18448 mv:2083 misc:1445 imb:36 pmb:485 smb:829 d:- ref:0 ; in:6676 out:6676 type:P dur:82000000 cpbdur:82000000 q:19.06 tex:48140 mv:2352 misc:1300 imb:36 pmb:480 smb:834 d:- ref:0 ; in:6677 out:6677 type:P dur:82000000 cpbdur:82000000 q:19.41 tex:48679 mv:2262 misc:1291 imb:28 pmb:472 smb:850 d:- ref:0 ; in:6678 out:6678 type:P dur:82000000 cpbdur:82000000 q:18.46 tex:35106 mv:2443 misc:1403 imb:42 pmb:507 smb:801 d:- ref:0 ; in:6679 out:6679 type:P dur:82000000 cpbdur:82000000 q:18.03 tex:19517 mv:1740 misc:1335 imb:16 pmb:448 smb:886 d:- ref:0 ; in:6680 out:6680 type:P dur:82000000 cpbdur:82000000 q:17.45 tex:46757 mv:2864 misc:1555 imb:21 pmb:754 smb:575 d:- ref:0 ; in:6681 out:6681 type:P dur:82000000 cpbdur:82000000 q:17.87 tex:15453 mv:1959 misc:1380 imb:23 pmb:447 smb:880 d:- ref:0 ; in:6682 out:6682 type:P dur:82000000 cpbdur:82000000 q:16.68 tex:15953 mv:2438 misc:1545 imb:34 pmb:610 smb:706 d:- ref:0 ; in:6683 out:6683 type:P dur:82000000 cpbdur:82000000 q:15.67 tex:49204 mv:3687 misc:1589 imb:38 pmb:999 smb:313 d:- ref:0 ; in:6684 out:6684 type:P dur:82000000 cpbdur:82000000 q:17.18 tex:19269 mv:2696 misc:1555 imb:31 pmb:624 smb:695 d:- ref:0 ; in:6685 out:6685 type:P dur:82000000 cpbdur:82000000 q:15.93 tex:25313 mv:2654 misc:1601 imb:24 pmb:720 smb:606 d:- ref:0 ; in:6686 out:6686 type:P dur:82000000 cpbdur:82000000 q:17.56 tex:28671 mv:1769 misc:1352 imb:11 pmb:491 smb:848 d:- ref:0 ; in:6687 out:6687 type:P dur:82000000 cpbdur:82000000 q:17.76 tex:30296 mv:1635 misc:1157 imb:28 pmb:351 smb:971 d:- ref:0 ; in:6688 out:6688 type:P dur:82000000 cpbdur:82000000 q:17.62 tex:15659 mv:1537 misc:1284 imb:21 pmb:391 smb:938 d:- ref:0 ; in:6689 out:6689 type:P dur:82000000 cpbdur:82000000 q:17.29 tex:37896 mv:2631 misc:1529 imb:34 pmb:659 smb:657 d:- ref:0 ; in:6690 out:6690 type:P dur:82000000 cpbdur:82000000 q:16.68 tex:25635 mv:2004 misc:1409 imb:28 pmb:470 smb:852 d:- ref:0 ; in:6691 out:6691 type:P dur:82000000 cpbdur:82000000 q:17.31 tex:34426 mv:2293 misc:1505 imb:21 pmb:589 smb:740 d:- ref:0 ; in:6692 out:6692 type:P dur:82000000 cpbdur:82000000 q:17.55 tex:18803 mv:2365 misc:1424 imb:41 pmb:487 smb:822 d:- ref:0 ; in:6693 out:6693 type:P dur:82000000 cpbdur:82000000 q:17.62 tex:30353 mv:1711 misc:1240 imb:20 pmb:407 smb:923 d:- ref:0 ; in:6694 out:6694 type:P dur:82000000 cpbdur:82000000 q:18.54 tex:40504 mv:2640 misc:1440 imb:42 pmb:488 smb:820 d:- ref:0 ; in:6695 out:6695 type:P dur:82000000 cpbdur:82000000 q:18.25 tex:29939 mv:2021 misc:1344 imb:16 pmb:465 smb:869 d:- ref:0 ; in:6696 out:6696 type:P dur:82000000 cpbdur:82000000 q:18.49 tex:25548 mv:2559 misc:1453 imb:51 pmb:483 smb:816 d:- ref:0 ; in:6697 out:6697 type:P dur:82000000 cpbdur:82000000 q:17.77 tex:20251 mv:1550 misc:1183 imb:15 pmb:376 smb:959 d:- ref:0 ; in:6698 out:6698 type:P dur:82000000 cpbdur:82000000 q:17.89 tex:19699 mv:2509 misc:1440 imb:37 pmb:513 smb:800 d:- ref:0 ; in:6699 out:6699 type:P dur:82000000 cpbdur:82000000 q:19.30 tex:58990 mv:2334 misc:1244 imb:18 pmb:470 smb:862 d:- ref:0 ; in:6700 out:6700 type:P dur:82000000 cpbdur:82000000 q:18.02 tex:27704 mv:1636 misc:1260 imb:19 pmb:414 smb:917 d:- ref:0 ; in:6701 out:6701 type:P dur:82000000 cpbdur:82000000 q:18.18 tex:28096 mv:2621 misc:1411 imb:64 pmb:507 smb:779 d:- ref:0 ; in:6702 out:6702 type:P dur:82000000 cpbdur:82000000 q:18.98 tex:45817 mv:2426 misc:1325 imb:31 pmb:480 smb:839 d:- ref:0 ; in:6703 out:6703 type:P dur:82000000 cpbdur:82000000 q:18.97 tex:41875 mv:1804 misc:1145 imb:10 pmb:410 smb:930 d:- ref:0 ; in:6704 out:6704 type:P dur:82000000 cpbdur:82000000 q:19.83 tex:53035 mv:2375 misc:1198 imb:25 pmb:431 smb:894 d:- ref:0 ; in:6705 out:6705 type:P dur:82000000 cpbdur:82000000 q:19.17 tex:29136 mv:2397 misc:1435 imb:26 pmb:557 smb:767 d:- ref:0 ; in:6706 out:6706 type:P dur:82000000 cpbdur:82000000 q:18.83 tex:38588 mv:1990 misc:1182 imb:25 pmb:392 smb:933 d:- ref:0 ; in:6707 out:6707 type:P dur:82000000 cpbdur:82000000 q:18.18 tex:18278 mv:2765 misc:1509 imb:49 pmb:553 smb:748 d:- ref:0 ; in:6708 out:6708 type:P dur:82000000 cpbdur:82000000 q:18.84 tex:38892 mv:2886 misc:1374 imb:61 pmb:472 smb:817 d:- ref:0 ; in:6709 out:6709 type:P dur:82000000 cpbdur:82000000 q:19.49 tex:55412 mv:2442 misc:1298 imb:20 pmb:498 smb:832 d:- ref:0 ; in:6710 out:6710 type:P dur:82000000 cpbdur:82000000 q:19.47 tex:57044 mv:2279 misc:1309 imb:23 pmb:521 smb:806 d:- ref:0 ; in:6711 out:6711 type:P dur:82000000 cpbdur:82000000 q:19.52 tex:40061 mv:1481 misc:898 imb:13 pmb:307 smb:1030 d:- ref:0 ; in:6712 out:6712 type:P dur:82000000 cpbdur:82000000 q:18.49 tex:26470 mv:2325 misc:1453 imb:27 pmb:573 smb:750 d:- ref:0 ; in:6713 out:6713 type:P dur:82000000 cpbdur:82000000 q:17.45 tex:39554 mv:2956 misc:1562 imb:18 pmb:782 smb:550 d:- ref:0 ; in:6714 out:6714 type:P dur:82000000 cpbdur:82000000 q:18.94 tex:40003 mv:2013 misc:1304 imb:23 pmb:459 smb:868 d:- ref:0 ; in:6715 out:6715 type:P dur:82000000 cpbdur:82000000 q:19.32 tex:52987 mv:1930 misc:1123 imb:11 pmb:420 smb:919 d:- ref:0 ; in:6716 out:6716 type:P dur:82000000 cpbdur:82000000 q:20.42 tex:58904 mv:2514 misc:1166 imb:33 pmb:426 smb:891 d:- ref:0 ; in:6717 out:6717 type:P dur:82000000 cpbdur:82000000 q:20.25 tex:40119 mv:1744 misc:1097 imb:13 pmb:382 smb:955 d:- ref:0 ; in:6718 out:6718 type:P dur:82000000 cpbdur:82000000 q:18.90 tex:32380 mv:3169 misc:1491 imb:61 pmb:591 smb:698 d:- ref:0 ; in:6719 out:6719 type:P dur:82000000 cpbdur:82000000 q:18.75 tex:22761 mv:2997 misc:1490 imb:64 pmb:513 smb:773 d:- ref:0 ; in:6720 out:6720 type:P dur:82000000 cpbdur:82000000 q:18.37 tex:40711 mv:2464 misc:1417 imb:39 pmb:552 smb:759 d:- ref:0 ; in:6721 out:6721 type:P dur:82000000 cpbdur:82000000 q:18.03 tex:35282 mv:1697 misc:1157 imb:15 pmb:407 smb:928 d:- ref:0 ; in:6722 out:6722 type:P dur:82000000 cpbdur:82000000 q:18.46 tex:32047 mv:2432 misc:1425 imb:39 pmb:520 smb:791 d:- ref:0 ; in:6723 out:6723 type:P dur:82000000 cpbdur:82000000 q:17.47 tex:41057 mv:2722 misc:1573 imb:31 pmb:730 smb:589 d:- ref:0 ; in:6724 out:6724 type:P dur:82000000 cpbdur:82000000 q:17.47 tex:29768 mv:2628 misc:1540 imb:30 pmb:656 smb:664 d:- ref:0 ; in:6725 out:6725 type:P dur:82000000 cpbdur:82000000 q:18.30 tex:40900 mv:2035 misc:1233 imb:23 pmb:449 smb:878 d:- ref:0 ; in:6726 out:6726 type:P dur:82000000 cpbdur:82000000 q:16.89 tex:27229 mv:2232 misc:1483 imb:17 pmb:596 smb:737 d:- ref:0 ; in:6727 out:6727 type:P dur:82000000 cpbdur:82000000 q:18.02 tex:34481 mv:1594 misc:1125 imb:18 pmb:358 smb:974 d:- ref:0 ; in:6728 out:6728 type:P dur:82000000 cpbdur:82000000 q:18.22 tex:36111 mv:2013 misc:1388 imb:13 pmb:515 smb:822 d:- ref:0 ; in:6729 out:6729 type:P dur:82000000 cpbdur:82000000 q:18.16 tex:40127 mv:1917 misc:1348 imb:18 pmb:483 smb:849 d:- ref:0 ; in:6730 out:6730 type:P dur:82000000 cpbdur:82000000 q:18.43 tex:52950 mv:1978 misc:1304 imb:18 pmb:470 smb:862 d:- ref:0 ; in:6731 out:6731 type:P dur:82000000 cpbdur:82000000 q:17.88 tex:23260 mv:1974 misc:1382 imb:18 pmb:496 smb:836 d:- ref:0 ; in:6732 out:6732 type:P dur:82000000 cpbdur:82000000 q:16.82 tex:32608 mv:2683 misc:1541 imb:30 pmb:717 smb:603 d:- ref:0 ; in:6733 out:6733 type:P dur:82000000 cpbdur:82000000 q:18.24 tex:30599 mv:2557 misc:1436 imb:42 pmb:491 smb:817 d:- ref:0 ; in:6734 out:6734 type:P dur:82000000 cpbdur:82000000 q:18.38 tex:24208 mv:2492 misc:1372 imb:39 pmb:468 smb:843 d:- ref:0 ; in:6735 out:6735 type:P dur:82000000 cpbdur:82000000 q:17.03 tex:25774 mv:3790 misc:1612 imb:71 pmb:756 smb:523 d:- ref:0 ; in:6736 out:6736 type:P dur:82000000 cpbdur:82000000 q:18.40 tex:40267 mv:2324 misc:1329 imb:40 pmb:474 smb:836 d:- ref:0 ; in:6737 out:6737 type:P dur:82000000 cpbdur:82000000 q:17.60 tex:24888 mv:1540 misc:1140 imb:13 pmb:346 smb:991 d:- ref:0 ; in:6738 out:6738 type:P dur:82000000 cpbdur:82000000 q:17.66 tex:15918 mv:1712 misc:1306 imb:35 pmb:384 smb:931 d:- ref:0 ; in:6739 out:6739 type:P dur:82000000 cpbdur:82000000 q:18.36 tex:26555 mv:2579 misc:1354 imb:43 pmb:463 smb:844 d:- ref:0 ; in:6740 out:6740 type:P dur:82000000 cpbdur:82000000 q:19.66 tex:42042 mv:2101 misc:1217 imb:33 pmb:421 smb:896 d:- ref:0 ; in:6741 out:6741 type:P dur:82000000 cpbdur:82000000 q:18.76 tex:29538 mv:3415 misc:1495 imb:70 pmb:631 smb:649 d:- ref:0 ; in:6742 out:6742 type:P dur:82000000 cpbdur:82000000 q:17.88 tex:26306 mv:2685 misc:1465 imb:68 pmb:507 smb:775 d:- ref:0 ; in:6743 out:6743 type:P dur:82000000 cpbdur:82000000 q:17.63 tex:17040 mv:2696 misc:1480 imb:54 pmb:520 smb:776 d:- ref:0 ; in:6744 out:6744 type:P dur:82000000 cpbdur:82000000 q:17.74 tex:23435 mv:1702 misc:1231 imb:20 pmb:380 smb:950 d:- ref:0 ; in:6745 out:6745 type:P dur:82000000 cpbdur:82000000 q:20.02 tex:63318 mv:3372 misc:1222 imb:35 pmb:480 smb:835 d:- ref:0 ; in:6746 out:6746 type:P dur:82000000 cpbdur:82000000 q:20.90 tex:59732 mv:5157 misc:1471 imb:96 pmb:767 smb:487 d:- ref:0 ; in:6747 out:6747 type:P dur:82000000 cpbdur:82000000 q:24.90 tex:201274 mv:14648 misc:1414 imb:1256 pmb:92 smb:2 d:- ref:0 ; in:6748 out:6748 type:P dur:82000000 cpbdur:82000000 q:24.04 tex:35516 mv:2778 misc:1154 imb:14 pmb:450 smb:886 d:- ref:0 ; in:6749 out:6749 type:P dur:82000000 cpbdur:82000000 q:23.66 tex:60377 mv:5924 misc:1251 imb:73 pmb:564 smb:713 d:- ref:0 ; in:6750 out:6750 type:I dur:82000000 cpbdur:82000000 q:16.33 tex:393894 mv:14662 misc:380 imb:1350 pmb:0 smb:0 d:- ref:; in:6751 out:6751 type:P dur:82000000 cpbdur:82000000 q:25.47 tex:74484 mv:8879 misc:1261 imb:138 pmb:579 smb:633 d:- ref:0 ; in:6752 out:6752 type:P dur:82000000 cpbdur:82000000 q:23.81 tex:34038 mv:2568 misc:1226 imb:23 pmb:476 smb:851 d:- ref:0 ; in:6753 out:6753 type:P dur:82000000 cpbdur:82000000 q:22.34 tex:50225 mv:3999 misc:1384 imb:164 pmb:639 smb:547 d:- ref:0 ; in:6754 out:6754 type:P dur:82000000 cpbdur:82000000 q:23.78 tex:90641 mv:10710 misc:1313 imb:273 pmb:626 smb:451 d:- ref:0 ; in:6755 out:6755 type:P dur:82000000 cpbdur:82000000 q:22.63 tex:53567 mv:4512 misc:1505 imb:147 pmb:634 smb:569 d:- ref:0 ; in:6756 out:6756 type:P dur:82000000 cpbdur:82000000 q:21.28 tex:64081 mv:5806 misc:1489 imb:249 pmb:794 smb:307 d:- ref:0 ; in:6757 out:6757 type:P dur:82000000 cpbdur:82000000 q:20.20 tex:44705 mv:2552 misc:1399 imb:41 pmb:568 smb:741 d:- ref:0 ; in:6758 out:6758 type:P dur:82000000 cpbdur:82000000 q:19.71 tex:47435 mv:2045 misc:1176 imb:13 pmb:463 smb:874 d:- ref:0 ; in:6759 out:6759 type:P dur:82000000 cpbdur:82000000 q:19.42 tex:74721 mv:4148 misc:1531 imb:78 pmb:830 smb:442 d:- ref:0 ; in:6760 out:6760 type:P dur:82000000 cpbdur:82000000 q:20.41 tex:57286 mv:4998 misc:1468 imb:77 pmb:650 smb:623 d:- ref:0 ; in:6761 out:6761 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:61960 mv:4062 misc:1362 imb:72 pmb:568 smb:710 d:- ref:0 ; in:6762 out:6762 type:P dur:82000000 cpbdur:82000000 q:20.47 tex:58691 mv:3549 misc:1392 imb:78 pmb:533 smb:739 d:- ref:0 ; in:6763 out:6763 type:P dur:82000000 cpbdur:82000000 q:20.61 tex:50895 mv:3314 misc:1183 imb:44 pmb:452 smb:854 d:- ref:0 ; in:6764 out:6764 type:P dur:82000000 cpbdur:82000000 q:19.59 tex:36486 mv:1827 misc:1175 imb:32 pmb:387 smb:931 d:- ref:0 ; in:6765 out:6765 type:P dur:82000000 cpbdur:82000000 q:19.62 tex:45863 mv:2792 misc:1409 imb:45 pmb:558 smb:747 d:- ref:0 ; in:6766 out:6766 type:P dur:82000000 cpbdur:82000000 q:20.20 tex:59711 mv:3091 misc:1206 imb:34 pmb:475 smb:841 d:- ref:0 ; in:6767 out:6767 type:P dur:82000000 cpbdur:82000000 q:20.25 tex:52966 mv:2620 misc:1150 imb:22 pmb:434 smb:894 d:- ref:0 ; in:6768 out:6768 type:P dur:82000000 cpbdur:82000000 q:19.06 tex:40819 mv:3645 misc:1536 imb:73 pmb:753 smb:524 d:- ref:0 ; in:6769 out:6769 type:P dur:82000000 cpbdur:82000000 q:20.33 tex:66084 mv:3368 misc:1276 imb:41 pmb:538 smb:771 d:- ref:0 ; in:6770 out:6770 type:P dur:82000000 cpbdur:82000000 q:18.49 tex:50905 mv:3615 misc:1552 imb:72 pmb:779 smb:499 d:- ref:0 ; in:6771 out:6771 type:P dur:82000000 cpbdur:82000000 q:19.51 tex:40291 mv:2292 misc:1321 imb:29 pmb:500 smb:821 d:- ref:0 ; in:6772 out:6772 type:P dur:82000000 cpbdur:82000000 q:19.45 tex:68518 mv:4057 misc:1481 imb:70 pmb:717 smb:563 d:- ref:0 ; in:6773 out:6773 type:P dur:82000000 cpbdur:82000000 q:18.53 tex:16557 mv:2559 misc:1500 imb:70 pmb:493 smb:787 d:- ref:0 ; in:6774 out:6774 type:P dur:82000000 cpbdur:82000000 q:19.84 tex:53571 mv:2766 misc:1255 imb:56 pmb:488 smb:806 d:- ref:0 ; in:6775 out:6775 type:P dur:82000000 cpbdur:82000000 q:17.90 tex:41921 mv:3637 misc:1522 imb:86 pmb:759 smb:505 d:- ref:0 ; in:6776 out:6776 type:P dur:82000000 cpbdur:82000000 q:17.21 tex:45726 mv:4075 misc:1551 imb:75 pmb:947 smb:328 d:- ref:0 ; in:6777 out:6777 type:P dur:82000000 cpbdur:82000000 q:15.14 tex:83697 mv:4773 misc:1562 imb:52 pmb:1057 smb:241 d:- ref:0 ; in:6778 out:6778 type:P dur:82000000 cpbdur:82000000 q:15.50 tex:20663 mv:2668 misc:1613 imb:15 pmb:810 smb:525 d:- ref:0 ; in:6779 out:6779 type:P dur:82000000 cpbdur:82000000 q:13.51 tex:55875 mv:3541 misc:1616 imb:17 pmb:985 smb:348 d:- ref:0 ; in:6780 out:6780 type:P dur:82000000 cpbdur:82000000 q:17.51 tex:324407 mv:17715 misc:1422 imb:945 pmb:405 smb:0 d:- ref:0 ; in:6781 out:6781 type:P dur:82000000 cpbdur:82000000 q:21.51 tex:19109 mv:1048 misc:995 imb:1 pmb:324 smb:1025 d:- ref:0 ; in:6782 out:6782 type:P dur:82000000 cpbdur:82000000 q:21.60 tex:25113 mv:1265 misc:1022 imb:3 pmb:335 smb:1012 d:- ref:0 ; in:6783 out:6783 type:P dur:82000000 cpbdur:82000000 q:20.45 tex:29767 mv:1807 misc:1306 imb:12 pmb:491 smb:847 d:- ref:0 ; in:6784 out:6784 type:P dur:82000000 cpbdur:82000000 q:18.70 tex:24988 mv:2267 misc:1481 imb:24 pmb:597 smb:729 d:- ref:0 ; in:6785 out:6785 type:P dur:82000000 cpbdur:82000000 q:19.07 tex:45743 mv:2756 misc:1445 imb:64 pmb:562 smb:724 d:- ref:0 ; in:6786 out:6786 type:P dur:82000000 cpbdur:82000000 q:19.31 tex:48412 mv:2620 misc:1384 imb:33 pmb:556 smb:761 d:- ref:0 ; in:6787 out:6787 type:P dur:82000000 cpbdur:82000000 q:18.59 tex:30620 mv:1962 misc:1290 imb:32 pmb:394 smb:924 d:- ref:0 ; in:6788 out:6788 type:P dur:82000000 cpbdur:82000000 q:19.58 tex:46730 mv:2107 misc:1187 imb:24 pmb:427 smb:899 d:- ref:0 ; in:6789 out:6789 type:P dur:82000000 cpbdur:82000000 q:19.15 tex:54080 mv:3085 misc:1459 imb:46 pmb:603 smb:701 d:- ref:0 ; in:6790 out:6790 type:P dur:82000000 cpbdur:82000000 q:18.51 tex:15248 mv:2211 misc:1437 imb:45 pmb:481 smb:824 d:- ref:0 ; in:6791 out:6791 type:P dur:82000000 cpbdur:82000000 q:17.18 tex:50492 mv:3981 misc:1591 imb:69 pmb:951 smb:330 d:- ref:0 ; in:6792 out:6792 type:P dur:82000000 cpbdur:82000000 q:18.81 tex:47237 mv:2666 misc:1385 imb:42 pmb:534 smb:774 d:- ref:0 ; in:6793 out:6793 type:P dur:82000000 cpbdur:82000000 q:18.78 tex:26755 mv:2513 misc:1492 imb:37 pmb:565 smb:748 d:- ref:0 ; in:6794 out:6794 type:P dur:82000000 cpbdur:82000000 q:17.80 tex:22017 mv:1887 misc:1352 imb:35 pmb:421 smb:894 d:- ref:0 ; in:6795 out:6795 type:P dur:82000000 cpbdur:82000000 q:18.19 tex:35398 mv:2209 misc:1401 imb:24 pmb:531 smb:795 d:- ref:0 ; in:6796 out:6796 type:P dur:82000000 cpbdur:82000000 q:18.87 tex:38172 mv:1982 misc:1190 imb:19 pmb:414 smb:917 d:- ref:0 ; in:6797 out:6797 type:P dur:82000000 cpbdur:82000000 q:17.59 tex:27281 mv:1774 misc:1265 imb:19 pmb:442 smb:889 d:- ref:0 ; in:6798 out:6798 type:P dur:82000000 cpbdur:82000000 q:18.40 tex:38044 mv:2814 misc:1486 imb:34 pmb:590 smb:726 d:- ref:0 ; in:6799 out:6799 type:P dur:82000000 cpbdur:82000000 q:19.53 tex:60167 mv:2261 misc:1044 imb:14 pmb:411 smb:925 d:- ref:0 ; in:6800 out:6800 type:P dur:82000000 cpbdur:82000000 q:18.31 tex:52663 mv:2839 misc:1458 imb:30 pmb:623 smb:697 d:- ref:0 ; in:6801 out:6801 type:P dur:82000000 cpbdur:82000000 q:18.17 tex:27960 mv:2348 misc:1444 imb:29 pmb:534 smb:787 d:- ref:0 ; in:6802 out:6802 type:P dur:82000000 cpbdur:82000000 q:18.38 tex:30187 mv:3434 misc:1587 imb:42 pmb:782 smb:526 d:- ref:0 ; in:6803 out:6803 type:P dur:82000000 cpbdur:82000000 q:16.62 tex:37750 mv:3029 misc:1589 imb:8 pmb:889 smb:453 d:- ref:0 ; in:6804 out:6804 type:P dur:82000000 cpbdur:82000000 q:20.62 tex:317737 mv:15443 misc:1420 imb:1243 pmb:107 smb:0 d:- ref:0 ; in:6805 out:6805 type:P dur:82000000 cpbdur:82000000 q:24.54 tex:17113 mv:2617 misc:1222 imb:5 pmb:435 smb:910 d:- ref:0 ; in:6806 out:6806 type:P dur:82000000 cpbdur:82000000 q:23.92 tex:59646 mv:5875 misc:1375 imb:59 pmb:655 smb:636 d:- ref:0 ; in:6807 out:6807 type:P dur:82000000 cpbdur:82000000 q:24.42 tex:96047 mv:7052 misc:1277 imb:125 pmb:570 smb:655 d:- ref:0 ; in:6808 out:6808 type:P dur:82000000 cpbdur:82000000 q:22.48 tex:51274 mv:3032 misc:1478 imb:63 pmb:712 smb:575 d:- ref:0 ; in:6809 out:6809 type:P dur:82000000 cpbdur:82000000 q:21.90 tex:64988 mv:3490 misc:1418 imb:32 pmb:654 smb:664 d:- ref:0 ; in:6810 out:6810 type:P dur:82000000 cpbdur:82000000 q:23.35 tex:92507 mv:5950 misc:1167 imb:119 pmb:444 smb:787 d:- ref:0 ; in:6811 out:6811 type:P dur:82000000 cpbdur:82000000 q:21.75 tex:36783 mv:2294 misc:1379 imb:35 pmb:582 smb:733 d:- ref:0 ; in:6812 out:6812 type:P dur:82000000 cpbdur:82000000 q:21.70 tex:69812 mv:4210 misc:1394 imb:35 pmb:648 smb:667 d:- ref:0 ; in:6813 out:6813 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:100528 mv:7090 misc:1302 imb:100 pmb:602 smb:648 d:- ref:0 ; in:6814 out:6814 type:P dur:82000000 cpbdur:82000000 q:22.54 tex:47138 mv:3607 misc:1311 imb:30 pmb:597 smb:723 d:- ref:0 ; in:6815 out:6815 type:P dur:82000000 cpbdur:82000000 q:20.72 tex:50352 mv:3200 misc:1472 imb:83 pmb:740 smb:527 d:- ref:0 ; in:6816 out:6816 type:P dur:82000000 cpbdur:82000000 q:23.24 tex:99349 mv:6785 misc:1338 imb:145 pmb:593 smb:612 d:- ref:0 ; in:6817 out:6817 type:P dur:82000000 cpbdur:82000000 q:21.45 tex:62604 mv:3645 misc:1479 imb:121 pmb:761 smb:468 d:- ref:0 ; in:6818 out:6818 type:P dur:82000000 cpbdur:82000000 q:21.64 tex:66977 mv:4333 misc:1386 imb:45 pmb:677 smb:628 d:- ref:0 ; in:6819 out:6819 type:P dur:82000000 cpbdur:82000000 q:21.56 tex:65135 mv:3941 misc:1364 imb:55 pmb:597 smb:698 d:- ref:0 ; in:6820 out:6820 type:P dur:82000000 cpbdur:82000000 q:21.45 tex:69900 mv:4064 misc:1428 imb:63 pmb:706 smb:581 d:- ref:0 ; in:6821 out:6821 type:P dur:82000000 cpbdur:82000000 q:21.07 tex:62351 mv:2768 misc:1377 imb:26 pmb:590 smb:734 d:- ref:0 ; in:6822 out:6822 type:P dur:82000000 cpbdur:82000000 q:21.72 tex:69520 mv:4808 misc:1336 imb:42 pmb:646 smb:662 d:- ref:0 ; in:6823 out:6823 type:P dur:82000000 cpbdur:82000000 q:21.62 tex:63829 mv:4053 misc:1294 imb:24 pmb:619 smb:707 d:- ref:0 ; in:6824 out:6824 type:P dur:82000000 cpbdur:82000000 q:20.58 tex:42733 mv:2338 misc:1393 imb:28 pmb:598 smb:724 d:- ref:0 ; in:6825 out:6825 type:P dur:82000000 cpbdur:82000000 q:21.50 tex:83376 mv:5042 misc:1414 imb:63 pmb:722 smb:565 d:- ref:0 ; in:6826 out:6826 type:P dur:82000000 cpbdur:82000000 q:21.20 tex:63909 mv:3639 misc:1364 imb:37 pmb:651 smb:662 d:- ref:0 ; in:6827 out:6827 type:P dur:82000000 cpbdur:82000000 q:21.56 tex:67080 mv:4182 misc:1322 imb:15 pmb:658 smb:677 d:- ref:0 ; in:6828 out:6828 type:P dur:82000000 cpbdur:82000000 q:21.76 tex:56687 mv:4037 misc:1292 imb:32 pmb:599 smb:719 d:- ref:0 ; in:6829 out:6829 type:P dur:82000000 cpbdur:82000000 q:21.78 tex:59820 mv:4149 misc:1335 imb:49 pmb:619 smb:682 d:- ref:0 ; in:6830 out:6830 type:P dur:82000000 cpbdur:82000000 q:21.11 tex:53338 mv:2982 misc:1432 imb:42 pmb:640 smb:668 d:- ref:0 ; in:6831 out:6831 type:P dur:82000000 cpbdur:82000000 q:19.82 tex:33483 mv:2143 misc:1334 imb:17 pmb:541 smb:792 d:- ref:0 ; in:6832 out:6832 type:P dur:82000000 cpbdur:82000000 q:19.81 tex:48957 mv:2528 misc:1347 imb:35 pmb:570 smb:745 d:- ref:0 ; in:6833 out:6833 type:P dur:82000000 cpbdur:82000000 q:20.93 tex:72724 mv:4018 misc:1362 imb:36 pmb:636 smb:678 d:- ref:0 ; in:6834 out:6834 type:P dur:82000000 cpbdur:82000000 q:21.24 tex:69269 mv:4371 misc:1288 imb:13 pmb:633 smb:704 d:- ref:0 ; in:6835 out:6835 type:P dur:82000000 cpbdur:82000000 q:20.68 tex:51703 mv:2694 misc:1187 imb:7 pmb:520 smb:823 d:- ref:0 ; in:6836 out:6836 type:P dur:82000000 cpbdur:82000000 q:20.17 tex:58188 mv:2310 misc:1350 imb:19 pmb:564 smb:767 d:- ref:0 ; in:6837 out:6837 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:59564 mv:2590 misc:1230 imb:21 pmb:512 smb:817 d:- ref:0 ; in:6838 out:6838 type:P dur:82000000 cpbdur:82000000 q:19.67 tex:39425 mv:1885 misc:1274 imb:22 pmb:471 smb:857 d:- ref:0 ; in:6839 out:6839 type:P dur:82000000 cpbdur:82000000 q:20.55 tex:58322 mv:2676 misc:1314 imb:23 pmb:562 smb:765 d:- ref:0 ; in:6840 out:6840 type:P dur:82000000 cpbdur:82000000 q:20.86 tex:61295 mv:3595 misc:1238 imb:21 pmb:585 smb:744 d:- ref:0 ; in:6841 out:6841 type:P dur:82000000 cpbdur:82000000 q:21.42 tex:71788 mv:3959 misc:1325 imb:31 pmb:629 smb:690 d:- ref:0 ; in:6842 out:6842 type:P dur:82000000 cpbdur:82000000 q:21.52 tex:57382 mv:3550 misc:1260 imb:16 pmb:570 smb:764 d:- ref:0 ; in:6843 out:6843 type:P dur:82000000 cpbdur:82000000 q:21.06 tex:50658 mv:3021 misc:1369 imb:30 pmb:615 smb:705 d:- ref:0 ; in:6844 out:6844 type:P dur:82000000 cpbdur:82000000 q:20.98 tex:59299 mv:3006 misc:1287 imb:22 pmb:546 smb:782 d:- ref:0 ; in:6845 out:6845 type:P dur:82000000 cpbdur:82000000 q:20.98 tex:57933 mv:3267 misc:1352 imb:12 pmb:625 smb:713 d:- ref:0 ; in:6846 out:6846 type:P dur:82000000 cpbdur:82000000 q:19.79 tex:31583 mv:2312 misc:1353 imb:32 pmb:566 smb:752 d:- ref:0 ; in:6847 out:6847 type:P dur:82000000 cpbdur:82000000 q:17.86 tex:78372 mv:3210 misc:1458 imb:40 pmb:904 smb:406 d:- ref:0 ; in:6848 out:6848 type:P dur:82000000 cpbdur:82000000 q:17.63 tex:28051 mv:2037 misc:1416 imb:20 pmb:541 smb:789 d:- ref:0 ; in:6849 out:6849 type:P dur:82000000 cpbdur:82000000 q:17.72 tex:29105 mv:1852 misc:1291 imb:18 pmb:426 smb:906 d:- ref:0 ; in:6850 out:6850 type:P dur:82000000 cpbdur:82000000 q:19.17 tex:62105 mv:2626 misc:1397 imb:26 pmb:614 smb:710 d:- ref:0 ; in:6851 out:6851 type:P dur:82000000 cpbdur:82000000 q:19.39 tex:47983 mv:2249 misc:1320 imb:17 pmb:543 smb:790 d:- ref:0 ; in:6852 out:6852 type:P dur:82000000 cpbdur:82000000 q:20.50 tex:51605 mv:2816 misc:1291 imb:25 pmb:540 smb:785 d:- ref:0 ; in:6853 out:6853 type:P dur:82000000 cpbdur:82000000 q:21.07 tex:65164 mv:3958 misc:1382 imb:26 pmb:668 smb:656 d:- ref:0 ; in:6854 out:6854 type:P dur:82000000 cpbdur:82000000 q:20.12 tex:45713 mv:2222 misc:1313 imb:11 pmb:542 smb:797 d:- ref:0 ; in:6855 out:6855 type:P dur:82000000 cpbdur:82000000 q:20.74 tex:59460 mv:2724 misc:1280 imb:22 pmb:512 smb:816 d:- ref:0 ; in:6856 out:6856 type:P dur:82000000 cpbdur:82000000 q:20.77 tex:48792 mv:2372 misc:1220 imb:19 pmb:482 smb:849 d:- ref:0 ; in:6857 out:6857 type:P dur:82000000 cpbdur:82000000 q:19.29 tex:54705 mv:2973 misc:1482 imb:38 pmb:773 smb:539 d:- ref:0 ; in:6858 out:6858 type:P dur:82000000 cpbdur:82000000 q:20.98 tex:71526 mv:3987 misc:1359 imb:33 pmb:631 smb:686 d:- ref:0 ; in:6859 out:6859 type:P dur:82000000 cpbdur:82000000 q:20.60 tex:44799 mv:2264 misc:1281 imb:22 pmb:508 smb:820 d:- ref:0 ; in:6860 out:6860 type:P dur:82000000 cpbdur:82000000 q:19.31 tex:65473 mv:3253 misc:1498 imb:59 pmb:805 smb:486 d:- ref:0 ; in:6861 out:6861 type:P dur:82000000 cpbdur:82000000 q:20.87 tex:76148 mv:4225 misc:1299 imb:16 pmb:635 smb:699 d:- ref:0 ; in:6862 out:6862 type:P dur:82000000 cpbdur:82000000 q:20.76 tex:42190 mv:3587 misc:1367 imb:25 pmb:633 smb:692 d:- ref:0 ; in:6863 out:6863 type:P dur:82000000 cpbdur:82000000 q:19.46 tex:62352 mv:2870 misc:1466 imb:40 pmb:754 smb:556 d:- ref:0 ; in:6864 out:6864 type:P dur:82000000 cpbdur:82000000 q:20.98 tex:67009 mv:4607 misc:1328 imb:43 pmb:669 smb:638 d:- ref:0 ; in:6865 out:6865 type:P dur:82000000 cpbdur:82000000 q:20.68 tex:47908 mv:2617 misc:1275 imb:19 pmb:527 smb:804 d:- ref:0 ; in:6866 out:6866 type:P dur:82000000 cpbdur:82000000 q:21.12 tex:73855 mv:4313 misc:1328 imb:57 pmb:619 smb:674 d:- ref:0 ; in:6867 out:6867 type:P dur:82000000 cpbdur:82000000 q:21.08 tex:58348 mv:4303 misc:1357 imb:23 pmb:657 smb:670 d:- ref:0 ; in:6868 out:6868 type:P dur:82000000 cpbdur:82000000 q:20.64 tex:47527 mv:2426 misc:1335 imb:30 pmb:548 smb:772 d:- ref:0 ; in:6869 out:6869 type:P dur:82000000 cpbdur:82000000 q:21.04 tex:72565 mv:4210 misc:1345 imb:59 pmb:614 smb:677 d:- ref:0 ; in:6870 out:6870 type:P dur:82000000 cpbdur:82000000 q:21.74 tex:67900 mv:4627 misc:1329 imb:32 pmb:619 smb:699 d:- ref:0 ; in:6871 out:6871 type:P dur:82000000 cpbdur:82000000 q:21.72 tex:59646 mv:4720 misc:1394 imb:45 pmb:676 smb:629 d:- ref:0 ; in:6872 out:6872 type:P dur:82000000 cpbdur:82000000 q:25.72 tex:194821 mv:14608 misc:1419 imb:1232 pmb:118 smb:0 d:- ref:0 ; in:6873 out:6873 type:P dur:82000000 cpbdur:82000000 q:24.30 tex:44310 mv:2886 misc:1252 imb:25 pmb:524 smb:801 d:- ref:0 ; in:6874 out:6874 type:P dur:82000000 cpbdur:82000000 q:24.78 tex:103118 mv:12699 misc:1463 imb:521 pmb:603 smb:226 d:- ref:0 ; in:6875 out:6875 type:P dur:82000000 cpbdur:82000000 q:23.60 tex:53965 mv:5407 misc:1380 imb:147 pmb:603 smb:600 d:- ref:0 ; in:6876 out:6876 type:P dur:82000000 cpbdur:82000000 q:24.33 tex:112704 mv:10448 misc:1424 imb:270 pmb:624 smb:456 d:- ref:0 ; in:6877 out:6877 type:P dur:82000000 cpbdur:82000000 q:22.45 tex:69635 mv:4237 misc:1520 imb:162 pmb:723 smb:465 d:- ref:0 ; in:6878 out:6878 type:P dur:82000000 cpbdur:82000000 q:21.49 tex:69274 mv:4024 misc:1518 imb:112 pmb:712 smb:526 d:- ref:0 ; in:6879 out:6879 type:P dur:82000000 cpbdur:82000000 q:19.52 tex:39045 mv:2155 misc:1336 imb:37 pmb:559 smb:754 d:- ref:0 ; in:6880 out:6880 type:P dur:82000000 cpbdur:82000000 q:19.86 tex:71500 mv:3004 misc:1328 imb:43 pmb:586 smb:721 d:- ref:0 ; in:6881 out:6881 type:P dur:82000000 cpbdur:82000000 q:21.14 tex:72204 mv:5788 misc:1480 imb:213 pmb:618 smb:519 d:- ref:0 ; in:6882 out:6882 type:P dur:82000000 cpbdur:82000000 q:19.85 tex:42975 mv:2634 misc:1407 imb:61 pmb:554 smb:735 d:- ref:0 ; in:6883 out:6883 type:P dur:82000000 cpbdur:82000000 q:19.37 tex:68828 mv:4710 misc:1542 imb:148 pmb:846 smb:356 d:- ref:0 ; in:6884 out:6884 type:P dur:82000000 cpbdur:82000000 q:20.20 tex:58977 mv:4357 misc:1418 imb:103 pmb:563 smb:684 d:- ref:0 ; in:6885 out:6885 type:P dur:82000000 cpbdur:82000000 q:19.88 tex:40973 mv:2900 misc:1479 imb:78 pmb:592 smb:680 d:- ref:0 ; in:6886 out:6886 type:P dur:82000000 cpbdur:82000000 q:18.70 tex:45735 mv:3274 misc:1543 imb:60 pmb:768 smb:522 d:- ref:0 ; in:6887 out:6887 type:P dur:82000000 cpbdur:82000000 q:21.13 tex:66112 mv:5538 misc:1430 imb:155 pmb:598 smb:597 d:- ref:0 ; in:6888 out:6888 type:P dur:82000000 cpbdur:82000000 q:19.89 tex:32437 mv:2080 misc:1291 imb:29 pmb:460 smb:861 d:- ref:0 ; in:6889 out:6889 type:P dur:82000000 cpbdur:82000000 q:18.76 tex:42669 mv:3141 misc:1526 imb:61 pmb:729 smb:560 d:- ref:0 ; in:6890 out:6890 type:P dur:82000000 cpbdur:82000000 q:20.68 tex:58985 mv:4586 misc:1429 imb:120 pmb:540 smb:690 d:- ref:0 ; in:6891 out:6891 type:P dur:82000000 cpbdur:82000000 q:19.78 tex:48108 mv:2693 misc:1367 imb:42 pmb:563 smb:745 d:- ref:0 ; in:6892 out:6892 type:P dur:82000000 cpbdur:82000000 q:19.38 tex:58967 mv:3753 misc:1512 imb:70 pmb:783 smb:497 d:- ref:0 ; in:6893 out:6893 type:P dur:82000000 cpbdur:82000000 q:20.63 tex:54840 mv:4678 misc:1418 imb:102 pmb:588 smb:660 d:- ref:0 ; in:6894 out:6894 type:P dur:82000000 cpbdur:82000000 q:19.22 tex:58450 mv:4005 misc:1553 imb:86 pmb:789 smb:475 d:- ref:0 ; in:6895 out:6895 type:P dur:82000000 cpbdur:82000000 q:18.19 tex:35515 mv:2849 misc:1524 imb:45 pmb:683 smb:622 d:- ref:0 ; in:6896 out:6896 type:P dur:82000000 cpbdur:82000000 q:21.07 tex:69808 mv:5961 misc:1431 imb:192 pmb:619 smb:539 d:- ref:0 ; in:6897 out:6897 type:P dur:82000000 cpbdur:82000000 q:19.97 tex:37644 mv:2322 misc:1330 imb:47 pmb:484 smb:819 d:- ref:0 ; in:6898 out:6898 type:P dur:82000000 cpbdur:82000000 q:18.53 tex:33478 mv:3143 misc:1515 imb:61 pmb:689 smb:600 d:- ref:0 ; in:6899 out:6899 type:P dur:82000000 cpbdur:82000000 q:20.75 tex:54966 mv:4782 misc:1412 imb:156 pmb:518 smb:676 d:- ref:0 ; in:6900 out:6900 type:P dur:82000000 cpbdur:82000000 q:19.62 tex:34943 mv:2203 misc:1366 imb:39 pmb:499 smb:812 d:- ref:0 ; in:6901 out:6901 type:P dur:82000000 cpbdur:82000000 q:19.95 tex:52588 mv:3182 misc:1366 imb:61 pmb:538 smb:751 d:- ref:0 ; in:6902 out:6902 type:P dur:82000000 cpbdur:82000000 q:20.76 tex:59663 mv:4900 misc:1445 imb:133 pmb:586 smb:631 d:- ref:0 ; in:6903 out:6903 type:P dur:82000000 cpbdur:82000000 q:18.93 tex:47421 mv:3342 misc:1541 imb:86 pmb:724 smb:540 d:- ref:0 ; in:6904 out:6904 type:P dur:82000000 cpbdur:82000000 q:19.42 tex:63103 mv:3496 misc:1441 imb:44 pmb:644 smb:662 d:- ref:0 ; in:6905 out:6905 type:P dur:82000000 cpbdur:82000000 q:20.34 tex:59467 mv:4531 misc:1434 imb:95 pmb:577 smb:678 d:- ref:0 ; in:6906 out:6906 type:P dur:82000000 cpbdur:82000000 q:20.08 tex:58510 mv:2943 misc:1387 imb:47 pmb:561 smb:742 d:- ref:0 ; in:6907 out:6907 type:P dur:82000000 cpbdur:82000000 q:19.44 tex:69023 mv:3476 misc:1509 imb:67 pmb:738 smb:545 d:- ref:0 ; in:6908 out:6908 type:P dur:82000000 cpbdur:82000000 q:21.60 tex:68055 mv:6652 misc:1413 imb:130 pmb:640 smb:580 d:- ref:0 ; in:6909 out:6909 type:P dur:82000000 cpbdur:82000000 q:21.83 tex:63875 mv:5593 misc:1380 imb:68 pmb:637 smb:645 d:- ref:0 ; in:6910 out:6910 type:P dur:82000000 cpbdur:82000000 q:25.83 tex:474095 mv:18571 misc:1414 imb:1107 pmb:243 smb:0 d:- ref:0 ; in:6911 out:6911 type:P dur:82000000 cpbdur:82000000 q:29.32 tex:177024 mv:14777 misc:1471 imb:345 pmb:805 smb:200 d:- ref:0 ; in:6912 out:6912 type:P dur:82000000 cpbdur:82000000 q:28.70 tex:139758 mv:14128 misc:1474 imb:179 pmb:982 smb:189 d:- ref:0 ; in:6913 out:6913 type:P dur:82000000 cpbdur:82000000 q:28.32 tex:171680 mv:13744 misc:1480 imb:198 pmb:1006 smb:146 d:- ref:0 ; in:6914 out:6914 type:P dur:82000000 cpbdur:82000000 q:28.11 tex:174792 mv:13664 misc:1456 imb:214 pmb:904 smb:232 d:- ref:0 ; in:6915 out:6915 type:P dur:82000000 cpbdur:82000000 q:27.83 tex:150078 mv:12223 misc:1419 imb:122 pmb:847 smb:381 d:- ref:0 ; in:6916 out:6916 type:P dur:82000000 cpbdur:82000000 q:27.58 tex:140569 mv:11769 misc:1478 imb:87 pmb:957 smb:306 d:- ref:0 ; in:6917 out:6917 type:P dur:82000000 cpbdur:82000000 q:27.39 tex:171696 mv:12855 misc:1489 imb:95 pmb:1089 smb:166 d:- ref:0 ; in:6918 out:6918 type:P dur:82000000 cpbdur:82000000 q:26.61 tex:97023 mv:6461 misc:1420 imb:24 pmb:703 smb:623 d:- ref:0 ; in:6919 out:6919 type:P dur:82000000 cpbdur:82000000 q:26.27 tex:143148 mv:8329 misc:1515 imb:38 pmb:1055 smb:257 d:- ref:0 ; in:6920 out:6920 type:P dur:82000000 cpbdur:82000000 q:25.95 tex:105468 mv:6710 misc:1366 imb:17 pmb:680 smb:653 d:- ref:0 ; in:6921 out:6921 type:P dur:82000000 cpbdur:82000000 q:25.87 tex:114386 mv:7020 misc:1386 imb:26 pmb:756 smb:568 d:- ref:0 ; in:6922 out:6922 type:P dur:82000000 cpbdur:82000000 q:25.84 tex:103961 mv:6347 misc:1324 imb:24 pmb:621 smb:705 d:- ref:0 ; in:6923 out:6923 type:P dur:82000000 cpbdur:82000000 q:25.80 tex:107297 mv:6858 misc:1493 imb:22 pmb:770 smb:558 d:- ref:0 ; in:6924 out:6924 type:P dur:82000000 cpbdur:82000000 q:25.76 tex:107443 mv:6791 misc:1342 imb:19 pmb:687 smb:644 d:- ref:0 ; in:6925 out:6925 type:P dur:82000000 cpbdur:82000000 q:26.03 tex:130507 mv:8335 misc:1470 imb:27 pmb:907 smb:416 d:- ref:0 ; in:6926 out:6926 type:P dur:82000000 cpbdur:82000000 q:26.28 tex:134262 mv:8729 misc:1465 imb:41 pmb:915 smb:394 d:- ref:0 ; in:6927 out:6927 type:P dur:82000000 cpbdur:82000000 q:26.37 tex:132054 mv:8098 misc:1480 imb:39 pmb:882 smb:429 d:- ref:0 ; in:6928 out:6928 type:P dur:82000000 cpbdur:82000000 q:25.90 tex:95778 mv:6163 misc:1163 imb:15 pmb:531 smb:804 d:- ref:0 ; in:6929 out:6929 type:P dur:82000000 cpbdur:82000000 q:26.01 tex:119456 mv:7609 misc:1439 imb:40 pmb:863 smb:447 d:- ref:0 ; in:6930 out:6930 type:P dur:82000000 cpbdur:82000000 q:26.07 tex:135176 mv:8895 misc:1489 imb:38 pmb:1009 smb:303 d:- ref:0 ; in:6931 out:6931 type:P dur:82000000 cpbdur:82000000 q:25.79 tex:103310 mv:6962 misc:1400 imb:21 pmb:734 smb:595 d:- ref:0 ; in:6932 out:6932 type:P dur:82000000 cpbdur:82000000 q:25.78 tex:108368 mv:6742 misc:1338 imb:20 pmb:660 smb:670 d:- ref:0 ; in:6933 out:6933 type:P dur:82000000 cpbdur:82000000 q:26.15 tex:143922 mv:9855 misc:1487 imb:43 pmb:1053 smb:254 d:- ref:0 ; in:6934 out:6934 type:P dur:82000000 cpbdur:82000000 q:26.45 tex:151523 mv:10508 misc:1497 imb:46 pmb:1092 smb:212 d:- ref:0 ; in:6935 out:6935 type:P dur:82000000 cpbdur:82000000 q:28.96 tex:248616 mv:17726 misc:1442 imb:509 pmb:780 smb:61 d:- ref:0 ; in:6936 out:6936 type:P dur:82000000 cpbdur:82000000 q:29.02 tex:154227 mv:13065 misc:1492 imb:223 pmb:973 smb:154 d:- ref:0 ; in:6937 out:6937 type:P dur:82000000 cpbdur:82000000 q:28.73 tex:160960 mv:14378 misc:1478 imb:272 pmb:964 smb:114 d:- ref:0 ; in:6938 out:6938 type:P dur:82000000 cpbdur:82000000 q:28.54 tex:149141 mv:12811 misc:1496 imb:269 pmb:901 smb:180 d:- ref:0 ; in:6939 out:6939 type:P dur:82000000 cpbdur:82000000 q:28.37 tex:175361 mv:13143 misc:1440 imb:252 pmb:913 smb:185 d:- ref:0 ; in:6940 out:6940 type:P dur:82000000 cpbdur:82000000 q:28.59 tex:145415 mv:12417 misc:1432 imb:248 pmb:791 smb:311 d:- ref:0 ; in:6941 out:6941 type:P dur:82000000 cpbdur:82000000 q:28.92 tex:180577 mv:14733 misc:1482 imb:301 pmb:897 smb:152 d:- ref:0 ; in:6942 out:6942 type:P dur:82000000 cpbdur:82000000 q:29.00 tex:176377 mv:13241 misc:1478 imb:212 pmb:943 smb:195 d:- ref:0 ; in:6943 out:6943 type:P dur:82000000 cpbdur:82000000 q:28.91 tex:179339 mv:15187 misc:1458 imb:242 pmb:977 smb:131 d:- ref:0 ; in:6944 out:6944 type:P dur:82000000 cpbdur:82000000 q:28.22 tex:163588 mv:11434 misc:1458 imb:127 pmb:1050 smb:173 d:- ref:0 ; in:6945 out:6945 type:P dur:82000000 cpbdur:82000000 q:27.94 tex:163023 mv:13006 misc:1435 imb:98 pmb:1010 smb:242 d:- ref:0 ; in:6946 out:6946 type:P dur:82000000 cpbdur:82000000 q:27.21 tex:143669 mv:9329 misc:1458 imb:56 pmb:1047 smb:247 d:- ref:0 ; in:6947 out:6947 type:P dur:82000000 cpbdur:82000000 q:26.48 tex:135256 mv:7777 misc:1455 imb:25 pmb:1009 smb:316 d:- ref:0 ; in:6948 out:6948 type:P dur:82000000 cpbdur:82000000 q:26.79 tex:147421 mv:11238 misc:1357 imb:75 pmb:838 smb:437 d:- ref:0 ; in:6949 out:6949 type:P dur:82000000 cpbdur:82000000 q:26.17 tex:113558 mv:7208 misc:1450 imb:20 pmb:830 smb:500 d:- ref:0 ; in:6950 out:6950 type:P dur:82000000 cpbdur:82000000 q:25.83 tex:107139 mv:6880 misc:1349 imb:22 pmb:712 smb:616 d:- ref:0 ; in:6951 out:6951 type:P dur:82000000 cpbdur:82000000 q:25.82 tex:121121 mv:7697 misc:1438 imb:34 pmb:865 smb:451 d:- ref:0 ; in:6952 out:6952 type:P dur:82000000 cpbdur:82000000 q:25.83 tex:111117 mv:7370 misc:1353 imb:34 pmb:738 smb:578 d:- ref:0 ; in:6953 out:6953 type:P dur:82000000 cpbdur:82000000 q:25.69 tex:94787 mv:6226 misc:1323 imb:16 pmb:632 smb:702 d:- ref:0 ; in:6954 out:6954 type:P dur:82000000 cpbdur:82000000 q:25.69 tex:105841 mv:6498 misc:1309 imb:11 pmb:670 smb:669 d:- ref:0 ; in:6955 out:6955 type:P dur:82000000 cpbdur:82000000 q:25.72 tex:110068 mv:6907 misc:1449 imb:28 pmb:767 smb:555 d:- ref:0 ; in:6956 out:6956 type:P dur:82000000 cpbdur:82000000 q:26.01 tex:132818 mv:7637 misc:1417 imb:18 pmb:903 smb:429 d:- ref:0 ; in:6957 out:6957 type:P dur:82000000 cpbdur:82000000 q:25.77 tex:103549 mv:6487 misc:1284 imb:23 pmb:657 smb:670 d:- ref:0 ; in:6958 out:6958 type:P dur:82000000 cpbdur:82000000 q:25.73 tex:104266 mv:6523 misc:1267 imb:14 pmb:649 smb:687 d:- ref:0 ; in:6959 out:6959 type:P dur:82000000 cpbdur:82000000 q:25.61 tex:100663 mv:6259 misc:1318 imb:15 pmb:657 smb:678 d:- ref:0 ; in:6960 out:6960 type:P dur:82000000 cpbdur:82000000 q:25.95 tex:138078 mv:8682 misc:1432 imb:40 pmb:970 smb:340 d:- ref:0 ; in:6961 out:6961 type:P dur:82000000 cpbdur:82000000 q:26.23 tex:154272 mv:9553 misc:1423 imb:52 pmb:1019 smb:279 d:- ref:0 ; in:6962 out:6962 type:P dur:82000000 cpbdur:82000000 q:26.24 tex:139852 mv:9547 misc:1457 imb:51 pmb:1011 smb:288 d:- ref:0 ; in:6963 out:6963 type:P dur:82000000 cpbdur:82000000 q:26.40 tex:150858 mv:9869 misc:1441 imb:62 pmb:1025 smb:263 d:- ref:0 ; in:6964 out:6964 type:P dur:82000000 cpbdur:82000000 q:29.03 tex:263987 mv:17946 misc:1427 imb:696 pmb:624 smb:30 d:- ref:0 ; in:6965 out:6965 type:P dur:82000000 cpbdur:82000000 q:28.13 tex:142071 mv:12058 misc:1439 imb:91 pmb:978 smb:281 d:- ref:0 ; in:6966 out:6966 type:P dur:82000000 cpbdur:82000000 q:27.18 tex:115219 mv:8681 misc:1460 imb:41 pmb:939 smb:370 d:- ref:0 ; in:6967 out:6967 type:P dur:82000000 cpbdur:82000000 q:26.38 tex:117436 mv:7169 misc:1419 imb:25 pmb:853 smb:472 d:- ref:0 ; in:6968 out:6968 type:P dur:82000000 cpbdur:82000000 q:26.52 tex:130537 mv:11690 misc:1437 imb:80 pmb:906 smb:364 d:- ref:0 ; in:6969 out:6969 type:P dur:82000000 cpbdur:82000000 q:25.90 tex:107266 mv:7546 misc:1444 imb:28 pmb:828 smb:494 d:- ref:0 ; in:6970 out:6970 type:P dur:82000000 cpbdur:82000000 q:25.56 tex:98884 mv:6555 misc:1385 imb:21 pmb:707 smb:622 d:- ref:0 ; in:6971 out:6971 type:P dur:82000000 cpbdur:82000000 q:27.12 tex:187751 mv:13868 misc:1445 imb:249 pmb:866 smb:235 d:- ref:0 ; in:6972 out:6972 type:P dur:82000000 cpbdur:82000000 q:26.38 tex:112890 mv:7198 misc:1456 imb:17 pmb:850 smb:483 d:- ref:0 ; in:6973 out:6973 type:P dur:82000000 cpbdur:82000000 q:27.24 tex:178196 mv:12486 misc:1390 imb:278 pmb:746 smb:326 d:- ref:0 ; in:6974 out:6974 type:P dur:82000000 cpbdur:82000000 q:27.85 tex:176077 mv:14247 misc:1428 imb:329 pmb:743 smb:278 d:- ref:0 ; in:6975 out:6975 type:P dur:82000000 cpbdur:82000000 q:28.09 tex:176269 mv:14451 misc:1440 imb:295 pmb:775 smb:280 d:- ref:0 ; in:6976 out:6976 type:P dur:82000000 cpbdur:82000000 q:27.11 tex:119558 mv:8815 misc:1435 imb:60 pmb:917 smb:373 d:- ref:0 ; in:6977 out:6977 type:P dur:82000000 cpbdur:82000000 q:28.18 tex:212564 mv:15721 misc:1443 imb:467 pmb:713 smb:170 d:- ref:0 ; in:6978 out:6978 type:P dur:82000000 cpbdur:82000000 q:27.04 tex:97112 mv:6831 misc:1409 imb:27 pmb:735 smb:588 d:- ref:0 ; in:6979 out:6979 type:P dur:82000000 cpbdur:82000000 q:27.41 tex:177745 mv:13792 misc:1447 imb:173 pmb:882 smb:295 d:- ref:0 ; in:6980 out:6980 type:P dur:82000000 cpbdur:82000000 q:26.69 tex:103164 mv:7475 misc:1425 imb:21 pmb:773 smb:556 d:- ref:0 ; in:6981 out:6981 type:P dur:82000000 cpbdur:82000000 q:26.87 tex:152180 mv:12951 misc:1461 imb:129 pmb:923 smb:298 d:- ref:0 ; in:6982 out:6982 type:P dur:82000000 cpbdur:82000000 q:26.21 tex:115723 mv:7201 misc:1460 imb:24 pmb:859 smb:467 d:- ref:0 ; in:6983 out:6983 type:P dur:82000000 cpbdur:82000000 q:25.93 tex:115387 mv:7373 misc:1384 imb:30 pmb:787 smb:533 d:- ref:0 ; in:6984 out:6984 type:P dur:82000000 cpbdur:82000000 q:26.32 tex:155219 mv:11550 misc:1447 imb:69 pmb:926 smb:355 d:- ref:0 ; in:6985 out:6985 type:P dur:82000000 cpbdur:82000000 q:26.16 tex:134707 mv:8673 misc:1420 imb:36 pmb:927 smb:387 d:- ref:0 ; in:6986 out:6986 type:P dur:82000000 cpbdur:82000000 q:26.03 tex:119453 mv:7413 misc:1358 imb:30 pmb:761 smb:559 d:- ref:0 ; in:6987 out:6987 type:P dur:82000000 cpbdur:82000000 q:26.43 tex:160092 mv:12374 misc:1430 imb:99 pmb:986 smb:265 d:- ref:0 ; in:6988 out:6988 type:P dur:82000000 cpbdur:82000000 q:29.16 tex:265024 mv:18226 misc:1422 imb:709 pmb:596 smb:45 d:- ref:0 ; in:6989 out:6989 type:P dur:82000000 cpbdur:82000000 q:27.95 tex:112910 mv:8806 misc:1388 imb:36 pmb:886 smb:428 d:- ref:0 ; in:6990 out:6990 type:P dur:82000000 cpbdur:82000000 q:27.32 tex:139130 mv:10181 misc:1417 imb:116 pmb:971 smb:263 d:- ref:0 ; in:6991 out:6991 type:P dur:82000000 cpbdur:82000000 q:27.19 tex:152844 mv:12822 misc:1422 imb:122 pmb:956 smb:272 d:- ref:0 ; in:6992 out:6992 type:P dur:82000000 cpbdur:82000000 q:26.52 tex:103141 mv:6836 misc:1311 imb:31 pmb:686 smb:633 d:- ref:0 ; in:6993 out:6993 type:P dur:82000000 cpbdur:82000000 q:25.91 tex:103434 mv:6796 misc:1394 imb:27 pmb:768 smb:555 d:- ref:0 ; in:6994 out:6994 type:P dur:82000000 cpbdur:82000000 q:27.19 tex:180664 mv:13809 misc:1463 imb:290 pmb:821 smb:239 d:- ref:0 ; in:6995 out:6995 type:P dur:82000000 cpbdur:82000000 q:27.83 tex:163415 mv:13829 misc:1468 imb:259 pmb:849 smb:242 d:- ref:0 ; in:6996 out:6996 type:P dur:82000000 cpbdur:82000000 q:28.24 tex:180128 mv:14751 misc:1449 imb:409 pmb:791 smb:150 d:- ref:0 ; in:6997 out:6997 type:P dur:82000000 cpbdur:82000000 q:27.13 tex:100679 mv:6840 misc:1369 imb:23 pmb:746 smb:581 d:- ref:0 ; in:6998 out:6998 type:P dur:82000000 cpbdur:82000000 q:27.98 tex:182850 mv:13858 misc:1428 imb:440 pmb:680 smb:230 d:- ref:0 ; in:6999 out:6999 type:P dur:82000000 cpbdur:82000000 q:28.06 tex:154390 mv:14052 misc:1438 imb:385 pmb:690 smb:275 d:- ref:0 ; in:7000 out:7000 type:I dur:82000000 cpbdur:82000000 q:24.13 tex:465706 mv:13894 misc:368 imb:1350 pmb:0 smb:0 d:- ref:; in:7001 out:7001 type:P dur:82000000 cpbdur:82000000 q:29.50 tex:114783 mv:12565 misc:1436 imb:209 pmb:777 smb:364 d:- ref:0 ; in:7002 out:7002 type:P dur:82000000 cpbdur:82000000 q:28.15 tex:95568 mv:7726 misc:1402 imb:42 pmb:810 smb:498 d:- ref:0 ; in:7003 out:7003 type:P dur:82000000 cpbdur:82000000 q:27.01 tex:97512 mv:6950 misc:1418 imb:36 pmb:794 smb:520 d:- ref:0 ; in:7004 out:7004 type:P dur:82000000 cpbdur:82000000 q:26.92 tex:138173 mv:12501 misc:1446 imb:203 pmb:835 smb:312 d:- ref:0 ; in:7005 out:7005 type:P dur:82000000 cpbdur:82000000 q:26.19 tex:104989 mv:6826 misc:1433 imb:29 pmb:770 smb:551 d:- ref:0 ; in:7006 out:7006 type:P dur:82000000 cpbdur:82000000 q:26.10 tex:121822 mv:8033 misc:1409 imb:31 pmb:809 smb:510 d:- ref:0 ; in:7007 out:7007 type:P dur:82000000 cpbdur:82000000 q:26.31 tex:147952 mv:12870 misc:1450 imb:189 pmb:960 smb:201 d:- ref:0 ; in:7008 out:7008 type:P dur:82000000 cpbdur:82000000 q:26.15 tex:118703 mv:8730 misc:1463 imb:44 pmb:900 smb:406 d:- ref:0 ; in:7009 out:7009 type:P dur:82000000 cpbdur:82000000 q:29.51 tex:317404 mv:19340 misc:1424 imb:832 pmb:516 smb:2 d:- ref:0 ; in:7010 out:7010 type:P dur:82000000 cpbdur:82000000 q:29.02 tex:193801 mv:16577 misc:1438 imb:284 pmb:951 smb:115 d:- ref:0 ; in:7011 out:7011 type:P dur:82000000 cpbdur:82000000 q:27.85 tex:126333 mv:9092 misc:1487 imb:46 pmb:1006 smb:298 d:- ref:0 ; in:7012 out:7012 type:P dur:82000000 cpbdur:82000000 q:28.00 tex:200206 mv:15681 misc:1465 imb:305 pmb:915 smb:130 d:- ref:0 ; in:7013 out:7013 type:P dur:82000000 cpbdur:82000000 q:27.07 tex:119620 mv:7852 misc:1488 imb:30 pmb:922 smb:398 d:- ref:0 ; in:7014 out:7014 type:P dur:82000000 cpbdur:82000000 q:28.09 tex:231665 mv:16379 misc:1460 imb:414 pmb:833 smb:103 d:- ref:0 ; in:7015 out:7015 type:P dur:82000000 cpbdur:82000000 q:27.18 tex:132653 mv:8324 misc:1479 imb:43 pmb:962 smb:345 d:- ref:0 ; in:7016 out:7016 type:P dur:82000000 cpbdur:82000000 q:28.00 tex:214435 mv:15818 misc:1451 imb:411 pmb:828 smb:111 d:- ref:0 ; in:7017 out:7017 type:P dur:82000000 cpbdur:82000000 q:27.07 tex:118859 mv:7843 misc:1482 imb:33 pmb:913 smb:404 d:- ref:0 ; in:7018 out:7018 type:P dur:82000000 cpbdur:82000000 q:28.34 tex:239611 mv:15572 misc:1465 imb:375 pmb:852 smb:123 d:- ref:0 ; in:7019 out:7019 type:P dur:82000000 cpbdur:82000000 q:27.24 tex:114392 mv:7549 misc:1507 imb:16 pmb:937 smb:397 d:- ref:0 ; in:7020 out:7020 type:P dur:82000000 cpbdur:82000000 q:28.37 tex:251159 mv:15832 misc:1457 imb:373 pmb:868 smb:109 d:- ref:0 ; in:7021 out:7021 type:P dur:82000000 cpbdur:82000000 q:27.27 tex:125904 mv:7977 misc:1527 imb:43 pmb:963 smb:344 d:- ref:0 ; in:7022 out:7022 type:P dur:82000000 cpbdur:82000000 q:28.31 tex:236608 mv:15181 misc:1459 imb:367 pmb:831 smb:152 d:- ref:0 ; in:7023 out:7023 type:P dur:82000000 cpbdur:82000000 q:27.30 tex:128095 mv:8180 misc:1533 imb:24 pmb:990 smb:336 d:- ref:0 ; in:7024 out:7024 type:P dur:82000000 cpbdur:82000000 q:28.06 tex:194400 mv:12548 misc:1388 imb:249 pmb:718 smb:383 d:- ref:0 ; in:7025 out:7025 type:P dur:82000000 cpbdur:82000000 q:27.02 tex:109731 mv:7446 misc:1495 imb:22 pmb:876 smb:452 d:- ref:0 ; in:7026 out:7026 type:P dur:82000000 cpbdur:82000000 q:27.30 tex:165878 mv:10254 misc:1308 imb:134 pmb:642 smb:574 d:- ref:0 ; in:7027 out:7027 type:P dur:82000000 cpbdur:82000000 q:26.63 tex:109570 mv:6986 misc:1388 imb:21 pmb:728 smb:601 d:- ref:0 ; in:7028 out:7028 type:P dur:82000000 cpbdur:82000000 q:26.79 tex:143248 mv:9018 misc:1326 imb:53 pmb:734 smb:563 d:- ref:0 ; in:7029 out:7029 type:P dur:82000000 cpbdur:82000000 q:26.08 tex:124957 mv:7703 misc:1556 imb:20 pmb:971 smb:359 d:- ref:0 ; in:7030 out:7030 type:P dur:82000000 cpbdur:82000000 q:26.25 tex:140560 mv:8681 misc:1351 imb:31 pmb:725 smb:594 d:- ref:0 ; in:7031 out:7031 type:P dur:82000000 cpbdur:82000000 q:25.80 tex:104774 mv:6626 misc:1416 imb:23 pmb:696 smb:631 d:- ref:0 ; in:7032 out:7032 type:P dur:82000000 cpbdur:82000000 q:26.19 tex:153549 mv:8821 misc:1446 imb:35 pmb:891 smb:424 d:- ref:0 ; in:7033 out:7033 type:P dur:82000000 cpbdur:82000000 q:26.05 tex:125177 mv:7453 misc:1402 imb:36 pmb:785 smb:529 d:- ref:0 ; in:7034 out:7034 type:P dur:82000000 cpbdur:82000000 q:26.23 tex:147419 mv:8969 misc:1460 imb:35 pmb:883 smb:432 d:- ref:0 ; in:7035 out:7035 type:P dur:82000000 cpbdur:82000000 q:25.68 tex:98728 mv:6297 misc:1247 imb:20 pmb:615 smb:715 d:- ref:0 ; in:7036 out:7036 type:P dur:82000000 cpbdur:82000000 q:25.96 tex:132246 mv:8118 misc:1380 imb:26 pmb:748 smb:576 d:- ref:0 ; in:7037 out:7037 type:P dur:82000000 cpbdur:82000000 q:25.76 tex:104182 mv:6697 misc:1393 imb:32 pmb:649 smb:669 d:- ref:0 ; in:7038 out:7038 type:P dur:82000000 cpbdur:82000000 q:26.20 tex:150840 mv:8559 misc:1337 imb:26 pmb:777 smb:547 d:- ref:0 ; in:7039 out:7039 type:P dur:82000000 cpbdur:82000000 q:25.99 tex:118095 mv:7296 misc:1369 imb:22 pmb:742 smb:586 d:- ref:0 ; in:7040 out:7040 type:P dur:82000000 cpbdur:82000000 q:26.23 tex:139075 mv:8407 misc:1254 imb:29 pmb:681 smb:640 d:- ref:0 ; in:7041 out:7041 type:P dur:82000000 cpbdur:82000000 q:25.91 tex:117071 mv:7078 misc:1403 imb:21 pmb:794 smb:535 d:- ref:0 ; in:7042 out:7042 type:P dur:82000000 cpbdur:82000000 q:26.19 tex:139616 mv:8507 misc:1373 imb:31 pmb:777 smb:542 d:- ref:0 ; in:7043 out:7043 type:P dur:82000000 cpbdur:82000000 q:26.17 tex:141246 mv:8162 misc:1472 imb:27 pmb:914 smb:409 d:- ref:0 ; in:7044 out:7044 type:P dur:82000000 cpbdur:82000000 q:26.56 tex:149288 mv:8882 misc:1374 imb:99 pmb:776 smb:475 d:- ref:0 ; in:7045 out:7045 type:P dur:82000000 cpbdur:82000000 q:26.08 tex:119484 mv:7047 misc:1365 imb:28 pmb:741 smb:581 d:- ref:0 ; in:7046 out:7046 type:P dur:82000000 cpbdur:82000000 q:27.25 tex:206231 mv:12750 misc:1435 imb:478 pmb:642 smb:230 d:- ref:0 ; in:7047 out:7047 type:P dur:82000000 cpbdur:82000000 q:26.41 tex:116398 mv:7314 misc:1408 imb:39 pmb:788 smb:523 d:- ref:0 ; in:7048 out:7048 type:P dur:82000000 cpbdur:82000000 q:27.89 tex:216438 mv:14310 misc:1452 imb:405 pmb:742 smb:203 d:- ref:0 ; in:7049 out:7049 type:P dur:82000000 cpbdur:82000000 q:26.97 tex:116923 mv:7533 misc:1440 imb:36 pmb:827 smb:487 d:- ref:0 ; in:7050 out:7050 type:P dur:82000000 cpbdur:82000000 q:28.28 tex:243913 mv:15523 misc:1444 imb:490 pmb:775 smb:85 d:- ref:0 ; in:7051 out:7051 type:P dur:82000000 cpbdur:82000000 q:27.36 tex:129367 mv:8131 misc:1454 imb:35 pmb:911 smb:404 d:- ref:0 ; in:7052 out:7052 type:P dur:82000000 cpbdur:82000000 q:28.32 tex:233343 mv:16040 misc:1449 imb:594 pmb:702 smb:54 d:- ref:0 ; in:7053 out:7053 type:P dur:82000000 cpbdur:82000000 q:27.19 tex:107505 mv:6986 misc:1381 imb:32 pmb:744 smb:574 d:- ref:0 ; in:7054 out:7054 type:P dur:82000000 cpbdur:82000000 q:27.89 tex:197161 mv:15019 misc:1452 imb:441 pmb:751 smb:158 d:- ref:0 ; in:7055 out:7055 type:P dur:82000000 cpbdur:82000000 q:27.00 tex:124815 mv:8279 misc:1442 imb:53 pmb:867 smb:430 d:- ref:0 ; in:7056 out:7056 type:P dur:82000000 cpbdur:82000000 q:27.38 tex:188759 mv:12800 misc:1417 imb:282 pmb:750 smb:318 d:- ref:0 ; in:7057 out:7057 type:P dur:82000000 cpbdur:82000000 q:26.51 tex:98825 mv:6432 misc:1287 imb:39 pmb:620 smb:691 d:- ref:0 ; in:7058 out:7058 type:P dur:82000000 cpbdur:82000000 q:27.22 tex:186888 mv:12729 misc:1415 imb:185 pmb:807 smb:358 d:- ref:0 ; in:7059 out:7059 type:P dur:82000000 cpbdur:82000000 q:26.41 tex:115618 mv:6877 misc:1417 imb:35 pmb:775 smb:540 d:- ref:0 ; in:7060 out:7060 type:P dur:82000000 cpbdur:82000000 q:27.31 tex:190620 mv:12550 misc:1414 imb:197 pmb:790 smb:363 d:- ref:0 ; in:7061 out:7061 type:P dur:82000000 cpbdur:82000000 q:26.70 tex:115068 mv:7486 misc:1374 imb:43 pmb:760 smb:547 d:- ref:0 ; in:7062 out:7062 type:P dur:82000000 cpbdur:82000000 q:27.85 tex:202972 mv:14320 misc:1444 imb:273 pmb:794 smb:283 d:- ref:0 ; in:7063 out:7063 type:P dur:82000000 cpbdur:82000000 q:27.05 tex:127395 mv:7576 misc:1453 imb:43 pmb:858 smb:449 d:- ref:0 ; in:7064 out:7064 type:P dur:82000000 cpbdur:82000000 q:28.43 tex:254957 mv:15119 misc:1428 imb:413 pmb:749 smb:188 d:- ref:0 ; in:7065 out:7065 type:P dur:82000000 cpbdur:82000000 q:27.22 tex:105461 mv:6715 misc:1432 imb:33 pmb:727 smb:590 d:- ref:0 ; in:7066 out:7066 type:P dur:82000000 cpbdur:82000000 q:28.53 tex:230230 mv:15147 misc:1455 imb:498 pmb:715 smb:137 d:- ref:0 ; in:7067 out:7067 type:P dur:82000000 cpbdur:82000000 q:27.32 tex:128075 mv:7484 misc:1497 imb:20 pmb:886 smb:444 d:- ref:0 ; in:7068 out:7068 type:P dur:82000000 cpbdur:82000000 q:28.88 tex:244538 mv:16145 misc:1437 imb:602 pmb:727 smb:21 d:- ref:0 ; in:7069 out:7069 type:P dur:82000000 cpbdur:82000000 q:27.47 tex:123328 mv:7340 misc:1508 imb:34 pmb:910 smb:406 d:- ref:0 ; in:7070 out:7070 type:P dur:82000000 cpbdur:82000000 q:28.04 tex:195695 mv:14023 misc:1426 imb:265 pmb:831 smb:254 d:- ref:0 ; in:7071 out:7071 type:P dur:82000000 cpbdur:82000000 q:26.95 tex:109191 mv:7233 misc:1480 imb:21 pmb:871 smb:458 d:- ref:0 ; in:7072 out:7072 type:P dur:82000000 cpbdur:82000000 q:27.39 tex:179770 mv:12387 misc:1403 imb:145 pmb:853 smb:352 d:- ref:0 ; in:7073 out:7073 type:P dur:82000000 cpbdur:82000000 q:26.54 tex:97814 mv:6823 misc:1435 imb:24 pmb:737 smb:589 d:- ref:0 ; in:7074 out:7074 type:P dur:82000000 cpbdur:82000000 q:26.95 tex:158150 mv:11562 misc:1432 imb:108 pmb:852 smb:390 d:- ref:0 ; in:7075 out:7075 type:P dur:82000000 cpbdur:82000000 q:26.38 tex:133874 mv:7695 misc:1495 imb:22 pmb:949 smb:379 d:- ref:0 ; in:7076 out:7076 type:P dur:82000000 cpbdur:82000000 q:26.98 tex:162752 mv:11263 misc:1321 imb:80 pmb:825 smb:445 d:- ref:0 ; in:7077 out:7077 type:P dur:82000000 cpbdur:82000000 q:26.28 tex:124268 mv:7317 misc:1447 imb:28 pmb:855 smb:467 d:- ref:0 ; in:7078 out:7078 type:P dur:82000000 cpbdur:82000000 q:27.32 tex:184629 mv:11566 misc:1309 imb:144 pmb:750 smb:456 d:- ref:0 ; in:7079 out:7079 type:P dur:82000000 cpbdur:82000000 q:26.45 tex:113824 mv:7113 misc:1455 imb:21 pmb:833 smb:496 d:- ref:0 ; in:7080 out:7080 type:P dur:82000000 cpbdur:82000000 q:27.36 tex:189926 mv:11711 misc:1299 imb:181 pmb:739 smb:430 d:- ref:0 ; in:7081 out:7081 type:P dur:82000000 cpbdur:82000000 q:26.61 tex:100378 mv:6562 misc:1196 imb:36 pmb:586 smb:728 d:- ref:0 ; in:7082 out:7082 type:P dur:82000000 cpbdur:82000000 q:27.62 tex:186189 mv:13666 misc:1433 imb:441 pmb:688 smb:221 d:- ref:0 ; in:7083 out:7083 type:P dur:82000000 cpbdur:82000000 q:26.62 tex:101981 mv:7180 misc:1423 imb:42 pmb:770 smb:538 d:- ref:0 ; in:7084 out:7084 type:P dur:82000000 cpbdur:82000000 q:27.40 tex:184101 mv:11975 misc:1428 imb:243 pmb:735 smb:372 d:- ref:0 ; in:7085 out:7085 type:P dur:82000000 cpbdur:82000000 q:26.62 tex:98130 mv:6559 misc:1343 imb:25 pmb:663 smb:662 d:- ref:0 ; in:7086 out:7086 type:P dur:82000000 cpbdur:82000000 q:26.82 tex:145383 mv:10559 misc:1426 imb:100 pmb:823 smb:427 d:- ref:0 ; in:7087 out:7087 type:P dur:82000000 cpbdur:82000000 q:26.28 tex:120113 mv:7161 misc:1502 imb:23 pmb:813 smb:514 d:- ref:0 ; in:7088 out:7088 type:P dur:82000000 cpbdur:82000000 q:27.91 tex:198227 mv:13136 misc:1365 imb:307 pmb:644 smb:399 d:- ref:0 ; in:7089 out:7089 type:P dur:82000000 cpbdur:82000000 q:26.92 tex:108699 mv:7026 misc:1395 imb:23 pmb:734 smb:593 d:- ref:0 ; in:7090 out:7090 type:P dur:82000000 cpbdur:82000000 q:27.43 tex:178299 mv:11652 misc:1345 imb:149 pmb:744 smb:457 d:- ref:0 ; in:7091 out:7091 type:P dur:82000000 cpbdur:82000000 q:26.61 tex:100070 mv:6711 misc:1307 imb:28 pmb:655 smb:667 d:- ref:0 ; in:7092 out:7092 type:P dur:82000000 cpbdur:82000000 q:27.35 tex:181917 mv:11928 misc:1339 imb:122 pmb:802 smb:426 d:- ref:0 ; in:7093 out:7093 type:P dur:82000000 cpbdur:82000000 q:26.49 tex:120103 mv:7403 misc:1542 imb:33 pmb:865 smb:452 d:- ref:0 ; in:7094 out:7094 type:P dur:82000000 cpbdur:82000000 q:27.27 tex:181491 mv:12038 misc:1359 imb:233 pmb:718 smb:399 d:- ref:0 ; in:7095 out:7095 type:P dur:82000000 cpbdur:82000000 q:26.72 tex:118423 mv:7876 misc:1389 imb:43 pmb:836 smb:471 d:- ref:0 ; in:7096 out:7096 type:P dur:82000000 cpbdur:82000000 q:27.53 tex:172761 mv:12691 misc:1412 imb:201 pmb:817 smb:332 d:- ref:0 ; in:7097 out:7097 type:P dur:82000000 cpbdur:82000000 q:26.62 tex:102223 mv:7056 misc:1505 imb:15 pmb:822 smb:513 d:- ref:0 ; in:7098 out:7098 type:P dur:82000000 cpbdur:82000000 q:26.91 tex:145010 mv:10143 misc:1327 imb:97 pmb:703 smb:550 d:- ref:0 ; in:7099 out:7099 type:P dur:82000000 cpbdur:82000000 q:26.34 tex:116415 mv:7201 misc:1504 imb:22 pmb:849 smb:479 d:- ref:0 ; in:7100 out:7100 type:P dur:82000000 cpbdur:82000000 q:26.60 tex:137735 mv:9829 misc:1308 imb:58 pmb:781 smb:511 d:- ref:0 ; in:7101 out:7101 type:P dur:82000000 cpbdur:82000000 q:26.09 tex:115517 mv:7124 misc:1431 imb:25 pmb:780 smb:545 d:- ref:0 ; in:7102 out:7102 type:P dur:82000000 cpbdur:82000000 q:26.27 tex:138392 mv:8570 misc:1310 imb:52 pmb:698 smb:600 d:- ref:0 ; in:7103 out:7103 type:P dur:82000000 cpbdur:82000000 q:25.86 tex:104867 mv:6306 misc:1379 imb:19 pmb:668 smb:663 d:- ref:0 ; in:7104 out:7104 type:P dur:82000000 cpbdur:82000000 q:26.19 tex:139367 mv:8984 misc:1313 imb:57 pmb:708 smb:585 d:- ref:0 ; in:7105 out:7105 type:P dur:82000000 cpbdur:82000000 q:25.90 tex:108716 mv:6891 misc:1401 imb:32 pmb:709 smb:609 d:- ref:0 ; in:7106 out:7106 type:P dur:82000000 cpbdur:82000000 q:25.67 tex:104433 mv:6507 misc:1276 imb:18 pmb:645 smb:687 d:- ref:0 ; in:7107 out:7107 type:P dur:82000000 cpbdur:82000000 q:27.69 tex:226419 mv:15182 misc:1455 imb:571 pmb:696 smb:83 d:- ref:0 ; in:7108 out:7108 type:P dur:82000000 cpbdur:82000000 q:26.73 tex:105075 mv:6860 misc:1377 imb:26 pmb:740 smb:584 d:- ref:0 ; in:7109 out:7109 type:P dur:82000000 cpbdur:82000000 q:28.45 tex:250876 mv:15985 misc:1451 imb:576 pmb:699 smb:75 d:- ref:0 ; in:7110 out:7110 type:P dur:82000000 cpbdur:82000000 q:27.30 tex:102012 mv:6703 misc:1445 imb:26 pmb:757 smb:567 d:- ref:0 ; in:7111 out:7111 type:P dur:82000000 cpbdur:82000000 q:27.67 tex:154538 mv:11146 misc:1444 imb:115 pmb:898 smb:337 d:- ref:0 ; in:7112 out:7112 type:P dur:82000000 cpbdur:82000000 q:27.08 tex:135048 mv:8571 misc:1533 imb:52 pmb:967 smb:331 d:- ref:0 ; in:7113 out:7113 type:P dur:82000000 cpbdur:82000000 q:27.04 tex:131609 mv:7953 misc:1334 imb:82 pmb:695 smb:573 d:- ref:0 ; in:7114 out:7114 type:P dur:82000000 cpbdur:82000000 q:27.79 tex:183245 mv:13524 misc:1463 imb:143 pmb:1078 smb:129 d:- ref:0 ; in:7115 out:7115 type:P dur:82000000 cpbdur:82000000 q:26.84 tex:132189 mv:9261 misc:1462 imb:67 pmb:1189 smb:94 d:- ref:0 ; in:7116 out:7116 type:P dur:82000000 cpbdur:82000000 q:26.18 tex:137254 mv:8770 misc:1464 imb:54 pmb:1208 smb:88 d:- ref:0 ; in:7117 out:7117 type:P dur:82000000 cpbdur:82000000 q:25.57 tex:112406 mv:7504 misc:1474 imb:25 pmb:1166 smb:159 d:- ref:0 ; in:7118 out:7118 type:P dur:82000000 cpbdur:82000000 q:24.96 tex:133554 mv:7035 misc:1483 imb:22 pmb:1195 smb:133 d:- ref:0 ; in:7119 out:7119 type:P dur:82000000 cpbdur:82000000 q:24.54 tex:117394 mv:5624 misc:1502 imb:16 pmb:1140 smb:194 d:- ref:0 ; in:7120 out:7120 type:P dur:82000000 cpbdur:82000000 q:24.08 tex:131842 mv:5887 misc:1487 imb:19 pmb:1177 smb:154 d:- ref:0 ; in:7121 out:7121 type:P dur:82000000 cpbdur:82000000 q:23.97 tex:125468 mv:5720 misc:1524 imb:12 pmb:1118 smb:220 d:- ref:0 ; in:7122 out:7122 type:P dur:82000000 cpbdur:82000000 q:23.79 tex:111535 mv:5064 misc:1529 imb:9 pmb:1040 smb:301 d:- ref:0 ; in:7123 out:7123 type:P dur:82000000 cpbdur:82000000 q:23.93 tex:122378 mv:6036 misc:1522 imb:16 pmb:1102 smb:232 d:- ref:0 ; in:7124 out:7124 type:P dur:82000000 cpbdur:82000000 q:24.17 tex:126755 mv:6156 misc:1497 imb:14 pmb:1114 smb:222 d:- ref:0 ; in:7125 out:7125 type:P dur:82000000 cpbdur:82000000 q:24.00 tex:118282 mv:5419 misc:1515 imb:8 pmb:1081 smb:261 d:- ref:0 ; in:7126 out:7126 type:P dur:82000000 cpbdur:82000000 q:23.98 tex:109041 mv:5991 misc:1528 imb:12 pmb:1069 smb:269 d:- ref:0 ; in:7127 out:7127 type:P dur:82000000 cpbdur:82000000 q:23.68 tex:98856 mv:5054 misc:1482 imb:8 pmb:944 smb:398 d:- ref:0 ; in:7128 out:7128 type:P dur:82000000 cpbdur:82000000 q:23.76 tex:107381 mv:5688 misc:1539 imb:16 pmb:1068 smb:266 d:- ref:0 ; in:7129 out:7129 type:P dur:82000000 cpbdur:82000000 q:23.82 tex:116281 mv:5508 misc:1531 imb:13 pmb:1096 smb:241 d:- ref:0 ; in:7130 out:7130 type:P dur:82000000 cpbdur:82000000 q:24.18 tex:140535 mv:7142 misc:1491 imb:23 pmb:1176 smb:151 d:- ref:0 ; in:7131 out:7131 type:P dur:82000000 cpbdur:82000000 q:23.94 tex:116951 mv:5533 misc:1524 imb:20 pmb:1081 smb:249 d:- ref:0 ; in:7132 out:7132 type:P dur:82000000 cpbdur:82000000 q:24.12 tex:119026 mv:6196 misc:1474 imb:17 pmb:1102 smb:231 d:- ref:0 ; in:7133 out:7133 type:P dur:82000000 cpbdur:82000000 q:24.01 tex:102918 mv:5915 misc:1519 imb:27 pmb:1091 smb:232 d:- ref:0 ; in:7134 out:7134 type:P dur:82000000 cpbdur:82000000 q:27.49 tex:239375 mv:15626 misc:1415 imb:1220 pmb:130 smb:0 d:- ref:0 ; in:7135 out:7135 type:P dur:82000000 cpbdur:82000000 q:26.13 tex:64298 mv:6670 misc:1408 imb:74 pmb:688 smb:588 d:- ref:0 ; in:7136 out:7136 type:P dur:82000000 cpbdur:82000000 q:25.12 tex:56293 mv:5676 misc:1447 imb:95 pmb:700 smb:555 d:- ref:0 ; in:7137 out:7137 type:P dur:82000000 cpbdur:82000000 q:23.95 tex:54132 mv:3411 misc:1409 imb:56 pmb:567 smb:727 d:- ref:0 ; in:7138 out:7138 type:P dur:82000000 cpbdur:82000000 q:23.27 tex:65496 mv:4338 misc:1510 imb:145 pmb:688 smb:517 d:- ref:0 ; in:7139 out:7139 type:P dur:82000000 cpbdur:82000000 q:22.92 tex:66986 mv:3786 misc:1332 imb:42 pmb:558 smb:750 d:- ref:0 ; in:7140 out:7140 type:P dur:82000000 cpbdur:82000000 q:22.66 tex:57478 mv:3179 misc:1271 imb:32 pmb:457 smb:861 d:- ref:0 ; in:7141 out:7141 type:P dur:82000000 cpbdur:82000000 q:22.25 tex:75248 mv:4277 misc:1523 imb:86 pmb:747 smb:517 d:- ref:0 ; in:7142 out:7142 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:44932 mv:2165 misc:1119 imb:32 pmb:313 smb:1005 d:- ref:0 ; in:7143 out:7143 type:P dur:82000000 cpbdur:82000000 q:21.98 tex:63182 mv:3242 misc:1352 imb:29 pmb:504 smb:817 d:- ref:0 ; in:7144 out:7144 type:P dur:82000000 cpbdur:82000000 q:22.44 tex:71926 mv:3972 misc:1438 imb:64 pmb:608 smb:678 d:- ref:0 ; in:7145 out:7145 type:P dur:82000000 cpbdur:82000000 q:22.05 tex:52782 mv:2508 misc:1182 imb:22 pmb:388 smb:940 d:- ref:0 ; in:7146 out:7146 type:P dur:82000000 cpbdur:82000000 q:21.70 tex:42746 mv:2217 misc:1101 imb:37 pmb:285 smb:1028 d:- ref:0 ; in:7147 out:7147 type:P dur:82000000 cpbdur:82000000 q:21.64 tex:46409 mv:2686 misc:1225 imb:55 pmb:356 smb:939 d:- ref:0 ; in:7148 out:7148 type:P dur:82000000 cpbdur:82000000 q:21.73 tex:44814 mv:2226 misc:984 imb:25 pmb:280 smb:1045 d:- ref:0 ; in:7149 out:7149 type:P dur:82000000 cpbdur:82000000 q:22.05 tex:64635 mv:3209 misc:1204 imb:23 pmb:451 smb:876 d:- ref:0 ; in:7150 out:7150 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:60966 mv:3378 misc:1216 imb:29 pmb:426 smb:895 d:- ref:0 ; in:7151 out:7151 type:P dur:82000000 cpbdur:82000000 q:22.44 tex:65215 mv:3430 misc:1283 imb:42 pmb:484 smb:824 d:- ref:0 ; in:7152 out:7152 type:P dur:82000000 cpbdur:82000000 q:22.67 tex:54107 mv:3327 misc:1182 imb:32 pmb:415 smb:903 d:- ref:0 ; in:7153 out:7153 type:P dur:82000000 cpbdur:82000000 q:22.45 tex:57780 mv:3069 misc:1199 imb:22 pmb:417 smb:911 d:- ref:0 ; in:7154 out:7154 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:52285 mv:3122 misc:1209 imb:33 pmb:422 smb:895 d:- ref:0 ; in:7155 out:7155 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:47838 mv:2837 misc:1149 imb:25 pmb:363 smb:962 d:- ref:0 ; in:7156 out:7156 type:P dur:82000000 cpbdur:82000000 q:22.46 tex:48829 mv:3173 misc:1374 imb:63 pmb:451 smb:836 d:- ref:0 ; in:7157 out:7157 type:P dur:82000000 cpbdur:82000000 q:22.26 tex:54685 mv:2967 misc:1204 imb:32 pmb:423 smb:895 d:- ref:0 ; in:7158 out:7158 type:P dur:82000000 cpbdur:82000000 q:22.16 tex:53555 mv:2701 misc:1080 imb:27 pmb:369 smb:954 d:- ref:0 ; in:7159 out:7159 type:P dur:82000000 cpbdur:82000000 q:22.04 tex:49051 mv:2602 misc:1099 imb:35 pmb:350 smb:965 d:- ref:0 ; in:7160 out:7160 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:72118 mv:4296 misc:1330 imb:39 pmb:586 smb:725 d:- ref:0 ; in:7161 out:7161 type:P dur:82000000 cpbdur:82000000 q:22.25 tex:62509 mv:3441 misc:1402 imb:32 pmb:581 smb:737 d:- ref:0 ; in:7162 out:7162 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:68278 mv:4311 misc:1355 imb:33 pmb:555 smb:762 d:- ref:0 ; in:7163 out:7163 type:P dur:82000000 cpbdur:82000000 q:22.59 tex:52065 mv:3224 misc:1287 imb:27 pmb:472 smb:851 d:- ref:0 ; in:7164 out:7164 type:P dur:82000000 cpbdur:82000000 q:22.95 tex:69270 mv:4570 misc:1352 imb:42 pmb:572 smb:736 d:- ref:0 ; in:7165 out:7165 type:P dur:82000000 cpbdur:82000000 q:23.41 tex:88376 mv:6631 misc:1409 imb:64 pmb:719 smb:567 d:- ref:0 ; in:7166 out:7166 type:P dur:82000000 cpbdur:82000000 q:27.30 tex:209576 mv:15106 misc:1422 imb:1226 pmb:124 smb:0 d:- ref:0 ; in:7167 out:7167 type:P dur:82000000 cpbdur:82000000 q:25.17 tex:35514 mv:2050 misc:1316 imb:17 pmb:536 smb:797 d:- ref:0 ; in:7168 out:7168 type:P dur:82000000 cpbdur:82000000 q:22.85 tex:50079 mv:3115 misc:1518 imb:43 pmb:879 smb:428 d:- ref:0 ; in:7169 out:7169 type:P dur:82000000 cpbdur:82000000 q:21.19 tex:91624 mv:4249 misc:1511 imb:63 pmb:1085 smb:202 d:- ref:0 ; in:7170 out:7170 type:P dur:82000000 cpbdur:82000000 q:19.63 tex:49687 mv:2817 misc:1552 imb:14 pmb:859 smb:477 d:- ref:0 ; in:7171 out:7171 type:P dur:82000000 cpbdur:82000000 q:20.29 tex:58080 mv:3598 misc:1474 imb:13 pmb:810 smb:527 d:- ref:0 ; in:7172 out:7172 type:P dur:82000000 cpbdur:82000000 q:20.66 tex:42228 mv:2988 misc:1344 imb:2 pmb:640 smb:708 d:- ref:0 ; in:7173 out:7173 type:P dur:82000000 cpbdur:82000000 q:20.61 tex:54836 mv:2575 misc:1373 imb:29 pmb:545 smb:776 d:- ref:0 ; in:7174 out:7174 type:P dur:82000000 cpbdur:82000000 q:19.95 tex:38545 mv:2229 misc:1442 imb:7 pmb:619 smb:724 d:- ref:0 ; in:7175 out:7175 type:P dur:82000000 cpbdur:82000000 q:20.06 tex:54801 mv:2359 misc:1360 imb:8 pmb:557 smb:785 d:- ref:0 ; in:7176 out:7176 type:P dur:82000000 cpbdur:82000000 q:19.38 tex:73440 mv:3807 misc:1561 imb:17 pmb:1083 smb:250 d:- ref:0 ; in:7177 out:7177 type:P dur:82000000 cpbdur:82000000 q:19.69 tex:45811 mv:2197 misc:1328 imb:0 pmb:569 smb:781 d:- ref:0 ; in:7178 out:7178 type:P dur:82000000 cpbdur:82000000 q:18.36 tex:66402 mv:3437 misc:1577 imb:9 pmb:1015 smb:326 d:- ref:0 ; in:7179 out:7179 type:P dur:82000000 cpbdur:82000000 q:18.21 tex:42357 mv:2468 misc:1535 imb:2 pmb:720 smb:628 d:- ref:0 ; in:7180 out:7180 type:P dur:82000000 cpbdur:82000000 q:18.50 tex:44270 mv:2460 misc:1566 imb:4 pmb:742 smb:604 d:- ref:0 ; in:7181 out:7181 type:P dur:82000000 cpbdur:82000000 q:18.60 tex:37513 mv:1706 misc:1301 imb:3 pmb:484 smb:863 d:- ref:0 ; in:7182 out:7182 type:P dur:82000000 cpbdur:82000000 q:17.07 tex:66249 mv:3510 misc:1561 imb:7 pmb:1118 smb:225 d:- ref:0 ; in:7183 out:7183 type:P dur:82000000 cpbdur:82000000 q:19.02 tex:51964 mv:2452 misc:1368 imb:16 pmb:562 smb:772 d:- ref:0 ; in:7184 out:7184 type:P dur:82000000 cpbdur:82000000 q:19.16 tex:43281 mv:1908 misc:1259 imb:12 pmb:450 smb:888 d:- ref:0 ; in:7185 out:7185 type:P dur:82000000 cpbdur:82000000 q:18.90 tex:29078 mv:1834 misc:1360 imb:2 pmb:510 smb:838 d:- ref:0 ; in:7186 out:7186 type:P dur:82000000 cpbdur:82000000 q:17.43 tex:49937 mv:3077 misc:1586 imb:1 pmb:975 smb:374 d:- ref:0 ; in:7187 out:7187 type:P dur:82000000 cpbdur:82000000 q:16.96 tex:27147 mv:1868 misc:1489 imb:1 pmb:602 smb:747 d:- ref:0 ; in:7188 out:7188 type:P dur:82000000 cpbdur:82000000 q:20.63 tex:76007 mv:3206 misc:1339 imb:7 pmb:646 smb:697 d:- ref:0 ; in:7189 out:7189 type:P dur:82000000 cpbdur:82000000 q:20.19 tex:64896 mv:2722 misc:1342 imb:6 pmb:668 smb:676 d:- ref:0 ; in:7190 out:7190 type:P dur:82000000 cpbdur:82000000 q:21.47 tex:75592 mv:3909 misc:1251 imb:8 pmb:613 smb:729 d:- ref:0 ; in:7191 out:7191 type:P dur:82000000 cpbdur:82000000 q:20.51 tex:33127 mv:1560 misc:1217 imb:2 pmb:424 smb:924 d:- ref:0 ; in:7192 out:7192 type:P dur:82000000 cpbdur:82000000 q:20.60 tex:59402 mv:2389 misc:1297 imb:17 pmb:537 smb:796 d:- ref:0 ; in:7193 out:7193 type:P dur:82000000 cpbdur:82000000 q:20.46 tex:45420 mv:2357 misc:1319 imb:13 pmb:543 smb:794 d:- ref:0 ; in:7194 out:7194 type:P dur:82000000 cpbdur:82000000 q:21.12 tex:71556 mv:2861 misc:1191 imb:3 pmb:567 smb:780 d:- ref:0 ; in:7195 out:7195 type:P dur:82000000 cpbdur:82000000 q:21.46 tex:62139 mv:3197 misc:1184 imb:8 pmb:561 smb:781 d:- ref:0 ; in:7196 out:7196 type:P dur:82000000 cpbdur:82000000 q:20.31 tex:32768 mv:1641 misc:1215 imb:1 pmb:471 smb:878 d:- ref:0 ; in:7197 out:7197 type:P dur:82000000 cpbdur:82000000 q:19.16 tex:47719 mv:2675 misc:1526 imb:4 pmb:805 smb:541 d:- ref:0 ; in:7198 out:7198 type:P dur:82000000 cpbdur:82000000 q:17.26 tex:73692 mv:3527 misc:1557 imb:4 pmb:1139 smb:207 d:- ref:0 ; in:7199 out:7199 type:P dur:82000000 cpbdur:82000000 q:17.22 tex:34929 mv:2278 misc:1553 imb:2 pmb:722 smb:626 d:- ref:0 ; in:7200 out:7200 type:P dur:82000000 cpbdur:82000000 q:20.79 tex:83136 mv:3847 misc:1209 imb:6 pmb:605 smb:739 d:- ref:0 ; in:7201 out:7201 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:64613 mv:3743 misc:1188 imb:10 pmb:549 smb:791 d:- ref:0 ; in:7202 out:7202 type:P dur:82000000 cpbdur:82000000 q:20.78 tex:43920 mv:2117 misc:1267 imb:1 pmb:561 smb:788 d:- ref:0 ; in:7203 out:7203 type:P dur:82000000 cpbdur:82000000 q:19.33 tex:53727 mv:2355 misc:1398 imb:6 pmb:711 smb:633 d:- ref:0 ; in:7204 out:7204 type:P dur:82000000 cpbdur:82000000 q:19.30 tex:46189 mv:2202 misc:1385 imb:1 pmb:612 smb:737 d:- ref:0 ; in:7205 out:7205 type:P dur:82000000 cpbdur:82000000 q:17.40 tex:60373 mv:3208 misc:1587 imb:1 pmb:1040 smb:309 d:- ref:0 ; in:7206 out:7206 type:P dur:82000000 cpbdur:82000000 q:17.53 tex:24876 mv:1419 misc:1249 imb:0 pmb:433 smb:917 d:- ref:0 ; in:7207 out:7207 type:P dur:82000000 cpbdur:82000000 q:17.57 tex:30399 mv:1493 misc:1156 imb:0 pmb:423 smb:927 d:- ref:0 ; in:7208 out:7208 type:P dur:82000000 cpbdur:82000000 q:17.29 tex:34942 mv:2227 misc:1535 imb:1 pmb:705 smb:644 d:- ref:0 ; in:7209 out:7209 type:P dur:82000000 cpbdur:82000000 q:20.80 tex:75330 mv:3983 misc:1335 imb:9 pmb:671 smb:670 d:- ref:0 ; in:7210 out:7210 type:P dur:82000000 cpbdur:82000000 q:21.58 tex:65920 mv:4024 misc:1240 imb:10 pmb:586 smb:754 d:- ref:0 ; in:7211 out:7211 type:P dur:82000000 cpbdur:82000000 q:22.04 tex:71752 mv:4088 misc:1176 imb:9 pmb:590 smb:751 d:- ref:0 ; in:7212 out:7212 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:39376 mv:2275 misc:1341 imb:2 pmb:629 smb:719 d:- ref:0 ; in:7213 out:7213 type:P dur:82000000 cpbdur:82000000 q:21.75 tex:77703 mv:4213 misc:1244 imb:15 pmb:617 smb:718 d:- ref:0 ; in:7214 out:7214 type:P dur:82000000 cpbdur:82000000 q:21.12 tex:54236 mv:2795 misc:1329 imb:28 pmb:591 smb:731 d:- ref:0 ; in:7215 out:7215 type:P dur:82000000 cpbdur:82000000 q:19.85 tex:30086 mv:1835 misc:1327 imb:2 pmb:565 smb:783 d:- ref:0 ; in:7216 out:7216 type:P dur:82000000 cpbdur:82000000 q:18.76 tex:51585 mv:2448 misc:1471 imb:5 pmb:734 smb:611 d:- ref:0 ; in:7217 out:7217 type:P dur:82000000 cpbdur:82000000 q:17.83 tex:45337 mv:2112 misc:1439 imb:1 pmb:672 smb:677 d:- ref:0 ; in:7218 out:7218 type:P dur:82000000 cpbdur:82000000 q:17.48 tex:67424 mv:2998 misc:1554 imb:1 pmb:950 smb:399 d:- ref:0 ; in:7219 out:7219 type:P dur:82000000 cpbdur:82000000 q:19.39 tex:55446 mv:2328 misc:1330 imb:0 pmb:564 smb:786 d:- ref:0 ; in:7220 out:7220 type:P dur:82000000 cpbdur:82000000 q:21.41 tex:85123 mv:4486 misc:1295 imb:11 pmb:664 smb:675 d:- ref:0 ; in:7221 out:7221 type:P dur:82000000 cpbdur:82000000 q:19.65 tex:22699 mv:1573 misc:1264 imb:0 pmb:459 smb:891 d:- ref:0 ; in:7222 out:7222 type:P dur:82000000 cpbdur:82000000 q:21.65 tex:83975 mv:4944 misc:1281 imb:41 pmb:630 smb:679 d:- ref:0 ; in:7223 out:7223 type:P dur:82000000 cpbdur:82000000 q:20.88 tex:42907 mv:2282 misc:1275 imb:15 pmb:552 smb:783 d:- ref:0 ; in:7224 out:7224 type:P dur:82000000 cpbdur:82000000 q:20.59 tex:55638 mv:2486 misc:1228 imb:3 pmb:532 smb:815 d:- ref:0 ; in:7225 out:7225 type:P dur:82000000 cpbdur:82000000 q:20.41 tex:48917 mv:2288 misc:1315 imb:2 pmb:580 smb:768 d:- ref:0 ; in:7226 out:7226 type:P dur:82000000 cpbdur:82000000 q:20.12 tex:42210 mv:1882 misc:1308 imb:2 pmb:518 smb:830 d:- ref:0 ; in:7227 out:7227 type:P dur:82000000 cpbdur:82000000 q:19.61 tex:37895 mv:1949 misc:1284 imb:1 pmb:521 smb:828 d:- ref:0 ; in:7228 out:7228 type:P dur:82000000 cpbdur:82000000 q:18.72 tex:44344 mv:2427 misc:1445 imb:3 pmb:703 smb:644 d:- ref:0 ; in:7229 out:7229 type:P dur:82000000 cpbdur:82000000 q:18.41 tex:46986 mv:2290 misc:1452 imb:2 pmb:680 smb:668 d:- ref:0 ; in:7230 out:7230 type:P dur:82000000 cpbdur:82000000 q:17.64 tex:27064 mv:1352 misc:1216 imb:0 pmb:408 smb:942 d:- ref:0 ; in:7231 out:7231 type:P dur:82000000 cpbdur:82000000 q:16.92 tex:52371 mv:2986 misc:1571 imb:1 pmb:964 smb:385 d:- ref:0 ; in:7232 out:7232 type:P dur:82000000 cpbdur:82000000 q:17.14 tex:31515 mv:2118 misc:1535 imb:0 pmb:664 smb:686 d:- ref:0 ; in:7233 out:7233 type:P dur:82000000 cpbdur:82000000 q:20.26 tex:82644 mv:2663 misc:1157 imb:5 pmb:553 smb:792 d:- ref:0 ; in:7234 out:7234 type:P dur:82000000 cpbdur:82000000 q:21.16 tex:67265 mv:2966 misc:1153 imb:5 pmb:544 smb:801 d:- ref:0 ; in:7235 out:7235 type:P dur:82000000 cpbdur:82000000 q:19.83 tex:24507 mv:1584 misc:1277 imb:3 pmb:482 smb:865 d:- ref:0 ; in:7236 out:7236 type:P dur:82000000 cpbdur:82000000 q:21.42 tex:83019 mv:3782 misc:1231 imb:10 pmb:614 smb:726 d:- ref:0 ; in:7237 out:7237 type:P dur:82000000 cpbdur:82000000 q:22.00 tex:68521 mv:3890 misc:1213 imb:9 pmb:590 smb:751 d:- ref:0 ; in:7238 out:7238 type:P dur:82000000 cpbdur:82000000 q:20.02 tex:32025 mv:1706 misc:1261 imb:1 pmb:540 smb:809 d:- ref:0 ; in:7239 out:7239 type:P dur:82000000 cpbdur:82000000 q:18.79 tex:42007 mv:2327 misc:1426 imb:1 pmb:697 smb:652 d:- ref:0 ; in:7240 out:7240 type:P dur:82000000 cpbdur:82000000 q:17.47 tex:65057 mv:3131 misc:1556 imb:3 pmb:985 smb:362 d:- ref:0 ; in:7241 out:7241 type:P dur:82000000 cpbdur:82000000 q:16.95 tex:22471 mv:1927 misc:1522 imb:1 pmb:621 smb:728 d:- ref:0 ; in:7242 out:7242 type:P dur:82000000 cpbdur:82000000 q:20.13 tex:78752 mv:3103 misc:1217 imb:6 pmb:591 smb:753 d:- ref:0 ; in:7243 out:7243 type:P dur:82000000 cpbdur:82000000 q:20.90 tex:61394 mv:2930 misc:1196 imb:6 pmb:552 smb:792 d:- ref:0 ; in:7244 out:7244 type:P dur:82000000 cpbdur:82000000 q:19.98 tex:34568 mv:1767 misc:1241 imb:0 pmb:493 smb:857 d:- ref:0 ; in:7245 out:7245 type:P dur:82000000 cpbdur:82000000 q:18.46 tex:45897 mv:2204 misc:1387 imb:2 pmb:690 smb:658 d:- ref:0 ; in:7246 out:7246 type:P dur:82000000 cpbdur:82000000 q:18.04 tex:30397 mv:1342 misc:1149 imb:1 pmb:366 smb:983 d:- ref:0 ; in:7247 out:7247 type:P dur:82000000 cpbdur:82000000 q:17.41 tex:38466 mv:2390 misc:1568 imb:1 pmb:770 smb:579 d:- ref:0 ; in:7248 out:7248 type:P dur:82000000 cpbdur:82000000 q:16.24 tex:74367 mv:3655 misc:1546 imb:1 pmb:1181 smb:168 d:- ref:0 ; in:7249 out:7249 type:P dur:82000000 cpbdur:82000000 q:16.95 tex:29188 mv:2299 misc:1553 imb:2 pmb:717 smb:631 d:- ref:0 ; in:7250 out:7250 type:I dur:82000000 cpbdur:82000000 q:16.23 tex:554913 mv:15460 misc:379 imb:1350 pmb:0 smb:0 d:- ref:; in:7251 out:7251 type:P dur:82000000 cpbdur:82000000 q:20.95 tex:14744 mv:1364 misc:1236 imb:2 pmb:416 smb:932 d:- ref:0 ; in:7252 out:7252 type:P dur:82000000 cpbdur:82000000 q:22.89 tex:3936 mv:497 misc:799 imb:0 pmb:145 smb:1205 d:- ref:0 ; in:7253 out:7253 type:P dur:82000000 cpbdur:82000000 q:21.03 tex:23671 mv:1585 misc:1296 imb:0 pmb:475 smb:875 d:- ref:0 ; in:7254 out:7254 type:P dur:82000000 cpbdur:82000000 q:20.47 tex:39536 mv:1790 misc:1194 imb:3 pmb:476 smb:871 d:- ref:0 ; in:7255 out:7255 type:P dur:82000000 cpbdur:82000000 q:19.82 tex:28109 mv:1355 misc:1040 imb:0 pmb:363 smb:987 d:- ref:0 ; in:7256 out:7256 type:P dur:82000000 cpbdur:82000000 q:18.62 tex:25219 mv:2097 misc:1476 imb:1 pmb:627 smb:722 d:- ref:0 ; in:7257 out:7257 type:P dur:82000000 cpbdur:82000000 q:20.82 tex:70907 mv:3229 misc:1216 imb:3 pmb:611 smb:736 d:- ref:0 ; in:7258 out:7258 type:P dur:82000000 cpbdur:82000000 q:20.69 tex:64348 mv:2930 misc:1306 imb:5 pmb:626 smb:719 d:- ref:0 ; in:7259 out:7259 type:P dur:82000000 cpbdur:82000000 q:20.00 tex:51018 mv:2088 misc:1310 imb:3 pmb:556 smb:791 d:- ref:0 ; in:7260 out:7260 type:P dur:82000000 cpbdur:82000000 q:20.17 tex:45140 mv:2222 misc:1230 imb:4 pmb:526 smb:820 d:- ref:0 ; in:7261 out:7261 type:P dur:82000000 cpbdur:82000000 q:21.26 tex:81774 mv:3378 misc:1176 imb:5 pmb:570 smb:775 d:- ref:0 ; in:7262 out:7262 type:P dur:82000000 cpbdur:82000000 q:21.72 tex:66065 mv:3384 misc:1279 imb:28 pmb:550 smb:772 d:- ref:0 ; in:7263 out:7263 type:P dur:82000000 cpbdur:82000000 q:21.27 tex:47386 mv:2615 misc:1295 imb:17 pmb:525 smb:808 d:- ref:0 ; in:7264 out:7264 type:P dur:82000000 cpbdur:82000000 q:19.75 tex:19661 mv:1433 misc:1234 imb:1 pmb:441 smb:908 d:- ref:0 ; in:7265 out:7265 type:P dur:82000000 cpbdur:82000000 q:21.08 tex:71338 mv:4013 misc:1233 imb:12 pmb:627 smb:711 d:- ref:0 ; in:7266 out:7266 type:P dur:82000000 cpbdur:82000000 q:21.45 tex:57959 mv:3765 misc:1180 imb:6 pmb:575 smb:769 d:- ref:0 ; in:7267 out:7267 type:P dur:82000000 cpbdur:82000000 q:22.50 tex:64128 mv:3426 misc:950 imb:34 pmb:320 smb:996 d:- ref:0 ; in:7268 out:7268 type:P dur:82000000 cpbdur:82000000 q:21.46 tex:58780 mv:2315 misc:1305 imb:8 pmb:547 smb:795 d:- ref:0 ; in:7269 out:7269 type:P dur:82000000 cpbdur:82000000 q:20.06 tex:33380 mv:1787 misc:1305 imb:3 pmb:513 smb:834 d:- ref:0 ; in:7270 out:7270 type:P dur:82000000 cpbdur:82000000 q:22.39 tex:89471 mv:4207 misc:1202 imb:47 pmb:455 smb:848 d:- ref:0 ; in:7271 out:7271 type:P dur:82000000 cpbdur:82000000 q:20.59 tex:25663 mv:1572 misc:1205 imb:4 pmb:446 smb:900 d:- ref:0 ; in:7272 out:7272 type:P dur:82000000 cpbdur:82000000 q:21.13 tex:72508 mv:3446 misc:1270 imb:15 pmb:612 smb:723 d:- ref:0 ; in:7273 out:7273 type:P dur:82000000 cpbdur:82000000 q:23.05 tex:86047 mv:5239 misc:1258 imb:73 pmb:565 smb:712 d:- ref:0 ; in:7274 out:7274 type:P dur:82000000 cpbdur:82000000 q:22.57 tex:50007 mv:3821 misc:1236 imb:15 pmb:577 smb:758 d:- ref:0 ; in:7275 out:7275 type:P dur:82000000 cpbdur:82000000 q:21.15 tex:55262 mv:2493 misc:1341 imb:13 pmb:645 smb:692 d:- ref:0 ; in:7276 out:7276 type:P dur:82000000 cpbdur:82000000 q:20.78 tex:45027 mv:2392 misc:1269 imb:2 pmb:558 smb:790 d:- ref:0 ; in:7277 out:7277 type:P dur:82000000 cpbdur:82000000 q:20.72 tex:51900 mv:2393 misc:1155 imb:4 pmb:513 smb:833 d:- ref:0 ; in:7278 out:7278 type:P dur:82000000 cpbdur:82000000 q:19.58 tex:34754 mv:1964 misc:1306 imb:1 pmb:564 smb:785 d:- ref:0 ; in:7279 out:7279 type:P dur:82000000 cpbdur:82000000 q:17.86 tex:68383 mv:2995 misc:1566 imb:8 pmb:915 smb:427 d:- ref:0 ; in:7280 out:7280 type:P dur:82000000 cpbdur:82000000 q:20.74 tex:76091 mv:3623 misc:1182 imb:17 pmb:581 smb:752 d:- ref:0 ; in:7281 out:7281 type:P dur:82000000 cpbdur:82000000 q:19.22 tex:56880 mv:3372 misc:1516 imb:5 pmb:802 smb:543 d:- ref:0 ; in:7282 out:7282 type:P dur:82000000 cpbdur:82000000 q:18.12 tex:30126 mv:2153 misc:1473 imb:1 pmb:627 smb:722 d:- ref:0 ; in:7283 out:7283 type:P dur:82000000 cpbdur:82000000 q:20.84 tex:75263 mv:4136 misc:1241 imb:14 pmb:612 smb:724 d:- ref:0 ; in:7284 out:7284 type:P dur:82000000 cpbdur:82000000 q:19.04 tex:49025 mv:2762 misc:1413 imb:0 pmb:728 smb:622 d:- ref:0 ; in:7285 out:7285 type:P dur:82000000 cpbdur:82000000 q:18.19 tex:31388 mv:2139 misc:1433 imb:1 pmb:633 smb:716 d:- ref:0 ; in:7286 out:7286 type:P dur:82000000 cpbdur:82000000 q:17.52 tex:23389 mv:1408 misc:1235 imb:1 pmb:398 smb:951 d:- ref:0 ; in:7287 out:7287 type:P dur:82000000 cpbdur:82000000 q:18.45 tex:53267 mv:2507 misc:1450 imb:6 pmb:675 smb:669 d:- ref:0 ; in:7288 out:7288 type:P dur:82000000 cpbdur:82000000 q:16.96 tex:41796 mv:2676 misc:1576 imb:0 pmb:858 smb:492 d:- ref:0 ; in:7289 out:7289 type:P dur:82000000 cpbdur:82000000 q:17.18 tex:34675 mv:2048 misc:1509 imb:2 pmb:624 smb:724 d:- ref:0 ; in:7290 out:7290 type:P dur:82000000 cpbdur:82000000 q:16.31 tex:76349 mv:3487 misc:1564 imb:2 pmb:1117 smb:231 d:- ref:0 ; in:7291 out:7291 type:P dur:82000000 cpbdur:82000000 q:17.17 tex:43939 mv:2485 misc:1536 imb:4 pmb:737 smb:609 d:- ref:0 ; in:7292 out:7292 type:P dur:82000000 cpbdur:82000000 q:17.31 tex:36295 mv:2058 misc:1471 imb:1 pmb:616 smb:733 d:- ref:0 ; in:7293 out:7293 type:P dur:82000000 cpbdur:82000000 q:17.88 tex:33843 mv:1731 misc:1234 imb:1 pmb:427 smb:922 d:- ref:0 ; in:7294 out:7294 type:P dur:82000000 cpbdur:82000000 q:17.16 tex:25556 mv:1766 misc:1406 imb:2 pmb:538 smb:810 d:- ref:0 ; in:7295 out:7295 type:P dur:82000000 cpbdur:82000000 q:17.71 tex:29387 mv:1414 misc:1135 imb:1 pmb:362 smb:987 d:- ref:0 ; in:7296 out:7296 type:P dur:82000000 cpbdur:82000000 q:16.28 tex:53855 mv:3065 misc:1576 imb:2 pmb:1003 smb:345 d:- ref:0 ; in:7297 out:7297 type:P dur:82000000 cpbdur:82000000 q:16.32 tex:27805 mv:1796 misc:1431 imb:5 pmb:530 smb:815 d:- ref:0 ; in:7298 out:7298 type:P dur:82000000 cpbdur:82000000 q:16.49 tex:28228 mv:1290 misc:1170 imb:3 pmb:350 smb:997 d:- ref:0 ; in:7299 out:7299 type:P dur:82000000 cpbdur:82000000 q:16.37 tex:30524 mv:1645 misc:1423 imb:1 pmb:519 smb:830 d:- ref:0 ; in:7300 out:7300 type:P dur:82000000 cpbdur:82000000 q:16.60 tex:21401 mv:2158 misc:1529 imb:1 pmb:676 smb:673 d:- ref:0 ; in:7301 out:7301 type:P dur:82000000 cpbdur:82000000 q:16.46 tex:40909 mv:2528 misc:1563 imb:0 pmb:778 smb:572 d:- ref:0 ; in:7302 out:7302 type:P dur:82000000 cpbdur:82000000 q:16.75 tex:22193 mv:1934 misc:1513 imb:3 pmb:604 smb:743 d:- ref:0 ; in:7303 out:7303 type:P dur:82000000 cpbdur:82000000 q:19.98 tex:72098 mv:3341 misc:1137 imb:9 pmb:551 smb:790 d:- ref:0 ; in:7304 out:7304 type:P dur:82000000 cpbdur:82000000 q:20.89 tex:57648 mv:3327 misc:1121 imb:10 pmb:527 smb:813 d:- ref:0 ; in:7305 out:7305 type:P dur:82000000 cpbdur:82000000 q:19.74 tex:26316 mv:1581 misc:1175 imb:5 pmb:447 smb:898 d:- ref:0 ; in:7306 out:7306 type:P dur:82000000 cpbdur:82000000 q:18.39 tex:52631 mv:2242 misc:1383 imb:8 pmb:670 smb:672 d:- ref:0 ; in:7307 out:7307 type:P dur:82000000 cpbdur:82000000 q:21.75 tex:69015 mv:3242 misc:1103 imb:57 pmb:344 smb:949 d:- ref:0 ; in:7308 out:7308 type:P dur:82000000 cpbdur:82000000 q:20.59 tex:36297 mv:1819 misc:1188 imb:6 pmb:465 smb:879 d:- ref:0 ; in:7309 out:7309 type:P dur:82000000 cpbdur:82000000 q:19.48 tex:56340 mv:2452 misc:1432 imb:10 pmb:690 smb:650 d:- ref:0 ; in:7310 out:7310 type:P dur:82000000 cpbdur:82000000 q:21.36 tex:67631 mv:3269 misc:1236 imb:33 pmb:483 smb:834 d:- ref:0 ; in:7311 out:7311 type:P dur:82000000 cpbdur:82000000 q:21.09 tex:47066 mv:2315 misc:1227 imb:16 pmb:487 smb:847 d:- ref:0 ; in:7312 out:7312 type:P dur:82000000 cpbdur:82000000 q:21.31 tex:62269 mv:3339 misc:1304 imb:15 pmb:619 smb:716 d:- ref:0 ; in:7313 out:7313 type:P dur:82000000 cpbdur:82000000 q:21.78 tex:57187 mv:3267 misc:1226 imb:13 pmb:547 smb:790 d:- ref:0 ; in:7314 out:7314 type:P dur:82000000 cpbdur:82000000 q:20.39 tex:39040 mv:1968 misc:1296 imb:5 pmb:542 smb:803 d:- ref:0 ; in:7315 out:7315 type:P dur:82000000 cpbdur:82000000 q:18.84 tex:33872 mv:2055 misc:1425 imb:4 pmb:641 smb:705 d:- ref:0 ; in:7316 out:7316 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:64013 mv:3030 misc:1125 imb:12 pmb:502 smb:836 d:- ref:0 ; in:7317 out:7317 type:P dur:82000000 cpbdur:82000000 q:19.57 tex:30416 mv:1376 misc:1104 imb:1 pmb:400 smb:949 d:- ref:0 ; in:7318 out:7318 type:P dur:82000000 cpbdur:82000000 q:18.54 tex:35978 mv:1834 misc:1292 imb:3 pmb:542 smb:805 d:- ref:0 ; in:7319 out:7319 type:P dur:82000000 cpbdur:82000000 q:19.79 tex:44916 mv:2102 misc:1006 imb:10 pmb:310 smb:1030 d:- ref:0 ; in:7320 out:7320 type:P dur:82000000 cpbdur:82000000 q:18.82 tex:41205 mv:1686 misc:1205 imb:1 pmb:472 smb:877 d:- ref:0 ; in:7321 out:7321 type:P dur:82000000 cpbdur:82000000 q:18.49 tex:48161 mv:2098 misc:1373 imb:1 pmb:614 smb:735 d:- ref:0 ; in:7322 out:7322 type:P dur:82000000 cpbdur:82000000 q:18.13 tex:38585 mv:1762 misc:1237 imb:2 pmb:490 smb:858 d:- ref:0 ; in:7323 out:7323 type:P dur:82000000 cpbdur:82000000 q:20.42 tex:76566 mv:3780 misc:1198 imb:11 pmb:580 smb:759 d:- ref:0 ; in:7324 out:7324 type:P dur:82000000 cpbdur:82000000 q:20.26 tex:54677 mv:2471 misc:1180 imb:5 pmb:521 smb:824 d:- ref:0 ; in:7325 out:7325 type:P dur:82000000 cpbdur:82000000 q:23.07 tex:89230 mv:6277 misc:1165 imb:94 pmb:531 smb:725 d:- ref:0 ; in:7326 out:7326 type:P dur:82000000 cpbdur:82000000 q:21.55 tex:42030 mv:2132 misc:1294 imb:2 pmb:554 smb:794 d:- ref:0 ; in:7327 out:7327 type:P dur:82000000 cpbdur:82000000 q:19.74 tex:42517 mv:2091 misc:1328 imb:6 pmb:621 smb:723 d:- ref:0 ; in:7328 out:7328 type:P dur:82000000 cpbdur:82000000 q:21.86 tex:70890 mv:4419 misc:1059 imb:64 pmb:349 smb:937 d:- ref:0 ; in:7329 out:7329 type:P dur:82000000 cpbdur:82000000 q:19.99 tex:40998 mv:1773 misc:1277 imb:3 pmb:525 smb:822 d:- ref:0 ; in:7330 out:7330 type:P dur:82000000 cpbdur:82000000 q:18.27 tex:65771 mv:2762 misc:1475 imb:7 pmb:812 smb:531 d:- ref:0 ; in:7331 out:7331 type:P dur:82000000 cpbdur:82000000 q:22.27 tex:135921 mv:7223 misc:1328 imb:185 pmb:525 smb:640 d:- ref:0 ; in:7332 out:7332 type:P dur:82000000 cpbdur:82000000 q:22.03 tex:27716 mv:1713 misc:1267 imb:7 pmb:451 smb:892 d:- ref:0 ; in:7333 out:7333 type:P dur:82000000 cpbdur:82000000 q:22.61 tex:67769 mv:7412 misc:1507 imb:215 pmb:734 smb:401 d:- ref:0 ; in:7334 out:7334 type:P dur:82000000 cpbdur:82000000 q:23.56 tex:81980 mv:8436 misc:1480 imb:227 pmb:672 smb:451 d:- ref:0 ; in:7335 out:7335 type:P dur:82000000 cpbdur:82000000 q:23.35 tex:81596 mv:8353 misc:1523 imb:297 pmb:727 smb:326 d:- ref:0 ; in:7336 out:7336 type:P dur:82000000 cpbdur:82000000 q:23.71 tex:73936 mv:7425 misc:1455 imb:140 pmb:651 smb:559 d:- ref:0 ; in:7337 out:7337 type:P dur:82000000 cpbdur:82000000 q:23.25 tex:70292 mv:7239 misc:1525 imb:233 pmb:707 smb:410 d:- ref:0 ; in:7338 out:7338 type:P dur:82000000 cpbdur:82000000 q:23.72 tex:63142 mv:6908 misc:1406 imb:158 pmb:562 smb:630 d:- ref:0 ; in:7339 out:7339 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:48066 mv:5186 misc:1516 imb:182 pmb:656 smb:512 d:- ref:0 ; in:7340 out:7340 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:70437 mv:7375 misc:1388 imb:165 pmb:591 smb:594 d:- ref:0 ; in:7341 out:7341 type:P dur:82000000 cpbdur:82000000 q:22.51 tex:33847 mv:4687 misc:1482 imb:182 pmb:585 smb:583 d:- ref:0 ; in:7342 out:7342 type:P dur:82000000 cpbdur:82000000 q:22.82 tex:61486 mv:7396 misc:1486 imb:221 pmb:614 smb:515 d:- ref:0 ; in:7343 out:7343 type:P dur:82000000 cpbdur:82000000 q:22.68 tex:64652 mv:6453 misc:1415 imb:210 pmb:583 smb:557 d:- ref:0 ; in:7344 out:7344 type:P dur:82000000 cpbdur:82000000 q:22.91 tex:57494 mv:6879 misc:1403 imb:177 pmb:575 smb:598 d:- ref:0 ; in:7345 out:7345 type:P dur:82000000 cpbdur:82000000 q:22.73 tex:69838 mv:7289 misc:1425 imb:250 pmb:619 smb:481 d:- ref:0 ; in:7346 out:7346 type:P dur:82000000 cpbdur:82000000 q:23.07 tex:56933 mv:6178 misc:1409 imb:135 pmb:544 smb:671 d:- ref:0 ; in:7347 out:7347 type:P dur:82000000 cpbdur:82000000 q:22.31 tex:61150 mv:6831 misc:1523 imb:172 pmb:745 smb:433 d:- ref:0 ; in:7348 out:7348 type:P dur:82000000 cpbdur:82000000 q:22.99 tex:70002 mv:7041 misc:1429 imb:211 pmb:509 smb:630 d:- ref:0 ; in:7349 out:7349 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:56597 mv:6244 misc:1495 imb:199 pmb:608 smb:543 d:- ref:0 ; in:7350 out:7350 type:P dur:82000000 cpbdur:82000000 q:23.34 tex:69210 mv:5723 misc:1387 imb:153 pmb:503 smb:694 d:- ref:0 ; in:7351 out:7351 type:P dur:82000000 cpbdur:82000000 q:22.93 tex:56828 mv:4679 misc:1317 imb:144 pmb:521 smb:685 d:- ref:0 ; in:7352 out:7352 type:P dur:82000000 cpbdur:82000000 q:23.89 tex:79580 mv:6487 misc:1357 imb:214 pmb:439 smb:697 d:- ref:0 ; in:7353 out:7353 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:42998 mv:4983 misc:1459 imb:164 pmb:565 smb:621 d:- ref:0 ; in:7354 out:7354 type:P dur:82000000 cpbdur:82000000 q:22.98 tex:52617 mv:5435 misc:1404 imb:141 pmb:505 smb:704 d:- ref:0 ; in:7355 out:7355 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:68576 mv:5910 misc:1466 imb:117 pmb:672 smb:561 d:- ref:0 ; in:7356 out:7356 type:P dur:82000000 cpbdur:82000000 q:23.24 tex:74718 mv:6015 misc:1395 imb:156 pmb:521 smb:673 d:- ref:0 ; in:7357 out:7357 type:P dur:82000000 cpbdur:82000000 q:22.63 tex:47377 mv:4726 misc:1377 imb:146 pmb:506 smb:698 d:- ref:0 ; in:7358 out:7358 type:P dur:82000000 cpbdur:82000000 q:23.76 tex:86748 mv:7577 misc:1371 imb:218 pmb:557 smb:575 d:- ref:0 ; in:7359 out:7359 type:P dur:82000000 cpbdur:82000000 q:22.55 tex:34295 mv:4256 misc:1425 imb:105 pmb:600 smb:645 d:- ref:0 ; in:7360 out:7360 type:P dur:82000000 cpbdur:82000000 q:23.86 tex:90967 mv:7222 misc:1299 imb:171 pmb:556 smb:623 d:- ref:0 ; in:7361 out:7361 type:P dur:82000000 cpbdur:82000000 q:22.46 tex:56881 mv:5346 misc:1533 imb:133 pmb:790 smb:427 d:- ref:0 ; in:7362 out:7362 type:P dur:82000000 cpbdur:82000000 q:23.83 tex:89214 mv:7425 misc:1273 imb:142 pmb:589 smb:619 d:- ref:0 ; in:7363 out:7363 type:P dur:82000000 cpbdur:82000000 q:23.10 tex:56186 mv:5178 misc:1356 imb:77 pmb:686 smb:587 d:- ref:0 ; in:7364 out:7364 type:P dur:82000000 cpbdur:82000000 q:23.23 tex:75741 mv:5190 misc:1317 imb:84 pmb:596 smb:670 d:- ref:0 ; in:7365 out:7365 type:P dur:82000000 cpbdur:82000000 q:23.07 tex:77787 mv:5804 misc:1393 imb:101 pmb:688 smb:561 d:- ref:0 ; in:7366 out:7366 type:P dur:82000000 cpbdur:82000000 q:23.30 tex:81817 mv:6101 misc:1354 imb:121 pmb:645 smb:584 d:- ref:0 ; in:7367 out:7367 type:P dur:82000000 cpbdur:82000000 q:22.06 tex:56150 mv:4511 misc:1475 imb:89 pmb:781 smb:480 d:- ref:0 ; in:7368 out:7368 type:P dur:82000000 cpbdur:82000000 q:22.25 tex:76271 mv:4905 misc:1344 imb:87 pmb:563 smb:700 d:- ref:0 ; in:7369 out:7369 type:P dur:82000000 cpbdur:82000000 q:22.64 tex:78654 mv:5028 misc:1350 imb:77 pmb:620 smb:653 d:- ref:0 ; in:7370 out:7370 type:P dur:82000000 cpbdur:82000000 q:23.10 tex:86923 mv:6183 misc:1246 imb:126 pmb:559 smb:665 d:- ref:0 ; in:7371 out:7371 type:P dur:82000000 cpbdur:82000000 q:22.29 tex:67589 mv:4915 misc:1504 imb:125 pmb:701 smb:524 d:- ref:0 ; in:7372 out:7372 type:P dur:82000000 cpbdur:82000000 q:22.32 tex:69554 mv:5259 misc:1275 imb:154 pmb:457 smb:739 d:- ref:0 ; in:7373 out:7373 type:P dur:82000000 cpbdur:82000000 q:21.98 tex:60114 mv:4128 misc:1374 imb:60 pmb:590 smb:700 d:- ref:0 ; in:7374 out:7374 type:P dur:82000000 cpbdur:82000000 q:22.08 tex:65195 mv:5330 misc:1275 imb:117 pmb:522 smb:711 d:- ref:0 ; in:7375 out:7375 type:P dur:82000000 cpbdur:82000000 q:20.76 tex:41708 mv:3270 misc:1470 imb:70 pmb:616 smb:664 d:- ref:0 ; in:7376 out:7376 type:P dur:82000000 cpbdur:82000000 q:21.02 tex:58384 mv:4477 misc:1371 imb:105 pmb:543 smb:702 d:- ref:0 ; in:7377 out:7377 type:P dur:82000000 cpbdur:82000000 q:20.79 tex:55835 mv:2920 misc:1141 imb:17 pmb:472 smb:861 d:- ref:0 ; in:7378 out:7378 type:P dur:82000000 cpbdur:82000000 q:19.81 tex:30566 mv:2497 misc:1441 imb:43 pmb:565 smb:742 d:- ref:0 ; in:7379 out:7379 type:P dur:82000000 cpbdur:82000000 q:20.56 tex:57302 mv:4446 misc:1284 imb:47 pmb:538 smb:765 d:- ref:0 ; in:7380 out:7380 type:P dur:82000000 cpbdur:82000000 q:20.25 tex:54685 mv:3734 misc:1373 imb:53 pmb:622 smb:675 d:- ref:0 ; in:7381 out:7381 type:P dur:82000000 cpbdur:82000000 q:20.90 tex:55869 mv:4847 misc:1372 imb:96 pmb:573 smb:681 d:- ref:0 ; in:7382 out:7382 type:P dur:82000000 cpbdur:82000000 q:24.90 tex:181596 mv:15066 misc:1418 imb:1194 pmb:156 smb:0 d:- ref:0 ; in:7383 out:7383 type:P dur:82000000 cpbdur:82000000 q:23.93 tex:42378 mv:2954 misc:1204 imb:17 pmb:504 smb:829 d:- ref:0 ; in:7384 out:7384 type:P dur:82000000 cpbdur:82000000 q:21.70 tex:44094 mv:2702 misc:1452 imb:38 pmb:710 smb:602 d:- ref:0 ; in:7385 out:7385 type:P dur:82000000 cpbdur:82000000 q:21.33 tex:72120 mv:3774 misc:1482 imb:49 pmb:704 smb:597 d:- ref:0 ; in:7386 out:7386 type:P dur:82000000 cpbdur:82000000 q:21.14 tex:57727 mv:3298 misc:1359 imb:35 pmb:586 smb:729 d:- ref:0 ; in:7387 out:7387 type:P dur:82000000 cpbdur:82000000 q:19.12 tex:70477 mv:3591 misc:1532 imb:39 pmb:977 smb:334 d:- ref:0 ; in:7388 out:7388 type:P dur:82000000 cpbdur:82000000 q:21.65 tex:73514 mv:4968 misc:1238 imb:51 pmb:592 smb:707 d:- ref:0 ; in:7389 out:7389 type:P dur:82000000 cpbdur:82000000 q:21.15 tex:57530 mv:3779 misc:1379 imb:42 pmb:637 smb:671 d:- ref:0 ; in:7390 out:7390 type:P dur:82000000 cpbdur:82000000 q:21.42 tex:71405 mv:4970 misc:1393 imb:42 pmb:652 smb:656 d:- ref:0 ; in:7391 out:7391 type:P dur:82000000 cpbdur:82000000 q:21.05 tex:54344 mv:3086 misc:1170 imb:16 pmb:494 smb:840 d:- ref:0 ; in:7392 out:7392 type:P dur:82000000 cpbdur:82000000 q:21.33 tex:63832 mv:4727 misc:1361 imb:54 pmb:631 smb:665 d:- ref:0 ; in:7393 out:7393 type:P dur:82000000 cpbdur:82000000 q:21.31 tex:59610 mv:3693 misc:1353 imb:32 pmb:611 smb:707 d:- ref:0 ; in:7394 out:7394 type:P dur:82000000 cpbdur:82000000 q:21.91 tex:66502 mv:5363 misc:1231 imb:58 pmb:563 smb:729 d:- ref:0 ; in:7395 out:7395 type:P dur:82000000 cpbdur:82000000 q:20.65 tex:37451 mv:2571 misc:1338 imb:18 pmb:549 smb:783 d:- ref:0 ; in:7396 out:7396 type:P dur:82000000 cpbdur:82000000 q:20.99 tex:56064 mv:4287 misc:1401 imb:42 pmb:643 smb:665 d:- ref:0 ; in:7397 out:7397 type:P dur:82000000 cpbdur:82000000 q:21.08 tex:61546 mv:4329 misc:1221 imb:37 pmb:551 smb:762 d:- ref:0 ; in:7398 out:7398 type:P dur:82000000 cpbdur:82000000 q:20.12 tex:38164 mv:2669 misc:1431 imb:34 pmb:593 smb:723 d:- ref:0 ; in:7399 out:7399 type:P dur:82000000 cpbdur:82000000 q:20.86 tex:68275 mv:4220 misc:1337 imb:53 pmb:608 smb:689 d:- ref:0 ; in:7400 out:7400 type:P dur:82000000 cpbdur:82000000 q:21.06 tex:64812 mv:3709 misc:1231 imb:39 pmb:553 smb:758 d:- ref:0 ; in:7401 out:7401 type:P dur:82000000 cpbdur:82000000 q:21.22 tex:67786 mv:4292 misc:1386 imb:62 pmb:628 smb:660 d:- ref:0 ; in:7402 out:7402 type:P dur:82000000 cpbdur:82000000 q:20.03 tex:41414 mv:2911 misc:1459 imb:55 pmb:605 smb:690 d:- ref:0 ; in:7403 out:7403 type:P dur:82000000 cpbdur:82000000 q:19.42 tex:79391 mv:4232 misc:1545 imb:58 pmb:868 smb:424 d:- ref:0 ; in:7404 out:7404 type:P dur:82000000 cpbdur:82000000 q:20.51 tex:56340 mv:4108 misc:1240 imb:36 pmb:548 smb:766 d:- ref:0 ; in:7405 out:7405 type:P dur:82000000 cpbdur:82000000 q:20.93 tex:56425 mv:3587 misc:1316 imb:27 pmb:587 smb:736 d:- ref:0 ; in:7406 out:7406 type:P dur:82000000 cpbdur:82000000 q:21.16 tex:63911 mv:4635 misc:1358 imb:32 pmb:623 smb:695 d:- ref:0 ; in:7407 out:7407 type:P dur:82000000 cpbdur:82000000 q:19.76 tex:20457 mv:2046 misc:1361 imb:32 pmb:456 smb:862 d:- ref:0 ; in:7408 out:7408 type:P dur:82000000 cpbdur:82000000 q:20.31 tex:60060 mv:3848 misc:1388 imb:49 pmb:636 smb:665 d:- ref:0 ; in:7409 out:7409 type:P dur:82000000 cpbdur:82000000 q:19.86 tex:33821 mv:2501 misc:1302 imb:27 pmb:501 smb:822 d:- ref:0 ; in:7410 out:7410 type:P dur:82000000 cpbdur:82000000 q:20.63 tex:64367 mv:3929 misc:1264 imb:26 pmb:543 smb:781 d:- ref:0 ; in:7411 out:7411 type:P dur:82000000 cpbdur:82000000 q:19.58 tex:35667 mv:2223 misc:1302 imb:12 pmb:515 smb:823 d:- ref:0 ; in:7412 out:7412 type:P dur:82000000 cpbdur:82000000 q:21.30 tex:76221 mv:4773 misc:1342 imb:57 pmb:641 smb:652 d:- ref:0 ; in:7413 out:7413 type:P dur:82000000 cpbdur:82000000 q:19.82 tex:37152 mv:2033 misc:1303 imb:16 pmb:507 smb:827 d:- ref:0 ; in:7414 out:7414 type:P dur:82000000 cpbdur:82000000 q:20.71 tex:62560 mv:4209 misc:1335 imb:41 pmb:615 smb:694 d:- ref:0 ; in:7415 out:7415 type:P dur:82000000 cpbdur:82000000 q:21.03 tex:58836 mv:3627 misc:1233 imb:31 pmb:519 smb:800 d:- ref:0 ; in:7416 out:7416 type:P dur:82000000 cpbdur:82000000 q:21.00 tex:61458 mv:4350 misc:1312 imb:35 pmb:600 smb:715 d:- ref:0 ; in:7417 out:7417 type:P dur:82000000 cpbdur:82000000 q:20.04 tex:40926 mv:2766 misc:1300 imb:18 pmb:530 smb:802 d:- ref:0 ; in:7418 out:7418 type:P dur:82000000 cpbdur:82000000 q:21.67 tex:73226 mv:4966 misc:1304 imb:52 pmb:578 smb:720 d:- ref:0 ; in:7419 out:7419 type:P dur:82000000 cpbdur:82000000 q:21.09 tex:52225 mv:3483 misc:1404 imb:45 pmb:625 smb:680 d:- ref:0 ; in:7420 out:7420 type:P dur:82000000 cpbdur:82000000 q:21.19 tex:66397 mv:4626 misc:1321 imb:37 pmb:600 smb:713 d:- ref:0 ; in:7421 out:7421 type:P dur:82000000 cpbdur:82000000 q:21.78 tex:63884 mv:3943 misc:1085 imb:25 pmb:467 smb:858 d:- ref:0 ; in:7422 out:7422 type:P dur:82000000 cpbdur:82000000 q:21.69 tex:62884 mv:3629 misc:1279 imb:30 pmb:555 smb:765 d:- ref:0 ; in:7423 out:7423 type:P dur:82000000 cpbdur:82000000 q:21.76 tex:57980 mv:4680 misc:1316 imb:31 pmb:630 smb:689 d:- ref:0 ; in:7424 out:7424 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:55141 mv:3239 misc:1036 imb:29 pmb:415 smb:906 d:- ref:0 ; in:7425 out:7425 type:P dur:82000000 cpbdur:82000000 q:21.44 tex:68449 mv:5222 misc:1393 imb:49 pmb:668 smb:633 d:- ref:0 ; in:7426 out:7426 type:P dur:82000000 cpbdur:82000000 q:21.15 tex:58121 mv:3730 misc:1365 imb:35 pmb:596 smb:719 d:- ref:0 ; in:7427 out:7427 type:P dur:82000000 cpbdur:82000000 q:21.97 tex:74174 mv:5351 misc:1307 imb:50 pmb:617 smb:683 d:- ref:0 ; in:7428 out:7428 type:P dur:82000000 cpbdur:82000000 q:20.62 tex:39483 mv:2712 misc:1389 imb:28 pmb:550 smb:772 d:- ref:0 ; in:7429 out:7429 type:P dur:82000000 cpbdur:82000000 q:20.83 tex:64322 mv:3955 misc:1267 imb:41 pmb:573 smb:736 d:- ref:0 ; in:7430 out:7430 type:P dur:82000000 cpbdur:82000000 q:21.56 tex:66700 mv:4923 misc:1305 imb:38 pmb:603 smb:709 d:- ref:0 ; in:7431 out:7431 type:P dur:82000000 cpbdur:82000000 q:21.52 tex:64756 mv:4488 misc:1300 imb:30 pmb:582 smb:738 d:- ref:0 ; in:7432 out:7432 type:P dur:82000000 cpbdur:82000000 q:20.27 tex:45593 mv:3208 misc:1479 imb:40 pmb:664 smb:646 d:- ref:0 ; in:7433 out:7433 type:P dur:82000000 cpbdur:82000000 q:21.19 tex:74102 mv:4219 misc:1127 imb:42 pmb:535 smb:773 d:- ref:0 ; in:7434 out:7434 type:P dur:82000000 cpbdur:82000000 q:21.34 tex:69630 mv:4617 misc:1305 imb:28 pmb:609 smb:713 d:- ref:0 ; in:7435 out:7435 type:P dur:82000000 cpbdur:82000000 q:21.43 tex:65209 mv:4834 misc:1317 imb:48 pmb:614 smb:688 d:- ref:0 ; in:7436 out:7436 type:P dur:82000000 cpbdur:82000000 q:21.76 tex:69018 mv:4389 misc:1185 imb:27 pmb:551 smb:772 d:- ref:0 ; in:7437 out:7437 type:P dur:82000000 cpbdur:82000000 q:21.09 tex:54667 mv:3285 misc:1352 imb:34 pmb:589 smb:727 d:- ref:0 ; in:7438 out:7438 type:P dur:82000000 cpbdur:82000000 q:21.06 tex:70807 mv:3842 misc:1311 imb:32 pmb:588 smb:730 d:- ref:0 ; in:7439 out:7439 type:P dur:82000000 cpbdur:82000000 q:21.00 tex:60546 mv:3228 misc:1098 imb:23 pmb:476 smb:851 d:- ref:0 ; in:7440 out:7440 type:P dur:82000000 cpbdur:82000000 q:21.42 tex:69894 mv:4721 misc:1297 imb:41 pmb:623 smb:686 d:- ref:0 ; in:7441 out:7441 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:54728 mv:3993 misc:1255 imb:31 pmb:577 smb:742 d:- ref:0 ; in:7442 out:7442 type:P dur:82000000 cpbdur:82000000 q:21.27 tex:59718 mv:4069 misc:1389 imb:33 pmb:615 smb:702 d:- ref:0 ; in:7443 out:7443 type:P dur:82000000 cpbdur:82000000 q:21.20 tex:69034 mv:3982 misc:1304 imb:38 pmb:574 smb:738 d:- ref:0 ; in:7444 out:7444 type:P dur:82000000 cpbdur:82000000 q:21.26 tex:71859 mv:4196 misc:1361 imb:45 pmb:608 smb:697 d:- ref:0 ; in:7445 out:7445 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:67031 mv:4716 misc:1213 imb:36 pmb:578 smb:736 d:- ref:0 ; in:7446 out:7446 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:51143 mv:3150 misc:1443 imb:31 pmb:664 smb:655 d:- ref:0 ; in:7447 out:7447 type:P dur:82000000 cpbdur:82000000 q:21.02 tex:68221 mv:4522 misc:1321 imb:52 pmb:596 smb:702 d:- ref:0 ; in:7448 out:7448 type:P dur:82000000 cpbdur:82000000 q:21.33 tex:62905 mv:3887 misc:1248 imb:52 pmb:523 smb:775 d:- ref:0 ; in:7449 out:7449 type:P dur:82000000 cpbdur:82000000 q:21.27 tex:69695 mv:4277 misc:1260 imb:39 pmb:581 smb:730 d:- ref:0 ; in:7450 out:7450 type:P dur:82000000 cpbdur:82000000 q:21.39 tex:64310 mv:4301 misc:1389 imb:47 pmb:621 smb:682 d:- ref:0 ; in:7451 out:7451 type:P dur:82000000 cpbdur:82000000 q:21.77 tex:68719 mv:4625 misc:1224 imb:52 pmb:541 smb:757 d:- ref:0 ; in:7452 out:7452 type:P dur:82000000 cpbdur:82000000 q:21.00 tex:57702 mv:3658 misc:1392 imb:40 pmb:610 smb:700 d:- ref:0 ; in:7453 out:7453 type:P dur:82000000 cpbdur:82000000 q:21.26 tex:73440 mv:4417 misc:1271 imb:28 pmb:597 smb:725 d:- ref:0 ; in:7454 out:7454 type:P dur:82000000 cpbdur:82000000 q:21.66 tex:64490 mv:4449 misc:1269 imb:33 pmb:571 smb:746 d:- ref:0 ; in:7455 out:7455 type:P dur:82000000 cpbdur:82000000 q:21.41 tex:64606 mv:4141 misc:1429 imb:45 pmb:643 smb:662 d:- ref:0 ; in:7456 out:7456 type:P dur:82000000 cpbdur:82000000 q:21.46 tex:58250 mv:4675 misc:1435 imb:67 pmb:631 smb:652 d:- ref:0 ; in:7457 out:7457 type:P dur:82000000 cpbdur:82000000 q:21.28 tex:62125 mv:3524 misc:1215 imb:22 pmb:522 smb:806 d:- ref:0 ; in:7458 out:7458 type:P dur:82000000 cpbdur:82000000 q:21.37 tex:67332 mv:4363 misc:1265 imb:28 pmb:583 smb:739 d:- ref:0 ; in:7459 out:7459 type:P dur:82000000 cpbdur:82000000 q:20.71 tex:42913 mv:2604 misc:1243 imb:24 pmb:484 smb:842 d:- ref:0 ; in:7460 out:7460 type:P dur:82000000 cpbdur:82000000 q:21.36 tex:75695 mv:4796 misc:1301 imb:29 pmb:598 smb:723 d:- ref:0 ; in:7461 out:7461 type:P dur:82000000 cpbdur:82000000 q:21.08 tex:54357 mv:3292 misc:1359 imb:33 pmb:564 smb:753 d:- ref:0 ; in:7462 out:7462 type:P dur:82000000 cpbdur:82000000 q:20.19 tex:54396 mv:2953 misc:1403 imb:26 pmb:623 smb:701 d:- ref:0 ; in:7463 out:7463 type:P dur:82000000 cpbdur:82000000 q:21.36 tex:78736 mv:4795 misc:1165 imb:61 pmb:529 smb:760 d:- ref:0 ; in:7464 out:7464 type:P dur:82000000 cpbdur:82000000 q:21.42 tex:69858 mv:4023 misc:1295 imb:24 pmb:589 smb:737 d:- ref:0 ; in:7465 out:7465 type:P dur:82000000 cpbdur:82000000 q:21.59 tex:57870 mv:4766 misc:1340 imb:49 pmb:600 smb:701 d:- ref:0 ; in:7466 out:7466 type:P dur:82000000 cpbdur:82000000 q:22.12 tex:70779 mv:5213 misc:1392 imb:52 pmb:625 smb:673 d:- ref:0 ; in:7467 out:7467 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:55451 mv:3610 misc:1259 imb:26 pmb:560 smb:764 d:- ref:0 ; in:7468 out:7468 type:P dur:82000000 cpbdur:82000000 q:21.04 tex:66424 mv:3975 misc:1393 imb:46 pmb:629 smb:675 d:- ref:0 ; in:7469 out:7469 type:P dur:82000000 cpbdur:82000000 q:21.20 tex:58165 mv:3324 misc:1279 imb:21 pmb:556 smb:773 d:- ref:0 ; in:7470 out:7470 type:P dur:82000000 cpbdur:82000000 q:21.59 tex:64510 mv:4498 misc:1320 imb:41 pmb:576 smb:733 d:- ref:0 ; in:7471 out:7471 type:P dur:82000000 cpbdur:82000000 q:20.57 tex:38008 mv:2683 misc:1373 imb:31 pmb:579 smb:740 d:- ref:0 ; in:7472 out:7472 type:P dur:82000000 cpbdur:82000000 q:21.75 tex:75318 mv:5668 misc:1206 imb:48 pmb:576 smb:726 d:- ref:0 ; in:7473 out:7473 type:P dur:82000000 cpbdur:82000000 q:20.36 tex:44434 mv:2664 misc:1406 imb:31 pmb:612 smb:707 d:- ref:0 ; in:7474 out:7474 type:P dur:82000000 cpbdur:82000000 q:21.01 tex:68585 mv:4429 misc:1338 imb:44 pmb:615 smb:691 d:- ref:0 ; in:7475 out:7475 type:P dur:82000000 cpbdur:82000000 q:21.39 tex:66136 mv:3962 misc:1254 imb:28 pmb:538 smb:784 d:- ref:0 ; in:7476 out:7476 type:P dur:82000000 cpbdur:82000000 q:21.29 tex:52875 mv:3962 misc:1339 imb:38 pmb:622 smb:690 d:- ref:0 ; in:7477 out:7477 type:P dur:82000000 cpbdur:82000000 q:20.10 tex:43448 mv:2466 misc:1310 imb:27 pmb:538 smb:785 d:- ref:0 ; in:7478 out:7478 type:P dur:82000000 cpbdur:82000000 q:20.70 tex:53230 mv:3556 misc:1318 imb:34 pmb:546 smb:770 d:- ref:0 ; in:7479 out:7479 type:P dur:82000000 cpbdur:82000000 q:21.18 tex:67720 mv:4694 misc:1330 imb:37 pmb:634 smb:679 d:- ref:0 ; in:7480 out:7480 type:P dur:82000000 cpbdur:82000000 q:21.36 tex:72685 mv:5026 misc:1297 imb:34 pmb:636 smb:680 d:- ref:0 ; in:7481 out:7481 type:P dur:82000000 cpbdur:82000000 q:21.67 tex:56449 mv:3821 misc:1154 imb:36 pmb:495 smb:819 d:- ref:0 ; in:7482 out:7482 type:P dur:82000000 cpbdur:82000000 q:21.42 tex:70716 mv:4475 misc:1353 imb:52 pmb:617 smb:681 d:- ref:0 ; in:7483 out:7483 type:P dur:82000000 cpbdur:82000000 q:20.27 tex:39445 mv:2557 misc:1422 imb:24 pmb:583 smb:743 d:- ref:0 ; in:7484 out:7484 type:P dur:82000000 cpbdur:82000000 q:20.66 tex:59343 mv:3912 misc:1313 imb:45 pmb:574 smb:731 d:- ref:0 ; in:7485 out:7485 type:P dur:82000000 cpbdur:82000000 q:19.92 tex:55198 mv:2942 misc:1332 imb:31 pmb:574 smb:745 d:- ref:0 ; in:7486 out:7486 type:P dur:82000000 cpbdur:82000000 q:20.92 tex:68808 mv:5205 misc:1411 imb:92 pmb:639 smb:619 d:- ref:0 ; in:7487 out:7487 type:P dur:82000000 cpbdur:82000000 q:20.98 tex:53467 mv:4401 misc:1340 imb:70 pmb:561 smb:719 d:- ref:0 ; in:7488 out:7488 type:P dur:82000000 cpbdur:82000000 q:19.68 tex:36330 mv:2255 misc:1303 imb:34 pmb:491 smb:825 d:- ref:0 ; in:7489 out:7489 type:P dur:82000000 cpbdur:82000000 q:20.70 tex:65202 mv:4373 misc:1313 imb:51 pmb:583 smb:716 d:- ref:0 ; in:7490 out:7490 type:P dur:82000000 cpbdur:82000000 q:24.70 tex:273188 mv:15855 misc:1413 imb:1209 pmb:141 smb:0 d:- ref:0 ; in:7491 out:7491 type:P dur:82000000 cpbdur:82000000 q:25.76 tex:44172 mv:6321 misc:1379 imb:30 pmb:635 smb:685 d:- ref:0 ; in:7492 out:7492 type:P dur:82000000 cpbdur:82000000 q:24.70 tex:59081 mv:7895 misc:1432 imb:45 pmb:793 smb:512 d:- ref:0 ; in:7493 out:7493 type:P dur:82000000 cpbdur:82000000 q:23.92 tex:70790 mv:7518 misc:1436 imb:61 pmb:810 smb:479 d:- ref:0 ; in:7494 out:7494 type:P dur:82000000 cpbdur:82000000 q:23.69 tex:69108 mv:7879 misc:1445 imb:59 pmb:817 smb:474 d:- ref:0 ; in:7495 out:7495 type:P dur:82000000 cpbdur:82000000 q:23.38 tex:86045 mv:7947 misc:1464 imb:107 pmb:849 smb:394 d:- ref:0 ; in:7496 out:7496 type:P dur:82000000 cpbdur:82000000 q:23.38 tex:83625 mv:8496 misc:1455 imb:92 pmb:852 smb:406 d:- ref:0 ; in:7497 out:7497 type:P dur:82000000 cpbdur:82000000 q:23.34 tex:82594 mv:7768 misc:1462 imb:76 pmb:832 smb:442 d:- ref:0 ; in:7498 out:7498 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:83491 mv:7806 misc:1455 imb:72 pmb:822 smb:456 d:- ref:0 ; in:7499 out:7499 type:P dur:82000000 cpbdur:82000000 q:23.20 tex:81380 mv:7502 misc:1430 imb:88 pmb:812 smb:450 d:- ref:0 ; in:7500 out:7500 type:I dur:82000000 cpbdur:82000000 q:19.21 tex:455386 mv:13808 misc:374 imb:1350 pmb:0 smb:0 d:- ref:; in:7501 out:7501 type:P dur:82000000 cpbdur:82000000 q:26.10 tex:41609 mv:5889 misc:1374 imb:13 pmb:637 smb:700 d:- ref:0 ; in:7502 out:7502 type:P dur:82000000 cpbdur:82000000 q:24.98 tex:62379 mv:6855 misc:1406 imb:31 pmb:771 smb:548 d:- ref:0 ; in:7503 out:7503 type:P dur:82000000 cpbdur:82000000 q:24.26 tex:72667 mv:7404 misc:1417 imb:29 pmb:828 smb:493 d:- ref:0 ; in:7504 out:7504 type:P dur:82000000 cpbdur:82000000 q:23.91 tex:72594 mv:7692 misc:1426 imb:34 pmb:830 smb:486 d:- ref:0 ; in:7505 out:7505 type:P dur:82000000 cpbdur:82000000 q:23.63 tex:74474 mv:7392 misc:1438 imb:50 pmb:836 smb:464 d:- ref:0 ; in:7506 out:7506 type:P dur:82000000 cpbdur:82000000 q:23.60 tex:76312 mv:7605 misc:1443 imb:42 pmb:845 smb:463 d:- ref:0 ; in:7507 out:7507 type:P dur:82000000 cpbdur:82000000 q:23.39 tex:94538 mv:7628 misc:1450 imb:69 pmb:888 smb:393 d:- ref:0 ; in:7508 out:7508 type:P dur:82000000 cpbdur:82000000 q:23.43 tex:88813 mv:8093 misc:1438 imb:68 pmb:891 smb:391 d:- ref:0 ; in:7509 out:7509 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:89828 mv:7499 misc:1433 imb:49 pmb:873 smb:428 d:- ref:0 ; in:7510 out:7510 type:P dur:82000000 cpbdur:82000000 q:23.37 tex:88997 mv:7668 misc:1423 imb:63 pmb:872 smb:415 d:- ref:0 ; in:7511 out:7511 type:P dur:82000000 cpbdur:82000000 q:23.47 tex:97942 mv:7906 misc:1424 imb:57 pmb:876 smb:417 d:- ref:0 ; in:7512 out:7512 type:P dur:82000000 cpbdur:82000000 q:23.67 tex:75797 mv:7620 misc:1415 imb:40 pmb:830 smb:480 d:- ref:0 ; in:7513 out:7513 type:P dur:82000000 cpbdur:82000000 q:23.54 tex:79544 mv:7006 misc:1386 imb:31 pmb:818 smb:501 d:- ref:0 ; in:7514 out:7514 type:P dur:82000000 cpbdur:82000000 q:23.55 tex:79807 mv:7316 misc:1429 imb:49 pmb:848 smb:453 d:- ref:0 ; in:7515 out:7515 type:P dur:82000000 cpbdur:82000000 q:23.62 tex:86280 mv:7601 misc:1407 imb:47 pmb:843 smb:460 d:- ref:0 ; in:7516 out:7516 type:P dur:82000000 cpbdur:82000000 q:23.63 tex:84412 mv:7492 misc:1432 imb:63 pmb:884 smb:403 d:- ref:0 ; in:7517 out:7517 type:P dur:82000000 cpbdur:82000000 q:23.73 tex:88870 mv:7814 misc:1420 imb:55 pmb:870 smb:425 d:- ref:0 ; in:7518 out:7518 type:P dur:82000000 cpbdur:82000000 q:23.84 tex:89232 mv:7819 misc:1413 imb:59 pmb:863 smb:428 d:- ref:0 ; in:7519 out:7519 type:P dur:82000000 cpbdur:82000000 q:23.61 tex:81319 mv:7218 misc:1415 imb:64 pmb:842 smb:444 d:- ref:0 ; in:7520 out:7520 type:P dur:82000000 cpbdur:82000000 q:23.74 tex:87403 mv:7962 misc:1435 imb:96 pmb:844 smb:410 d:- ref:0 ; in:7521 out:7521 type:P dur:82000000 cpbdur:82000000 q:23.74 tex:91030 mv:7207 misc:1411 imb:56 pmb:865 smb:429 d:- ref:0 ; in:7522 out:7522 type:P dur:82000000 cpbdur:82000000 q:23.78 tex:83547 mv:7508 misc:1409 imb:55 pmb:842 smb:453 d:- ref:0 ; in:7523 out:7523 type:P dur:82000000 cpbdur:82000000 q:23.65 tex:85835 mv:7400 misc:1429 imb:56 pmb:840 smb:454 d:- ref:0 ; in:7524 out:7524 type:P dur:82000000 cpbdur:82000000 q:23.77 tex:88337 mv:8262 misc:1417 imb:67 pmb:856 smb:427 d:- ref:0 ; in:7525 out:7525 type:P dur:82000000 cpbdur:82000000 q:23.61 tex:87674 mv:7740 misc:1426 imb:57 pmb:866 smb:427 d:- ref:0 ; in:7526 out:7526 type:P dur:82000000 cpbdur:82000000 q:23.70 tex:85109 mv:7744 misc:1435 imb:72 pmb:862 smb:416 d:- ref:0 ; in:7527 out:7527 type:P dur:82000000 cpbdur:82000000 q:23.56 tex:81814 mv:7282 misc:1424 imb:61 pmb:832 smb:457 d:- ref:0 ; in:7528 out:7528 type:P dur:82000000 cpbdur:82000000 q:23.60 tex:87150 mv:7455 misc:1451 imb:54 pmb:861 smb:435 d:- ref:0 ; in:7529 out:7529 type:P dur:82000000 cpbdur:82000000 q:23.66 tex:87254 mv:7872 misc:1434 imb:91 pmb:870 smb:389 d:- ref:0 ; in:7530 out:7530 type:P dur:82000000 cpbdur:82000000 q:23.69 tex:85153 mv:7712 misc:1447 imb:71 pmb:880 smb:399 d:- ref:0 ; in:7531 out:7531 type:P dur:82000000 cpbdur:82000000 q:23.65 tex:84934 mv:7905 misc:1433 imb:79 pmb:865 smb:406 d:- ref:0 ; in:7532 out:7532 type:P dur:82000000 cpbdur:82000000 q:23.72 tex:84843 mv:7795 misc:1434 imb:60 pmb:865 smb:425 d:- ref:0 ; in:7533 out:7533 type:P dur:82000000 cpbdur:82000000 q:23.63 tex:85773 mv:7712 misc:1451 imb:69 pmb:878 smb:403 d:- ref:0 ; in:7534 out:7534 type:P dur:82000000 cpbdur:82000000 q:23.53 tex:80114 mv:7294 misc:1448 imb:48 pmb:868 smb:434 d:- ref:0 ; in:7535 out:7535 type:P dur:82000000 cpbdur:82000000 q:23.58 tex:87105 mv:7965 misc:1434 imb:48 pmb:895 smb:407 d:- ref:0 ; in:7536 out:7536 type:P dur:82000000 cpbdur:82000000 q:23.65 tex:84230 mv:7214 misc:1436 imb:49 pmb:862 smb:439 d:- ref:0 ; in:7537 out:7537 type:P dur:82000000 cpbdur:82000000 q:23.53 tex:84857 mv:7518 misc:1441 imb:57 pmb:874 smb:419 d:- ref:0 ; in:7538 out:7538 type:P dur:82000000 cpbdur:82000000 q:23.66 tex:82454 mv:8084 misc:1430 imb:60 pmb:874 smb:416 d:- ref:0 ; in:7539 out:7539 type:P dur:82000000 cpbdur:82000000 q:23.71 tex:86257 mv:7356 misc:1419 imb:45 pmb:874 smb:431 d:- ref:0 ; in:7540 out:7540 type:P dur:82000000 cpbdur:82000000 q:23.67 tex:86198 mv:7313 misc:1425 imb:45 pmb:851 smb:454 d:- ref:0 ; in:7541 out:7541 type:P dur:82000000 cpbdur:82000000 q:23.69 tex:78126 mv:7876 misc:1430 imb:41 pmb:896 smb:413 d:- ref:0 ; in:7542 out:7542 type:P dur:82000000 cpbdur:82000000 q:23.74 tex:82336 mv:7963 misc:1461 imb:67 pmb:895 smb:388 d:- ref:0 ; in:7543 out:7543 type:P dur:82000000 cpbdur:82000000 q:23.62 tex:82131 mv:7874 misc:1467 imb:40 pmb:896 smb:414 d:- ref:0 ; in:7544 out:7544 type:P dur:82000000 cpbdur:82000000 q:23.68 tex:84395 mv:8239 misc:1454 imb:47 pmb:917 smb:386 d:- ref:0 ; in:7545 out:7545 type:P dur:82000000 cpbdur:82000000 q:23.66 tex:85214 mv:7874 misc:1424 imb:56 pmb:900 smb:394 d:- ref:0 ; in:7546 out:7546 type:P dur:82000000 cpbdur:82000000 q:23.68 tex:89477 mv:7423 misc:1436 imb:62 pmb:871 smb:417 d:- ref:0 ; in:7547 out:7547 type:P dur:82000000 cpbdur:82000000 q:23.67 tex:83649 mv:8270 misc:1449 imb:77 pmb:886 smb:387 d:- ref:0 ; in:7548 out:7548 type:P dur:82000000 cpbdur:82000000 q:23.61 tex:82205 mv:8020 misc:1423 imb:55 pmb:874 smb:421 d:- ref:0 ; in:7549 out:7549 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:83373 mv:7567 misc:1444 imb:62 pmb:883 smb:405 d:- ref:0 ; in:7550 out:7550 type:P dur:82000000 cpbdur:82000000 q:23.54 tex:77383 mv:8233 misc:1456 imb:87 pmb:891 smb:372 d:- ref:0 ; in:7551 out:7551 type:P dur:82000000 cpbdur:82000000 q:23.47 tex:104723 mv:8259 misc:1490 imb:91 pmb:955 smb:304 d:- ref:0 ; in:7552 out:7552 type:P dur:82000000 cpbdur:82000000 q:23.50 tex:97252 mv:7873 misc:1483 imb:63 pmb:913 smb:374 d:- ref:0 ; in:7553 out:7553 type:P dur:82000000 cpbdur:82000000 q:23.48 tex:96625 mv:7574 misc:1449 imb:62 pmb:892 smb:396 d:- ref:0 ; in:7554 out:7554 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:94552 mv:8103 misc:1473 imb:56 pmb:927 smb:367 d:- ref:0 ; in:7555 out:7555 type:P dur:82000000 cpbdur:82000000 q:23.56 tex:74551 mv:6835 misc:1454 imb:32 pmb:841 smb:477 d:- ref:0 ; in:7556 out:7556 type:P dur:82000000 cpbdur:82000000 q:23.59 tex:77415 mv:7649 misc:1480 imb:42 pmb:893 smb:415 d:- ref:0 ; in:7557 out:7557 type:P dur:82000000 cpbdur:82000000 q:23.49 tex:100443 mv:8469 misc:1488 imb:85 pmb:947 smb:318 d:- ref:0 ; in:7558 out:7558 type:P dur:82000000 cpbdur:82000000 q:23.48 tex:95253 mv:7868 misc:1471 imb:38 pmb:920 smb:392 d:- ref:0 ; in:7559 out:7559 type:P dur:82000000 cpbdur:82000000 q:26.36 tex:195512 mv:15459 misc:1413 imb:1305 pmb:45 smb:0 d:- ref:0 ; in:7560 out:7560 type:P dur:82000000 cpbdur:82000000 q:26.97 tex:163543 mv:17053 misc:1420 imb:1122 pmb:213 smb:15 d:- ref:0 ; in:7561 out:7561 type:P dur:82000000 cpbdur:82000000 q:27.27 tex:154046 mv:15601 misc:1433 imb:929 pmb:319 smb:102 d:- ref:0 ; in:7562 out:7562 type:P dur:82000000 cpbdur:82000000 q:27.17 tex:125700 mv:15945 misc:1427 imb:892 pmb:399 smb:59 d:- ref:0 ; in:7563 out:7563 type:P dur:82000000 cpbdur:82000000 q:26.79 tex:91722 mv:15320 misc:1446 imb:773 pmb:470 smb:107 d:- ref:0 ; in:7564 out:7564 type:P dur:82000000 cpbdur:82000000 q:26.71 tex:107365 mv:15182 misc:1429 imb:953 pmb:376 smb:21 d:- ref:0 ; in:7565 out:7565 type:P dur:82000000 cpbdur:82000000 q:26.10 tex:85072 mv:13727 misc:1401 imb:731 pmb:393 smb:226 d:- ref:0 ; in:7566 out:7566 type:P dur:82000000 cpbdur:82000000 q:25.96 tex:106303 mv:16345 misc:1432 imb:988 pmb:309 smb:53 d:- ref:0 ; in:7567 out:7567 type:P dur:82000000 cpbdur:82000000 q:26.15 tex:107715 mv:15915 misc:1442 imb:830 pmb:463 smb:57 d:- ref:0 ; in:7568 out:7568 type:P dur:82000000 cpbdur:82000000 q:26.42 tex:119353 mv:16420 misc:1419 imb:884 pmb:454 smb:12 d:- ref:0 ; in:7569 out:7569 type:P dur:82000000 cpbdur:82000000 q:26.72 tex:121907 mv:16034 misc:1443 imb:823 pmb:474 smb:53 d:- ref:0 ; in:7570 out:7570 type:P dur:82000000 cpbdur:82000000 q:26.82 tex:108837 mv:15777 misc:1442 imb:739 pmb:537 smb:74 d:- ref:0 ; in:7571 out:7571 type:P dur:82000000 cpbdur:82000000 q:26.55 tex:101951 mv:16047 misc:1434 imb:834 pmb:461 smb:55 d:- ref:0 ; in:7572 out:7572 type:P dur:82000000 cpbdur:82000000 q:26.63 tex:111841 mv:15282 misc:1437 imb:935 pmb:360 smb:55 d:- ref:0 ; in:7573 out:7573 type:P dur:82000000 cpbdur:82000000 q:26.24 tex:108045 mv:15815 misc:1428 imb:1022 pmb:295 smb:33 d:- ref:0 ; in:7574 out:7574 type:P dur:82000000 cpbdur:82000000 q:25.93 tex:94288 mv:15975 misc:1449 imb:824 pmb:439 smb:87 d:- ref:0 ; in:7575 out:7575 type:P dur:82000000 cpbdur:82000000 q:25.44 tex:99191 mv:16031 misc:1442 imb:879 pmb:407 smb:64 d:- ref:0 ; in:7576 out:7576 type:P dur:82000000 cpbdur:82000000 q:25.60 tex:93594 mv:14400 misc:1430 imb:948 pmb:280 smb:122 d:- ref:0 ; in:7577 out:7577 type:P dur:82000000 cpbdur:82000000 q:25.22 tex:91286 mv:14829 misc:1437 imb:783 pmb:441 smb:126 d:- ref:0 ; in:7578 out:7578 type:P dur:82000000 cpbdur:82000000 q:26.03 tex:129206 mv:15911 misc:1435 imb:923 pmb:355 smb:72 d:- ref:0 ; in:7579 out:7579 type:P dur:82000000 cpbdur:82000000 q:24.75 tex:15139 mv:11289 misc:1420 imb:1349 pmb:1 smb:0 d:- ref:0 ; in:7580 out:7580 type:P dur:82000000 cpbdur:82000000 q:23.61 tex:16761 mv:12237 misc:1418 imb:1341 pmb:9 smb:0 d:- ref:0 ; in:7581 out:7581 type:P dur:82000000 cpbdur:82000000 q:23.38 tex:43794 mv:13676 misc:1410 imb:1334 pmb:16 smb:0 d:- ref:0 ; in:7582 out:7582 type:P dur:82000000 cpbdur:82000000 q:23.03 tex:39972 mv:14165 misc:1415 imb:1297 pmb:53 smb:0 d:- ref:0 ; in:7583 out:7583 type:P dur:82000000 cpbdur:82000000 q:23.99 tex:93246 mv:16548 misc:1414 imb:1111 pmb:232 smb:7 d:- ref:0 ; in:7584 out:7584 type:P dur:82000000 cpbdur:82000000 q:24.98 tex:123044 mv:16532 misc:1424 imb:881 pmb:448 smb:21 d:- ref:0 ; in:7585 out:7585 type:P dur:82000000 cpbdur:82000000 q:25.81 tex:129424 mv:15725 misc:1419 imb:756 pmb:577 smb:17 d:- ref:0 ; in:7586 out:7586 type:P dur:82000000 cpbdur:82000000 q:26.91 tex:187974 mv:15756 misc:1422 imb:896 pmb:454 smb:0 d:- ref:0 ; in:7587 out:7587 type:P dur:82000000 cpbdur:82000000 q:27.85 tex:209845 mv:16626 misc:1417 imb:944 pmb:406 smb:0 d:- ref:0 ; in:7588 out:7588 type:P dur:82000000 cpbdur:82000000 q:27.30 tex:140379 mv:14331 misc:1450 imb:700 pmb:575 smb:75 d:- ref:0 ; in:7589 out:7589 type:P dur:82000000 cpbdur:82000000 q:27.21 tex:160646 mv:16110 misc:1444 imb:787 pmb:510 smb:53 d:- ref:0 ; in:7590 out:7590 type:P dur:82000000 cpbdur:82000000 q:27.24 tex:160683 mv:16123 misc:1442 imb:750 pmb:539 smb:61 d:- ref:0 ; in:7591 out:7591 type:P dur:82000000 cpbdur:82000000 q:27.56 tex:166395 mv:15908 misc:1441 imb:724 pmb:518 smb:108 d:- ref:0 ; in:7592 out:7592 type:P dur:82000000 cpbdur:82000000 q:27.18 tex:144532 mv:13856 misc:1460 imb:659 pmb:590 smb:101 d:- ref:0 ; in:7593 out:7593 type:P dur:82000000 cpbdur:82000000 q:26.94 tex:131891 mv:13631 misc:1462 imb:660 pmb:563 smb:127 d:- ref:0 ; in:7594 out:7594 type:P dur:82000000 cpbdur:82000000 q:26.71 tex:129399 mv:13795 misc:1462 imb:662 pmb:567 smb:121 d:- ref:0 ; in:7595 out:7595 type:P dur:82000000 cpbdur:82000000 q:26.98 tex:163186 mv:15524 misc:1450 imb:695 pmb:566 smb:89 d:- ref:0 ; in:7596 out:7596 type:P dur:82000000 cpbdur:82000000 q:27.15 tex:160258 mv:14455 misc:1463 imb:621 pmb:595 smb:134 d:- ref:0 ; in:7597 out:7597 type:P dur:82000000 cpbdur:82000000 q:26.96 tex:135060 mv:13144 misc:1460 imb:524 pmb:642 smb:184 d:- ref:0 ; in:7598 out:7598 type:P dur:82000000 cpbdur:82000000 q:26.82 tex:129878 mv:12690 misc:1456 imb:504 pmb:680 smb:166 d:- ref:0 ; in:7599 out:7599 type:P dur:82000000 cpbdur:82000000 q:27.20 tex:175822 mv:15649 misc:1449 imb:684 pmb:565 smb:101 d:- ref:0 ; in:7600 out:7600 type:P dur:82000000 cpbdur:82000000 q:27.15 tex:152552 mv:14430 misc:1458 imb:633 pmb:564 smb:153 d:- ref:0 ; in:7601 out:7601 type:P dur:82000000 cpbdur:82000000 q:27.14 tex:150716 mv:13746 misc:1466 imb:604 pmb:630 smb:116 d:- ref:0 ; in:7602 out:7602 type:P dur:82000000 cpbdur:82000000 q:26.95 tex:139243 mv:13477 misc:1480 imb:597 pmb:589 smb:164 d:- ref:0 ; in:7603 out:7603 type:P dur:82000000 cpbdur:82000000 q:27.16 tex:163841 mv:15018 misc:1461 imb:643 pmb:596 smb:111 d:- ref:0 ; in:7604 out:7604 type:P dur:82000000 cpbdur:82000000 q:26.89 tex:134516 mv:13296 misc:1452 imb:698 pmb:530 smb:122 d:- ref:0 ; in:7605 out:7605 type:P dur:82000000 cpbdur:82000000 q:27.02 tex:159102 mv:15302 misc:1452 imb:702 pmb:564 smb:84 d:- ref:0 ; in:7606 out:7606 type:P dur:82000000 cpbdur:82000000 q:27.10 tex:153905 mv:15001 misc:1454 imb:666 pmb:569 smb:115 d:- ref:0 ; in:7607 out:7607 type:P dur:82000000 cpbdur:82000000 q:27.47 tex:185945 mv:16184 misc:1455 imb:699 pmb:572 smb:79 d:- ref:0 ; in:7608 out:7608 type:P dur:82000000 cpbdur:82000000 q:27.24 tex:152262 mv:14874 misc:1456 imb:598 pmb:638 smb:114 d:- ref:0 ; in:7609 out:7609 type:P dur:82000000 cpbdur:82000000 q:27.33 tex:176173 mv:15560 misc:1427 imb:649 pmb:608 smb:93 d:- ref:0 ; in:7610 out:7610 type:P dur:82000000 cpbdur:82000000 q:27.09 tex:144746 mv:14897 misc:1453 imb:628 pmb:597 smb:125 d:- ref:0 ; in:7611 out:7611 type:P dur:82000000 cpbdur:82000000 q:27.44 tex:182299 mv:17877 misc:1416 imb:1087 pmb:263 smb:0 d:- ref:0 ; in:7612 out:7612 type:P dur:82000000 cpbdur:82000000 q:27.47 tex:146148 mv:16366 misc:1438 imb:1009 pmb:292 smb:49 d:- ref:0 ; in:7613 out:7613 type:P dur:82000000 cpbdur:82000000 q:27.55 tex:133416 mv:15735 misc:1449 imb:830 pmb:389 smb:131 d:- ref:0 ; in:7614 out:7614 type:P dur:82000000 cpbdur:82000000 q:27.08 tex:96712 mv:14485 misc:1459 imb:670 pmb:567 smb:113 d:- ref:0 ; in:7615 out:7615 type:P dur:82000000 cpbdur:82000000 q:26.79 tex:88260 mv:15008 misc:1436 imb:770 pmb:498 smb:82 d:- ref:0 ; in:7616 out:7616 type:P dur:82000000 cpbdur:82000000 q:26.70 tex:106191 mv:15588 misc:1421 imb:965 pmb:352 smb:33 d:- ref:0 ; in:7617 out:7617 type:P dur:82000000 cpbdur:82000000 q:26.14 tex:87318 mv:14292 misc:1438 imb:719 pmb:428 smb:203 d:- ref:0 ; in:7618 out:7618 type:P dur:82000000 cpbdur:82000000 q:26.04 tex:108841 mv:16070 misc:1441 imb:961 pmb:318 smb:71 d:- ref:0 ; in:7619 out:7619 type:P dur:82000000 cpbdur:82000000 q:26.06 tex:103127 mv:16034 misc:1447 imb:775 pmb:520 smb:55 d:- ref:0 ; in:7620 out:7620 type:P dur:82000000 cpbdur:82000000 q:26.46 tex:119583 mv:16136 misc:1433 imb:889 pmb:428 smb:33 d:- ref:0 ; in:7621 out:7621 type:P dur:82000000 cpbdur:82000000 q:26.83 tex:121600 mv:16552 misc:1440 imb:837 pmb:476 smb:37 d:- ref:0 ; in:7622 out:7622 type:P dur:82000000 cpbdur:82000000 q:26.92 tex:106768 mv:15020 misc:1428 imb:736 pmb:488 smb:126 d:- ref:0 ; in:7623 out:7623 type:P dur:82000000 cpbdur:82000000 q:26.69 tex:104204 mv:15738 misc:1442 imb:828 pmb:462 smb:60 d:- ref:0 ; in:7624 out:7624 type:P dur:82000000 cpbdur:82000000 q:26.77 tex:116667 mv:15506 misc:1435 imb:933 pmb:350 smb:67 d:- ref:0 ; in:7625 out:7625 type:P dur:82000000 cpbdur:82000000 q:26.36 tex:110255 mv:16464 misc:1425 imb:1053 pmb:280 smb:17 d:- ref:0 ; in:7626 out:7626 type:P dur:82000000 cpbdur:82000000 q:26.03 tex:99368 mv:16222 misc:1450 imb:847 pmb:414 smb:89 d:- ref:0 ; in:7627 out:7627 type:P dur:82000000 cpbdur:82000000 q:25.54 tex:82706 mv:14683 misc:1443 imb:838 pmb:387 smb:125 d:- ref:0 ; in:7628 out:7628 type:P dur:82000000 cpbdur:82000000 q:25.64 tex:94813 mv:15493 misc:1430 imb:1024 pmb:285 smb:41 d:- ref:0 ; in:7629 out:7629 type:P dur:82000000 cpbdur:82000000 q:25.24 tex:87729 mv:13660 misc:1435 imb:715 pmb:450 smb:185 d:- ref:0 ; in:7630 out:7630 type:P dur:82000000 cpbdur:82000000 q:26.02 tex:131354 mv:15847 misc:1423 imb:965 pmb:331 smb:54 d:- ref:0 ; in:7631 out:7631 type:P dur:82000000 cpbdur:82000000 q:24.00 tex:6208 mv:9835 misc:1413 imb:1349 pmb:1 smb:0 d:- ref:0 ; in:7632 out:7632 type:P dur:82000000 cpbdur:82000000 q:22.21 tex:7924 mv:9822 misc:1446 imb:1152 pmb:96 smb:102 d:- ref:0 ; in:7633 out:7633 type:P dur:82000000 cpbdur:82000000 q:21.06 tex:14206 mv:11220 misc:1446 imb:1160 pmb:116 smb:74 d:- ref:0 ; in:7634 out:7634 type:P dur:82000000 cpbdur:82000000 q:21.52 tex:36967 mv:15194 misc:1415 imb:1104 pmb:246 smb:0 d:- ref:0 ; in:7635 out:7635 type:P dur:82000000 cpbdur:82000000 q:22.52 tex:54619 mv:16113 misc:1412 imb:1052 pmb:295 smb:3 d:- ref:0 ; in:7636 out:7636 type:P dur:82000000 cpbdur:82000000 q:24.54 tex:114854 mv:18081 misc:1417 imb:997 pmb:349 smb:4 d:- ref:0 ; in:7637 out:7637 type:P dur:82000000 cpbdur:82000000 q:26.22 tex:162176 mv:19754 misc:1414 imb:952 pmb:398 smb:0 d:- ref:0 ; in:7638 out:7638 type:P dur:82000000 cpbdur:82000000 q:27.65 tex:185366 mv:20254 misc:1420 imb:920 pmb:430 smb:0 d:- ref:0 ; in:7639 out:7639 type:P dur:82000000 cpbdur:82000000 q:28.33 tex:202637 mv:19706 misc:1417 imb:875 pmb:474 smb:1 d:- ref:0 ; in:7640 out:7640 type:P dur:82000000 cpbdur:82000000 q:28.30 tex:167876 mv:17341 misc:1431 imb:815 pmb:513 smb:22 d:- ref:0 ; in:7641 out:7641 type:P dur:82000000 cpbdur:82000000 q:28.04 tex:152857 mv:17126 misc:1449 imb:767 pmb:538 smb:45 d:- ref:0 ; in:7642 out:7642 type:P dur:82000000 cpbdur:82000000 q:28.41 tex:195158 mv:18425 misc:1433 imb:902 pmb:437 smb:11 d:- ref:0 ; in:7643 out:7643 type:P dur:82000000 cpbdur:82000000 q:28.03 tex:141763 mv:16333 misc:1456 imb:740 pmb:521 smb:89 d:- ref:0 ; in:7644 out:7644 type:P dur:82000000 cpbdur:82000000 q:27.85 tex:151059 mv:15838 misc:1455 imb:737 pmb:532 smb:81 d:- ref:0 ; in:7645 out:7645 type:P dur:82000000 cpbdur:82000000 q:28.60 tex:202528 mv:19134 misc:1418 imb:920 pmb:430 smb:0 d:- ref:0 ; in:7646 out:7646 type:P dur:82000000 cpbdur:82000000 q:28.46 tex:186495 mv:17165 misc:1444 imb:694 pmb:603 smb:53 d:- ref:0 ; in:7647 out:7647 type:P dur:82000000 cpbdur:82000000 q:28.28 tex:178833 mv:16702 misc:1441 imb:766 pmb:530 smb:54 d:- ref:0 ; in:7648 out:7648 type:P dur:82000000 cpbdur:82000000 q:27.97 tex:154117 mv:15900 misc:1447 imb:739 pmb:580 smb:31 d:- ref:0 ; in:7649 out:7649 type:P dur:82000000 cpbdur:82000000 q:28.05 tex:165477 mv:17861 misc:1446 imb:767 pmb:549 smb:34 d:- ref:0 ; in:7650 out:7650 type:P dur:82000000 cpbdur:82000000 q:27.66 tex:132010 mv:14527 misc:1455 imb:710 pmb:533 smb:107 d:- ref:0 ; in:7651 out:7651 type:P dur:82000000 cpbdur:82000000 q:27.73 tex:151557 mv:15840 misc:1451 imb:718 pmb:550 smb:82 d:- ref:0 ; in:7652 out:7652 type:P dur:82000000 cpbdur:82000000 q:27.98 tex:171973 mv:16995 misc:1432 imb:773 pmb:545 smb:32 d:- ref:0 ; in:7653 out:7653 type:P dur:82000000 cpbdur:82000000 q:28.61 tex:195701 mv:19866 misc:1433 imb:719 pmb:616 smb:15 d:- ref:0 ; in:7654 out:7654 type:P dur:82000000 cpbdur:82000000 q:28.39 tex:180897 mv:16686 misc:1433 imb:750 pmb:586 smb:14 d:- ref:0 ; in:7655 out:7655 type:P dur:82000000 cpbdur:82000000 q:28.05 tex:162634 mv:16438 misc:1440 imb:786 pmb:538 smb:26 d:- ref:0 ; in:7656 out:7656 type:P dur:82000000 cpbdur:82000000 q:27.94 tex:161817 mv:17789 misc:1442 imb:737 pmb:581 smb:32 d:- ref:0 ; in:7657 out:7657 type:P dur:82000000 cpbdur:82000000 q:27.94 tex:159655 mv:18014 misc:1435 imb:744 pmb:580 smb:26 d:- ref:0 ; in:7658 out:7658 type:P dur:82000000 cpbdur:82000000 q:25.94 tex:5351 mv:10378 misc:1415 imb:1348 pmb:2 smb:0 d:- ref:0 ; in:7659 out:7659 type:P dur:82000000 cpbdur:82000000 q:23.97 tex:3935 mv:4380 misc:1301 imb:445 pmb:190 smb:715 d:- ref:0 ; in:7660 out:7660 type:P dur:82000000 cpbdur:82000000 q:22.33 tex:6628 mv:6544 misc:1548 imb:723 pmb:136 smb:491 d:- ref:0 ; in:7661 out:7661 type:P dur:82000000 cpbdur:82000000 q:22.36 tex:39847 mv:13032 misc:1417 imb:1338 pmb:12 smb:0 d:- ref:0 ; in:7662 out:7662 type:P dur:82000000 cpbdur:82000000 q:22.56 tex:32371 mv:12578 misc:1411 imb:1326 pmb:24 smb:0 d:- ref:0 ; in:7663 out:7663 type:P dur:82000000 cpbdur:82000000 q:22.87 tex:51709 mv:14956 misc:1415 imb:1208 pmb:142 smb:0 d:- ref:0 ; in:7664 out:7664 type:P dur:82000000 cpbdur:82000000 q:24.19 tex:106321 mv:18374 misc:1417 imb:1030 pmb:320 smb:0 d:- ref:0 ; in:7665 out:7665 type:P dur:82000000 cpbdur:82000000 q:24.62 tex:106372 mv:14885 misc:1431 imb:541 pmb:779 smb:30 d:- ref:0 ; in:7666 out:7666 type:P dur:82000000 cpbdur:82000000 q:24.98 tex:119527 mv:15702 misc:1419 imb:484 pmb:866 smb:0 d:- ref:0 ; in:7667 out:7667 type:P dur:82000000 cpbdur:82000000 q:25.89 tex:153257 mv:16331 misc:1420 imb:643 pmb:707 smb:0 d:- ref:0 ; in:7668 out:7668 type:P dur:82000000 cpbdur:82000000 q:27.47 tex:235795 mv:17208 misc:1421 imb:844 pmb:506 smb:0 d:- ref:0 ; in:7669 out:7669 type:P dur:82000000 cpbdur:82000000 q:26.63 tex:119253 mv:12678 misc:1485 imb:193 pmb:922 smb:235 d:- ref:0 ; in:7670 out:7670 type:P dur:82000000 cpbdur:82000000 q:26.03 tex:124320 mv:12704 misc:1472 imb:157 pmb:992 smb:201 d:- ref:0 ; in:7671 out:7671 type:P dur:82000000 cpbdur:82000000 q:24.95 tex:109248 mv:6462 misc:1490 imb:61 pmb:1036 smb:253 d:- ref:0 ; in:7672 out:7672 type:P dur:82000000 cpbdur:82000000 q:24.30 tex:105463 mv:6604 misc:1517 imb:47 pmb:1030 smb:273 d:- ref:0 ; in:7673 out:7673 type:P dur:82000000 cpbdur:82000000 q:23.91 tex:95598 mv:6222 misc:1500 imb:46 pmb:958 smb:346 d:- ref:0 ; in:7674 out:7674 type:P dur:82000000 cpbdur:82000000 q:23.64 tex:94363 mv:6042 misc:1507 imb:32 pmb:954 smb:364 d:- ref:0 ; in:7675 out:7675 type:P dur:82000000 cpbdur:82000000 q:23.64 tex:96918 mv:6504 misc:1514 imb:36 pmb:980 smb:334 d:- ref:0 ; in:7676 out:7676 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:96959 mv:6455 misc:1506 imb:39 pmb:979 smb:332 d:- ref:0 ; in:7677 out:7677 type:P dur:82000000 cpbdur:82000000 q:23.54 tex:102017 mv:6956 misc:1499 imb:31 pmb:1000 smb:319 d:- ref:0 ; in:7678 out:7678 type:P dur:82000000 cpbdur:82000000 q:23.55 tex:95456 mv:6487 misc:1505 imb:49 pmb:965 smb:336 d:- ref:0 ; in:7679 out:7679 type:P dur:82000000 cpbdur:82000000 q:23.42 tex:115152 mv:6672 misc:1512 imb:64 pmb:1050 smb:236 d:- ref:0 ; in:7680 out:7680 type:P dur:82000000 cpbdur:82000000 q:23.45 tex:113517 mv:6465 misc:1514 imb:56 pmb:1029 smb:265 d:- ref:0 ; in:7681 out:7681 type:P dur:82000000 cpbdur:82000000 q:23.30 tex:107041 mv:5839 misc:1496 imb:25 pmb:973 smb:352 d:- ref:0 ; in:7682 out:7682 type:P dur:82000000 cpbdur:82000000 q:23.47 tex:109126 mv:6378 misc:1512 imb:42 pmb:996 smb:312 d:- ref:0 ; in:7683 out:7683 type:P dur:82000000 cpbdur:82000000 q:23.49 tex:109363 mv:6381 misc:1520 imb:42 pmb:995 smb:313 d:- ref:0 ; in:7684 out:7684 type:P dur:82000000 cpbdur:82000000 q:23.42 tex:111616 mv:6149 misc:1483 imb:30 pmb:979 smb:341 d:- ref:0 ; in:7685 out:7685 type:P dur:82000000 cpbdur:82000000 q:23.54 tex:83898 mv:5717 misc:1513 imb:30 pmb:907 smb:413 d:- ref:0 ; in:7686 out:7686 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:102648 mv:6238 misc:1498 imb:58 pmb:990 smb:302 d:- ref:0 ; in:7687 out:7687 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:106727 mv:5684 misc:1501 imb:30 pmb:950 smb:370 d:- ref:0 ; in:7688 out:7688 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:98402 mv:6228 misc:1514 imb:46 pmb:982 smb:322 d:- ref:0 ; in:7689 out:7689 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:15654 mv:11555 misc:1415 imb:1349 pmb:1 smb:0 d:- ref:0 ; in:7690 out:7690 type:P dur:82000000 cpbdur:82000000 q:22.48 tex:32002 mv:12926 misc:1416 imb:1334 pmb:16 smb:0 d:- ref:0 ; in:7691 out:7691 type:P dur:82000000 cpbdur:82000000 q:22.18 tex:27356 mv:13069 misc:1415 imb:1321 pmb:29 smb:0 d:- ref:0 ; in:7692 out:7692 type:P dur:82000000 cpbdur:82000000 q:21.92 tex:28805 mv:13605 misc:1414 imb:1289 pmb:61 smb:0 d:- ref:0 ; in:7693 out:7693 type:P dur:82000000 cpbdur:82000000 q:22.41 tex:60619 mv:15302 misc:1423 imb:1109 pmb:228 smb:13 d:- ref:0 ; in:7694 out:7694 type:P dur:82000000 cpbdur:82000000 q:23.14 tex:71185 mv:15205 misc:1426 imb:1058 pmb:271 smb:21 d:- ref:0 ; in:7695 out:7695 type:P dur:82000000 cpbdur:82000000 q:24.10 tex:93790 mv:16631 misc:1419 imb:1056 pmb:287 smb:7 d:- ref:0 ; in:7696 out:7696 type:P dur:82000000 cpbdur:82000000 q:25.22 tex:129279 mv:16614 misc:1419 imb:1076 pmb:274 smb:0 d:- ref:0 ; in:7697 out:7697 type:P dur:82000000 cpbdur:82000000 q:26.26 tex:148826 mv:17090 misc:1420 imb:1100 pmb:250 smb:0 d:- ref:0 ; in:7698 out:7698 type:P dur:82000000 cpbdur:82000000 q:26.12 tex:105757 mv:15302 misc:1461 imb:796 pmb:436 smb:118 d:- ref:0 ; in:7699 out:7699 type:P dur:82000000 cpbdur:82000000 q:26.46 tex:138636 mv:17512 misc:1452 imb:924 pmb:386 smb:40 d:- ref:0 ; in:7700 out:7700 type:P dur:82000000 cpbdur:82000000 q:26.22 tex:96231 mv:14284 misc:1445 imb:734 pmb:456 smb:160 d:- ref:0 ; in:7701 out:7701 type:P dur:82000000 cpbdur:82000000 q:26.28 tex:109719 mv:15849 misc:1432 imb:846 pmb:447 smb:57 d:- ref:0 ; in:7702 out:7702 type:P dur:82000000 cpbdur:82000000 q:25.68 tex:78642 mv:14023 misc:1423 imb:802 pmb:381 smb:167 d:- ref:0 ; in:7703 out:7703 type:P dur:82000000 cpbdur:82000000 q:25.67 tex:95737 mv:15363 misc:1460 imb:953 pmb:337 smb:60 d:- ref:0 ; in:7704 out:7704 type:P dur:82000000 cpbdur:82000000 q:25.30 tex:94142 mv:15034 misc:1448 imb:788 pmb:444 smb:118 d:- ref:0 ; in:7705 out:7705 type:P dur:82000000 cpbdur:82000000 q:25.67 tex:113149 mv:15813 misc:1446 imb:864 pmb:383 smb:103 d:- ref:0 ; in:7706 out:7706 type:P dur:82000000 cpbdur:82000000 q:25.74 tex:106339 mv:14912 misc:1437 imb:749 pmb:450 smb:151 d:- ref:0 ; in:7707 out:7707 type:P dur:82000000 cpbdur:82000000 q:26.65 tex:138548 mv:17079 misc:1445 imb:863 pmb:439 smb:48 d:- ref:0 ; in:7708 out:7708 type:P dur:82000000 cpbdur:82000000 q:26.76 tex:117674 mv:14076 misc:1434 imb:556 pmb:550 smb:244 d:- ref:0 ; in:7709 out:7709 type:P dur:82000000 cpbdur:82000000 q:26.99 tex:155389 mv:17215 misc:1428 imb:989 pmb:297 smb:64 d:- ref:0 ; in:7710 out:7710 type:P dur:82000000 cpbdur:82000000 q:26.39 tex:97336 mv:14325 misc:1443 imb:662 pmb:487 smb:201 d:- ref:0 ; in:7711 out:7711 type:P dur:82000000 cpbdur:82000000 q:26.46 tex:137241 mv:16420 misc:1435 imb:883 pmb:392 smb:75 d:- ref:0 ; in:7712 out:7712 type:P dur:82000000 cpbdur:82000000 q:25.95 tex:84688 mv:13013 misc:1459 imb:596 pmb:527 smb:227 d:- ref:0 ; in:7713 out:7713 type:P dur:82000000 cpbdur:82000000 q:26.14 tex:105790 mv:15338 misc:1448 imb:831 pmb:432 smb:87 d:- ref:0 ; in:7714 out:7714 type:P dur:82000000 cpbdur:82000000 q:25.72 tex:89668 mv:14228 misc:1464 imb:745 pmb:424 smb:181 d:- ref:0 ; in:7715 out:7715 type:P dur:82000000 cpbdur:82000000 q:25.99 tex:120735 mv:16587 misc:1446 imb:963 pmb:325 smb:62 d:- ref:0 ; in:7716 out:7716 type:P dur:82000000 cpbdur:82000000 q:25.82 tex:91411 mv:12887 misc:1446 imb:614 pmb:409 smb:327 d:- ref:0 ; in:7717 out:7717 type:P dur:82000000 cpbdur:82000000 q:26.00 tex:115706 mv:15217 misc:1453 imb:858 pmb:347 smb:145 d:- ref:0 ; in:7718 out:7718 type:P dur:82000000 cpbdur:82000000 q:25.93 tex:107733 mv:14564 misc:1431 imb:798 pmb:374 smb:178 d:- ref:0 ; in:7719 out:7719 type:P dur:82000000 cpbdur:82000000 q:26.43 tex:140771 mv:16278 misc:1455 imb:895 pmb:368 smb:87 d:- ref:0 ; in:7720 out:7720 type:P dur:82000000 cpbdur:82000000 q:26.11 tex:104282 mv:14500 misc:1434 imb:711 pmb:438 smb:201 d:- ref:0 ; in:7721 out:7721 type:P dur:82000000 cpbdur:82000000 q:26.19 tex:126884 mv:15892 misc:1432 imb:933 pmb:336 smb:81 d:- ref:0 ; in:7722 out:7722 type:P dur:82000000 cpbdur:82000000 q:25.76 tex:90826 mv:14353 misc:1437 imb:810 pmb:401 smb:139 d:- ref:0 ; in:7723 out:7723 type:P dur:82000000 cpbdur:82000000 q:25.73 tex:99599 mv:15112 misc:1441 imb:868 pmb:396 smb:86 d:- ref:0 ; in:7724 out:7724 type:P dur:82000000 cpbdur:82000000 q:25.19 tex:85254 mv:13707 misc:1431 imb:683 pmb:521 smb:146 d:- ref:0 ; in:7725 out:7725 type:P dur:82000000 cpbdur:82000000 q:25.54 tex:98002 mv:15314 misc:1468 imb:765 pmb:464 smb:121 d:- ref:0 ; in:7726 out:7726 type:P dur:82000000 cpbdur:82000000 q:25.50 tex:112438 mv:15086 misc:1444 imb:743 pmb:470 smb:137 d:- ref:0 ; in:7727 out:7727 type:P dur:82000000 cpbdur:82000000 q:26.49 tex:163493 mv:17492 misc:1447 imb:844 pmb:420 smb:86 d:- ref:0 ; in:7728 out:7728 type:P dur:82000000 cpbdur:82000000 q:26.79 tex:130445 mv:14991 misc:1428 imb:661 pmb:495 smb:194 d:- ref:0 ; in:7729 out:7729 type:P dur:82000000 cpbdur:82000000 q:27.18 tex:165082 mv:17326 misc:1424 imb:1027 pmb:302 smb:21 d:- ref:0 ; in:7730 out:7730 type:P dur:82000000 cpbdur:82000000 q:26.81 tex:121177 mv:15133 misc:1434 imb:832 pmb:385 smb:133 d:- ref:0 ; in:7731 out:7731 type:P dur:82000000 cpbdur:82000000 q:26.73 tex:128352 mv:16243 misc:1437 imb:1013 pmb:283 smb:54 d:- ref:0 ; in:7732 out:7732 type:P dur:82000000 cpbdur:82000000 q:26.01 tex:90123 mv:13986 misc:1443 imb:753 pmb:408 smb:189 d:- ref:0 ; in:7733 out:7733 type:P dur:82000000 cpbdur:82000000 q:25.88 tex:102640 mv:15201 misc:1455 imb:854 pmb:393 smb:103 d:- ref:0 ; in:7734 out:7734 type:P dur:82000000 cpbdur:82000000 q:25.46 tex:94283 mv:14974 misc:1431 imb:826 pmb:432 smb:92 d:- ref:0 ; in:7735 out:7735 type:P dur:82000000 cpbdur:82000000 q:25.87 tex:116312 mv:15117 misc:1483 imb:868 pmb:361 smb:121 d:- ref:0 ; in:7736 out:7736 type:P dur:82000000 cpbdur:82000000 q:25.35 tex:94107 mv:14430 misc:1455 imb:757 pmb:458 smb:135 d:- ref:0 ; in:7737 out:7737 type:P dur:82000000 cpbdur:82000000 q:26.11 tex:142300 mv:16564 misc:1448 imb:893 pmb:362 smb:95 d:- ref:0 ; in:7738 out:7738 type:P dur:82000000 cpbdur:82000000 q:26.08 tex:107359 mv:13884 misc:1413 imb:675 pmb:452 smb:223 d:- ref:0 ; in:7739 out:7739 type:P dur:82000000 cpbdur:82000000 q:26.46 tex:140406 mv:16062 misc:1444 imb:863 pmb:396 smb:91 d:- ref:0 ; in:7740 out:7740 type:P dur:82000000 cpbdur:82000000 q:26.16 tex:106742 mv:14317 misc:1429 imb:704 pmb:455 smb:191 d:- ref:0 ; in:7741 out:7741 type:P dur:82000000 cpbdur:82000000 q:26.33 tex:129756 mv:16663 misc:1445 imb:863 pmb:397 smb:90 d:- ref:0 ; in:7742 out:7742 type:P dur:82000000 cpbdur:82000000 q:25.70 tex:79952 mv:13991 misc:1449 imb:703 pmb:441 smb:206 d:- ref:0 ; in:7743 out:7743 type:P dur:82000000 cpbdur:82000000 q:25.96 tex:113656 mv:16047 misc:1441 imb:913 pmb:353 smb:84 d:- ref:0 ; in:7744 out:7744 type:P dur:82000000 cpbdur:82000000 q:25.35 tex:85956 mv:13515 misc:1473 imb:704 pmb:497 smb:149 d:- ref:0 ; in:7745 out:7745 type:P dur:82000000 cpbdur:82000000 q:25.92 tex:123643 mv:15898 misc:1459 imb:901 pmb:370 smb:79 d:- ref:0 ; in:7746 out:7746 type:P dur:82000000 cpbdur:82000000 q:25.91 tex:110718 mv:14916 misc:1438 imb:809 pmb:412 smb:129 d:- ref:0 ; in:7747 out:7747 type:P dur:82000000 cpbdur:82000000 q:26.46 tex:143567 mv:17700 misc:1437 imb:870 pmb:432 smb:48 d:- ref:0 ; in:7748 out:7748 type:P dur:82000000 cpbdur:82000000 q:26.54 tex:123936 mv:14681 misc:1431 imb:691 pmb:439 smb:220 d:- ref:0 ; in:7749 out:7749 type:P dur:82000000 cpbdur:82000000 q:27.15 tex:179173 mv:17716 misc:1423 imb:1019 pmb:304 smb:27 d:- ref:0 ; in:7750 out:7750 type:I dur:82000000 cpbdur:82000000 q:23.08 tex:240888 mv:14520 misc:368 imb:1350 pmb:0 smb:0 d:- ref:; in:7751 out:7751 type:P dur:82000000 cpbdur:82000000 q:27.08 tex:129388 mv:15806 misc:1446 imb:943 pmb:342 smb:65 d:- ref:0 ; in:7752 out:7752 type:P dur:82000000 cpbdur:82000000 q:26.24 tex:87894 mv:14758 misc:1452 imb:752 pmb:466 smb:132 d:- ref:0 ; in:7753 out:7753 type:P dur:82000000 cpbdur:82000000 q:26.08 tex:113582 mv:16146 misc:1448 imb:918 pmb:338 smb:94 d:- ref:0 ; in:7754 out:7754 type:P dur:82000000 cpbdur:82000000 q:25.47 tex:91374 mv:14986 misc:1440 imb:782 pmb:468 smb:100 d:- ref:0 ; in:7755 out:7755 type:P dur:82000000 cpbdur:82000000 q:25.65 tex:101230 mv:15489 misc:1449 imb:835 pmb:373 smb:142 d:- ref:0 ; in:7756 out:7756 type:P dur:82000000 cpbdur:82000000 q:25.42 tex:102276 mv:14571 misc:1457 imb:683 pmb:519 smb:148 d:- ref:0 ; in:7757 out:7757 type:P dur:82000000 cpbdur:82000000 q:26.31 tex:129867 mv:16159 misc:1454 imb:730 pmb:529 smb:91 d:- ref:0 ; in:7758 out:7758 type:P dur:82000000 cpbdur:82000000 q:26.38 tex:103016 mv:14472 misc:1456 imb:691 pmb:514 smb:145 d:- ref:0 ; in:7759 out:7759 type:P dur:82000000 cpbdur:82000000 q:26.71 tex:121145 mv:15648 misc:1439 imb:883 pmb:426 smb:41 d:- ref:0 ; in:7760 out:7760 type:P dur:82000000 cpbdur:82000000 q:26.45 tex:97926 mv:15596 misc:1446 imb:692 pmb:570 smb:88 d:- ref:0 ; in:7761 out:7761 type:P dur:82000000 cpbdur:82000000 q:26.22 tex:105204 mv:15511 misc:1437 imb:822 pmb:501 smb:27 d:- ref:0 ; in:7762 out:7762 type:P dur:82000000 cpbdur:82000000 q:26.00 tex:94102 mv:15411 misc:1447 imb:872 pmb:409 smb:69 d:- ref:0 ; in:7763 out:7763 type:P dur:82000000 cpbdur:82000000 q:25.86 tex:91397 mv:16216 misc:1435 imb:953 pmb:360 smb:37 d:- ref:0 ; in:7764 out:7764 type:P dur:82000000 cpbdur:82000000 q:25.32 tex:90142 mv:15180 misc:1446 imb:832 pmb:442 smb:76 d:- ref:0 ; in:7765 out:7765 type:P dur:82000000 cpbdur:82000000 q:25.56 tex:103119 mv:16159 misc:1458 imb:844 pmb:421 smb:85 d:- ref:0 ; in:7766 out:7766 type:P dur:82000000 cpbdur:82000000 q:25.78 tex:107597 mv:15922 misc:1449 imb:818 pmb:442 smb:90 d:- ref:0 ; in:7767 out:7767 type:P dur:82000000 cpbdur:82000000 q:26.22 tex:120643 mv:16051 misc:1450 imb:805 pmb:481 smb:64 d:- ref:0 ; in:7768 out:7768 type:P dur:82000000 cpbdur:82000000 q:26.36 tex:122570 mv:15984 misc:1454 imb:740 pmb:500 smb:110 d:- ref:0 ; in:7769 out:7769 type:P dur:82000000 cpbdur:82000000 q:26.86 tex:157925 mv:17015 misc:1420 imb:1092 pmb:247 smb:11 d:- ref:0 ; in:7770 out:7770 type:P dur:82000000 cpbdur:82000000 q:26.53 tex:90630 mv:13987 misc:1463 imb:753 pmb:439 smb:158 d:- ref:0 ; in:7771 out:7771 type:P dur:82000000 cpbdur:82000000 q:26.36 tex:110030 mv:15784 misc:1450 imb:863 pmb:428 smb:59 d:- ref:0 ; in:7772 out:7772 type:P dur:82000000 cpbdur:82000000 q:25.75 tex:79593 mv:13638 misc:1473 imb:630 pmb:518 smb:202 d:- ref:0 ; in:7773 out:7773 type:P dur:82000000 cpbdur:82000000 q:25.43 tex:95987 mv:16328 misc:1445 imb:859 pmb:452 smb:39 d:- ref:0 ; in:7774 out:7774 type:P dur:82000000 cpbdur:82000000 q:24.99 tex:82734 mv:15339 misc:1447 imb:859 pmb:413 smb:78 d:- ref:0 ; in:7775 out:7775 type:P dur:82000000 cpbdur:82000000 q:25.46 tex:118984 mv:16763 misc:1437 imb:937 pmb:373 smb:40 d:- ref:0 ; in:7776 out:7776 type:P dur:82000000 cpbdur:82000000 q:25.41 tex:98674 mv:14748 misc:1450 imb:706 pmb:468 smb:176 d:- ref:0 ; in:7777 out:7777 type:P dur:82000000 cpbdur:82000000 q:25.94 tex:109803 mv:16071 misc:1446 imb:873 pmb:395 smb:82 d:- ref:0 ; in:7778 out:7778 type:P dur:82000000 cpbdur:82000000 q:26.17 tex:108121 mv:15378 misc:1445 imb:849 pmb:434 smb:67 d:- ref:0 ; in:7779 out:7779 type:P dur:82000000 cpbdur:82000000 q:26.41 tex:127409 mv:17278 misc:1425 imb:959 pmb:372 smb:19 d:- ref:0 ; in:7780 out:7780 type:P dur:82000000 cpbdur:82000000 q:26.02 tex:88204 mv:16315 misc:1441 imb:847 pmb:441 smb:62 d:- ref:0 ; in:7781 out:7781 type:P dur:82000000 cpbdur:82000000 q:26.20 tex:105269 mv:16354 misc:1433 imb:854 pmb:470 smb:26 d:- ref:0 ; in:7782 out:7782 type:P dur:82000000 cpbdur:82000000 q:25.66 tex:75676 mv:15190 misc:1438 imb:890 pmb:382 smb:78 d:- ref:0 ; in:7783 out:7783 type:P dur:82000000 cpbdur:82000000 q:25.29 tex:82268 mv:16156 misc:1424 imb:879 pmb:452 smb:19 d:- ref:0 ; in:7784 out:7784 type:P dur:82000000 cpbdur:82000000 q:24.94 tex:80544 mv:15495 misc:1441 imb:941 pmb:361 smb:48 d:- ref:0 ; in:7785 out:7785 type:P dur:82000000 cpbdur:82000000 q:25.10 tex:103989 mv:16759 misc:1444 imb:904 pmb:409 smb:37 d:- ref:0 ; in:7786 out:7786 type:P dur:82000000 cpbdur:82000000 q:25.16 tex:106711 mv:15932 misc:1437 imb:900 pmb:392 smb:58 d:- ref:0 ; in:7787 out:7787 type:P dur:82000000 cpbdur:82000000 q:25.99 tex:114983 mv:16451 misc:1446 imb:694 pmb:581 smb:75 d:- ref:0 ; in:7788 out:7788 type:P dur:82000000 cpbdur:82000000 q:26.59 tex:118194 mv:16036 misc:1442 imb:728 pmb:540 smb:82 d:- ref:0 ; in:7789 out:7789 type:P dur:82000000 cpbdur:82000000 q:26.92 tex:149795 mv:17815 misc:1422 imb:1031 pmb:295 smb:24 d:- ref:0 ; in:7790 out:7790 type:P dur:82000000 cpbdur:82000000 q:26.45 tex:103143 mv:15198 misc:1427 imb:807 pmb:412 smb:131 d:- ref:0 ; in:7791 out:7791 type:P dur:82000000 cpbdur:82000000 q:26.15 tex:92045 mv:16007 misc:1436 imb:912 pmb:415 smb:23 d:- ref:0 ; in:7792 out:7792 type:P dur:82000000 cpbdur:82000000 q:25.68 tex:80930 mv:15049 misc:1437 imb:795 pmb:435 smb:120 d:- ref:0 ; in:7793 out:7793 type:P dur:82000000 cpbdur:82000000 q:25.44 tex:94951 mv:16058 misc:1431 imb:932 pmb:398 smb:20 d:- ref:0 ; in:7794 out:7794 type:P dur:82000000 cpbdur:82000000 q:25.24 tex:95919 mv:15693 misc:1460 imb:883 pmb:379 smb:88 d:- ref:0 ; in:7795 out:7795 type:P dur:82000000 cpbdur:82000000 q:25.45 tex:116034 mv:17139 misc:1451 imb:893 pmb:373 smb:84 d:- ref:0 ; in:7796 out:7796 type:P dur:82000000 cpbdur:82000000 q:25.23 tex:91547 mv:14986 misc:1483 imb:697 pmb:514 smb:139 d:- ref:0 ; in:7797 out:7797 type:P dur:82000000 cpbdur:82000000 q:25.74 tex:98466 mv:15459 misc:1459 imb:782 pmb:443 smb:125 d:- ref:0 ; in:7798 out:7798 type:P dur:82000000 cpbdur:82000000 q:26.11 tex:114490 mv:15763 misc:1427 imb:877 pmb:395 smb:78 d:- ref:0 ; in:7799 out:7799 type:P dur:82000000 cpbdur:82000000 q:26.46 tex:122622 mv:16307 misc:1439 imb:849 pmb:457 smb:44 d:- ref:0 ; in:7800 out:7800 type:P dur:82000000 cpbdur:82000000 q:26.30 tex:114724 mv:15852 misc:1440 imb:842 pmb:442 smb:66 d:- ref:0 ; in:7801 out:7801 type:P dur:82000000 cpbdur:82000000 q:26.42 tex:127495 mv:17426 misc:1439 imb:908 pmb:418 smb:24 d:- ref:0 ; in:7802 out:7802 type:P dur:82000000 cpbdur:82000000 q:26.06 tex:109595 mv:15840 misc:1453 imb:789 pmb:470 smb:91 d:- ref:0 ; in:7803 out:7803 type:P dur:82000000 cpbdur:82000000 q:25.96 tex:111755 mv:16690 misc:1443 imb:895 pmb:418 smb:37 d:- ref:0 ; in:7804 out:7804 type:P dur:82000000 cpbdur:82000000 q:25.41 tex:105327 mv:14945 misc:1456 imb:739 pmb:545 smb:66 d:- ref:0 ; in:7805 out:7805 type:P dur:82000000 cpbdur:82000000 q:26.07 tex:134333 mv:16989 misc:1446 imb:762 pmb:509 smb:79 d:- ref:0 ; in:7806 out:7806 type:P dur:82000000 cpbdur:82000000 q:25.95 tex:119331 mv:15045 misc:1456 imb:662 pmb:529 smb:159 d:- ref:0 ; in:7807 out:7807 type:P dur:82000000 cpbdur:82000000 q:26.88 tex:162613 mv:17189 misc:1430 imb:796 pmb:527 smb:27 d:- ref:0 ; in:7808 out:7808 type:P dur:82000000 cpbdur:82000000 q:27.29 tex:167234 mv:16745 misc:1453 imb:621 pmb:593 smb:136 d:- ref:0 ; in:7809 out:7809 type:P dur:82000000 cpbdur:82000000 q:27.64 tex:179553 mv:17691 misc:1428 imb:956 pmb:383 smb:11 d:- ref:0 ; in:7810 out:7810 type:P dur:82000000 cpbdur:82000000 q:27.21 tex:138332 mv:15231 misc:1445 imb:809 pmb:449 smb:92 d:- ref:0 ; in:7811 out:7811 type:P dur:82000000 cpbdur:82000000 q:27.25 tex:153105 mv:16871 misc:1440 imb:910 pmb:409 smb:31 d:- ref:0 ; in:7812 out:7812 type:P dur:82000000 cpbdur:82000000 q:26.79 tex:108532 mv:14073 misc:1467 imb:638 pmb:557 smb:155 d:- ref:0 ; in:7813 out:7813 type:P dur:82000000 cpbdur:82000000 q:26.76 tex:130693 mv:15712 misc:1467 imb:770 pmb:480 smb:100 d:- ref:0 ; in:7814 out:7814 type:P dur:82000000 cpbdur:82000000 q:26.05 tex:98266 mv:13696 misc:1454 imb:737 pmb:504 smb:109 d:- ref:0 ; in:7815 out:7815 type:P dur:82000000 cpbdur:82000000 q:26.80 tex:160646 mv:16534 misc:1460 imb:772 pmb:468 smb:110 d:- ref:0 ; in:7816 out:7816 type:P dur:82000000 cpbdur:82000000 q:26.42 tex:120468 mv:13660 misc:1472 imb:612 pmb:578 smb:160 d:- ref:0 ; in:7817 out:7817 type:P dur:82000000 cpbdur:82000000 q:26.74 tex:144272 mv:15714 misc:1454 imb:834 pmb:422 smb:94 d:- ref:0 ; in:7818 out:7818 type:P dur:82000000 cpbdur:82000000 q:26.82 tex:139146 mv:14778 misc:1452 imb:736 pmb:482 smb:132 d:- ref:0 ; in:7819 out:7819 type:P dur:82000000 cpbdur:82000000 q:27.05 tex:150048 mv:16156 misc:1452 imb:687 pmb:576 smb:87 d:- ref:0 ; in:7820 out:7820 type:P dur:82000000 cpbdur:82000000 q:26.98 tex:127118 mv:13771 misc:1455 imb:607 pmb:615 smb:128 d:- ref:0 ; in:7821 out:7821 type:P dur:82000000 cpbdur:82000000 q:26.87 tex:126972 mv:15173 misc:1455 imb:718 pmb:549 smb:83 d:- ref:0 ; in:7822 out:7822 type:P dur:82000000 cpbdur:82000000 q:26.25 tex:106243 mv:13557 misc:1472 imb:663 pmb:605 smb:82 d:- ref:0 ; in:7823 out:7823 type:P dur:82000000 cpbdur:82000000 q:26.01 tex:104436 mv:14218 misc:1442 imb:792 pmb:496 smb:62 d:- ref:0 ; in:7824 out:7824 type:P dur:82000000 cpbdur:82000000 q:25.82 tex:110501 mv:13698 misc:1449 imb:638 pmb:598 smb:114 d:- ref:0 ; in:7825 out:7825 type:P dur:82000000 cpbdur:82000000 q:26.21 tex:136451 mv:14836 misc:1441 imb:747 pmb:504 smb:99 d:- ref:0 ; in:7826 out:7826 type:P dur:82000000 cpbdur:82000000 q:24.51 tex:5819 mv:10155 misc:1418 imb:1349 pmb:1 smb:0 d:- ref:0 ; in:7827 out:7827 type:P dur:82000000 cpbdur:82000000 q:22.25 tex:2318 mv:1190 misc:908 imb:112 pmb:74 smb:1164 d:- ref:0 ; in:7828 out:7828 type:P dur:82000000 cpbdur:82000000 q:20.88 tex:10945 mv:7894 misc:1457 imb:875 pmb:252 smb:223 d:- ref:0 ; in:7829 out:7829 type:P dur:82000000 cpbdur:82000000 q:21.62 tex:32679 mv:12918 misc:1419 imb:1337 pmb:12 smb:1 d:- ref:0 ; in:7830 out:7830 type:P dur:82000000 cpbdur:82000000 q:21.99 tex:34616 mv:12691 misc:1413 imb:1316 pmb:33 smb:1 d:- ref:0 ; in:7831 out:7831 type:P dur:82000000 cpbdur:82000000 q:22.46 tex:57186 mv:16174 misc:1416 imb:1151 pmb:190 smb:9 d:- ref:0 ; in:7832 out:7832 type:P dur:82000000 cpbdur:82000000 q:23.74 tex:88505 mv:17511 misc:1416 imb:1065 pmb:283 smb:2 d:- ref:0 ; in:7833 out:7833 type:P dur:82000000 cpbdur:82000000 q:24.45 tex:104335 mv:13054 misc:1451 imb:629 pmb:550 smb:171 d:- ref:0 ; in:7834 out:7834 type:P dur:82000000 cpbdur:82000000 q:24.78 tex:105054 mv:10882 misc:1448 imb:491 pmb:698 smb:161 d:- ref:0 ; in:7835 out:7835 type:P dur:82000000 cpbdur:82000000 q:25.07 tex:121323 mv:11400 misc:1437 imb:508 pmb:796 smb:46 d:- ref:0 ; in:7836 out:7836 type:P dur:82000000 cpbdur:82000000 q:25.96 tex:153114 mv:11496 misc:1414 imb:628 pmb:722 smb:0 d:- ref:0 ; in:7837 out:7837 type:P dur:82000000 cpbdur:82000000 q:26.63 tex:160421 mv:11373 misc:1422 imb:595 pmb:755 smb:0 d:- ref:0 ; in:7838 out:7838 type:P dur:82000000 cpbdur:82000000 q:27.71 tex:205720 mv:11232 misc:1416 imb:696 pmb:654 smb:0 d:- ref:0 ; in:7839 out:7839 type:P dur:82000000 cpbdur:82000000 q:26.20 tex:93292 mv:5600 misc:1500 imb:43 pmb:934 smb:373 d:- ref:0 ; in:7840 out:7840 type:P dur:82000000 cpbdur:82000000 q:25.10 tex:109983 mv:6639 misc:1490 imb:62 pmb:1021 smb:267 d:- ref:0 ; in:7841 out:7841 type:P dur:82000000 cpbdur:82000000 q:24.21 tex:101595 mv:6212 misc:1505 imb:58 pmb:984 smb:308 d:- ref:0 ; in:7842 out:7842 type:P dur:82000000 cpbdur:82000000 q:24.02 tex:104583 mv:6672 misc:1481 imb:72 pmb:964 smb:314 d:- ref:0 ; in:7843 out:7843 type:P dur:82000000 cpbdur:82000000 q:23.69 tex:96469 mv:6071 misc:1492 imb:44 pmb:899 smb:407 d:- ref:0 ; in:7844 out:7844 type:P dur:82000000 cpbdur:82000000 q:23.40 tex:116485 mv:5901 misc:1518 imb:59 pmb:997 smb:294 d:- ref:0 ; in:7845 out:7845 type:P dur:82000000 cpbdur:82000000 q:23.49 tex:115920 mv:6656 misc:1504 imb:66 pmb:974 smb:310 d:- ref:0 ; in:7846 out:7846 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:93568 mv:6637 misc:1499 imb:54 pmb:909 smb:387 d:- ref:0 ; in:7847 out:7847 type:P dur:82000000 cpbdur:82000000 q:23.48 tex:123764 mv:6780 misc:1496 imb:73 pmb:996 smb:281 d:- ref:0 ; in:7848 out:7848 type:P dur:82000000 cpbdur:82000000 q:23.42 tex:122689 mv:6550 misc:1521 imb:60 pmb:952 smb:338 d:- ref:0 ; in:7849 out:7849 type:P dur:82000000 cpbdur:82000000 q:23.52 tex:98422 mv:6437 misc:1493 imb:43 pmb:905 smb:402 d:- ref:0 ; in:7850 out:7850 type:P dur:82000000 cpbdur:82000000 q:23.44 tex:121251 mv:6568 misc:1517 imb:63 pmb:1004 smb:283 d:- ref:0 ; in:7851 out:7851 type:P dur:82000000 cpbdur:82000000 q:23.31 tex:110418 mv:6041 misc:1509 imb:51 pmb:933 smb:366 d:- ref:0 ; in:7852 out:7852 type:P dur:82000000 cpbdur:82000000 q:23.31 tex:104807 mv:6089 misc:1520 imb:71 pmb:915 smb:364 d:- ref:0 ; in:7853 out:7853 type:P dur:82000000 cpbdur:82000000 q:23.42 tex:110288 mv:6319 misc:1513 imb:75 pmb:893 smb:382 d:- ref:0 ; in:7854 out:7854 type:P dur:82000000 cpbdur:82000000 q:23.31 tex:105350 mv:6117 misc:1501 imb:75 pmb:919 smb:356 d:- ref:0 ; in:7855 out:7855 type:P dur:82000000 cpbdur:82000000 q:23.15 tex:108973 mv:5969 misc:1506 imb:56 pmb:947 smb:347 d:- ref:0 ; in:7856 out:7856 type:P dur:82000000 cpbdur:82000000 q:23.38 tex:111111 mv:6205 misc:1492 imb:66 pmb:937 smb:347 d:- ref:0 ; in:7857 out:7857 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:122047 mv:6908 misc:1501 imb:78 pmb:976 smb:296 d:- ref:0 ; in:7858 out:7858 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:112570 mv:6213 misc:1473 imb:60 pmb:905 smb:385 d:- ref:0 ; in:7859 out:7859 type:P dur:82000000 cpbdur:82000000 q:23.39 tex:110800 mv:5870 misc:1474 imb:48 pmb:884 smb:418 d:- ref:0 ; in:7860 out:7860 type:P dur:82000000 cpbdur:82000000 q:23.31 tex:105999 mv:5926 misc:1531 imb:46 pmb:946 smb:358 d:- ref:0 ; in:7861 out:7861 type:P dur:82000000 cpbdur:82000000 q:23.21 tex:112252 mv:5862 misc:1510 imb:50 pmb:960 smb:340 d:- ref:0 ; in:7862 out:7862 type:P dur:82000000 cpbdur:82000000 q:23.37 tex:110820 mv:5979 misc:1505 imb:37 pmb:935 smb:378 d:- ref:0 ; in:7863 out:7863 type:P dur:82000000 cpbdur:82000000 q:23.41 tex:101201 mv:6103 misc:1512 imb:59 pmb:925 smb:366 d:- ref:0 ; in:7864 out:7864 type:P dur:82000000 cpbdur:82000000 q:23.18 tex:93511 mv:5482 misc:1487 imb:64 pmb:920 smb:366 d:- ref:0 ; in:7865 out:7865 type:P dur:82000000 cpbdur:82000000 q:23.18 tex:102240 mv:5618 misc:1478 imb:48 pmb:872 smb:430 d:- ref:0 ; in:7866 out:7866 type:P dur:82000000 cpbdur:82000000 q:22.97 tex:96243 mv:5306 misc:1507 imb:44 pmb:932 smb:374 d:- ref:0 ; in:7867 out:7867 type:P dur:82000000 cpbdur:82000000 q:23.45 tex:112904 mv:6518 misc:1506 imb:46 pmb:952 smb:352 d:- ref:0 ; in:7868 out:7868 type:P dur:82000000 cpbdur:82000000 q:23.69 tex:96104 mv:6748 misc:1516 imb:57 pmb:948 smb:345 d:- ref:0 ; in:7869 out:7869 type:P dur:82000000 cpbdur:82000000 q:22.89 tex:23945 mv:12299 misc:1412 imb:1331 pmb:19 smb:0 d:- ref:0 ; in:7870 out:7870 type:P dur:82000000 cpbdur:82000000 q:22.96 tex:40529 mv:13255 misc:1416 imb:1335 pmb:15 smb:0 d:- ref:0 ; in:7871 out:7871 type:P dur:82000000 cpbdur:82000000 q:23.14 tex:54108 mv:14476 misc:1416 imb:1284 pmb:66 smb:0 d:- ref:0 ; in:7872 out:7872 type:P dur:82000000 cpbdur:82000000 q:24.12 tex:95604 mv:16810 misc:1418 imb:1142 pmb:206 smb:2 d:- ref:0 ; in:7873 out:7873 type:P dur:82000000 cpbdur:82000000 q:25.05 tex:122087 mv:16695 misc:1418 imb:903 pmb:445 smb:2 d:- ref:0 ; in:7874 out:7874 type:P dur:82000000 cpbdur:82000000 q:25.44 tex:125975 mv:15679 misc:1442 imb:815 pmb:499 smb:36 d:- ref:0 ; in:7875 out:7875 type:P dur:82000000 cpbdur:82000000 q:26.52 tex:154693 mv:14729 misc:1418 imb:931 pmb:419 smb:0 d:- ref:0 ; in:7876 out:7876 type:P dur:82000000 cpbdur:82000000 q:27.92 tex:216433 mv:16738 misc:1421 imb:974 pmb:376 smb:0 d:- ref:0 ; in:7877 out:7877 type:P dur:82000000 cpbdur:82000000 q:27.62 tex:138927 mv:14170 misc:1463 imb:669 pmb:554 smb:127 d:- ref:0 ; in:7878 out:7878 type:P dur:82000000 cpbdur:82000000 q:27.82 tex:167352 mv:15867 misc:1437 imb:803 pmb:503 smb:44 d:- ref:0 ; in:7879 out:7879 type:P dur:82000000 cpbdur:82000000 q:27.43 tex:147916 mv:13649 misc:1483 imb:601 pmb:627 smb:122 d:- ref:0 ; in:7880 out:7880 type:P dur:82000000 cpbdur:82000000 q:27.69 tex:164453 mv:15948 misc:1455 imb:742 pmb:544 smb:64 d:- ref:0 ; in:7881 out:7881 type:P dur:82000000 cpbdur:82000000 q:27.30 tex:140488 mv:13699 misc:1469 imb:700 pmb:553 smb:97 d:- ref:0 ; in:7882 out:7882 type:P dur:82000000 cpbdur:82000000 q:27.14 tex:150650 mv:13971 misc:1467 imb:708 pmb:539 smb:103 d:- ref:0 ; in:7883 out:7883 type:P dur:82000000 cpbdur:82000000 q:26.56 tex:101023 mv:11748 misc:1493 imb:568 pmb:590 smb:192 d:- ref:0 ; in:7884 out:7884 type:P dur:82000000 cpbdur:82000000 q:26.98 tex:152746 mv:15760 misc:1470 imb:725 pmb:548 smb:77 d:- ref:0 ; in:7885 out:7885 type:P dur:82000000 cpbdur:82000000 q:26.80 tex:124204 mv:12602 misc:1474 imb:582 pmb:590 smb:178 d:- ref:0 ; in:7886 out:7886 type:P dur:82000000 cpbdur:82000000 q:27.20 tex:164589 mv:15547 misc:1480 imb:716 pmb:541 smb:93 d:- ref:0 ; in:7887 out:7887 type:P dur:82000000 cpbdur:82000000 q:27.14 tex:146906 mv:13223 misc:1479 imb:475 pmb:667 smb:208 d:- ref:0 ; in:7888 out:7888 type:P dur:82000000 cpbdur:82000000 q:27.94 tex:198887 mv:16922 misc:1455 imb:778 pmb:522 smb:50 d:- ref:0 ; in:7889 out:7889 type:P dur:82000000 cpbdur:82000000 q:27.58 tex:136128 mv:12821 misc:1467 imb:552 pmb:557 smb:241 d:- ref:0 ; in:7890 out:7890 type:P dur:82000000 cpbdur:82000000 q:27.81 tex:170853 mv:15439 misc:1468 imb:723 pmb:525 smb:102 d:- ref:0 ; in:7891 out:7891 type:P dur:82000000 cpbdur:82000000 q:27.52 tex:129372 mv:12410 misc:1482 imb:474 pmb:634 smb:242 d:- ref:0 ; in:7892 out:7892 type:P dur:82000000 cpbdur:82000000 q:27.68 tex:154568 mv:15589 misc:1451 imb:738 pmb:525 smb:87 d:- ref:0 ; in:7893 out:7893 type:P dur:82000000 cpbdur:82000000 q:27.27 tex:138758 mv:13028 misc:1470 imb:653 pmb:552 smb:145 d:- ref:0 ; in:7894 out:7894 type:P dur:82000000 cpbdur:82000000 q:27.46 tex:168813 mv:15363 misc:1456 imb:828 pmb:465 smb:57 d:- ref:0 ; in:7895 out:7895 type:P dur:82000000 cpbdur:82000000 q:26.95 tex:121455 mv:12214 misc:1491 imb:561 pmb:608 smb:181 d:- ref:0 ; in:7896 out:7896 type:P dur:82000000 cpbdur:82000000 q:27.47 tex:186151 mv:15361 misc:1456 imb:793 pmb:507 smb:50 d:- ref:0 ; in:7897 out:7897 type:P dur:82000000 cpbdur:82000000 q:27.41 tex:151345 mv:13439 misc:1472 imb:597 pmb:627 smb:126 d:- ref:0 ; in:7898 out:7898 type:P dur:82000000 cpbdur:82000000 q:27.49 tex:164351 mv:14616 misc:1473 imb:713 pmb:518 smb:119 d:- ref:0 ; in:7899 out:7899 type:P dur:82000000 cpbdur:82000000 q:27.05 tex:132856 mv:12408 misc:1464 imb:580 pmb:564 smb:206 d:- ref:0 ; in:7900 out:7900 type:P dur:82000000 cpbdur:82000000 q:27.60 tex:174732 mv:15706 misc:1450 imb:723 pmb:534 smb:93 d:- ref:0 ; in:7901 out:7901 type:P dur:82000000 cpbdur:82000000 q:27.46 tex:158825 mv:13361 misc:1478 imb:635 pmb:609 smb:106 d:- ref:0 ; in:7902 out:7902 type:P dur:82000000 cpbdur:82000000 q:27.21 tex:143020 mv:13235 misc:1473 imb:658 pmb:571 smb:121 d:- ref:0 ; in:7903 out:7903 type:P dur:82000000 cpbdur:82000000 q:26.74 tex:120380 mv:11181 misc:1495 imb:502 pmb:669 smb:179 d:- ref:0 ; in:7904 out:7904 type:P dur:82000000 cpbdur:82000000 q:27.00 tex:155165 mv:14904 misc:1475 imb:670 pmb:590 smb:90 d:- ref:0 ; in:7905 out:7905 type:P dur:82000000 cpbdur:82000000 q:26.57 tex:117006 mv:11696 misc:1474 imb:500 pmb:646 smb:204 d:- ref:0 ; in:7906 out:7906 type:P dur:82000000 cpbdur:82000000 q:27.23 tex:176094 mv:14838 misc:1452 imb:627 pmb:610 smb:113 d:- ref:0 ; in:7907 out:7907 type:P dur:82000000 cpbdur:82000000 q:27.06 tex:133456 mv:12424 misc:1488 imb:461 pmb:688 smb:201 d:- ref:0 ; in:7908 out:7908 type:P dur:82000000 cpbdur:82000000 q:25.01 tex:6719 mv:10511 misc:1418 imb:1349 pmb:1 smb:0 d:- ref:0 ; in:7909 out:7909 type:P dur:82000000 cpbdur:82000000 q:23.25 tex:7833 mv:8805 misc:1458 imb:887 pmb:129 smb:334 d:- ref:0 ; in:7910 out:7910 type:P dur:82000000 cpbdur:82000000 q:22.88 tex:38692 mv:14045 misc:1415 imb:1256 pmb:93 smb:1 d:- ref:0 ; in:7911 out:7911 type:P dur:82000000 cpbdur:82000000 q:23.46 tex:82714 mv:15588 misc:1410 imb:1190 pmb:160 smb:0 d:- ref:0 ; in:7912 out:7912 type:P dur:82000000 cpbdur:82000000 q:24.64 tex:115033 mv:16527 misc:1416 imb:1136 pmb:213 smb:1 d:- ref:0 ; in:7913 out:7913 type:P dur:82000000 cpbdur:82000000 q:25.57 tex:131109 mv:16344 misc:1419 imb:1156 pmb:194 smb:0 d:- ref:0 ; in:7914 out:7914 type:P dur:82000000 cpbdur:82000000 q:26.66 tex:166285 mv:16122 misc:1417 imb:1148 pmb:202 smb:0 d:- ref:0 ; in:7915 out:7915 type:P dur:82000000 cpbdur:82000000 q:27.10 tex:169287 mv:16088 misc:1417 imb:928 pmb:420 smb:2 d:- ref:0 ; in:7916 out:7916 type:P dur:82000000 cpbdur:82000000 q:26.75 tex:116794 mv:12265 misc:1453 imb:661 pmb:481 smb:208 d:- ref:0 ; in:7917 out:7917 type:P dur:82000000 cpbdur:82000000 q:26.79 tex:132366 mv:13825 misc:1449 imb:700 pmb:475 smb:175 d:- ref:0 ; in:7918 out:7918 type:P dur:82000000 cpbdur:82000000 q:26.72 tex:128910 mv:12546 misc:1464 imb:643 pmb:478 smb:229 d:- ref:0 ; in:7919 out:7919 type:P dur:82000000 cpbdur:82000000 q:26.64 tex:127210 mv:14248 misc:1430 imb:614 pmb:516 smb:220 d:- ref:0 ; in:7920 out:7920 type:P dur:82000000 cpbdur:82000000 q:26.55 tex:124071 mv:12561 misc:1440 imb:614 pmb:471 smb:265 d:- ref:0 ; in:7921 out:7921 type:P dur:82000000 cpbdur:82000000 q:26.55 tex:129119 mv:13162 misc:1455 imb:623 pmb:532 smb:195 d:- ref:0 ; in:7922 out:7922 type:P dur:82000000 cpbdur:82000000 q:26.47 tex:135624 mv:13672 misc:1464 imb:577 pmb:598 smb:175 d:- ref:0 ; in:7923 out:7923 type:P dur:82000000 cpbdur:82000000 q:26.67 tex:148018 mv:14328 misc:1454 imb:693 pmb:460 smb:197 d:- ref:0 ; in:7924 out:7924 type:P dur:82000000 cpbdur:82000000 q:26.56 tex:120099 mv:12416 misc:1453 imb:550 pmb:560 smb:240 d:- ref:0 ; in:7925 out:7925 type:P dur:82000000 cpbdur:82000000 q:26.38 tex:120202 mv:12694 misc:1448 imb:555 pmb:572 smb:223 d:- ref:0 ; in:7926 out:7926 type:P dur:82000000 cpbdur:82000000 q:26.05 tex:104766 mv:9845 misc:1405 imb:502 pmb:445 smb:403 d:- ref:0 ; in:7927 out:7927 type:P dur:82000000 cpbdur:82000000 q:26.39 tex:149778 mv:13108 misc:1434 imb:615 pmb:492 smb:243 d:- ref:0 ; in:7928 out:7928 type:P dur:82000000 cpbdur:82000000 q:26.45 tex:133116 mv:12535 misc:1453 imb:541 pmb:553 smb:256 d:- ref:0 ; in:7929 out:7929 type:P dur:82000000 cpbdur:82000000 q:26.33 tex:115674 mv:11840 misc:1462 imb:546 pmb:506 smb:298 d:- ref:0 ; in:7930 out:7930 type:P dur:82000000 cpbdur:82000000 q:26.09 tex:117039 mv:10819 misc:1422 imb:528 pmb:459 smb:363 d:- ref:0 ; in:7931 out:7931 type:P dur:82000000 cpbdur:82000000 q:26.19 tex:134057 mv:13635 misc:1436 imb:578 pmb:541 smb:231 d:- ref:0 ; in:7932 out:7932 type:P dur:82000000 cpbdur:82000000 q:26.25 tex:119020 mv:11500 misc:1440 imb:581 pmb:440 smb:329 d:- ref:0 ; in:7933 out:7933 type:P dur:82000000 cpbdur:82000000 q:26.66 tex:138428 mv:14058 misc:1450 imb:685 pmb:468 smb:197 d:- ref:0 ; in:7934 out:7934 type:P dur:82000000 cpbdur:82000000 q:26.49 tex:132991 mv:12701 misc:1452 imb:571 pmb:547 smb:232 d:- ref:0 ; in:7935 out:7935 type:P dur:82000000 cpbdur:82000000 q:26.67 tex:141057 mv:15077 misc:1442 imb:671 pmb:507 smb:172 d:- ref:0 ; in:7936 out:7936 type:P dur:82000000 cpbdur:82000000 q:26.57 tex:131609 mv:13737 misc:1462 imb:669 pmb:509 smb:172 d:- ref:0 ; in:7937 out:7937 type:P dur:82000000 cpbdur:82000000 q:26.61 tex:136661 mv:14479 misc:1460 imb:646 pmb:539 smb:165 d:- ref:0 ; in:7938 out:7938 type:P dur:82000000 cpbdur:82000000 q:26.63 tex:131602 mv:12944 misc:1462 imb:618 pmb:506 smb:226 d:- ref:0 ; in:7939 out:7939 type:P dur:82000000 cpbdur:82000000 q:26.93 tex:152064 mv:14725 misc:1451 imb:626 pmb:517 smb:207 d:- ref:0 ; in:7940 out:7940 type:P dur:82000000 cpbdur:82000000 q:26.65 tex:121769 mv:11907 misc:1444 imb:530 pmb:459 smb:361 d:- ref:0 ; in:7941 out:7941 type:P dur:82000000 cpbdur:82000000 q:26.35 tex:124067 mv:11793 misc:1452 imb:534 pmb:525 smb:291 d:- ref:0 ; in:7942 out:7942 type:P dur:82000000 cpbdur:82000000 q:26.19 tex:122968 mv:12296 misc:1448 imb:515 pmb:592 smb:243 d:- ref:0 ; in:7943 out:7943 type:P dur:82000000 cpbdur:82000000 q:26.27 tex:128659 mv:13208 misc:1445 imb:520 pmb:578 smb:252 d:- ref:0 ; in:7944 out:7944 type:P dur:82000000 cpbdur:82000000 q:26.06 tex:115334 mv:11088 misc:1434 imb:545 pmb:506 smb:299 d:- ref:0 ; in:7945 out:7945 type:P dur:82000000 cpbdur:82000000 q:25.93 tex:106288 mv:10591 misc:1425 imb:463 pmb:525 smb:362 d:- ref:0 ; in:7946 out:7946 type:P dur:82000000 cpbdur:82000000 q:25.79 tex:107322 mv:9695 misc:1431 imb:451 pmb:449 smb:450 d:- ref:0 ; in:7947 out:7947 type:P dur:82000000 cpbdur:82000000 q:26.31 tex:147666 mv:14613 misc:1433 imb:611 pmb:523 smb:216 d:- ref:0 ; in:7948 out:7948 type:P dur:82000000 cpbdur:82000000 q:27.56 tex:132439 mv:14040 misc:1417 imb:1216 pmb:134 smb:0 d:- ref:0 ; in:7949 out:7949 type:P dur:82000000 cpbdur:82000000 q:25.98 tex:45972 mv:6405 misc:1087 imb:145 pmb:451 smb:754 d:- ref:0 ; in:7950 out:7950 type:P dur:82000000 cpbdur:82000000 q:24.95 tex:61383 mv:9952 misc:1417 imb:437 pmb:512 smb:401 d:- ref:0 ; in:7951 out:7951 type:P dur:82000000 cpbdur:82000000 q:24.53 tex:70782 mv:11550 misc:1460 imb:621 pmb:454 smb:275 d:- ref:0 ; in:7952 out:7952 type:P dur:82000000 cpbdur:82000000 q:24.33 tex:71745 mv:12522 misc:1461 imb:686 pmb:474 smb:190 d:- ref:0 ; in:7953 out:7953 type:P dur:82000000 cpbdur:82000000 q:24.01 tex:63884 mv:11642 misc:1442 imb:497 pmb:512 smb:341 d:- ref:0 ; in:7954 out:7954 type:P dur:82000000 cpbdur:82000000 q:24.63 tex:79258 mv:11379 misc:1459 imb:480 pmb:483 smb:387 d:- ref:0 ; in:7955 out:7955 type:P dur:82000000 cpbdur:82000000 q:23.50 tex:39604 mv:5122 misc:1378 imb:195 pmb:508 smb:647 d:- ref:0 ; in:7956 out:7956 type:P dur:82000000 cpbdur:82000000 q:23.41 tex:72146 mv:6105 misc:1405 imb:274 pmb:463 smb:613 d:- ref:0 ; in:7957 out:7957 type:P dur:82000000 cpbdur:82000000 q:22.47 tex:54642 mv:5652 misc:1506 imb:250 pmb:576 smb:524 d:- ref:0 ; in:7958 out:7958 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:56916 mv:5505 misc:1139 imb:204 pmb:345 smb:801 d:- ref:0 ; in:7959 out:7959 type:P dur:82000000 cpbdur:82000000 q:21.85 tex:43406 mv:5138 misc:1416 imb:208 pmb:494 smb:648 d:- ref:0 ; in:7960 out:7960 type:P dur:82000000 cpbdur:82000000 q:23.62 tex:87002 mv:8864 misc:1286 imb:566 pmb:270 smb:514 d:- ref:0 ; in:7961 out:7961 type:P dur:82000000 cpbdur:82000000 q:22.24 tex:39885 mv:5134 misc:1437 imb:200 pmb:512 smb:638 d:- ref:0 ; in:7962 out:7962 type:P dur:82000000 cpbdur:82000000 q:23.39 tex:94325 mv:11193 misc:1410 imb:1203 pmb:85 smb:62 d:- ref:0 ; in:7963 out:7963 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:26199 mv:8262 misc:1435 imb:876 pmb:86 smb:388 d:- ref:0 ; in:7964 out:7964 type:P dur:82000000 cpbdur:82000000 q:25.97 tex:118404 mv:12840 misc:1420 imb:1332 pmb:18 smb:0 d:- ref:0 ; in:7965 out:7965 type:P dur:82000000 cpbdur:82000000 q:24.33 tex:33384 mv:3628 misc:1356 imb:157 pmb:448 smb:745 d:- ref:0 ; in:7966 out:7966 type:P dur:82000000 cpbdur:82000000 q:23.68 tex:57395 mv:4327 misc:1078 imb:133 pmb:347 smb:870 d:- ref:0 ; in:7967 out:7967 type:P dur:82000000 cpbdur:82000000 q:22.43 tex:59536 mv:6429 misc:1515 imb:278 pmb:673 smb:399 d:- ref:0 ; in:7968 out:7968 type:P dur:82000000 cpbdur:82000000 q:22.75 tex:59233 mv:3871 misc:1032 imb:81 pmb:365 smb:904 d:- ref:0 ; in:7969 out:7969 type:P dur:82000000 cpbdur:82000000 q:26.75 tex:331556 mv:16473 misc:1419 imb:1155 pmb:195 smb:0 d:- ref:0 ; in:7970 out:7970 type:P dur:82000000 cpbdur:82000000 q:26.81 tex:72309 mv:5194 misc:1497 imb:29 pmb:886 smb:435 d:- ref:0 ; in:7971 out:7971 type:P dur:82000000 cpbdur:82000000 q:25.47 tex:91717 mv:6199 misc:1500 imb:57 pmb:1013 smb:280 d:- ref:0 ; in:7972 out:7972 type:P dur:82000000 cpbdur:82000000 q:24.36 tex:92561 mv:4160 misc:1511 imb:34 pmb:948 smb:368 d:- ref:0 ; in:7973 out:7973 type:P dur:82000000 cpbdur:82000000 q:22.24 tex:110078 mv:4535 misc:1475 imb:90 pmb:1125 smb:135 d:- ref:0 ; in:7974 out:7974 type:P dur:82000000 cpbdur:82000000 q:21.59 tex:74152 mv:3147 misc:1525 imb:20 pmb:801 smb:529 d:- ref:0 ; in:7975 out:7975 type:P dur:82000000 cpbdur:82000000 q:22.30 tex:127620 mv:5359 misc:1469 imb:60 pmb:953 smb:337 d:- ref:0 ; in:7976 out:7976 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:79024 mv:3042 misc:1470 imb:8 pmb:780 smb:562 d:- ref:0 ; in:7977 out:7977 type:P dur:82000000 cpbdur:82000000 q:20.23 tex:94111 mv:3774 misc:1523 imb:49 pmb:1054 smb:247 d:- ref:0 ; in:7978 out:7978 type:P dur:82000000 cpbdur:82000000 q:23.79 tex:127989 mv:7155 misc:1336 imb:77 pmb:769 smb:504 d:- ref:0 ; in:7979 out:7979 type:P dur:82000000 cpbdur:82000000 q:22.75 tex:62682 mv:3392 misc:1438 imb:9 pmb:784 smb:557 d:- ref:0 ; in:7980 out:7980 type:P dur:82000000 cpbdur:82000000 q:21.76 tex:63722 mv:3648 misc:1478 imb:14 pmb:820 smb:516 d:- ref:0 ; in:7981 out:7981 type:P dur:82000000 cpbdur:82000000 q:23.17 tex:94171 mv:5284 misc:1137 imb:69 pmb:476 smb:805 d:- ref:0 ; in:7982 out:7982 type:P dur:82000000 cpbdur:82000000 q:21.43 tex:70755 mv:3157 misc:1536 imb:25 pmb:847 smb:478 d:- ref:0 ; in:7983 out:7983 type:P dur:82000000 cpbdur:82000000 q:20.44 tex:78356 mv:3054 misc:1518 imb:11 pmb:876 smb:463 d:- ref:0 ; in:7984 out:7984 type:P dur:82000000 cpbdur:82000000 q:24.44 tex:201788 mv:11711 misc:1157 imb:224 pmb:565 smb:561 d:- ref:0 ; in:7985 out:7985 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:35094 mv:1843 misc:1215 imb:7 pmb:543 smb:800 d:- ref:0 ; in:7986 out:7986 type:P dur:82000000 cpbdur:82000000 q:21.78 tex:66200 mv:3278 misc:1498 imb:27 pmb:846 smb:477 d:- ref:0 ; in:7987 out:7987 type:P dur:82000000 cpbdur:82000000 q:25.56 tex:174216 mv:10993 misc:1215 imb:332 pmb:483 smb:535 d:- ref:0 ; in:7988 out:7988 type:P dur:82000000 cpbdur:82000000 q:24.08 tex:83922 mv:3584 misc:1406 imb:17 pmb:806 smb:527 d:- ref:0 ; in:7989 out:7989 type:P dur:82000000 cpbdur:82000000 q:22.06 tex:92251 mv:3383 misc:1486 imb:32 pmb:947 smb:371 d:- ref:0 ; in:7990 out:7990 type:P dur:82000000 cpbdur:82000000 q:26.06 tex:209233 mv:14751 misc:1248 imb:452 pmb:557 smb:341 d:- ref:0 ; in:7991 out:7991 type:P dur:82000000 cpbdur:82000000 q:24.42 tex:60859 mv:2780 misc:1417 imb:12 pmb:748 smb:590 d:- ref:0 ; in:7992 out:7992 type:P dur:82000000 cpbdur:82000000 q:22.41 tex:99631 mv:3534 misc:1475 imb:32 pmb:974 smb:344 d:- ref:0 ; in:7993 out:7993 type:P dur:82000000 cpbdur:82000000 q:26.08 tex:199595 mv:13139 misc:1234 imb:453 pmb:501 smb:396 d:- ref:0 ; in:7994 out:7994 type:P dur:82000000 cpbdur:82000000 q:24.00 tex:49740 mv:2698 misc:1394 imb:31 pmb:688 smb:631 d:- ref:0 ; in:7995 out:7995 type:P dur:82000000 cpbdur:82000000 q:21.97 tex:92128 mv:3686 misc:1458 imb:57 pmb:908 smb:385 d:- ref:0 ; in:7996 out:7996 type:P dur:82000000 cpbdur:82000000 q:25.97 tex:212374 mv:14456 misc:1242 imb:438 pmb:534 smb:378 d:- ref:0 ; in:7997 out:7997 type:P dur:82000000 cpbdur:82000000 q:24.37 tex:49238 mv:2345 misc:1433 imb:17 pmb:663 smb:670 d:- ref:0 ; in:7998 out:7998 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:102622 mv:4153 misc:1497 imb:95 pmb:981 smb:274 d:- ref:0 ; in:7999 out:7999 type:P dur:82000000 cpbdur:82000000 q:26.42 tex:231762 mv:13821 misc:1361 imb:650 pmb:385 smb:315 d:- ref:0 ; in:8000 out:8000 type:I dur:82000000 cpbdur:82000000 q:20.97 tex:429213 mv:14192 misc:371 imb:1350 pmb:0 smb:0 d:- ref:; in:8001 out:8001 type:P dur:82000000 cpbdur:82000000 q:26.27 tex:877 mv:75 misc:288 imb:0 pmb:25 smb:1325 d:- ref:0 ; in:8002 out:8002 type:P dur:82000000 cpbdur:82000000 q:27.17 tex:156893 mv:12624 misc:1235 imb:444 pmb:442 smb:464 d:- ref:0 ; in:8003 out:8003 type:P dur:82000000 cpbdur:82000000 q:25.82 tex:63080 mv:6584 misc:1448 imb:82 pmb:748 smb:520 d:- ref:0 ; in:8004 out:8004 type:P dur:82000000 cpbdur:82000000 q:24.70 tex:71041 mv:6893 misc:1490 imb:98 pmb:847 smb:405 d:- ref:0 ; in:8005 out:8005 type:P dur:82000000 cpbdur:82000000 q:24.90 tex:105410 mv:13068 misc:1418 imb:1288 pmb:62 smb:0 d:- ref:0 ; in:8006 out:8006 type:P dur:82000000 cpbdur:82000000 q:23.05 tex:22638 mv:2103 misc:995 imb:24 pmb:353 smb:973 d:- ref:0 ; in:8007 out:8007 type:P dur:82000000 cpbdur:82000000 q:21.77 tex:30587 mv:4014 misc:1423 imb:183 pmb:476 smb:691 d:- ref:0 ; in:8008 out:8008 type:P dur:82000000 cpbdur:82000000 q:20.58 tex:36049 mv:3829 misc:1426 imb:158 pmb:487 smb:705 d:- ref:0 ; in:8009 out:8009 type:P dur:82000000 cpbdur:82000000 q:20.17 tex:40551 mv:3828 misc:1349 imb:171 pmb:434 smb:745 d:- ref:0 ; in:8010 out:8010 type:P dur:82000000 cpbdur:82000000 q:19.81 tex:36047 mv:3478 misc:1387 imb:131 pmb:440 smb:779 d:- ref:0 ; in:8011 out:8011 type:P dur:82000000 cpbdur:82000000 q:19.15 tex:51399 mv:4794 misc:1503 imb:149 pmb:618 smb:583 d:- ref:0 ; in:8012 out:8012 type:P dur:82000000 cpbdur:82000000 q:19.60 tex:32640 mv:3384 misc:1248 imb:72 pmb:414 smb:864 d:- ref:0 ; in:8013 out:8013 type:P dur:82000000 cpbdur:82000000 q:19.19 tex:38683 mv:4974 misc:1535 imb:180 pmb:614 smb:556 d:- ref:0 ; in:8014 out:8014 type:P dur:82000000 cpbdur:82000000 q:19.26 tex:41567 mv:3557 misc:1292 imb:55 pmb:449 smb:846 d:- ref:0 ; in:8015 out:8015 type:P dur:82000000 cpbdur:82000000 q:19.32 tex:44162 mv:3851 misc:1363 imb:87 pmb:507 smb:756 d:- ref:0 ; in:8016 out:8016 type:P dur:82000000 cpbdur:82000000 q:19.44 tex:43077 mv:5047 misc:1452 imb:161 pmb:573 smb:616 d:- ref:0 ; in:8017 out:8017 type:P dur:82000000 cpbdur:82000000 q:19.19 tex:42195 mv:3480 misc:1285 imb:59 pmb:452 smb:839 d:- ref:0 ; in:8018 out:8018 type:P dur:82000000 cpbdur:82000000 q:19.49 tex:45249 mv:4989 misc:1458 imb:161 pmb:547 smb:642 d:- ref:0 ; in:8019 out:8019 type:P dur:82000000 cpbdur:82000000 q:19.20 tex:39930 mv:3223 misc:1367 imb:80 pmb:469 smb:801 d:- ref:0 ; in:8020 out:8020 type:P dur:82000000 cpbdur:82000000 q:18.95 tex:41484 mv:2761 misc:1235 imb:47 pmb:381 smb:922 d:- ref:0 ; in:8021 out:8021 type:P dur:82000000 cpbdur:82000000 q:19.38 tex:48358 mv:4815 misc:1395 imb:134 pmb:549 smb:667 d:- ref:0 ; in:8022 out:8022 type:P dur:82000000 cpbdur:82000000 q:19.53 tex:34440 mv:2972 misc:1268 imb:64 pmb:390 smb:896 d:- ref:0 ; in:8023 out:8023 type:P dur:82000000 cpbdur:82000000 q:19.09 tex:48076 mv:4815 misc:1453 imb:132 pmb:541 smb:677 d:- ref:0 ; in:8024 out:8024 type:P dur:82000000 cpbdur:82000000 q:19.44 tex:47636 mv:4405 misc:1399 imb:107 pmb:541 smb:702 d:- ref:0 ; in:8025 out:8025 type:P dur:82000000 cpbdur:82000000 q:19.31 tex:38487 mv:3956 misc:1421 imb:76 pmb:532 smb:742 d:- ref:0 ; in:8026 out:8026 type:P dur:82000000 cpbdur:82000000 q:19.56 tex:40279 mv:2566 misc:1003 imb:15 pmb:348 smb:987 d:- ref:0 ; in:8027 out:8027 type:P dur:82000000 cpbdur:82000000 q:19.27 tex:43205 mv:3769 misc:1322 imb:65 pmb:543 smb:742 d:- ref:0 ; in:8028 out:8028 type:P dur:82000000 cpbdur:82000000 q:19.66 tex:38880 mv:3495 misc:1321 imb:93 pmb:419 smb:838 d:- ref:0 ; in:8029 out:8029 type:P dur:82000000 cpbdur:82000000 q:19.74 tex:41512 mv:2695 misc:1097 imb:44 pmb:339 smb:967 d:- ref:0 ; in:8030 out:8030 type:P dur:82000000 cpbdur:82000000 q:19.74 tex:40160 mv:3459 misc:1245 imb:89 pmb:415 smb:846 d:- ref:0 ; in:8031 out:8031 type:P dur:82000000 cpbdur:82000000 q:19.70 tex:40656 mv:3385 misc:1335 imb:111 pmb:401 smb:838 d:- ref:0 ; in:8032 out:8032 type:P dur:82000000 cpbdur:82000000 q:20.34 tex:51340 mv:3397 misc:1247 imb:84 pmb:403 smb:863 d:- ref:0 ; in:8033 out:8033 type:P dur:82000000 cpbdur:82000000 q:20.03 tex:43992 mv:3363 misc:1165 imb:48 pmb:423 smb:879 d:- ref:0 ; in:8034 out:8034 type:P dur:82000000 cpbdur:82000000 q:20.08 tex:44476 mv:3691 misc:1249 imb:59 pmb:469 smb:822 d:- ref:0 ; in:8035 out:8035 type:P dur:82000000 cpbdur:82000000 q:20.47 tex:50607 mv:3368 misc:1161 imb:53 pmb:408 smb:889 d:- ref:0 ; in:8036 out:8036 type:P dur:82000000 cpbdur:82000000 q:20.19 tex:44315 mv:3497 misc:1268 imb:78 pmb:447 smb:825 d:- ref:0 ; in:8037 out:8037 type:P dur:82000000 cpbdur:82000000 q:19.91 tex:41360 mv:3140 misc:1292 imb:71 pmb:456 smb:823 d:- ref:0 ; in:8038 out:8038 type:P dur:82000000 cpbdur:82000000 q:20.40 tex:54387 mv:3414 misc:1127 imb:58 pmb:380 smb:912 d:- ref:0 ; in:8039 out:8039 type:P dur:82000000 cpbdur:82000000 q:20.24 tex:46624 mv:3278 misc:1210 imb:47 pmb:444 smb:859 d:- ref:0 ; in:8040 out:8040 type:P dur:82000000 cpbdur:82000000 q:20.04 tex:41902 mv:3058 misc:1272 imb:66 pmb:434 smb:850 d:- ref:0 ; in:8041 out:8041 type:P dur:82000000 cpbdur:82000000 q:20.82 tex:50483 mv:3408 misc:1149 imb:54 pmb:378 smb:918 d:- ref:0 ; in:8042 out:8042 type:P dur:82000000 cpbdur:82000000 q:20.41 tex:48658 mv:3522 misc:1268 imb:101 pmb:450 smb:799 d:- ref:0 ; in:8043 out:8043 type:P dur:82000000 cpbdur:82000000 q:20.29 tex:49233 mv:3637 misc:1338 imb:102 pmb:477 smb:771 d:- ref:0 ; in:8044 out:8044 type:P dur:82000000 cpbdur:82000000 q:20.54 tex:50038 mv:3292 misc:1134 imb:59 pmb:372 smb:919 d:- ref:0 ; in:8045 out:8045 type:P dur:82000000 cpbdur:82000000 q:20.16 tex:50601 mv:3615 misc:1328 imb:103 pmb:481 smb:766 d:- ref:0 ; in:8046 out:8046 type:P dur:82000000 cpbdur:82000000 q:20.15 tex:54569 mv:3301 misc:1258 imb:72 pmb:469 smb:809 d:- ref:0 ; in:8047 out:8047 type:P dur:82000000 cpbdur:82000000 q:21.28 tex:63813 mv:4099 misc:1216 imb:72 pmb:409 smb:869 d:- ref:0 ; in:8048 out:8048 type:P dur:82000000 cpbdur:82000000 q:20.79 tex:50114 mv:2935 misc:1159 imb:26 pmb:453 smb:871 d:- ref:0 ; in:8049 out:8049 type:P dur:82000000 cpbdur:82000000 q:20.12 tex:45020 mv:2648 misc:1276 imb:53 pmb:458 smb:839 d:- ref:0 ; in:8050 out:8050 type:P dur:82000000 cpbdur:82000000 q:21.37 tex:67051 mv:4412 misc:1169 imb:92 pmb:410 smb:848 d:- ref:0 ; in:8051 out:8051 type:P dur:82000000 cpbdur:82000000 q:20.50 tex:49023 mv:2563 misc:1190 imb:35 pmb:459 smb:856 d:- ref:0 ; in:8052 out:8052 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:53240 mv:3248 misc:1176 imb:51 pmb:456 smb:843 d:- ref:0 ; in:8053 out:8053 type:P dur:82000000 cpbdur:82000000 q:21.88 tex:58995 mv:4782 misc:1279 imb:125 pmb:420 smb:805 d:- ref:0 ; in:8054 out:8054 type:P dur:82000000 cpbdur:82000000 q:20.87 tex:45705 mv:3755 misc:1380 imb:151 pmb:467 smb:732 d:- ref:0 ; in:8055 out:8055 type:P dur:82000000 cpbdur:82000000 q:20.71 tex:51536 mv:5917 misc:1515 imb:369 pmb:481 smb:500 d:- ref:0 ; in:8056 out:8056 type:P dur:82000000 cpbdur:82000000 q:21.74 tex:61324 mv:5055 misc:1301 imb:152 pmb:441 smb:757 d:- ref:0 ; in:8057 out:8057 type:P dur:82000000 cpbdur:82000000 q:20.42 tex:47086 mv:3604 misc:1422 imb:153 pmb:504 smb:693 d:- ref:0 ; in:8058 out:8058 type:P dur:82000000 cpbdur:82000000 q:20.36 tex:58038 mv:3880 misc:1354 imb:151 pmb:502 smb:697 d:- ref:0 ; in:8059 out:8059 type:P dur:82000000 cpbdur:82000000 q:21.96 tex:67288 mv:4187 misc:1181 imb:90 pmb:377 smb:883 d:- ref:0 ; in:8060 out:8060 type:P dur:82000000 cpbdur:82000000 q:21.17 tex:56167 mv:3221 misc:1236 imb:55 pmb:471 smb:824 d:- ref:0 ; in:8061 out:8061 type:P dur:82000000 cpbdur:82000000 q:20.51 tex:41814 mv:2861 misc:1197 imb:49 pmb:441 smb:860 d:- ref:0 ; in:8062 out:8062 type:P dur:82000000 cpbdur:82000000 q:22.15 tex:72988 mv:7380 misc:1456 imb:325 pmb:576 smb:449 d:- ref:0 ; in:8063 out:8063 type:P dur:82000000 cpbdur:82000000 q:21.36 tex:58733 mv:6085 misc:1454 imb:311 pmb:647 smb:392 d:- ref:0 ; in:8064 out:8064 type:P dur:82000000 cpbdur:82000000 q:24.01 tex:100511 mv:12828 misc:1413 imb:1278 pmb:58 smb:14 d:- ref:0 ; in:8065 out:8065 type:P dur:82000000 cpbdur:82000000 q:22.77 tex:30066 mv:4674 misc:1212 imb:207 pmb:346 smb:797 d:- ref:0 ; in:8066 out:8066 type:P dur:82000000 cpbdur:82000000 q:23.06 tex:57147 mv:5973 misc:1176 imb:266 pmb:305 smb:779 d:- ref:0 ; in:8067 out:8067 type:P dur:82000000 cpbdur:82000000 q:22.19 tex:36772 mv:6448 misc:1436 imb:363 pmb:410 smb:577 d:- ref:0 ; in:8068 out:8068 type:P dur:82000000 cpbdur:82000000 q:23.01 tex:59260 mv:6723 misc:1361 imb:342 pmb:335 smb:673 d:- ref:0 ; in:8069 out:8069 type:P dur:82000000 cpbdur:82000000 q:21.85 tex:24809 mv:5486 misc:1417 imb:258 pmb:402 smb:690 d:- ref:0 ; in:8070 out:8070 type:P dur:82000000 cpbdur:82000000 q:22.81 tex:52893 mv:5506 misc:1241 imb:234 pmb:324 smb:792 d:- ref:0 ; in:8071 out:8071 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:25501 mv:5644 misc:1423 imb:278 pmb:398 smb:674 d:- ref:0 ; in:8072 out:8072 type:P dur:82000000 cpbdur:82000000 q:22.75 tex:57856 mv:5824 misc:1208 imb:239 pmb:312 smb:799 d:- ref:0 ; in:8073 out:8073 type:P dur:82000000 cpbdur:82000000 q:21.66 tex:23018 mv:4880 misc:1414 imb:232 pmb:382 smb:736 d:- ref:0 ; in:8074 out:8074 type:P dur:82000000 cpbdur:82000000 q:22.61 tex:58303 mv:6336 misc:1257 imb:306 pmb:306 smb:738 d:- ref:0 ; in:8075 out:8075 type:P dur:82000000 cpbdur:82000000 q:21.57 tex:27834 mv:4818 misc:1404 imb:239 pmb:376 smb:735 d:- ref:0 ; in:8076 out:8076 type:P dur:82000000 cpbdur:82000000 q:22.73 tex:62013 mv:6490 misc:1249 imb:305 pmb:304 smb:741 d:- ref:0 ; in:8077 out:8077 type:P dur:82000000 cpbdur:82000000 q:21.50 tex:34888 mv:6517 misc:1483 imb:363 pmb:451 smb:536 d:- ref:0 ; in:8078 out:8078 type:P dur:82000000 cpbdur:82000000 q:22.76 tex:60261 mv:6595 misc:1272 imb:302 pmb:305 smb:743 d:- ref:0 ; in:8079 out:8079 type:P dur:82000000 cpbdur:82000000 q:21.39 tex:32767 mv:5410 misc:1447 imb:284 pmb:434 smb:632 d:- ref:0 ; in:8080 out:8080 type:P dur:82000000 cpbdur:82000000 q:22.64 tex:59883 mv:5906 misc:1211 imb:285 pmb:302 smb:763 d:- ref:0 ; in:8081 out:8081 type:P dur:82000000 cpbdur:82000000 q:21.56 tex:30671 mv:5362 misc:1375 imb:271 pmb:396 smb:683 d:- ref:0 ; in:8082 out:8082 type:P dur:82000000 cpbdur:82000000 q:22.59 tex:57047 mv:5651 misc:1294 imb:309 pmb:299 smb:742 d:- ref:0 ; in:8083 out:8083 type:P dur:82000000 cpbdur:82000000 q:21.53 tex:29181 mv:5065 misc:1402 imb:248 pmb:371 smb:731 d:- ref:0 ; in:8084 out:8084 type:P dur:82000000 cpbdur:82000000 q:22.67 tex:59544 mv:5380 misc:1156 imb:207 pmb:316 smb:827 d:- ref:0 ; in:8085 out:8085 type:P dur:82000000 cpbdur:82000000 q:21.77 tex:34072 mv:4937 misc:1407 imb:231 pmb:413 smb:706 d:- ref:0 ; in:8086 out:8086 type:P dur:82000000 cpbdur:82000000 q:23.00 tex:72104 mv:6898 misc:1318 imb:307 pmb:368 smb:675 d:- ref:0 ; in:8087 out:8087 type:P dur:82000000 cpbdur:82000000 q:21.92 tex:49245 mv:5208 misc:1355 imb:240 pmb:408 smb:702 d:- ref:0 ; in:8088 out:8088 type:P dur:82000000 cpbdur:82000000 q:22.76 tex:69182 mv:5941 misc:1261 imb:277 pmb:357 smb:716 d:- ref:0 ; in:8089 out:8089 type:P dur:82000000 cpbdur:82000000 q:22.14 tex:56692 mv:5539 misc:1401 imb:232 pmb:473 smb:645 d:- ref:0 ; in:8090 out:8090 type:P dur:82000000 cpbdur:82000000 q:22.51 tex:64441 mv:6038 misc:1233 imb:211 pmb:374 smb:765 d:- ref:0 ; in:8091 out:8091 type:P dur:82000000 cpbdur:82000000 q:21.89 tex:54595 mv:5769 misc:1404 imb:246 pmb:485 smb:619 d:- ref:0 ; in:8092 out:8092 type:P dur:82000000 cpbdur:82000000 q:22.61 tex:68408 mv:6097 misc:1215 imb:242 pmb:397 smb:711 d:- ref:0 ; in:8093 out:8093 type:P dur:82000000 cpbdur:82000000 q:21.64 tex:39153 mv:5236 misc:1379 imb:227 pmb:462 smb:661 d:- ref:0 ; in:8094 out:8094 type:P dur:82000000 cpbdur:82000000 q:22.61 tex:67922 mv:5972 misc:1306 imb:252 pmb:380 smb:718 d:- ref:0 ; in:8095 out:8095 type:P dur:82000000 cpbdur:82000000 q:21.80 tex:44404 mv:5232 misc:1356 imb:227 pmb:434 smb:689 d:- ref:0 ; in:8096 out:8096 type:P dur:82000000 cpbdur:82000000 q:22.57 tex:67526 mv:5981 misc:1261 imb:220 pmb:403 smb:727 d:- ref:0 ; in:8097 out:8097 type:P dur:82000000 cpbdur:82000000 q:22.53 tex:45695 mv:4551 misc:1186 imb:172 pmb:373 smb:805 d:- ref:0 ; in:8098 out:8098 type:P dur:82000000 cpbdur:82000000 q:23.26 tex:77523 mv:6325 misc:1280 imb:227 pmb:409 smb:714 d:- ref:0 ; in:8099 out:8099 type:P dur:82000000 cpbdur:82000000 q:22.50 tex:56953 mv:6170 misc:1445 imb:271 pmb:486 smb:593 d:- ref:0 ; in:8100 out:8100 type:P dur:82000000 cpbdur:82000000 q:23.58 tex:75178 mv:5712 misc:1158 imb:202 pmb:350 smb:798 d:- ref:0 ; in:8101 out:8101 type:P dur:82000000 cpbdur:82000000 q:22.51 tex:41862 mv:4486 misc:1356 imb:162 pmb:482 smb:706 d:- ref:0 ; in:8102 out:8102 type:P dur:82000000 cpbdur:82000000 q:23.66 tex:94470 mv:7637 misc:1261 imb:214 pmb:443 smb:693 d:- ref:0 ; in:8103 out:8103 type:P dur:82000000 cpbdur:82000000 q:23.16 tex:62043 mv:4783 misc:1350 imb:164 pmb:465 smb:721 d:- ref:0 ; in:8104 out:8104 type:P dur:82000000 cpbdur:82000000 q:24.12 tex:92486 mv:7312 misc:1266 imb:191 pmb:452 smb:707 d:- ref:0 ; in:8105 out:8105 type:P dur:82000000 cpbdur:82000000 q:23.34 tex:60641 mv:4907 misc:1372 imb:134 pmb:537 smb:679 d:- ref:0 ; in:8106 out:8106 type:P dur:82000000 cpbdur:82000000 q:24.30 tex:95480 mv:9444 misc:1300 imb:236 pmb:524 smb:590 d:- ref:0 ; in:8107 out:8107 type:P dur:82000000 cpbdur:82000000 q:23.31 tex:57084 mv:3924 misc:1336 imb:100 pmb:518 smb:732 d:- ref:0 ; in:8108 out:8108 type:P dur:82000000 cpbdur:82000000 q:24.34 tex:99083 mv:9464 misc:1309 imb:280 pmb:490 smb:580 d:- ref:0 ; in:8109 out:8109 type:P dur:82000000 cpbdur:82000000 q:23.55 tex:42129 mv:3370 misc:1189 imb:87 pmb:368 smb:895 d:- ref:0 ; in:8110 out:8110 type:P dur:82000000 cpbdur:82000000 q:24.11 tex:88378 mv:7332 misc:1282 imb:205 pmb:432 smb:713 d:- ref:0 ; in:8111 out:8111 type:P dur:82000000 cpbdur:82000000 q:23.17 tex:54904 mv:5315 misc:1405 imb:174 pmb:509 smb:667 d:- ref:0 ; in:8112 out:8112 type:P dur:82000000 cpbdur:82000000 q:23.90 tex:77439 mv:7250 misc:1247 imb:177 pmb:430 smb:743 d:- ref:0 ; in:8113 out:8113 type:P dur:82000000 cpbdur:82000000 q:22.23 tex:54165 mv:4089 misc:1466 imb:143 pmb:571 smb:636 d:- ref:0 ; in:8114 out:8114 type:P dur:82000000 cpbdur:82000000 q:20.51 tex:27151 mv:2813 misc:1428 imb:91 pmb:541 smb:718 d:- ref:0 ; in:8115 out:8115 type:P dur:82000000 cpbdur:82000000 q:18.79 tex:73036 mv:4277 misc:1543 imb:134 pmb:755 smb:461 d:- ref:0 ; in:8116 out:8116 type:P dur:82000000 cpbdur:82000000 q:20.75 tex:69283 mv:4903 misc:1294 imb:73 pmb:511 smb:766 d:- ref:0 ; in:8117 out:8117 type:P dur:82000000 cpbdur:82000000 q:20.83 tex:56936 mv:4270 misc:1130 imb:22 pmb:504 smb:824 d:- ref:0 ; in:8118 out:8118 type:P dur:82000000 cpbdur:82000000 q:24.83 tex:265376 mv:15403 misc:1413 imb:1219 pmb:131 smb:0 d:- ref:0 ; in:8119 out:8119 type:P dur:82000000 cpbdur:82000000 q:25.77 tex:51355 mv:4886 misc:1359 imb:61 pmb:624 smb:665 d:- ref:0 ; in:8120 out:8120 type:P dur:82000000 cpbdur:82000000 q:24.95 tex:78269 mv:6101 misc:1390 imb:96 pmb:687 smb:567 d:- ref:0 ; in:8121 out:8121 type:P dur:82000000 cpbdur:82000000 q:24.31 tex:91375 mv:5748 misc:1413 imb:117 pmb:654 smb:579 d:- ref:0 ; in:8122 out:8122 type:P dur:82000000 cpbdur:82000000 q:23.38 tex:77863 mv:4413 misc:1476 imb:108 pmb:699 smb:543 d:- ref:0 ; in:8123 out:8123 type:P dur:82000000 cpbdur:82000000 q:22.28 tex:66956 mv:3821 misc:1527 imb:78 pmb:757 smb:515 d:- ref:0 ; in:8124 out:8124 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:84285 mv:4773 misc:1366 imb:54 pmb:635 smb:661 d:- ref:0 ; in:8125 out:8125 type:P dur:82000000 cpbdur:82000000 q:21.72 tex:60819 mv:3228 misc:1449 imb:43 pmb:678 smb:629 d:- ref:0 ; in:8126 out:8126 type:P dur:82000000 cpbdur:82000000 q:21.15 tex:74548 mv:3680 misc:1540 imb:66 pmb:822 smb:462 d:- ref:0 ; in:8127 out:8127 type:P dur:82000000 cpbdur:82000000 q:22.79 tex:106524 mv:5746 misc:1394 imb:93 pmb:616 smb:641 d:- ref:0 ; in:8128 out:8128 type:P dur:82000000 cpbdur:82000000 q:22.03 tex:73312 mv:3726 misc:1466 imb:45 pmb:708 smb:597 d:- ref:0 ; in:8129 out:8129 type:P dur:82000000 cpbdur:82000000 q:21.31 tex:79671 mv:3735 misc:1498 imb:71 pmb:739 smb:540 d:- ref:0 ; in:8130 out:8130 type:P dur:82000000 cpbdur:82000000 q:23.11 tex:103993 mv:5150 misc:1313 imb:168 pmb:504 smb:678 d:- ref:0 ; in:8131 out:8131 type:P dur:82000000 cpbdur:82000000 q:22.30 tex:61328 mv:3072 misc:1448 imb:21 pmb:656 smb:673 d:- ref:0 ; in:8132 out:8132 type:P dur:82000000 cpbdur:82000000 q:21.30 tex:69926 mv:3426 misc:1520 imb:48 pmb:756 smb:546 d:- ref:0 ; in:8133 out:8133 type:P dur:82000000 cpbdur:82000000 q:23.84 tex:117459 mv:7400 misc:1413 imb:266 pmb:558 smb:526 d:- ref:0 ; in:8134 out:8134 type:P dur:82000000 cpbdur:82000000 q:23.05 tex:65255 mv:4187 misc:1470 imb:76 pmb:663 smb:611 d:- ref:0 ; in:8135 out:8135 type:P dur:82000000 cpbdur:82000000 q:22.19 tex:72024 mv:3431 misc:1473 imb:39 pmb:723 smb:588 d:- ref:0 ; in:8136 out:8136 type:P dur:82000000 cpbdur:82000000 q:23.61 tex:107252 mv:6942 misc:1414 imb:177 pmb:604 smb:569 d:- ref:0 ; in:8137 out:8137 type:P dur:82000000 cpbdur:82000000 q:23.50 tex:80583 mv:5253 misc:1404 imb:68 pmb:685 smb:597 d:- ref:0 ; in:8138 out:8138 type:P dur:82000000 cpbdur:82000000 q:23.04 tex:86427 mv:4268 misc:1417 imb:35 pmb:724 smb:591 d:- ref:0 ; in:8139 out:8139 type:P dur:82000000 cpbdur:82000000 q:23.97 tex:105932 mv:6319 misc:1357 imb:158 pmb:553 smb:639 d:- ref:0 ; in:8140 out:8140 type:P dur:82000000 cpbdur:82000000 q:23.15 tex:76853 mv:3883 misc:1384 imb:32 pmb:687 smb:631 d:- ref:0 ; in:8141 out:8141 type:P dur:82000000 cpbdur:82000000 q:21.81 tex:57998 mv:3525 misc:1533 imb:56 pmb:727 smb:567 d:- ref:0 ; in:8142 out:8142 type:P dur:82000000 cpbdur:82000000 q:24.04 tex:119685 mv:6352 misc:1211 imb:180 pmb:446 smb:724 d:- ref:0 ; in:8143 out:8143 type:P dur:82000000 cpbdur:82000000 q:23.49 tex:90232 mv:3934 misc:1434 imb:41 pmb:736 smb:573 d:- ref:0 ; in:8144 out:8144 type:P dur:82000000 cpbdur:82000000 q:23.24 tex:89588 mv:4902 misc:1414 imb:45 pmb:726 smb:579 d:- ref:0 ; in:8145 out:8145 type:P dur:82000000 cpbdur:82000000 q:24.12 tex:94627 mv:5151 misc:1086 imb:117 pmb:337 smb:896 d:- ref:0 ; in:8146 out:8146 type:P dur:82000000 cpbdur:82000000 q:22.63 tex:50353 mv:2818 misc:1437 imb:32 pmb:624 smb:694 d:- ref:0 ; in:8147 out:8147 type:P dur:82000000 cpbdur:82000000 q:22.87 tex:92958 mv:4367 misc:1411 imb:69 pmb:743 smb:538 d:- ref:0 ; in:8148 out:8148 type:P dur:82000000 cpbdur:82000000 q:24.86 tex:133600 mv:9855 misc:1425 imb:402 pmb:683 smb:265 d:- ref:0 ; in:8149 out:8149 type:P dur:82000000 cpbdur:82000000 q:23.33 tex:62961 mv:4362 misc:1501 imb:150 pmb:802 smb:398 d:- ref:0 ; in:8150 out:8150 type:P dur:82000000 cpbdur:82000000 q:22.97 tex:82880 mv:5027 misc:1525 imb:151 pmb:801 smb:398 d:- ref:0 ; in:8151 out:8151 type:P dur:82000000 cpbdur:82000000 q:22.52 tex:65782 mv:3919 misc:1395 imb:47 pmb:687 smb:616 d:- ref:0 ; in:8152 out:8152 type:P dur:82000000 cpbdur:82000000 q:21.00 tex:86900 mv:4516 misc:1528 imb:120 pmb:964 smb:266 d:- ref:0 ; in:8153 out:8153 type:P dur:82000000 cpbdur:82000000 q:21.71 tex:82802 mv:3547 misc:1419 imb:23 pmb:711 smb:616 d:- ref:0 ; in:8154 out:8154 type:P dur:82000000 cpbdur:82000000 q:22.21 tex:84323 mv:4293 misc:1440 imb:42 pmb:721 smb:587 d:- ref:0 ; in:8155 out:8155 type:P dur:82000000 cpbdur:82000000 q:21.80 tex:67805 mv:3126 misc:1413 imb:29 pmb:644 smb:677 d:- ref:0 ; in:8156 out:8156 type:P dur:82000000 cpbdur:82000000 q:22.35 tex:94742 mv:4522 misc:1464 imb:24 pmb:792 smb:534 d:- ref:0 ; in:8157 out:8157 type:P dur:82000000 cpbdur:82000000 q:22.36 tex:79013 mv:4018 misc:1433 imb:26 pmb:714 smb:610 d:- ref:0 ; in:8158 out:8158 type:P dur:82000000 cpbdur:82000000 q:20.60 tex:35122 mv:2353 misc:1525 imb:24 pmb:653 smb:673 d:- ref:0 ; in:8159 out:8159 type:P dur:82000000 cpbdur:82000000 q:22.14 tex:103972 mv:4994 misc:1474 imb:71 pmb:766 smb:513 d:- ref:0 ; in:8160 out:8160 type:P dur:82000000 cpbdur:82000000 q:22.98 tex:96466 mv:5810 misc:1468 imb:78 pmb:722 smb:550 d:- ref:0 ; in:8161 out:8161 type:P dur:82000000 cpbdur:82000000 q:22.25 tex:85302 mv:3320 misc:1498 imb:37 pmb:744 smb:569 d:- ref:0 ; in:8162 out:8162 type:P dur:82000000 cpbdur:82000000 q:21.84 tex:71198 mv:3170 misc:1456 imb:28 pmb:680 smb:642 d:- ref:0 ; in:8163 out:8163 type:P dur:82000000 cpbdur:82000000 q:22.25 tex:93531 mv:3580 misc:1433 imb:28 pmb:742 smb:580 d:- ref:0 ; in:8164 out:8164 type:P dur:82000000 cpbdur:82000000 q:22.44 tex:97502 mv:5445 misc:1421 imb:42 pmb:817 smb:491 d:- ref:0 ; in:8165 out:8165 type:P dur:82000000 cpbdur:82000000 q:21.19 tex:63401 mv:3139 misc:1524 imb:40 pmb:769 smb:541 d:- ref:0 ; in:8166 out:8166 type:P dur:82000000 cpbdur:82000000 q:21.94 tex:95285 mv:3970 misc:1457 imb:23 pmb:748 smb:579 d:- ref:0 ; in:8167 out:8167 type:P dur:82000000 cpbdur:82000000 q:21.89 tex:67038 mv:3309 misc:1413 imb:11 pmb:667 smb:672 d:- ref:0 ; in:8168 out:8168 type:P dur:82000000 cpbdur:82000000 q:22.18 tex:97005 mv:5294 misc:1461 imb:51 pmb:782 smb:517 d:- ref:0 ; in:8169 out:8169 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:73034 mv:2909 misc:1385 imb:15 pmb:615 smb:720 d:- ref:0 ; in:8170 out:8170 type:P dur:82000000 cpbdur:82000000 q:22.50 tex:104737 mv:5435 misc:1420 imb:17 pmb:785 smb:548 d:- ref:0 ; in:8171 out:8171 type:P dur:82000000 cpbdur:82000000 q:22.68 tex:80955 mv:4576 misc:1349 imb:13 pmb:686 smb:651 d:- ref:0 ; in:8172 out:8172 type:P dur:82000000 cpbdur:82000000 q:21.65 tex:63902 mv:2922 misc:1408 imb:19 pmb:668 smb:663 d:- ref:0 ; in:8173 out:8173 type:P dur:82000000 cpbdur:82000000 q:22.09 tex:94681 mv:4175 misc:1448 imb:29 pmb:747 smb:574 d:- ref:0 ; in:8174 out:8174 type:P dur:82000000 cpbdur:82000000 q:21.98 tex:71421 mv:3415 misc:1396 imb:12 pmb:665 smb:673 d:- ref:0 ; in:8175 out:8175 type:P dur:82000000 cpbdur:82000000 q:19.87 tex:59807 mv:2823 misc:1522 imb:23 pmb:839 smb:488 d:- ref:0 ; in:8176 out:8176 type:P dur:82000000 cpbdur:82000000 q:21.00 tex:79681 mv:3475 misc:1436 imb:16 pmb:669 smb:665 d:- ref:0 ; in:8177 out:8177 type:P dur:82000000 cpbdur:82000000 q:21.21 tex:67706 mv:3102 misc:1336 imb:7 pmb:594 smb:749 d:- ref:0 ; in:8178 out:8178 type:P dur:82000000 cpbdur:82000000 q:25.21 tex:245447 mv:15786 misc:1415 imb:1208 pmb:142 smb:0 d:- ref:0 ; in:8179 out:8179 type:P dur:82000000 cpbdur:82000000 q:24.83 tex:16120 mv:1203 misc:1021 imb:0 pmb:337 smb:1013 d:- ref:0 ; in:8180 out:8180 type:P dur:82000000 cpbdur:82000000 q:23.03 tex:40051 mv:2191 misc:1334 imb:11 pmb:581 smb:758 d:- ref:0 ; in:8181 out:8181 type:P dur:82000000 cpbdur:82000000 q:21.57 tex:52955 mv:3277 misc:1472 imb:36 pmb:825 smb:489 d:- ref:0 ; in:8182 out:8182 type:P dur:82000000 cpbdur:82000000 q:20.07 tex:82124 mv:3288 misc:1500 imb:29 pmb:964 smb:357 d:- ref:0 ; in:8183 out:8183 type:P dur:82000000 cpbdur:82000000 q:19.26 tex:80427 mv:4016 misc:1517 imb:26 pmb:1088 smb:236 d:- ref:0 ; in:8184 out:8184 type:P dur:82000000 cpbdur:82000000 q:17.82 tex:40731 mv:2907 misc:1586 imb:17 pmb:867 smb:466 d:- ref:0 ; in:8185 out:8185 type:P dur:82000000 cpbdur:82000000 q:18.37 tex:44096 mv:3055 misc:1577 imb:33 pmb:775 smb:542 d:- ref:0 ; in:8186 out:8186 type:P dur:82000000 cpbdur:82000000 q:17.24 tex:61100 mv:3432 misc:1556 imb:14 pmb:1034 smb:302 d:- ref:0 ; in:8187 out:8187 type:P dur:82000000 cpbdur:82000000 q:17.13 tex:31029 mv:2872 misc:1611 imb:19 pmb:826 smb:505 d:- ref:0 ; in:8188 out:8188 type:P dur:82000000 cpbdur:82000000 q:15.45 tex:101363 mv:4510 misc:1503 imb:33 pmb:1180 smb:137 d:- ref:0 ; in:8189 out:8189 type:P dur:82000000 cpbdur:82000000 q:16.53 tex:25951 mv:2298 misc:1495 imb:22 pmb:632 smb:696 d:- ref:0 ; in:8190 out:8190 type:P dur:82000000 cpbdur:82000000 q:15.42 tex:36561 mv:3021 misc:1570 imb:31 pmb:759 smb:560 d:- ref:0 ; in:8191 out:8191 type:P dur:82000000 cpbdur:82000000 q:17.59 tex:35707 mv:2326 misc:1471 imb:17 pmb:644 smb:689 d:- ref:0 ; in:8192 out:8192 type:P dur:82000000 cpbdur:82000000 q:16.74 tex:33268 mv:2358 misc:1550 imb:20 pmb:646 smb:684 d:- ref:0 ; in:8193 out:8193 type:P dur:82000000 cpbdur:82000000 q:17.75 tex:37672 mv:2245 misc:1459 imb:20 pmb:631 smb:699 d:- ref:0 ; in:8194 out:8194 type:P dur:82000000 cpbdur:82000000 q:17.12 tex:48873 mv:2805 misc:1538 imb:23 pmb:765 smb:562 d:- ref:0 ; in:8195 out:8195 type:P dur:82000000 cpbdur:82000000 q:16.99 tex:31614 mv:2473 misc:1553 imb:16 pmb:701 smb:633 d:- ref:0 ; in:8196 out:8196 type:P dur:82000000 cpbdur:82000000 q:17.86 tex:34109 mv:2530 misc:1473 imb:23 pmb:628 smb:699 d:- ref:0 ; in:8197 out:8197 type:P dur:82000000 cpbdur:82000000 q:16.47 tex:68013 mv:3890 misc:1553 imb:33 pmb:1100 smb:217 d:- ref:0 ; in:8198 out:8198 type:P dur:82000000 cpbdur:82000000 q:17.43 tex:32522 mv:2885 misc:1577 imb:27 pmb:763 smb:560 d:- ref:0 ; in:8199 out:8199 type:P dur:82000000 cpbdur:82000000 q:15.87 tex:26618 mv:2508 misc:1610 imb:10 pmb:758 smb:582 d:- ref:0 ; in:8200 out:8200 type:P dur:82000000 cpbdur:82000000 q:16.64 tex:20918 mv:2321 misc:1521 imb:23 pmb:631 smb:696 d:- ref:0 ; in:8201 out:8201 type:P dur:82000000 cpbdur:82000000 q:15.56 tex:22553 mv:2389 misc:1570 imb:17 pmb:685 smb:648 d:- ref:0 ; in:8202 out:8202 type:P dur:82000000 cpbdur:82000000 q:16.54 tex:17532 mv:2344 misc:1564 imb:28 pmb:636 smb:686 d:- ref:0 ; in:8203 out:8203 type:P dur:82000000 cpbdur:82000000 q:15.52 tex:27913 mv:2609 misc:1614 imb:20 pmb:753 smb:577 d:- ref:0 ; in:8204 out:8204 type:P dur:82000000 cpbdur:82000000 q:16.36 tex:34462 mv:2444 misc:1558 imb:13 pmb:724 smb:613 d:- ref:0 ; in:8205 out:8205 type:P dur:82000000 cpbdur:82000000 q:17.64 tex:30964 mv:2534 misc:1478 imb:23 pmb:658 smb:669 d:- ref:0 ; in:8206 out:8206 type:P dur:82000000 cpbdur:82000000 q:16.20 tex:37960 mv:2881 misc:1583 imb:22 pmb:825 smb:503 d:- ref:0 ; in:8207 out:8207 type:P dur:82000000 cpbdur:82000000 q:17.00 tex:23268 mv:2578 misc:1546 imb:27 pmb:674 smb:649 d:- ref:0 ; in:8208 out:8208 type:P dur:82000000 cpbdur:82000000 q:15.73 tex:24277 mv:2416 misc:1595 imb:14 pmb:716 smb:620 d:- ref:0 ; in:8209 out:8209 type:P dur:82000000 cpbdur:82000000 q:16.25 tex:24843 mv:2507 misc:1554 imb:31 pmb:665 smb:654 d:- ref:0 ; in:8210 out:8210 type:P dur:82000000 cpbdur:82000000 q:14.63 tex:23375 mv:2408 misc:1505 imb:24 pmb:614 smb:712 d:- ref:0 ; in:8211 out:8211 type:P dur:82000000 cpbdur:82000000 q:15.48 tex:27773 mv:2492 misc:1519 imb:22 pmb:618 smb:710 d:- ref:0 ; in:8212 out:8212 type:P dur:82000000 cpbdur:82000000 q:16.65 tex:26945 mv:2206 misc:1505 imb:14 pmb:656 smb:680 d:- ref:0 ; in:8213 out:8213 type:P dur:82000000 cpbdur:82000000 q:16.88 tex:23805 mv:1712 misc:1379 imb:15 pmb:474 smb:861 d:- ref:0 ; in:8214 out:8214 type:P dur:82000000 cpbdur:82000000 q:15.93 tex:32184 mv:2859 misc:1589 imb:29 pmb:801 smb:520 d:- ref:0 ; in:8215 out:8215 type:P dur:82000000 cpbdur:82000000 q:16.37 tex:23866 mv:2410 misc:1564 imb:32 pmb:634 smb:684 d:- ref:0 ; in:8216 out:8216 type:P dur:82000000 cpbdur:82000000 q:15.50 tex:23221 mv:2471 misc:1524 imb:26 pmb:585 smb:739 d:- ref:0 ; in:8217 out:8217 type:P dur:82000000 cpbdur:82000000 q:16.16 tex:20826 mv:2367 misc:1567 imb:33 pmb:643 smb:674 d:- ref:0 ; in:8218 out:8218 type:P dur:82000000 cpbdur:82000000 q:14.75 tex:12774 mv:1601 misc:1385 imb:15 pmb:401 smb:934 d:- ref:0 ; in:8219 out:8219 type:P dur:82000000 cpbdur:82000000 q:15.76 tex:18073 mv:2202 misc:1517 imb:34 pmb:572 smb:744 d:- ref:0 ; in:8220 out:8220 type:P dur:82000000 cpbdur:82000000 q:14.30 tex:50905 mv:3842 misc:1589 imb:29 pmb:1006 smb:315 d:- ref:0 ; in:8221 out:8221 type:P dur:82000000 cpbdur:82000000 q:15.96 tex:20739 mv:2420 misc:1545 imb:26 pmb:666 smb:658 d:- ref:0 ; in:8222 out:8222 type:P dur:82000000 cpbdur:82000000 q:14.37 tex:26344 mv:2540 misc:1596 imb:22 pmb:676 smb:652 d:- ref:0 ; in:8223 out:8223 type:P dur:82000000 cpbdur:82000000 q:13.35 tex:123806 mv:4306 misc:1456 imb:14 pmb:1296 smb:40 d:- ref:0 ; in:8224 out:8224 type:P dur:82000000 cpbdur:82000000 q:14.33 tex:14460 mv:1674 misc:1418 imb:5 pmb:460 smb:885 d:- ref:0 ; in:8225 out:8225 type:P dur:82000000 cpbdur:82000000 q:12.99 tex:32363 mv:2336 misc:1597 imb:4 pmb:728 smb:618 d:- ref:0 ; in:8226 out:8226 type:P dur:82000000 cpbdur:82000000 q:16.99 tex:468866 mv:16898 misc:1420 imb:1220 pmb:130 smb:0 d:- ref:0 ; in:8227 out:8227 type:P dur:82000000 cpbdur:82000000 q:20.99 tex:15078 mv:1182 misc:1116 imb:0 pmb:332 smb:1018 d:- ref:0 ; in:8228 out:8228 type:P dur:82000000 cpbdur:82000000 q:22.26 tex:15472 mv:1216 misc:1096 imb:6 pmb:330 smb:1014 d:- ref:0 ; in:8229 out:8229 type:P dur:82000000 cpbdur:82000000 q:20.66 tex:15859 mv:1560 misc:1269 imb:12 pmb:412 smb:926 d:- ref:0 ; in:8230 out:8230 type:P dur:82000000 cpbdur:82000000 q:18.91 tex:27672 mv:2186 misc:1470 imb:15 pmb:602 smb:733 d:- ref:0 ; in:8231 out:8231 type:P dur:82000000 cpbdur:82000000 q:18.88 tex:39596 mv:2402 misc:1394 imb:18 pmb:594 smb:738 d:- ref:0 ; in:8232 out:8232 type:P dur:82000000 cpbdur:82000000 q:21.03 tex:83171 mv:5230 misc:1335 imb:32 pmb:712 smb:606 d:- ref:0 ; in:8233 out:8233 type:P dur:82000000 cpbdur:82000000 q:19.13 tex:51604 mv:2954 misc:1466 imb:46 pmb:720 smb:584 d:- ref:0 ; in:8234 out:8234 type:P dur:82000000 cpbdur:82000000 q:18.26 tex:39323 mv:2805 misc:1528 imb:41 pmb:731 smb:578 d:- ref:0 ; in:8235 out:8235 type:P dur:82000000 cpbdur:82000000 q:19.95 tex:66798 mv:3004 misc:1342 imb:19 pmb:608 smb:723 d:- ref:0 ; in:8236 out:8236 type:P dur:82000000 cpbdur:82000000 q:19.48 tex:50799 mv:2972 misc:1461 imb:36 pmb:646 smb:668 d:- ref:0 ; in:8237 out:8237 type:P dur:82000000 cpbdur:82000000 q:18.37 tex:28432 mv:2202 misc:1510 imb:26 pmb:594 smb:730 d:- ref:0 ; in:8238 out:8238 type:P dur:82000000 cpbdur:82000000 q:20.06 tex:66188 mv:2952 misc:1324 imb:38 pmb:576 smb:736 d:- ref:0 ; in:8239 out:8239 type:P dur:82000000 cpbdur:82000000 q:19.65 tex:31857 mv:1891 misc:1276 imb:31 pmb:441 smb:878 d:- ref:0 ; in:8240 out:8240 type:P dur:82000000 cpbdur:82000000 q:19.69 tex:54732 mv:2258 misc:1250 imb:8 pmb:534 smb:808 d:- ref:0 ; in:8241 out:8241 type:P dur:82000000 cpbdur:82000000 q:18.59 tex:38432 mv:2961 misc:1503 imb:44 pmb:729 smb:577 d:- ref:0 ; in:8242 out:8242 type:P dur:82000000 cpbdur:82000000 q:19.76 tex:39351 mv:2578 misc:1351 imb:54 pmb:584 smb:712 d:- ref:0 ; in:8243 out:8243 type:P dur:82000000 cpbdur:82000000 q:19.30 tex:48000 mv:4897 misc:1527 imb:163 pmb:865 smb:322 d:- ref:0 ; in:8244 out:8244 type:P dur:82000000 cpbdur:82000000 q:18.32 tex:36542 mv:4209 misc:1569 imb:125 pmb:791 smb:434 d:- ref:0 ; in:8245 out:8245 type:P dur:82000000 cpbdur:82000000 q:18.10 tex:29625 mv:4204 misc:1595 imb:125 pmb:760 smb:465 d:- ref:0 ; in:8246 out:8246 type:P dur:82000000 cpbdur:82000000 q:16.66 tex:45440 mv:3445 misc:1571 imb:52 pmb:925 smb:373 d:- ref:0 ; in:8247 out:8247 type:P dur:82000000 cpbdur:82000000 q:16.41 tex:74263 mv:4252 misc:1525 imb:84 pmb:1070 smb:196 d:- ref:0 ; in:8248 out:8248 type:P dur:82000000 cpbdur:82000000 q:14.97 tex:32805 mv:2845 misc:1566 imb:39 pmb:689 smb:622 d:- ref:0 ; in:8249 out:8249 type:P dur:82000000 cpbdur:82000000 q:15.80 tex:30822 mv:1490 misc:1288 imb:8 pmb:426 smb:916 d:- ref:0 ; in:8250 out:8250 type:I dur:82000000 cpbdur:82000000 q:14.91 tex:517447 mv:14626 misc:375 imb:1350 pmb:0 smb:0 d:- ref:; in:8251 out:8251 type:P dur:82000000 cpbdur:82000000 q:19.80 tex:23335 mv:1255 misc:1034 imb:6 pmb:323 smb:1021 d:- ref:0 ; in:8252 out:8252 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:19154 mv:1257 misc:1069 imb:0 pmb:353 smb:997 d:- ref:0 ; in:8253 out:8253 type:P dur:82000000 cpbdur:82000000 q:20.72 tex:24774 mv:1515 misc:1191 imb:8 pmb:431 smb:911 d:- ref:0 ; in:8254 out:8254 type:P dur:82000000 cpbdur:82000000 q:19.00 tex:46401 mv:2404 misc:1379 imb:15 pmb:638 smb:697 d:- ref:0 ; in:8255 out:8255 type:P dur:82000000 cpbdur:82000000 q:17.88 tex:21986 mv:1715 misc:1347 imb:17 pmb:483 smb:850 d:- ref:0 ; in:8256 out:8256 type:P dur:82000000 cpbdur:82000000 q:16.59 tex:34890 mv:2531 misc:1523 imb:34 pmb:683 smb:633 d:- ref:0 ; in:8257 out:8257 type:P dur:82000000 cpbdur:82000000 q:17.51 tex:37328 mv:2147 misc:1421 imb:17 pmb:587 smb:746 d:- ref:0 ; in:8258 out:8258 type:P dur:82000000 cpbdur:82000000 q:19.01 tex:65752 mv:3140 misc:1308 imb:32 pmb:600 smb:718 d:- ref:0 ; in:8259 out:8259 type:P dur:82000000 cpbdur:82000000 q:22.54 tex:88110 mv:6759 misc:1195 imb:129 pmb:555 smb:666 d:- ref:0 ; in:8260 out:8260 type:P dur:82000000 cpbdur:82000000 q:21.57 tex:53382 mv:2769 misc:1281 imb:20 pmb:565 smb:765 d:- ref:0 ; in:8261 out:8261 type:P dur:82000000 cpbdur:82000000 q:20.02 tex:44020 mv:2518 misc:1342 imb:31 pmb:622 smb:697 d:- ref:0 ; in:8262 out:8262 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:85204 mv:6015 misc:1245 imb:101 pmb:555 smb:694 d:- ref:0 ; in:8263 out:8263 type:P dur:82000000 cpbdur:82000000 q:20.69 tex:29085 mv:1921 misc:1306 imb:23 pmb:507 smb:820 d:- ref:0 ; in:8264 out:8264 type:P dur:82000000 cpbdur:82000000 q:20.37 tex:57105 mv:2927 misc:1400 imb:47 pmb:619 smb:684 d:- ref:0 ; in:8265 out:8265 type:P dur:82000000 cpbdur:82000000 q:22.86 tex:95417 mv:6843 misc:1220 imb:92 pmb:635 smb:623 d:- ref:0 ; in:8266 out:8266 type:P dur:82000000 cpbdur:82000000 q:21.07 tex:55634 mv:2593 misc:1325 imb:42 pmb:635 smb:673 d:- ref:0 ; in:8267 out:8267 type:P dur:82000000 cpbdur:82000000 q:19.72 tex:38289 mv:1993 misc:1278 imb:19 pmb:529 smb:802 d:- ref:0 ; in:8268 out:8268 type:P dur:82000000 cpbdur:82000000 q:19.58 tex:39580 mv:2546 misc:1370 imb:53 pmb:556 smb:741 d:- ref:0 ; in:8269 out:8269 type:P dur:82000000 cpbdur:82000000 q:19.02 tex:71960 mv:3913 misc:1551 imb:71 pmb:859 smb:420 d:- ref:0 ; in:8270 out:8270 type:P dur:82000000 cpbdur:82000000 q:18.14 tex:56053 mv:3118 misc:1501 imb:56 pmb:726 smb:568 d:- ref:0 ; in:8271 out:8271 type:P dur:82000000 cpbdur:82000000 q:18.59 tex:54586 mv:2538 misc:1404 imb:28 pmb:636 smb:686 d:- ref:0 ; in:8272 out:8272 type:P dur:82000000 cpbdur:82000000 q:17.20 tex:73722 mv:3652 misc:1554 imb:58 pmb:946 smb:346 d:- ref:0 ; in:8273 out:8273 type:P dur:82000000 cpbdur:82000000 q:16.53 tex:27560 mv:2145 misc:1511 imb:17 pmb:619 smb:714 d:- ref:0 ; in:8274 out:8274 type:P dur:82000000 cpbdur:82000000 q:16.94 tex:41212 mv:2567 misc:1565 imb:22 pmb:725 smb:603 d:- ref:0 ; in:8275 out:8275 type:P dur:82000000 cpbdur:82000000 q:17.70 tex:43691 mv:2483 misc:1482 imb:23 pmb:677 smb:650 d:- ref:0 ; in:8276 out:8276 type:P dur:82000000 cpbdur:82000000 q:17.49 tex:52169 mv:3206 misc:1569 imb:42 pmb:866 smb:442 d:- ref:0 ; in:8277 out:8277 type:P dur:82000000 cpbdur:82000000 q:17.77 tex:37619 mv:2396 misc:1465 imb:20 pmb:634 smb:696 d:- ref:0 ; in:8278 out:8278 type:P dur:82000000 cpbdur:82000000 q:16.21 tex:76449 mv:3773 misc:1514 imb:46 pmb:1063 smb:241 d:- ref:0 ; in:8279 out:8279 type:P dur:82000000 cpbdur:82000000 q:16.23 tex:31840 mv:2371 misc:1549 imb:35 pmb:645 smb:670 d:- ref:0 ; in:8280 out:8280 type:P dur:82000000 cpbdur:82000000 q:17.51 tex:35931 mv:2599 misc:1510 imb:24 pmb:695 smb:631 d:- ref:0 ; in:8281 out:8281 type:P dur:82000000 cpbdur:82000000 q:15.79 tex:40541 mv:2776 misc:1579 imb:36 pmb:796 smb:518 d:- ref:0 ; in:8282 out:8282 type:P dur:82000000 cpbdur:82000000 q:16.56 tex:22410 mv:2730 misc:1548 imb:47 pmb:700 smb:603 d:- ref:0 ; in:8283 out:8283 type:P dur:82000000 cpbdur:82000000 q:15.23 tex:46248 mv:3744 misc:1576 imb:58 pmb:846 smb:446 d:- ref:0 ; in:8284 out:8284 type:P dur:82000000 cpbdur:82000000 q:16.24 tex:30677 mv:2715 misc:1584 imb:35 pmb:733 smb:582 d:- ref:0 ; in:8285 out:8285 type:P dur:82000000 cpbdur:82000000 q:15.98 tex:26757 mv:1521 misc:1298 imb:11 pmb:433 smb:906 d:- ref:0 ; in:8286 out:8286 type:P dur:82000000 cpbdur:82000000 q:17.07 tex:26719 mv:2721 misc:1560 imb:34 pmb:673 smb:643 d:- ref:0 ; in:8287 out:8287 type:P dur:82000000 cpbdur:82000000 q:16.50 tex:15535 mv:1560 misc:1369 imb:18 pmb:424 smb:908 d:- ref:0 ; in:8288 out:8288 type:P dur:82000000 cpbdur:82000000 q:15.41 tex:37753 mv:3569 misc:1574 imb:51 pmb:767 smb:532 d:- ref:0 ; in:8289 out:8289 type:P dur:82000000 cpbdur:82000000 q:16.19 tex:24387 mv:2327 misc:1558 imb:34 pmb:647 smb:669 d:- ref:0 ; in:8290 out:8290 type:P dur:82000000 cpbdur:82000000 q:16.22 tex:28735 mv:1509 misc:1268 imb:13 pmb:435 smb:902 d:- ref:0 ; in:8291 out:8291 type:P dur:82000000 cpbdur:82000000 q:16.96 tex:30196 mv:2524 misc:1536 imb:28 pmb:674 smb:648 d:- ref:0 ; in:8292 out:8292 type:P dur:82000000 cpbdur:82000000 q:16.63 tex:23295 mv:2012 misc:1437 imb:43 pmb:490 smb:817 d:- ref:0 ; in:8293 out:8293 type:P dur:82000000 cpbdur:82000000 q:17.61 tex:26679 mv:2919 misc:1522 imb:75 pmb:639 smb:636 d:- ref:0 ; in:8294 out:8294 type:P dur:82000000 cpbdur:82000000 q:16.19 tex:46382 mv:3984 misc:1578 imb:97 pmb:950 smb:303 d:- ref:0 ; in:8295 out:8295 type:P dur:82000000 cpbdur:82000000 q:16.46 tex:27037 mv:2369 misc:1546 imb:34 pmb:633 smb:683 d:- ref:0 ; in:8296 out:8296 type:P dur:82000000 cpbdur:82000000 q:15.29 tex:23530 mv:2545 misc:1509 imb:48 pmb:549 smb:753 d:- ref:0 ; in:8297 out:8297 type:P dur:82000000 cpbdur:82000000 q:13.98 tex:58294 mv:3365 misc:1573 imb:30 pmb:931 smb:389 d:- ref:0 ; in:8298 out:8298 type:P dur:82000000 cpbdur:82000000 q:16.83 tex:17602 mv:2483 misc:1507 imb:62 pmb:595 smb:693 d:- ref:0 ; in:8299 out:8299 type:P dur:82000000 cpbdur:82000000 q:17.68 tex:16336 mv:3610 misc:1550 imb:150 pmb:570 smb:630 d:- ref:0 ; in:8300 out:8300 type:P dur:82000000 cpbdur:82000000 q:17.15 tex:40108 mv:4759 misc:1581 imb:173 pmb:819 smb:358 d:- ref:0 ; in:8301 out:8301 type:P dur:82000000 cpbdur:82000000 q:17.45 tex:29094 mv:3729 misc:1593 imb:99 pmb:783 smb:468 d:- ref:0 ; in:8302 out:8302 type:P dur:82000000 cpbdur:82000000 q:17.96 tex:31689 mv:3150 misc:1529 imb:75 pmb:712 smb:563 d:- ref:0 ; in:8303 out:8303 type:P dur:82000000 cpbdur:82000000 q:16.68 tex:35818 mv:2553 misc:1557 imb:36 pmb:703 smb:611 d:- ref:0 ; in:8304 out:8304 type:P dur:82000000 cpbdur:82000000 q:17.93 tex:40531 mv:3249 misc:1524 imb:65 pmb:749 smb:536 d:- ref:0 ; in:8305 out:8305 type:P dur:82000000 cpbdur:82000000 q:16.42 tex:56065 mv:4012 misc:1547 imb:81 pmb:1038 smb:231 d:- ref:0 ; in:8306 out:8306 type:P dur:82000000 cpbdur:82000000 q:15.22 tex:31114 mv:2887 misc:1535 imb:41 pmb:663 smb:646 d:- ref:0 ; in:8307 out:8307 type:P dur:82000000 cpbdur:82000000 q:15.72 tex:22889 mv:2494 misc:1545 imb:45 pmb:662 smb:643 d:- ref:0 ; in:8308 out:8308 type:P dur:82000000 cpbdur:82000000 q:15.15 tex:23274 mv:2043 misc:1435 imb:36 pmb:463 smb:851 d:- ref:0 ; in:8309 out:8309 type:P dur:82000000 cpbdur:82000000 q:16.38 tex:32248 mv:3332 misc:1588 imb:98 pmb:722 smb:530 d:- ref:0 ; in:8310 out:8310 type:P dur:82000000 cpbdur:82000000 q:17.41 tex:42351 mv:2871 misc:1562 imb:28 pmb:753 smb:569 d:- ref:0 ; in:8311 out:8311 type:P dur:82000000 cpbdur:82000000 q:17.04 tex:29528 mv:1736 misc:1328 imb:13 pmb:492 smb:845 d:- ref:0 ; in:8312 out:8312 type:P dur:82000000 cpbdur:82000000 q:17.51 tex:24324 mv:1872 misc:1428 imb:21 pmb:508 smb:821 d:- ref:0 ; in:8313 out:8313 type:P dur:82000000 cpbdur:82000000 q:16.08 tex:34758 mv:3002 misc:1592 imb:38 pmb:830 smb:482 d:- ref:0 ; in:8314 out:8314 type:P dur:82000000 cpbdur:82000000 q:16.05 tex:22145 mv:2282 misc:1541 imb:41 pmb:592 smb:717 d:- ref:0 ; in:8315 out:8315 type:P dur:82000000 cpbdur:82000000 q:16.91 tex:27647 mv:2569 misc:1544 imb:37 pmb:669 smb:644 d:- ref:0 ; in:8316 out:8316 type:P dur:82000000 cpbdur:82000000 q:16.02 tex:24354 mv:2758 misc:1600 imb:67 pmb:676 smb:607 d:- ref:0 ; in:8317 out:8317 type:P dur:82000000 cpbdur:82000000 q:16.54 tex:21435 mv:2449 misc:1548 imb:58 pmb:587 smb:705 d:- ref:0 ; in:8318 out:8318 type:P dur:82000000 cpbdur:82000000 q:16.06 tex:27288 mv:2619 misc:1581 imb:59 pmb:631 smb:660 d:- ref:0 ; in:8319 out:8319 type:P dur:82000000 cpbdur:82000000 q:17.14 tex:31416 mv:2553 misc:1511 imb:28 pmb:645 smb:677 d:- ref:0 ; in:8320 out:8320 type:P dur:82000000 cpbdur:82000000 q:16.75 tex:27968 mv:1659 misc:1341 imb:14 pmb:475 smb:861 d:- ref:0 ; in:8321 out:8321 type:P dur:82000000 cpbdur:82000000 q:16.95 tex:26957 mv:1928 misc:1435 imb:25 pmb:504 smb:821 d:- ref:0 ; in:8322 out:8322 type:P dur:82000000 cpbdur:82000000 q:16.24 tex:35809 mv:3006 misc:1585 imb:54 pmb:790 smb:506 d:- ref:0 ; in:8323 out:8323 type:P dur:82000000 cpbdur:82000000 q:17.53 tex:38147 mv:1838 misc:1359 imb:5 pmb:508 smb:837 d:- ref:0 ; in:8324 out:8324 type:P dur:82000000 cpbdur:82000000 q:17.14 tex:21219 mv:1976 misc:1453 imb:19 pmb:556 smb:775 d:- ref:0 ; in:8325 out:8325 type:P dur:82000000 cpbdur:82000000 q:15.97 tex:31972 mv:2384 misc:1564 imb:23 pmb:714 smb:613 d:- ref:0 ; in:8326 out:8326 type:P dur:82000000 cpbdur:82000000 q:17.97 tex:33329 mv:2334 misc:1441 imb:24 pmb:572 smb:754 d:- ref:0 ; in:8327 out:8327 type:P dur:82000000 cpbdur:82000000 q:17.89 tex:27651 mv:1610 misc:1267 imb:8 pmb:432 smb:910 d:- ref:0 ; in:8328 out:8328 type:P dur:82000000 cpbdur:82000000 q:18.24 tex:34677 mv:2199 misc:1404 imb:26 pmb:559 smb:765 d:- ref:0 ; in:8329 out:8329 type:P dur:82000000 cpbdur:82000000 q:17.35 tex:38718 mv:2554 misc:1552 imb:36 pmb:696 smb:618 d:- ref:0 ; in:8330 out:8330 type:P dur:82000000 cpbdur:82000000 q:17.15 tex:34054 mv:1834 misc:1416 imb:16 pmb:508 smb:826 d:- ref:0 ; in:8331 out:8331 type:P dur:82000000 cpbdur:82000000 q:21.15 tex:146681 mv:8434 misc:1293 imb:238 pmb:528 smb:584 d:- ref:0 ; in:8332 out:8332 type:P dur:82000000 cpbdur:82000000 q:22.12 tex:34471 mv:2634 misc:1311 imb:49 pmb:486 smb:815 d:- ref:0 ; in:8333 out:8333 type:P dur:82000000 cpbdur:82000000 q:20.23 tex:34686 mv:2694 misc:1412 imb:73 pmb:590 smb:687 d:- ref:0 ; in:8334 out:8334 type:P dur:82000000 cpbdur:82000000 q:23.48 tex:115623 mv:7520 misc:1185 imb:151 pmb:512 smb:687 d:- ref:0 ; in:8335 out:8335 type:P dur:82000000 cpbdur:82000000 q:22.21 tex:56127 mv:2788 misc:1253 imb:27 pmb:560 smb:763 d:- ref:0 ; in:8336 out:8336 type:P dur:82000000 cpbdur:82000000 q:21.48 tex:59007 mv:2958 misc:1363 imb:39 pmb:608 smb:703 d:- ref:0 ; in:8337 out:8337 type:P dur:82000000 cpbdur:82000000 q:23.44 tex:103601 mv:7316 misc:1155 imb:128 pmb:512 smb:710 d:- ref:0 ; in:8338 out:8338 type:P dur:82000000 cpbdur:82000000 q:21.41 tex:45619 mv:2464 misc:1357 imb:66 pmb:574 smb:710 d:- ref:0 ; in:8339 out:8339 type:P dur:82000000 cpbdur:82000000 q:19.69 tex:25690 mv:2160 misc:1318 imb:55 pmb:494 smb:801 d:- ref:0 ; in:8340 out:8340 type:P dur:82000000 cpbdur:82000000 q:23.32 tex:113010 mv:9108 misc:1226 imb:246 pmb:580 smb:524 d:- ref:0 ; in:8341 out:8341 type:P dur:82000000 cpbdur:82000000 q:22.28 tex:56328 mv:4648 misc:1360 imb:172 pmb:700 smb:478 d:- ref:0 ; in:8342 out:8342 type:P dur:82000000 cpbdur:82000000 q:20.41 tex:52483 mv:3299 misc:1434 imb:75 pmb:743 smb:532 d:- ref:0 ; in:8343 out:8343 type:P dur:82000000 cpbdur:82000000 q:20.75 tex:60583 mv:3536 misc:1385 imb:66 pmb:676 smb:608 d:- ref:0 ; in:8344 out:8344 type:P dur:82000000 cpbdur:82000000 q:19.83 tex:43525 mv:2327 misc:1372 imb:23 pmb:617 smb:710 d:- ref:0 ; in:8345 out:8345 type:P dur:82000000 cpbdur:82000000 q:18.60 tex:63506 mv:3650 misc:1476 imb:41 pmb:874 smb:435 d:- ref:0 ; in:8346 out:8346 type:P dur:82000000 cpbdur:82000000 q:17.59 tex:35489 mv:2544 misc:1495 imb:19 pmb:714 smb:617 d:- ref:0 ; in:8347 out:8347 type:P dur:82000000 cpbdur:82000000 q:18.31 tex:54272 mv:2995 misc:1461 imb:27 pmb:695 smb:628 d:- ref:0 ; in:8348 out:8348 type:P dur:82000000 cpbdur:82000000 q:18.13 tex:42254 mv:1803 misc:1255 imb:10 pmb:481 smb:859 d:- ref:0 ; in:8349 out:8349 type:P dur:82000000 cpbdur:82000000 q:19.17 tex:55844 mv:3099 misc:1425 imb:39 pmb:655 smb:656 d:- ref:0 ; in:8350 out:8350 type:P dur:82000000 cpbdur:82000000 q:18.29 tex:30821 mv:2235 misc:1456 imb:21 pmb:571 smb:758 d:- ref:0 ; in:8351 out:8351 type:P dur:82000000 cpbdur:82000000 q:19.44 tex:60594 mv:4044 misc:1466 imb:127 pmb:694 smb:529 d:- ref:0 ; in:8352 out:8352 type:P dur:82000000 cpbdur:82000000 q:20.28 tex:61865 mv:4650 misc:1501 imb:143 pmb:716 smb:491 d:- ref:0 ; in:8353 out:8353 type:P dur:82000000 cpbdur:82000000 q:20.76 tex:57410 mv:3600 misc:1406 imb:47 pmb:640 smb:663 d:- ref:0 ; in:8354 out:8354 type:P dur:82000000 cpbdur:82000000 q:19.86 tex:32674 mv:3246 misc:1528 imb:77 pmb:664 smb:609 d:- ref:0 ; in:8355 out:8355 type:P dur:82000000 cpbdur:82000000 q:19.58 tex:42677 mv:2447 misc:1292 imb:24 pmb:505 smb:821 d:- ref:0 ; in:8356 out:8356 type:P dur:82000000 cpbdur:82000000 q:19.88 tex:48533 mv:2460 misc:1287 imb:21 pmb:538 smb:791 d:- ref:0 ; in:8357 out:8357 type:P dur:82000000 cpbdur:82000000 q:19.00 tex:49540 mv:3322 misc:1514 imb:45 pmb:812 smb:493 d:- ref:0 ; in:8358 out:8358 type:P dur:82000000 cpbdur:82000000 q:20.46 tex:58062 mv:3221 misc:1365 imb:49 pmb:595 smb:706 d:- ref:0 ; in:8359 out:8359 type:P dur:82000000 cpbdur:82000000 q:20.63 tex:37092 mv:3878 misc:1414 imb:154 pmb:608 smb:588 d:- ref:0 ; in:8360 out:8360 type:P dur:82000000 cpbdur:82000000 q:19.98 tex:32154 mv:3518 misc:1488 imb:120 pmb:646 smb:584 d:- ref:0 ; in:8361 out:8361 type:P dur:82000000 cpbdur:82000000 q:20.51 tex:47176 mv:5643 misc:1541 imb:245 pmb:701 smb:404 d:- ref:0 ; in:8362 out:8362 type:P dur:82000000 cpbdur:82000000 q:20.01 tex:38639 mv:3759 misc:1482 imb:130 pmb:661 smb:559 d:- ref:0 ; in:8363 out:8363 type:P dur:82000000 cpbdur:82000000 q:18.89 tex:43263 mv:4618 misc:1543 imb:131 pmb:894 smb:325 d:- ref:0 ; in:8364 out:8364 type:P dur:82000000 cpbdur:82000000 q:19.94 tex:48393 mv:4293 misc:1530 imb:129 pmb:681 smb:540 d:- ref:0 ; in:8365 out:8365 type:P dur:82000000 cpbdur:82000000 q:19.82 tex:42402 mv:3159 misc:1423 imb:60 pmb:589 smb:701 d:- ref:0 ; in:8366 out:8366 type:P dur:82000000 cpbdur:82000000 q:19.70 tex:43875 mv:3090 misc:1507 imb:73 pmb:634 smb:643 d:- ref:0 ; in:8367 out:8367 type:P dur:82000000 cpbdur:82000000 q:19.81 tex:44990 mv:2999 misc:1339 imb:48 pmb:569 smb:733 d:- ref:0 ; in:8368 out:8368 type:P dur:82000000 cpbdur:82000000 q:19.69 tex:53194 mv:2463 misc:1327 imb:27 pmb:543 smb:780 d:- ref:0 ; in:8369 out:8369 type:P dur:82000000 cpbdur:82000000 q:19.08 tex:55470 mv:3807 misc:1531 imb:78 pmb:863 smb:409 d:- ref:0 ; in:8370 out:8370 type:P dur:82000000 cpbdur:82000000 q:20.83 tex:74760 mv:3312 misc:1288 imb:26 pmb:574 smb:750 d:- ref:0 ; in:8371 out:8371 type:P dur:82000000 cpbdur:82000000 q:21.21 tex:63242 mv:2827 misc:1211 imb:19 pmb:505 smb:826 d:- ref:0 ; in:8372 out:8372 type:P dur:82000000 cpbdur:82000000 q:20.72 tex:39624 mv:2225 misc:1327 imb:23 pmb:547 smb:780 d:- ref:0 ; in:8373 out:8373 type:P dur:82000000 cpbdur:82000000 q:21.18 tex:66244 mv:3172 misc:1256 imb:22 pmb:548 smb:780 d:- ref:0 ; in:8374 out:8374 type:P dur:82000000 cpbdur:82000000 q:21.44 tex:63005 mv:3053 misc:1238 imb:23 pmb:531 smb:796 d:- ref:0 ; in:8375 out:8375 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:37208 mv:1896 misc:1312 imb:8 pmb:496 smb:846 d:- ref:0 ; in:8376 out:8376 type:P dur:82000000 cpbdur:82000000 q:22.62 tex:50144 mv:12220 misc:1412 imb:1332 pmb:18 smb:0 d:- ref:0 ; in:8377 out:8377 type:P dur:82000000 cpbdur:82000000 q:20.64 tex:8051 mv:1891 misc:1242 imb:103 pmb:253 smb:994 d:- ref:0 ; in:8378 out:8378 type:P dur:82000000 cpbdur:82000000 q:19.05 tex:28889 mv:4284 misc:1563 imb:150 pmb:644 smb:556 d:- ref:0 ; in:8379 out:8379 type:P dur:82000000 cpbdur:82000000 q:17.37 tex:39384 mv:3695 misc:1561 imb:64 pmb:865 smb:421 d:- ref:0 ; in:8380 out:8380 type:P dur:82000000 cpbdur:82000000 q:16.06 tex:30349 mv:2779 misc:1576 imb:14 pmb:835 smb:501 d:- ref:0 ; in:8381 out:8381 type:P dur:82000000 cpbdur:82000000 q:17.42 tex:17756 mv:3126 misc:1566 imb:73 pmb:634 smb:643 d:- ref:0 ; in:8382 out:8382 type:P dur:82000000 cpbdur:82000000 q:17.01 tex:14011 mv:2558 misc:1391 imb:87 pmb:416 smb:847 d:- ref:0 ; in:8383 out:8383 type:P dur:82000000 cpbdur:82000000 q:15.88 tex:25433 mv:3740 misc:1603 imb:141 pmb:702 smb:507 d:- ref:0 ; in:8384 out:8384 type:P dur:82000000 cpbdur:82000000 q:15.31 tex:22156 mv:4575 misc:1573 imb:125 pmb:629 smb:596 d:- ref:0 ; in:8385 out:8385 type:P dur:82000000 cpbdur:82000000 q:16.50 tex:11313 mv:2497 misc:1470 imb:94 pmb:435 smb:821 d:- ref:0 ; in:8386 out:8386 type:P dur:82000000 cpbdur:82000000 q:15.30 tex:8323 mv:2584 misc:1389 imb:56 pmb:376 smb:918 d:- ref:0 ; in:8387 out:8387 type:P dur:82000000 cpbdur:82000000 q:15.27 tex:9737 mv:2308 misc:1275 imb:50 pmb:352 smb:948 d:- ref:0 ; in:8388 out:8388 type:P dur:82000000 cpbdur:82000000 q:16.32 tex:12918 mv:3364 misc:1526 imb:138 pmb:506 smb:706 d:- ref:0 ; in:8389 out:8389 type:P dur:82000000 cpbdur:82000000 q:16.82 tex:11405 mv:3438 misc:1581 imb:135 pmb:566 smb:649 d:- ref:0 ; in:8390 out:8390 type:P dur:82000000 cpbdur:82000000 q:16.68 tex:8182 mv:2057 misc:1329 imb:98 pmb:301 smb:951 d:- ref:0 ; in:8391 out:8391 type:P dur:82000000 cpbdur:82000000 q:17.04 tex:14866 mv:3257 misc:1469 imb:147 pmb:441 smb:762 d:- ref:0 ; in:8392 out:8392 type:P dur:82000000 cpbdur:82000000 q:17.67 tex:13601 mv:4391 misc:1416 imb:222 pmb:369 smb:759 d:- ref:0 ; in:8393 out:8393 type:P dur:82000000 cpbdur:82000000 q:16.72 tex:16408 mv:3755 misc:1485 imb:158 pmb:489 smb:703 d:- ref:0 ; in:8394 out:8394 type:P dur:82000000 cpbdur:82000000 q:17.25 tex:14497 mv:4071 misc:1520 imb:161 pmb:541 smb:648 d:- ref:0 ; in:8395 out:8395 type:P dur:82000000 cpbdur:82000000 q:17.34 tex:13959 mv:4528 misc:1481 imb:239 pmb:400 smb:711 d:- ref:0 ; in:8396 out:8396 type:P dur:82000000 cpbdur:82000000 q:16.35 tex:23680 mv:4257 misc:1599 imb:149 pmb:685 smb:516 d:- ref:0 ; in:8397 out:8397 type:P dur:82000000 cpbdur:82000000 q:17.01 tex:13067 mv:3446 misc:1471 imb:134 pmb:464 smb:752 d:- ref:0 ; in:8398 out:8398 type:P dur:82000000 cpbdur:82000000 q:17.11 tex:14567 mv:3500 misc:1469 imb:136 pmb:440 smb:774 d:- ref:0 ; in:8399 out:8399 type:P dur:82000000 cpbdur:82000000 q:16.05 tex:23147 mv:3789 misc:1576 imb:145 pmb:637 smb:568 d:- ref:0 ; in:8400 out:8400 type:P dur:82000000 cpbdur:82000000 q:16.83 tex:11762 mv:3270 misc:1480 imb:96 pmb:522 smb:732 d:- ref:0 ; in:8401 out:8401 type:P dur:82000000 cpbdur:82000000 q:16.94 tex:11913 mv:3736 misc:1471 imb:149 pmb:472 smb:729 d:- ref:0 ; in:8402 out:8402 type:P dur:82000000 cpbdur:82000000 q:16.00 tex:22547 mv:4031 misc:1582 imb:135 pmb:715 smb:500 d:- ref:0 ; in:8403 out:8403 type:P dur:82000000 cpbdur:82000000 q:16.91 tex:13288 mv:3333 misc:1507 imb:100 pmb:545 smb:705 d:- ref:0 ; in:8404 out:8404 type:P dur:82000000 cpbdur:82000000 q:16.59 tex:8307 mv:2816 misc:1397 imb:85 pmb:406 smb:859 d:- ref:0 ; in:8405 out:8405 type:P dur:82000000 cpbdur:82000000 q:15.29 tex:20760 mv:5403 misc:1589 imb:124 pmb:667 smb:559 d:- ref:0 ; in:8406 out:8406 type:P dur:82000000 cpbdur:82000000 q:16.63 tex:12954 mv:3276 misc:1466 imb:112 pmb:470 smb:768 d:- ref:0 ; in:8407 out:8407 type:P dur:82000000 cpbdur:82000000 q:16.40 tex:18767 mv:3972 misc:1605 imb:136 pmb:648 smb:566 d:- ref:0 ; in:8408 out:8408 type:P dur:82000000 cpbdur:82000000 q:15.30 tex:15204 mv:4132 misc:1504 imb:100 pmb:500 smb:750 d:- ref:0 ; in:8409 out:8409 type:P dur:82000000 cpbdur:82000000 q:16.55 tex:13543 mv:3332 misc:1493 imb:105 pmb:530 smb:715 d:- ref:0 ; in:8410 out:8410 type:P dur:82000000 cpbdur:82000000 q:16.69 tex:11298 mv:3386 misc:1468 imb:122 pmb:454 smb:774 d:- ref:0 ; in:8411 out:8411 type:P dur:82000000 cpbdur:82000000 q:15.69 tex:20516 mv:3667 misc:1569 imb:99 pmb:681 smb:570 d:- ref:0 ; in:8412 out:8412 type:P dur:82000000 cpbdur:82000000 q:16.85 tex:15929 mv:4068 misc:1539 imb:129 pmb:608 smb:613 d:- ref:0 ; in:8413 out:8413 type:P dur:82000000 cpbdur:82000000 q:17.03 tex:15968 mv:4199 misc:1513 imb:134 pmb:529 smb:687 d:- ref:0 ; in:8414 out:8414 type:P dur:82000000 cpbdur:82000000 q:16.17 tex:25661 mv:3980 misc:1591 imb:112 pmb:728 smb:510 d:- ref:0 ; in:8415 out:8415 type:P dur:82000000 cpbdur:82000000 q:17.00 tex:16854 mv:3882 misc:1496 imb:106 pmb:576 smb:668 d:- ref:0 ; in:8416 out:8416 type:P dur:82000000 cpbdur:82000000 q:17.17 tex:16083 mv:3796 misc:1473 imb:142 pmb:480 smb:728 d:- ref:0 ; in:8417 out:8417 type:P dur:82000000 cpbdur:82000000 q:16.12 tex:25358 mv:4122 misc:1576 imb:109 pmb:750 smb:491 d:- ref:0 ; in:8418 out:8418 type:P dur:82000000 cpbdur:82000000 q:17.35 tex:22602 mv:4919 misc:1495 imb:157 pmb:613 smb:580 d:- ref:0 ; in:8419 out:8419 type:P dur:82000000 cpbdur:82000000 q:17.05 tex:12608 mv:3630 misc:1498 imb:140 pmb:454 smb:756 d:- ref:0 ; in:8420 out:8420 type:P dur:82000000 cpbdur:82000000 q:16.23 tex:26065 mv:4060 misc:1571 imb:101 pmb:730 smb:519 d:- ref:0 ; in:8421 out:8421 type:P dur:82000000 cpbdur:82000000 q:17.19 tex:18065 mv:4185 misc:1502 imb:122 pmb:583 smb:645 d:- ref:0 ; in:8422 out:8422 type:P dur:82000000 cpbdur:82000000 q:17.30 tex:16940 mv:4449 misc:1483 imb:142 pmb:523 smb:685 d:- ref:0 ; in:8423 out:8423 type:P dur:82000000 cpbdur:82000000 q:16.27 tex:25193 mv:3867 misc:1572 imb:88 pmb:749 smb:513 d:- ref:0 ; in:8424 out:8424 type:P dur:82000000 cpbdur:82000000 q:17.37 tex:22697 mv:4827 misc:1532 imb:126 pmb:677 smb:547 d:- ref:0 ; in:8425 out:8425 type:P dur:82000000 cpbdur:82000000 q:17.25 tex:13733 mv:3957 misc:1494 imb:120 pmb:501 smb:729 d:- ref:0 ; in:8426 out:8426 type:P dur:82000000 cpbdur:82000000 q:16.39 tex:26334 mv:3947 misc:1591 imb:109 pmb:711 smb:530 d:- ref:0 ; in:8427 out:8427 type:P dur:82000000 cpbdur:82000000 q:17.42 tex:22142 mv:4555 misc:1511 imb:130 pmb:643 smb:577 d:- ref:0 ; in:8428 out:8428 type:P dur:82000000 cpbdur:82000000 q:17.38 tex:18432 mv:4155 misc:1509 imb:114 pmb:561 smb:675 d:- ref:0 ; in:8429 out:8429 type:P dur:82000000 cpbdur:82000000 q:16.27 tex:24914 mv:3905 misc:1613 imb:106 pmb:735 smb:509 d:- ref:0 ; in:8430 out:8430 type:P dur:82000000 cpbdur:82000000 q:17.52 tex:17574 mv:4156 misc:1486 imb:100 pmb:576 smb:674 d:- ref:0 ; in:8431 out:8431 type:P dur:82000000 cpbdur:82000000 q:17.62 tex:16187 mv:4157 misc:1376 imb:146 pmb:429 smb:775 d:- ref:0 ; in:8432 out:8432 type:P dur:82000000 cpbdur:82000000 q:16.86 tex:21772 mv:4448 misc:1540 imb:126 pmb:652 smb:572 d:- ref:0 ; in:8433 out:8433 type:P dur:82000000 cpbdur:82000000 q:17.94 tex:23119 mv:4637 misc:1444 imb:119 pmb:587 smb:644 d:- ref:0 ; in:8434 out:8434 type:P dur:82000000 cpbdur:82000000 q:18.14 tex:23156 mv:5277 misc:1439 imb:181 pmb:509 smb:660 d:- ref:0 ; in:8435 out:8435 type:P dur:82000000 cpbdur:82000000 q:16.91 tex:18673 mv:3842 misc:1557 imb:93 pmb:630 smb:627 d:- ref:0 ; in:8436 out:8436 type:P dur:82000000 cpbdur:82000000 q:18.27 tex:27157 mv:5764 misc:1495 imb:176 pmb:644 smb:530 d:- ref:0 ; in:8437 out:8437 type:P dur:82000000 cpbdur:82000000 q:17.67 tex:13971 mv:3490 misc:1379 imb:106 pmb:436 smb:808 d:- ref:0 ; in:8438 out:8438 type:P dur:82000000 cpbdur:82000000 q:16.99 tex:25490 mv:4478 misc:1576 imb:112 pmb:748 smb:490 d:- ref:0 ; in:8439 out:8439 type:P dur:82000000 cpbdur:82000000 q:18.00 tex:27488 mv:4927 misc:1513 imb:126 pmb:671 smb:553 d:- ref:0 ; in:8440 out:8440 type:P dur:82000000 cpbdur:82000000 q:18.18 tex:25838 mv:4913 misc:1433 imb:169 pmb:529 smb:652 d:- ref:0 ; in:8441 out:8441 type:P dur:82000000 cpbdur:82000000 q:17.55 tex:16856 mv:3379 misc:1325 imb:64 pmb:457 smb:829 d:- ref:0 ; in:8442 out:8442 type:P dur:82000000 cpbdur:82000000 q:18.60 tex:29983 mv:5939 misc:1478 imb:145 pmb:735 smb:470 d:- ref:0 ; in:8443 out:8443 type:P dur:82000000 cpbdur:82000000 q:18.60 tex:24493 mv:5647 misc:1412 imb:168 pmb:531 smb:651 d:- ref:0 ; in:8444 out:8444 type:P dur:82000000 cpbdur:82000000 q:18.12 tex:24404 mv:4792 misc:1468 imb:116 pmb:624 smb:610 d:- ref:0 ; in:8445 out:8445 type:P dur:82000000 cpbdur:82000000 q:18.79 tex:32524 mv:5538 misc:1482 imb:114 pmb:714 smb:522 d:- ref:0 ; in:8446 out:8446 type:P dur:82000000 cpbdur:82000000 q:18.75 tex:27392 mv:5514 misc:1462 imb:143 pmb:604 smb:603 d:- ref:0 ; in:8447 out:8447 type:P dur:82000000 cpbdur:82000000 q:18.29 tex:30055 mv:4638 misc:1483 imb:107 pmb:654 smb:589 d:- ref:0 ; in:8448 out:8448 type:P dur:82000000 cpbdur:82000000 q:18.77 tex:32880 mv:5491 misc:1365 imb:113 pmb:641 smb:596 d:- ref:0 ; in:8449 out:8449 type:P dur:82000000 cpbdur:82000000 q:19.50 tex:30443 mv:6036 misc:1465 imb:219 pmb:670 smb:461 d:- ref:0 ; in:8450 out:8450 type:P dur:82000000 cpbdur:82000000 q:19.25 tex:41851 mv:6907 misc:1514 imb:208 pmb:743 smb:399 d:- ref:0 ; in:8451 out:8451 type:P dur:82000000 cpbdur:82000000 q:19.25 tex:38889 mv:5604 misc:1427 imb:117 pmb:700 smb:533 d:- ref:0 ; in:8452 out:8452 type:P dur:82000000 cpbdur:82000000 q:19.19 tex:39229 mv:5548 misc:1407 imb:154 pmb:602 smb:594 d:- ref:0 ; in:8453 out:8453 type:P dur:82000000 cpbdur:82000000 q:19.74 tex:37388 mv:5755 misc:1345 imb:198 pmb:549 smb:603 d:- ref:0 ; in:8454 out:8454 type:P dur:82000000 cpbdur:82000000 q:20.37 tex:47914 mv:7388 misc:1474 imb:283 pmb:722 smb:345 d:- ref:0 ; in:8455 out:8455 type:P dur:82000000 cpbdur:82000000 q:20.43 tex:41266 mv:6438 misc:1432 imb:228 pmb:586 smb:536 d:- ref:0 ; in:8456 out:8456 type:P dur:82000000 cpbdur:82000000 q:20.58 tex:40686 mv:6444 misc:1470 imb:197 pmb:682 smb:471 d:- ref:0 ; in:8457 out:8457 type:P dur:82000000 cpbdur:82000000 q:20.48 tex:51557 mv:6451 misc:1432 imb:218 pmb:601 smb:531 d:- ref:0 ; in:8458 out:8458 type:P dur:82000000 cpbdur:82000000 q:20.89 tex:43089 mv:6851 misc:1468 imb:203 pmb:721 smb:426 d:- ref:0 ; in:8459 out:8459 type:P dur:82000000 cpbdur:82000000 q:20.96 tex:44384 mv:8152 misc:1544 imb:326 pmb:730 smb:294 d:- ref:0 ; in:8460 out:8460 type:P dur:82000000 cpbdur:82000000 q:20.68 tex:29691 mv:7659 misc:1538 imb:332 pmb:655 smb:363 d:- ref:0 ; in:8461 out:8461 type:P dur:82000000 cpbdur:82000000 q:21.17 tex:48723 mv:8913 misc:1500 imb:430 pmb:717 smb:203 d:- ref:0 ; in:8462 out:8462 type:P dur:82000000 cpbdur:82000000 q:20.93 tex:43275 mv:6242 misc:1531 imb:186 pmb:654 smb:510 d:- ref:0 ; in:8463 out:8463 type:P dur:82000000 cpbdur:82000000 q:20.95 tex:47230 mv:6196 misc:1430 imb:248 pmb:566 smb:536 d:- ref:0 ; in:8464 out:8464 type:P dur:82000000 cpbdur:82000000 q:20.05 tex:37260 mv:3951 misc:1461 imb:105 pmb:565 smb:680 d:- ref:0 ; in:8465 out:8465 type:P dur:82000000 cpbdur:82000000 q:20.14 tex:42964 mv:4918 misc:1486 imb:139 pmb:620 smb:591 d:- ref:0 ; in:8466 out:8466 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:52643 mv:5180 misc:1369 imb:173 pmb:492 smb:685 d:- ref:0 ; in:8467 out:8467 type:P dur:82000000 cpbdur:82000000 q:20.02 tex:38577 mv:4006 misc:1321 imb:88 pmb:514 smb:748 d:- ref:0 ; in:8468 out:8468 type:P dur:82000000 cpbdur:82000000 q:20.26 tex:45801 mv:4897 misc:1446 imb:142 pmb:577 smb:631 d:- ref:0 ; in:8469 out:8469 type:P dur:82000000 cpbdur:82000000 q:20.21 tex:45352 mv:4516 misc:1356 imb:133 pmb:498 smb:719 d:- ref:0 ; in:8470 out:8470 type:P dur:82000000 cpbdur:82000000 q:19.80 tex:37960 mv:3747 misc:1317 imb:98 pmb:463 smb:789 d:- ref:0 ; in:8471 out:8471 type:P dur:82000000 cpbdur:82000000 q:19.94 tex:40505 mv:4597 misc:1466 imb:104 pmb:571 smb:675 d:- ref:0 ; in:8472 out:8472 type:P dur:82000000 cpbdur:82000000 q:20.37 tex:49482 mv:5362 misc:1460 imb:173 pmb:546 smb:631 d:- ref:0 ; in:8473 out:8473 type:P dur:82000000 cpbdur:82000000 q:19.29 tex:43249 mv:4552 misc:1527 imb:64 pmb:802 smb:484 d:- ref:0 ; in:8474 out:8474 type:P dur:82000000 cpbdur:82000000 q:18.87 tex:34094 mv:3427 misc:1399 imb:66 pmb:529 smb:755 d:- ref:0 ; in:8475 out:8475 type:P dur:82000000 cpbdur:82000000 q:19.95 tex:41568 mv:4883 misc:1413 imb:164 pmb:497 smb:689 d:- ref:0 ; in:8476 out:8476 type:P dur:82000000 cpbdur:82000000 q:19.22 tex:42015 mv:5093 misc:1564 imb:83 pmb:765 smb:502 d:- ref:0 ; in:8477 out:8477 type:P dur:82000000 cpbdur:82000000 q:20.09 tex:43687 mv:4628 misc:1301 imb:134 pmb:400 smb:816 d:- ref:0 ; in:8478 out:8478 type:P dur:82000000 cpbdur:82000000 q:19.44 tex:41069 mv:4328 misc:1459 imb:53 pmb:678 smb:619 d:- ref:0 ; in:8479 out:8479 type:P dur:82000000 cpbdur:82000000 q:20.17 tex:43133 mv:4558 misc:1333 imb:145 pmb:458 smb:747 d:- ref:0 ; in:8480 out:8480 type:P dur:82000000 cpbdur:82000000 q:20.15 tex:38726 mv:3961 misc:1353 imb:96 pmb:489 smb:765 d:- ref:0 ; in:8481 out:8481 type:P dur:82000000 cpbdur:82000000 q:19.94 tex:39444 mv:4125 misc:1303 imb:118 pmb:457 smb:775 d:- ref:0 ; in:8482 out:8482 type:P dur:82000000 cpbdur:82000000 q:19.01 tex:39162 mv:4263 misc:1487 imb:59 pmb:715 smb:576 d:- ref:0 ; in:8483 out:8483 type:P dur:82000000 cpbdur:82000000 q:20.02 tex:44106 mv:4880 misc:1398 imb:147 pmb:490 smb:713 d:- ref:0 ; in:8484 out:8484 type:P dur:82000000 cpbdur:82000000 q:20.34 tex:48619 mv:5026 misc:1379 imb:145 pmb:502 smb:703 d:- ref:0 ; in:8485 out:8485 type:P dur:82000000 cpbdur:82000000 q:20.19 tex:40749 mv:4150 misc:1349 imb:106 pmb:484 smb:760 d:- ref:0 ; in:8486 out:8486 type:P dur:82000000 cpbdur:82000000 q:20.17 tex:42984 mv:4535 misc:1329 imb:147 pmb:429 smb:774 d:- ref:0 ; in:8487 out:8487 type:P dur:82000000 cpbdur:82000000 q:19.65 tex:25046 mv:2799 misc:1315 imb:46 pmb:463 smb:841 d:- ref:0 ; in:8488 out:8488 type:P dur:82000000 cpbdur:82000000 q:20.54 tex:43969 mv:5541 misc:1314 imb:175 pmb:451 smb:724 d:- ref:0 ; in:8489 out:8489 type:P dur:82000000 cpbdur:82000000 q:19.39 tex:44981 mv:5200 misc:1531 imb:72 pmb:844 smb:434 d:- ref:0 ; in:8490 out:8490 type:P dur:82000000 cpbdur:82000000 q:19.81 tex:33616 mv:3783 misc:1321 imb:142 pmb:385 smb:823 d:- ref:0 ; in:8491 out:8491 type:P dur:82000000 cpbdur:82000000 q:19.88 tex:36943 mv:3992 misc:1321 imb:106 pmb:470 smb:774 d:- ref:0 ; in:8492 out:8492 type:P dur:82000000 cpbdur:82000000 q:19.58 tex:35676 mv:3846 misc:1278 imb:110 pmb:422 smb:818 d:- ref:0 ; in:8493 out:8493 type:P dur:82000000 cpbdur:82000000 q:19.76 tex:38479 mv:4066 misc:1343 imb:103 pmb:492 smb:755 d:- ref:0 ; in:8494 out:8494 type:P dur:82000000 cpbdur:82000000 q:19.64 tex:35143 mv:3817 misc:1288 imb:102 pmb:465 smb:783 d:- ref:0 ; in:8495 out:8495 type:P dur:82000000 cpbdur:82000000 q:19.67 tex:42040 mv:4274 misc:1262 imb:115 pmb:478 smb:757 d:- ref:0 ; in:8496 out:8496 type:P dur:82000000 cpbdur:82000000 q:20.31 tex:49822 mv:5131 misc:1383 imb:139 pmb:535 smb:676 d:- ref:0 ; in:8497 out:8497 type:P dur:82000000 cpbdur:82000000 q:20.26 tex:41447 mv:4772 misc:1405 imb:129 pmb:530 smb:691 d:- ref:0 ; in:8498 out:8498 type:P dur:82000000 cpbdur:82000000 q:20.20 tex:45752 mv:4635 misc:1317 imb:148 pmb:483 smb:719 d:- ref:0 ; in:8499 out:8499 type:P dur:82000000 cpbdur:82000000 q:19.48 tex:46850 mv:5113 misc:1541 imb:64 pmb:795 smb:491 d:- ref:0 ; in:8500 out:8500 type:I dur:82000000 cpbdur:82000000 q:16.86 tex:213511 mv:14152 misc:377 imb:1350 pmb:0 smb:0 d:- ref:; in:8501 out:8501 type:P dur:82000000 cpbdur:82000000 q:22.71 tex:18700 mv:2859 misc:1113 imb:75 pmb:323 smb:952 d:- ref:0 ; in:8502 out:8502 type:P dur:82000000 cpbdur:82000000 q:21.81 tex:33337 mv:4583 misc:1240 imb:138 pmb:407 smb:805 d:- ref:0 ; in:8503 out:8503 type:P dur:82000000 cpbdur:82000000 q:20.79 tex:29361 mv:3844 misc:1251 imb:74 pmb:444 smb:832 d:- ref:0 ; in:8504 out:8504 type:P dur:82000000 cpbdur:82000000 q:20.92 tex:40806 mv:5259 misc:1287 imb:164 pmb:425 smb:761 d:- ref:0 ; in:8505 out:8505 type:P dur:82000000 cpbdur:82000000 q:20.69 tex:32437 mv:4607 misc:1332 imb:139 pmb:443 smb:768 d:- ref:0 ; in:8506 out:8506 type:P dur:82000000 cpbdur:82000000 q:20.60 tex:27793 mv:4093 misc:1386 imb:92 pmb:501 smb:757 d:- ref:0 ; in:8507 out:8507 type:P dur:82000000 cpbdur:82000000 q:19.68 tex:22477 mv:2946 misc:1257 imb:56 pmb:438 smb:856 d:- ref:0 ; in:8508 out:8508 type:P dur:82000000 cpbdur:82000000 q:20.11 tex:38931 mv:5409 misc:1332 imb:171 pmb:473 smb:706 d:- ref:0 ; in:8509 out:8509 type:P dur:82000000 cpbdur:82000000 q:19.92 tex:29159 mv:3614 misc:1211 imb:55 pmb:440 smb:855 d:- ref:0 ; in:8510 out:8510 type:P dur:82000000 cpbdur:82000000 q:18.82 tex:31764 mv:4330 misc:1498 imb:46 pmb:716 smb:588 d:- ref:0 ; in:8511 out:8511 type:P dur:82000000 cpbdur:82000000 q:19.17 tex:35745 mv:4384 misc:1423 imb:71 pmb:598 smb:681 d:- ref:0 ; in:8512 out:8512 type:P dur:82000000 cpbdur:82000000 q:20.01 tex:43642 mv:4747 misc:1291 imb:152 pmb:447 smb:751 d:- ref:0 ; in:8513 out:8513 type:P dur:82000000 cpbdur:82000000 q:19.67 tex:32735 mv:3514 misc:1231 imb:73 pmb:428 smb:849 d:- ref:0 ; in:8514 out:8514 type:P dur:82000000 cpbdur:82000000 q:19.87 tex:34025 mv:4582 misc:1345 imb:141 pmb:464 smb:745 d:- ref:0 ; in:8515 out:8515 type:P dur:82000000 cpbdur:82000000 q:19.68 tex:34755 mv:3818 misc:1307 imb:80 pmb:504 smb:766 d:- ref:0 ; in:8516 out:8516 type:P dur:82000000 cpbdur:82000000 q:19.70 tex:41719 mv:4556 misc:1293 imb:137 pmb:454 smb:759 d:- ref:0 ; in:8517 out:8517 type:P dur:82000000 cpbdur:82000000 q:19.81 tex:40957 mv:4396 misc:1303 imb:126 pmb:460 smb:764 d:- ref:0 ; in:8518 out:8518 type:P dur:82000000 cpbdur:82000000 q:20.13 tex:43388 mv:4801 misc:1355 imb:148 pmb:465 smb:737 d:- ref:0 ; in:8519 out:8519 type:P dur:82000000 cpbdur:82000000 q:20.41 tex:42478 mv:5101 misc:1413 imb:168 pmb:487 smb:695 d:- ref:0 ; in:8520 out:8520 type:P dur:82000000 cpbdur:82000000 q:20.48 tex:44956 mv:5430 misc:1382 imb:178 pmb:488 smb:684 d:- ref:0 ; in:8521 out:8521 type:P dur:82000000 cpbdur:82000000 q:20.16 tex:28961 mv:4132 misc:1411 imb:78 pmb:544 smb:728 d:- ref:0 ; in:8522 out:8522 type:P dur:82000000 cpbdur:82000000 q:20.84 tex:48269 mv:7201 misc:1482 imb:305 pmb:543 smb:502 d:- ref:0 ; in:8523 out:8523 type:P dur:82000000 cpbdur:82000000 q:20.46 tex:44232 mv:5751 misc:1513 imb:202 pmb:615 smb:533 d:- ref:0 ; in:8524 out:8524 type:P dur:82000000 cpbdur:82000000 q:20.52 tex:36682 mv:5922 misc:1484 imb:184 pmb:590 smb:576 d:- ref:0 ; in:8525 out:8525 type:P dur:82000000 cpbdur:82000000 q:20.78 tex:47794 mv:6725 misc:1553 imb:257 pmb:573 smb:520 d:- ref:0 ; in:8526 out:8526 type:P dur:82000000 cpbdur:82000000 q:19.69 tex:29606 mv:3695 misc:1475 imb:79 pmb:599 smb:672 d:- ref:0 ; in:8527 out:8527 type:P dur:82000000 cpbdur:82000000 q:19.78 tex:41190 mv:4524 misc:1430 imb:137 pmb:462 smb:751 d:- ref:0 ; in:8528 out:8528 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:48553 mv:6496 misc:1543 imb:233 pmb:678 smb:439 d:- ref:0 ; in:8529 out:8529 type:P dur:82000000 cpbdur:82000000 q:20.25 tex:45321 mv:5493 misc:1442 imb:195 pmb:531 smb:624 d:- ref:0 ; in:8530 out:8530 type:P dur:82000000 cpbdur:82000000 q:20.27 tex:46444 mv:5223 misc:1445 imb:146 pmb:537 smb:667 d:- ref:0 ; in:8531 out:8531 type:P dur:82000000 cpbdur:82000000 q:19.86 tex:37855 mv:4172 misc:1429 imb:106 pmb:498 smb:746 d:- ref:0 ; in:8532 out:8532 type:P dur:82000000 cpbdur:82000000 q:19.90 tex:36605 mv:4608 misc:1507 imb:133 pmb:556 smb:661 d:- ref:0 ; in:8533 out:8533 type:P dur:82000000 cpbdur:82000000 q:19.40 tex:49888 mv:5767 misc:1569 imb:80 pmb:885 smb:385 d:- ref:0 ; in:8534 out:8534 type:P dur:82000000 cpbdur:82000000 q:20.04 tex:44632 mv:4365 misc:1283 imb:147 pmb:371 smb:832 d:- ref:0 ; in:8535 out:8535 type:P dur:82000000 cpbdur:82000000 q:19.88 tex:28889 mv:3638 misc:1401 imb:52 pmb:530 smb:768 d:- ref:0 ; in:8536 out:8536 type:P dur:82000000 cpbdur:82000000 q:20.06 tex:44390 mv:4730 misc:1400 imb:142 pmb:498 smb:710 d:- ref:0 ; in:8537 out:8537 type:P dur:82000000 cpbdur:82000000 q:19.17 tex:46094 mv:5044 misc:1566 imb:72 pmb:822 smb:456 d:- ref:0 ; in:8538 out:8538 type:P dur:82000000 cpbdur:82000000 q:20.07 tex:45771 mv:5209 misc:1316 imb:152 pmb:423 smb:775 d:- ref:0 ; in:8539 out:8539 type:P dur:82000000 cpbdur:82000000 q:20.16 tex:33944 mv:4602 misc:1518 imb:109 pmb:618 smb:623 d:- ref:0 ; in:8540 out:8540 type:P dur:82000000 cpbdur:82000000 q:20.42 tex:50760 mv:5811 misc:1421 imb:196 pmb:533 smb:621 d:- ref:0 ; in:8541 out:8541 type:P dur:82000000 cpbdur:82000000 q:20.31 tex:44177 mv:5041 misc:1406 imb:150 pmb:503 smb:697 d:- ref:0 ; in:8542 out:8542 type:P dur:82000000 cpbdur:82000000 q:20.36 tex:46682 mv:5097 misc:1389 imb:157 pmb:503 smb:690 d:- ref:0 ; in:8543 out:8543 type:P dur:82000000 cpbdur:82000000 q:20.18 tex:36302 mv:4561 misc:1449 imb:128 pmb:541 smb:681 d:- ref:0 ; in:8544 out:8544 type:P dur:82000000 cpbdur:82000000 q:20.19 tex:43212 mv:5214 misc:1462 imb:175 pmb:558 smb:617 d:- ref:0 ; in:8545 out:8545 type:P dur:82000000 cpbdur:82000000 q:19.60 tex:32808 mv:3333 misc:1299 imb:65 pmb:469 smb:816 d:- ref:0 ; in:8546 out:8546 type:P dur:82000000 cpbdur:82000000 q:19.80 tex:37892 mv:5063 misc:1477 imb:158 pmb:563 smb:629 d:- ref:0 ; in:8547 out:8547 type:P dur:82000000 cpbdur:82000000 q:20.47 tex:53984 mv:6063 misc:1457 imb:212 pmb:533 smb:605 d:- ref:0 ; in:8548 out:8548 type:P dur:82000000 cpbdur:82000000 q:19.66 tex:27804 mv:2946 misc:1322 imb:52 pmb:460 smb:838 d:- ref:0 ; in:8549 out:8549 type:P dur:82000000 cpbdur:82000000 q:20.08 tex:44768 mv:5696 misc:1480 imb:198 pmb:584 smb:568 d:- ref:0 ; in:8550 out:8550 type:P dur:82000000 cpbdur:82000000 q:20.36 tex:52668 mv:5961 misc:1507 imb:191 pmb:615 smb:544 d:- ref:0 ; in:8551 out:8551 type:P dur:82000000 cpbdur:82000000 q:20.08 tex:42613 mv:4490 misc:1369 imb:120 pmb:506 smb:724 d:- ref:0 ; in:8552 out:8552 type:P dur:82000000 cpbdur:82000000 q:20.60 tex:43037 mv:5919 misc:1476 imb:203 pmb:535 smb:612 d:- ref:0 ; in:8553 out:8553 type:P dur:82000000 cpbdur:82000000 q:20.74 tex:44454 mv:5552 misc:1466 imb:193 pmb:534 smb:623 d:- ref:0 ; in:8554 out:8554 type:P dur:82000000 cpbdur:82000000 q:19.74 tex:33489 mv:3694 misc:1393 imb:64 pmb:584 smb:702 d:- ref:0 ; in:8555 out:8555 type:P dur:82000000 cpbdur:82000000 q:19.79 tex:42220 mv:4348 misc:1352 imb:134 pmb:464 smb:752 d:- ref:0 ; in:8556 out:8556 type:P dur:82000000 cpbdur:82000000 q:19.96 tex:38742 mv:4905 misc:1513 imb:120 pmb:675 smb:555 d:- ref:0 ; in:8557 out:8557 type:P dur:82000000 cpbdur:82000000 q:20.20 tex:50380 mv:5587 misc:1433 imb:203 pmb:545 smb:602 d:- ref:0 ; in:8558 out:8558 type:P dur:82000000 cpbdur:82000000 q:20.15 tex:45297 mv:5340 misc:1443 imb:169 pmb:542 smb:639 d:- ref:0 ; in:8559 out:8559 type:P dur:82000000 cpbdur:82000000 q:19.83 tex:41110 mv:3948 misc:1350 imb:92 pmb:508 smb:750 d:- ref:0 ; in:8560 out:8560 type:P dur:82000000 cpbdur:82000000 q:20.33 tex:51484 mv:5774 misc:1462 imb:205 pmb:538 smb:607 d:- ref:0 ; in:8561 out:8561 type:P dur:82000000 cpbdur:82000000 q:20.64 tex:44660 mv:5565 misc:1511 imb:186 pmb:533 smb:631 d:- ref:0 ; in:8562 out:8562 type:P dur:82000000 cpbdur:82000000 q:20.57 tex:41641 mv:5789 misc:1498 imb:194 pmb:529 smb:627 d:- ref:0 ; in:8563 out:8563 type:P dur:82000000 cpbdur:82000000 q:19.99 tex:38944 mv:4203 misc:1461 imb:87 pmb:569 smb:694 d:- ref:0 ; in:8564 out:8564 type:P dur:82000000 cpbdur:82000000 q:20.07 tex:42270 mv:4936 misc:1506 imb:169 pmb:572 smb:609 d:- ref:0 ; in:8565 out:8565 type:P dur:82000000 cpbdur:82000000 q:19.85 tex:39777 mv:4513 misc:1454 imb:102 pmb:573 smb:675 d:- ref:0 ; in:8566 out:8566 type:P dur:82000000 cpbdur:82000000 q:20.01 tex:47858 mv:4894 misc:1376 imb:147 pmb:468 smb:735 d:- ref:0 ; in:8567 out:8567 type:P dur:82000000 cpbdur:82000000 q:19.97 tex:37863 mv:4440 misc:1481 imb:120 pmb:538 smb:692 d:- ref:0 ; in:8568 out:8568 type:P dur:82000000 cpbdur:82000000 q:20.45 tex:51786 mv:5857 misc:1501 imb:205 pmb:561 smb:584 d:- ref:0 ; in:8569 out:8569 type:P dur:82000000 cpbdur:82000000 q:19.96 tex:38372 mv:4299 misc:1393 imb:115 pmb:497 smb:738 d:- ref:0 ; in:8570 out:8570 type:P dur:82000000 cpbdur:82000000 q:19.81 tex:33002 mv:4743 misc:1463 imb:157 pmb:497 smb:696 d:- ref:0 ; in:8571 out:8571 type:P dur:82000000 cpbdur:82000000 q:19.62 tex:34956 mv:4417 misc:1403 imb:116 pmb:521 smb:713 d:- ref:0 ; in:8572 out:8572 type:P dur:82000000 cpbdur:82000000 q:20.41 tex:54899 mv:6332 misc:1457 imb:236 pmb:538 smb:576 d:- ref:0 ; in:8573 out:8573 type:P dur:82000000 cpbdur:82000000 q:19.52 tex:25753 mv:2887 misc:1296 imb:68 pmb:379 smb:903 d:- ref:0 ; in:8574 out:8574 type:P dur:82000000 cpbdur:82000000 q:20.08 tex:44786 mv:5328 misc:1462 imb:184 pmb:530 smb:636 d:- ref:0 ; in:8575 out:8575 type:P dur:82000000 cpbdur:82000000 q:19.87 tex:38550 mv:4226 misc:1424 imb:84 pmb:544 smb:722 d:- ref:0 ; in:8576 out:8576 type:P dur:82000000 cpbdur:82000000 q:20.19 tex:51407 mv:5333 misc:1436 imb:173 pmb:489 smb:688 d:- ref:0 ; in:8577 out:8577 type:P dur:82000000 cpbdur:82000000 q:20.01 tex:36137 mv:4043 misc:1420 imb:88 pmb:539 smb:723 d:- ref:0 ; in:8578 out:8578 type:P dur:82000000 cpbdur:82000000 q:20.43 tex:53866 mv:5842 misc:1452 imb:190 pmb:528 smb:632 d:- ref:0 ; in:8579 out:8579 type:P dur:82000000 cpbdur:82000000 q:19.42 tex:48808 mv:5467 misc:1533 imb:72 pmb:869 smb:409 d:- ref:0 ; in:8580 out:8580 type:P dur:82000000 cpbdur:82000000 q:19.94 tex:38360 mv:4486 misc:1418 imb:125 pmb:502 smb:723 d:- ref:0 ; in:8581 out:8581 type:P dur:82000000 cpbdur:82000000 q:20.57 tex:42493 mv:5475 misc:1376 imb:184 pmb:447 smb:719 d:- ref:0 ; in:8582 out:8582 type:P dur:82000000 cpbdur:82000000 q:19.32 tex:44798 mv:4852 misc:1550 imb:77 pmb:820 smb:453 d:- ref:0 ; in:8583 out:8583 type:P dur:82000000 cpbdur:82000000 q:20.14 tex:43571 mv:5347 misc:1370 imb:178 pmb:509 smb:663 d:- ref:0 ; in:8584 out:8584 type:P dur:82000000 cpbdur:82000000 q:20.12 tex:44472 mv:4588 misc:1300 imb:168 pmb:426 smb:756 d:- ref:0 ; in:8585 out:8585 type:P dur:82000000 cpbdur:82000000 q:19.98 tex:36189 mv:4760 misc:1475 imb:125 pmb:582 smb:643 d:- ref:0 ; in:8586 out:8586 type:P dur:82000000 cpbdur:82000000 q:20.43 tex:50630 mv:5849 misc:1417 imb:192 pmb:539 smb:619 d:- ref:0 ; in:8587 out:8587 type:P dur:82000000 cpbdur:82000000 q:20.20 tex:42278 mv:4907 misc:1351 imb:166 pmb:495 smb:689 d:- ref:0 ; in:8588 out:8588 type:P dur:82000000 cpbdur:82000000 q:20.48 tex:50431 mv:6143 misc:1442 imb:168 pmb:621 smb:561 d:- ref:0 ; in:8589 out:8589 type:P dur:82000000 cpbdur:82000000 q:20.91 tex:48053 mv:6924 misc:1527 imb:246 pmb:606 smb:498 d:- ref:0 ; in:8590 out:8590 type:P dur:82000000 cpbdur:82000000 q:19.82 tex:26669 mv:4139 misc:1504 imb:98 pmb:601 smb:651 d:- ref:0 ; in:8591 out:8591 type:P dur:82000000 cpbdur:82000000 q:20.91 tex:51396 mv:8775 misc:1501 imb:353 pmb:709 smb:288 d:- ref:0 ; in:8592 out:8592 type:P dur:82000000 cpbdur:82000000 q:21.26 tex:51084 mv:10742 misc:1486 imb:447 pmb:790 smb:113 d:- ref:0 ; in:8593 out:8593 type:P dur:82000000 cpbdur:82000000 q:21.02 tex:36697 mv:7087 misc:1528 imb:229 pmb:733 smb:388 d:- ref:0 ; in:8594 out:8594 type:P dur:82000000 cpbdur:82000000 q:21.52 tex:48994 mv:7967 misc:1487 imb:337 pmb:605 smb:408 d:- ref:0 ; in:8595 out:8595 type:P dur:82000000 cpbdur:82000000 q:20.84 tex:40307 mv:5949 misc:1552 imb:216 pmb:651 smb:483 d:- ref:0 ; in:8596 out:8596 type:P dur:82000000 cpbdur:82000000 q:20.77 tex:49762 mv:5207 misc:1359 imb:167 pmb:509 smb:674 d:- ref:0 ; in:8597 out:8597 type:P dur:82000000 cpbdur:82000000 q:20.05 tex:34455 mv:3796 misc:1517 imb:68 pmb:684 smb:598 d:- ref:0 ; in:8598 out:8598 type:P dur:82000000 cpbdur:82000000 q:20.62 tex:49920 mv:5549 misc:1275 imb:179 pmb:465 smb:706 d:- ref:0 ; in:8599 out:8599 type:P dur:82000000 cpbdur:82000000 q:19.70 tex:32655 mv:3604 misc:1325 imb:87 pmb:496 smb:767 d:- ref:0 ; in:8600 out:8600 type:P dur:82000000 cpbdur:82000000 q:20.62 tex:47852 mv:5847 misc:1397 imb:196 pmb:525 smb:629 d:- ref:0 ; in:8601 out:8601 type:P dur:82000000 cpbdur:82000000 q:20.59 tex:40375 mv:4662 misc:1315 imb:143 pmb:478 smb:729 d:- ref:0 ; in:8602 out:8602 type:P dur:82000000 cpbdur:82000000 q:20.20 tex:49190 mv:4777 misc:1377 imb:126 pmb:549 smb:675 d:- ref:0 ; in:8603 out:8603 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:46753 mv:4963 misc:1444 imb:148 pmb:545 smb:657 d:- ref:0 ; in:8604 out:8604 type:P dur:82000000 cpbdur:82000000 q:20.76 tex:45325 mv:5352 misc:1419 imb:175 pmb:488 smb:687 d:- ref:0 ; in:8605 out:8605 type:P dur:82000000 cpbdur:82000000 q:20.74 tex:44749 mv:5364 misc:1319 imb:163 pmb:466 smb:721 d:- ref:0 ; in:8606 out:8606 type:P dur:82000000 cpbdur:82000000 q:20.37 tex:41678 mv:4277 misc:1437 imb:99 pmb:557 smb:694 d:- ref:0 ; in:8607 out:8607 type:P dur:82000000 cpbdur:82000000 q:20.79 tex:44844 mv:5540 misc:1440 imb:171 pmb:526 smb:653 d:- ref:0 ; in:8608 out:8608 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:45424 mv:4697 misc:1439 imb:121 pmb:549 smb:680 d:- ref:0 ; in:8609 out:8609 type:P dur:82000000 cpbdur:82000000 q:19.60 tex:31123 mv:3039 misc:1302 imb:49 pmb:453 smb:848 d:- ref:0 ; in:8610 out:8610 type:P dur:82000000 cpbdur:82000000 q:19.32 tex:51887 mv:5875 misc:1542 imb:94 pmb:861 smb:395 d:- ref:0 ; in:8611 out:8611 type:P dur:82000000 cpbdur:82000000 q:18.97 tex:41647 mv:3623 misc:1378 imb:79 pmb:513 smb:758 d:- ref:0 ; in:8612 out:8612 type:P dur:82000000 cpbdur:82000000 q:19.54 tex:28854 mv:3021 misc:1269 imb:34 pmb:473 smb:843 d:- ref:0 ; in:8613 out:8613 type:P dur:82000000 cpbdur:82000000 q:19.86 tex:44251 mv:4038 misc:1239 imb:151 pmb:360 smb:839 d:- ref:0 ; in:8614 out:8614 type:P dur:82000000 cpbdur:82000000 q:19.83 tex:34603 mv:3459 misc:1314 imb:58 pmb:501 smb:791 d:- ref:0 ; in:8615 out:8615 type:P dur:82000000 cpbdur:82000000 q:19.70 tex:35653 mv:3559 misc:1332 imb:90 pmb:471 smb:789 d:- ref:0 ; in:8616 out:8616 type:P dur:82000000 cpbdur:82000000 q:21.13 tex:56482 mv:6424 misc:1494 imb:242 pmb:588 smb:520 d:- ref:0 ; in:8617 out:8617 type:P dur:82000000 cpbdur:82000000 q:20.80 tex:38304 mv:4778 misc:1382 imb:145 pmb:510 smb:695 d:- ref:0 ; in:8618 out:8618 type:P dur:82000000 cpbdur:82000000 q:20.81 tex:45758 mv:5245 misc:1381 imb:173 pmb:489 smb:688 d:- ref:0 ; in:8619 out:8619 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:40873 mv:5028 misc:1411 imb:152 pmb:490 smb:708 d:- ref:0 ; in:8620 out:8620 type:P dur:82000000 cpbdur:82000000 q:20.62 tex:46468 mv:4914 misc:1322 imb:164 pmb:468 smb:718 d:- ref:0 ; in:8621 out:8621 type:P dur:82000000 cpbdur:82000000 q:20.89 tex:48837 mv:5671 misc:1420 imb:178 pmb:515 smb:657 d:- ref:0 ; in:8622 out:8622 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:43406 mv:4911 misc:1363 imb:131 pmb:509 smb:710 d:- ref:0 ; in:8623 out:8623 type:P dur:82000000 cpbdur:82000000 q:20.46 tex:54330 mv:5382 misc:1432 imb:146 pmb:570 smb:634 d:- ref:0 ; in:8624 out:8624 type:P dur:82000000 cpbdur:82000000 q:20.55 tex:35531 mv:4363 misc:1418 imb:86 pmb:541 smb:723 d:- ref:0 ; in:8625 out:8625 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:46465 mv:4992 misc:1279 imb:169 pmb:444 smb:737 d:- ref:0 ; in:8626 out:8626 type:P dur:82000000 cpbdur:82000000 q:20.36 tex:48827 mv:4661 misc:1408 imb:137 pmb:519 smb:694 d:- ref:0 ; in:8627 out:8627 type:P dur:82000000 cpbdur:82000000 q:20.33 tex:47142 mv:4442 misc:1328 imb:107 pmb:546 smb:697 d:- ref:0 ; in:8628 out:8628 type:P dur:82000000 cpbdur:82000000 q:20.28 tex:44035 mv:4967 misc:1478 imb:131 pmb:593 smb:626 d:- ref:0 ; in:8629 out:8629 type:P dur:82000000 cpbdur:82000000 q:20.54 tex:44496 mv:5203 misc:1357 imb:177 pmb:493 smb:680 d:- ref:0 ; in:8630 out:8630 type:P dur:82000000 cpbdur:82000000 q:20.06 tex:46872 mv:4527 misc:1361 imb:116 pmb:539 smb:695 d:- ref:0 ; in:8631 out:8631 type:P dur:82000000 cpbdur:82000000 q:19.74 tex:31170 mv:3686 misc:1392 imb:84 pmb:538 smb:728 d:- ref:0 ; in:8632 out:8632 type:P dur:82000000 cpbdur:82000000 q:20.31 tex:53006 mv:5520 misc:1346 imb:198 pmb:500 smb:652 d:- ref:0 ; in:8633 out:8633 type:P dur:82000000 cpbdur:82000000 q:20.08 tex:44112 mv:4590 misc:1314 imb:129 pmb:494 smb:727 d:- ref:0 ; in:8634 out:8634 type:P dur:82000000 cpbdur:82000000 q:20.42 tex:51809 mv:4969 misc:1294 imb:148 pmb:471 smb:731 d:- ref:0 ; in:8635 out:8635 type:P dur:82000000 cpbdur:82000000 q:20.54 tex:37923 mv:4918 misc:1391 imb:127 pmb:552 smb:671 d:- ref:0 ; in:8636 out:8636 type:P dur:82000000 cpbdur:82000000 q:20.69 tex:44319 mv:5167 misc:1338 imb:168 pmb:441 smb:741 d:- ref:0 ; in:8637 out:8637 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:46966 mv:5061 misc:1413 imb:116 pmb:591 smb:643 d:- ref:0 ; in:8638 out:8638 type:P dur:82000000 cpbdur:82000000 q:20.57 tex:44815 mv:4847 misc:1226 imb:164 pmb:399 smb:787 d:- ref:0 ; in:8639 out:8639 type:P dur:82000000 cpbdur:82000000 q:20.29 tex:41819 mv:4902 misc:1391 imb:139 pmb:542 smb:669 d:- ref:0 ; in:8640 out:8640 type:P dur:82000000 cpbdur:82000000 q:20.91 tex:49198 mv:5935 misc:1387 imb:183 pmb:507 smb:660 d:- ref:0 ; in:8641 out:8641 type:P dur:82000000 cpbdur:82000000 q:19.39 tex:47915 mv:4915 misc:1578 imb:65 pmb:887 smb:398 d:- ref:0 ; in:8642 out:8642 type:P dur:82000000 cpbdur:82000000 q:19.69 tex:32820 mv:3568 misc:1252 imb:118 pmb:384 smb:848 d:- ref:0 ; in:8643 out:8643 type:P dur:82000000 cpbdur:82000000 q:19.86 tex:38995 mv:4035 misc:1314 imb:103 pmb:501 smb:746 d:- ref:0 ; in:8644 out:8644 type:P dur:82000000 cpbdur:82000000 q:20.36 tex:53996 mv:5264 misc:1324 imb:188 pmb:472 smb:690 d:- ref:0 ; in:8645 out:8645 type:P dur:82000000 cpbdur:82000000 q:19.44 tex:48135 mv:4569 misc:1536 imb:57 pmb:759 smb:534 d:- ref:0 ; in:8646 out:8646 type:P dur:82000000 cpbdur:82000000 q:20.48 tex:47951 mv:4877 misc:1332 imb:133 pmb:479 smb:738 d:- ref:0 ; in:8647 out:8647 type:P dur:82000000 cpbdur:82000000 q:20.22 tex:32396 mv:3567 misc:1293 imb:57 pmb:503 smb:790 d:- ref:0 ; in:8648 out:8648 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:49375 mv:5087 misc:1338 imb:167 pmb:485 smb:698 d:- ref:0 ; in:8649 out:8649 type:P dur:82000000 cpbdur:82000000 q:19.41 tex:38431 mv:4282 misc:1527 imb:49 pmb:798 smb:503 d:- ref:0 ; in:8650 out:8650 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:52752 mv:5178 misc:1286 imb:176 pmb:456 smb:718 d:- ref:0 ; in:8651 out:8651 type:P dur:82000000 cpbdur:82000000 q:20.03 tex:37880 mv:3981 misc:1267 imb:118 pmb:419 smb:813 d:- ref:0 ; in:8652 out:8652 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:46430 mv:5184 misc:1370 imb:169 pmb:460 smb:721 d:- ref:0 ; in:8653 out:8653 type:P dur:82000000 cpbdur:82000000 q:20.63 tex:38813 mv:4808 misc:1355 imb:127 pmb:484 smb:739 d:- ref:0 ; in:8654 out:8654 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:50905 mv:5136 misc:1383 imb:169 pmb:504 smb:677 d:- ref:0 ; in:8655 out:8655 type:P dur:82000000 cpbdur:82000000 q:20.48 tex:47701 mv:4887 misc:1396 imb:131 pmb:515 smb:704 d:- ref:0 ; in:8656 out:8656 type:P dur:82000000 cpbdur:82000000 q:20.70 tex:44585 mv:5095 misc:1336 imb:183 pmb:435 smb:732 d:- ref:0 ; in:8657 out:8657 type:P dur:82000000 cpbdur:82000000 q:20.06 tex:41734 mv:4096 misc:1386 imb:118 pmb:492 smb:740 d:- ref:0 ; in:8658 out:8658 type:P dur:82000000 cpbdur:82000000 q:20.61 tex:46290 mv:5348 misc:1386 imb:177 pmb:468 smb:705 d:- ref:0 ; in:8659 out:8659 type:P dur:82000000 cpbdur:82000000 q:20.42 tex:46044 mv:4899 misc:1457 imb:139 pmb:569 smb:642 d:- ref:0 ; in:8660 out:8660 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:45424 mv:4833 misc:1375 imb:135 pmb:545 smb:670 d:- ref:0 ; in:8661 out:8661 type:P dur:82000000 cpbdur:82000000 q:20.53 tex:45005 mv:4774 misc:1293 imb:181 pmb:396 smb:773 d:- ref:0 ; in:8662 out:8662 type:P dur:82000000 cpbdur:82000000 q:20.54 tex:40356 mv:4913 misc:1347 imb:135 pmb:495 smb:720 d:- ref:0 ; in:8663 out:8663 type:P dur:82000000 cpbdur:82000000 q:20.77 tex:45514 mv:5372 misc:1418 imb:198 pmb:454 smb:698 d:- ref:0 ; in:8664 out:8664 type:P dur:82000000 cpbdur:82000000 q:20.24 tex:46007 mv:4517 misc:1436 imb:127 pmb:563 smb:660 d:- ref:0 ; in:8665 out:8665 type:P dur:82000000 cpbdur:82000000 q:20.21 tex:44069 mv:4433 misc:1378 imb:120 pmb:499 smb:731 d:- ref:0 ; in:8666 out:8666 type:P dur:82000000 cpbdur:82000000 q:20.77 tex:50845 mv:5673 misc:1346 imb:213 pmb:489 smb:648 d:- ref:0 ; in:8667 out:8667 type:P dur:82000000 cpbdur:82000000 q:20.47 tex:46839 mv:5133 misc:1404 imb:144 pmb:597 smb:609 d:- ref:0 ; in:8668 out:8668 type:P dur:82000000 cpbdur:82000000 q:20.00 tex:36860 mv:3532 misc:1248 imb:73 pmb:462 smb:815 d:- ref:0 ; in:8669 out:8669 type:P dur:82000000 cpbdur:82000000 q:19.91 tex:36624 mv:4114 misc:1350 imb:134 pmb:450 smb:766 d:- ref:0 ; in:8670 out:8670 type:P dur:82000000 cpbdur:82000000 q:20.69 tex:51622 mv:5859 misc:1335 imb:216 pmb:453 smb:681 d:- ref:0 ; in:8671 out:8671 type:P dur:82000000 cpbdur:82000000 q:20.16 tex:41486 mv:4453 misc:1349 imb:106 pmb:531 smb:713 d:- ref:0 ; in:8672 out:8672 type:P dur:82000000 cpbdur:82000000 q:20.61 tex:42287 mv:4973 misc:1364 imb:185 pmb:429 smb:736 d:- ref:0 ; in:8673 out:8673 type:P dur:82000000 cpbdur:82000000 q:20.64 tex:43871 mv:5131 misc:1326 imb:174 pmb:505 smb:671 d:- ref:0 ; in:8674 out:8674 type:P dur:82000000 cpbdur:82000000 q:20.22 tex:49728 mv:4831 misc:1385 imb:130 pmb:553 smb:667 d:- ref:0 ; in:8675 out:8675 type:P dur:82000000 cpbdur:82000000 q:20.53 tex:43552 mv:4945 misc:1311 imb:168 pmb:449 smb:733 d:- ref:0 ; in:8676 out:8676 type:P dur:82000000 cpbdur:82000000 q:20.87 tex:49233 mv:5726 misc:1393 imb:192 pmb:498 smb:660 d:- ref:0 ; in:8677 out:8677 type:P dur:82000000 cpbdur:82000000 q:20.69 tex:42505 mv:5328 misc:1343 imb:167 pmb:476 smb:707 d:- ref:0 ; in:8678 out:8678 type:P dur:82000000 cpbdur:82000000 q:20.30 tex:41812 mv:4674 misc:1434 imb:133 pmb:542 smb:675 d:- ref:0 ; in:8679 out:8679 type:P dur:82000000 cpbdur:82000000 q:20.16 tex:42552 mv:4172 misc:1396 imb:108 pmb:528 smb:714 d:- ref:0 ; in:8680 out:8680 type:P dur:82000000 cpbdur:82000000 q:20.52 tex:43382 mv:5033 misc:1321 imb:173 pmb:453 smb:724 d:- ref:0 ; in:8681 out:8681 type:P dur:82000000 cpbdur:82000000 q:19.54 tex:28769 mv:2722 misc:1253 imb:45 pmb:442 smb:863 d:- ref:0 ; in:8682 out:8682 type:P dur:82000000 cpbdur:82000000 q:20.11 tex:49599 mv:4644 misc:1341 imb:139 pmb:492 smb:719 d:- ref:0 ; in:8683 out:8683 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:50435 mv:4883 misc:1346 imb:155 pmb:517 smb:678 d:- ref:0 ; in:8684 out:8684 type:P dur:82000000 cpbdur:82000000 q:20.72 tex:45703 mv:5343 misc:1346 imb:180 pmb:453 smb:717 d:- ref:0 ; in:8685 out:8685 type:P dur:82000000 cpbdur:82000000 q:20.81 tex:47283 mv:5205 misc:1336 imb:167 pmb:457 smb:726 d:- ref:0 ; in:8686 out:8686 type:P dur:82000000 cpbdur:82000000 q:19.90 tex:31043 mv:3108 misc:1233 imb:45 pmb:478 smb:827 d:- ref:0 ; in:8687 out:8687 type:P dur:82000000 cpbdur:82000000 q:20.60 tex:48320 mv:5201 misc:1367 imb:171 pmb:461 smb:718 d:- ref:0 ; in:8688 out:8688 type:P dur:82000000 cpbdur:82000000 q:20.53 tex:37878 mv:4761 misc:1425 imb:129 pmb:515 smb:706 d:- ref:0 ; in:8689 out:8689 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:54867 mv:5089 misc:1364 imb:169 pmb:513 smb:668 d:- ref:0 ; in:8690 out:8690 type:P dur:82000000 cpbdur:82000000 q:19.94 tex:33112 mv:3423 misc:1353 imb:57 pmb:501 smb:792 d:- ref:0 ; in:8691 out:8691 type:P dur:82000000 cpbdur:82000000 q:20.57 tex:47293 mv:5430 misc:1333 imb:202 pmb:440 smb:708 d:- ref:0 ; in:8692 out:8692 type:P dur:82000000 cpbdur:82000000 q:20.84 tex:46791 mv:5466 misc:1383 imb:178 pmb:480 smb:692 d:- ref:0 ; in:8693 out:8693 type:P dur:82000000 cpbdur:82000000 q:20.21 tex:42039 mv:4158 misc:1387 imb:95 pmb:538 smb:717 d:- ref:0 ; in:8694 out:8694 type:P dur:82000000 cpbdur:82000000 q:20.39 tex:51393 mv:4772 misc:1299 imb:158 pmb:438 smb:754 d:- ref:0 ; in:8695 out:8695 type:P dur:82000000 cpbdur:82000000 q:20.66 tex:41306 mv:5063 misc:1399 imb:128 pmb:543 smb:679 d:- ref:0 ; in:8696 out:8696 type:P dur:82000000 cpbdur:82000000 q:20.66 tex:44149 mv:5243 misc:1360 imb:177 pmb:473 smb:700 d:- ref:0 ; in:8697 out:8697 type:P dur:82000000 cpbdur:82000000 q:20.51 tex:43420 mv:4772 misc:1336 imb:136 pmb:486 smb:728 d:- ref:0 ; in:8698 out:8698 type:P dur:82000000 cpbdur:82000000 q:20.22 tex:53039 mv:4889 misc:1368 imb:148 pmb:519 smb:683 d:- ref:0 ; in:8699 out:8699 type:P dur:82000000 cpbdur:82000000 q:20.30 tex:47603 mv:4940 misc:1337 imb:157 pmb:480 smb:713 d:- ref:0 ; in:8700 out:8700 type:P dur:82000000 cpbdur:82000000 q:20.74 tex:46330 mv:5775 misc:1367 imb:193 pmb:503 smb:654 d:- ref:0 ; in:8701 out:8701 type:P dur:82000000 cpbdur:82000000 q:20.44 tex:51517 mv:5170 misc:1401 imb:161 pmb:534 smb:655 d:- ref:0 ; in:8702 out:8702 type:P dur:82000000 cpbdur:82000000 q:20.57 tex:41413 mv:5274 misc:1345 imb:163 pmb:498 smb:689 d:- ref:0 ; in:8703 out:8703 type:P dur:82000000 cpbdur:82000000 q:20.35 tex:46954 mv:4946 misc:1460 imb:120 pmb:588 smb:642 d:- ref:0 ; in:8704 out:8704 type:P dur:82000000 cpbdur:82000000 q:20.63 tex:47646 mv:5453 misc:1301 imb:178 pmb:467 smb:705 d:- ref:0 ; in:8705 out:8705 type:P dur:82000000 cpbdur:82000000 q:19.89 tex:37399 mv:3824 misc:1353 imb:104 pmb:488 smb:758 d:- ref:0 ; in:8706 out:8706 type:P dur:82000000 cpbdur:82000000 q:20.58 tex:48813 mv:5765 misc:1350 imb:187 pmb:499 smb:664 d:- ref:0 ; in:8707 out:8707 type:P dur:82000000 cpbdur:82000000 q:20.28 tex:44419 mv:4516 misc:1433 imb:109 pmb:578 smb:663 d:- ref:0 ; in:8708 out:8708 type:P dur:82000000 cpbdur:82000000 q:20.51 tex:45674 mv:5414 misc:1336 imb:156 pmb:498 smb:696 d:- ref:0 ; in:8709 out:8709 type:P dur:82000000 cpbdur:82000000 q:20.75 tex:46502 mv:5303 misc:1339 imb:204 pmb:459 smb:687 d:- ref:0 ; in:8710 out:8710 type:P dur:82000000 cpbdur:82000000 q:20.95 tex:45286 mv:5937 misc:1345 imb:199 pmb:475 smb:676 d:- ref:0 ; in:8711 out:8711 type:P dur:82000000 cpbdur:82000000 q:20.61 tex:38155 mv:4911 misc:1326 imb:175 pmb:427 smb:748 d:- ref:0 ; in:8712 out:8712 type:P dur:82000000 cpbdur:82000000 q:21.07 tex:48120 mv:6033 misc:1407 imb:187 pmb:515 smb:648 d:- ref:0 ; in:8713 out:8713 type:P dur:82000000 cpbdur:82000000 q:20.83 tex:39841 mv:5157 misc:1402 imb:125 pmb:557 smb:668 d:- ref:0 ; in:8714 out:8714 type:P dur:82000000 cpbdur:82000000 q:20.86 tex:46994 mv:5289 misc:1293 imb:178 pmb:453 smb:719 d:- ref:0 ; in:8715 out:8715 type:P dur:82000000 cpbdur:82000000 q:20.57 tex:36448 mv:4587 misc:1365 imb:133 pmb:495 smb:722 d:- ref:0 ; in:8716 out:8716 type:P dur:82000000 cpbdur:82000000 q:20.86 tex:50218 mv:6157 misc:1393 imb:217 pmb:485 smb:648 d:- ref:0 ; in:8717 out:8717 type:P dur:82000000 cpbdur:82000000 q:20.15 tex:44523 mv:4630 misc:1415 imb:145 pmb:526 smb:679 d:- ref:0 ; in:8718 out:8718 type:P dur:82000000 cpbdur:82000000 q:20.08 tex:41890 mv:4411 misc:1363 imb:100 pmb:533 smb:717 d:- ref:0 ; in:8719 out:8719 type:P dur:82000000 cpbdur:82000000 q:20.05 tex:44030 mv:4329 misc:1401 imb:114 pmb:519 smb:717 d:- ref:0 ; in:8720 out:8720 type:P dur:82000000 cpbdur:82000000 q:20.30 tex:55608 mv:5972 misc:1356 imb:228 pmb:468 smb:654 d:- ref:0 ; in:8721 out:8721 type:P dur:82000000 cpbdur:82000000 q:19.87 tex:37151 mv:4289 misc:1360 imb:118 pmb:475 smb:757 d:- ref:0 ; in:8722 out:8722 type:P dur:82000000 cpbdur:82000000 q:20.65 tex:52203 mv:5715 misc:1306 imb:206 pmb:451 smb:693 d:- ref:0 ; in:8723 out:8723 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:52730 mv:5548 misc:1450 imb:152 pmb:600 smb:598 d:- ref:0 ; in:8724 out:8724 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:54707 mv:5746 misc:1387 imb:180 pmb:514 smb:656 d:- ref:0 ; in:8725 out:8725 type:P dur:82000000 cpbdur:82000000 q:20.65 tex:47696 mv:5051 misc:1309 imb:179 pmb:427 smb:744 d:- ref:0 ; in:8726 out:8726 type:P dur:82000000 cpbdur:82000000 q:20.41 tex:48392 mv:5270 misc:1466 imb:141 pmb:598 smb:611 d:- ref:0 ; in:8727 out:8727 type:P dur:82000000 cpbdur:82000000 q:20.82 tex:48132 mv:5866 misc:1346 imb:186 pmb:460 smb:704 d:- ref:0 ; in:8728 out:8728 type:P dur:82000000 cpbdur:82000000 q:19.99 tex:34311 mv:3775 misc:1378 imb:66 pmb:533 smb:751 d:- ref:0 ; in:8729 out:8729 type:P dur:82000000 cpbdur:82000000 q:20.40 tex:51297 mv:5140 misc:1371 imb:180 pmb:460 smb:710 d:- ref:0 ; in:8730 out:8730 type:P dur:82000000 cpbdur:82000000 q:20.15 tex:41000 mv:4214 misc:1402 imb:88 pmb:548 smb:714 d:- ref:0 ; in:8731 out:8731 type:P dur:82000000 cpbdur:82000000 q:19.91 tex:45050 mv:4353 misc:1301 imb:147 pmb:423 smb:780 d:- ref:0 ; in:8732 out:8732 type:P dur:82000000 cpbdur:82000000 q:19.84 tex:42926 mv:4207 misc:1339 imb:137 pmb:453 smb:760 d:- ref:0 ; in:8733 out:8733 type:P dur:82000000 cpbdur:82000000 q:20.43 tex:57778 mv:5289 misc:1397 imb:185 pmb:491 smb:674 d:- ref:0 ; in:8734 out:8734 type:P dur:82000000 cpbdur:82000000 q:20.45 tex:51262 mv:5153 misc:1377 imb:166 pmb:485 smb:699 d:- ref:0 ; in:8735 out:8735 type:P dur:82000000 cpbdur:82000000 q:19.97 tex:42460 mv:3964 misc:1352 imb:127 pmb:444 smb:779 d:- ref:0 ; in:8736 out:8736 type:P dur:82000000 cpbdur:82000000 q:20.62 tex:50694 mv:5730 misc:1384 imb:196 pmb:458 smb:696 d:- ref:0 ; in:8737 out:8737 type:P dur:82000000 cpbdur:82000000 q:20.34 tex:44381 mv:4786 misc:1481 imb:144 pmb:546 smb:660 d:- ref:0 ; in:8738 out:8738 type:P dur:82000000 cpbdur:82000000 q:20.42 tex:52329 mv:5131 misc:1348 imb:178 pmb:437 smb:735 d:- ref:0 ; in:8739 out:8739 type:P dur:82000000 cpbdur:82000000 q:20.42 tex:48400 mv:4727 misc:1345 imb:133 pmb:497 smb:720 d:- ref:0 ; in:8740 out:8740 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:51428 mv:5229 misc:1383 imb:150 pmb:537 smb:663 d:- ref:0 ; in:8741 out:8741 type:P dur:82000000 cpbdur:82000000 q:20.52 tex:42955 mv:4584 misc:1325 imb:170 pmb:410 smb:770 d:- ref:0 ; in:8742 out:8742 type:P dur:82000000 cpbdur:82000000 q:20.30 tex:51207 mv:5078 misc:1371 imb:127 pmb:540 smb:683 d:- ref:0 ; in:8743 out:8743 type:P dur:82000000 cpbdur:82000000 q:20.29 tex:45951 mv:4893 misc:1380 imb:162 pmb:521 smb:667 d:- ref:0 ; in:8744 out:8744 type:P dur:82000000 cpbdur:82000000 q:20.09 tex:48490 mv:4607 misc:1335 imb:138 pmb:481 smb:731 d:- ref:0 ; in:8745 out:8745 type:P dur:82000000 cpbdur:82000000 q:20.28 tex:50002 mv:4973 misc:1401 imb:157 pmb:529 smb:664 d:- ref:0 ; in:8746 out:8746 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:50409 mv:6015 misc:1352 imb:208 pmb:471 smb:671 d:- ref:0 ; in:8747 out:8747 type:P dur:82000000 cpbdur:82000000 q:20.09 tex:43369 mv:4473 misc:1406 imb:108 pmb:573 smb:669 d:- ref:0 ; in:8748 out:8748 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:46368 mv:5499 misc:1405 imb:187 pmb:471 smb:692 d:- ref:0 ; in:8749 out:8749 type:P dur:82000000 cpbdur:82000000 q:20.12 tex:35237 mv:4233 misc:1418 imb:83 pmb:581 smb:686 d:- ref:0 ; in:8750 out:8750 type:I dur:82000000 cpbdur:82000000 q:17.46 tex:227152 mv:14476 misc:380 imb:1350 pmb:0 smb:0 d:- ref:; in:8751 out:8751 type:P dur:82000000 cpbdur:82000000 q:22.88 tex:20217 mv:3003 misc:1132 imb:109 pmb:285 smb:956 d:- ref:0 ; in:8752 out:8752 type:P dur:82000000 cpbdur:82000000 q:22.04 tex:36355 mv:4814 misc:1255 imb:137 pmb:446 smb:767 d:- ref:0 ; in:8753 out:8753 type:P dur:82000000 cpbdur:82000000 q:21.48 tex:43068 mv:5253 misc:1303 imb:168 pmb:457 smb:725 d:- ref:0 ; in:8754 out:8754 type:P dur:82000000 cpbdur:82000000 q:20.91 tex:35826 mv:4502 misc:1264 imb:134 pmb:414 smb:802 d:- ref:0 ; in:8755 out:8755 type:P dur:82000000 cpbdur:82000000 q:20.70 tex:38867 mv:4592 misc:1301 imb:135 pmb:444 smb:771 d:- ref:0 ; in:8756 out:8756 type:P dur:82000000 cpbdur:82000000 q:21.03 tex:45880 mv:5813 misc:1355 imb:164 pmb:499 smb:687 d:- ref:0 ; in:8757 out:8757 type:P dur:82000000 cpbdur:82000000 q:19.49 tex:37905 mv:4315 misc:1548 imb:62 pmb:771 smb:517 d:- ref:0 ; in:8758 out:8758 type:P dur:82000000 cpbdur:82000000 q:20.11 tex:45177 mv:4206 misc:1153 imb:154 pmb:352 smb:844 d:- ref:0 ; in:8759 out:8759 type:P dur:82000000 cpbdur:82000000 q:20.41 tex:43428 mv:4780 misc:1280 imb:142 pmb:482 smb:726 d:- ref:0 ; in:8760 out:8760 type:P dur:82000000 cpbdur:82000000 q:20.74 tex:43513 mv:5291 misc:1316 imb:170 pmb:455 smb:725 d:- ref:0 ; in:8761 out:8761 type:P dur:82000000 cpbdur:82000000 q:20.84 tex:45312 mv:5595 misc:1325 imb:188 pmb:445 smb:717 d:- ref:0 ; in:8762 out:8762 type:P dur:82000000 cpbdur:82000000 q:20.02 tex:32503 mv:3467 misc:1310 imb:61 pmb:501 smb:788 d:- ref:0 ; in:8763 out:8763 type:P dur:82000000 cpbdur:82000000 q:20.00 tex:38147 mv:4082 misc:1307 imb:107 pmb:424 smb:819 d:- ref:0 ; in:8764 out:8764 type:P dur:82000000 cpbdur:82000000 q:20.20 tex:40662 mv:4690 misc:1344 imb:104 pmb:526 smb:720 d:- ref:0 ; in:8765 out:8765 type:P dur:82000000 cpbdur:82000000 q:20.52 tex:41902 mv:4809 misc:1289 imb:163 pmb:411 smb:776 d:- ref:0 ; in:8766 out:8766 type:P dur:82000000 cpbdur:82000000 q:20.28 tex:45464 mv:4608 misc:1320 imb:87 pmb:526 smb:737 d:- ref:0 ; in:8767 out:8767 type:P dur:82000000 cpbdur:82000000 q:20.62 tex:39569 mv:4730 misc:1269 imb:149 pmb:394 smb:807 d:- ref:0 ; in:8768 out:8768 type:P dur:82000000 cpbdur:82000000 q:20.45 tex:41032 mv:4849 misc:1351 imb:141 pmb:491 smb:718 d:- ref:0 ; in:8769 out:8769 type:P dur:82000000 cpbdur:82000000 q:20.63 tex:41563 mv:4963 misc:1250 imb:164 pmb:393 smb:793 d:- ref:0 ; in:8770 out:8770 type:P dur:82000000 cpbdur:82000000 q:20.09 tex:37391 mv:3926 misc:1259 imb:115 pmb:458 smb:777 d:- ref:0 ; in:8771 out:8771 type:P dur:82000000 cpbdur:82000000 q:20.51 tex:39181 mv:4767 misc:1308 imb:155 pmb:457 smb:738 d:- ref:0 ; in:8772 out:8772 type:P dur:82000000 cpbdur:82000000 q:20.60 tex:41894 mv:4990 misc:1340 imb:157 pmb:474 smb:719 d:- ref:0 ; in:8773 out:8773 type:P dur:82000000 cpbdur:82000000 q:20.29 tex:46070 mv:4782 misc:1356 imb:116 pmb:552 smb:682 d:- ref:0 ; in:8774 out:8774 type:P dur:82000000 cpbdur:82000000 q:20.01 tex:42525 mv:4231 misc:1236 imb:135 pmb:415 smb:800 d:- ref:0 ; in:8775 out:8775 type:P dur:82000000 cpbdur:82000000 q:20.42 tex:49360 mv:5062 misc:1322 imb:133 pmb:504 smb:713 d:- ref:0 ; in:8776 out:8776 type:P dur:82000000 cpbdur:82000000 q:20.28 tex:43038 mv:4184 misc:1298 imb:96 pmb:504 smb:750 d:- ref:0 ; in:8777 out:8777 type:P dur:82000000 cpbdur:82000000 q:20.18 tex:47543 mv:4717 misc:1292 imb:151 pmb:471 smb:728 d:- ref:0 ; in:8778 out:8778 type:P dur:82000000 cpbdur:82000000 q:20.57 tex:42271 mv:4976 misc:1305 imb:164 pmb:416 smb:770 d:- ref:0 ; in:8779 out:8779 type:P dur:82000000 cpbdur:82000000 q:20.70 tex:43091 mv:4919 misc:1350 imb:131 pmb:513 smb:706 d:- ref:0 ; in:8780 out:8780 type:P dur:82000000 cpbdur:82000000 q:20.67 tex:43998 mv:5472 misc:1370 imb:157 pmb:536 smb:657 d:- ref:0 ; in:8781 out:8781 type:P dur:82000000 cpbdur:82000000 q:20.63 tex:45009 mv:5114 misc:1285 imb:174 pmb:430 smb:746 d:- ref:0 ; in:8782 out:8782 type:P dur:82000000 cpbdur:82000000 q:20.44 tex:47937 mv:4970 misc:1341 imb:154 pmb:500 smb:696 d:- ref:0 ; in:8783 out:8783 type:P dur:82000000 cpbdur:82000000 q:20.61 tex:42166 mv:4692 misc:1310 imb:146 pmb:440 smb:764 d:- ref:0 ; in:8784 out:8784 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:51722 mv:5025 misc:1357 imb:164 pmb:485 smb:701 d:- ref:0 ; in:8785 out:8785 type:P dur:82000000 cpbdur:82000000 q:20.13 tex:37390 mv:3896 misc:1346 imb:80 pmb:516 smb:754 d:- ref:0 ; in:8786 out:8786 type:P dur:82000000 cpbdur:82000000 q:20.72 tex:46757 mv:5547 misc:1304 imb:168 pmb:455 smb:727 d:- ref:0 ; in:8787 out:8787 type:P dur:82000000 cpbdur:82000000 q:20.53 tex:41715 mv:4720 misc:1309 imb:123 pmb:464 smb:763 d:- ref:0 ; in:8788 out:8788 type:P dur:82000000 cpbdur:82000000 q:20.31 tex:47281 mv:4764 misc:1379 imb:150 pmb:506 smb:694 d:- ref:0 ; in:8789 out:8789 type:P dur:82000000 cpbdur:82000000 q:20.67 tex:46277 mv:5268 misc:1367 imb:177 pmb:462 smb:711 d:- ref:0 ; in:8790 out:8790 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:49136 mv:5168 misc:1416 imb:166 pmb:530 smb:654 d:- ref:0 ; in:8791 out:8791 type:P dur:82000000 cpbdur:82000000 q:20.02 tex:39295 mv:4326 misc:1275 imb:92 pmb:472 smb:786 d:- ref:0 ; in:8792 out:8792 type:P dur:82000000 cpbdur:82000000 q:20.46 tex:51986 mv:5202 misc:1324 imb:181 pmb:444 smb:725 d:- ref:0 ; in:8793 out:8793 type:P dur:82000000 cpbdur:82000000 q:20.30 tex:41499 mv:4445 misc:1376 imb:100 pmb:551 smb:699 d:- ref:0 ; in:8794 out:8794 type:P dur:82000000 cpbdur:82000000 q:20.52 tex:47519 mv:4891 misc:1254 imb:176 pmb:379 smb:795 d:- ref:0 ; in:8795 out:8795 type:P dur:82000000 cpbdur:82000000 q:20.31 tex:47427 mv:4811 misc:1362 imb:115 pmb:529 smb:706 d:- ref:0 ; in:8796 out:8796 type:P dur:82000000 cpbdur:82000000 q:20.86 tex:49109 mv:5668 misc:1375 imb:179 pmb:488 smb:683 d:- ref:0 ; in:8797 out:8797 type:P dur:82000000 cpbdur:82000000 q:19.35 tex:46855 mv:4783 misc:1570 imb:76 pmb:829 smb:445 d:- ref:0 ; in:8798 out:8798 type:P dur:82000000 cpbdur:82000000 q:20.25 tex:49142 mv:4723 misc:1319 imb:180 pmb:417 smb:753 d:- ref:0 ; in:8799 out:8799 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:50512 mv:4627 misc:1333 imb:158 pmb:441 smb:751 d:- ref:0 ; in:8800 out:8800 type:P dur:82000000 cpbdur:82000000 q:20.72 tex:49752 mv:5317 misc:1267 imb:187 pmb:401 smb:762 d:- ref:0 ; in:8801 out:8801 type:P dur:82000000 cpbdur:82000000 q:20.16 tex:33722 mv:3523 misc:1347 imb:80 pmb:485 smb:785 d:- ref:0 ; in:8802 out:8802 type:P dur:82000000 cpbdur:82000000 q:20.64 tex:46036 mv:5204 misc:1296 imb:173 pmb:448 smb:729 d:- ref:0 ; in:8803 out:8803 type:P dur:82000000 cpbdur:82000000 q:19.53 tex:28821 mv:2846 misc:1301 imb:56 pmb:464 smb:830 d:- ref:0 ; in:8804 out:8804 type:P dur:82000000 cpbdur:82000000 q:20.18 tex:48857 mv:4981 misc:1338 imb:151 pmb:479 smb:720 d:- ref:0 ; in:8805 out:8805 type:P dur:82000000 cpbdur:82000000 q:20.52 tex:44330 mv:4855 misc:1311 imb:167 pmb:421 smb:762 d:- ref:0 ; in:8806 out:8806 type:P dur:82000000 cpbdur:82000000 q:20.52 tex:45026 mv:4862 misc:1264 imb:155 pmb:432 smb:763 d:- ref:0 ; in:8807 out:8807 type:P dur:82000000 cpbdur:82000000 q:20.33 tex:49799 mv:4557 misc:1292 imb:160 pmb:425 smb:765 d:- ref:0 ; in:8808 out:8808 type:P dur:82000000 cpbdur:82000000 q:20.45 tex:43114 mv:4961 misc:1397 imb:106 pmb:569 smb:675 d:- ref:0 ; in:8809 out:8809 type:P dur:82000000 cpbdur:82000000 q:20.37 tex:47167 mv:4803 misc:1350 imb:172 pmb:457 smb:721 d:- ref:0 ; in:8810 out:8810 type:P dur:82000000 cpbdur:82000000 q:20.66 tex:42519 mv:5140 misc:1285 imb:162 pmb:418 smb:770 d:- ref:0 ; in:8811 out:8811 type:P dur:82000000 cpbdur:82000000 q:19.47 tex:48184 mv:5481 misc:1543 imb:123 pmb:801 smb:426 d:- ref:0 ; in:8812 out:8812 type:P dur:82000000 cpbdur:82000000 q:20.33 tex:47507 mv:4819 misc:1250 imb:154 pmb:409 smb:787 d:- ref:0 ; in:8813 out:8813 type:P dur:82000000 cpbdur:82000000 q:20.52 tex:38922 mv:4759 misc:1263 imb:160 pmb:415 smb:775 d:- ref:0 ; in:8814 out:8814 type:P dur:82000000 cpbdur:82000000 q:20.62 tex:43148 mv:5360 misc:1316 imb:173 pmb:460 smb:717 d:- ref:0 ; in:8815 out:8815 type:P dur:82000000 cpbdur:82000000 q:20.36 tex:38302 mv:3821 misc:1357 imb:77 pmb:513 smb:760 d:- ref:0 ; in:8816 out:8816 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:50919 mv:5471 misc:1346 imb:178 pmb:501 smb:671 d:- ref:0 ; in:8817 out:8817 type:P dur:82000000 cpbdur:82000000 q:20.07 tex:41838 mv:3773 misc:1253 imb:102 pmb:427 smb:821 d:- ref:0 ; in:8818 out:8818 type:P dur:82000000 cpbdur:82000000 q:20.63 tex:45053 mv:5315 misc:1304 imb:171 pmb:457 smb:722 d:- ref:0 ; in:8819 out:8819 type:P dur:82000000 cpbdur:82000000 q:20.25 tex:46930 mv:4258 misc:1332 imb:130 pmb:500 smb:720 d:- ref:0 ; in:8820 out:8820 type:P dur:82000000 cpbdur:82000000 q:20.44 tex:46635 mv:4772 misc:1353 imb:160 pmb:466 smb:724 d:- ref:0 ; in:8821 out:8821 type:P dur:82000000 cpbdur:82000000 q:20.69 tex:42101 mv:4944 misc:1307 imb:153 pmb:472 smb:725 d:- ref:0 ; in:8822 out:8822 type:P dur:82000000 cpbdur:82000000 q:20.71 tex:42347 mv:5308 misc:1329 imb:164 pmb:490 smb:696 d:- ref:0 ; in:8823 out:8823 type:P dur:82000000 cpbdur:82000000 q:19.56 tex:28708 mv:2888 misc:1260 imb:54 pmb:466 smb:830 d:- ref:0 ; in:8824 out:8824 type:P dur:82000000 cpbdur:82000000 q:20.00 tex:44842 mv:4482 misc:1268 imb:145 pmb:462 smb:743 d:- ref:0 ; in:8825 out:8825 type:P dur:82000000 cpbdur:82000000 q:20.50 tex:53094 mv:4984 misc:1306 imb:157 pmb:512 smb:681 d:- ref:0 ; in:8826 out:8826 type:P dur:82000000 cpbdur:82000000 q:20.50 tex:42232 mv:4560 misc:1224 imb:141 pmb:446 smb:763 d:- ref:0 ; in:8827 out:8827 type:P dur:82000000 cpbdur:82000000 q:20.29 tex:44423 mv:4458 misc:1343 imb:107 pmb:530 smb:713 d:- ref:0 ; in:8828 out:8828 type:P dur:82000000 cpbdur:82000000 q:20.52 tex:41681 mv:4729 misc:1254 imb:146 pmb:465 smb:739 d:- ref:0 ; in:8829 out:8829 type:P dur:82000000 cpbdur:82000000 q:20.83 tex:49943 mv:5634 misc:1303 imb:179 pmb:470 smb:701 d:- ref:0 ; in:8830 out:8830 type:P dur:82000000 cpbdur:82000000 q:20.13 tex:39658 mv:3947 misc:1323 imb:71 pmb:539 smb:740 d:- ref:0 ; in:8831 out:8831 type:P dur:82000000 cpbdur:82000000 q:20.12 tex:46391 mv:4429 misc:1212 imb:115 pmb:457 smb:778 d:- ref:0 ; in:8832 out:8832 type:P dur:82000000 cpbdur:82000000 q:20.71 tex:44679 mv:4912 misc:1305 imb:153 pmb:470 smb:727 d:- ref:0 ; in:8833 out:8833 type:P dur:82000000 cpbdur:82000000 q:20.57 tex:37172 mv:4558 misc:1294 imb:100 pmb:494 smb:756 d:- ref:0 ; in:8834 out:8834 type:P dur:82000000 cpbdur:82000000 q:20.64 tex:42797 mv:4810 misc:1225 imb:138 pmb:426 smb:786 d:- ref:0 ; in:8835 out:8835 type:P dur:82000000 cpbdur:82000000 q:20.13 tex:33950 mv:3932 misc:1374 imb:72 pmb:534 smb:744 d:- ref:0 ; in:8836 out:8836 type:P dur:82000000 cpbdur:82000000 q:20.76 tex:46507 mv:5078 misc:1295 imb:143 pmb:462 smb:745 d:- ref:0 ; in:8837 out:8837 type:P dur:82000000 cpbdur:82000000 q:20.39 tex:47989 mv:4624 misc:1307 imb:111 pmb:520 smb:719 d:- ref:0 ; in:8838 out:8838 type:P dur:82000000 cpbdur:82000000 q:20.69 tex:42102 mv:4317 misc:1325 imb:136 pmb:435 smb:779 d:- ref:0 ; in:8839 out:8839 type:P dur:82000000 cpbdur:82000000 q:20.94 tex:49185 mv:5847 misc:1336 imb:172 pmb:509 smb:669 d:- ref:0 ; in:8840 out:8840 type:P dur:82000000 cpbdur:82000000 q:20.11 tex:37480 mv:3807 misc:1377 imb:73 pmb:551 smb:726 d:- ref:0 ; in:8841 out:8841 type:P dur:82000000 cpbdur:82000000 q:20.33 tex:46551 mv:4460 misc:1309 imb:144 pmb:450 smb:756 d:- ref:0 ; in:8842 out:8842 type:P dur:82000000 cpbdur:82000000 q:21.03 tex:50805 mv:5456 misc:1299 imb:175 pmb:470 smb:705 d:- ref:0 ; in:8843 out:8843 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:38633 mv:3945 misc:1366 imb:106 pmb:501 smb:743 d:- ref:0 ; in:8844 out:8844 type:P dur:82000000 cpbdur:82000000 q:20.79 tex:40845 mv:4823 misc:1316 imb:131 pmb:447 smb:772 d:- ref:0 ; in:8845 out:8845 type:P dur:82000000 cpbdur:82000000 q:20.74 tex:36024 mv:4592 misc:1344 imb:128 pmb:482 smb:740 d:- ref:0 ; in:8846 out:8846 type:P dur:82000000 cpbdur:82000000 q:20.86 tex:46479 mv:4878 misc:1251 imb:148 pmb:464 smb:738 d:- ref:0 ; in:8847 out:8847 type:P dur:82000000 cpbdur:82000000 q:19.79 tex:30460 mv:3043 misc:1297 imb:33 pmb:505 smb:812 d:- ref:0 ; in:8848 out:8848 type:P dur:82000000 cpbdur:82000000 q:20.53 tex:45230 mv:4787 misc:1215 imb:166 pmb:411 smb:773 d:- ref:0 ; in:8849 out:8849 type:P dur:82000000 cpbdur:82000000 q:20.17 tex:40673 mv:4130 misc:1357 imb:119 pmb:526 smb:705 d:- ref:0 ; in:8850 out:8850 type:P dur:82000000 cpbdur:82000000 q:20.60 tex:42289 mv:4959 misc:1240 imb:145 pmb:425 smb:780 d:- ref:0 ; in:8851 out:8851 type:P dur:82000000 cpbdur:82000000 q:20.52 tex:33221 mv:4155 misc:1280 imb:110 pmb:441 smb:799 d:- ref:0 ; in:8852 out:8852 type:P dur:82000000 cpbdur:82000000 q:20.91 tex:49281 mv:5679 misc:1336 imb:187 pmb:487 smb:676 d:- ref:0 ; in:8853 out:8853 type:P dur:82000000 cpbdur:82000000 q:20.54 tex:40934 mv:4040 misc:1186 imb:99 pmb:438 smb:813 d:- ref:0 ; in:8854 out:8854 type:P dur:82000000 cpbdur:82000000 q:20.84 tex:50337 mv:5204 misc:1299 imb:150 pmb:476 smb:724 d:- ref:0 ; in:8855 out:8855 type:P dur:82000000 cpbdur:82000000 q:20.74 tex:43084 mv:4532 misc:1288 imb:137 pmb:474 smb:739 d:- ref:0 ; in:8856 out:8856 type:P dur:82000000 cpbdur:82000000 q:21.48 tex:59334 mv:6416 misc:1426 imb:186 pmb:598 smb:566 d:- ref:0 ; in:8857 out:8857 type:P dur:82000000 cpbdur:82000000 q:20.80 tex:31782 mv:3702 misc:1300 imb:91 pmb:468 smb:791 d:- ref:0 ; in:8858 out:8858 type:P dur:82000000 cpbdur:82000000 q:20.99 tex:48530 mv:5592 misc:1374 imb:179 pmb:512 smb:659 d:- ref:0 ; in:8859 out:8859 type:P dur:82000000 cpbdur:82000000 q:20.70 tex:41418 mv:4468 misc:1258 imb:141 pmb:450 smb:759 d:- ref:0 ; in:8860 out:8860 type:P dur:82000000 cpbdur:82000000 q:20.89 tex:46993 mv:5461 misc:1314 imb:186 pmb:487 smb:677 d:- ref:0 ; in:8861 out:8861 type:P dur:82000000 cpbdur:82000000 q:20.33 tex:41821 mv:4297 misc:1362 imb:104 pmb:549 smb:697 d:- ref:0 ; in:8862 out:8862 type:P dur:82000000 cpbdur:82000000 q:20.35 tex:46720 mv:4736 misc:1328 imb:139 pmb:496 smb:715 d:- ref:0 ; in:8863 out:8863 type:P dur:82000000 cpbdur:82000000 q:20.08 tex:44702 mv:3780 misc:1198 imb:103 pmb:446 smb:801 d:- ref:0 ; in:8864 out:8864 type:P dur:82000000 cpbdur:82000000 q:20.65 tex:47356 mv:5256 misc:1348 imb:181 pmb:484 smb:685 d:- ref:0 ; in:8865 out:8865 type:P dur:82000000 cpbdur:82000000 q:20.70 tex:41967 mv:5365 misc:1364 imb:144 pmb:513 smb:693 d:- ref:0 ; in:8866 out:8866 type:P dur:82000000 cpbdur:82000000 q:20.70 tex:43961 mv:5285 misc:1330 imb:190 pmb:449 smb:711 d:- ref:0 ; in:8867 out:8867 type:P dur:82000000 cpbdur:82000000 q:20.51 tex:34997 mv:4355 misc:1392 imb:110 pmb:509 smb:731 d:- ref:0 ; in:8868 out:8868 type:P dur:82000000 cpbdur:82000000 q:20.86 tex:48048 mv:5980 misc:1388 imb:216 pmb:502 smb:632 d:- ref:0 ; in:8869 out:8869 type:P dur:82000000 cpbdur:82000000 q:19.98 tex:37998 mv:4215 misc:1467 imb:112 pmb:585 smb:653 d:- ref:0 ; in:8870 out:8870 type:P dur:82000000 cpbdur:82000000 q:20.71 tex:49650 mv:5780 misc:1386 imb:191 pmb:510 smb:649 d:- ref:0 ; in:8871 out:8871 type:P dur:82000000 cpbdur:82000000 q:20.54 tex:41481 mv:4571 misc:1292 imb:153 pmb:417 smb:780 d:- ref:0 ; in:8872 out:8872 type:P dur:82000000 cpbdur:82000000 q:20.40 tex:44070 mv:4732 misc:1446 imb:117 pmb:584 smb:649 d:- ref:0 ; in:8873 out:8873 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:47777 mv:5145 misc:1254 imb:174 pmb:449 smb:727 d:- ref:0 ; in:8874 out:8874 type:P dur:82000000 cpbdur:82000000 q:20.45 tex:51488 mv:4871 misc:1329 imb:132 pmb:533 smb:685 d:- ref:0 ; in:8875 out:8875 type:P dur:82000000 cpbdur:82000000 q:20.93 tex:46737 mv:5003 misc:1252 imb:164 pmb:413 smb:773 d:- ref:0 ; in:8876 out:8876 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:38696 mv:4874 misc:1334 imb:129 pmb:504 smb:717 d:- ref:0 ; in:8877 out:8877 type:P dur:82000000 cpbdur:82000000 q:20.68 tex:45194 mv:4780 misc:1282 imb:143 pmb:436 smb:771 d:- ref:0 ; in:8878 out:8878 type:P dur:82000000 cpbdur:82000000 q:20.53 tex:31481 mv:3505 misc:1350 imb:81 pmb:447 smb:822 d:- ref:0 ; in:8879 out:8879 type:P dur:82000000 cpbdur:82000000 q:21.13 tex:52560 mv:6136 misc:1352 imb:170 pmb:482 smb:698 d:- ref:0 ; in:8880 out:8880 type:P dur:82000000 cpbdur:82000000 q:24.48 tex:106908 mv:14678 misc:1414 imb:1222 pmb:128 smb:0 d:- ref:0 ; in:8881 out:8881 type:P dur:82000000 cpbdur:82000000 q:22.85 tex:13216 mv:3437 misc:1291 imb:7 pmb:513 smb:830 d:- ref:0 ; in:8882 out:8882 type:P dur:82000000 cpbdur:82000000 q:21.74 tex:22863 mv:5265 misc:1520 imb:51 pmb:807 smb:492 d:- ref:0 ; in:8883 out:8883 type:P dur:82000000 cpbdur:82000000 q:21.48 tex:45364 mv:4880 misc:1524 imb:80 pmb:742 smb:528 d:- ref:0 ; in:8884 out:8884 type:P dur:82000000 cpbdur:82000000 q:20.18 tex:22931 mv:2699 misc:1514 imb:23 pmb:679 smb:648 d:- ref:0 ; in:8885 out:8885 type:P dur:82000000 cpbdur:82000000 q:18.83 tex:48789 mv:3967 misc:1556 imb:27 pmb:985 smb:338 d:- ref:0 ; in:8886 out:8886 type:P dur:82000000 cpbdur:82000000 q:18.91 tex:30872 mv:3928 misc:1560 imb:41 pmb:746 smb:563 d:- ref:0 ; in:8887 out:8887 type:P dur:82000000 cpbdur:82000000 q:16.90 tex:55351 mv:3578 misc:1543 imb:10 pmb:1080 smb:260 d:- ref:0 ; in:8888 out:8888 type:P dur:82000000 cpbdur:82000000 q:17.09 tex:28011 mv:3051 misc:1610 imb:20 pmb:841 smb:489 d:- ref:0 ; in:8889 out:8889 type:P dur:82000000 cpbdur:82000000 q:18.45 tex:35468 mv:2727 misc:1237 imb:37 pmb:383 smb:930 d:- ref:0 ; in:8890 out:8890 type:P dur:82000000 cpbdur:82000000 q:16.80 tex:21685 mv:2582 misc:1557 imb:16 pmb:680 smb:654 d:- ref:0 ; in:8891 out:8891 type:P dur:82000000 cpbdur:82000000 q:16.11 tex:53654 mv:3817 misc:1545 imb:12 pmb:1147 smb:191 d:- ref:0 ; in:8892 out:8892 type:P dur:82000000 cpbdur:82000000 q:20.11 tex:63564 mv:4120 misc:1404 imb:121 pmb:440 smb:789 d:- ref:0 ; in:8893 out:8893 type:P dur:82000000 cpbdur:82000000 q:19.78 tex:9380 mv:1306 misc:1010 imb:27 pmb:234 smb:1089 d:- ref:0 ; in:8894 out:8894 type:P dur:82000000 cpbdur:82000000 q:19.92 tex:19445 mv:5426 misc:1521 imb:96 pmb:684 smb:570 d:- ref:0 ; in:8895 out:8895 type:P dur:82000000 cpbdur:82000000 q:22.24 tex:55311 mv:5050 misc:1159 imb:120 pmb:346 smb:884 d:- ref:0 ; in:8896 out:8896 type:P dur:82000000 cpbdur:82000000 q:20.42 tex:20285 mv:2335 misc:1364 imb:21 pmb:483 smb:846 d:- ref:0 ; in:8897 out:8897 type:P dur:82000000 cpbdur:82000000 q:20.03 tex:23244 mv:3127 misc:1405 imb:16 pmb:577 smb:757 d:- ref:0 ; in:8898 out:8898 type:P dur:82000000 cpbdur:82000000 q:20.03 tex:39744 mv:3460 misc:1092 imb:34 pmb:332 smb:984 d:- ref:0 ; in:8899 out:8899 type:P dur:82000000 cpbdur:82000000 q:19.53 tex:17459 mv:2455 misc:1334 imb:42 pmb:461 smb:847 d:- ref:0 ; in:8900 out:8900 type:P dur:82000000 cpbdur:82000000 q:18.07 tex:43881 mv:4755 misc:1556 imb:52 pmb:977 smb:321 d:- ref:0 ; in:8901 out:8901 type:P dur:82000000 cpbdur:82000000 q:21.80 tex:61009 mv:3818 misc:965 imb:96 pmb:266 smb:988 d:- ref:0 ; in:8902 out:8902 type:P dur:82000000 cpbdur:82000000 q:19.88 tex:18838 mv:1829 misc:1245 imb:28 pmb:383 smb:939 d:- ref:0 ; in:8903 out:8903 type:P dur:82000000 cpbdur:82000000 q:18.40 tex:37216 mv:4015 misc:1569 imb:39 pmb:873 smb:438 d:- ref:0 ; in:8904 out:8904 type:P dur:82000000 cpbdur:82000000 q:22.40 tex:95621 mv:5983 misc:1084 imb:207 pmb:333 smb:810 d:- ref:0 ; in:8905 out:8905 type:P dur:82000000 cpbdur:82000000 q:21.08 tex:22042 mv:1459 misc:1083 imb:11 pmb:345 smb:994 d:- ref:0 ; in:8906 out:8906 type:P dur:82000000 cpbdur:82000000 q:19.86 tex:23840 mv:1731 misc:1245 imb:5 pmb:421 smb:924 d:- ref:0 ; in:8907 out:8907 type:P dur:82000000 cpbdur:82000000 q:22.54 tex:78667 mv:5942 misc:903 imb:197 pmb:246 smb:907 d:- ref:0 ; in:8908 out:8908 type:P dur:82000000 cpbdur:82000000 q:20.44 tex:32461 mv:1874 misc:1169 imb:25 pmb:442 smb:883 d:- ref:0 ; in:8909 out:8909 type:P dur:82000000 cpbdur:82000000 q:18.99 tex:30736 mv:3426 misc:1550 imb:29 pmb:758 smb:563 d:- ref:0 ; in:8910 out:8910 type:P dur:82000000 cpbdur:82000000 q:21.43 tex:72729 mv:5421 misc:1106 imb:88 pmb:345 smb:917 d:- ref:0 ; in:8911 out:8911 type:P dur:82000000 cpbdur:82000000 q:19.81 tex:20727 mv:1502 misc:1123 imb:6 pmb:352 smb:992 d:- ref:0 ; in:8912 out:8912 type:P dur:82000000 cpbdur:82000000 q:18.63 tex:30410 mv:2507 misc:1443 imb:24 pmb:605 smb:721 d:- ref:0 ; in:8913 out:8913 type:P dur:82000000 cpbdur:82000000 q:21.88 tex:70623 mv:4566 misc:931 imb:194 pmb:200 smb:956 d:- ref:0 ; in:8914 out:8914 type:P dur:82000000 cpbdur:82000000 q:19.95 tex:20125 mv:1289 misc:1114 imb:17 pmb:321 smb:1012 d:- ref:0 ; in:8915 out:8915 type:P dur:82000000 cpbdur:82000000 q:18.49 tex:37084 mv:3159 misc:1541 imb:25 pmb:779 smb:546 d:- ref:0 ; in:8916 out:8916 type:P dur:82000000 cpbdur:82000000 q:20.51 tex:50788 mv:4031 misc:1029 imb:115 pmb:275 smb:960 d:- ref:0 ; in:8917 out:8917 type:P dur:82000000 cpbdur:82000000 q:18.82 tex:31191 mv:2327 misc:1314 imb:8 pmb:543 smb:799 d:- ref:0 ; in:8918 out:8918 type:P dur:82000000 cpbdur:82000000 q:17.83 tex:18364 mv:2178 misc:1434 imb:14 pmb:566 smb:770 d:- ref:0 ; in:8919 out:8919 type:P dur:82000000 cpbdur:82000000 q:18.97 tex:39727 mv:2631 misc:970 imb:71 pmb:215 smb:1064 d:- ref:0 ; in:8920 out:8920 type:P dur:82000000 cpbdur:82000000 q:18.24 tex:18882 mv:2497 misc:1437 imb:26 pmb:557 smb:767 d:- ref:0 ; in:8921 out:8921 type:P dur:82000000 cpbdur:82000000 q:16.55 tex:32987 mv:2988 misc:1561 imb:9 pmb:860 smb:481 d:- ref:0 ; in:8922 out:8922 type:P dur:82000000 cpbdur:82000000 q:17.91 tex:30020 mv:2390 misc:1318 imb:57 pmb:366 smb:927 d:- ref:0 ; in:8923 out:8923 type:P dur:82000000 cpbdur:82000000 q:17.27 tex:31583 mv:3112 misc:1537 imb:17 pmb:776 smb:557 d:- ref:0 ; in:8924 out:8924 type:P dur:82000000 cpbdur:82000000 q:17.29 tex:22792 mv:2999 misc:1561 imb:25 pmb:739 smb:586 d:- ref:0 ; in:8925 out:8925 type:P dur:82000000 cpbdur:82000000 q:16.59 tex:17601 mv:2359 misc:1424 imb:40 pmb:547 smb:763 d:- ref:0 ; in:8926 out:8926 type:P dur:82000000 cpbdur:82000000 q:18.47 tex:27288 mv:4448 misc:1512 imb:14 pmb:740 smb:596 d:- ref:0 ; in:8927 out:8927 type:P dur:82000000 cpbdur:82000000 q:19.01 tex:21035 mv:5053 misc:1408 imb:13 pmb:691 smb:646 d:- ref:0 ; in:8928 out:8928 type:P dur:82000000 cpbdur:82000000 q:22.15 tex:54375 mv:13113 misc:1416 imb:1307 pmb:43 smb:0 d:- ref:0 ; in:8929 out:8929 type:P dur:82000000 cpbdur:82000000 q:21.73 tex:27675 mv:5516 misc:1145 imb:239 pmb:288 smb:823 d:- ref:0 ; in:8930 out:8930 type:P dur:82000000 cpbdur:82000000 q:20.47 tex:19250 mv:4462 misc:1288 imb:173 pmb:364 smb:813 d:- ref:0 ; in:8931 out:8931 type:P dur:82000000 cpbdur:82000000 q:21.58 tex:42561 mv:6168 misc:1175 imb:301 pmb:290 smb:759 d:- ref:0 ; in:8932 out:8932 type:P dur:82000000 cpbdur:82000000 q:19.89 tex:12928 mv:3232 misc:1360 imb:136 pmb:388 smb:826 d:- ref:0 ; in:8933 out:8933 type:P dur:82000000 cpbdur:82000000 q:20.80 tex:37413 mv:5215 misc:1156 imb:261 pmb:247 smb:842 d:- ref:0 ; in:8934 out:8934 type:P dur:82000000 cpbdur:82000000 q:19.20 tex:21348 mv:3671 misc:1477 imb:99 pmb:603 smb:648 d:- ref:0 ; in:8935 out:8935 type:P dur:82000000 cpbdur:82000000 q:18.07 tex:13259 mv:2497 misc:1452 imb:42 pmb:493 smb:815 d:- ref:0 ; in:8936 out:8936 type:P dur:82000000 cpbdur:82000000 q:19.42 tex:40383 mv:5057 misc:1312 imb:236 pmb:309 smb:805 d:- ref:0 ; in:8937 out:8937 type:P dur:82000000 cpbdur:82000000 q:17.86 tex:8600 mv:1848 misc:1232 imb:22 pmb:362 smb:966 d:- ref:0 ; in:8938 out:8938 type:P dur:82000000 cpbdur:82000000 q:16.83 tex:18700 mv:3023 misc:1509 imb:84 pmb:567 smb:699 d:- ref:0 ; in:8939 out:8939 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:59174 mv:8884 misc:1238 imb:283 pmb:378 smb:689 d:- ref:0 ; in:8940 out:8940 type:P dur:82000000 cpbdur:82000000 q:19.05 tex:20955 mv:3571 misc:1362 imb:70 pmb:555 smb:725 d:- ref:0 ; in:8941 out:8941 type:P dur:82000000 cpbdur:82000000 q:17.47 tex:28734 mv:3662 misc:1516 imb:87 pmb:724 smb:539 d:- ref:0 ; in:8942 out:8942 type:P dur:82000000 cpbdur:82000000 q:20.46 tex:62753 mv:9212 misc:1411 imb:290 pmb:498 smb:562 d:- ref:0 ; in:8943 out:8943 type:P dur:82000000 cpbdur:82000000 q:18.78 tex:17958 mv:3609 misc:1369 imb:75 pmb:561 smb:714 d:- ref:0 ; in:8944 out:8944 type:P dur:82000000 cpbdur:82000000 q:17.79 tex:18701 mv:3628 misc:1375 imb:88 pmb:526 smb:736 d:- ref:0 ; in:8945 out:8945 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:96522 mv:11339 misc:1363 imb:482 pmb:419 smb:449 d:- ref:0 ; in:8946 out:8946 type:P dur:82000000 cpbdur:82000000 q:20.96 tex:13997 mv:3172 misc:1367 imb:81 pmb:460 smb:809 d:- ref:0 ; in:8947 out:8947 type:P dur:82000000 cpbdur:82000000 q:19.20 tex:34548 mv:4445 misc:1479 imb:96 pmb:729 smb:525 d:- ref:0 ; in:8948 out:8948 type:P dur:82000000 cpbdur:82000000 q:23.20 tex:95643 mv:12595 misc:1314 imb:477 pmb:433 smb:440 d:- ref:0 ; in:8949 out:8949 type:P dur:82000000 cpbdur:82000000 q:21.51 tex:22591 mv:3264 misc:1361 imb:67 pmb:524 smb:759 d:- ref:0 ; in:8950 out:8950 type:P dur:82000000 cpbdur:82000000 q:19.81 tex:32888 mv:3678 misc:1458 imb:106 pmb:616 smb:628 d:- ref:0 ; in:8951 out:8951 type:P dur:82000000 cpbdur:82000000 q:23.81 tex:102376 mv:12386 misc:1310 imb:525 pmb:388 smb:437 d:- ref:0 ; in:8952 out:8952 type:P dur:82000000 cpbdur:82000000 q:21.99 tex:33609 mv:3930 misc:1405 imb:84 pmb:630 smb:636 d:- ref:0 ; in:8953 out:8953 type:P dur:82000000 cpbdur:82000000 q:20.00 tex:36164 mv:3312 misc:1420 imb:83 pmb:666 smb:601 d:- ref:0 ; in:8954 out:8954 type:P dur:82000000 cpbdur:82000000 q:23.66 tex:94180 mv:12018 misc:1250 imb:573 pmb:306 smb:471 d:- ref:0 ; in:8955 out:8955 type:P dur:82000000 cpbdur:82000000 q:21.70 tex:26272 mv:3862 misc:1378 imb:121 pmb:540 smb:689 d:- ref:0 ; in:8956 out:8956 type:P dur:82000000 cpbdur:82000000 q:20.19 tex:36913 mv:4951 misc:1424 imb:170 pmb:691 smb:489 d:- ref:0 ; in:8957 out:8957 type:P dur:82000000 cpbdur:82000000 q:23.51 tex:77159 mv:11362 misc:1231 imb:506 pmb:338 smb:506 d:- ref:0 ; in:8958 out:8958 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:24873 mv:3752 misc:1359 imb:110 pmb:528 smb:712 d:- ref:0 ; in:8959 out:8959 type:P dur:82000000 cpbdur:82000000 q:19.96 tex:30612 mv:4533 misc:1471 imb:151 pmb:649 smb:550 d:- ref:0 ; in:8960 out:8960 type:P dur:82000000 cpbdur:82000000 q:21.96 tex:55026 mv:10904 misc:1318 imb:335 pmb:516 smb:499 d:- ref:0 ; in:8961 out:8961 type:P dur:82000000 cpbdur:82000000 q:20.45 tex:25966 mv:3911 misc:1435 imb:97 pmb:549 smb:704 d:- ref:0 ; in:8962 out:8962 type:P dur:82000000 cpbdur:82000000 q:19.35 tex:32617 mv:5574 misc:1513 imb:113 pmb:786 smb:451 d:- ref:0 ; in:8963 out:8963 type:P dur:82000000 cpbdur:82000000 q:21.15 tex:45538 mv:8200 misc:1246 imb:209 pmb:448 smb:693 d:- ref:0 ; in:8964 out:8964 type:P dur:82000000 cpbdur:82000000 q:19.44 tex:28012 mv:4470 misc:1430 imb:81 pmb:648 smb:621 d:- ref:0 ; in:8965 out:8965 type:P dur:82000000 cpbdur:82000000 q:18.18 tex:17502 mv:3334 misc:1484 imb:69 pmb:572 smb:709 d:- ref:0 ; in:8966 out:8966 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:45822 mv:7120 misc:1226 imb:232 pmb:388 smb:730 d:- ref:0 ; in:8967 out:8967 type:P dur:82000000 cpbdur:82000000 q:18.75 tex:17233 mv:3379 misc:1332 imb:63 pmb:503 smb:784 d:- ref:0 ; in:8968 out:8968 type:P dur:82000000 cpbdur:82000000 q:17.87 tex:17964 mv:3424 misc:1444 imb:64 pmb:564 smb:722 d:- ref:0 ; in:8969 out:8969 type:P dur:82000000 cpbdur:82000000 q:20.31 tex:44501 mv:6431 misc:1116 imb:189 pmb:359 smb:802 d:- ref:0 ; in:8970 out:8970 type:P dur:82000000 cpbdur:82000000 q:18.73 tex:17141 mv:3014 misc:1269 imb:56 pmb:484 smb:810 d:- ref:0 ; in:8971 out:8971 type:P dur:82000000 cpbdur:82000000 q:17.60 tex:13570 mv:2845 misc:1441 imb:55 pmb:491 smb:804 d:- ref:0 ; in:8972 out:8972 type:P dur:82000000 cpbdur:82000000 q:20.48 tex:44871 mv:7186 misc:1135 imb:201 pmb:372 smb:777 d:- ref:0 ; in:8973 out:8973 type:P dur:82000000 cpbdur:82000000 q:18.68 tex:16291 mv:2646 misc:1327 imb:40 pmb:494 smb:816 d:- ref:0 ; in:8974 out:8974 type:P dur:82000000 cpbdur:82000000 q:17.61 tex:14915 mv:2764 misc:1433 imb:63 pmb:504 smb:783 d:- ref:0 ; in:8975 out:8975 type:P dur:82000000 cpbdur:82000000 q:20.21 tex:42763 mv:6974 misc:1199 imb:165 pmb:390 smb:795 d:- ref:0 ; in:8976 out:8976 type:P dur:82000000 cpbdur:82000000 q:18.43 tex:26043 mv:3178 misc:1411 imb:73 pmb:548 smb:729 d:- ref:0 ; in:8977 out:8977 type:P dur:82000000 cpbdur:82000000 q:17.26 tex:26654 mv:4019 misc:1575 imb:104 pmb:753 smb:493 d:- ref:0 ; in:8978 out:8978 type:P dur:82000000 cpbdur:82000000 q:19.88 tex:35450 mv:5929 misc:1101 imb:146 pmb:373 smb:831 d:- ref:0 ; in:8979 out:8979 type:P dur:82000000 cpbdur:82000000 q:18.10 tex:19639 mv:2906 misc:1343 imb:59 pmb:508 smb:783 d:- ref:0 ; in:8980 out:8980 type:P dur:82000000 cpbdur:82000000 q:17.65 tex:12444 mv:2631 misc:1349 imb:75 pmb:387 smb:888 d:- ref:0 ; in:8981 out:8981 type:P dur:82000000 cpbdur:82000000 q:19.80 tex:36343 mv:5947 misc:1126 imb:149 pmb:361 smb:840 d:- ref:0 ; in:8982 out:8982 type:P dur:82000000 cpbdur:82000000 q:18.17 tex:21996 mv:3481 misc:1363 imb:59 pmb:527 smb:764 d:- ref:0 ; in:8983 out:8983 type:P dur:82000000 cpbdur:82000000 q:17.28 tex:22401 mv:3868 misc:1539 imb:69 pmb:728 smb:553 d:- ref:0 ; in:8984 out:8984 type:P dur:82000000 cpbdur:82000000 q:20.12 tex:43632 mv:5625 misc:1071 imb:152 pmb:325 smb:873 d:- ref:0 ; in:8985 out:8985 type:P dur:82000000 cpbdur:82000000 q:18.50 tex:16240 mv:2597 misc:1251 imb:37 pmb:431 smb:882 d:- ref:0 ; in:8986 out:8986 type:P dur:82000000 cpbdur:82000000 q:17.82 tex:16364 mv:2492 misc:1344 imb:42 pmb:442 smb:866 d:- ref:0 ; in:8987 out:8987 type:P dur:82000000 cpbdur:82000000 q:20.37 tex:48017 mv:5480 misc:999 imb:142 pmb:300 smb:908 d:- ref:0 ; in:8988 out:8988 type:P dur:82000000 cpbdur:82000000 q:18.71 tex:13481 mv:2609 misc:1214 imb:47 pmb:401 smb:902 d:- ref:0 ; in:8989 out:8989 type:P dur:82000000 cpbdur:82000000 q:17.98 tex:14892 mv:2650 misc:1418 imb:57 pmb:446 smb:847 d:- ref:0 ; in:8990 out:8990 type:P dur:82000000 cpbdur:82000000 q:20.36 tex:41274 mv:5439 misc:1047 imb:181 pmb:307 smb:862 d:- ref:0 ; in:8991 out:8991 type:P dur:82000000 cpbdur:82000000 q:18.80 tex:14526 mv:2907 misc:1263 imb:38 pmb:449 smb:863 d:- ref:0 ; in:8992 out:8992 type:P dur:82000000 cpbdur:82000000 q:17.94 tex:13172 mv:3032 misc:1364 imb:45 pmb:486 smb:819 d:- ref:0 ; in:8993 out:8993 type:P dur:82000000 cpbdur:82000000 q:19.29 tex:34905 mv:5491 misc:1092 imb:111 pmb:357 smb:882 d:- ref:0 ; in:8994 out:8994 type:P dur:82000000 cpbdur:82000000 q:17.71 tex:9888 mv:2179 misc:1149 imb:25 pmb:367 smb:958 d:- ref:0 ; in:8995 out:8995 type:P dur:82000000 cpbdur:82000000 q:17.05 tex:21532 mv:3682 misc:1546 imb:95 pmb:650 smb:605 d:- ref:0 ; in:8996 out:8996 type:P dur:82000000 cpbdur:82000000 q:18.76 tex:27770 mv:5092 misc:1170 imb:91 pmb:394 smb:865 d:- ref:0 ; in:8997 out:8997 type:P dur:82000000 cpbdur:82000000 q:17.18 tex:18498 mv:3125 misc:1457 imb:56 pmb:557 smb:737 d:- ref:0 ; in:8998 out:8998 type:P dur:82000000 cpbdur:82000000 q:16.84 tex:11563 mv:2891 misc:1434 imb:52 pmb:503 smb:795 d:- ref:0 ; in:8999 out:8999 type:P dur:82000000 cpbdur:82000000 q:18.33 tex:27691 mv:4513 misc:1204 imb:86 pmb:405 smb:859 d:- ref:0 ; in:9000 out:9000 type:I dur:82000000 cpbdur:82000000 q:15.86 tex:134444 mv:13016 misc:372 imb:1350 pmb:0 smb:0 d:- ref:; in:9001 out:9001 type:P dur:82000000 cpbdur:82000000 q:20.85 tex:1674 mv:907 misc:923 imb:29 pmb:161 smb:1160 d:- ref:0 ; in:9002 out:9002 type:P dur:82000000 cpbdur:82000000 q:19.60 tex:10671 mv:2918 misc:1035 imb:79 pmb:248 smb:1023 d:- ref:0 ; in:9003 out:9003 type:P dur:82000000 cpbdur:82000000 q:17.65 tex:10495 mv:2937 misc:1424 imb:59 pmb:497 smb:794 d:- ref:0 ; in:9004 out:9004 type:P dur:82000000 cpbdur:82000000 q:17.09 tex:13486 mv:3472 misc:1538 imb:90 pmb:556 smb:704 d:- ref:0 ; in:9005 out:9005 type:P dur:82000000 cpbdur:82000000 q:17.66 tex:16863 mv:3431 misc:1306 imb:121 pmb:321 smb:908 d:- ref:0 ; in:9006 out:9006 type:P dur:82000000 cpbdur:82000000 q:17.20 tex:19646 mv:4261 misc:1509 imb:118 pmb:579 smb:653 d:- ref:0 ; in:9007 out:9007 type:P dur:82000000 cpbdur:82000000 q:16.37 tex:26027 mv:3728 misc:1581 imb:114 pmb:662 smb:574 d:- ref:0 ; in:9008 out:9008 type:P dur:82000000 cpbdur:82000000 q:17.18 tex:15928 mv:3675 misc:1477 imb:127 pmb:487 smb:736 d:- ref:0 ; in:9009 out:9009 type:P dur:82000000 cpbdur:82000000 q:17.77 tex:17186 mv:4492 misc:1410 imb:135 pmb:494 smb:721 d:- ref:0 ; in:9010 out:9010 type:P dur:82000000 cpbdur:82000000 q:18.64 tex:20779 mv:6414 misc:1463 imb:217 pmb:602 smb:531 d:- ref:0 ; in:9011 out:9011 type:P dur:82000000 cpbdur:82000000 q:22.58 tex:66787 mv:13023 misc:1430 imb:1170 pmb:123 smb:57 d:- ref:0 ; in:9012 out:9012 type:P dur:82000000 cpbdur:82000000 q:21.21 tex:20608 mv:5118 misc:1482 imb:239 pmb:488 smb:623 d:- ref:0 ; in:9013 out:9013 type:P dur:82000000 cpbdur:82000000 q:20.23 tex:24298 mv:6447 misc:1551 imb:396 pmb:517 smb:437 d:- ref:0 ; in:9014 out:9014 type:P dur:82000000 cpbdur:82000000 q:20.35 tex:36934 mv:5983 misc:1411 imb:190 pmb:481 smb:679 d:- ref:0 ; in:9015 out:9015 type:P dur:82000000 cpbdur:82000000 q:19.13 tex:22720 mv:4620 misc:1468 imb:109 pmb:672 smb:569 d:- ref:0 ; in:9016 out:9016 type:P dur:82000000 cpbdur:82000000 q:18.13 tex:17782 mv:2916 misc:1478 imb:70 pmb:542 smb:738 d:- ref:0 ; in:9017 out:9017 type:P dur:82000000 cpbdur:82000000 q:19.40 tex:45687 mv:5274 misc:1287 imb:101 pmb:460 smb:789 d:- ref:0 ; in:9018 out:9018 type:P dur:82000000 cpbdur:82000000 q:17.85 tex:11749 mv:2230 misc:1205 imb:39 pmb:384 smb:927 d:- ref:0 ; in:9019 out:9019 type:P dur:82000000 cpbdur:82000000 q:17.22 tex:26174 mv:3763 misc:1567 imb:88 pmb:717 smb:545 d:- ref:0 ; in:9020 out:9020 type:P dur:82000000 cpbdur:82000000 q:19.06 tex:45121 mv:4779 misc:1148 imb:92 pmb:389 smb:869 d:- ref:0 ; in:9021 out:9021 type:P dur:82000000 cpbdur:82000000 q:17.49 tex:22527 mv:3179 misc:1422 imb:51 pmb:583 smb:716 d:- ref:0 ; in:9022 out:9022 type:P dur:82000000 cpbdur:82000000 q:16.90 tex:12725 mv:2612 misc:1479 imb:54 pmb:498 smb:798 d:- ref:0 ; in:9023 out:9023 type:P dur:82000000 cpbdur:82000000 q:20.02 tex:49693 mv:5104 misc:1107 imb:119 pmb:354 smb:877 d:- ref:0 ; in:9024 out:9024 type:P dur:82000000 cpbdur:82000000 q:18.26 tex:21951 mv:3180 misc:1333 imb:56 pmb:530 smb:764 d:- ref:0 ; in:9025 out:9025 type:P dur:82000000 cpbdur:82000000 q:17.61 tex:11889 mv:1994 misc:1261 imb:34 pmb:352 smb:964 d:- ref:0 ; in:9026 out:9026 type:P dur:82000000 cpbdur:82000000 q:20.78 tex:58227 mv:4819 misc:882 imb:168 pmb:215 smb:967 d:- ref:0 ; in:9027 out:9027 type:P dur:82000000 cpbdur:82000000 q:18.91 tex:19583 mv:2323 misc:1150 imb:34 pmb:401 smb:915 d:- ref:0 ; in:9028 out:9028 type:P dur:82000000 cpbdur:82000000 q:17.90 tex:13189 mv:2344 misc:1339 imb:51 pmb:430 smb:869 d:- ref:0 ; in:9029 out:9029 type:P dur:82000000 cpbdur:82000000 q:20.83 tex:55671 mv:4686 misc:891 imb:144 pmb:234 smb:972 d:- ref:0 ; in:9030 out:9030 type:P dur:82000000 cpbdur:82000000 q:19.01 tex:21024 mv:2146 misc:1142 imb:35 pmb:392 smb:923 d:- ref:0 ; in:9031 out:9031 type:P dur:82000000 cpbdur:82000000 q:17.68 tex:10486 mv:1868 misc:1278 imb:36 pmb:384 smb:930 d:- ref:0 ; in:9032 out:9032 type:P dur:82000000 cpbdur:82000000 q:20.77 tex:54921 mv:5351 misc:912 imb:172 pmb:249 smb:929 d:- ref:0 ; in:9033 out:9033 type:P dur:82000000 cpbdur:82000000 q:18.97 tex:21615 mv:2391 misc:1138 imb:48 pmb:393 smb:909 d:- ref:0 ; in:9034 out:9034 type:P dur:82000000 cpbdur:82000000 q:17.75 tex:11802 mv:2362 misc:1276 imb:65 pmb:390 smb:895 d:- ref:0 ; in:9035 out:9035 type:P dur:82000000 cpbdur:82000000 q:20.84 tex:61246 mv:5448 misc:1002 imb:203 pmb:240 smb:907 d:- ref:0 ; in:9036 out:9036 type:P dur:82000000 cpbdur:82000000 q:19.08 tex:23343 mv:2381 misc:1140 imb:42 pmb:425 smb:883 d:- ref:0 ; in:9037 out:9037 type:P dur:82000000 cpbdur:82000000 q:17.75 tex:10719 mv:1991 misc:1322 imb:57 pmb:393 smb:900 d:- ref:0 ; in:9038 out:9038 type:P dur:82000000 cpbdur:82000000 q:20.94 tex:60539 mv:5722 misc:923 imb:162 pmb:272 smb:916 d:- ref:0 ; in:9039 out:9039 type:P dur:82000000 cpbdur:82000000 q:18.99 tex:21295 mv:2269 misc:1172 imb:39 pmb:427 smb:884 d:- ref:0 ; in:9040 out:9040 type:P dur:82000000 cpbdur:82000000 q:17.77 tex:15443 mv:2708 misc:1361 imb:55 pmb:452 smb:843 d:- ref:0 ; in:9041 out:9041 type:P dur:82000000 cpbdur:82000000 q:21.13 tex:61319 mv:6951 misc:1050 imb:179 pmb:313 smb:858 d:- ref:0 ; in:9042 out:9042 type:P dur:82000000 cpbdur:82000000 q:19.36 tex:25597 mv:3012 misc:1271 imb:56 pmb:498 smb:796 d:- ref:0 ; in:9043 out:9043 type:P dur:82000000 cpbdur:82000000 q:17.76 tex:13193 mv:2183 misc:1344 imb:35 pmb:435 smb:880 d:- ref:0 ; in:9044 out:9044 type:P dur:82000000 cpbdur:82000000 q:21.43 tex:65345 mv:8436 misc:1219 imb:204 pmb:452 smb:694 d:- ref:0 ; in:9045 out:9045 type:P dur:82000000 cpbdur:82000000 q:19.70 tex:14299 mv:2587 misc:1218 imb:82 pmb:373 smb:895 d:- ref:0 ; in:9046 out:9046 type:P dur:82000000 cpbdur:82000000 q:18.26 tex:35452 mv:4278 misc:1430 imb:89 pmb:674 smb:587 d:- ref:0 ; in:9047 out:9047 type:P dur:82000000 cpbdur:82000000 q:22.12 tex:76163 mv:9252 misc:1233 imb:227 pmb:478 smb:645 d:- ref:0 ; in:9048 out:9048 type:P dur:82000000 cpbdur:82000000 q:20.22 tex:24420 mv:2913 misc:1267 imb:68 pmb:471 smb:811 d:- ref:0 ; in:9049 out:9049 type:P dur:82000000 cpbdur:82000000 q:18.60 tex:28067 mv:3558 misc:1439 imb:74 pmb:660 smb:616 d:- ref:0 ; in:9050 out:9050 type:P dur:82000000 cpbdur:82000000 q:21.76 tex:78842 mv:9407 misc:1191 imb:277 pmb:455 smb:618 d:- ref:0 ; in:9051 out:9051 type:P dur:82000000 cpbdur:82000000 q:20.09 tex:26914 mv:3292 misc:1242 imb:75 pmb:498 smb:777 d:- ref:0 ; in:9052 out:9052 type:P dur:82000000 cpbdur:82000000 q:18.82 tex:31786 mv:4242 misc:1412 imb:70 pmb:694 smb:586 d:- ref:0 ; in:9053 out:9053 type:P dur:82000000 cpbdur:82000000 q:22.14 tex:82209 mv:9369 misc:1190 imb:229 pmb:507 smb:614 d:- ref:0 ; in:9054 out:9054 type:P dur:82000000 cpbdur:82000000 q:20.41 tex:29403 mv:3502 misc:1335 imb:87 pmb:560 smb:703 d:- ref:0 ; in:9055 out:9055 type:P dur:82000000 cpbdur:82000000 q:18.91 tex:31706 mv:4187 misc:1475 imb:87 pmb:731 smb:532 d:- ref:0 ; in:9056 out:9056 type:P dur:82000000 cpbdur:82000000 q:22.79 tex:84643 mv:10180 misc:1153 imb:262 pmb:484 smb:604 d:- ref:0 ; in:9057 out:9057 type:P dur:82000000 cpbdur:82000000 q:20.85 tex:31517 mv:3463 misc:1324 imb:84 pmb:569 smb:697 d:- ref:0 ; in:9058 out:9058 type:P dur:82000000 cpbdur:82000000 q:19.48 tex:50288 mv:4887 misc:1441 imb:83 pmb:789 smb:478 d:- ref:0 ; in:9059 out:9059 type:P dur:82000000 cpbdur:82000000 q:23.22 tex:97461 mv:10121 misc:1122 imb:276 pmb:465 smb:609 d:- ref:0 ; in:9060 out:9060 type:P dur:82000000 cpbdur:82000000 q:21.31 tex:35566 mv:3566 misc:1284 imb:67 pmb:606 smb:677 d:- ref:0 ; in:9061 out:9061 type:P dur:82000000 cpbdur:82000000 q:19.47 tex:51220 mv:4114 misc:1402 imb:60 pmb:766 smb:524 d:- ref:0 ; in:9062 out:9062 type:P dur:82000000 cpbdur:82000000 q:23.07 tex:117358 mv:9995 misc:1151 imb:405 pmb:355 smb:590 d:- ref:0 ; in:9063 out:9063 type:P dur:82000000 cpbdur:82000000 q:21.40 tex:36190 mv:3844 misc:1406 imb:97 pmb:590 smb:663 d:- ref:0 ; in:9064 out:9064 type:P dur:82000000 cpbdur:82000000 q:19.72 tex:20117 mv:2851 misc:1344 imb:68 pmb:491 smb:791 d:- ref:0 ; in:9065 out:9065 type:P dur:82000000 cpbdur:82000000 q:22.36 tex:112864 mv:9619 misc:1221 imb:316 pmb:425 smb:609 d:- ref:0 ; in:9066 out:9066 type:P dur:82000000 cpbdur:82000000 q:20.77 tex:20902 mv:2930 misc:1320 imb:70 pmb:460 smb:820 d:- ref:0 ; in:9067 out:9067 type:P dur:82000000 cpbdur:82000000 q:19.11 tex:44944 mv:4980 misc:1500 imb:105 pmb:804 smb:441 d:- ref:0 ; in:9068 out:9068 type:P dur:82000000 cpbdur:82000000 q:22.61 tex:82912 mv:9587 misc:1229 imb:295 pmb:445 smb:610 d:- ref:0 ; in:9069 out:9069 type:P dur:82000000 cpbdur:82000000 q:20.93 tex:29366 mv:3895 misc:1411 imb:103 pmb:579 smb:668 d:- ref:0 ; in:9070 out:9070 type:P dur:82000000 cpbdur:82000000 q:19.35 tex:47696 mv:4867 misc:1493 imb:105 pmb:791 smb:454 d:- ref:0 ; in:9071 out:9071 type:P dur:82000000 cpbdur:82000000 q:21.83 tex:72227 mv:8794 misc:1235 imb:260 pmb:422 smb:668 d:- ref:0 ; in:9072 out:9072 type:P dur:82000000 cpbdur:82000000 q:20.00 tex:22127 mv:2568 misc:1241 imb:50 pmb:448 smb:852 d:- ref:0 ; in:9073 out:9073 type:P dur:82000000 cpbdur:82000000 q:18.45 tex:41388 mv:4133 misc:1463 imb:73 pmb:771 smb:506 d:- ref:0 ; in:9074 out:9074 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:82623 mv:7525 misc:940 imb:305 pmb:241 smb:804 d:- ref:0 ; in:9075 out:9075 type:P dur:82000000 cpbdur:82000000 q:20.15 tex:17259 mv:2070 misc:1103 imb:44 pmb:384 smb:922 d:- ref:0 ; in:9076 out:9076 type:P dur:82000000 cpbdur:82000000 q:19.04 tex:30968 mv:3629 misc:1379 imb:65 pmb:589 smb:696 d:- ref:0 ; in:9077 out:9077 type:P dur:82000000 cpbdur:82000000 q:22.47 tex:82444 mv:7475 misc:1001 imb:360 pmb:207 smb:783 d:- ref:0 ; in:9078 out:9078 type:P dur:82000000 cpbdur:82000000 q:20.53 tex:7859 mv:1634 misc:1059 imb:42 pmb:256 smb:1052 d:- ref:0 ; in:9079 out:9079 type:P dur:82000000 cpbdur:82000000 q:18.73 tex:25292 mv:3051 misc:1385 imb:61 pmb:547 smb:742 d:- ref:0 ; in:9080 out:9080 type:P dur:82000000 cpbdur:82000000 q:22.46 tex:91831 mv:7671 misc:1098 imb:359 pmb:229 smb:762 d:- ref:0 ; in:9081 out:9081 type:P dur:82000000 cpbdur:82000000 q:20.56 tex:12146 mv:1950 misc:968 imb:57 pmb:272 smb:1021 d:- ref:0 ; in:9082 out:9082 type:P dur:82000000 cpbdur:82000000 q:19.18 tex:31446 mv:3862 misc:1428 imb:118 pmb:588 smb:644 d:- ref:0 ; in:9083 out:9083 type:P dur:82000000 cpbdur:82000000 q:21.18 tex:56245 mv:7000 misc:1131 imb:456 pmb:180 smb:714 d:- ref:0 ; in:9084 out:9084 type:P dur:82000000 cpbdur:82000000 q:20.06 tex:11386 mv:3862 misc:1272 imb:121 pmb:360 smb:869 d:- ref:0 ; in:9085 out:9085 type:P dur:82000000 cpbdur:82000000 q:20.43 tex:42930 mv:7239 misc:1519 imb:462 pmb:323 smb:565 d:- ref:0 ; in:9086 out:9086 type:P dur:82000000 cpbdur:82000000 q:19.03 tex:14929 mv:4876 misc:1459 imb:150 pmb:538 smb:662 d:- ref:0 ; in:9087 out:9087 type:P dur:82000000 cpbdur:82000000 q:19.38 tex:32580 mv:9380 misc:1512 imb:408 pmb:762 smb:180 d:- ref:0 ; in:9088 out:9088 type:P dur:82000000 cpbdur:82000000 q:19.29 tex:24938 mv:8884 misc:1490 imb:298 pmb:914 smb:138 d:- ref:0 ; in:9089 out:9089 type:P dur:82000000 cpbdur:82000000 q:21.76 tex:54936 mv:11768 misc:1416 imb:1246 pmb:104 smb:0 d:- ref:0 ; in:9090 out:9090 type:P dur:82000000 cpbdur:82000000 q:20.79 tex:24518 mv:8964 misc:1462 imb:737 pmb:406 smb:207 d:- ref:0 ; in:9091 out:9091 type:P dur:82000000 cpbdur:82000000 q:20.74 tex:25467 mv:9975 misc:1486 imb:829 pmb:381 smb:140 d:- ref:0 ; in:9092 out:9092 type:P dur:82000000 cpbdur:82000000 q:20.79 tex:30882 mv:6507 misc:1251 imb:360 pmb:257 smb:733 d:- ref:0 ; in:9093 out:9093 type:P dur:82000000 cpbdur:82000000 q:19.95 tex:15758 mv:4234 misc:1192 imb:222 pmb:256 smb:872 d:- ref:0 ; in:9094 out:9094 type:P dur:82000000 cpbdur:82000000 q:19.56 tex:17361 mv:5250 misc:1269 imb:304 pmb:290 smb:756 d:- ref:0 ; in:9095 out:9095 type:P dur:82000000 cpbdur:82000000 q:19.86 tex:29885 mv:5757 misc:1158 imb:332 pmb:233 smb:785 d:- ref:0 ; in:9096 out:9096 type:P dur:82000000 cpbdur:82000000 q:18.82 tex:14689 mv:4533 misc:1410 imb:241 pmb:423 smb:686 d:- ref:0 ; in:9097 out:9097 type:P dur:82000000 cpbdur:82000000 q:18.40 tex:14591 mv:4580 misc:1373 imb:233 pmb:392 smb:725 d:- ref:0 ; in:9098 out:9098 type:P dur:82000000 cpbdur:82000000 q:19.33 tex:34050 mv:6547 misc:1275 imb:304 pmb:351 smb:695 d:- ref:0 ; in:9099 out:9099 type:P dur:82000000 cpbdur:82000000 q:18.30 tex:14286 mv:4606 misc:1188 imb:232 pmb:320 smb:798 d:- ref:0 ; in:9100 out:9100 type:P dur:82000000 cpbdur:82000000 q:17.74 tex:10992 mv:3989 misc:1147 imb:191 pmb:265 smb:894 d:- ref:0 ; in:9101 out:9101 type:P dur:82000000 cpbdur:82000000 q:19.72 tex:32482 mv:6747 misc:1323 imb:396 pmb:255 smb:699 d:- ref:0 ; in:9102 out:9102 type:P dur:82000000 cpbdur:82000000 q:18.68 tex:17247 mv:4810 misc:1247 imb:270 pmb:308 smb:772 d:- ref:0 ; in:9103 out:9103 type:P dur:82000000 cpbdur:82000000 q:18.07 tex:15013 mv:4298 misc:1385 imb:227 pmb:334 smb:789 d:- ref:0 ; in:9104 out:9104 type:P dur:82000000 cpbdur:82000000 q:19.25 tex:32530 mv:6603 misc:1315 imb:307 pmb:353 smb:690 d:- ref:0 ; in:9105 out:9105 type:P dur:82000000 cpbdur:82000000 q:18.35 tex:15048 mv:4063 misc:1257 imb:223 pmb:291 smb:836 d:- ref:0 ; in:9106 out:9106 type:P dur:82000000 cpbdur:82000000 q:18.21 tex:11622 mv:4814 misc:1332 imb:238 pmb:354 smb:758 d:- ref:0 ; in:9107 out:9107 type:P dur:82000000 cpbdur:82000000 q:18.97 tex:31099 mv:5132 misc:1257 imb:238 pmb:308 smb:804 d:- ref:0 ; in:9108 out:9108 type:P dur:82000000 cpbdur:82000000 q:18.04 tex:12533 mv:3309 misc:1198 imb:156 pmb:297 smb:897 d:- ref:0 ; in:9109 out:9109 type:P dur:82000000 cpbdur:82000000 q:17.99 tex:13673 mv:3685 misc:1370 imb:181 pmb:337 smb:832 d:- ref:0 ; in:9110 out:9110 type:P dur:82000000 cpbdur:82000000 q:19.18 tex:31918 mv:4955 misc:1287 imb:209 pmb:321 smb:820 d:- ref:0 ; in:9111 out:9111 type:P dur:82000000 cpbdur:82000000 q:18.45 tex:17887 mv:3720 misc:1193 imb:171 pmb:290 smb:889 d:- ref:0 ; in:9112 out:9112 type:P dur:82000000 cpbdur:82000000 q:17.78 tex:7751 mv:3041 misc:1152 imb:150 pmb:269 smb:931 d:- ref:0 ; in:9113 out:9113 type:P dur:82000000 cpbdur:82000000 q:19.78 tex:29136 mv:4298 misc:1230 imb:211 pmb:208 smb:931 d:- ref:0 ; in:9114 out:9114 type:P dur:82000000 cpbdur:82000000 q:18.73 tex:16242 mv:4046 misc:1392 imb:199 pmb:376 smb:775 d:- ref:0 ; in:9115 out:9115 type:P dur:82000000 cpbdur:82000000 q:17.60 tex:9594 mv:2543 misc:1247 imb:107 pmb:323 smb:920 d:- ref:0 ; in:9116 out:9116 type:P dur:82000000 cpbdur:82000000 q:18.82 tex:26267 mv:4737 misc:1244 imb:185 pmb:323 smb:842 d:- ref:0 ; in:9117 out:9117 type:P dur:82000000 cpbdur:82000000 q:18.29 tex:14938 mv:3640 misc:1326 imb:168 pmb:340 smb:842 d:- ref:0 ; in:9118 out:9118 type:P dur:82000000 cpbdur:82000000 q:18.11 tex:12614 mv:4054 misc:1324 imb:204 pmb:308 smb:838 d:- ref:0 ; in:9119 out:9119 type:P dur:82000000 cpbdur:82000000 q:19.17 tex:30690 mv:5252 misc:1266 imb:206 pmb:308 smb:836 d:- ref:0 ; in:9120 out:9120 type:P dur:82000000 cpbdur:82000000 q:18.12 tex:10236 mv:2983 misc:1237 imb:128 pmb:309 smb:913 d:- ref:0 ; in:9121 out:9121 type:P dur:82000000 cpbdur:82000000 q:17.73 tex:5799 mv:2640 misc:1233 imb:126 pmb:270 smb:954 d:- ref:0 ; in:9122 out:9122 type:P dur:82000000 cpbdur:82000000 q:18.98 tex:30193 mv:5257 misc:1262 imb:184 pmb:333 smb:833 d:- ref:0 ; in:9123 out:9123 type:P dur:82000000 cpbdur:82000000 q:17.96 tex:10368 mv:2757 misc:1243 imb:141 pmb:295 smb:914 d:- ref:0 ; in:9124 out:9124 type:P dur:82000000 cpbdur:82000000 q:17.65 tex:8768 mv:3193 misc:1271 imb:136 pmb:313 smb:901 d:- ref:0 ; in:9125 out:9125 type:P dur:82000000 cpbdur:82000000 q:19.56 tex:30077 mv:5767 misc:1244 imb:272 pmb:235 smb:843 d:- ref:0 ; in:9126 out:9126 type:P dur:82000000 cpbdur:82000000 q:18.38 tex:16448 mv:3739 misc:1333 imb:167 pmb:381 smb:802 d:- ref:0 ; in:9127 out:9127 type:P dur:82000000 cpbdur:82000000 q:17.94 tex:8507 mv:3413 misc:1208 imb:164 pmb:273 smb:913 d:- ref:0 ; in:9128 out:9128 type:P dur:82000000 cpbdur:82000000 q:19.20 tex:29958 mv:5654 misc:1252 imb:211 pmb:350 smb:789 d:- ref:0 ; in:9129 out:9129 type:P dur:82000000 cpbdur:82000000 q:18.12 tex:9939 mv:2908 misc:1145 imb:131 pmb:298 smb:921 d:- ref:0 ; in:9130 out:9130 type:P dur:82000000 cpbdur:82000000 q:18.08 tex:12490 mv:3757 misc:1329 imb:201 pmb:303 smb:846 d:- ref:0 ; in:9131 out:9131 type:P dur:82000000 cpbdur:82000000 q:19.08 tex:28587 mv:4969 misc:1204 imb:182 pmb:335 smb:833 d:- ref:0 ; in:9132 out:9132 type:P dur:82000000 cpbdur:82000000 q:18.12 tex:11292 mv:3523 misc:1145 imb:166 pmb:287 smb:897 d:- ref:0 ; in:9133 out:9133 type:P dur:82000000 cpbdur:82000000 q:18.14 tex:10806 mv:3886 misc:1284 imb:170 pmb:316 smb:864 d:- ref:0 ; in:9134 out:9134 type:P dur:82000000 cpbdur:82000000 q:19.40 tex:36082 mv:5815 misc:1167 imb:289 pmb:285 smb:776 d:- ref:0 ; in:9135 out:9135 type:P dur:82000000 cpbdur:82000000 q:18.57 tex:13794 mv:3764 misc:978 imb:194 pmb:250 smb:906 d:- ref:0 ; in:9136 out:9136 type:P dur:82000000 cpbdur:82000000 q:18.84 tex:19452 mv:3859 misc:1129 imb:179 pmb:283 smb:888 d:- ref:0 ; in:9137 out:9137 type:P dur:82000000 cpbdur:82000000 q:20.71 tex:37705 mv:5826 misc:1269 imb:312 pmb:242 smb:796 d:- ref:0 ; in:9138 out:9138 type:P dur:82000000 cpbdur:82000000 q:20.07 tex:23149 mv:3735 misc:1036 imb:181 pmb:223 smb:946 d:- ref:0 ; in:9139 out:9139 type:P dur:82000000 cpbdur:82000000 q:19.46 tex:20925 mv:4583 misc:1404 imb:235 pmb:393 smb:722 d:- ref:0 ; in:9140 out:9140 type:P dur:82000000 cpbdur:82000000 q:19.81 tex:26694 mv:4525 misc:1061 imb:202 pmb:211 smb:937 d:- ref:0 ; in:9141 out:9141 type:P dur:82000000 cpbdur:82000000 q:18.64 tex:15287 mv:3004 misc:1141 imb:145 pmb:280 smb:925 d:- ref:0 ; in:9142 out:9142 type:P dur:82000000 cpbdur:82000000 q:18.45 tex:18424 mv:3917 misc:1275 imb:181 pmb:341 smb:828 d:- ref:0 ; in:9143 out:9143 type:P dur:82000000 cpbdur:82000000 q:19.46 tex:32562 mv:4304 misc:1214 imb:169 pmb:312 smb:869 d:- ref:0 ; in:9144 out:9144 type:P dur:82000000 cpbdur:82000000 q:19.00 tex:24468 mv:3426 misc:874 imb:156 pmb:194 smb:1000 d:- ref:0 ; in:9145 out:9145 type:P dur:82000000 cpbdur:82000000 q:19.06 tex:22197 mv:3469 misc:1166 imb:162 pmb:267 smb:921 d:- ref:0 ; in:9146 out:9146 type:P dur:82000000 cpbdur:82000000 q:19.43 tex:31827 mv:4031 misc:1110 imb:140 pmb:271 smb:939 d:- ref:0 ; in:9147 out:9147 type:P dur:82000000 cpbdur:82000000 q:18.77 tex:19707 mv:3160 misc:909 imb:110 pmb:224 smb:1016 d:- ref:0 ; in:9148 out:9148 type:P dur:82000000 cpbdur:82000000 q:18.57 tex:21170 mv:3365 misc:969 imb:143 pmb:233 smb:974 d:- ref:0 ; in:9149 out:9149 type:P dur:82000000 cpbdur:82000000 q:19.89 tex:34373 mv:4618 misc:1113 imb:249 pmb:180 smb:921 d:- ref:0 ; in:9150 out:9150 type:P dur:82000000 cpbdur:82000000 q:19.32 tex:27208 mv:3759 misc:1137 imb:156 pmb:277 smb:917 d:- ref:0 ; in:9151 out:9151 type:P dur:82000000 cpbdur:82000000 q:19.18 tex:24795 mv:3616 misc:1037 imb:152 pmb:254 smb:944 d:- ref:0 ; in:9152 out:9152 type:P dur:82000000 cpbdur:82000000 q:19.75 tex:26460 mv:4420 misc:1000 imb:234 pmb:160 smb:956 d:- ref:0 ; in:9153 out:9153 type:P dur:82000000 cpbdur:82000000 q:19.20 tex:23026 mv:4065 misc:1077 imb:185 pmb:269 smb:896 d:- ref:0 ; in:9154 out:9154 type:P dur:82000000 cpbdur:82000000 q:19.14 tex:20454 mv:4221 misc:1205 imb:160 pmb:321 smb:869 d:- ref:0 ; in:9155 out:9155 type:P dur:82000000 cpbdur:82000000 q:19.70 tex:29632 mv:4712 misc:968 imb:254 pmb:178 smb:918 d:- ref:0 ; in:9156 out:9156 type:P dur:82000000 cpbdur:82000000 q:18.57 tex:17892 mv:3820 misc:992 imb:171 pmb:276 smb:903 d:- ref:0 ; in:9157 out:9157 type:P dur:82000000 cpbdur:82000000 q:18.34 tex:19433 mv:4761 misc:1342 imb:247 pmb:357 smb:746 d:- ref:0 ; in:9158 out:9158 type:P dur:82000000 cpbdur:82000000 q:19.42 tex:38593 mv:6201 misc:1046 imb:237 pmb:303 smb:810 d:- ref:0 ; in:9159 out:9159 type:P dur:82000000 cpbdur:82000000 q:18.76 tex:19795 mv:4451 misc:938 imb:206 pmb:247 smb:897 d:- ref:0 ; in:9160 out:9160 type:P dur:82000000 cpbdur:82000000 q:19.16 tex:25887 mv:5286 misc:1083 imb:208 pmb:316 smb:826 d:- ref:0 ; in:9161 out:9161 type:P dur:82000000 cpbdur:82000000 q:20.42 tex:38675 mv:6560 misc:1125 imb:287 pmb:280 smb:783 d:- ref:0 ; in:9162 out:9162 type:P dur:82000000 cpbdur:82000000 q:19.67 tex:19448 mv:4353 misc:855 imb:222 pmb:211 smb:917 d:- ref:0 ; in:9163 out:9163 type:P dur:82000000 cpbdur:82000000 q:19.41 tex:27100 mv:5663 misc:1221 imb:234 pmb:363 smb:753 d:- ref:0 ; in:9164 out:9164 type:P dur:82000000 cpbdur:82000000 q:20.13 tex:31422 mv:6194 misc:1200 imb:326 pmb:248 smb:776 d:- ref:0 ; in:9165 out:9165 type:P dur:82000000 cpbdur:82000000 q:19.00 tex:16925 mv:4418 misc:1161 imb:184 pmb:340 smb:826 d:- ref:0 ; in:9166 out:9166 type:P dur:82000000 cpbdur:82000000 q:18.55 tex:11504 mv:4321 misc:1231 imb:172 pmb:355 smb:823 d:- ref:0 ; in:9167 out:9167 type:P dur:82000000 cpbdur:82000000 q:19.54 tex:28236 mv:5801 misc:1147 imb:342 pmb:225 smb:783 d:- ref:0 ; in:9168 out:9168 type:P dur:82000000 cpbdur:82000000 q:18.81 tex:21771 mv:5410 misc:1211 imb:277 pmb:342 smb:731 d:- ref:0 ; in:9169 out:9169 type:P dur:82000000 cpbdur:82000000 q:18.40 tex:17041 mv:5009 misc:1302 imb:272 pmb:347 smb:731 d:- ref:0 ; in:9170 out:9170 type:P dur:82000000 cpbdur:82000000 q:19.23 tex:30951 mv:6026 misc:1223 imb:240 pmb:350 smb:760 d:- ref:0 ; in:9171 out:9171 type:P dur:82000000 cpbdur:82000000 q:18.19 tex:14498 mv:4326 misc:1192 imb:188 pmb:356 smb:806 d:- ref:0 ; in:9172 out:9172 type:P dur:82000000 cpbdur:82000000 q:17.64 tex:14057 mv:4268 misc:1147 imb:207 pmb:268 smb:875 d:- ref:0 ; in:9173 out:9173 type:P dur:82000000 cpbdur:82000000 q:19.58 tex:31463 mv:6169 misc:1256 imb:314 pmb:257 smb:779 d:- ref:0 ; in:9174 out:9174 type:P dur:82000000 cpbdur:82000000 q:18.39 tex:20660 mv:4928 misc:1332 imb:246 pmb:380 smb:724 d:- ref:0 ; in:9175 out:9175 type:P dur:82000000 cpbdur:82000000 q:17.64 tex:6916 mv:3396 misc:1096 imb:163 pmb:232 smb:955 d:- ref:0 ; in:9176 out:9176 type:P dur:82000000 cpbdur:82000000 q:19.14 tex:30050 mv:6070 misc:1312 imb:264 pmb:360 smb:726 d:- ref:0 ; in:9177 out:9177 type:P dur:82000000 cpbdur:82000000 q:18.33 tex:13151 mv:3928 misc:1273 imb:174 pmb:336 smb:840 d:- ref:0 ; in:9178 out:9178 type:P dur:82000000 cpbdur:82000000 q:18.05 tex:10310 mv:4023 misc:1331 imb:212 pmb:321 smb:817 d:- ref:0 ; in:9179 out:9179 type:P dur:82000000 cpbdur:82000000 q:18.96 tex:29472 mv:5146 misc:1270 imb:198 pmb:336 smb:816 d:- ref:0 ; in:9180 out:9180 type:P dur:82000000 cpbdur:82000000 q:18.00 tex:11440 mv:3364 misc:1220 imb:150 pmb:316 smb:884 d:- ref:0 ; in:9181 out:9181 type:P dur:82000000 cpbdur:82000000 q:17.83 tex:9538 mv:3544 misc:1278 imb:181 pmb:290 smb:879 d:- ref:0 ; in:9182 out:9182 type:P dur:82000000 cpbdur:82000000 q:18.99 tex:29758 mv:5242 misc:1264 imb:151 pmb:346 smb:853 d:- ref:0 ; in:9183 out:9183 type:P dur:82000000 cpbdur:82000000 q:18.38 tex:18381 mv:4051 misc:1216 imb:179 pmb:325 smb:846 d:- ref:0 ; in:9184 out:9184 type:P dur:82000000 cpbdur:82000000 q:17.80 tex:8450 mv:2898 misc:1228 imb:122 pmb:292 smb:936 d:- ref:0 ; in:9185 out:9185 type:P dur:82000000 cpbdur:82000000 q:19.75 tex:30413 mv:4911 misc:1212 imb:223 pmb:225 smb:902 d:- ref:0 ; in:9186 out:9186 type:P dur:82000000 cpbdur:82000000 q:18.41 tex:18475 mv:3669 misc:1384 imb:182 pmb:387 smb:781 d:- ref:0 ; in:9187 out:9187 type:P dur:82000000 cpbdur:82000000 q:17.91 tex:7331 mv:2924 misc:1289 imb:135 pmb:288 smb:927 d:- ref:0 ; in:9188 out:9188 type:P dur:82000000 cpbdur:82000000 q:18.83 tex:27400 mv:5420 misc:1188 imb:214 pmb:326 smb:810 d:- ref:0 ; in:9189 out:9189 type:P dur:82000000 cpbdur:82000000 q:17.84 tex:11335 mv:3266 misc:1167 imb:132 pmb:308 smb:910 d:- ref:0 ; in:9190 out:9190 type:P dur:82000000 cpbdur:82000000 q:18.12 tex:18374 mv:4190 misc:1364 imb:169 pmb:360 smb:821 d:- ref:0 ; in:9191 out:9191 type:P dur:82000000 cpbdur:82000000 q:18.81 tex:26607 mv:4350 misc:1131 imb:163 pmb:302 smb:885 d:- ref:0 ; in:9192 out:9192 type:P dur:82000000 cpbdur:82000000 q:18.18 tex:12852 mv:3574 misc:1366 imb:147 pmb:390 smb:813 d:- ref:0 ; in:9193 out:9193 type:P dur:82000000 cpbdur:82000000 q:17.84 tex:10336 mv:3265 misc:1335 imb:133 pmb:359 smb:858 d:- ref:0 ; in:9194 out:9194 type:P dur:82000000 cpbdur:82000000 q:18.92 tex:30812 mv:5390 misc:1286 imb:202 pmb:332 smb:816 d:- ref:0 ; in:9195 out:9195 type:P dur:82000000 cpbdur:82000000 q:17.91 tex:10156 mv:3236 misc:1232 imb:120 pmb:336 smb:894 d:- ref:0 ; in:9196 out:9196 type:P dur:82000000 cpbdur:82000000 q:17.38 tex:18158 mv:4740 misc:1478 imb:230 pmb:442 smb:678 d:- ref:0 ; in:9197 out:9197 type:P dur:82000000 cpbdur:82000000 q:19.56 tex:28723 mv:4865 misc:1252 imb:225 pmb:237 smb:888 d:- ref:0 ; in:9198 out:9198 type:P dur:82000000 cpbdur:82000000 q:18.53 tex:15507 mv:3930 misc:1299 imb:182 pmb:346 smb:822 d:- ref:0 ; in:9199 out:9199 type:P dur:82000000 cpbdur:82000000 q:17.84 tex:10108 mv:3494 misc:1406 imb:205 pmb:314 smb:831 d:- ref:0 ; in:9200 out:9200 type:P dur:82000000 cpbdur:82000000 q:19.08 tex:29756 mv:4816 misc:1212 imb:177 pmb:316 smb:857 d:- ref:0 ; in:9201 out:9201 type:P dur:82000000 cpbdur:82000000 q:18.28 tex:12547 mv:3651 misc:1218 imb:141 pmb:363 smb:846 d:- ref:0 ; in:9202 out:9202 type:P dur:82000000 cpbdur:82000000 q:17.84 tex:10020 mv:3436 misc:1264 imb:156 pmb:306 smb:888 d:- ref:0 ; in:9203 out:9203 type:P dur:82000000 cpbdur:82000000 q:19.11 tex:31032 mv:5432 misc:1288 imb:231 pmb:330 smb:789 d:- ref:0 ; in:9204 out:9204 type:P dur:82000000 cpbdur:82000000 q:18.60 tex:11620 mv:3789 misc:1231 imb:176 pmb:329 smb:845 d:- ref:0 ; in:9205 out:9205 type:P dur:82000000 cpbdur:82000000 q:18.18 tex:19452 mv:4503 misc:1157 imb:241 pmb:291 smb:818 d:- ref:0 ; in:9206 out:9206 type:P dur:82000000 cpbdur:82000000 q:20.08 tex:37698 mv:5470 misc:1072 imb:306 pmb:186 smb:858 d:- ref:0 ; in:9207 out:9207 type:P dur:82000000 cpbdur:82000000 q:20.00 tex:21247 mv:3530 misc:911 imb:202 pmb:186 smb:962 d:- ref:0 ; in:9208 out:9208 type:P dur:82000000 cpbdur:82000000 q:19.90 tex:18463 mv:3704 misc:1025 imb:202 pmb:200 smb:948 d:- ref:0 ; in:9209 out:9209 type:P dur:82000000 cpbdur:82000000 q:20.99 tex:33882 mv:5149 misc:1193 imb:238 pmb:227 smb:885 d:- ref:0 ; in:9210 out:9210 type:P dur:82000000 cpbdur:82000000 q:19.85 tex:17013 mv:2928 misc:947 imb:141 pmb:202 smb:1007 d:- ref:0 ; in:9211 out:9211 type:P dur:82000000 cpbdur:82000000 q:19.30 tex:24810 mv:4015 misc:1279 imb:215 pmb:331 smb:804 d:- ref:0 ; in:9212 out:9212 type:P dur:82000000 cpbdur:82000000 q:19.60 tex:28767 mv:4339 misc:958 imb:225 pmb:181 smb:944 d:- ref:0 ; in:9213 out:9213 type:P dur:82000000 cpbdur:82000000 q:18.85 tex:23151 mv:3663 misc:1074 imb:157 pmb:279 smb:914 d:- ref:0 ; in:9214 out:9214 type:P dur:82000000 cpbdur:82000000 q:18.71 tex:17257 mv:2758 misc:1081 imb:88 pmb:262 smb:1000 d:- ref:0 ; in:9215 out:9215 type:P dur:82000000 cpbdur:82000000 q:19.49 tex:34471 mv:4597 misc:1116 imb:200 pmb:267 smb:883 d:- ref:0 ; in:9216 out:9216 type:P dur:82000000 cpbdur:82000000 q:19.06 tex:23632 mv:3192 misc:856 imb:105 pmb:222 smb:1023 d:- ref:0 ; in:9217 out:9217 type:P dur:82000000 cpbdur:82000000 q:19.21 tex:21305 mv:4203 misc:1292 imb:180 pmb:329 smb:841 d:- ref:0 ; in:9218 out:9218 type:P dur:82000000 cpbdur:82000000 q:19.45 tex:34866 mv:4436 misc:1034 imb:192 pmb:224 smb:934 d:- ref:0 ; in:9219 out:9219 type:P dur:82000000 cpbdur:82000000 q:18.95 tex:22996 mv:3721 misc:891 imb:125 pmb:233 smb:992 d:- ref:0 ; in:9220 out:9220 type:P dur:82000000 cpbdur:82000000 q:18.96 tex:18958 mv:3680 misc:1178 imb:134 pmb:326 smb:890 d:- ref:0 ; in:9221 out:9221 type:P dur:82000000 cpbdur:82000000 q:22.96 tex:146195 mv:12100 misc:1409 imb:1314 pmb:36 smb:0 d:- ref:0 ; in:9222 out:9222 type:P dur:82000000 cpbdur:82000000 q:22.31 tex:36141 mv:5920 misc:1195 imb:144 pmb:426 smb:780 d:- ref:0 ; in:9223 out:9223 type:P dur:82000000 cpbdur:82000000 q:21.41 tex:52040 mv:5663 misc:1209 imb:126 pmb:423 smb:801 d:- ref:0 ; in:9224 out:9224 type:P dur:82000000 cpbdur:82000000 q:20.75 tex:32880 mv:4874 misc:1254 imb:201 pmb:436 smb:713 d:- ref:0 ; in:9225 out:9225 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:59838 mv:5770 misc:1232 imb:142 pmb:432 smb:776 d:- ref:0 ; in:9226 out:9226 type:P dur:82000000 cpbdur:82000000 q:19.87 tex:35960 mv:4378 misc:1246 imb:140 pmb:446 smb:764 d:- ref:0 ; in:9227 out:9227 type:P dur:82000000 cpbdur:82000000 q:20.57 tex:57324 mv:6902 misc:1254 imb:197 pmb:436 smb:717 d:- ref:0 ; in:9228 out:9228 type:P dur:82000000 cpbdur:82000000 q:20.22 tex:45882 mv:4958 misc:1240 imb:142 pmb:436 smb:772 d:- ref:0 ; in:9229 out:9229 type:P dur:82000000 cpbdur:82000000 q:20.94 tex:59191 mv:7764 misc:1293 imb:237 pmb:458 smb:655 d:- ref:0 ; in:9230 out:9230 type:P dur:82000000 cpbdur:82000000 q:19.96 tex:41775 mv:3861 misc:1236 imb:100 pmb:447 smb:803 d:- ref:0 ; in:9231 out:9231 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:61808 mv:7260 misc:1252 imb:173 pmb:466 smb:711 d:- ref:0 ; in:9232 out:9232 type:P dur:82000000 cpbdur:82000000 q:20.30 tex:46356 mv:5048 misc:1284 imb:130 pmb:478 smb:742 d:- ref:0 ; in:9233 out:9233 type:P dur:82000000 cpbdur:82000000 q:20.93 tex:62584 mv:7761 misc:1303 imb:246 pmb:469 smb:635 d:- ref:0 ; in:9234 out:9234 type:P dur:82000000 cpbdur:82000000 q:20.37 tex:54525 mv:5632 misc:1251 imb:159 pmb:484 smb:707 d:- ref:0 ; in:9235 out:9235 type:P dur:82000000 cpbdur:82000000 q:20.51 tex:53713 mv:5747 misc:1204 imb:82 pmb:479 smb:789 d:- ref:0 ; in:9236 out:9236 type:P dur:82000000 cpbdur:82000000 q:20.00 tex:41214 mv:4595 misc:1247 imb:92 pmb:475 smb:783 d:- ref:0 ; in:9237 out:9237 type:P dur:82000000 cpbdur:82000000 q:20.44 tex:61871 mv:6343 misc:1202 imb:123 pmb:493 smb:734 d:- ref:0 ; in:9238 out:9238 type:P dur:82000000 cpbdur:82000000 q:19.63 tex:34752 mv:4084 misc:1236 imb:92 pmb:474 smb:784 d:- ref:0 ; in:9239 out:9239 type:P dur:82000000 cpbdur:82000000 q:20.41 tex:63861 mv:6788 misc:1231 imb:152 pmb:480 smb:718 d:- ref:0 ; in:9240 out:9240 type:P dur:82000000 cpbdur:82000000 q:19.70 tex:30934 mv:4234 misc:1232 imb:101 pmb:466 smb:783 d:- ref:0 ; in:9241 out:9241 type:P dur:82000000 cpbdur:82000000 q:20.84 tex:63845 mv:8278 misc:1253 imb:184 pmb:512 smb:654 d:- ref:0 ; in:9242 out:9242 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:56145 mv:5974 misc:1257 imb:106 pmb:518 smb:726 d:- ref:0 ; in:9243 out:9243 type:P dur:82000000 cpbdur:82000000 q:20.78 tex:58890 mv:7456 misc:1254 imb:157 pmb:548 smb:645 d:- ref:0 ; in:9244 out:9244 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:44031 mv:5533 misc:1292 imb:151 pmb:541 smb:658 d:- ref:0 ; in:9245 out:9245 type:P dur:82000000 cpbdur:82000000 q:21.34 tex:67039 mv:8392 misc:1321 imb:213 pmb:564 smb:573 d:- ref:0 ; in:9246 out:9246 type:P dur:82000000 cpbdur:82000000 q:20.56 tex:34155 mv:5060 misc:1337 imb:124 pmb:554 smb:672 d:- ref:0 ; in:9247 out:9247 type:P dur:82000000 cpbdur:82000000 q:20.78 tex:57721 mv:7426 misc:1285 imb:149 pmb:588 smb:613 d:- ref:0 ; in:9248 out:9248 type:P dur:82000000 cpbdur:82000000 q:20.24 tex:43476 mv:5305 misc:1323 imb:99 pmb:593 smb:658 d:- ref:0 ; in:9249 out:9249 type:P dur:82000000 cpbdur:82000000 q:20.82 tex:58419 mv:7232 misc:1301 imb:104 pmb:594 smb:652 d:- ref:0 ; in:9250 out:9250 type:I dur:82000000 cpbdur:82000000 q:17.31 tex:291076 mv:12060 misc:376 imb:1350 pmb:0 smb:0 d:- ref:; in:9251 out:9251 type:P dur:82000000 cpbdur:82000000 q:23.90 tex:39607 mv:7245 misc:1276 imb:82 pmb:541 smb:727 d:- ref:0 ; in:9252 out:9252 type:P dur:82000000 cpbdur:82000000 q:22.56 tex:34088 mv:5676 misc:1284 imb:96 pmb:536 smb:718 d:- ref:0 ; in:9253 out:9253 type:P dur:82000000 cpbdur:82000000 q:22.55 tex:53909 mv:8568 misc:1307 imb:163 pmb:570 smb:617 d:- ref:0 ; in:9254 out:9254 type:P dur:82000000 cpbdur:82000000 q:21.77 tex:46030 mv:6739 misc:1375 imb:119 pmb:631 smb:600 d:- ref:0 ; in:9255 out:9255 type:P dur:82000000 cpbdur:82000000 q:22.01 tex:63183 mv:9240 misc:1377 imb:196 pmb:668 smb:486 d:- ref:0 ; in:9256 out:9256 type:P dur:82000000 cpbdur:82000000 q:21.42 tex:48276 mv:6483 misc:1425 imb:153 pmb:663 smb:534 d:- ref:0 ; in:9257 out:9257 type:P dur:82000000 cpbdur:82000000 q:22.02 tex:63902 mv:9961 misc:1417 imb:216 pmb:669 smb:465 d:- ref:0 ; in:9258 out:9258 type:P dur:82000000 cpbdur:82000000 q:21.40 tex:53170 mv:7252 misc:1466 imb:171 pmb:682 smb:497 d:- ref:0 ; in:9259 out:9259 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:58725 mv:7810 misc:1457 imb:170 pmb:686 smb:494 d:- ref:0 ; in:9260 out:9260 type:P dur:82000000 cpbdur:82000000 q:21.52 tex:50535 mv:7650 misc:1439 imb:154 pmb:678 smb:518 d:- ref:0 ; in:9261 out:9261 type:P dur:82000000 cpbdur:82000000 q:21.87 tex:62795 mv:9474 misc:1451 imb:202 pmb:702 smb:446 d:- ref:0 ; in:9262 out:9262 type:P dur:82000000 cpbdur:82000000 q:21.42 tex:57051 mv:7962 misc:1491 imb:255 pmb:704 smb:391 d:- ref:0 ; in:9263 out:9263 type:P dur:82000000 cpbdur:82000000 q:21.76 tex:65548 mv:8912 misc:1444 imb:151 pmb:682 smb:517 d:- ref:0 ; in:9264 out:9264 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:53442 mv:7943 misc:1463 imb:171 pmb:683 smb:496 d:- ref:0 ; in:9265 out:9265 type:P dur:82000000 cpbdur:82000000 q:22.21 tex:75466 mv:10359 misc:1463 imb:215 pmb:709 smb:426 d:- ref:0 ; in:9266 out:9266 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:45632 mv:6790 misc:1458 imb:111 pmb:650 smb:589 d:- ref:0 ; in:9267 out:9267 type:P dur:82000000 cpbdur:82000000 q:22.00 tex:65554 mv:9801 misc:1453 imb:180 pmb:697 smb:473 d:- ref:0 ; in:9268 out:9268 type:P dur:82000000 cpbdur:82000000 q:21.55 tex:50123 mv:7415 misc:1446 imb:135 pmb:691 smb:524 d:- ref:0 ; in:9269 out:9269 type:P dur:82000000 cpbdur:82000000 q:22.15 tex:76705 mv:9330 misc:1437 imb:193 pmb:682 smb:475 d:- ref:0 ; in:9270 out:9270 type:P dur:82000000 cpbdur:82000000 q:21.90 tex:61062 mv:7836 misc:1470 imb:170 pmb:714 smb:466 d:- ref:0 ; in:9271 out:9271 type:P dur:82000000 cpbdur:82000000 q:21.95 tex:68033 mv:7820 misc:1443 imb:114 pmb:698 smb:538 d:- ref:0 ; in:9272 out:9272 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:47942 mv:7270 misc:1484 imb:168 pmb:684 smb:498 d:- ref:0 ; in:9273 out:9273 type:P dur:82000000 cpbdur:82000000 q:21.81 tex:65607 mv:8098 misc:1431 imb:124 pmb:674 smb:552 d:- ref:0 ; in:9274 out:9274 type:P dur:82000000 cpbdur:82000000 q:21.64 tex:55213 mv:7445 misc:1486 imb:117 pmb:715 smb:518 d:- ref:0 ; in:9275 out:9275 type:P dur:82000000 cpbdur:82000000 q:22.40 tex:85981 mv:9353 misc:1474 imb:149 pmb:721 smb:480 d:- ref:0 ; in:9276 out:9276 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:46800 mv:5884 misc:1484 imb:100 pmb:690 smb:560 d:- ref:0 ; in:9277 out:9277 type:P dur:82000000 cpbdur:82000000 q:22.37 tex:88111 mv:9658 misc:1495 imb:172 pmb:756 smb:422 d:- ref:0 ; in:9278 out:9278 type:P dur:82000000 cpbdur:82000000 q:21.66 tex:52883 mv:5659 misc:1490 imb:94 pmb:679 smb:577 d:- ref:0 ; in:9279 out:9279 type:P dur:82000000 cpbdur:82000000 q:22.58 tex:82988 mv:9672 misc:1444 imb:192 pmb:690 smb:468 d:- ref:0 ; in:9280 out:9280 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:53522 mv:5689 misc:1501 imb:117 pmb:771 smb:462 d:- ref:0 ; in:9281 out:9281 type:P dur:82000000 cpbdur:82000000 q:22.84 tex:84202 mv:8894 misc:1456 imb:177 pmb:682 smb:491 d:- ref:0 ; in:9282 out:9282 type:P dur:82000000 cpbdur:82000000 q:22.43 tex:76478 mv:8008 misc:1490 imb:172 pmb:800 smb:378 d:- ref:0 ; in:9283 out:9283 type:P dur:82000000 cpbdur:82000000 q:22.92 tex:74446 mv:7863 misc:1451 imb:102 pmb:695 smb:553 d:- ref:0 ; in:9284 out:9284 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:70613 mv:6298 misc:1497 imb:101 pmb:728 smb:521 d:- ref:0 ; in:9285 out:9285 type:P dur:82000000 cpbdur:82000000 q:22.87 tex:74564 mv:7864 misc:1452 imb:130 pmb:658 smb:562 d:- ref:0 ; in:9286 out:9286 type:P dur:82000000 cpbdur:82000000 q:21.85 tex:53527 mv:5464 misc:1521 imb:125 pmb:738 smb:487 d:- ref:0 ; in:9287 out:9287 type:P dur:82000000 cpbdur:82000000 q:23.08 tex:87057 mv:8838 misc:1465 imb:132 pmb:686 smb:532 d:- ref:0 ; in:9288 out:9288 type:P dur:82000000 cpbdur:82000000 q:22.37 tex:69850 mv:6701 misc:1505 imb:148 pmb:737 smb:465 d:- ref:0 ; in:9289 out:9289 type:P dur:82000000 cpbdur:82000000 q:23.37 tex:90763 mv:9853 misc:1464 imb:156 pmb:705 smb:489 d:- ref:0 ; in:9290 out:9290 type:P dur:82000000 cpbdur:82000000 q:22.59 tex:52741 mv:5802 misc:1465 imb:101 pmb:652 smb:597 d:- ref:0 ; in:9291 out:9291 type:P dur:82000000 cpbdur:82000000 q:23.16 tex:80323 mv:9175 misc:1454 imb:214 pmb:689 smb:447 d:- ref:0 ; in:9292 out:9292 type:P dur:82000000 cpbdur:82000000 q:22.66 tex:57995 mv:7056 misc:1509 imb:150 pmb:690 smb:510 d:- ref:0 ; in:9293 out:9293 type:P dur:82000000 cpbdur:82000000 q:23.31 tex:83627 mv:9970 misc:1515 imb:218 pmb:706 smb:426 d:- ref:0 ; in:9294 out:9294 type:P dur:82000000 cpbdur:82000000 q:21.82 tex:40194 mv:5546 misc:1540 imb:152 pmb:728 smb:470 d:- ref:0 ; in:9295 out:9295 type:P dur:82000000 cpbdur:82000000 q:22.60 tex:73069 mv:8373 misc:1470 imb:131 pmb:691 smb:528 d:- ref:0 ; in:9296 out:9296 type:P dur:82000000 cpbdur:82000000 q:22.47 tex:69576 mv:8687 misc:1529 imb:168 pmb:759 smb:423 d:- ref:0 ; in:9297 out:9297 type:P dur:82000000 cpbdur:82000000 q:22.90 tex:74434 mv:8733 misc:1473 imb:128 pmb:715 smb:507 d:- ref:0 ; in:9298 out:9298 type:P dur:82000000 cpbdur:82000000 q:22.26 tex:66148 mv:7294 misc:1526 imb:130 pmb:798 smb:422 d:- ref:0 ; in:9299 out:9299 type:P dur:82000000 cpbdur:82000000 q:23.04 tex:84987 mv:8950 misc:1423 imb:152 pmb:678 smb:520 d:- ref:0 ; in:9300 out:9300 type:P dur:82000000 cpbdur:82000000 q:22.58 tex:60397 mv:7179 misc:1504 imb:148 pmb:679 smb:523 d:- ref:0 ; in:9301 out:9301 type:P dur:82000000 cpbdur:82000000 q:23.20 tex:86646 mv:9859 misc:1471 imb:204 pmb:677 smb:469 d:- ref:0 ; in:9302 out:9302 type:P dur:82000000 cpbdur:82000000 q:21.74 tex:44982 mv:6130 misc:1552 imb:158 pmb:754 smb:438 d:- ref:0 ; in:9303 out:9303 type:P dur:82000000 cpbdur:82000000 q:22.73 tex:77491 mv:9348 misc:1457 imb:203 pmb:696 smb:451 d:- ref:0 ; in:9304 out:9304 type:P dur:82000000 cpbdur:82000000 q:22.18 tex:66353 mv:7498 misc:1525 imb:157 pmb:766 smb:427 d:- ref:0 ; in:9305 out:9305 type:P dur:82000000 cpbdur:82000000 q:22.93 tex:77780 mv:8918 misc:1438 imb:165 pmb:658 smb:527 d:- ref:0 ; in:9306 out:9306 type:P dur:82000000 cpbdur:82000000 q:22.36 tex:70210 mv:7452 misc:1530 imb:173 pmb:734 smb:443 d:- ref:0 ; in:9307 out:9307 type:P dur:82000000 cpbdur:82000000 q:22.78 tex:69835 mv:7392 misc:1437 imb:100 pmb:618 smb:632 d:- ref:0 ; in:9308 out:9308 type:P dur:82000000 cpbdur:82000000 q:22.48 tex:67968 mv:7314 misc:1534 imb:122 pmb:708 smb:520 d:- ref:0 ; in:9309 out:9309 type:P dur:82000000 cpbdur:82000000 q:22.81 tex:70706 mv:7848 misc:1470 imb:130 pmb:644 smb:576 d:- ref:0 ; in:9310 out:9310 type:P dur:82000000 cpbdur:82000000 q:22.13 tex:64555 mv:6226 misc:1539 imb:113 pmb:706 smb:531 d:- ref:0 ; in:9311 out:9311 type:P dur:82000000 cpbdur:82000000 q:23.05 tex:83082 mv:7873 misc:1453 imb:128 pmb:643 smb:579 d:- ref:0 ; in:9312 out:9312 type:P dur:82000000 cpbdur:82000000 q:22.14 tex:59247 mv:5035 misc:1526 imb:78 pmb:701 smb:571 d:- ref:0 ; in:9313 out:9313 type:P dur:82000000 cpbdur:82000000 q:23.08 tex:84098 mv:8500 misc:1402 imb:120 pmb:620 smb:610 d:- ref:0 ; in:9314 out:9314 type:P dur:82000000 cpbdur:82000000 q:22.20 tex:59619 mv:5640 misc:1493 imb:95 pmb:692 smb:563 d:- ref:0 ; in:9315 out:9315 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:74599 mv:7284 misc:1381 imb:95 pmb:630 smb:625 d:- ref:0 ; in:9316 out:9316 type:P dur:82000000 cpbdur:82000000 q:21.16 tex:53348 mv:4818 misc:1570 imb:118 pmb:786 smb:446 d:- ref:0 ; in:9317 out:9317 type:P dur:82000000 cpbdur:82000000 q:22.33 tex:84329 mv:8551 misc:1464 imb:142 pmb:673 smb:535 d:- ref:0 ; in:9318 out:9318 type:P dur:82000000 cpbdur:82000000 q:21.07 tex:38664 mv:4043 misc:1557 imb:81 pmb:625 smb:644 d:- ref:0 ; in:9319 out:9319 type:P dur:82000000 cpbdur:82000000 q:22.29 tex:83040 mv:7295 misc:1401 imb:77 pmb:655 smb:618 d:- ref:0 ; in:9320 out:9320 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:43807 mv:3662 misc:1371 imb:24 pmb:570 smb:756 d:- ref:0 ; in:9321 out:9321 type:P dur:82000000 cpbdur:82000000 q:22.50 tex:71649 mv:7089 misc:1350 imb:76 pmb:621 smb:653 d:- ref:0 ; in:9322 out:9322 type:P dur:82000000 cpbdur:82000000 q:21.10 tex:51491 mv:4320 misc:1557 imb:104 pmb:730 smb:516 d:- ref:0 ; in:9323 out:9323 type:P dur:82000000 cpbdur:82000000 q:22.74 tex:84713 mv:8584 misc:1327 imb:128 pmb:604 smb:618 d:- ref:0 ; in:9324 out:9324 type:P dur:82000000 cpbdur:82000000 q:21.17 tex:55313 mv:4180 misc:1547 imb:91 pmb:728 smb:531 d:- ref:0 ; in:9325 out:9325 type:P dur:82000000 cpbdur:82000000 q:22.71 tex:80877 mv:7793 misc:1362 imb:129 pmb:575 smb:646 d:- ref:0 ; in:9326 out:9326 type:P dur:82000000 cpbdur:82000000 q:21.24 tex:53151 mv:4525 misc:1548 imb:85 pmb:727 smb:538 d:- ref:0 ; in:9327 out:9327 type:P dur:82000000 cpbdur:82000000 q:22.38 tex:85235 mv:8091 misc:1410 imb:121 pmb:643 smb:586 d:- ref:0 ; in:9328 out:9328 type:P dur:82000000 cpbdur:82000000 q:21.29 tex:48057 mv:3672 misc:1511 imb:43 pmb:634 smb:673 d:- ref:0 ; in:9329 out:9329 type:P dur:82000000 cpbdur:82000000 q:22.53 tex:73425 mv:7514 misc:1413 imb:120 pmb:604 smb:626 d:- ref:0 ; in:9330 out:9330 type:P dur:82000000 cpbdur:82000000 q:20.89 tex:46196 mv:4045 misc:1543 imb:88 pmb:679 smb:583 d:- ref:0 ; in:9331 out:9331 type:P dur:82000000 cpbdur:82000000 q:22.36 tex:82997 mv:7648 misc:1387 imb:93 pmb:632 smb:625 d:- ref:0 ; in:9332 out:9332 type:P dur:82000000 cpbdur:82000000 q:21.14 tex:42030 mv:4184 misc:1530 imb:78 pmb:656 smb:616 d:- ref:0 ; in:9333 out:9333 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:84858 mv:8355 misc:1411 imb:111 pmb:651 smb:588 d:- ref:0 ; in:9334 out:9334 type:P dur:82000000 cpbdur:82000000 q:20.98 tex:33439 mv:3428 misc:1493 imb:50 pmb:606 smb:694 d:- ref:0 ; in:9335 out:9335 type:P dur:82000000 cpbdur:82000000 q:22.63 tex:81360 mv:7676 misc:1316 imb:98 pmb:598 smb:654 d:- ref:0 ; in:9336 out:9336 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:48829 mv:4498 misc:1497 imb:82 pmb:654 smb:614 d:- ref:0 ; in:9337 out:9337 type:P dur:82000000 cpbdur:82000000 q:22.82 tex:80533 mv:7750 misc:1357 imb:102 pmb:588 smb:660 d:- ref:0 ; in:9338 out:9338 type:P dur:82000000 cpbdur:82000000 q:22.13 tex:64192 mv:5946 misc:1470 imb:80 pmb:666 smb:604 d:- ref:0 ; in:9339 out:9339 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:71529 mv:7085 misc:1418 imb:82 pmb:627 smb:641 d:- ref:0 ; in:9340 out:9340 type:P dur:82000000 cpbdur:82000000 q:21.74 tex:51007 mv:4667 misc:1462 imb:70 pmb:657 smb:623 d:- ref:0 ; in:9341 out:9341 type:P dur:82000000 cpbdur:82000000 q:22.57 tex:72104 mv:7723 misc:1485 imb:130 pmb:639 smb:581 d:- ref:0 ; in:9342 out:9342 type:P dur:82000000 cpbdur:82000000 q:21.88 tex:60301 mv:4990 misc:1509 imb:83 pmb:656 smb:611 d:- ref:0 ; in:9343 out:9343 type:P dur:82000000 cpbdur:82000000 q:22.72 tex:73444 mv:7133 misc:1335 imb:66 pmb:605 smb:679 d:- ref:0 ; in:9344 out:9344 type:P dur:82000000 cpbdur:82000000 q:21.47 tex:59131 mv:4808 misc:1541 imb:91 pmb:734 smb:525 d:- ref:0 ; in:9345 out:9345 type:P dur:82000000 cpbdur:82000000 q:22.50 tex:71807 mv:6972 misc:1325 imb:76 pmb:588 smb:686 d:- ref:0 ; in:9346 out:9346 type:P dur:82000000 cpbdur:82000000 q:21.31 tex:55354 mv:4108 misc:1522 imb:89 pmb:680 smb:581 d:- ref:0 ; in:9347 out:9347 type:P dur:82000000 cpbdur:82000000 q:22.73 tex:83060 mv:8163 misc:1329 imb:111 pmb:605 smb:634 d:- ref:0 ; in:9348 out:9348 type:P dur:82000000 cpbdur:82000000 q:21.76 tex:54748 mv:4811 misc:1489 imb:85 pmb:649 smb:616 d:- ref:0 ; in:9349 out:9349 type:P dur:82000000 cpbdur:82000000 q:22.83 tex:78961 mv:7604 misc:1363 imb:111 pmb:600 smb:639 d:- ref:0 ; in:9350 out:9350 type:P dur:82000000 cpbdur:82000000 q:22.42 tex:65635 mv:6663 misc:1502 imb:107 pmb:679 smb:564 d:- ref:0 ; in:9351 out:9351 type:P dur:82000000 cpbdur:82000000 q:22.79 tex:69973 mv:6941 misc:1310 imb:95 pmb:575 smb:680 d:- ref:0 ; in:9352 out:9352 type:P dur:82000000 cpbdur:82000000 q:21.76 tex:49552 mv:4505 misc:1439 imb:58 pmb:635 smb:657 d:- ref:0 ; in:9353 out:9353 type:P dur:82000000 cpbdur:82000000 q:22.73 tex:75504 mv:7783 misc:1449 imb:130 pmb:621 smb:599 d:- ref:0 ; in:9354 out:9354 type:P dur:82000000 cpbdur:82000000 q:21.92 tex:57650 mv:4934 misc:1504 imb:76 pmb:652 smb:622 d:- ref:0 ; in:9355 out:9355 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:73054 mv:7227 misc:1351 imb:88 pmb:591 smb:671 d:- ref:0 ; in:9356 out:9356 type:P dur:82000000 cpbdur:82000000 q:21.57 tex:44104 mv:4351 misc:1521 imb:69 pmb:655 smb:626 d:- ref:0 ; in:9357 out:9357 type:P dur:82000000 cpbdur:82000000 q:22.48 tex:86420 mv:7844 misc:1408 imb:103 pmb:660 smb:587 d:- ref:0 ; in:9358 out:9358 type:P dur:82000000 cpbdur:82000000 q:21.25 tex:45441 mv:4144 misc:1527 imb:82 pmb:654 smb:614 d:- ref:0 ; in:9359 out:9359 type:P dur:82000000 cpbdur:82000000 q:22.78 tex:83026 mv:7678 misc:1320 imb:92 pmb:606 smb:652 d:- ref:0 ; in:9360 out:9360 type:P dur:82000000 cpbdur:82000000 q:22.03 tex:58908 mv:4938 misc:1514 imb:79 pmb:686 smb:585 d:- ref:0 ; in:9361 out:9361 type:P dur:82000000 cpbdur:82000000 q:23.12 tex:83730 mv:8576 misc:1358 imb:133 pmb:618 smb:599 d:- ref:0 ; in:9362 out:9362 type:P dur:82000000 cpbdur:82000000 q:22.53 tex:55172 mv:5226 misc:1402 imb:72 pmb:594 smb:684 d:- ref:0 ; in:9363 out:9363 type:P dur:82000000 cpbdur:82000000 q:22.86 tex:72950 mv:7192 misc:1394 imb:88 pmb:644 smb:618 d:- ref:0 ; in:9364 out:9364 type:P dur:82000000 cpbdur:82000000 q:22.30 tex:62875 mv:5953 misc:1508 imb:116 pmb:717 smb:517 d:- ref:0 ; in:9365 out:9365 type:P dur:82000000 cpbdur:82000000 q:22.76 tex:71251 mv:7443 misc:1386 imb:120 pmb:619 smb:611 d:- ref:0 ; in:9366 out:9366 type:P dur:82000000 cpbdur:82000000 q:21.45 tex:57985 mv:4515 misc:1532 imb:118 pmb:725 smb:507 d:- ref:0 ; in:9367 out:9367 type:P dur:82000000 cpbdur:82000000 q:22.48 tex:82868 mv:7584 misc:1404 imb:97 pmb:670 smb:583 d:- ref:0 ; in:9368 out:9368 type:P dur:82000000 cpbdur:82000000 q:21.58 tex:42375 mv:3943 misc:1450 imb:46 pmb:593 smb:711 d:- ref:0 ; in:9369 out:9369 type:P dur:82000000 cpbdur:82000000 q:22.56 tex:72190 mv:7243 misc:1383 imb:87 pmb:617 smb:646 d:- ref:0 ; in:9370 out:9370 type:P dur:82000000 cpbdur:82000000 q:22.23 tex:71543 mv:6270 misc:1475 imb:93 pmb:664 smb:593 d:- ref:0 ; in:9371 out:9371 type:P dur:82000000 cpbdur:82000000 q:23.09 tex:81197 mv:8350 misc:1381 imb:112 pmb:624 smb:614 d:- ref:0 ; in:9372 out:9372 type:P dur:82000000 cpbdur:82000000 q:22.44 tex:67029 mv:5500 misc:1463 imb:87 pmb:664 smb:599 d:- ref:0 ; in:9373 out:9373 type:P dur:82000000 cpbdur:82000000 q:23.14 tex:77624 mv:7964 misc:1372 imb:101 pmb:622 smb:627 d:- ref:0 ; in:9374 out:9374 type:P dur:82000000 cpbdur:82000000 q:22.45 tex:68544 mv:5865 misc:1495 imb:91 pmb:661 smb:598 d:- ref:0 ; in:9375 out:9375 type:P dur:82000000 cpbdur:82000000 q:22.88 tex:73903 mv:7277 misc:1364 imb:86 pmb:595 smb:669 d:- ref:0 ; in:9376 out:9376 type:P dur:82000000 cpbdur:82000000 q:22.26 tex:61750 mv:5628 misc:1502 imb:93 pmb:698 smb:559 d:- ref:0 ; in:9377 out:9377 type:P dur:82000000 cpbdur:82000000 q:22.79 tex:71897 mv:7186 misc:1373 imb:88 pmb:612 smb:650 d:- ref:0 ; in:9378 out:9378 type:P dur:82000000 cpbdur:82000000 q:22.07 tex:55444 mv:5358 misc:1502 imb:87 pmb:652 smb:611 d:- ref:0 ; in:9379 out:9379 type:P dur:82000000 cpbdur:82000000 q:22.70 tex:70147 mv:7158 misc:1375 imb:77 pmb:604 smb:669 d:- ref:0 ; in:9380 out:9380 type:P dur:82000000 cpbdur:82000000 q:21.12 tex:46774 mv:4625 misc:1561 imb:91 pmb:721 smb:538 d:- ref:0 ; in:9381 out:9381 type:P dur:82000000 cpbdur:82000000 q:22.40 tex:86401 mv:7875 misc:1436 imb:88 pmb:655 smb:607 d:- ref:0 ; in:9382 out:9382 type:P dur:82000000 cpbdur:82000000 q:21.62 tex:46916 mv:4129 misc:1451 imb:25 pmb:581 smb:744 d:- ref:0 ; in:9383 out:9383 type:P dur:82000000 cpbdur:82000000 q:22.91 tex:82778 mv:7862 misc:1408 imb:106 pmb:636 smb:608 d:- ref:0 ; in:9384 out:9384 type:P dur:82000000 cpbdur:82000000 q:21.88 tex:52696 mv:4245 misc:1483 imb:58 pmb:639 smb:653 d:- ref:0 ; in:9385 out:9385 type:P dur:82000000 cpbdur:82000000 q:22.96 tex:81981 mv:8115 misc:1384 imb:115 pmb:615 smb:620 d:- ref:0 ; in:9386 out:9386 type:P dur:82000000 cpbdur:82000000 q:22.07 tex:55636 mv:5013 misc:1519 imb:89 pmb:667 smb:594 d:- ref:0 ; in:9387 out:9387 type:P dur:82000000 cpbdur:82000000 q:22.69 tex:71580 mv:7043 misc:1385 imb:80 pmb:629 smb:641 d:- ref:0 ; in:9388 out:9388 type:P dur:82000000 cpbdur:82000000 q:22.34 tex:73261 mv:6023 misc:1460 imb:81 pmb:695 smb:574 d:- ref:0 ; in:9389 out:9389 type:P dur:82000000 cpbdur:82000000 q:24.33 tex:77467 mv:12029 misc:1416 imb:1315 pmb:35 smb:0 d:- ref:0 ; in:9390 out:9390 type:P dur:82000000 cpbdur:82000000 q:22.78 tex:24260 mv:2711 misc:909 imb:58 pmb:283 smb:1009 d:- ref:0 ; in:9391 out:9391 type:P dur:82000000 cpbdur:82000000 q:21.79 tex:23423 mv:4585 misc:1120 imb:141 pmb:463 smb:746 d:- ref:0 ; in:9392 out:9392 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:26515 mv:3595 misc:1122 imb:140 pmb:421 smb:789 d:- ref:0 ; in:9393 out:9393 type:P dur:82000000 cpbdur:82000000 q:19.23 tex:34316 mv:3553 misc:1155 imb:93 pmb:567 smb:690 d:- ref:0 ; in:9394 out:9394 type:P dur:82000000 cpbdur:82000000 q:17.51 tex:17550 mv:1585 misc:1097 imb:17 pmb:405 smb:928 d:- ref:0 ; in:9395 out:9395 type:P dur:82000000 cpbdur:82000000 q:17.83 tex:22605 mv:1903 misc:1036 imb:37 pmb:343 smb:970 d:- ref:0 ; in:9396 out:9396 type:P dur:82000000 cpbdur:82000000 q:16.88 tex:26135 mv:3015 misc:1282 imb:115 pmb:551 smb:684 d:- ref:0 ; in:9397 out:9397 type:P dur:82000000 cpbdur:82000000 q:17.42 tex:27892 mv:3682 misc:1090 imb:163 pmb:440 smb:747 d:- ref:0 ; in:9398 out:9398 type:P dur:82000000 cpbdur:82000000 q:19.13 tex:39514 mv:6066 misc:1068 imb:253 pmb:400 smb:697 d:- ref:0 ; in:9399 out:9399 type:P dur:82000000 cpbdur:82000000 q:18.73 tex:24794 mv:4168 misc:1062 imb:193 pmb:394 smb:763 d:- ref:0 ; in:9400 out:9400 type:P dur:82000000 cpbdur:82000000 q:18.56 tex:27150 mv:4190 misc:1100 imb:128 pmb:500 smb:722 d:- ref:0 ; in:9401 out:9401 type:P dur:82000000 cpbdur:82000000 q:17.47 tex:35168 mv:2673 misc:1191 imb:40 pmb:601 smb:709 d:- ref:0 ; in:9402 out:9402 type:P dur:82000000 cpbdur:82000000 q:16.83 tex:17967 mv:2165 misc:1148 imb:34 pmb:513 smb:803 d:- ref:0 ; in:9403 out:9403 type:P dur:82000000 cpbdur:82000000 q:15.54 tex:31475 mv:2314 misc:1139 imb:21 pmb:612 smb:717 d:- ref:0 ; in:9404 out:9404 type:P dur:82000000 cpbdur:82000000 q:16.50 tex:21627 mv:2277 misc:1096 imb:35 pmb:471 smb:844 d:- ref:0 ; in:9405 out:9405 type:P dur:82000000 cpbdur:82000000 q:15.23 tex:29769 mv:2791 misc:1104 imb:33 pmb:575 smb:742 d:- ref:0 ; in:9406 out:9406 type:P dur:82000000 cpbdur:82000000 q:15.25 tex:18925 mv:1705 misc:1042 imb:37 pmb:335 smb:978 d:- ref:0 ; in:9407 out:9407 type:P dur:82000000 cpbdur:82000000 q:16.89 tex:23873 mv:3038 misc:1073 imb:59 pmb:496 smb:795 d:- ref:0 ; in:9408 out:9408 type:P dur:82000000 cpbdur:82000000 q:16.13 tex:29199 mv:2810 misc:1087 imb:56 pmb:540 smb:754 d:- ref:0 ; in:9409 out:9409 type:P dur:82000000 cpbdur:82000000 q:16.05 tex:21533 mv:2399 misc:1084 imb:70 pmb:487 smb:793 d:- ref:0 ; in:9410 out:9410 type:P dur:82000000 cpbdur:82000000 q:16.49 tex:22235 mv:1732 misc:1073 imb:39 pmb:340 smb:971 d:- ref:0 ; in:9411 out:9411 type:P dur:82000000 cpbdur:82000000 q:15.15 tex:17870 mv:1882 misc:1128 imb:16 pmb:434 smb:900 d:- ref:0 ; in:9412 out:9412 type:P dur:82000000 cpbdur:82000000 q:15.94 tex:23714 mv:1980 misc:1114 imb:27 pmb:450 smb:873 d:- ref:0 ; in:9413 out:9413 type:P dur:82000000 cpbdur:82000000 q:17.30 tex:27329 mv:2560 misc:1127 imb:56 pmb:426 smb:868 d:- ref:0 ; in:9414 out:9414 type:P dur:82000000 cpbdur:82000000 q:15.94 tex:24744 mv:2027 misc:1133 imb:20 pmb:521 smb:809 d:- ref:0 ; in:9415 out:9415 type:P dur:82000000 cpbdur:82000000 q:16.67 tex:20599 mv:2311 misc:1122 imb:49 pmb:445 smb:856 d:- ref:0 ; in:9416 out:9416 type:P dur:82000000 cpbdur:82000000 q:17.32 tex:26710 mv:2068 misc:1054 imb:41 pmb:332 smb:977 d:- ref:0 ; in:9417 out:9417 type:P dur:82000000 cpbdur:82000000 q:15.79 tex:24758 mv:1997 misc:1133 imb:17 pmb:553 smb:780 d:- ref:0 ; in:9418 out:9418 type:P dur:82000000 cpbdur:82000000 q:15.97 tex:19234 mv:2084 misc:1114 imb:44 pmb:466 smb:840 d:- ref:0 ; in:9419 out:9419 type:P dur:82000000 cpbdur:82000000 q:16.62 tex:19562 mv:1951 misc:1071 imb:36 pmb:347 smb:967 d:- ref:0 ; in:9420 out:9420 type:P dur:82000000 cpbdur:82000000 q:15.33 tex:26192 mv:3286 misc:1274 imb:151 pmb:544 smb:655 d:- ref:0 ; in:9421 out:9421 type:P dur:82000000 cpbdur:82000000 q:15.74 tex:20833 mv:2239 misc:1088 imb:57 pmb:481 smb:812 d:- ref:0 ; in:9422 out:9422 type:P dur:82000000 cpbdur:82000000 q:18.31 tex:28059 mv:1834 misc:1003 imb:42 pmb:280 smb:1028 d:- ref:0 ; in:9423 out:9423 type:P dur:82000000 cpbdur:82000000 q:16.60 tex:12807 mv:1305 misc:1048 imb:12 pmb:341 smb:997 d:- ref:0 ; in:9424 out:9424 type:P dur:82000000 cpbdur:82000000 q:16.15 tex:26088 mv:2420 misc:1108 imb:50 pmb:548 smb:752 d:- ref:0 ; in:9425 out:9425 type:P dur:82000000 cpbdur:82000000 q:18.91 tex:30783 mv:1584 misc:905 imb:28 pmb:230 smb:1092 d:- ref:0 ; in:9426 out:9426 type:P dur:82000000 cpbdur:82000000 q:17.31 tex:19185 mv:1475 misc:1060 imb:16 pmb:389 smb:945 d:- ref:0 ; in:9427 out:9427 type:P dur:82000000 cpbdur:82000000 q:17.11 tex:21452 mv:1996 misc:1088 imb:38 pmb:422 smb:890 d:- ref:0 ; in:9428 out:9428 type:P dur:82000000 cpbdur:82000000 q:18.91 tex:32130 mv:2192 misc:950 imb:46 pmb:264 smb:1040 d:- ref:0 ; in:9429 out:9429 type:P dur:82000000 cpbdur:82000000 q:17.37 tex:24871 mv:2045 misc:1100 imb:32 pmb:477 smb:841 d:- ref:0 ; in:9430 out:9430 type:P dur:82000000 cpbdur:82000000 q:16.57 tex:12112 mv:1507 misc:1085 imb:16 pmb:379 smb:955 d:- ref:0 ; in:9431 out:9431 type:P dur:82000000 cpbdur:82000000 q:18.76 tex:29196 mv:2392 misc:908 imb:38 pmb:260 smb:1052 d:- ref:0 ; in:9432 out:9432 type:P dur:82000000 cpbdur:82000000 q:17.35 tex:23240 mv:2085 misc:1091 imb:33 pmb:447 smb:870 d:- ref:0 ; in:9433 out:9433 type:P dur:82000000 cpbdur:82000000 q:16.44 tex:29735 mv:2358 misc:1091 imb:33 pmb:592 smb:725 d:- ref:0 ; in:9434 out:9434 type:P dur:82000000 cpbdur:82000000 q:18.96 tex:31389 mv:3451 misc:1056 imb:121 pmb:381 smb:848 d:- ref:0 ; in:9435 out:9435 type:P dur:82000000 cpbdur:82000000 q:17.86 tex:17028 mv:2218 misc:1098 imb:32 pmb:464 smb:854 d:- ref:0 ; in:9436 out:9436 type:P dur:82000000 cpbdur:82000000 q:16.95 tex:20105 mv:2042 misc:1109 imb:25 pmb:484 smb:841 d:- ref:0 ; in:9437 out:9437 type:P dur:82000000 cpbdur:82000000 q:19.56 tex:27205 mv:1777 misc:850 imb:33 pmb:213 smb:1104 d:- ref:0 ; in:9438 out:9438 type:P dur:82000000 cpbdur:82000000 q:17.82 tex:16794 mv:1686 misc:1040 imb:28 pmb:352 smb:970 d:- ref:0 ; in:9439 out:9439 type:P dur:82000000 cpbdur:82000000 q:16.78 tex:13938 mv:1989 misc:1105 imb:39 pmb:439 smb:872 d:- ref:0 ; in:9440 out:9440 type:P dur:82000000 cpbdur:82000000 q:18.19 tex:28046 mv:1738 misc:896 imb:24 pmb:234 smb:1092 d:- ref:0 ; in:9441 out:9441 type:P dur:82000000 cpbdur:82000000 q:16.40 tex:31551 mv:2177 misc:1120 imb:22 pmb:609 smb:719 d:- ref:0 ; in:9442 out:9442 type:P dur:82000000 cpbdur:82000000 q:16.06 tex:14337 mv:1523 misc:1076 imb:23 pmb:369 smb:958 d:- ref:0 ; in:9443 out:9443 type:P dur:82000000 cpbdur:82000000 q:18.21 tex:27697 mv:1700 misc:947 imb:25 pmb:252 smb:1073 d:- ref:0 ; in:9444 out:9444 type:P dur:82000000 cpbdur:82000000 q:16.65 tex:12488 mv:1352 misc:1000 imb:33 pmb:284 smb:1033 d:- ref:0 ; in:9445 out:9445 type:P dur:82000000 cpbdur:82000000 q:16.80 tex:17167 mv:2613 misc:1044 imb:106 pmb:413 smb:831 d:- ref:0 ; in:9446 out:9446 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:46024 mv:6134 misc:1026 imb:252 pmb:428 smb:670 d:- ref:0 ; in:9447 out:9447 type:P dur:82000000 cpbdur:82000000 q:19.00 tex:22048 mv:3130 misc:1086 imb:81 pmb:470 smb:799 d:- ref:0 ; in:9448 out:9448 type:P dur:82000000 cpbdur:82000000 q:18.10 tex:21666 mv:3206 misc:1104 imb:106 pmb:496 smb:748 d:- ref:0 ; in:9449 out:9449 type:P dur:82000000 cpbdur:82000000 q:18.99 tex:28889 mv:1628 misc:859 imb:25 pmb:214 smb:1111 d:- ref:0 ; in:9450 out:9450 type:P dur:82000000 cpbdur:82000000 q:18.17 tex:21898 mv:2322 misc:1092 imb:66 pmb:460 smb:824 d:- ref:0 ; in:9451 out:9451 type:P dur:82000000 cpbdur:82000000 q:16.77 tex:21980 mv:1875 misc:1113 imb:22 pmb:503 smb:825 d:- ref:0 ; in:9452 out:9452 type:P dur:82000000 cpbdur:82000000 q:18.82 tex:30756 mv:2401 misc:1059 imb:41 pmb:339 smb:970 d:- ref:0 ; in:9453 out:9453 type:P dur:82000000 cpbdur:82000000 q:17.11 tex:21172 mv:1808 misc:1124 imb:23 pmb:466 smb:861 d:- ref:0 ; in:9454 out:9454 type:P dur:82000000 cpbdur:82000000 q:16.47 tex:37252 mv:2411 misc:1097 imb:34 pmb:637 smb:679 d:- ref:0 ; in:9455 out:9455 type:P dur:82000000 cpbdur:82000000 q:18.33 tex:26666 mv:1876 misc:986 imb:21 pmb:290 smb:1039 d:- ref:0 ; in:9456 out:9456 type:P dur:82000000 cpbdur:82000000 q:17.00 tex:16197 mv:1745 misc:1090 imb:26 pmb:423 smb:901 d:- ref:0 ; in:9457 out:9457 type:P dur:82000000 cpbdur:82000000 q:16.48 tex:26593 mv:2316 misc:1123 imb:30 pmb:584 smb:736 d:- ref:0 ; in:9458 out:9458 type:P dur:82000000 cpbdur:82000000 q:19.04 tex:30745 mv:2462 misc:1033 imb:55 pmb:316 smb:979 d:- ref:0 ; in:9459 out:9459 type:P dur:82000000 cpbdur:82000000 q:17.73 tex:16716 mv:1824 misc:1100 imb:47 pmb:348 smb:955 d:- ref:0 ; in:9460 out:9460 type:P dur:82000000 cpbdur:82000000 q:16.94 tex:19598 mv:2173 misc:1101 imb:37 pmb:457 smb:856 d:- ref:0 ; in:9461 out:9461 type:P dur:82000000 cpbdur:82000000 q:19.11 tex:33735 mv:2229 misc:996 imb:44 pmb:285 smb:1021 d:- ref:0 ; in:9462 out:9462 type:P dur:82000000 cpbdur:82000000 q:17.30 tex:21304 mv:2051 misc:1109 imb:30 pmb:479 smb:841 d:- ref:0 ; in:9463 out:9463 type:P dur:82000000 cpbdur:82000000 q:16.55 tex:9504 mv:1518 misc:1058 imb:28 pmb:376 smb:946 d:- ref:0 ; in:9464 out:9464 type:P dur:82000000 cpbdur:82000000 q:18.10 tex:26622 mv:1322 misc:752 imb:20 pmb:162 smb:1168 d:- ref:0 ; in:9465 out:9465 type:P dur:82000000 cpbdur:82000000 q:16.48 tex:31360 mv:2205 misc:1123 imb:19 pmb:595 smb:736 d:- ref:0 ; in:9466 out:9466 type:P dur:82000000 cpbdur:82000000 q:16.89 tex:16949 mv:2123 misc:1128 imb:52 pmb:395 smb:903 d:- ref:0 ; in:9467 out:9467 type:P dur:82000000 cpbdur:82000000 q:18.76 tex:29117 mv:2094 misc:917 imb:34 pmb:254 smb:1062 d:- ref:0 ; in:9468 out:9468 type:P dur:82000000 cpbdur:82000000 q:17.45 tex:25547 mv:2364 misc:1097 imb:55 pmb:450 smb:845 d:- ref:0 ; in:9469 out:9469 type:P dur:82000000 cpbdur:82000000 q:17.36 tex:21984 mv:2796 misc:1116 imb:89 pmb:456 smb:805 d:- ref:0 ; in:9470 out:9470 type:P dur:82000000 cpbdur:82000000 q:19.28 tex:36181 mv:2372 misc:959 imb:35 pmb:282 smb:1033 d:- ref:0 ; in:9471 out:9471 type:P dur:82000000 cpbdur:82000000 q:17.52 tex:11639 mv:1292 misc:1029 imb:16 pmb:296 smb:1038 d:- ref:0 ; in:9472 out:9472 type:P dur:82000000 cpbdur:82000000 q:17.00 tex:24948 mv:2705 misc:1123 imb:75 pmb:487 smb:788 d:- ref:0 ; in:9473 out:9473 type:P dur:82000000 cpbdur:82000000 q:19.42 tex:36156 mv:2363 misc:937 imb:38 pmb:255 smb:1057 d:- ref:0 ; in:9474 out:9474 type:P dur:82000000 cpbdur:82000000 q:17.89 tex:13709 mv:1324 misc:951 imb:23 pmb:246 smb:1081 d:- ref:0 ; in:9475 out:9475 type:P dur:82000000 cpbdur:82000000 q:16.92 tex:16866 mv:1960 misc:1150 imb:36 pmb:462 smb:852 d:- ref:0 ; in:9476 out:9476 type:P dur:82000000 cpbdur:82000000 q:18.64 tex:31253 mv:1933 misc:854 imb:22 pmb:243 smb:1085 d:- ref:0 ; in:9477 out:9477 type:P dur:82000000 cpbdur:82000000 q:17.87 tex:17798 mv:1639 misc:1035 imb:24 pmb:345 smb:981 d:- ref:0 ; in:9478 out:9478 type:P dur:82000000 cpbdur:82000000 q:16.64 tex:21038 mv:1726 misc:1084 imb:28 pmb:434 smb:888 d:- ref:0 ; in:9479 out:9479 type:P dur:82000000 cpbdur:82000000 q:18.33 tex:28928 mv:1623 misc:905 imb:14 pmb:249 smb:1087 d:- ref:0 ; in:9480 out:9480 type:P dur:82000000 cpbdur:82000000 q:17.35 tex:20387 mv:2643 misc:1106 imb:83 pmb:493 smb:774 d:- ref:0 ; in:9481 out:9481 type:P dur:82000000 cpbdur:82000000 q:17.20 tex:21824 mv:2738 misc:1110 imb:65 pmb:480 smb:805 d:- ref:0 ; in:9482 out:9482 type:P dur:82000000 cpbdur:82000000 q:19.39 tex:44189 mv:5571 misc:1040 imb:231 pmb:435 smb:684 d:- ref:0 ; in:9483 out:9483 type:P dur:82000000 cpbdur:82000000 q:18.56 tex:20469 mv:3608 misc:1059 imb:80 pmb:490 smb:780 d:- ref:0 ; in:9484 out:9484 type:P dur:82000000 cpbdur:82000000 q:17.67 tex:19405 mv:2390 misc:1093 imb:64 pmb:460 smb:826 d:- ref:0 ; in:9485 out:9485 type:P dur:82000000 cpbdur:82000000 q:18.43 tex:33713 mv:2180 misc:1011 imb:34 pmb:340 smb:976 d:- ref:0 ; in:9486 out:9486 type:P dur:82000000 cpbdur:82000000 q:16.73 tex:23823 mv:2270 misc:1131 imb:53 pmb:538 smb:759 d:- ref:0 ; in:9487 out:9487 type:P dur:82000000 cpbdur:82000000 q:16.45 tex:39902 mv:2596 misc:1094 imb:44 pmb:616 smb:690 d:- ref:0 ; in:9488 out:9488 type:P dur:82000000 cpbdur:82000000 q:17.48 tex:32131 mv:2348 misc:1097 imb:35 pmb:462 smb:853 d:- ref:0 ; in:9489 out:9489 type:P dur:82000000 cpbdur:82000000 q:17.22 tex:24428 mv:2414 misc:1046 imb:77 pmb:438 smb:835 d:- ref:0 ; in:9490 out:9490 type:P dur:82000000 cpbdur:82000000 q:16.13 tex:30006 mv:2472 misc:1250 imb:45 pmb:594 smb:711 d:- ref:0 ; in:9491 out:9491 type:P dur:82000000 cpbdur:82000000 q:16.70 tex:23784 mv:2499 misc:1181 imb:54 pmb:557 smb:739 d:- ref:0 ; in:9492 out:9492 type:P dur:82000000 cpbdur:82000000 q:15.63 tex:24088 mv:2097 misc:1151 imb:28 pmb:545 smb:777 d:- ref:0 ; in:9493 out:9493 type:P dur:82000000 cpbdur:82000000 q:16.36 tex:31944 mv:2291 misc:1093 imb:32 pmb:553 smb:765 d:- ref:0 ; in:9494 out:9494 type:P dur:82000000 cpbdur:82000000 q:18.42 tex:48505 mv:3378 misc:1069 imb:83 pmb:428 smb:839 d:- ref:0 ; in:9495 out:9495 type:P dur:82000000 cpbdur:82000000 q:16.89 tex:19283 mv:1662 misc:1095 imb:8 pmb:454 smb:888 d:- ref:0 ; in:9496 out:9496 type:P dur:82000000 cpbdur:82000000 q:16.28 tex:35088 mv:2330 misc:1134 imb:24 pmb:616 smb:710 d:- ref:0 ; in:9497 out:9497 type:P dur:82000000 cpbdur:82000000 q:20.28 tex:135859 mv:12899 misc:1418 imb:1299 pmb:43 smb:8 d:- ref:0 ; in:9498 out:9498 type:P dur:82000000 cpbdur:82000000 q:21.21 tex:13152 mv:1374 misc:890 imb:18 pmb:234 smb:1098 d:- ref:0 ; in:9499 out:9499 type:P dur:82000000 cpbdur:82000000 q:19.68 tex:16339 mv:1688 misc:917 imb:13 pmb:266 smb:1071 d:- ref:0 ; in:9500 out:9500 type:I dur:82000000 cpbdur:82000000 q:14.89 tex:231730 mv:13860 misc:378 imb:1350 pmb:0 smb:0 d:- ref:; in:9501 out:9501 type:P dur:82000000 cpbdur:82000000 q:21.46 tex:5818 mv:646 misc:704 imb:10 pmb:134 smb:1206 d:- ref:0 ; in:9502 out:9502 type:P dur:82000000 cpbdur:82000000 q:19.95 tex:7271 mv:1004 misc:901 imb:26 pmb:172 smb:1152 d:- ref:0 ; in:9503 out:9503 type:P dur:82000000 cpbdur:82000000 q:18.40 tex:7958 mv:1644 misc:1310 imb:80 pmb:258 smb:1012 d:- ref:0 ; in:9504 out:9504 type:P dur:82000000 cpbdur:82000000 q:18.12 tex:7479 mv:1892 misc:1365 imb:101 pmb:312 smb:937 d:- ref:0 ; in:9505 out:9505 type:P dur:82000000 cpbdur:82000000 q:17.13 tex:18200 mv:2918 misc:1506 imb:127 pmb:488 smb:735 d:- ref:0 ; in:9506 out:9506 type:P dur:82000000 cpbdur:82000000 q:15.96 tex:26254 mv:3432 misc:1562 imb:143 pmb:614 smb:593 d:- ref:0 ; in:9507 out:9507 type:P dur:82000000 cpbdur:82000000 q:16.24 tex:14650 mv:2116 misc:1370 imb:96 pmb:378 smb:876 d:- ref:0 ; in:9508 out:9508 type:P dur:82000000 cpbdur:82000000 q:16.09 tex:13493 mv:2250 misc:1377 imb:114 pmb:336 smb:900 d:- ref:0 ; in:9509 out:9509 type:P dur:82000000 cpbdur:82000000 q:15.89 tex:9603 mv:2055 misc:1358 imb:116 pmb:317 smb:917 d:- ref:0 ; in:9510 out:9510 type:P dur:82000000 cpbdur:82000000 q:15.51 tex:9657 mv:2265 misc:1374 imb:135 pmb:301 smb:914 d:- ref:0 ; in:9511 out:9511 type:P dur:82000000 cpbdur:82000000 q:16.34 tex:13738 mv:2662 misc:1528 imb:124 pmb:438 smb:788 d:- ref:0 ; in:9512 out:9512 type:P dur:82000000 cpbdur:82000000 q:15.06 tex:12010 mv:3091 misc:1427 imb:169 pmb:335 smb:846 d:- ref:0 ; in:9513 out:9513 type:P dur:82000000 cpbdur:82000000 q:16.49 tex:19719 mv:2619 misc:1478 imb:108 pmb:473 smb:769 d:- ref:0 ; in:9514 out:9514 type:P dur:82000000 cpbdur:82000000 q:16.55 tex:19088 mv:2464 misc:1432 imb:47 pmb:536 smb:767 d:- ref:0 ; in:9515 out:9515 type:P dur:82000000 cpbdur:82000000 q:15.40 tex:26915 mv:3652 misc:1537 imb:178 pmb:478 smb:694 d:- ref:0 ; in:9516 out:9516 type:P dur:82000000 cpbdur:82000000 q:16.14 tex:12432 mv:2513 misc:1511 imb:114 pmb:479 smb:757 d:- ref:0 ; in:9517 out:9517 type:P dur:82000000 cpbdur:82000000 q:14.68 tex:8586 mv:2068 misc:1314 imb:129 pmb:232 smb:989 d:- ref:0 ; in:9518 out:9518 type:P dur:82000000 cpbdur:82000000 q:15.97 tex:16666 mv:2530 misc:1476 imb:101 pmb:460 smb:789 d:- ref:0 ; in:9519 out:9519 type:P dur:82000000 cpbdur:82000000 q:15.95 tex:13794 mv:2037 misc:1417 imb:94 pmb:355 smb:901 d:- ref:0 ; in:9520 out:9520 type:P dur:82000000 cpbdur:82000000 q:14.73 tex:16252 mv:3042 misc:1458 imb:157 pmb:364 smb:829 d:- ref:0 ; in:9521 out:9521 type:P dur:82000000 cpbdur:82000000 q:16.33 tex:14328 mv:3736 misc:1560 imb:169 pmb:538 smb:643 d:- ref:0 ; in:9522 out:9522 type:P dur:82000000 cpbdur:82000000 q:15.57 tex:8629 mv:1806 misc:1285 imb:103 pmb:250 smb:997 d:- ref:0 ; in:9523 out:9523 type:P dur:82000000 cpbdur:82000000 q:14.70 tex:13624 mv:3306 misc:1454 imb:181 pmb:324 smb:845 d:- ref:0 ; in:9524 out:9524 type:P dur:82000000 cpbdur:82000000 q:15.66 tex:11878 mv:2462 misc:1500 imb:115 pmb:440 smb:795 d:- ref:0 ; in:9525 out:9525 type:P dur:82000000 cpbdur:82000000 q:15.04 tex:13058 mv:2802 misc:1420 imb:126 pmb:340 smb:884 d:- ref:0 ; in:9526 out:9526 type:P dur:82000000 cpbdur:82000000 q:15.11 tex:11748 mv:2621 misc:1295 imb:173 pmb:219 smb:958 d:- ref:0 ; in:9527 out:9527 type:P dur:82000000 cpbdur:82000000 q:19.11 tex:77955 mv:7882 misc:1259 imb:180 pmb:496 smb:674 d:- ref:0 ; in:9528 out:9528 type:P dur:82000000 cpbdur:82000000 q:18.43 tex:11281 mv:1299 misc:1116 imb:36 pmb:291 smb:1023 d:- ref:0 ; in:9529 out:9529 type:P dur:82000000 cpbdur:82000000 q:17.23 tex:18894 mv:2295 misc:1411 imb:67 pmb:487 smb:796 d:- ref:0 ; in:9530 out:9530 type:P dur:82000000 cpbdur:82000000 q:20.27 tex:64576 mv:6575 misc:1057 imb:179 pmb:351 smb:820 d:- ref:0 ; in:9531 out:9531 type:P dur:82000000 cpbdur:82000000 q:19.10 tex:22584 mv:2373 misc:1259 imb:69 pmb:433 smb:848 d:- ref:0 ; in:9532 out:9532 type:P dur:82000000 cpbdur:82000000 q:18.00 tex:19863 mv:2105 misc:1264 imb:57 pmb:411 smb:882 d:- ref:0 ; in:9533 out:9533 type:P dur:82000000 cpbdur:82000000 q:20.52 tex:50224 mv:6590 misc:1154 imb:215 pmb:336 smb:799 d:- ref:0 ; in:9534 out:9534 type:P dur:82000000 cpbdur:82000000 q:18.88 tex:24893 mv:2557 misc:1318 imb:69 pmb:439 smb:842 d:- ref:0 ; in:9535 out:9535 type:P dur:82000000 cpbdur:82000000 q:17.40 tex:26473 mv:3493 misc:1530 imb:163 pmb:569 smb:618 d:- ref:0 ; in:9536 out:9536 type:P dur:82000000 cpbdur:82000000 q:19.21 tex:43766 mv:6074 misc:1240 imb:93 pmb:468 smb:789 d:- ref:0 ; in:9537 out:9537 type:P dur:82000000 cpbdur:82000000 q:17.59 tex:11967 mv:1444 misc:1149 imb:39 pmb:298 smb:1013 d:- ref:0 ; in:9538 out:9538 type:P dur:82000000 cpbdur:82000000 q:17.27 tex:24187 mv:3381 misc:1496 imb:131 pmb:533 smb:686 d:- ref:0 ; in:9539 out:9539 type:P dur:82000000 cpbdur:82000000 q:19.04 tex:39764 mv:5864 misc:1204 imb:102 pmb:450 smb:798 d:- ref:0 ; in:9540 out:9540 type:P dur:82000000 cpbdur:82000000 q:17.63 tex:14844 mv:1788 misc:1104 imb:42 pmb:330 smb:978 d:- ref:0 ; in:9541 out:9541 type:P dur:82000000 cpbdur:82000000 q:16.77 tex:19438 mv:2442 misc:1416 imb:84 pmb:492 smb:774 d:- ref:0 ; in:9542 out:9542 type:P dur:82000000 cpbdur:82000000 q:16.58 tex:8575 mv:2214 misc:1459 imb:84 pmb:418 smb:848 d:- ref:0 ; in:9543 out:9543 type:P dur:82000000 cpbdur:82000000 q:15.87 tex:27296 mv:3363 misc:1541 imb:123 pmb:675 smb:552 d:- ref:0 ; in:9544 out:9544 type:P dur:82000000 cpbdur:82000000 q:14.57 tex:17164 mv:3227 misc:1441 imb:163 pmb:373 smb:814 d:- ref:0 ; in:9545 out:9545 type:P dur:82000000 cpbdur:82000000 q:15.93 tex:18255 mv:2393 misc:1488 imb:92 pmb:455 smb:803 d:- ref:0 ; in:9546 out:9546 type:P dur:82000000 cpbdur:82000000 q:15.43 tex:22300 mv:3260 misc:1472 imb:168 pmb:358 smb:824 d:- ref:0 ; in:9547 out:9547 type:P dur:82000000 cpbdur:82000000 q:16.65 tex:10781 mv:2339 misc:1488 imb:80 pmb:485 smb:785 d:- ref:0 ; in:9548 out:9548 type:P dur:82000000 cpbdur:82000000 q:14.65 tex:15587 mv:3070 misc:1511 imb:145 pmb:406 smb:799 d:- ref:0 ; in:9549 out:9549 type:P dur:82000000 cpbdur:82000000 q:15.67 tex:12873 mv:2348 misc:1515 imb:87 pmb:500 smb:763 d:- ref:0 ; in:9550 out:9550 type:P dur:82000000 cpbdur:82000000 q:14.06 tex:28445 mv:3457 misc:1530 imb:117 pmb:561 smb:672 d:- ref:0 ; in:9551 out:9551 type:P dur:82000000 cpbdur:82000000 q:18.06 tex:103252 mv:12492 misc:1416 imb:1322 pmb:28 smb:0 d:- ref:0 ; in:9552 out:9552 type:P dur:82000000 cpbdur:82000000 q:19.50 tex:814 mv:354 misc:472 imb:5 pmb:70 smb:1275 d:- ref:0 ; in:9553 out:9553 type:P dur:82000000 cpbdur:82000000 q:17.30 tex:7940 mv:1313 misc:1147 imb:4 pmb:367 smb:979 d:- ref:0 ; in:9554 out:9554 type:P dur:82000000 cpbdur:82000000 q:15.81 tex:16124 mv:1696 misc:1188 imb:5 pmb:488 smb:857 d:- ref:0 ; in:9555 out:9555 type:P dur:82000000 cpbdur:82000000 q:14.32 tex:31210 mv:2611 misc:1339 imb:106 pmb:543 smb:701 d:- ref:0 ; in:9556 out:9556 type:P dur:82000000 cpbdur:82000000 q:12.62 tex:50628 mv:3145 misc:1403 imb:140 pmb:621 smb:589 d:- ref:0 ; in:9557 out:9557 type:P dur:82000000 cpbdur:82000000 q:14.12 tex:13039 mv:1885 misc:1236 imb:65 pmb:333 smb:952 d:- ref:0 ; in:9558 out:9558 type:P dur:82000000 cpbdur:82000000 q:13.44 tex:33400 mv:3143 misc:1433 imb:132 pmb:549 smb:669 d:- ref:0 ; in:9559 out:9559 type:P dur:82000000 cpbdur:82000000 q:14.72 tex:11569 mv:1963 misc:1172 imb:54 pmb:337 smb:959 d:- ref:0 ; in:9560 out:9560 type:P dur:82000000 cpbdur:82000000 q:13.40 tex:33799 mv:3343 misc:1474 imb:142 pmb:585 smb:623 d:- ref:0 ; in:9561 out:9561 type:P dur:82000000 cpbdur:82000000 q:14.49 tex:11857 mv:2107 misc:1276 imb:85 pmb:309 smb:956 d:- ref:0 ; in:9562 out:9562 type:P dur:82000000 cpbdur:82000000 q:14.81 tex:13191 mv:1978 misc:1207 imb:76 pmb:260 smb:1014 d:- ref:0 ; in:9563 out:9563 type:P dur:82000000 cpbdur:82000000 q:15.62 tex:15121 mv:2369 misc:1262 imb:71 pmb:381 smb:898 d:- ref:0 ; in:9564 out:9564 type:P dur:82000000 cpbdur:82000000 q:15.21 tex:10730 mv:2309 misc:1297 imb:97 pmb:295 smb:958 d:- ref:0 ; in:9565 out:9565 type:P dur:82000000 cpbdur:82000000 q:15.86 tex:10980 mv:1842 misc:1370 imb:59 pmb:376 smb:915 d:- ref:0 ; in:9566 out:9566 type:P dur:82000000 cpbdur:82000000 q:14.84 tex:8720 mv:2068 misc:1276 imb:94 pmb:262 smb:994 d:- ref:0 ; in:9567 out:9567 type:P dur:82000000 cpbdur:82000000 q:15.56 tex:8624 mv:1817 misc:1279 imb:45 pmb:351 smb:954 d:- ref:0 ; in:9568 out:9568 type:P dur:82000000 cpbdur:82000000 q:14.70 tex:10078 mv:1895 misc:1195 imb:63 pmb:279 smb:1008 d:- ref:0 ; in:9569 out:9569 type:P dur:82000000 cpbdur:82000000 q:15.68 tex:10935 mv:1791 misc:1274 imb:68 pmb:325 smb:957 d:- ref:0 ; in:9570 out:9570 type:P dur:82000000 cpbdur:82000000 q:15.43 tex:13890 mv:2934 misc:1368 imb:123 pmb:350 smb:877 d:- ref:0 ; in:9571 out:9571 type:P dur:82000000 cpbdur:82000000 q:14.26 tex:19049 mv:3080 misc:1527 imb:141 pmb:502 smb:707 d:- ref:0 ; in:9572 out:9572 type:P dur:82000000 cpbdur:82000000 q:15.00 tex:9729 mv:1958 misc:1233 imb:75 pmb:272 smb:1003 d:- ref:0 ; in:9573 out:9573 type:P dur:82000000 cpbdur:82000000 q:15.30 tex:12956 mv:2708 misc:1328 imb:118 pmb:304 smb:928 d:- ref:0 ; in:9574 out:9574 type:P dur:82000000 cpbdur:82000000 q:15.13 tex:15544 mv:2610 misc:1294 imb:93 pmb:338 smb:919 d:- ref:0 ; in:9575 out:9575 type:P dur:82000000 cpbdur:82000000 q:17.62 tex:21223 mv:5377 misc:1160 imb:131 pmb:449 smb:770 d:- ref:0 ; in:9576 out:9576 type:P dur:82000000 cpbdur:82000000 q:18.55 tex:29288 mv:6339 misc:1141 imb:153 pmb:439 smb:758 d:- ref:0 ; in:9577 out:9577 type:P dur:82000000 cpbdur:82000000 q:18.76 tex:28543 mv:6265 misc:1136 imb:144 pmb:453 smb:753 d:- ref:0 ; in:9578 out:9578 type:P dur:82000000 cpbdur:82000000 q:19.03 tex:33760 mv:6584 misc:1152 imb:181 pmb:426 smb:743 d:- ref:0 ; in:9579 out:9579 type:P dur:82000000 cpbdur:82000000 q:19.15 tex:29379 mv:6387 misc:1154 imb:144 pmb:441 smb:765 d:- ref:0 ; in:9580 out:9580 type:P dur:82000000 cpbdur:82000000 q:19.28 tex:33605 mv:6757 misc:1182 imb:189 pmb:419 smb:742 d:- ref:0 ; in:9581 out:9581 type:P dur:82000000 cpbdur:82000000 q:19.03 tex:27992 mv:6035 misc:1141 imb:137 pmb:441 smb:772 d:- ref:0 ; in:9582 out:9582 type:P dur:82000000 cpbdur:82000000 q:19.24 tex:35323 mv:6749 misc:1176 imb:187 pmb:433 smb:730 d:- ref:0 ; in:9583 out:9583 type:P dur:82000000 cpbdur:82000000 q:19.16 tex:26912 mv:5935 misc:1153 imb:148 pmb:435 smb:767 d:- ref:0 ; in:9584 out:9584 type:P dur:82000000 cpbdur:82000000 q:19.17 tex:31190 mv:6501 misc:1173 imb:180 pmb:433 smb:737 d:- ref:0 ; in:9585 out:9585 type:P dur:82000000 cpbdur:82000000 q:18.99 tex:30376 mv:6277 misc:1171 imb:175 pmb:445 smb:730 d:- ref:0 ; in:9586 out:9586 type:P dur:82000000 cpbdur:82000000 q:18.97 tex:27818 mv:6176 misc:1150 imb:156 pmb:440 smb:754 d:- ref:0 ; in:9587 out:9587 type:P dur:82000000 cpbdur:82000000 q:19.29 tex:30674 mv:5859 misc:1171 imb:154 pmb:433 smb:763 d:- ref:0 ; in:9588 out:9588 type:P dur:82000000 cpbdur:82000000 q:19.00 tex:26950 mv:6067 misc:1143 imb:156 pmb:439 smb:755 d:- ref:0 ; in:9589 out:9589 type:P dur:82000000 cpbdur:82000000 q:18.89 tex:27658 mv:5831 misc:1151 imb:143 pmb:451 smb:756 d:- ref:0 ; in:9590 out:9590 type:P dur:82000000 cpbdur:82000000 q:19.00 tex:29967 mv:5747 misc:1150 imb:161 pmb:437 smb:752 d:- ref:0 ; in:9591 out:9591 type:P dur:82000000 cpbdur:82000000 q:18.85 tex:24722 mv:5707 misc:1155 imb:149 pmb:429 smb:772 d:- ref:0 ; in:9592 out:9592 type:P dur:82000000 cpbdur:82000000 q:19.17 tex:32591 mv:6659 misc:1158 imb:195 pmb:439 smb:716 d:- ref:0 ; in:9593 out:9593 type:P dur:82000000 cpbdur:82000000 q:19.19 tex:31851 mv:6379 misc:1194 imb:202 pmb:441 smb:707 d:- ref:0 ; in:9594 out:9594 type:P dur:82000000 cpbdur:82000000 q:19.04 tex:24978 mv:5915 misc:1171 imb:174 pmb:441 smb:735 d:- ref:0 ; in:9595 out:9595 type:P dur:82000000 cpbdur:82000000 q:19.24 tex:30778 mv:6888 misc:1246 imb:288 pmb:416 smb:646 d:- ref:0 ; in:9596 out:9596 type:P dur:82000000 cpbdur:82000000 q:19.54 tex:25358 mv:6444 misc:1222 imb:293 pmb:378 smb:679 d:- ref:0 ; in:9597 out:9597 type:P dur:82000000 cpbdur:82000000 q:19.56 tex:24989 mv:6466 misc:1249 imb:306 pmb:416 smb:628 d:- ref:0 ; in:9598 out:9598 type:P dur:82000000 cpbdur:82000000 q:19.73 tex:25719 mv:7449 misc:1272 imb:401 pmb:393 smb:556 d:- ref:0 ; in:9599 out:9599 type:P dur:82000000 cpbdur:82000000 q:20.19 tex:32767 mv:9450 misc:1399 imb:606 pmb:406 smb:338 d:- ref:0 ; in:9600 out:9600 type:P dur:82000000 cpbdur:82000000 q:20.55 tex:30097 mv:9514 misc:1445 imb:583 pmb:412 smb:355 d:- ref:0 ; in:9601 out:9601 type:P dur:82000000 cpbdur:82000000 q:20.80 tex:31631 mv:10047 misc:1426 imb:598 pmb:447 smb:305 d:- ref:0 ; in:9602 out:9602 type:P dur:82000000 cpbdur:82000000 q:21.28 tex:40652 mv:12058 misc:1466 imb:750 pmb:466 smb:134 d:- ref:0 ; in:9603 out:9603 type:P dur:82000000 cpbdur:82000000 q:21.63 tex:37650 mv:11410 misc:1420 imb:595 pmb:496 smb:259 d:- ref:0 ; in:9604 out:9604 type:P dur:82000000 cpbdur:82000000 q:22.10 tex:49006 mv:12779 misc:1455 imb:752 pmb:467 smb:131 d:- ref:0 ; in:9605 out:9605 type:P dur:82000000 cpbdur:82000000 q:22.40 tex:53662 mv:13048 misc:1458 imb:750 pmb:500 smb:100 d:- ref:0 ; in:9606 out:9606 type:P dur:82000000 cpbdur:82000000 q:22.68 tex:48245 mv:12699 misc:1448 imb:773 pmb:487 smb:90 d:- ref:0 ; in:9607 out:9607 type:P dur:82000000 cpbdur:82000000 q:22.96 tex:57183 mv:13150 misc:1451 imb:727 pmb:514 smb:109 d:- ref:0 ; in:9608 out:9608 type:P dur:82000000 cpbdur:82000000 q:23.02 tex:52779 mv:12502 misc:1447 imb:689 pmb:574 smb:87 d:- ref:0 ; in:9609 out:9609 type:P dur:82000000 cpbdur:82000000 q:23.07 tex:56262 mv:11616 misc:1458 imb:608 pmb:598 smb:144 d:- ref:0 ; in:9610 out:9610 type:P dur:82000000 cpbdur:82000000 q:23.23 tex:64228 mv:12667 misc:1449 imb:684 pmb:591 smb:75 d:- ref:0 ; in:9611 out:9611 type:P dur:82000000 cpbdur:82000000 q:23.28 tex:60880 mv:11323 misc:1445 imb:591 pmb:609 smb:150 d:- ref:0 ; in:9612 out:9612 type:P dur:82000000 cpbdur:82000000 q:23.32 tex:64431 mv:11503 misc:1442 imb:611 pmb:633 smb:106 d:- ref:0 ; in:9613 out:9613 type:P dur:82000000 cpbdur:82000000 q:23.42 tex:69757 mv:11437 misc:1446 imb:623 pmb:615 smb:112 d:- ref:0 ; in:9614 out:9614 type:P dur:82000000 cpbdur:82000000 q:23.55 tex:59241 mv:11592 misc:1431 imb:605 pmb:622 smb:123 d:- ref:0 ; in:9615 out:9615 type:P dur:82000000 cpbdur:82000000 q:24.08 tex:85351 mv:12873 misc:1432 imb:762 pmb:507 smb:81 d:- ref:0 ; in:9616 out:9616 type:P dur:82000000 cpbdur:82000000 q:24.50 tex:83044 mv:12908 misc:1448 imb:723 pmb:540 smb:87 d:- ref:0 ; in:9617 out:9617 type:P dur:82000000 cpbdur:82000000 q:24.84 tex:91209 mv:12366 misc:1409 imb:705 pmb:532 smb:113 d:- ref:0 ; in:9618 out:9618 type:P dur:82000000 cpbdur:82000000 q:25.22 tex:103438 mv:12803 misc:1423 imb:761 pmb:495 smb:94 d:- ref:0 ; in:9619 out:9619 type:P dur:82000000 cpbdur:82000000 q:25.18 tex:95454 mv:11716 misc:1406 imb:612 pmb:620 smb:118 d:- ref:0 ; in:9620 out:9620 type:P dur:82000000 cpbdur:82000000 q:25.14 tex:99107 mv:11357 misc:1400 imb:627 pmb:591 smb:132 d:- ref:0 ; in:9621 out:9621 type:P dur:82000000 cpbdur:82000000 q:25.05 tex:95223 mv:10039 misc:1330 imb:520 pmb:601 smb:229 d:- ref:0 ; in:9622 out:9622 type:P dur:82000000 cpbdur:82000000 q:25.05 tex:107078 mv:8835 misc:1351 imb:394 pmb:619 smb:337 d:- ref:0 ; in:9623 out:9623 type:P dur:82000000 cpbdur:82000000 q:23.34 tex:54313 mv:4476 misc:1483 imb:208 pmb:780 smb:362 d:- ref:0 ; in:9624 out:9624 type:P dur:82000000 cpbdur:82000000 q:22.06 tex:69783 mv:4268 misc:1413 imb:124 pmb:864 smb:362 d:- ref:0 ; in:9625 out:9625 type:P dur:82000000 cpbdur:82000000 q:20.92 tex:52259 mv:3458 misc:1443 imb:86 pmb:848 smb:416 d:- ref:0 ; in:9626 out:9626 type:P dur:82000000 cpbdur:82000000 q:20.31 tex:71530 mv:2715 misc:1363 imb:24 pmb:755 smb:571 d:- ref:0 ; in:9627 out:9627 type:P dur:82000000 cpbdur:82000000 q:19.05 tex:73455 mv:3306 misc:1399 imb:36 pmb:922 smb:392 d:- ref:0 ; in:9628 out:9628 type:P dur:82000000 cpbdur:82000000 q:19.08 tex:48906 mv:2617 misc:1405 imb:21 pmb:717 smb:612 d:- ref:0 ; in:9629 out:9629 type:P dur:82000000 cpbdur:82000000 q:17.23 tex:81510 mv:3643 misc:1463 imb:64 pmb:1009 smb:277 d:- ref:0 ; in:9630 out:9630 type:P dur:82000000 cpbdur:82000000 q:18.25 tex:48681 mv:2458 misc:1389 imb:14 pmb:722 smb:614 d:- ref:0 ; in:9631 out:9631 type:P dur:82000000 cpbdur:82000000 q:17.06 tex:32049 mv:2439 misc:1496 imb:22 pmb:719 smb:609 d:- ref:0 ; in:9632 out:9632 type:P dur:82000000 cpbdur:82000000 q:19.59 tex:57541 mv:2394 misc:1313 imb:25 pmb:586 smb:739 d:- ref:0 ; in:9633 out:9633 type:P dur:82000000 cpbdur:82000000 q:18.98 tex:39713 mv:2254 misc:1369 imb:8 pmb:654 smb:688 d:- ref:0 ; in:9634 out:9634 type:P dur:82000000 cpbdur:82000000 q:17.96 tex:31682 mv:2151 misc:1415 imb:13 pmb:651 smb:686 d:- ref:0 ; in:9635 out:9635 type:P dur:82000000 cpbdur:82000000 q:17.35 tex:51978 mv:3056 misc:1478 imb:27 pmb:894 smb:429 d:- ref:0 ; in:9636 out:9636 type:P dur:82000000 cpbdur:82000000 q:17.71 tex:30020 mv:1975 misc:1349 imb:5 pmb:603 smb:742 d:- ref:0 ; in:9637 out:9637 type:P dur:82000000 cpbdur:82000000 q:16.05 tex:83011 mv:3331 misc:1450 imb:27 pmb:1011 smb:312 d:- ref:0 ; in:9638 out:9638 type:P dur:82000000 cpbdur:82000000 q:17.17 tex:34849 mv:2622 misc:1457 imb:23 pmb:728 smb:599 d:- ref:0 ; in:9639 out:9639 type:P dur:82000000 cpbdur:82000000 q:15.51 tex:29418 mv:2259 misc:1467 imb:10 pmb:705 smb:635 d:- ref:0 ; in:9640 out:9640 type:P dur:82000000 cpbdur:82000000 q:15.95 tex:31106 mv:1966 misc:1416 imb:12 pmb:586 smb:752 d:- ref:0 ; in:9641 out:9641 type:P dur:82000000 cpbdur:82000000 q:15.83 tex:24479 mv:2010 misc:1391 imb:27 pmb:574 smb:749 d:- ref:0 ; in:9642 out:9642 type:P dur:82000000 cpbdur:82000000 q:17.15 tex:32241 mv:2348 misc:1395 imb:20 pmb:684 smb:646 d:- ref:0 ; in:9643 out:9643 type:P dur:82000000 cpbdur:82000000 q:15.90 tex:31320 mv:2300 misc:1452 imb:12 pmb:698 smb:640 d:- ref:0 ; in:9644 out:9644 type:P dur:82000000 cpbdur:82000000 q:16.44 tex:33259 mv:2119 misc:1422 imb:25 pmb:609 smb:716 d:- ref:0 ; in:9645 out:9645 type:P dur:82000000 cpbdur:82000000 q:18.66 tex:50607 mv:2041 misc:1248 imb:21 pmb:511 smb:818 d:- ref:0 ; in:9646 out:9646 type:P dur:82000000 cpbdur:82000000 q:18.81 tex:32483 mv:1472 misc:1053 imb:10 pmb:384 smb:956 d:- ref:0 ; in:9647 out:9647 type:P dur:82000000 cpbdur:82000000 q:19.67 tex:36114 mv:1841 misc:1181 imb:32 pmb:445 smb:873 d:- ref:0 ; in:9648 out:9648 type:P dur:82000000 cpbdur:82000000 q:20.38 tex:51299 mv:1830 misc:1143 imb:19 pmb:440 smb:891 d:- ref:0 ; in:9649 out:9649 type:P dur:82000000 cpbdur:82000000 q:20.69 tex:43361 mv:1803 misc:1100 imb:20 pmb:413 smb:917 d:- ref:0 ; in:9650 out:9650 type:P dur:82000000 cpbdur:82000000 q:21.07 tex:43835 mv:1970 misc:1131 imb:29 pmb:432 smb:889 d:- ref:0 ; in:9651 out:9651 type:P dur:82000000 cpbdur:82000000 q:20.77 tex:34804 mv:1824 misc:1068 imb:25 pmb:396 smb:929 d:- ref:0 ; in:9652 out:9652 type:P dur:82000000 cpbdur:82000000 q:19.38 tex:36096 mv:2435 misc:1349 imb:26 pmb:673 smb:651 d:- ref:0 ; in:9653 out:9653 type:P dur:82000000 cpbdur:82000000 q:18.43 tex:21181 mv:1822 misc:1349 imb:9 pmb:552 smb:789 d:- ref:0 ; in:9654 out:9654 type:P dur:82000000 cpbdur:82000000 q:17.05 tex:32708 mv:2520 misc:1468 imb:33 pmb:732 smb:585 d:- ref:0 ; in:9655 out:9655 type:P dur:82000000 cpbdur:82000000 q:17.05 tex:23748 mv:2006 misc:1422 imb:11 pmb:632 smb:707 d:- ref:0 ; in:9656 out:9656 type:P dur:82000000 cpbdur:82000000 q:16.72 tex:26242 mv:1848 misc:1326 imb:17 pmb:518 smb:815 d:- ref:0 ; in:9657 out:9657 type:P dur:82000000 cpbdur:82000000 q:15.66 tex:54779 mv:3113 misc:1436 imb:22 pmb:919 smb:409 d:- ref:0 ; in:9658 out:9658 type:P dur:82000000 cpbdur:82000000 q:16.44 tex:31512 mv:2061 misc:1403 imb:13 pmb:623 smb:714 d:- ref:0 ; in:9659 out:9659 type:P dur:82000000 cpbdur:82000000 q:16.44 tex:23692 mv:2055 misc:1453 imb:38 pmb:541 smb:771 d:- ref:0 ; in:9660 out:9660 type:P dur:82000000 cpbdur:82000000 q:15.31 tex:39328 mv:2627 misc:1469 imb:30 pmb:737 smb:583 d:- ref:0 ; in:9661 out:9661 type:P dur:82000000 cpbdur:82000000 q:19.31 tex:71673 mv:2459 misc:1292 imb:24 pmb:599 smb:727 d:- ref:0 ; in:9662 out:9662 type:P dur:82000000 cpbdur:82000000 q:20.24 tex:45899 mv:1904 misc:1077 imb:22 pmb:432 smb:896 d:- ref:0 ; in:9663 out:9663 type:P dur:82000000 cpbdur:82000000 q:19.94 tex:25901 mv:1470 misc:1133 imb:5 pmb:408 smb:937 d:- ref:0 ; in:9664 out:9664 type:P dur:82000000 cpbdur:82000000 q:18.72 tex:26256 mv:1755 misc:1245 imb:6 pmb:533 smb:811 d:- ref:0 ; in:9665 out:9665 type:P dur:82000000 cpbdur:82000000 q:17.96 tex:22841 mv:1892 misc:1331 imb:14 pmb:564 smb:772 d:- ref:0 ; in:9666 out:9666 type:P dur:82000000 cpbdur:82000000 q:18.72 tex:49207 mv:2203 misc:1310 imb:14 pmb:571 smb:765 d:- ref:0 ; in:9667 out:9667 type:P dur:82000000 cpbdur:82000000 q:19.00 tex:44413 mv:2326 misc:1325 imb:9 pmb:642 smb:699 d:- ref:0 ; in:9668 out:9668 type:P dur:82000000 cpbdur:82000000 q:19.44 tex:45077 mv:1942 misc:1189 imb:12 pmb:464 smb:874 d:- ref:0 ; in:9669 out:9669 type:P dur:82000000 cpbdur:82000000 q:19.37 tex:39701 mv:1920 misc:1219 imb:15 pmb:480 smb:855 d:- ref:0 ; in:9670 out:9670 type:P dur:82000000 cpbdur:82000000 q:18.57 tex:28191 mv:1811 misc:1262 imb:3 pmb:485 smb:862 d:- ref:0 ; in:9671 out:9671 type:P dur:82000000 cpbdur:82000000 q:22.57 tex:178915 mv:14911 misc:1414 imb:1279 pmb:71 smb:0 d:- ref:0 ; in:9672 out:9672 type:P dur:82000000 cpbdur:82000000 q:23.40 tex:38258 mv:4538 misc:1300 imb:83 pmb:582 smb:685 d:- ref:0 ; in:9673 out:9673 type:P dur:82000000 cpbdur:82000000 q:23.01 tex:56721 mv:6254 misc:1441 imb:173 pmb:684 smb:493 d:- ref:0 ; in:9674 out:9674 type:P dur:82000000 cpbdur:82000000 q:22.23 tex:45723 mv:5913 misc:1524 imb:181 pmb:767 smb:402 d:- ref:0 ; in:9675 out:9675 type:P dur:82000000 cpbdur:82000000 q:21.46 tex:47386 mv:4824 misc:1550 imb:126 pmb:824 smb:400 d:- ref:0 ; in:9676 out:9676 type:P dur:82000000 cpbdur:82000000 q:22.10 tex:71886 mv:6606 misc:1412 imb:121 pmb:770 smb:459 d:- ref:0 ; in:9677 out:9677 type:P dur:82000000 cpbdur:82000000 q:20.96 tex:39935 mv:3832 misc:1521 imb:74 pmb:732 smb:544 d:- ref:0 ; in:9678 out:9678 type:P dur:82000000 cpbdur:82000000 q:21.95 tex:83615 mv:7017 misc:1360 imb:137 pmb:757 smb:456 d:- ref:0 ; in:9679 out:9679 type:P dur:82000000 cpbdur:82000000 q:21.02 tex:42378 mv:4030 misc:1472 imb:67 pmb:792 smb:491 d:- ref:0 ; in:9680 out:9680 type:P dur:82000000 cpbdur:82000000 q:21.16 tex:63146 mv:5322 misc:1452 imb:50 pmb:762 smb:538 d:- ref:0 ; in:9681 out:9681 type:P dur:82000000 cpbdur:82000000 q:19.99 tex:41385 mv:3648 misc:1495 imb:66 pmb:734 smb:550 d:- ref:0 ; in:9682 out:9682 type:P dur:82000000 cpbdur:82000000 q:19.81 tex:37004 mv:3327 misc:1469 imb:48 pmb:693 smb:609 d:- ref:0 ; in:9683 out:9683 type:P dur:82000000 cpbdur:82000000 q:20.69 tex:61183 mv:4856 misc:1417 imb:45 pmb:742 smb:563 d:- ref:0 ; in:9684 out:9684 type:P dur:82000000 cpbdur:82000000 q:21.09 tex:67009 mv:5877 misc:1450 imb:62 pmb:847 smb:441 d:- ref:0 ; in:9685 out:9685 type:P dur:82000000 cpbdur:82000000 q:20.10 tex:43691 mv:3490 misc:1499 imb:41 pmb:744 smb:565 d:- ref:0 ; in:9686 out:9686 type:P dur:82000000 cpbdur:82000000 q:20.70 tex:53342 mv:4628 misc:1462 imb:47 pmb:812 smb:491 d:- ref:0 ; in:9687 out:9687 type:P dur:82000000 cpbdur:82000000 q:21.04 tex:71011 mv:5443 misc:1482 imb:61 pmb:859 smb:430 d:- ref:0 ; in:9688 out:9688 type:P dur:82000000 cpbdur:82000000 q:21.43 tex:80111 mv:6093 misc:1460 imb:65 pmb:917 smb:368 d:- ref:0 ; in:9689 out:9689 type:P dur:82000000 cpbdur:82000000 q:20.55 tex:41283 mv:3548 misc:1457 imb:52 pmb:720 smb:578 d:- ref:0 ; in:9690 out:9690 type:P dur:82000000 cpbdur:82000000 q:21.38 tex:83620 mv:6156 misc:1456 imb:57 pmb:920 smb:373 d:- ref:0 ; in:9691 out:9691 type:P dur:82000000 cpbdur:82000000 q:20.76 tex:51653 mv:3897 misc:1482 imb:51 pmb:797 smb:502 d:- ref:0 ; in:9692 out:9692 type:P dur:82000000 cpbdur:82000000 q:20.96 tex:64886 mv:5017 misc:1497 imb:75 pmb:867 smb:408 d:- ref:0 ; in:9693 out:9693 type:P dur:82000000 cpbdur:82000000 q:20.65 tex:59061 mv:4321 misc:1458 imb:48 pmb:799 smb:503 d:- ref:0 ; in:9694 out:9694 type:P dur:82000000 cpbdur:82000000 q:21.22 tex:75609 mv:6123 misc:1492 imb:79 pmb:879 smb:392 d:- ref:0 ; in:9695 out:9695 type:P dur:82000000 cpbdur:82000000 q:20.20 tex:54348 mv:3778 misc:1554 imb:69 pmb:808 smb:473 d:- ref:0 ; in:9696 out:9696 type:P dur:82000000 cpbdur:82000000 q:21.20 tex:73878 mv:5784 misc:1458 imb:55 pmb:852 smb:443 d:- ref:0 ; in:9697 out:9697 type:P dur:82000000 cpbdur:82000000 q:20.45 tex:54601 mv:3551 misc:1448 imb:24 pmb:795 smb:531 d:- ref:0 ; in:9698 out:9698 type:P dur:82000000 cpbdur:82000000 q:20.94 tex:65306 mv:4758 misc:1400 imb:16 pmb:782 smb:552 d:- ref:0 ; in:9699 out:9699 type:P dur:82000000 cpbdur:82000000 q:20.32 tex:47451 mv:3681 misc:1492 imb:43 pmb:817 smb:490 d:- ref:0 ; in:9700 out:9700 type:P dur:82000000 cpbdur:82000000 q:21.08 tex:66602 mv:4958 misc:1432 imb:41 pmb:782 smb:527 d:- ref:0 ; in:9701 out:9701 type:P dur:82000000 cpbdur:82000000 q:21.49 tex:69335 mv:5524 misc:1445 imb:35 pmb:814 smb:501 d:- ref:0 ; in:9702 out:9702 type:P dur:82000000 cpbdur:82000000 q:20.62 tex:25875 mv:2880 misc:1437 imb:31 pmb:602 smb:717 d:- ref:0 ; in:9703 out:9703 type:P dur:82000000 cpbdur:82000000 q:20.25 tex:51658 mv:3982 misc:1536 imb:48 pmb:856 smb:446 d:- ref:0 ; in:9704 out:9704 type:P dur:82000000 cpbdur:82000000 q:21.61 tex:77190 mv:5778 misc:1456 imb:55 pmb:900 smb:395 d:- ref:0 ; in:9705 out:9705 type:P dur:82000000 cpbdur:82000000 q:21.86 tex:84961 mv:5435 misc:1436 imb:49 pmb:925 smb:376 d:- ref:0 ; in:9706 out:9706 type:P dur:82000000 cpbdur:82000000 q:21.34 tex:71329 mv:5003 misc:1500 imb:48 pmb:957 smb:345 d:- ref:0 ; in:9707 out:9707 type:P dur:82000000 cpbdur:82000000 q:21.33 tex:74273 mv:4928 misc:1519 imb:36 pmb:888 smb:426 d:- ref:0 ; in:9708 out:9708 type:P dur:82000000 cpbdur:82000000 q:21.71 tex:63414 mv:5193 misc:1441 imb:24 pmb:805 smb:521 d:- ref:0 ; in:9709 out:9709 type:P dur:82000000 cpbdur:82000000 q:21.24 tex:63930 mv:4553 misc:1517 imb:39 pmb:983 smb:328 d:- ref:0 ; in:9710 out:9710 type:P dur:82000000 cpbdur:82000000 q:21.86 tex:77037 mv:5908 misc:1471 imb:33 pmb:920 smb:397 d:- ref:0 ; in:9711 out:9711 type:P dur:82000000 cpbdur:82000000 q:20.96 tex:68433 mv:4364 misc:1499 imb:52 pmb:972 smb:326 d:- ref:0 ; in:9712 out:9712 type:P dur:82000000 cpbdur:82000000 q:22.09 tex:107107 mv:6457 misc:1452 imb:97 pmb:971 smb:282 d:- ref:0 ; in:9713 out:9713 type:P dur:82000000 cpbdur:82000000 q:22.19 tex:84532 mv:6291 misc:1473 imb:53 pmb:913 smb:384 d:- ref:0 ; in:9714 out:9714 type:P dur:82000000 cpbdur:82000000 q:22.45 tex:99280 mv:6061 misc:1467 imb:58 pmb:951 smb:341 d:- ref:0 ; in:9715 out:9715 type:P dur:82000000 cpbdur:82000000 q:21.51 tex:42679 mv:3759 misc:1514 imb:45 pmb:799 smb:506 d:- ref:0 ; in:9716 out:9716 type:P dur:82000000 cpbdur:82000000 q:20.64 tex:53276 mv:4176 misc:1540 imb:54 pmb:934 smb:362 d:- ref:0 ; in:9717 out:9717 type:P dur:82000000 cpbdur:82000000 q:21.24 tex:73042 mv:4921 misc:1501 imb:34 pmb:989 smb:327 d:- ref:0 ; in:9718 out:9718 type:P dur:82000000 cpbdur:82000000 q:20.54 tex:44849 mv:3084 misc:1435 imb:20 pmb:692 smb:638 d:- ref:0 ; in:9719 out:9719 type:P dur:82000000 cpbdur:82000000 q:21.84 tex:83693 mv:4777 misc:1506 imb:46 pmb:949 smb:355 d:- ref:0 ; in:9720 out:9720 type:P dur:82000000 cpbdur:82000000 q:22.79 tex:104399 mv:6511 misc:1458 imb:80 pmb:947 smb:323 d:- ref:0 ; in:9721 out:9721 type:P dur:82000000 cpbdur:82000000 q:22.32 tex:97196 mv:5460 misc:1520 imb:49 pmb:1022 smb:279 d:- ref:0 ; in:9722 out:9722 type:P dur:82000000 cpbdur:82000000 q:21.15 tex:66796 mv:3788 misc:1528 imb:34 pmb:970 smb:346 d:- ref:0 ; in:9723 out:9723 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:59190 mv:3734 misc:1548 imb:29 pmb:900 smb:421 d:- ref:0 ; in:9724 out:9724 type:P dur:82000000 cpbdur:82000000 q:21.64 tex:79058 mv:5169 misc:1453 imb:22 pmb:887 smb:441 d:- ref:0 ; in:9725 out:9725 type:P dur:82000000 cpbdur:82000000 q:20.84 tex:63999 mv:3625 misc:1520 imb:25 pmb:911 smb:414 d:- ref:0 ; in:9726 out:9726 type:P dur:82000000 cpbdur:82000000 q:21.64 tex:74468 mv:5349 misc:1479 imb:25 pmb:901 smb:424 d:- ref:0 ; in:9727 out:9727 type:P dur:82000000 cpbdur:82000000 q:21.73 tex:76233 mv:4952 misc:1519 imb:34 pmb:938 smb:378 d:- ref:0 ; in:9728 out:9728 type:P dur:82000000 cpbdur:82000000 q:21.76 tex:74844 mv:5093 misc:1471 imb:21 pmb:919 smb:410 d:- ref:0 ; in:9729 out:9729 type:P dur:82000000 cpbdur:82000000 q:20.61 tex:50055 mv:3553 misc:1552 imb:23 pmb:919 smb:408 d:- ref:0 ; in:9730 out:9730 type:P dur:82000000 cpbdur:82000000 q:21.34 tex:81583 mv:4688 misc:1497 imb:26 pmb:962 smb:362 d:- ref:0 ; in:9731 out:9731 type:P dur:82000000 cpbdur:82000000 q:21.56 tex:69986 mv:4184 misc:1414 imb:19 pmb:810 smb:521 d:- ref:0 ; in:9732 out:9732 type:P dur:82000000 cpbdur:82000000 q:21.29 tex:84689 mv:5258 misc:1493 imb:25 pmb:978 smb:347 d:- ref:0 ; in:9733 out:9733 type:P dur:82000000 cpbdur:82000000 q:20.93 tex:62706 mv:3748 misc:1530 imb:31 pmb:822 smb:497 d:- ref:0 ; in:9734 out:9734 type:P dur:82000000 cpbdur:82000000 q:22.35 tex:114763 mv:6389 misc:1480 imb:40 pmb:1047 smb:263 d:- ref:0 ; in:9735 out:9735 type:P dur:82000000 cpbdur:82000000 q:21.85 tex:78068 mv:4081 misc:1523 imb:33 pmb:973 smb:344 d:- ref:0 ; in:9736 out:9736 type:P dur:82000000 cpbdur:82000000 q:22.15 tex:88939 mv:5163 misc:1498 imb:18 pmb:975 smb:357 d:- ref:0 ; in:9737 out:9737 type:P dur:82000000 cpbdur:82000000 q:22.50 tex:89245 mv:5193 misc:1490 imb:49 pmb:981 smb:320 d:- ref:0 ; in:9738 out:9738 type:P dur:82000000 cpbdur:82000000 q:21.95 tex:105613 mv:5177 misc:1482 imb:39 pmb:1101 smb:210 d:- ref:0 ; in:9739 out:9739 type:P dur:82000000 cpbdur:82000000 q:21.55 tex:82349 mv:4303 misc:1524 imb:29 pmb:973 smb:348 d:- ref:0 ; in:9740 out:9740 type:P dur:82000000 cpbdur:82000000 q:22.08 tex:107070 mv:5710 misc:1500 imb:38 pmb:1082 smb:230 d:- ref:0 ; in:9741 out:9741 type:P dur:82000000 cpbdur:82000000 q:21.90 tex:93004 mv:4626 misc:1538 imb:34 pmb:1028 smb:288 d:- ref:0 ; in:9742 out:9742 type:P dur:82000000 cpbdur:82000000 q:22.18 tex:105400 mv:5996 misc:1508 imb:42 pmb:1086 smb:222 d:- ref:0 ; in:9743 out:9743 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:73122 mv:3806 misc:1528 imb:22 pmb:900 smb:428 d:- ref:0 ; in:9744 out:9744 type:P dur:82000000 cpbdur:82000000 q:22.00 tex:98718 mv:5819 misc:1503 imb:25 pmb:1067 smb:258 d:- ref:0 ; in:9745 out:9745 type:P dur:82000000 cpbdur:82000000 q:21.43 tex:93032 mv:4523 misc:1493 imb:37 pmb:1067 smb:246 d:- ref:0 ; in:9746 out:9746 type:P dur:82000000 cpbdur:82000000 q:21.82 tex:83781 mv:4685 misc:1502 imb:21 pmb:999 smb:330 d:- ref:0 ; in:9747 out:9747 type:P dur:82000000 cpbdur:82000000 q:21.86 tex:92315 mv:4624 misc:1517 imb:15 pmb:1008 smb:327 d:- ref:0 ; in:9748 out:9748 type:P dur:82000000 cpbdur:82000000 q:22.19 tex:114057 mv:6119 misc:1496 imb:33 pmb:1099 smb:218 d:- ref:0 ; in:9749 out:9749 type:P dur:82000000 cpbdur:82000000 q:21.71 tex:75782 mv:3598 misc:1516 imb:6 pmb:956 smb:388 d:- ref:0 ; in:9750 out:9750 type:I dur:82000000 cpbdur:82000000 q:18.70 tex:496489 mv:15206 misc:377 imb:1350 pmb:0 smb:0 d:- ref:; in:9751 out:9751 type:P dur:82000000 cpbdur:82000000 q:25.71 tex:60610 mv:4246 misc:1480 imb:68 pmb:732 smb:550 d:- ref:0 ; in:9752 out:9752 type:P dur:82000000 cpbdur:82000000 q:24.34 tex:60644 mv:4566 misc:1494 imb:15 pmb:918 smb:417 d:- ref:0 ; in:9753 out:9753 type:P dur:82000000 cpbdur:82000000 q:23.01 tex:62924 mv:3900 misc:1544 imb:11 pmb:938 smb:401 d:- ref:0 ; in:9754 out:9754 type:P dur:82000000 cpbdur:82000000 q:23.07 tex:69303 mv:4972 misc:1501 imb:11 pmb:898 smb:441 d:- ref:0 ; in:9755 out:9755 type:P dur:82000000 cpbdur:82000000 q:21.65 tex:53840 mv:3743 misc:1553 imb:14 pmb:975 smb:361 d:- ref:0 ; in:9756 out:9756 type:P dur:82000000 cpbdur:82000000 q:22.50 tex:80887 mv:5178 misc:1487 imb:17 pmb:932 smb:401 d:- ref:0 ; in:9757 out:9757 type:P dur:82000000 cpbdur:82000000 q:21.37 tex:90686 mv:4695 misc:1499 imb:27 pmb:1147 smb:176 d:- ref:0 ; in:9758 out:9758 type:P dur:82000000 cpbdur:82000000 q:22.26 tex:89432 mv:5365 misc:1499 imb:13 pmb:1001 smb:336 d:- ref:0 ; in:9759 out:9759 type:P dur:82000000 cpbdur:82000000 q:23.50 tex:134151 mv:6099 misc:1510 imb:70 pmb:1053 smb:227 d:- ref:0 ; in:9760 out:9760 type:P dur:82000000 cpbdur:82000000 q:23.36 tex:115356 mv:5546 misc:1498 imb:42 pmb:1096 smb:212 d:- ref:0 ; in:9761 out:9761 type:P dur:82000000 cpbdur:82000000 q:23.83 tex:93742 mv:5045 misc:1493 imb:40 pmb:953 smb:357 d:- ref:0 ; in:9762 out:9762 type:P dur:82000000 cpbdur:82000000 q:23.55 tex:86142 mv:5643 misc:1495 imb:21 pmb:1005 smb:324 d:- ref:0 ; in:9763 out:9763 type:P dur:82000000 cpbdur:82000000 q:22.63 tex:61728 mv:3782 misc:1530 imb:10 pmb:958 smb:382 d:- ref:0 ; in:9764 out:9764 type:P dur:82000000 cpbdur:82000000 q:22.75 tex:83897 mv:5031 misc:1536 imb:22 pmb:1003 smb:325 d:- ref:0 ; in:9765 out:9765 type:P dur:82000000 cpbdur:82000000 q:22.59 tex:90373 mv:4775 misc:1540 imb:21 pmb:1069 smb:260 d:- ref:0 ; in:9766 out:9766 type:P dur:82000000 cpbdur:82000000 q:22.73 tex:91729 mv:5253 misc:1514 imb:23 pmb:1043 smb:284 d:- ref:0 ; in:9767 out:9767 type:P dur:82000000 cpbdur:82000000 q:23.13 tex:123258 mv:5748 misc:1498 imb:51 pmb:1134 smb:165 d:- ref:0 ; in:9768 out:9768 type:P dur:82000000 cpbdur:82000000 q:23.19 tex:105968 mv:5650 misc:1486 imb:17 pmb:1124 smb:209 d:- ref:0 ; in:9769 out:9769 type:P dur:82000000 cpbdur:82000000 q:22.43 tex:118227 mv:4897 misc:1476 imb:25 pmb:1211 smb:114 d:- ref:0 ; in:9770 out:9770 type:P dur:82000000 cpbdur:82000000 q:23.19 tex:106818 mv:5982 misc:1488 imb:22 pmb:1098 smb:230 d:- ref:0 ; in:9771 out:9771 type:P dur:82000000 cpbdur:82000000 q:22.76 tex:85237 mv:4653 misc:1534 imb:43 pmb:1075 smb:232 d:- ref:0 ; in:9772 out:9772 type:P dur:82000000 cpbdur:82000000 q:22.12 tex:92677 mv:4410 misc:1513 imb:18 pmb:1164 smb:168 d:- ref:0 ; in:9773 out:9773 type:P dur:82000000 cpbdur:82000000 q:22.80 tex:105328 mv:4944 misc:1512 imb:11 pmb:1114 smb:225 d:- ref:0 ; in:9774 out:9774 type:P dur:82000000 cpbdur:82000000 q:23.39 tex:113699 mv:5867 misc:1498 imb:16 pmb:1125 smb:209 d:- ref:0 ; in:9775 out:9775 type:P dur:82000000 cpbdur:82000000 q:22.50 tex:111530 mv:4480 misc:1486 imb:19 pmb:1212 smb:119 d:- ref:0 ; in:9776 out:9776 type:P dur:82000000 cpbdur:82000000 q:23.76 tex:129533 mv:6268 misc:1487 imb:55 pmb:1122 smb:173 d:- ref:0 ; in:9777 out:9777 type:P dur:82000000 cpbdur:82000000 q:23.66 tex:88901 mv:5356 misc:1487 imb:24 pmb:1026 smb:300 d:- ref:0 ; in:9778 out:9778 type:P dur:82000000 cpbdur:82000000 q:22.81 tex:85715 mv:4374 misc:1519 imb:11 pmb:1132 smb:207 d:- ref:0 ; in:9779 out:9779 type:P dur:82000000 cpbdur:82000000 q:21.74 tex:85250 mv:4205 misc:1497 imb:11 pmb:1187 smb:152 d:- ref:0 ; in:9780 out:9780 type:P dur:82000000 cpbdur:82000000 q:22.73 tex:104934 mv:4441 misc:1497 imb:20 pmb:1073 smb:257 d:- ref:0 ; in:9781 out:9781 type:P dur:82000000 cpbdur:82000000 q:23.02 tex:86817 mv:3795 misc:1524 imb:11 pmb:1075 smb:264 d:- ref:0 ; in:9782 out:9782 type:P dur:82000000 cpbdur:82000000 q:23.04 tex:94795 mv:3913 misc:1532 imb:11 pmb:1087 smb:252 d:- ref:0 ; in:9783 out:9783 type:P dur:82000000 cpbdur:82000000 q:22.03 tex:90994 mv:4174 misc:1504 imb:7 pmb:1200 smb:143 d:- ref:0 ; in:9784 out:9784 type:P dur:82000000 cpbdur:82000000 q:20.92 tex:73820 mv:3788 misc:1520 imb:5 pmb:1164 smb:181 d:- ref:0 ; in:9785 out:9785 type:P dur:82000000 cpbdur:82000000 q:21.48 tex:81191 mv:3726 misc:1531 imb:5 pmb:1122 smb:223 d:- ref:0 ; in:9786 out:9786 type:P dur:82000000 cpbdur:82000000 q:22.26 tex:95354 mv:4157 misc:1513 imb:5 pmb:1113 smb:232 d:- ref:0 ; in:9787 out:9787 type:P dur:82000000 cpbdur:82000000 q:23.08 tex:110179 mv:5391 misc:1486 imb:9 pmb:1099 smb:242 d:- ref:0 ; in:9788 out:9788 type:P dur:82000000 cpbdur:82000000 q:21.55 tex:66172 mv:3766 misc:1510 imb:5 pmb:1132 smb:213 d:- ref:0 ; in:9789 out:9789 type:P dur:82000000 cpbdur:82000000 q:20.12 tex:109158 mv:3928 misc:1458 imb:3 pmb:1260 smb:87 d:- ref:0 ; in:9790 out:9790 type:P dur:82000000 cpbdur:82000000 q:18.56 tex:105501 mv:3940 misc:1455 imb:3 pmb:1284 smb:63 d:- ref:0 ; in:9791 out:9791 type:P dur:82000000 cpbdur:82000000 q:17.58 tex:76692 mv:3614 misc:1542 imb:6 pmb:1178 smb:166 d:- ref:0 ; in:9792 out:9792 type:P dur:82000000 cpbdur:82000000 q:18.30 tex:74083 mv:3379 misc:1546 imb:1 pmb:1093 smb:256 d:- ref:0 ; in:9793 out:9793 type:P dur:82000000 cpbdur:82000000 q:17.01 tex:100900 mv:3892 misc:1488 imb:5 pmb:1266 smb:79 d:- ref:0 ; in:9794 out:9794 type:P dur:82000000 cpbdur:82000000 q:16.93 tex:55240 mv:3070 misc:1586 imb:2 pmb:1010 smb:338 d:- ref:0 ; in:9795 out:9795 type:P dur:82000000 cpbdur:82000000 q:16.53 tex:39937 mv:2877 misc:1586 imb:2 pmb:939 smb:409 d:- ref:0 ; in:9796 out:9796 type:P dur:82000000 cpbdur:82000000 q:15.46 tex:197934 mv:4038 misc:1436 imb:4 pmb:1318 smb:28 d:- ref:0 ; in:9797 out:9797 type:P dur:82000000 cpbdur:82000000 q:16.50 tex:35219 mv:2636 misc:1601 imb:1 pmb:874 smb:475 d:- ref:0 ; in:9798 out:9798 type:P dur:82000000 cpbdur:82000000 q:19.31 tex:57977 mv:2913 misc:1590 imb:5 pmb:913 smb:432 d:- ref:0 ; in:9799 out:9799 type:P dur:82000000 cpbdur:82000000 q:19.38 tex:52329 mv:2677 misc:1506 imb:3 pmb:837 smb:510 d:- ref:0 ; in:9800 out:9800 type:P dur:82000000 cpbdur:82000000 q:21.01 tex:81665 mv:4639 misc:1488 imb:63 pmb:1183 smb:104 d:- ref:0 ; in:9801 out:9801 type:P dur:82000000 cpbdur:82000000 q:21.10 tex:56964 mv:4414 misc:1518 imb:85 pmb:1066 smb:199 d:- ref:0 ; in:9802 out:9802 type:P dur:82000000 cpbdur:82000000 q:22.12 tex:99496 mv:5379 misc:1461 imb:110 pmb:1175 smb:65 d:- ref:0 ; in:9803 out:9803 type:P dur:82000000 cpbdur:82000000 q:22.00 tex:64834 mv:4982 misc:1496 imb:97 pmb:1136 smb:117 d:- ref:0 ; in:9804 out:9804 type:P dur:82000000 cpbdur:82000000 q:21.97 tex:71403 mv:5120 misc:1469 imb:102 pmb:1180 smb:68 d:- ref:0 ; in:9805 out:9805 type:P dur:82000000 cpbdur:82000000 q:22.04 tex:75418 mv:5205 misc:1489 imb:101 pmb:1167 smb:82 d:- ref:0 ; in:9806 out:9806 type:P dur:82000000 cpbdur:82000000 q:22.10 tex:75441 mv:5569 misc:1462 imb:102 pmb:1181 smb:67 d:- ref:0 ; in:9807 out:9807 type:P dur:82000000 cpbdur:82000000 q:22.10 tex:75166 mv:5438 misc:1476 imb:75 pmb:1190 smb:85 d:- ref:0 ; in:9808 out:9808 type:P dur:82000000 cpbdur:82000000 q:22.17 tex:77061 mv:5570 misc:1465 imb:93 pmb:1186 smb:71 d:- ref:0 ; in:9809 out:9809 type:P dur:82000000 cpbdur:82000000 q:22.26 tex:81595 mv:5724 misc:1465 imb:69 pmb:1216 smb:65 d:- ref:0 ; in:9810 out:9810 type:P dur:82000000 cpbdur:82000000 q:22.47 tex:89593 mv:5794 misc:1461 imb:82 pmb:1210 smb:58 d:- ref:0 ; in:9811 out:9811 type:P dur:82000000 cpbdur:82000000 q:22.68 tex:70066 mv:5493 misc:1505 imb:80 pmb:1153 smb:117 d:- ref:0 ; in:9812 out:9812 type:P dur:82000000 cpbdur:82000000 q:23.13 tex:103534 mv:6227 misc:1439 imb:101 pmb:1213 smb:36 d:- ref:0 ; in:9813 out:9813 type:P dur:82000000 cpbdur:82000000 q:23.09 tex:83862 mv:5803 misc:1471 imb:80 pmb:1193 smb:77 d:- ref:0 ; in:9814 out:9814 type:P dur:82000000 cpbdur:82000000 q:23.28 tex:95460 mv:6034 misc:1466 imb:79 pmb:1216 smb:55 d:- ref:0 ; in:9815 out:9815 type:P dur:82000000 cpbdur:82000000 q:23.44 tex:98832 mv:6432 misc:1448 imb:77 pmb:1224 smb:49 d:- ref:0 ; in:9816 out:9816 type:P dur:82000000 cpbdur:82000000 q:23.67 tex:83105 mv:6513 misc:1478 imb:87 pmb:1165 smb:98 d:- ref:0 ; in:9817 out:9817 type:P dur:82000000 cpbdur:82000000 q:23.88 tex:98726 mv:6668 misc:1446 imb:97 pmb:1216 smb:37 d:- ref:0 ; in:9818 out:9818 type:P dur:82000000 cpbdur:82000000 q:23.96 tex:96111 mv:6878 misc:1459 imb:87 pmb:1202 smb:61 d:- ref:0 ; in:9819 out:9819 type:P dur:82000000 cpbdur:82000000 q:24.13 tex:104395 mv:7286 misc:1447 imb:105 pmb:1202 smb:43 d:- ref:0 ; in:9820 out:9820 type:P dur:82000000 cpbdur:82000000 q:24.12 tex:105606 mv:7460 misc:1462 imb:94 pmb:1180 smb:76 d:- ref:0 ; in:9821 out:9821 type:P dur:82000000 cpbdur:82000000 q:24.28 tex:111174 mv:7759 misc:1459 imb:115 pmb:1189 smb:46 d:- ref:0 ; in:9822 out:9822 type:P dur:82000000 cpbdur:82000000 q:24.48 tex:122392 mv:8426 misc:1446 imb:114 pmb:1188 smb:48 d:- ref:0 ; in:9823 out:9823 type:P dur:82000000 cpbdur:82000000 q:24.54 tex:101643 mv:8504 misc:1469 imb:116 pmb:1162 smb:72 d:- ref:0 ; in:9824 out:9824 type:P dur:82000000 cpbdur:82000000 q:24.61 tex:110061 mv:8849 misc:1466 imb:103 pmb:1157 smb:90 d:- ref:0 ; in:9825 out:9825 type:P dur:82000000 cpbdur:82000000 q:24.71 tex:111919 mv:9406 misc:1451 imb:135 pmb:1164 smb:51 d:- ref:0 ; in:9826 out:9826 type:P dur:82000000 cpbdur:82000000 q:24.75 tex:111758 mv:9413 misc:1461 imb:111 pmb:1161 smb:78 d:- ref:0 ; in:9827 out:9827 type:P dur:82000000 cpbdur:82000000 q:24.86 tex:115990 mv:9751 misc:1451 imb:116 pmb:1187 smb:47 d:- ref:0 ; in:9828 out:9828 type:P dur:82000000 cpbdur:82000000 q:24.84 tex:117189 mv:9946 misc:1449 imb:124 pmb:1154 smb:72 d:- ref:0 ; in:9829 out:9829 type:P dur:82000000 cpbdur:82000000 q:24.99 tex:122828 mv:10380 misc:1448 imb:125 pmb:1170 smb:55 d:- ref:0 ; in:9830 out:9830 type:P dur:82000000 cpbdur:82000000 q:24.85 tex:113155 mv:10227 misc:1458 imb:114 pmb:1169 smb:67 d:- ref:0 ; in:9831 out:9831 type:P dur:82000000 cpbdur:82000000 q:24.90 tex:117021 mv:10318 misc:1453 imb:131 pmb:1154 smb:65 d:- ref:0 ; in:9832 out:9832 type:P dur:82000000 cpbdur:82000000 q:24.88 tex:115752 mv:10135 misc:1457 imb:124 pmb:1149 smb:77 d:- ref:0 ; in:9833 out:9833 type:P dur:82000000 cpbdur:82000000 q:24.86 tex:115107 mv:10425 misc:1452 imb:130 pmb:1163 smb:57 d:- ref:0 ; in:9834 out:9834 type:P dur:82000000 cpbdur:82000000 q:24.91 tex:120200 mv:11192 misc:1448 imb:158 pmb:1148 smb:44 d:- ref:0 ; in:9835 out:9835 type:P dur:82000000 cpbdur:82000000 q:24.69 tex:104382 mv:10163 misc:1479 imb:149 pmb:1129 smb:72 d:- ref:0 ; in:9836 out:9836 type:P dur:82000000 cpbdur:82000000 q:24.60 tex:104062 mv:10081 misc:1449 imb:201 pmb:1093 smb:56 d:- ref:0 ; in:9837 out:9837 type:P dur:82000000 cpbdur:82000000 q:24.45 tex:116287 mv:9915 misc:1446 imb:187 pmb:1111 smb:52 d:- ref:0 ; in:9838 out:9838 type:P dur:82000000 cpbdur:82000000 q:24.40 tex:103854 mv:9857 misc:1457 imb:221 pmb:1051 smb:78 d:- ref:0 ; in:9839 out:9839 type:P dur:82000000 cpbdur:82000000 q:24.17 tex:98301 mv:9064 misc:1459 imb:242 pmb:1034 smb:74 d:- ref:0 ; in:9840 out:9840 type:P dur:82000000 cpbdur:82000000 q:24.06 tex:96684 mv:10199 misc:1461 imb:268 pmb:1005 smb:77 d:- ref:0 ; in:9841 out:9841 type:P dur:82000000 cpbdur:82000000 q:23.82 tex:77614 mv:9178 misc:1464 imb:229 pmb:996 smb:125 d:- ref:0 ; in:9842 out:9842 type:P dur:82000000 cpbdur:82000000 q:23.49 tex:98259 mv:8628 misc:1473 imb:266 pmb:994 smb:90 d:- ref:0 ; in:9843 out:9843 type:P dur:82000000 cpbdur:82000000 q:23.58 tex:75027 mv:8219 misc:1466 imb:212 pmb:969 smb:169 d:- ref:0 ; in:9844 out:9844 type:P dur:82000000 cpbdur:82000000 q:23.56 tex:80634 mv:9060 misc:1458 imb:253 pmb:980 smb:117 d:- ref:0 ; in:9845 out:9845 type:P dur:82000000 cpbdur:82000000 q:23.25 tex:87195 mv:7793 misc:1492 imb:173 pmb:1021 smb:156 d:- ref:0 ; in:9846 out:9846 type:P dur:82000000 cpbdur:82000000 q:22.99 tex:68820 mv:7057 misc:1483 imb:145 pmb:1047 smb:158 d:- ref:0 ; in:9847 out:9847 type:P dur:82000000 cpbdur:82000000 q:21.97 tex:74353 mv:7383 misc:1488 imb:149 pmb:1079 smb:122 d:- ref:0 ; in:9848 out:9848 type:P dur:82000000 cpbdur:82000000 q:22.45 tex:91078 mv:7642 misc:1472 imb:123 pmb:1060 smb:167 d:- ref:0 ; in:9849 out:9849 type:P dur:82000000 cpbdur:82000000 q:22.09 tex:68357 mv:5162 misc:1521 imb:46 pmb:966 smb:338 d:- ref:0 ; in:9850 out:9850 type:P dur:82000000 cpbdur:82000000 q:21.44 tex:64375 mv:5412 misc:1525 imb:79 pmb:1022 smb:249 d:- ref:0 ; in:9851 out:9851 type:P dur:82000000 cpbdur:82000000 q:20.30 tex:66891 mv:4167 misc:1494 imb:38 pmb:947 smb:365 d:- ref:0 ; in:9852 out:9852 type:P dur:82000000 cpbdur:82000000 q:20.49 tex:64889 mv:4972 misc:1531 imb:53 pmb:972 smb:325 d:- ref:0 ; in:9853 out:9853 type:P dur:82000000 cpbdur:82000000 q:19.83 tex:44146 mv:3252 misc:1450 imb:17 pmb:772 smb:561 d:- ref:0 ; in:9854 out:9854 type:P dur:82000000 cpbdur:82000000 q:20.76 tex:62664 mv:5185 misc:1543 imb:55 pmb:925 smb:370 d:- ref:0 ; in:9855 out:9855 type:P dur:82000000 cpbdur:82000000 q:20.95 tex:56742 mv:4026 misc:1432 imb:24 pmb:792 smb:534 d:- ref:0 ; in:9856 out:9856 type:P dur:82000000 cpbdur:82000000 q:20.78 tex:44391 mv:3943 misc:1522 imb:39 pmb:813 smb:498 d:- ref:0 ; in:9857 out:9857 type:P dur:82000000 cpbdur:82000000 q:20.43 tex:66980 mv:4058 misc:1482 imb:30 pmb:902 smb:418 d:- ref:0 ; in:9858 out:9858 type:P dur:82000000 cpbdur:82000000 q:21.29 tex:70674 mv:4447 misc:1479 imb:28 pmb:857 smb:465 d:- ref:0 ; in:9859 out:9859 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:55548 mv:3971 misc:1361 imb:25 pmb:749 smb:576 d:- ref:0 ; in:9860 out:9860 type:P dur:82000000 cpbdur:82000000 q:21.71 tex:55001 mv:4019 misc:1356 imb:23 pmb:757 smb:570 d:- ref:0 ; in:9861 out:9861 type:P dur:82000000 cpbdur:82000000 q:21.10 tex:44726 mv:4132 misc:1510 imb:41 pmb:806 smb:503 d:- ref:0 ; in:9862 out:9862 type:P dur:82000000 cpbdur:82000000 q:21.54 tex:61318 mv:4268 misc:1358 imb:12 pmb:800 smb:538 d:- ref:0 ; in:9863 out:9863 type:P dur:82000000 cpbdur:82000000 q:21.48 tex:58764 mv:4812 misc:1488 imb:64 pmb:862 smb:424 d:- ref:0 ; in:9864 out:9864 type:P dur:82000000 cpbdur:82000000 q:21.55 tex:59617 mv:4134 misc:1409 imb:24 pmb:796 smb:530 d:- ref:0 ; in:9865 out:9865 type:P dur:82000000 cpbdur:82000000 q:20.89 tex:44944 mv:4210 misc:1502 imb:50 pmb:846 smb:454 d:- ref:0 ; in:9866 out:9866 type:P dur:82000000 cpbdur:82000000 q:20.01 tex:52733 mv:3642 misc:1473 imb:33 pmb:834 smb:483 d:- ref:0 ; in:9867 out:9867 type:P dur:82000000 cpbdur:82000000 q:20.08 tex:52311 mv:4074 misc:1495 imb:40 pmb:864 smb:446 d:- ref:0 ; in:9868 out:9868 type:P dur:82000000 cpbdur:82000000 q:19.45 tex:80550 mv:5346 misc:1544 imb:58 pmb:1070 smb:222 d:- ref:0 ; in:9869 out:9869 type:P dur:82000000 cpbdur:82000000 q:19.71 tex:34855 mv:2979 misc:1414 imb:18 pmb:661 smb:671 d:- ref:0 ; in:9870 out:9870 type:P dur:82000000 cpbdur:82000000 q:19.24 tex:56710 mv:4882 misc:1552 imb:56 pmb:914 smb:380 d:- ref:0 ; in:9871 out:9871 type:P dur:82000000 cpbdur:82000000 q:18.63 tex:38974 mv:3582 misc:1540 imb:34 pmb:764 smb:552 d:- ref:0 ; in:9872 out:9872 type:P dur:82000000 cpbdur:82000000 q:19.43 tex:58009 mv:4573 misc:1538 imb:41 pmb:913 smb:396 d:- ref:0 ; in:9873 out:9873 type:P dur:82000000 cpbdur:82000000 q:19.87 tex:35472 mv:2410 misc:1334 imb:17 pmb:608 smb:725 d:- ref:0 ; in:9874 out:9874 type:P dur:82000000 cpbdur:82000000 q:20.31 tex:53591 mv:3639 misc:1426 imb:33 pmb:771 smb:546 d:- ref:0 ; in:9875 out:9875 type:P dur:82000000 cpbdur:82000000 q:20.28 tex:31623 mv:3307 misc:1446 imb:30 pmb:671 smb:649 d:- ref:0 ; in:9876 out:9876 type:P dur:82000000 cpbdur:82000000 q:20.40 tex:55399 mv:3563 misc:1462 imb:26 pmb:777 smb:547 d:- ref:0 ; in:9877 out:9877 type:P dur:82000000 cpbdur:82000000 q:19.63 tex:34743 mv:3307 misc:1478 imb:28 pmb:683 smb:639 d:- ref:0 ; in:9878 out:9878 type:P dur:82000000 cpbdur:82000000 q:19.67 tex:34402 mv:3114 misc:1420 imb:27 pmb:636 smb:687 d:- ref:0 ; in:9879 out:9879 type:P dur:82000000 cpbdur:82000000 q:20.52 tex:62078 mv:4332 misc:1398 imb:31 pmb:764 smb:555 d:- ref:0 ; in:9880 out:9880 type:P dur:82000000 cpbdur:82000000 q:20.01 tex:47358 mv:3655 misc:1483 imb:44 pmb:759 smb:547 d:- ref:0 ; in:9881 out:9881 type:P dur:82000000 cpbdur:82000000 q:19.80 tex:30825 mv:3147 misc:1460 imb:30 pmb:689 smb:631 d:- ref:0 ; in:9882 out:9882 type:P dur:82000000 cpbdur:82000000 q:20.58 tex:57129 mv:4410 misc:1421 imb:41 pmb:800 smb:509 d:- ref:0 ; in:9883 out:9883 type:P dur:82000000 cpbdur:82000000 q:20.21 tex:45111 mv:4020 misc:1485 imb:36 pmb:806 smb:508 d:- ref:0 ; in:9884 out:9884 type:P dur:82000000 cpbdur:82000000 q:20.88 tex:55190 mv:4525 misc:1509 imb:42 pmb:833 smb:475 d:- ref:0 ; in:9885 out:9885 type:P dur:82000000 cpbdur:82000000 q:20.76 tex:34848 mv:3601 misc:1471 imb:25 pmb:719 smb:606 d:- ref:0 ; in:9886 out:9886 type:P dur:82000000 cpbdur:82000000 q:21.25 tex:56386 mv:4593 misc:1429 imb:43 pmb:851 smb:456 d:- ref:0 ; in:9887 out:9887 type:P dur:82000000 cpbdur:82000000 q:20.70 tex:47178 mv:3845 misc:1481 imb:51 pmb:737 smb:562 d:- ref:0 ; in:9888 out:9888 type:P dur:82000000 cpbdur:82000000 q:20.02 tex:37669 mv:3838 misc:1517 imb:50 pmb:776 smb:524 d:- ref:0 ; in:9889 out:9889 type:P dur:82000000 cpbdur:82000000 q:20.84 tex:56764 mv:4386 misc:1450 imb:52 pmb:812 smb:486 d:- ref:0 ; in:9890 out:9890 type:P dur:82000000 cpbdur:82000000 q:21.01 tex:67319 mv:4674 misc:1439 imb:34 pmb:822 smb:494 d:- ref:0 ; in:9891 out:9891 type:P dur:82000000 cpbdur:82000000 q:20.53 tex:29608 mv:3346 misc:1478 imb:43 pmb:668 smb:639 d:- ref:0 ; in:9892 out:9892 type:P dur:82000000 cpbdur:82000000 q:20.12 tex:45087 mv:4010 misc:1519 imb:45 pmb:824 smb:481 d:- ref:0 ; in:9893 out:9893 type:P dur:82000000 cpbdur:82000000 q:20.06 tex:36018 mv:3699 misc:1531 imb:51 pmb:763 smb:536 d:- ref:0 ; in:9894 out:9894 type:P dur:82000000 cpbdur:82000000 q:20.91 tex:62230 mv:4624 misc:1450 imb:46 pmb:818 smb:486 d:- ref:0 ; in:9895 out:9895 type:P dur:82000000 cpbdur:82000000 q:21.03 tex:39195 mv:3746 misc:1491 imb:40 pmb:732 smb:578 d:- ref:0 ; in:9896 out:9896 type:P dur:82000000 cpbdur:82000000 q:20.87 tex:36792 mv:3706 misc:1454 imb:50 pmb:722 smb:578 d:- ref:0 ; in:9897 out:9897 type:P dur:82000000 cpbdur:82000000 q:19.77 tex:40529 mv:3519 misc:1504 imb:42 pmb:773 smb:535 d:- ref:0 ; in:9898 out:9898 type:P dur:82000000 cpbdur:82000000 q:20.34 tex:45152 mv:3887 misc:1513 imb:47 pmb:787 smb:516 d:- ref:0 ; in:9899 out:9899 type:P dur:82000000 cpbdur:82000000 q:21.01 tex:54701 mv:4015 misc:1476 imb:44 pmb:785 smb:521 d:- ref:0 ; in:9900 out:9900 type:P dur:82000000 cpbdur:82000000 q:21.21 tex:58010 mv:3934 misc:1424 imb:46 pmb:746 smb:558 d:- ref:0 ; in:9901 out:9901 type:P dur:82000000 cpbdur:82000000 q:21.47 tex:74916 mv:5093 misc:1439 imb:47 pmb:829 smb:474 d:- ref:0 ; in:9902 out:9902 type:P dur:82000000 cpbdur:82000000 q:20.55 tex:25051 mv:3117 misc:1504 imb:44 pmb:619 smb:687 d:- ref:0 ; in:9903 out:9903 type:P dur:82000000 cpbdur:82000000 q:20.46 tex:65381 mv:3999 misc:1468 imb:46 pmb:823 smb:481 d:- ref:0 ; in:9904 out:9904 type:P dur:82000000 cpbdur:82000000 q:21.02 tex:53299 mv:3660 misc:1433 imb:43 pmb:750 smb:557 d:- ref:0 ; in:9905 out:9905 type:P dur:82000000 cpbdur:82000000 q:21.42 tex:49423 mv:4079 misc:1458 imb:42 pmb:787 smb:521 d:- ref:0 ; in:9906 out:9906 type:P dur:82000000 cpbdur:82000000 q:21.64 tex:48893 mv:4148 misc:1407 imb:30 pmb:730 smb:590 d:- ref:0 ; in:9907 out:9907 type:P dur:82000000 cpbdur:82000000 q:21.12 tex:42154 mv:3776 misc:1462 imb:43 pmb:786 smb:521 d:- ref:0 ; in:9908 out:9908 type:P dur:82000000 cpbdur:82000000 q:20.95 tex:47176 mv:3355 misc:1413 imb:26 pmb:733 smb:591 d:- ref:0 ; in:9909 out:9909 type:P dur:82000000 cpbdur:82000000 q:20.82 tex:53730 mv:4224 misc:1478 imb:42 pmb:830 smb:478 d:- ref:0 ; in:9910 out:9910 type:P dur:82000000 cpbdur:82000000 q:20.11 tex:37171 mv:3957 misc:1544 imb:46 pmb:833 smb:471 d:- ref:0 ; in:9911 out:9911 type:P dur:82000000 cpbdur:82000000 q:20.73 tex:47335 mv:4262 misc:1523 imb:70 pmb:844 smb:436 d:- ref:0 ; in:9912 out:9912 type:P dur:82000000 cpbdur:82000000 q:21.35 tex:77578 mv:5623 misc:1471 imb:56 pmb:867 smb:427 d:- ref:0 ; in:9913 out:9913 type:P dur:82000000 cpbdur:82000000 q:21.55 tex:54383 mv:5082 misc:1407 imb:36 pmb:782 smb:532 d:- ref:0 ; in:9914 out:9914 type:P dur:82000000 cpbdur:82000000 q:21.38 tex:61034 mv:5562 misc:1508 imb:60 pmb:892 smb:398 d:- ref:0 ; in:9915 out:9915 type:P dur:82000000 cpbdur:82000000 q:21.41 tex:66851 mv:5282 misc:1475 imb:61 pmb:876 smb:413 d:- ref:0 ; in:9916 out:9916 type:P dur:82000000 cpbdur:82000000 q:21.62 tex:58700 mv:4783 misc:1405 imb:35 pmb:791 smb:524 d:- ref:0 ; in:9917 out:9917 type:P dur:82000000 cpbdur:82000000 q:21.58 tex:64029 mv:5506 misc:1425 imb:38 pmb:820 smb:492 d:- ref:0 ; in:9918 out:9918 type:P dur:82000000 cpbdur:82000000 q:21.63 tex:54829 mv:4710 misc:1405 imb:26 pmb:762 smb:562 d:- ref:0 ; in:9919 out:9919 type:P dur:82000000 cpbdur:82000000 q:25.63 tex:358906 mv:18073 misc:1413 imb:1111 pmb:239 smb:0 d:- ref:0 ; in:9920 out:9920 type:P dur:82000000 cpbdur:82000000 q:27.42 tex:113215 mv:11639 misc:1426 imb:97 pmb:943 smb:310 d:- ref:0 ; in:9921 out:9921 type:P dur:82000000 cpbdur:82000000 q:26.78 tex:110953 mv:11087 misc:1456 imb:81 pmb:901 smb:368 d:- ref:0 ; in:9922 out:9922 type:P dur:82000000 cpbdur:82000000 q:26.42 tex:133046 mv:11807 misc:1483 imb:102 pmb:967 smb:281 d:- ref:0 ; in:9923 out:9923 type:P dur:82000000 cpbdur:82000000 q:26.10 tex:119162 mv:10664 misc:1494 imb:76 pmb:924 smb:350 d:- ref:0 ; in:9924 out:9924 type:P dur:82000000 cpbdur:82000000 q:25.95 tex:122249 mv:11434 misc:1509 imb:119 pmb:924 smb:307 d:- ref:0 ; in:9925 out:9925 type:P dur:82000000 cpbdur:82000000 q:25.90 tex:123411 mv:10929 misc:1476 imb:129 pmb:923 smb:298 d:- ref:0 ; in:9926 out:9926 type:P dur:82000000 cpbdur:82000000 q:25.83 tex:123122 mv:11112 misc:1502 imb:108 pmb:906 smb:336 d:- ref:0 ; in:9927 out:9927 type:P dur:82000000 cpbdur:82000000 q:25.83 tex:123311 mv:10907 misc:1510 imb:107 pmb:945 smb:298 d:- ref:0 ; in:9928 out:9928 type:P dur:82000000 cpbdur:82000000 q:25.74 tex:119009 mv:10575 misc:1504 imb:106 pmb:919 smb:325 d:- ref:0 ; in:9929 out:9929 type:P dur:82000000 cpbdur:82000000 q:25.75 tex:119887 mv:10908 misc:1501 imb:131 pmb:902 smb:317 d:- ref:0 ; in:9930 out:9930 type:P dur:82000000 cpbdur:82000000 q:25.73 tex:118693 mv:10687 misc:1476 imb:115 pmb:881 smb:354 d:- ref:0 ; in:9931 out:9931 type:P dur:82000000 cpbdur:82000000 q:25.73 tex:114416 mv:10854 misc:1514 imb:117 pmb:924 smb:309 d:- ref:0 ; in:9932 out:9932 type:P dur:82000000 cpbdur:82000000 q:25.65 tex:113293 mv:10511 misc:1484 imb:116 pmb:881 smb:353 d:- ref:0 ; in:9933 out:9933 type:P dur:82000000 cpbdur:82000000 q:25.52 tex:107055 mv:10239 misc:1474 imb:86 pmb:859 smb:405 d:- ref:0 ; in:9934 out:9934 type:P dur:82000000 cpbdur:82000000 q:25.53 tex:109122 mv:10407 misc:1487 imb:108 pmb:857 smb:385 d:- ref:0 ; in:9935 out:9935 type:P dur:82000000 cpbdur:82000000 q:25.53 tex:110285 mv:10503 misc:1492 imb:84 pmb:859 smb:407 d:- ref:0 ; in:9936 out:9936 type:P dur:82000000 cpbdur:82000000 q:25.65 tex:118619 mv:11724 misc:1489 imb:128 pmb:924 smb:298 d:- ref:0 ; in:9937 out:9937 type:P dur:82000000 cpbdur:82000000 q:25.51 tex:107529 mv:9958 misc:1473 imb:90 pmb:838 smb:422 d:- ref:0 ; in:9938 out:9938 type:P dur:82000000 cpbdur:82000000 q:25.44 tex:139864 mv:11437 misc:1467 imb:155 pmb:991 smb:204 d:- ref:0 ; in:9939 out:9939 type:P dur:82000000 cpbdur:82000000 q:25.22 tex:115234 mv:10425 misc:1469 imb:99 pmb:855 smb:396 d:- ref:0 ; in:9940 out:9940 type:P dur:82000000 cpbdur:82000000 q:25.20 tex:119741 mv:10586 misc:1489 imb:99 pmb:900 smb:351 d:- ref:0 ; in:9941 out:9941 type:P dur:82000000 cpbdur:82000000 q:25.12 tex:117216 mv:10105 misc:1447 imb:80 pmb:821 smb:449 d:- ref:0 ; in:9942 out:9942 type:P dur:82000000 cpbdur:82000000 q:25.17 tex:116555 mv:10511 misc:1502 imb:85 pmb:869 smb:396 d:- ref:0 ; in:9943 out:9943 type:P dur:82000000 cpbdur:82000000 q:25.08 tex:111757 mv:10150 misc:1501 imb:74 pmb:886 smb:390 d:- ref:0 ; in:9944 out:9944 type:P dur:82000000 cpbdur:82000000 q:25.22 tex:121952 mv:10835 misc:1469 imb:98 pmb:863 smb:389 d:- ref:0 ; in:9945 out:9945 type:P dur:82000000 cpbdur:82000000 q:25.18 tex:115076 mv:10108 misc:1496 imb:78 pmb:866 smb:406 d:- ref:0 ; in:9946 out:9946 type:P dur:82000000 cpbdur:82000000 q:25.19 tex:117490 mv:11181 misc:1489 imb:110 pmb:903 smb:337 d:- ref:0 ; in:9947 out:9947 type:P dur:82000000 cpbdur:82000000 q:25.18 tex:116045 mv:10356 misc:1479 imb:80 pmb:826 smb:444 d:- ref:0 ; in:9948 out:9948 type:P dur:82000000 cpbdur:82000000 q:25.14 tex:113873 mv:10136 misc:1455 imb:72 pmb:824 smb:454 d:- ref:0 ; in:9949 out:9949 type:P dur:82000000 cpbdur:82000000 q:25.04 tex:113753 mv:10217 misc:1478 imb:93 pmb:857 smb:400 d:- ref:0 ; in:9950 out:9950 type:P dur:82000000 cpbdur:82000000 q:25.20 tex:122346 mv:10045 misc:1441 imb:89 pmb:789 smb:472 d:- ref:0 ; in:9951 out:9951 type:P dur:82000000 cpbdur:82000000 q:25.14 tex:113938 mv:9767 misc:1447 imb:73 pmb:823 smb:454 d:- ref:0 ; in:9952 out:9952 type:P dur:82000000 cpbdur:82000000 q:25.08 tex:112548 mv:10029 misc:1439 imb:93 pmb:833 smb:424 d:- ref:0 ; in:9953 out:9953 type:P dur:82000000 cpbdur:82000000 q:25.13 tex:114311 mv:9710 misc:1459 imb:77 pmb:834 smb:439 d:- ref:0 ; in:9954 out:9954 type:P dur:82000000 cpbdur:82000000 q:25.26 tex:119213 mv:10352 misc:1451 imb:85 pmb:886 smb:379 d:- ref:0 ; in:9955 out:9955 type:P dur:82000000 cpbdur:82000000 q:25.10 tex:110607 mv:9890 misc:1439 imb:89 pmb:844 smb:417 d:- ref:0 ; in:9956 out:9956 type:P dur:82000000 cpbdur:82000000 q:25.29 tex:128411 mv:10635 misc:1458 imb:90 pmb:887 smb:373 d:- ref:0 ; in:9957 out:9957 type:P dur:82000000 cpbdur:82000000 q:25.20 tex:114603 mv:10026 misc:1443 imb:80 pmb:808 smb:462 d:- ref:0 ; in:9958 out:9958 type:P dur:82000000 cpbdur:82000000 q:25.06 tex:108598 mv:9790 misc:1444 imb:74 pmb:840 smb:436 d:- ref:0 ; in:9959 out:9959 type:P dur:82000000 cpbdur:82000000 q:25.04 tex:111037 mv:10174 misc:1445 imb:82 pmb:826 smb:442 d:- ref:0 ; in:9960 out:9960 type:P dur:82000000 cpbdur:82000000 q:25.19 tex:123071 mv:10896 misc:1433 imb:94 pmb:872 smb:384 d:- ref:0 ; in:9961 out:9961 type:P dur:82000000 cpbdur:82000000 q:25.04 tex:109163 mv:10482 misc:1443 imb:88 pmb:834 smb:428 d:- ref:0 ; in:9962 out:9962 type:P dur:82000000 cpbdur:82000000 q:25.13 tex:115976 mv:10455 misc:1441 imb:106 pmb:839 smb:405 d:- ref:0 ; in:9963 out:9963 type:P dur:82000000 cpbdur:82000000 q:25.08 tex:107934 mv:10200 misc:1434 imb:82 pmb:846 smb:422 d:- ref:0 ; in:9964 out:9964 type:P dur:82000000 cpbdur:82000000 q:25.14 tex:112605 mv:10887 misc:1412 imb:104 pmb:843 smb:403 d:- ref:0 ; in:9965 out:9965 type:P dur:82000000 cpbdur:82000000 q:25.26 tex:115973 mv:10827 misc:1432 imb:118 pmb:851 smb:381 d:- ref:0 ; in:9966 out:9966 type:P dur:82000000 cpbdur:82000000 q:25.34 tex:121074 mv:10545 misc:1405 imb:86 pmb:831 smb:433 d:- ref:0 ; in:9967 out:9967 type:P dur:82000000 cpbdur:82000000 q:25.35 tex:115946 mv:11081 misc:1405 imb:106 pmb:865 smb:379 d:- ref:0 ; in:9968 out:9968 type:P dur:82000000 cpbdur:82000000 q:25.34 tex:118354 mv:10830 misc:1408 imb:94 pmb:842 smb:414 d:- ref:0 ; in:9969 out:9969 type:P dur:82000000 cpbdur:82000000 q:25.27 tex:115303 mv:10612 misc:1373 imb:81 pmb:844 smb:425 d:- ref:0 ; in:9970 out:9970 type:P dur:82000000 cpbdur:82000000 q:25.37 tex:119568 mv:10837 misc:1411 imb:96 pmb:841 smb:413 d:- ref:0 ; in:9971 out:9971 type:P dur:82000000 cpbdur:82000000 q:25.45 tex:123841 mv:10817 misc:1390 imb:98 pmb:837 smb:415 d:- ref:0 ; in:9972 out:9972 type:P dur:82000000 cpbdur:82000000 q:25.34 tex:116800 mv:10041 misc:1391 imb:103 pmb:775 smb:472 d:- ref:0 ; in:9973 out:9973 type:P dur:82000000 cpbdur:82000000 q:25.34 tex:117508 mv:10538 misc:1410 imb:115 pmb:846 smb:389 d:- ref:0 ; in:9974 out:9974 type:P dur:82000000 cpbdur:82000000 q:25.33 tex:118437 mv:10760 misc:1419 imb:109 pmb:836 smb:405 d:- ref:0 ; in:9975 out:9975 type:P dur:82000000 cpbdur:82000000 q:25.33 tex:116673 mv:10623 misc:1416 imb:132 pmb:843 smb:375 d:- ref:0 ; in:9976 out:9976 type:P dur:82000000 cpbdur:82000000 q:25.16 tex:106451 mv:10355 misc:1410 imb:89 pmb:793 smb:468 d:- ref:0 ; in:9977 out:9977 type:P dur:82000000 cpbdur:82000000 q:25.20 tex:112533 mv:10064 misc:1427 imb:116 pmb:820 smb:414 d:- ref:0 ; in:9978 out:9978 type:P dur:82000000 cpbdur:82000000 q:25.24 tex:114467 mv:9904 misc:1389 imb:99 pmb:786 smb:465 d:- ref:0 ; in:9979 out:9979 type:P dur:82000000 cpbdur:82000000 q:25.26 tex:114715 mv:10185 misc:1428 imb:111 pmb:815 smb:424 d:- ref:0 ; in:9980 out:9980 type:P dur:82000000 cpbdur:82000000 q:25.24 tex:114622 mv:9737 misc:1409 imb:109 pmb:799 smb:442 d:- ref:0 ; in:9981 out:9981 type:P dur:82000000 cpbdur:82000000 q:25.14 tex:111397 mv:9286 misc:1405 imb:93 pmb:786 smb:471 d:- ref:0 ; in:9982 out:9982 type:P dur:82000000 cpbdur:82000000 q:25.20 tex:114570 mv:9673 misc:1397 imb:88 pmb:797 smb:465 d:- ref:0 ; in:9983 out:9983 type:P dur:82000000 cpbdur:82000000 q:25.23 tex:116228 mv:9844 misc:1400 imb:108 pmb:784 smb:458 d:- ref:0 ; in:9984 out:9984 type:P dur:82000000 cpbdur:82000000 q:25.29 tex:116873 mv:10123 misc:1420 imb:119 pmb:803 smb:428 d:- ref:0 ; in:9985 out:9985 type:P dur:82000000 cpbdur:82000000 q:25.12 tex:105071 mv:8915 misc:1454 imb:93 pmb:747 smb:510 d:- ref:0 ; in:9986 out:9986 type:P dur:82000000 cpbdur:82000000 q:25.06 tex:106424 mv:9546 misc:1422 imb:97 pmb:780 smb:473 d:- ref:0 ; in:9987 out:9987 type:P dur:82000000 cpbdur:82000000 q:24.92 tex:101101 mv:9474 misc:1425 imb:113 pmb:760 smb:477 d:- ref:0 ; in:9988 out:9988 type:P dur:82000000 cpbdur:82000000 q:24.74 tex:96165 mv:8827 misc:1424 imb:94 pmb:735 smb:521 d:- ref:0 ; in:9989 out:9989 type:P dur:82000000 cpbdur:82000000 q:24.70 tex:100017 mv:9324 misc:1443 imb:124 pmb:764 smb:462 d:- ref:0 ; in:9990 out:9990 type:P dur:82000000 cpbdur:82000000 q:24.76 tex:105258 mv:9704 misc:1422 imb:111 pmb:834 smb:405 d:- ref:0 ; in:9991 out:9991 type:P dur:82000000 cpbdur:82000000 q:24.57 tex:95135 mv:9081 misc:1440 imb:75 pmb:801 smb:474 d:- ref:0 ; in:9992 out:9992 type:P dur:82000000 cpbdur:82000000 q:24.61 tex:95952 mv:8311 misc:1385 imb:61 pmb:701 smb:588 d:- ref:0 ; in:9993 out:9993 type:P dur:82000000 cpbdur:82000000 q:24.49 tex:110078 mv:8691 misc:1455 imb:88 pmb:815 smb:447 d:- ref:0 ; in:9994 out:9994 type:P dur:82000000 cpbdur:82000000 q:24.25 tex:93749 mv:6777 misc:1386 imb:32 pmb:685 smb:633 d:- ref:0 ; in:9995 out:9995 type:P dur:82000000 cpbdur:82000000 q:24.18 tex:90750 mv:6153 misc:1249 imb:35 pmb:563 smb:752 d:- ref:0 ; in:9996 out:9996 type:P dur:82000000 cpbdur:82000000 q:24.17 tex:97606 mv:6659 misc:1271 imb:33 pmb:623 smb:694 d:- ref:0 ; in:9997 out:9997 type:P dur:82000000 cpbdur:82000000 q:24.04 tex:88336 mv:6039 misc:1233 imb:34 pmb:569 smb:747 d:- ref:0 ; in:9998 out:9998 type:P dur:82000000 cpbdur:82000000 q:24.20 tex:101825 mv:6736 misc:1199 imb:53 pmb:564 smb:733 d:- ref:0 ; in:9999 out:9999 type:P dur:82000000 cpbdur:82000000 q:24.08 tex:89190 mv:6227 misc:1079 imb:32 pmb:507 smb:811 d:- ref:0 ; in:10000 out:10000 type:I dur:82000000 cpbdur:82000000 q:21.85 tex:435849 mv:14002 misc:373 imb:1350 pmb:0 smb:0 d:- ref:; tests/keyframe/empty.txt0000664000175000017500000000000014741067256014714 0ustar aniolanioltests/keyframe/garbage.txt0000664000175000017500000000006714741067256015163 0ustar aniolaniolEXPECT_THROW(Load("data/keyframe/garbage.txt"), Error);tests/keyframe/aegi.txt0000664000175000017500000000143714741067256014502 0ustar aniolaniol# keyframe format v1 fps 25.000000 0 250 500 750 1000 1250 1500 1750 2000 2250 2500 2750 3000 3250 3500 3750 4000 4250 4500 4750 5000 5250 5500 5750 6000 6250 6500 6750 7000 7250 7500 7750 8000 8250 8500 8750 9000 9250 9500 9750 10000 10250 10500 10750 11000 11250 11500 11750 12000 12250 12500 12750 13000 13250 13500 13750 14000 14250 14500 14750 15000 15250 15500 15750 16000 16250 16500 16750 17000 17250 17500 17750 18000 18250 18500 18750 19000 19250 19500 19750 20000 20250 20500 20750 21000 21250 21500 21750 22000 22250 22500 22750 23000 23250 23500 23750 24000 24250 24500 24750 25000 25250 25500 25750 26000 26250 26500 26750 27000 27250 27500 27750 28000 28250 28500 28750 29000 29250 29500 29750 30000 30250 30500 30750 31000 31250 31500 31750 32000 32250 32500 32750 33000 33250 33500 tests/vfr/0000775000175000017500000000000014741067256012021 5ustar aniolanioltests/vfr/v1_negative_start_of_range.txt0000664000175000017500000000005714741067256020051 0ustar aniolaniol# timecode format v1 Assume 29.970030 -10,10,25tests/vfr/v1_float_frame_number.txt0000664000175000017500000000006114741067256017014 0ustar aniolaniol# timecode format v1 Assume 29.970030 0.0,10.0,25tests/vfr/v1_whitespace.txt0000664000175000017500000000006314741067256015323 0ustar aniolaniol# timecode format v1 Assume 29.970030 0, 10 , 25 tests/vfr/v2_mode5.txt0000664000175000017500000100062314741067256014204 0ustar aniolaniol# timecode format v2 0 33 67 100 133 167 200 234 267 300 334 375 417 459 500 542 584 626 667 709 751 792 834 876 918 959 1001 1043 1084 1126 1168 1210 1251 1293 1335 1376 1418 1460 1501 1543 1585 1627 1668 1710 1752 1793 1835 1877 1919 1960 2002 2044 2085 2127 2169 2211 2252 2294 2336 2377 2419 2461 2502 2544 2586 2628 2669 2711 2753 2794 2836 2878 2920 2961 3003 3045 3086 3128 3170 3212 3253 3295 3337 3378 3420 3462 3503 3545 3587 3629 3670 3712 3754 3795 3837 3871 3904 3937 3971 4004 4046 4087 4129 4171 4213 4254 4296 4338 4379 4421 4463 4504 4546 4588 4630 4671 4713 4755 4796 4838 4880 4922 4963 5005 5047 5088 5130 5172 5214 5255 5297 5339 5380 5422 5464 5505 5547 5589 5631 5672 5714 5756 5797 5839 5881 5923 5964 6006 6039 6073 6106 6139 6173 6206 6240 6273 6306 6340 6381 6423 6465 6506 6548 6590 6632 6673 6707 6740 6773 6807 6840 6874 6907 6940 6974 7007 7049 7090 7132 7174 7207 7241 7274 7307 7341 7374 7407 7441 7474 7507 7541 7574 7608 7641 7674 7708 7741 7774 7808 7841 7875 7908 7941 7975 8008 8041 8075 8108 8141 8175 8208 8242 8275 8308 8342 8375 8408 8442 8475 8508 8550 8592 8634 8675 8717 8759 8800 8842 8884 8926 8967 9009 9051 9092 9134 9176 9218 9259 9301 9343 9376 9409 9443 9476 9509 9543 9576 9610 9643 9676 9710 9743 9776 9810 9843 9877 9910 9943 9977 10010 10043 10077 10110 10143 10177 10210 10244 10277 10310 10344 10377 10410 10444 10477 10510 10544 10577 10611 10644 10677 10711 10744 10777 10811 10844 10878 10911 10944 10978 11011 11044 11078 11111 11144 11178 11211 11245 11278 11311 11345 11378 11411 11445 11478 11511 11545 11578 11612 11645 11678 11712 11745 11778 11812 11845 11879 11912 11945 11979 12012 12045 12079 12112 12145 12179 12212 12246 12279 12312 12346 12387 12429 12471 12512 12554 12596 12638 12679 12721 12763 12804 12846 12880 12913 12946 12980 13013 13046 13080 13113 13146 13180 13213 13247 13280 13313 13347 13380 13413 13447 13480 13513 13547 13580 13614 13647 13680 13714 13747 13780 13814 13847 13881 13914 13947 13981 14014 14047 14081 14114 14147 14181 14214 14248 14281 14314 14348 14381 14414 14448 14481 14514 14548 14581 14615 14648 14681 14715 14748 14781 14815 14848 14890 14932 14973 15015 15057 15098 15140 15182 15224 15265 15307 15349 15390 15432 15474 15515 15557 15599 15641 15682 15724 15766 15807 15849 15883 15916 15949 15983 16016 16049 16083 16116 16149 16183 16216 16250 16283 16316 16350 16383 16416 16450 16483 16516 16550 16583 16617 16650 16683 16717 16750 16783 16817 16850 16892 16934 16975 17017 17059 17100 17142 17184 17226 17267 17309 17351 17384 17417 17451 17484 17517 17551 17584 17618 17651 17684 17718 17751 17784 17818 17851 17885 17918 17951 17985 18018 18051 18085 18118 18151 18185 18218 18252 18285 18318 18352 18385 18418 18452 18485 18518 18552 18585 18619 18652 18685 18719 18752 18785 18819 18852 18886 18919 18952 18986 19019 19052 19086 19119 19152 19186 19219 19253 19286 19319 19353 19386 19419 19453 19486 19519 19561 19603 19645 19686 19728 19770 19811 19853 19895 19937 19978 20020 20053 20087 20120 20153 20187 20220 20254 20287 20320 20354 20387 20420 20454 20487 20520 20554 20587 20621 20654 20687 20721 20754 20787 20821 20854 20896 20938 20979 21021 21063 21104 21146 21188 21230 21271 21313 21355 21396 21438 21480 21521 21555 21588 21622 21655 21688 21722 21755 21788 21822 21855 21889 21922 21955 21989 22022 22055 22089 22122 22155 22189 22231 22272 22314 22356 22397 22439 22481 22522 22564 22606 22648 22689 22723 22756 22789 22823 22856 22890 22923 22956 22990 23023 23056 23090 23123 23156 23190 23223 23257 23290 23323 23357 23390 23423 23457 23490 23523 23557 23590 23624 23657 23690 23732 23774 23815 23857 23899 23941 23982 24024 24066 24107 24149 24191 24224 24258 24291 24324 24358 24399 24441 24483 24524 24566 24608 24650 24691 24733 24775 24816 24858 24900 24942 24983 25025 25067 25108 25150 25192 25225 25259 25292 25325 25359 25392 25425 25459 25492 25525 25559 25592 25626 25659 25692 25726 25759 25792 25826 25859 25893 25926 25959 25993 26026 26059 26093 26126 26159 26193 26235 26276 26318 26360 26401 26443 26485 26526 26560 26593 26627 26660 26693 26727 26760 26793 26827 26860 26894 26927 26960 26994 27027 27060 27094 27127 27160 27194 27227 27261 27294 27327 27361 27402 27444 27486 27527 27569 27611 27653 27694 27736 27778 27819 27861 27903 27945 27986 28028 28061 28095 28128 28161 28195 28237 28278 28320 28362 28403 28445 28487 28528 28562 28595 28629 28662 28695 28729 28762 28795 28829 28862 28896 28929 28962 28996 29029 29062 29096 29129 29162 29196 29229 29263 29296 29329 29363 29404 29446 29488 29529 29571 29613 29655 29696 29730 29763 29796 29830 29863 29897 29930 29963 29997 30030 30063 30097 30130 30163 30197 30239 30280 30322 30364 30397 30430 30464 30497 30530 30564 30597 30631 30664 30697 30731 30764 30797 30831 30864 30898 30931 30964 30998 31031 31064 31098 31131 31164 31198 31231 31265 31298 31331 31365 31398 31431 31465 31498 31531 31565 31598 31632 31665 31698 31732 31765 31798 31832 31865 31899 31932 31965 31999 32032 32065 32099 32132 32165 32199 32241 32282 32324 32366 32407 32449 32491 32532 32566 32599 32633 32666 32699 32733 32766 32799 32833 32866 32900 32933 32966 33000 33033 33066 33100 33133 33166 33200 33233 33267 33300 33333 33367 33400 33433 33467 33500 33533 33567 33600 33634 33667 33700 33742 33784 33825 33867 33909 33951 33992 34034 34076 34117 34159 34201 34243 34284 34326 34368 34409 34451 34493 34534 34568 34601 34635 34668 34701 34743 34785 34826 34868 34910 34952 34993 35035 35077 35118 35160 35202 35235 35269 35302 35335 35369 35402 35435 35469 35502 35535 35569 35602 35636 35669 35702 35736 35769 35802 35836 35869 35903 35936 35969 36003 36036 36069 36103 36136 36169 36203 36236 36270 36303 36336 36370 36403 36436 36470 36503 36536 36570 36603 36637 36670 36703 36737 36770 36803 36837 36870 36912 36954 36995 37037 37079 37120 37162 37204 37246 37287 37329 37371 37412 37454 37496 37537 37571 37604 37638 37671 37704 37738 37771 37804 37838 37871 37905 37938 37971 38005 38038 38071 38105 38138 38171 38205 38238 38272 38305 38338 38372 38405 38438 38472 38505 38538 38572 38605 38639 38672 38705 38739 38772 38805 38839 38872 38906 38939 38972 39006 39039 39072 39106 39139 39172 39206 39239 39273 39306 39339 39373 39406 39439 39473 39506 39539 39573 39606 39640 39673 39706 39740 39773 39806 39840 39873 39907 39940 39973 40007 40040 40073 40107 40140 40173 40207 40240 40274 40307 40340 40374 40415 40457 40499 40540 40582 40624 40666 40707 40749 40791 40832 40874 40916 40958 40999 41041 41074 41108 41141 41174 41208 41241 41275 41308 41341 41375 41408 41441 41475 41508 41541 41583 41625 41667 41708 41750 41792 41833 41875 41917 41959 42000 42042 42075 42109 42142 42175 42209 42242 42276 42309 42342 42376 42409 42442 42476 42509 42542 42576 42609 42643 42676 42709 42743 42776 42809 42843 42876 42918 42960 43001 43043 43085 43126 43168 43210 43252 43293 43335 43377 43418 43460 43502 43543 43585 43627 43669 43710 43752 43794 43835 43877 43911 43944 43977 44011 44044 44077 44111 44144 44177 44211 44244 44278 44311 44344 44378 44411 44444 44478 44511 44544 44578 44611 44645 44678 44711 44745 44778 44811 44845 44878 44912 44945 44978 45012 45045 45078 45112 45145 45178 45212 45245 45279 45312 45345 45379 45412 45445 45479 45512 45545 45587 45629 45671 45712 45754 45796 45837 45879 45921 45963 46004 46046 46088 46129 46171 46213 46246 46280 46313 46346 46380 46413 46446 46480 46513 46546 46580 46613 46647 46680 46713 46747 46780 46813 46847 46880 46922 46964 47005 47047 47089 47130 47172 47214 47256 47297 47339 47381 47422 47464 47506 47547 47581 47614 47648 47681 47714 47748 47781 47814 47848 47881 47923 47965 48006 48048 48081 48115 48148 48181 48215 48248 48282 48315 48348 48382 48415 48448 48482 48515 48548 48582 48615 48649 48682 48715 48749 48782 48815 48849 48882 48916 48949 48982 49016 49049 49082 49116 49149 49182 49216 49249 49283 49316 49349 49383 49424 49466 49508 49549 49591 49633 49675 49716 49758 49800 49841 49883 49925 49967 50008 50050 50092 50133 50175 50217 50250 50284 50317 50350 50384 50417 50450 50484 50517 50550 50584 50617 50651 50684 50717 50751 50784 50817 50851 50884 50926 50968 51009 51051 51093 51134 51176 51218 51251 51285 51318 51351 51385 51418 51451 51485 51518 51551 51585 51618 51652 51685 51718 51752 51785 51818 51852 51885 51919 51952 51985 52019 52052 52085 52119 52152 52185 52219 52252 52286 52319 52352 52386 52419 52452 52486 52519 52552 52586 52619 52653 52686 52719 52761 52803 52844 52886 52928 52970 53011 53053 53095 53136 53178 53220 53262 53303 53345 53387 53420 53453 53487 53520 53553 53587 53620 53654 53687 53720 53754 53787 53820 53854 53887 53921 53954 53987 54021 54054 54096 54137 54179 54221 54254 54288 54321 54354 54388 54421 54454 54488 54521 54554 54588 54621 54655 54688 54721 54755 54788 54821 54855 54888 54922 54955 54988 55022 55055 55097 55138 55180 55222 55264 55305 55347 55389 55430 55472 55514 55555 55589 55622 55656 55689 55722 55756 55789 55822 55856 55889 55923 55956 55989 56023 56056 56089 56123 56156 56189 56223 56256 56290 56323 56356 56390 56423 56456 56490 56523 56556 56590 56623 56657 56690 56723 56757 56790 56823 56857 56890 56932 56974 57015 57057 57099 57140 57182 57224 57257 57291 57324 57357 57391 57424 57457 57491 57524 57557 57591 57624 57658 57691 57724 57758 57791 57824 57858 57891 57925 57958 57991 58025 58058 58100 58141 58183 58225 58258 58292 58325 58358 58392 58425 58458 58492 58525 58558 58600 58642 58684 58725 58767 58809 58850 58892 58934 58976 59017 59059 59101 59142 59184 59226 59268 59309 59351 59393 59434 59476 59518 59559 59601 59643 59685 59726 59768 59810 59851 59893 59935 59977 60018 60060 60093 60127 60160 60193 60227 60260 60294 60327 60360 60394 60427 60460 60494 60527 60560 60594 60627 60661 60694 60727 60761 60794 60827 60861 60894 60928 60961 60994 61028 61061 61094 61128 61161 61194 61228 61261 61295 61328 61361 61395 61428 61461 61495 61528 61561 61595 61628 61662 61695 61728 61762 61795 61828 61862 61895 61929 61962 61995 62029 62062 62095 62129 62162 62195 62229 62262 62296 62329 62362 62396 62429 62462 62496 62529 62562 62596 62629 62663 62696 62729 62763 62796 62829 62863 62896 62930 62963 62996 63030 63063 63096 63130 63163 63196 63230 63263 63297 63330 63363 63397 63430 63463 63497 63530 63563 63597 63630 63664 63697 63730 63764 63797 63830 63864 63897 63931 63964 63997 64031 64064 64097 64131 64164 64197 64231 64264 64298 64331 64364 64398 64431 64464 64498 64531 64564 64598 64631 64665 64698 64731 64765 64798 64831 64865 64898 64932 64965 64998 65032 65065 65098 65132 65165 65198 65232 65265 65299 65332 65365 65399 65432 65465 65499 65532 65565 65599 65632 65666 65699 65732 65766 65799 65832 65866 65899 65933 65966 65999 66033 66066 66099 66133 66166 66199 66233 66266 66300 66333 66366 66400 66433 66466 66500 66533 66566 66600 66633 66667 66700 66733 66767 66800 66833 66867 66900 66934 66967 67000 67034 67067 67100 67134 67167 67200 67234 67267 67301 67334 67367 67401 67434 67467 67501 67534 67567 67601 67634 67668 67701 67734 67768 67801 67834 67868 67901 67935 67968 68001 68035 68068 68101 68135 68168 68201 68235 68268 68302 68335 68368 68402 68435 68468 68502 68535 68568 68602 68635 68669 68702 68735 68769 68802 68835 68869 68902 68936 68969 69002 69036 69069 69102 69136 69169 69202 69236 69269 69303 69336 69369 69403 69436 69469 69503 69536 69569 69603 69636 69670 69703 69736 69770 69803 69836 69870 69903 69937 69970 70003 70037 70070 70103 70137 70170 70203 70237 70270 70304 70337 70370 70404 70437 70470 70504 70537 70570 70604 70637 70671 70704 70737 70771 70804 70837 70871 70904 70938 70971 71004 71038 71071 71104 71138 71171 71204 71238 71271 71305 71338 71371 71405 71438 71471 71505 71538 71571 71605 71638 71672 71705 71738 71772 71805 71838 71872 71905 71939 71972 72005 72039 72072 72105 72139 72172 72205 72239 72272 72306 72339 72372 72406 72439 72472 72506 72539 72572 72606 72639 72673 72706 72739 72773 72806 72839 72873 72906 72940 72973 73006 73040 73073 73106 73140 73173 73206 73240 73273 73307 73340 73373 73407 73440 73473 73507 73540 73573 73607 73640 73674 73707 73740 73774 73807 73840 73874 73907 73941 73974 74007 74041 74074 74107 74141 74174 74207 74241 74274 74308 74341 74374 74408 74441 74474 74508 74541 74574 74608 74641 74675 74708 74741 74775 74808 74841 74875 74908 74942 74975 75008 75042 75075 75108 75142 75175 75208 75242 75275 75309 75342 75375 75409 75442 75475 75509 75542 75575 75609 75642 75676 75709 75742 75776 75809 75842 75876 75909 75943 75976 76009 76043 76076 76109 76143 76176 76209 76243 76276 76310 76343 76376 76410 76443 76476 76510 76543 76576 76610 76643 76677 76710 76743 76777 76810 76843 76877 76910 76944 76977 77010 77044 77077 77110 77144 77177 77210 77244 77277 77311 77344 77377 77411 77444 77477 77511 77544 77577 77611 77644 77678 77711 77744 77778 77811 77844 77878 77911 77945 77978 78011 78045 78078 78111 78145 78178 78211 78245 78278 78312 78345 78378 78412 78445 78478 78512 78545 78578 78612 78645 78679 78712 78745 78779 78812 78845 78879 78912 78946 78979 79012 79046 79079 79112 79146 79179 79212 79246 79279 79313 79346 79379 79413 79446 79479 79513 79546 79579 79613 79646 79680 79713 79746 79780 79813 79846 79880 79913 79947 79980 80013 80047 80080 80113 80147 80180 80213 80247 80280 80314 80347 80380 80414 80447 80480 80514 80547 80580 80614 80647 80681 80714 80747 80781 80814 80847 80881 80914 80948 80981 81014 81048 81081 81114 81148 81181 81214 81248 81281 81315 81348 81381 81415 81448 81481 81515 81548 81581 81615 81648 81682 81715 81748 81782 81815 81848 81882 81915 81949 81982 82015 82049 82082 82115 82149 82182 82215 82249 82282 82316 82349 82382 82416 82449 82482 82516 82549 82582 82616 82649 82683 82716 82749 82783 82816 82849 82883 82916 82950 82983 83016 83050 83083 83116 83150 83183 83216 83250 83283 83317 83350 83383 83417 83450 83483 83517 83550 83583 83617 83650 83684 83717 83750 83784 83817 83850 83884 83917 83951 83984 84017 84051 84084 84117 84151 84184 84217 84251 84284 84318 84351 84384 84418 84451 84484 84518 84551 84584 84618 84651 84685 84718 84751 84785 84818 84851 84885 84918 84952 84985 85018 85052 85085 85118 85152 85185 85218 85252 85285 85319 85352 85385 85419 85452 85485 85519 85552 85585 85619 85652 85686 85719 85752 85786 85819 85852 85886 85919 85953 85986 86019 86053 86086 86119 86153 86186 86219 86253 86286 86320 86353 86386 86420 86453 86486 86520 86553 86586 86620 86653 86687 86720 86753 86787 86820 86853 86887 86920 86954 86987 87020 87054 87087 87120 87154 87187 87220 87254 87287 87321 87354 87387 87421 87454 87487 87521 87554 87587 87621 87654 87688 87721 87754 87788 87821 87854 87888 87921 87955 87988 88021 88055 88088 88121 88155 88188 88221 88255 88288 88322 88355 88388 88422 88455 88488 88522 88555 88588 88622 88655 88689 88722 88755 88789 88822 88855 88889 88922 88956 88989 89022 89056 89089 89122 89156 89189 89222 89256 89289 89323 89356 89389 89423 89456 89489 89523 89556 89589 89623 89656 89690 89723 89756 89790 89823 89856 89890 89923 89957 89990 90023 90057 90090 90123 90157 90190 90223 90257 90290 90324 90357 90390 90424 90457 90490 90524 90557 90590 90624 90657 90691 90724 90757 90791 90824 90857 90891 90924 90958 90991 91024 91058 91091 91124 91158 91191 91224 91258 91291 91325 91358 91391 91425 91458 91491 91525 91558 91591 91625 91658 91692 91725 91758 91792 91825 91858 91892 91925 91959 91992 92025 92059 92092 92125 92159 92192 92225 92259 92292 92326 92359 92392 92426 92459 92492 92526 92559 92592 92626 92659 92693 92726 92759 92793 92826 92859 92893 92926 92960 92993 93026 93060 93093 93126 93160 93193 93226 93260 93293 93327 93360 93393 93427 93460 93493 93527 93560 93593 93627 93660 93694 93727 93760 93794 93827 93860 93894 93927 93961 93994 94027 94061 94094 94127 94161 94194 94227 94261 94294 94328 94361 94394 94428 94461 94494 94528 94561 94594 94628 94661 94695 94728 94761 94795 94828 94861 94895 94928 94962 94995 95028 95062 95095 95128 95162 95195 95228 95262 95295 95329 95362 95395 95429 95462 95495 95529 95562 95595 95629 95662 95696 95729 95762 95796 95829 95862 95896 95929 95963 95996 96029 96063 96096 96129 96163 96196 96229 96263 96296 96330 96363 96396 96430 96463 96496 96530 96563 96596 96630 96663 96697 96730 96763 96797 96830 96863 96897 96930 96964 96997 97030 97064 97097 97130 97164 97197 97230 97264 97297 97331 97364 97397 97431 97464 97497 97531 97564 97597 97631 97664 97698 97731 97764 97798 97831 97864 97898 97931 97965 97998 98031 98065 98098 98131 98165 98198 98231 98265 98298 98332 98365 98398 98432 98465 98498 98532 98565 98598 98632 98665 98699 98732 98765 98799 98832 98865 98899 98932 98966 98999 99032 99066 99099 99132 99166 99199 99232 99266 99299 99333 99366 99399 99433 99466 99499 99533 99566 99599 99633 99666 99700 99733 99766 99800 99833 99866 99900 99933 99967 100000 100033 100067 100100 100133 100167 100200 100233 100267 100300 100334 100367 100400 100434 100467 100500 100534 100567 100600 100634 100667 100701 100734 100767 100801 100834 100867 100901 100934 100968 101001 101034 101068 101101 101134 101168 101201 101234 101268 101301 101335 101368 101401 101435 101468 101501 101535 101568 101601 101635 101668 101702 101735 101768 101802 101835 101868 101902 101935 101969 102002 102035 102069 102102 102135 102169 102202 102235 102269 102302 102336 102369 102402 102436 102469 102502 102536 102569 102602 102636 102669 102703 102736 102769 102803 102836 102869 102903 102936 102970 103003 103036 103070 103103 103136 103170 103203 103236 103270 103303 103337 103370 103403 103437 103470 103503 103537 103570 103603 103637 103670 103704 103737 103770 103804 103837 103870 103904 103937 103971 104004 104037 104071 104104 104137 104171 104204 104237 104271 104304 104338 104371 104404 104438 104471 104504 104538 104571 104604 104638 104671 104705 104738 104771 104805 104838 104871 104905 104938 104972 105005 105038 105072 105105 105138 105172 105205 105238 105272 105305 105339 105372 105405 105439 105472 105505 105539 105572 105605 105639 105672 105706 105739 105772 105806 105839 105872 105906 105939 105973 106006 106039 106073 106106 106139 106173 106206 106239 106273 106306 106340 106373 106406 106440 106473 106506 106540 106573 106606 106640 106673 106707 106740 106773 106807 106840 106873 106907 106940 106974 107007 107040 107074 107107 107140 107174 107207 107240 107274 107307 107341 107374 107407 107441 107474 107507 107541 107574 107607 107641 107674 107708 107741 107774 107808 107841 107874 107908 107941 107975 108008 108041 108075 108108 108141 108175 108208 108241 108275 108308 108342 108375 108408 108442 108475 108508 108542 108575 108608 108650 108692 108734 108775 108817 108859 108900 108942 108984 109026 109067 109109 109151 109192 109234 109276 109318 109359 109401 109443 109484 109526 109568 109609 109651 109693 109735 109776 109818 109860 109901 109943 109977 110010 110043 110077 110110 110143 110177 110210 110243 110277 110310 110344 110377 110410 110444 110477 110510 110544 110577 110610 110644 110677 110711 110744 110777 110811 110844 110877 110911 110944 110978 111011 111044 111078 111111 111153 111194 111236 111278 111320 111361 111403 111445 111486 111528 111570 111611 111653 111695 111737 111778 111820 111862 111903 111945 111987 112029 112070 112112 112154 112195 112237 112279 112321 112362 112404 112446 112479 112512 112546 112579 112612 112668 112724 112779 112813 112846 112879 112913 112946 112980 113013 113046 113080 113113 113146 113180 113213 113246 113280 113313 113347 113380 113413 113447 113480 113513 113547 113580 113613 113647 113680 113714 113747 113780 113814 113847 113880 113914 113947 113981 114014 114047 114081 114114 114147 114181 114214 114247 114281 114314 114348 114381 114414 114448 114481 114514 114548 114581 114614 114648 114681 114715 114748 114781 114815 114848 114881 114915 114948 114982 115015 115048 115082 115115 115148 115182 115215 115248 115282 115315 115349 115382 115415 115449 115482 115515 115549 115582 115615 115649 115682 115716 115749 115782 115816 115849 115882 115916 115949 115983 116016 116049 116083 116116 116149 116183 116216 116249 116283 116316 116350 116383 116416 116450 116483 116516 116550 116583 116616 116650 116683 116717 116750 116783 116817 116850 116883 116917 116950 116984 117017 117050 117084 117117 117150 117184 117217 117250 117284 117317 117351 117384 117417 117451 117484 117517 117551 117584 117617 117651 117684 117718 117751 117784 117818 117851 117884 117918 117951 117985 118018 118051 118085 118118 118151 118185 118218 118251 118285 118318 118352 118385 118418 118452 118485 118518 118552 118585 118618 118652 118685 118719 118752 118785 118819 118852 118885 118919 118952 118986 119019 119052 119086 119119 119152 119186 119219 119252 119286 119319 119353 119386 119419 119453 119486 119519 119553 119586 119619 119653 119686 119720 119753 119786 119820 119853 119886 119920 119953 119987 120020 120053 120087 120120 120153 120187 120220 120253 120287 120320 120354 120387 120420 120454 120487 120520 120554 120587 120620 120654 120687 120721 120754 120787 120821 120854 120887 120921 120954 120988 121021 121054 121088 121121 121154 121188 121221 121254 121288 121321 121355 121388 121421 121455 121488 121521 121555 121588 121621 121655 121688 121722 121755 121788 121822 121855 121888 121922 121955 121989 122022 122055 122089 122122 122155 122189 122222 122255 122289 122322 122356 122389 122422 122456 122489 122522 122556 122589 122622 122656 122689 122723 122756 122789 122823 122856 122889 122923 122956 122990 123023 123056 123090 123123 123156 123190 123223 123256 123290 123323 123357 123390 123423 123457 123490 123523 123557 123590 123623 123657 123690 123724 123757 123790 123832 123874 123915 123957 123999 124041 124082 124124 124157 124191 124224 124257 124291 124333 124374 124416 124458 124491 124524 124558 124591 124624 124680 124736 124791 124825 124858 124891 124925 124958 124992 125025 125058 125092 125125 125158 125192 125225 125258 125292 125325 125359 125392 125425 125459 125492 125525 125559 125592 125625 125659 125692 125726 125759 125792 125826 125859 125892 125926 125959 125993 126026 126059 126093 126126 126159 126193 126226 126259 126293 126326 126360 126393 126426 126460 126493 126526 126560 126593 126626 126668 126710 126752 126793 126835 126877 126918 126960 126994 127027 127060 127094 127127 127160 127194 127227 127260 127294 127336 127377 127419 127461 127502 127544 127586 127627 127669 127711 127753 127794 127828 127861 127894 127928 127961 128003 128045 128086 128128 128170 128211 128253 128295 128337 128378 128420 128462 128495 128528 128562 128595 128628 128662 128695 128729 128762 128795 128837 128879 128920 128962 129004 129046 129087 129129 129171 129212 129254 129296 129338 129379 129421 129463 129504 129546 129588 129629 129671 129713 129755 129796 129838 129880 129921 129963 130005 130047 130088 130130 130172 130213 130255 130297 130339 130380 130422 130464 130505 130547 130589 130630 130672 130714 130756 130797 130839 130881 130922 130964 131006 131048 131089 131131 131173 131214 131256 131298 131340 131381 131423 131465 131506 131548 131590 131631 131673 131715 131757 131798 131840 131882 131923 131965 132007 132049 132090 132132 132165 132199 132232 132265 132299 132332 132366 132399 132432 132466 132499 132532 132566 132599 132632 132666 132699 132733 132766 132799 132833 132866 132899 132933 132966 133000 133033 133066 133100 133133 133166 133200 133233 133266 133300 133333 133367 133400 133433 133467 133508 133550 133592 133633 133667 133700 133734 133767 133800 133834 133867 133900 133934 133967 134009 134051 134092 134134 134176 134217 134259 134301 134334 134368 134401 134434 134468 134501 134534 134568 134601 134634 134668 134701 134735 134768 134801 134835 134868 134901 134935 134968 135002 135035 135068 135102 135135 135168 135202 135235 135268 135302 135335 135369 135402 135435 135469 135502 135535 135569 135602 135635 135669 135702 135736 135769 135802 135836 135869 135902 135936 135969 136003 136036 136069 136103 136136 136169 136203 136236 136269 136303 136336 136370 136403 136436 136470 136503 136536 136570 136603 136636 136670 136703 136737 136770 136803 136837 136870 136903 136937 136970 137004 137037 137070 137104 137137 137170 137204 137237 137270 137304 137337 137371 137404 137437 137471 137504 137537 137571 137604 137637 137671 137704 137738 137771 137804 137838 137871 137904 137938 137971 138005 138038 138071 138105 138138 138171 138205 138238 138271 138305 138338 138372 138405 138438 138472 138505 138538 138572 138605 138638 138672 138705 138739 138772 138805 138839 138872 138905 138939 138972 139006 139039 139072 139106 139139 139172 139206 139239 139272 139306 139339 139373 139406 139439 139473 139506 139539 139573 139606 139639 139673 139706 139740 139773 139806 139840 139873 139906 139940 139973 140007 140040 140073 140107 140140 140173 140207 140240 140273 140307 140340 140374 140407 140440 140474 140507 140540 140574 140607 140640 140674 140707 140741 140774 140807 140841 140874 140907 140941 140974 141008 141041 141074 141108 141141 141174 141208 141241 141274 141308 141341 141375 141408 141441 141475 141508 141541 141575 141608 141641 141675 141708 141742 141775 141808 141842 141875 141908 141942 141975 142009 142042 142075 142109 142142 142175 142209 142242 142275 142309 142342 142376 142409 142442 142476 142509 142542 142576 142609 142642 142676 142709 142743 142776 142809 142843 142876 142909 142943 142976 143010 143043 143076 143110 143143 143176 143210 143243 143276 143310 143343 143377 143410 143443 143477 143510 143543 143577 143610 143643 143677 143710 143744 143777 143810 143844 143877 143910 143944 143977 144011 144044 144077 144111 144144 144177 144211 144244 144277 144311 144344 144378 144411 144444 144478 144511 144544 144578 144611 144644 144678 144711 144745 144778 144811 144845 144878 144911 144945 144978 145012 145045 145078 145112 145145 145178 145212 145245 145278 145312 145345 145379 145412 145445 145479 145512 145545 145579 145612 145645 145679 145712 145746 145779 145812 145846 145879 145912 145946 145979 146013 146046 146079 146113 146146 146179 146213 146246 146279 146313 146346 146380 146413 146446 146480 146513 146546 146580 146613 146646 146680 146713 146747 146780 146813 146847 146880 146913 146947 146980 147014 147047 147080 147114 147147 147180 147214 147247 147280 147314 147347 147381 147414 147447 147481 147514 147547 147581 147614 147647 147681 147714 147748 147781 147814 147856 147898 147939 147981 148023 148065 148106 148148 148190 148231 148273 148315 148357 148398 148440 148482 148523 148565 148607 148648 148690 148732 148774 148815 148857 148899 148940 148982 149024 149066 149107 149149 149191 149232 149274 149316 149358 149399 149441 149483 149524 149566 149608 149649 149691 149733 149775 149816 149858 149900 149941 149983 150025 150067 150108 150150 150192 150233 150275 150317 150359 150400 150442 150484 150525 150567 150609 150650 150692 150734 150776 150817 150859 150901 150942 150984 151026 151068 151109 151151 151193 151234 151276 151318 151360 151401 151443 151485 151526 151568 151610 151651 151693 151735 151777 151818 151860 151902 151943 151985 152027 152069 152110 152152 152194 152235 152277 152319 152361 152402 152444 152486 152527 152569 152611 152652 152694 152736 152778 152819 152861 152903 152944 152986 153028 153070 153111 153153 153195 153236 153278 153320 153362 153403 153445 153487 153528 153570 153612 153653 153695 153737 153779 153820 153862 153904 153945 153987 154029 154071 154112 154154 154196 154237 154279 154321 154363 154404 154446 154488 154529 154571 154613 154654 154696 154738 154780 154821 154855 154888 154921 154955 154988 155022 155055 155088 155122 155155 155197 155238 155280 155322 155364 155405 155447 155489 155530 155572 155614 155655 155697 155739 155781 155822 155864 155906 155947 155989 156031 156073 156114 156156 156198 156239 156281 156323 156356 156390 156423 156456 156490 156523 156556 156590 156623 156656 156690 156723 156757 156790 156823 156857 156890 156923 156957 156990 157024 157057 157090 157124 157157 157190 157224 157257 157290 157324 157357 157391 157424 157457 157491 157524 157557 157591 157624 157657 157691 157724 157758 157791 157824 157858 157891 157924 157958 157991 158025 158058 158091 158125 158158 158191 158225 158258 158291 158325 158358 158392 158425 158458 158492 158533 158575 158617 158658 158700 158742 158784 158825 158867 158909 158950 158992 159034 159076 159117 159159 159201 159242 159284 159326 159368 159409 159451 159493 159534 159576 159618 159659 159701 159743 159785 159826 159868 159910 159951 159993 160035 160077 160118 160160 160202 160243 160285 160327 160369 160410 160452 160494 160535 160577 160619 160660 160702 160744 160786 160827 160869 160911 160952 160994 161036 161078 161119 161161 161203 161244 161286 161328 161361 161395 161428 161461 161495 161528 161561 161595 161628 161661 161695 161728 161762 161795 161828 161862 161895 161928 161962 161995 162029 162062 162095 162129 162162 162195 162229 162262 162295 162329 162362 162396 162429 162462 162496 162529 162562 162596 162629 162662 162696 162729 162763 162796 162829 162863 162896 162929 162963 162996 163030 163063 163096 163130 163163 163205 163246 163288 163330 163372 163413 163455 163497 163538 163580 163622 163663 163705 163747 163789 163830 163872 163914 163955 163997 164039 164081 164122 164164 164206 164247 164289 164331 164373 164414 164456 164498 164539 164581 164623 164664 164706 164748 164790 164831 164873 164915 164956 164998 165040 165082 165123 165165 165207 165248 165290 165332 165374 165415 165457 165499 165540 165582 165624 165665 165707 165749 165791 165832 165874 165916 165957 165999 166041 166083 166124 166166 166208 166249 166291 166333 166375 166416 166458 166500 166541 166583 166625 166666 166708 166750 166792 166833 166875 166917 166958 167000 167042 167084 167125 167167 167209 167250 167292 167334 167376 167417 167459 167501 167542 167584 167626 167667 167709 167751 167793 167834 167876 167918 167959 168001 168043 168085 168126 168168 168210 168251 168293 168335 168377 168418 168460 168502 168543 168585 168627 168668 168710 168752 168794 168835 168877 168919 168960 169002 169044 169086 169127 169169 169211 169252 169294 169336 169378 169419 169461 169503 169544 169586 169628 169669 169711 169753 169795 169836 169878 169920 169961 170003 170045 170087 170128 170170 170212 170253 170295 170337 170379 170420 170462 170504 170545 170587 170629 170670 170712 170754 170796 170837 170879 170921 170962 171004 171046 171088 171129 171171 171213 171254 171296 171338 171380 171421 171463 171505 171546 171588 171630 171671 171713 171755 171797 171838 171880 171922 171963 172005 172047 172089 172130 172172 172214 172255 172297 172339 172381 172422 172464 172506 172547 172589 172631 172672 172714 172756 172798 172839 172881 172923 172964 173006 173040 173073 173106 173140 173173 173206 173240 173273 173306 173340 173373 173407 173440 173473 173507 173540 173573 173607 173640 173673 173707 173740 173774 173807 173840 173874 173907 173940 173974 174007 174041 174074 174107 174141 174174 174207 174241 174274 174307 174341 174374 174408 174441 174474 174508 174541 174574 174608 174641 174674 174708 174741 174775 174808 174841 174875 174908 174941 174975 175008 175042 175075 175108 175142 175175 175208 175242 175275 175308 175342 175384 175425 175467 175509 175550 175592 175634 175675 175717 175759 175801 175842 175884 175926 175967 176009 176051 176093 176134 176176 176218 176259 176301 176343 176385 176426 176468 176510 176551 176593 176635 176676 176718 176760 176802 176843 176885 176927 176968 177010 177052 177094 177135 177177 177219 177260 177302 177344 177386 177427 177469 177511 177552 177594 177636 177677 177719 177761 177803 177844 177886 177928 177969 178011 178053 178095 178136 178178 178220 178261 178303 178345 178387 178428 178470 178512 178553 178595 178637 178678 178720 178762 178804 178845 178887 178929 178970 179012 179054 179096 179137 179179 179221 179262 179304 179346 179388 179429 179471 179513 179554 179596 179638 179679 179721 179763 179805 179846 179888 179930 179971 180013 180055 180097 180138 180180 180222 180263 180305 180347 180389 180430 180472 180514 180555 180597 180639 180680 180722 180764 180806 180847 180889 180931 180972 181014 181056 181098 181139 181181 181223 181264 181306 181348 181390 181431 181473 181515 181556 181598 181640 181681 181723 181765 181807 181848 181890 181932 181973 182015 182057 182099 182140 182182 182224 182265 182307 182349 182391 182432 182474 182516 182557 182599 182641 182682 182724 182766 182808 182849 182891 182933 182974 183016 183058 183100 183141 183183 183225 183266 183308 183350 183392 183433 183475 183517 183558 183600 183642 183683 183725 183767 183809 183850 183892 183934 183975 184017 184059 184101 184142 184184 184226 184267 184309 184351 184393 184434 184476 184518 184559 184601 184643 184684 184726 184768 184810 184851 184893 184935 184976 185018 185060 185102 185143 185185 185227 185268 185310 185352 185394 185435 185477 185519 185560 185602 185644 185685 185727 185769 185811 185852 185894 185936 185977 186019 186061 186103 186144 186186 186228 186269 186311 186353 186395 186436 186478 186520 186561 186603 186645 186686 186728 186770 186812 186853 186895 186937 186978 187020 187062 187104 187145 187187 187229 187270 187312 187354 187396 187437 187479 187521 187562 187604 187646 187687 187729 187771 187813 187854 187896 187938 187979 188021 188063 188105 188146 188188 188230 188271 188313 188355 188397 188438 188480 188522 188563 188605 188647 188688 188730 188772 188814 188855 188897 188939 188980 189022 189064 189106 189147 189189 189231 189272 189314 189356 189398 189439 189481 189523 189564 189606 189648 189689 189731 189773 189815 189856 189898 189940 189981 190023 190065 190107 190148 190190 190232 190273 190315 190357 190399 190440 190482 190524 190565 190607 190649 190690 190732 190774 190816 190857 190899 190941 190982 191024 191066 191108 191149 191191 191233 191274 191316 191358 191400 191441 191483 191525 191566 191608 191650 191691 191733 191775 191817 191858 191900 191942 191983 192025 192067 192109 192150 192192 192234 192275 192317 192359 192401 192442 192484 192526 192567 192609 192651 192692 192734 192776 192818 192859 192901 192943 192984 193026 193068 193110 193151 193193 193235 193276 193318 193360 193402 193443 193485 193527 193568 193610 193652 193693 193735 193777 193819 193860 193902 193944 193985 194027 194069 194111 194152 194194 194236 194277 194319 194361 194403 194444 194486 194528 194569 194611 194653 194694 194728 194761 194795 194828 194861 194895 194928 194961 194995 195028 195070 195112 195153 195195 195237 195278 195320 195362 195404 195445 195487 195529 195570 195612 195654 195695 195737 195779 195821 195862 195904 195946 195987 196029 196071 196113 196154 196196 196238 196279 196321 196363 196405 196446 196488 196530 196571 196613 196655 196696 196738 196780 196822 196863 196905 196947 196988 197030 197072 197114 197155 197197 197239 197280 197322 197364 197406 197447 197489 197531 197572 197614 197656 197697 197739 197781 197823 197864 197906 197948 197989 198031 198073 198115 198156 198198 198240 198281 198323 198365 198407 198448 198490 198532 198573 198615 198657 198698 198740 198782 198824 198865 198907 198949 198990 199032 199074 199116 199157 199199 199241 199282 199324 199366 199408 199449 199491 199533 199574 199616 199658 199699 199741 199783 199825 199866 199908 199950 199991 200033 200075 200117 200158 200200 200242 200283 200325 200367 200400 200434 200467 200500 200534 200567 200600 200634 200667 200700 200734 200767 200801 200834 200867 200901 200934 200967 201001 201034 201068 201101 201134 201168 201201 201234 201268 201301 201334 201368 201401 201435 201468 201501 201535 201568 201601 201635 201668 201701 201743 201785 201827 201868 201910 201952 201993 202035 202077 202119 202160 202202 202244 202285 202327 202369 202411 202452 202494 202536 202577 202619 202661 202702 202744 202786 202828 202869 202911 202953 202994 203036 203078 203120 203161 203203 203236 203270 203303 203336 203370 203403 203437 203470 203503 203537 203578 203620 203662 203703 203745 203787 203829 203870 203912 203954 203995 204037 204079 204121 204162 204204 204246 204287 204329 204371 204413 204454 204496 204538 204579 204621 204663 204704 204746 204788 204830 204871 204913 204955 204996 205038 205080 205122 205163 205205 205247 205288 205330 205372 205414 205455 205497 205539 205580 205622 205664 205705 205739 205772 205806 205839 205872 205906 205939 205972 206006 206039 206073 206106 206139 206173 206206 206239 206273 206306 206339 206373 206406 206440 206473 206506 206540 206573 206606 206640 206673 206706 206740 206773 206807 206840 206873 206907 206940 206973 207007 207040 207074 207107 207140 207174 207207 207240 207274 207307 207340 207374 207407 207441 207474 207507 207541 207574 207607 207641 207674 207707 207741 207774 207808 207841 207874 207908 207941 207974 208008 208041 208075 208108 208141 208175 208208 208250 208291 208333 208375 208417 208458 208500 208542 208583 208625 208667 208708 208750 208792 208834 208875 208917 208959 209000 209042 209084 209126 209167 209209 209251 209292 209334 209376 209418 209459 209501 209543 209584 209626 209668 209709 209751 209793 209835 209876 209918 209960 210001 210043 210085 210127 210168 210210 210252 210293 210335 210377 210419 210460 210502 210544 210585 210627 210669 210710 210752 210794 210836 210877 210919 210961 211002 211044 211086 211128 211169 211211 211253 211294 211336 211378 211420 211461 211503 211545 211586 211628 211670 211711 211753 211795 211837 211878 211920 211962 212003 212045 212087 212129 212170 212212 212254 212295 212337 212379 212421 212462 212504 212546 212587 212629 212671 212712 212746 212779 212813 212846 212879 212913 212946 212979 213013 213046 213080 213113 213146 213180 213213 213246 213280 213313 213346 213380 213413 213447 213480 213513 213547 213580 213613 213647 213680 213713 213747 213780 213814 213847 213880 213914 213947 213980 214014 214047 214081 214114 214147 214181 214214 214256 214297 214339 214381 214423 214464 214506 214548 214589 214631 214673 214714 214756 214798 214840 214881 214923 214965 215006 215048 215090 215132 215173 215215 215257 215298 215340 215382 215424 215465 215507 215549 215590 215632 215674 215715 215757 215799 215841 215882 215924 215966 216007 216049 216091 216133 216174 216216 216258 216299 216341 216383 216425 216466 216508 216550 216591 216633 216675 216716 216750 216783 216817 216850 216883 216917 216950 216983 217017 217050 217084 217117 217150 217184 217217 217259 217300 217342 217384 217426 217467 217509 217551 217592 217634 217676 217717 217759 217801 217843 217884 217926 217968 218009 218051 218093 218135 218176 218218 218260 218301 218343 218385 218427 218468 218510 218552 218593 218635 218677 218718 218760 218802 218844 218885 218927 218969 219010 219052 219094 219136 219177 219219 219261 219302 219344 219386 219428 219469 219511 219553 219594 219636 219678 219719 219761 219803 219845 219886 219928 219970 220011 220053 220095 220137 220178 220220 220262 220303 220345 220387 220429 220470 220512 220554 220595 220637 220679 220720 220762 220804 220846 220887 220929 220971 221012 221054 221096 221138 221179 221221 221263 221304 221346 221388 221430 221471 221513 221555 221596 221638 221680 221721 221763 221805 221847 221888 221930 221972 222013 222055 222097 222139 222180 222222 222264 222305 222347 222389 222431 222472 222514 222556 222597 222639 222681 222722 222764 222806 222848 222889 222931 222973 223014 223056 223098 223140 223181 223223 223265 223306 223348 223390 223432 223473 223515 223557 223598 223640 223682 223723 223765 223807 223849 223890 223932 223974 224015 224057 224099 224141 224182 224224 224266 224307 224349 224391 224433 224474 224516 224558 224599 224641 224683 224724 224766 224808 224850 224891 224933 224975 225016 225058 225100 225142 225183 225225 225267 225308 225350 225392 225434 225475 225517 225559 225600 225642 225684 225725 225767 225809 225851 225892 225934 225976 226017 226059 226101 226143 226184 226226 226268 226309 226351 226393 226435 226476 226518 226560 226601 226643 226685 226726 226768 226810 226852 226893 226935 226977 227018 227060 227102 227144 227185 227227 227269 227310 227352 227394 227436 227477 227519 227561 227602 227644 227686 227727 227769 227811 227853 227894 227936 227978 228019 228061 228103 228145 228186 228228 228270 228311 228353 228395 228437 228478 228520 228562 228603 228645 228687 228728 228770 228812 228854 228895 228937 228979 229020 229062 229104 229146 229187 229229 229271 229312 229354 229396 229438 229479 229521 229563 229604 229646 229688 229729 229771 229813 229855 229896 229938 229980 230021 230063 230105 230147 230188 230230 230272 230313 230355 230397 230439 230480 230522 230564 230605 230647 230689 230730 230772 230814 230856 230897 230939 230981 231022 231064 231106 231148 231189 231231 231273 231314 231356 231398 231440 231481 231523 231565 231606 231648 231690 231731 231773 231815 231857 231898 231940 231982 232023 232065 232107 232149 232190 232232 232274 232315 232357 232399 232441 232482 232524 232566 232607 232649 232691 232732 232774 232816 232858 232899 232941 232983 233024 233066 233108 233150 233191 233233 233275 233316 233358 233400 233442 233483 233525 233567 233608 233650 233692 233733 233775 233817 233859 233900 233942 233984 234025 234067 234109 234151 234192 234234 234276 234317 234359 234401 234443 234484 234526 234568 234609 234651 234693 234734 234776 234818 234860 234901 234943 234985 235026 235068 235110 235152 235193 235235 235277 235318 235360 235402 235444 235485 235527 235569 235610 235652 235694 235735 235777 235819 235861 235902 235944 235986 236027 236069 236111 236153 236194 236236 236278 236319 236361 236403 236445 236486 236528 236570 236611 236653 236695 236736 236778 236820 236862 236903 236945 236987 237028 237070 237112 237154 237195 237237 237279 237320 237362 237404 237446 237487 237529 237571 237612 237654 237696 237737 237779 237821 237863 237904 237946 237988 238029 238071 238113 238155 238196 238238 238280 238321 238363 238405 238447 238488 238530 238572 238613 238655 238697 238738 238780 238822 238864 238905 238947 238989 239030 239072 239114 239156 239197 239239 239281 239322 239364 239406 239448 239489 239531 239573 239614 239656 239698 239739 239781 239823 239865 239906 239948 239990 240031 240073 240115 240157 240198 240240 240282 240323 240365 240407 240440 240474 240507 240540 240574 240607 240640 240674 240707 240740 240774 240807 240841 240874 240907 240941 240974 241007 241041 241074 241108 241141 241174 241208 241241 241283 241324 241366 241408 241450 241491 241533 241575 241616 241658 241700 241741 241783 241825 241867 241908 241950 241992 242033 242075 242117 242159 242200 242242 242284 242325 242367 242409 242451 242492 242534 242576 242617 242659 242701 242742 242784 242826 242868 242909 242951 242993 243034 243076 243118 243160 243201 243243 243285 243326 243368 243410 243452 243493 243535 243577 243618 243660 243702 243743 243785 243827 243869 243910 243952 243994 244035 244077 244119 244161 244202 244244 244286 244327 244369 244411 244453 244494 244536 244578 244619 244661 244703 244744 244786 244828 244870 244911 244953 244995 245036 245078 245120 245162 245203 245245 245287 245328 245370 245412 245454 245495 245537 245579 245612 245645 245679 245712 245745 245779 245812 245846 245879 245912 245954 245996 246037 246079 246121 246163 246204 246246 246288 246329 246371 246413 246455 246496 246538 246580 246621 246663 246705 246746 246788 246830 246872 246913 246955 246997 247038 247080 247122 247164 247205 247247 247289 247330 247372 247414 247456 247497 247539 247581 247622 247664 247706 247747 247789 247831 247873 247914 247956 247998 248039 248081 248123 248165 248206 248248 248290 248331 248373 248415 248457 248498 248540 248582 248623 248665 248707 248748 248790 248832 248874 248915 248957 248999 249040 249082 249124 249166 249207 249249 249291 249332 249374 249416 249449 249483 249516 249549 249583 249624 249666 249708 249749 249791 249833 249875 249916 249958 250000 250041 250083 250125 250167 250208 250250 250292 250333 250375 250417 250459 250500 250542 250584 250625 250667 250709 250750 250792 250834 250876 250917 250959 251001 251042 251084 251126 251168 251209 251251 251293 251334 251376 251418 251460 251501 251543 251585 251626 251668 251710 251751 251785 251818 251852 251885 251918 251952 251985 252018 252052 252085 252119 252152 252185 252219 252252 252285 252319 252352 252385 252419 252452 252486 252519 252552 252586 252619 252652 252686 252719 252752 252786 252819 252853 252886 252919 252953 252986 253019 253053 253086 253120 253153 253186 253220 253253 253286 253320 253353 253386 253420 253462 253503 253545 253587 253628 253670 253712 253753 253795 253837 253879 253920 253962 254004 254045 254087 254129 254171 254212 254254 254296 254337 254379 254421 254463 254504 254546 254588 254621 254654 254688 254721 254754 254788 254821 254855 254888 254921 254963 255005 255046 255088 255130 255172 255213 255255 255297 255338 255380 255422 255464 255505 255547 255589 255630 255672 255714 255755 255797 255839 255881 255922 255964 256006 256047 256089 256131 256173 256214 256256 256298 256339 256381 256423 256465 256506 256548 256590 256631 256673 256715 256756 256798 256840 256882 256923 256965 257007 257048 257090 257132 257174 257215 257257 257299 257340 257382 257424 257466 257507 257549 257591 257632 257674 257716 257757 257799 257841 257883 257924 257966 258008 258049 258091 258133 258175 258216 258258 258300 258341 258383 258425 258467 258508 258550 258592 258633 258675 258717 258758 258800 258842 258884 258925 258967 259009 259050 259092 259134 259176 259217 259259 259301 259342 259384 259426 259468 259509 259551 259593 259634 259676 259718 259759 259801 259843 259885 259926 259968 260010 260051 260093 260135 260177 260218 260260 260302 260343 260385 260427 260469 260510 260552 260594 260635 260677 260719 260760 260802 260844 260886 260927 260969 261011 261052 261094 261136 261178 261219 261261 261303 261344 261386 261428 261470 261511 261553 261595 261636 261678 261720 261761 261803 261845 261887 261928 261970 262012 262053 262095 262137 262179 262220 262262 262304 262345 262387 262429 262471 262512 262554 262596 262637 262679 262721 262762 262804 262846 262888 262929 262971 263013 263054 263096 263138 263180 263221 263263 263305 263346 263388 263430 263472 263513 263555 263597 263638 263680 263722 263763 263805 263847 263889 263930 263972 264014 264055 264097 264139 264181 264222 264264 264306 264347 264389 264431 264473 264514 264556 264598 264639 264681 264723 264764 264806 264848 264890 264931 264973 265015 265056 265098 265140 265182 265223 265265 265307 265348 265390 265432 265474 265515 265557 265599 265640 265682 265724 265765 265807 265849 265891 265932 265974 266016 266057 266099 266141 266183 266224 266266 266308 266349 266391 266433 266475 266516 266558 266600 266641 266683 266725 266766 266808 266850 266892 266933 266975 267017 267058 267100 267142 267184 267225 267267 267309 267350 267392 267434 267476 267517 267559 267601 267642 267684 267726 267767 267809 267851 267893 267934 267976 268018 268059 268101 268143 268185 268226 268268 268310 268351 268393 268435 268477 268518 268560 268602 268643 268685 268727 268768 268810 268852 268894 268935 268977 269019 269060 269102 269144 269186 269227 269269 269311 269352 269394 269436 269478 269519 269561 269603 269644 269686 269728 269769 269811 269853 269895 269936 269970 270003 270036 270070 270103 270137 270170 270203 270237 270270 270303 270337 270370 270403 270437 270470 270504 270537 270570 270604 270637 270670 270704 270737 270770 270804 270837 270871 270904 270937 270971 271004 271037 271071 271104 271138 271171 271204 271238 271271 271304 271338 271371 271404 271438 271471 271505 271538 271571 271605 271638 271671 271705 271738 271771 271813 271855 271897 271938 271980 272022 272063 272105 272147 272189 272230 272272 272305 272339 272372 272405 272439 272481 272522 272564 272606 272647 272689 272731 272772 272814 272856 272898 272939 272981 273023 273064 273106 273148 273190 273231 273273 273315 273356 273398 273440 273482 273523 273565 273607 273648 273690 273732 273773 273815 273857 273899 273940 273982 274024 274065 274107 274149 274191 274232 274274 274316 274357 274399 274441 274483 274524 274566 274608 274649 274691 274733 274774 274816 274858 274900 274941 274983 275025 275066 275108 275150 275192 275233 275275 275317 275358 275400 275442 275484 275525 275567 275609 275650 275692 275734 275775 275817 275859 275901 275942 275984 276026 276067 276109 276151 276193 276234 276276 276318 276359 276401 276443 276485 276526 276568 276610 276651 276693 276735 276776 276818 276860 276902 276943 276985 277027 277068 277110 277152 277194 277235 277277 277319 277360 277402 277444 277486 277527 277569 277611 277652 277694 277736 277777 277819 277861 277903 277944 277986 278028 278069 278111 278153 278195 278236 278278 278320 278361 278403 278445 278487 278528 278570 278612 278653 278695 278737 278778 278820 278862 278904 278945 278987 279029 279070 279112 279154 279196 279237 279279 279321 279362 279404 279446 279488 279529 279571 279613 279654 279696 279738 279779 279821 279863 279905 279946 279988 280030 280071 280113 280155 280197 280238 280280 280322 280363 280405 280447 280489 280530 280572 280614 280655 280697 280739 280780 280822 280864 280906 280947 280989 281031 281072 281114 281156 281198 281239 281281 281323 281364 281406 281448 281490 281531 281573 281615 281656 281698 281740 281781 281823 281865 281907 281948 281990 282032 282073 282115 282157 282199 282240 282282 282324 282365 282407 282449 282491 282532 282574 282616 282657 282699 282741 282782 282824 282866 282908 282949 282991 283033 283074 283116 283158 283200 283241 283283 283325 283366 283408 283450 283492 283533 283575 283617 283658 283700 283742 283783 283825 283867 283909 283950 283992 284034 284075 284117 284159 284201 284242 284284 284326 284367 284409 284451 284493 284534 284576 284618 284659 284701 284743 284784 284826 284868 284910 284951 284993 285035 285076 285118 285160 285202 285243 285285 285327 285368 285410 285452 285494 285535 285577 285619 285660 285702 285744 285785 285827 285869 285911 285952 285994 286036 286077 286119 286161 286203 286244 286286 286328 286369 286411 286453 286495 286536 286578 286620 286661 286703 286745 286786 286828 286870 286912 286953 286995 287037 287078 287120 287162 287204 287245 287287 287329 287370 287412 287454 287496 287537 287579 287621 287662 287704 287746 287787 287829 287871 287913 287954 287996 288038 288079 288121 288163 288205 288246 288288 288330 288371 288413 288455 288497 288538 288580 288622 288663 288705 288747 288788 288830 288872 288914 288955 288997 289039 289080 289122 289164 289206 289247 289289 289331 289372 289414 289456 289498 289539 289581 289623 289664 289706 289748 289789 289831 289873 289915 289956 289998 290040 290081 290123 290165 290207 290248 290290 290332 290373 290415 290457 290499 290540 290582 290624 290665 290707 290749 290790 290832 290874 290916 290957 290999 291041 291082 291124 291166 291208 291249 291291 291333 291374 291416 291458 291500 291541 291583 291625 291666 291708 291750 291791 291833 291875 291917 291958 292000 292042 292083 292125 292159 292192 292225 292259 292292 292325 292359 292392 292425 292459 292492 292526 292559 292592 292626 292667 292709 292751 292792 292826 292859 292893 292926 292959 292993 293026 293059 293093 293126 293160 293193 293226 293260 293293 293335 293376 293418 293460 293493 293527 293560 293593 293627 293660 293693 293727 293760 293793 293827 293860 293894 293927 293960 294002 294044 294085 294127 294161 294194 294227 294261 294294 294327 294361 294394 294427 294461 294494 294528 294561 294594 294628 294669 294711 294753 294794 294836 294878 294920 294961 295003 295045 295086 295128 295170 295212 295253 295295 295337 295378 295420 295462 295504 295545 295587 295629 295662 295695 295729 295762 295795 295829 295862 295896 295929 295962 295996 296029 296062 296096 296129 296163 296196 296229 296263 296296 296329 296363 296396 296429 296463 296496 296530 296563 296596 296630 296663 296696 296730 296763 296796 296830 296863 296897 296930 296963 296997 297030 297063 297097 297130 297164 297197 297230 297264 297297 297330 297364 297397 297430 297464 297497 297531 297564 297597 297631 297664 297697 297731 297764 297797 297831 297864 297898 297931 297964 297998 298031 298064 298098 298131 298165 298198 298231 298265 298298 298331 298365 298398 298431 298465 298498 298532 298565 298598 298632 298665 298698 298732 298765 298798 298840 298882 298924 298965 299007 299049 299090 299132 299174 299216 299257 299299 299341 299382 299424 299466 299508 299549 299591 299633 299674 299716 299758 299799 299841 299883 299925 299966 300008 300050 300091 300133 300175 300217 300258 300300 300342 300383 300425 300467 300509 300550 300592 300634 300675 300717 300759 300800 300842 300884 300926 300967 301009 301051 301092 301134 301176 301218 301259 301301 301343 301384 301426 301468 301510 301551 301593 301635 301676 301718 301760 301801 301843 301885 301927 301968 302010 302052 302093 302135 302177 302219 302260 302302 302344 302385 302427 302469 302511 302552 302594 302636 302677 302719 302761 302802 302844 302886 302928 302969 303011 303053 303094 303136 303178 303220 303261 303303 303345 303386 303428 303470 303512 303553 303595 303637 303678 303720 303762 303803 303845 303887 303929 303970 304012 304054 304095 304137 304179 304221 304262 304304 304346 304387 304429 304471 304513 304554 304596 304638 304679 304721 304763 304804 304846 304888 304930 304971 305013 305055 305096 305138 305180 305222 305263 305305 305347 305388 305430 305472 305514 305555 305597 305639 305680 305722 305764 305805 305847 305889 305931 305972 306014 306056 306097 306139 306173 306206 306239 306273 306306 306339 306373 306406 306439 306473 306506 306540 306573 306606 306640 306673 306706 306740 306773 306806 306840 306873 306907 306940 306973 307007 307040 307073 307107 307140 307174 307207 307240 307274 307307 307340 307374 307407 307440 307474 307507 307541 307574 307607 307641 307674 307707 307741 307774 307807 307841 307874 307908 307941 307974 308008 308041 308074 308108 308141 308175 308208 308241 308275 308308 308341 308375 308408 308441 308475 308508 308542 308575 308608 308642 308675 308708 308742 308775 308808 308842 308875 308909 308942 308975 309009 309042 309075 309109 309142 309176 309209 309242 309276 309309 309342 309376 309409 309442 309476 309509 309543 309576 309609 309643 309676 309709 309743 309776 309809 309843 309876 309910 309943 309976 310010 310043 310076 310110 310143 310177 310210 310243 310277 310310 310343 310377 310410 310443 310477 310510 310544 310577 310610 310644 310685 310727 310769 310810 310852 310894 310936 310977 311019 311061 311102 311144 311186 311228 311269 311311 311353 311394 311436 311478 311520 311561 311603 311645 311686 311728 311770 311811 311853 311895 311937 311978 312020 312062 312103 312145 312187 312229 312270 312312 312354 312395 312437 312479 312521 312562 312604 312646 312687 312729 312771 312812 312854 312896 312938 312979 313021 313063 313104 313146 313188 313230 313271 313313 313355 313396 313438 313480 313522 313563 313605 313647 313688 313730 313772 313813 313855 313897 313939 313980 314022 314064 314105 314147 314189 314231 314272 314314 314356 314397 314439 314481 314523 314564 314606 314648 314689 314731 314773 314814 314856 314898 314940 314981 315023 315065 315106 315148 315190 315232 315273 315315 315357 315398 315440 315482 315524 315565 315607 315649 315690 315732 315774 315815 315857 315899 315941 315982 316024 316066 316107 316149 316191 316233 316274 316316 316358 316399 316441 316483 316525 316566 316608 316650 316691 316733 316775 316816 316858 316900 316942 316983 317025 317067 317108 317150 317192 317234 317275 317317 317359 317400 317442 317484 317526 317567 317609 317651 317692 317734 317776 317817 317859 317901 317943 317984 318026 318068 318109 318151 318193 318235 318276 318318 318360 318401 318443 318485 318527 318568 318610 318652 318693 318735 318777 318818 318860 318902 318944 318985 319027 319069 319110 319152 319194 319236 319277 319319 319361 319402 319444 319486 319528 319569 319611 319653 319694 319736 319778 319819 319861 319903 319945 319986 320028 320070 320111 320153 320195 320237 320278 320320 320362 320403 320445 320487 320529 320570 320612 320654 320695 320737 320779 320820 320862 320904 320946 320987 321029 321071 321112 321154 321196 321238 321279 321321 321363 321404 321446 321488 321530 321571 321613 321655 321696 321738 321780 321821 321863 321905 321947 321988 322030 322072 322113 322155 322197 322239 322280 322322 322364 322405 322447 322489 322531 322572 322614 322656 322697 322739 322781 322822 322864 322906 322948 322989 323031 323073 323114 323156 323198 323240 323281 323323 323365 323406 323448 323490 323532 323573 323615 323657 323698 323740 323782 323823 323865 323907 323949 323990 324032 324074 324115 324157 324199 324241 324282 324324 324366 324407 324449 324491 324533 324574 324616 324658 324699 324741 324783 324824 324866 324908 324950 324991 325033 325075 325116 325158 325200 325242 325283 325325 325367 325408 325450 325492 325534 325575 325617 325659 325700 325742 325784 325825 325867 325909 325951 325992 326034 326076 326117 326159 326201 326243 326284 326326 326368 326409 326451 326493 326535 326576 326618 326660 326701 326743 326785 326826 326868 326910 326952 326993 327035 327077 327118 327160 327202 327244 327285 327327 327369 327410 327452 327494 327536 327577 327619 327661 327702 327744 327786 327827 327869 327911 327953 327994 328036 328078 328119 328161 328203 328245 328286 328328 328370 328411 328453 328495 328537 328578 328620 328662 328703 328745 328787 328828 328870 328912 328954 328995 329037 329079 329120 329162 329204 329246 329287 329329 329371 329412 329454 329496 329538 329579 329621 329663 329704 329746 329788 329829 329871 329913 329955 329996 330038 330080 330121 330163 330205 330247 330288 330330 330372 330413 330455 330497 330539 330580 330622 330664 330705 330747 330789 330830 330872 330914 330956 330997 331039 331081 331122 331164 331206 331248 331289 331331 331373 331414 331456 331498 331540 331581 331623 331665 331706 331748 331790 331831 331873 331915 331957 331998 332040 332082 332123 332165 332207 332249 332290 332332 332374 332415 332457 332499 332541 332582 332624 332666 332707 332749 332791 332832 332874 332916 332958 332999 333041 333083 333124 333166 333208 333250 333291 333333 333375 333416 333458 333500 333542 333583 333625 333667 333708 333750 333792 333833 333875 333917 333959 334000 334042 334084 334125 334167 334209 334251 334292 334334 334376 334417 334459 334501 334543 334584 334626 334668 334709 334751 334793 334834 334876 334918 334960 335001 335043 335085 335126 335168 335210 335252 335293 335335 335377 335418 335460 335502 335544 335585 335627 335669 335710 335752 335794 335835 335877 335919 335961 336002 336036 336069 336102 336136 336169 336211 336253 336294 336336 336378 336419 336461 336503 336545 336586 336628 336670 336711 336753 336795 336836 336878 336920 336962 337003 337045 337087 337128 337170 337212 337254 337295 337337 337379 337420 337462 337504 337546 337587 337629 337671 337712 337754 337796 337837 337879 337921 337963 338004 338046 338088 338129 338171 338213 338255 338296 338338 338380 338421 338463 338505 338547 338588 338630 338672 338713 338755 338797 338838 338880 338922 338964 339005 339047 339089 339130 339172 339214 339256 339297 339339 339381 339422 339464 339506 339548 339589 339631 339673 339714 339756 339798 339839 339881 339923 339965 340006 340048 340090 340131 340173 340215 340257 340298 340340 340382 340423 340465 340507 340549 340590 340632 340674 340715 340757 340799 340840 340882 340924 340966 341007 341049 341091 341132 341174 341216 341258 341299 341341 341383 341424 341466 341508 341550 341591 341633 341675 341716 341758 341800 341841 341883 341925 341967 342008 342050 342092 342133 342175 342217 342259 342300 342342 342384 342425 342467 342509 342551 342592 342634 342676 342717 342759 342801 342842 342884 342926 342968 343009 343051 343093 343134 343176 343218 343260 343301 343343 343385 343426 343468 343510 343552 343593 343635 343677 343718 343760 343802 343843 343885 343927 343969 344010 344052 344094 344135 344177 344219 344261 344302 344344 344386 344427 344469 344511 344553 344594 344636 344678 344719 344761 344803 344844 344886 344928 344970 345011 345053 345095 345136 345178 345220 345262 345303 345345 345387 345428 345470 345512 345554 345595 345637 345679 345720 345762 345804 345845 345879 345912 345946 345979 346012 346046 346079 346112 346146 346179 346213 346246 346279 346313 346346 346379 346413 346446 346479 346513 346546 346580 346613 346646 346680 346713 346746 346780 346813 346846 346880 346913 346947 346980 347013 347047 347080 347113 347147 347180 347214 347247 347280 347314 347347 347380 347414 347447 347480 347514 347547 347581 347614 347647 347681 347714 347747 347781 347814 347847 347881 347914 347948 347981 348014 348048 348081 348114 348148 348181 348223 348265 348306 348348 348390 348431 348473 348515 348557 348598 348640 348682 348723 348765 348807 348848 348890 348932 348974 349015 349057 349099 349140 349182 349224 349266 349307 349349 349391 349432 349474 349516 349558 349599 349641 349683 349716 349749 349783 349816 349849 349883 349916 349950 349983 350016 350050 350083 350116 350150 350183 350217 350250 350283 350317 350350 350392 350433 350475 350517 350559 350600 350642 350684 350725 350767 350809 350850 350892 350934 350976 351017 351059 351101 351142 351184 351226 351268 351309 351351 351393 351434 351476 351518 351560 351601 351643 351685 351726 351768 351810 351851 351893 351935 351977 352018 352060 352102 352143 352185 352227 352269 352310 352352 352394 352435 352477 352519 352561 352602 352644 352686 352727 352769 352811 352852 352886 352919 352953 352986 353019 353053 353086 353119 353153 353186 353220 353253 353286 353320 353353 353386 353420 353453 353486 353520 353553 353587 353620 353653 353687 353720 353753 353787 353820 353853 353895 353937 353979 354020 354062 354104 354145 354187 354229 354271 354312 354354 354396 354437 354479 354521 354563 354604 354646 354688 354729 354771 354813 354854 354896 354938 354980 355021 355063 355105 355146 355188 355230 355272 355313 355355 355397 355438 355480 355522 355564 355605 355647 355689 355730 355772 355814 355855 355889 355922 355956 355989 356022 356064 356106 356147 356189 356231 356273 356314 356356 356398 356439 356481 356523 356565 356606 356648 356690 356731 356773 356815 356856 356898 356940 356982 357023 357065 357107 357148 357190 357224 357257 357290 357324 357357 357390 357424 357457 357490 357524 357557 357591 357624 357657 357691 357724 357757 357791 357824 357857 357891 357924 357958 357991 358024 358058 358091 358124 358158 358191 358225 358258 358291 358325 358358 358400 358441 358483 358525 358567 358608 358650 358692 358733 358775 358817 358858 358900 358942 358984 359025 359067 359109 359150 359192 359234 359276 359317 359359 359401 359442 359484 359526 359568 359609 359651 359693 359734 359776 359818 359859 359901 359943 359985 360026 360068 360110 360151 360193 360235 360277 360318 360360 360402 360443 360485 360527 360569 360610 360652 360694 360735 360777 360819 360860 360902 360944 360986 361027 361069 361111 361152 361194 361236 361278 361319 361361 361394 361428 361461 361494 361528 361570 361611 361653 361695 361736 361778 361820 361861 361903 361945 361987 362028 362062 362095 362128 362162 362195 362237 362279 362320 362362 362404 362445 362487 362529 362571 362612 362654 362696 362737 362779 362821 362862 362904 362946 362988 363029 363071 363113 363154 363196 363238 363280 363321 363363 363396 363430 363463 363496 363530 363572 363613 363655 363697 363738 363780 363822 363863 363905 363947 363989 364030 364072 364114 364155 364197 364239 364281 364322 364364 364406 364447 364489 364531 364573 364614 364656 364698 364739 364781 364823 364864 364906 364948 364990 365031 365073 365115 365156 365198 365240 365282 365323 365365 365407 365448 365490 365532 365574 365615 365657 365699 365740 365782 365824 365865 365907 365949 365991 366032 366074 366116 366157 366199 366241 366283 366324 366366 366408 366449 366491 366533 366575 366616 366658 366700 366741 366783 366825 366866 366908 366950 366992 367033 367075 367117 367158 367200 367242 367284 367325 367367 367409 367450 367492 367534 367567 367601 367634 367667 367701 367734 367767 367801 367834 367867 367901 367934 367968 368001 368034 368068 368101 368134 368168 368201 368235 368268 368301 368335 368368 368401 368435 368468 368501 368535 368568 368602 368635 368668 368702 368735 368768 368802 368835 368868 368902 368935 368969 369002 369035 369069 369102 369135 369169 369202 369236 369269 369302 369336 369369 369402 369436 369469 369502 369536 369569 369603 369636 369669 369703 369736 369769 369803 369836 369869 369903 369936 369970 370003 370036 370078 370120 370161 370203 370245 370287 370328 370370 370412 370453 370495 370537 370579 370620 370662 370704 370745 370787 370829 370870 370912 370954 370996 371037 371079 371121 371162 371204 371246 371288 371329 371371 371413 371454 371496 371538 371580 371621 371663 371705 371746 371788 371830 371871 371905 371938 371972 372005 372038 372072 372105 372138 372172 372205 372239 372272 372305 372339 372372 372405 372439 372472 372505 372539 372581 372622 372664 372706 372747 372789 372831 372872 372914 372956 372998 373039 373081 373123 373164 373206 373248 373290 373331 373373 373415 373456 373498 373540 373582 373623 373665 373707 373748 373790 373832 373873 373915 373957 373999 374040 374082 374124 374165 374207 374249 374291 374332 374374 374416 374457 374499 374541 374583 374624 374666 374708 374749 374791 374833 374874 374916 374958 375000 375041 375083 375125 375166 375208 375250 375292 375333 375375 375417 375458 375500 375542 375584 375625 375667 375709 375750 375792 375834 375875 375917 375959 376001 376042 376084 376126 376167 376209 376251 376293 376334 376376 376418 376459 376501 376543 376585 376626 376668 376710 376751 376793 376835 376876 376918 376960 377002 377043 377085 377127 377168 377210 377252 377294 377335 377377 377419 377460 377502 377544 377586 377627 377669 377711 377752 377794 377836 377877 377919 377961 378003 378044 378086 378128 378169 378211 378253 378295 378336 378378 378420 378461 378503 378545 378587 378628 378670 378712 378753 378795 378837 378878 378920 378962 379004 379045 379087 379129 379170 379212 379254 379296 379337 379379 379421 379462 379504 379546 379579 379613 379646 379679 379713 379754 379796 379838 379879 379921 379963 380005 380046 380088 380130 380171 380213 380247 380280 380313 380347 380380 380413 380447 380480 380513 380547 380580 380614 380647 380680 380714 380747 380780 380814 380847 380880 380914 380947 380981 381014 381047 381081 381114 381147 381181 381214 381248 381281 381314 381348 381381 381414 381448 381481 381514 381548 381581 381615 381648 381681 381715 381756 381798 381840 381881 381915 381948 381982 382015 382048 382082 382115 382148 382182 382215 382257 382299 382340 382382 382415 382449 382482 382515 382549 382582 382616 382649 382682 382716 382757 382799 382841 382882 382924 382966 383008 383049 383091 383133 383174 383216 383258 383300 383341 383383 383425 383466 383508 383550 383592 383633 383675 383717 383758 383800 383842 383883 383925 383967 384009 384050 384092 384134 384175 384217 384259 384301 384342 384384 384417 384451 384484 384517 384551 384584 384618 384651 384684 384718 384751 384784 384818 384851 384884 384926 384968 385010 385051 385085 385118 385151 385185 385218 385252 385285 385318 385352 385385 385418 385452 385485 385518 385552 385594 385635 385677 385719 385760 385802 385844 385885 385927 385969 386011 386052 386094 386136 386177 386219 386261 386303 386344 386386 386428 386469 386511 386553 386595 386636 386678 386720 386761 386803 386845 386886 386928 386970 387012 387053 387095 387137 387178 387220 387262 387304 387345 387387 387429 387470 387512 387554 387596 387637 387679 387721 387762 387804 387846 387887 387929 387971 388013 388054 388096 388138 388179 388221 388263 388305 388346 388388 388430 388471 388513 388555 388597 388638 388680 388722 388763 388805 388847 388888 388930 388972 389014 389055 389097 389139 389180 389222 389264 389306 389347 389389 389431 389472 389514 389556 389598 389639 389681 389723 389764 389806 389848 389889 389931 389973 390015 390056 390098 390140 390181 390223 390265 390307 390348 390390 390432 390473 390515 390557 390599 390640 390682 390724 390765 390807 390849 390890 390932 390974 391016 391057 391099 391141 391182 391224 391266 391308 391349 391391 391433 391474 391516 391558 391600 391641 391683 391725 391766 391808 391850 391891 391933 391975 392017 392058 392100 392142 392183 392225 392267 392309 392350 392392 392434 392475 392517 392559 392601 392642 392684 392726 392767 392809 392851 392892 392934 392976 393018 393059 393101 393143 393184 393226 393268 393310 393351 393393 393435 393476 393518 393560 393602 393643 393685 393727 393768 393810 393852 393893 393935 393977 394019 394060 394102 394144 394185 394227 394269 394311 394352 394394 394427 394461 394494 394527 394561 394594 394628 394661 394694 394728 394769 394811 394853 394894 394936 394978 395020 395061 395103 395145 395186 395228 395270 395312 395353 395395 395437 395478 395520 395562 395604 395645 395687 395729 395762 395795 395829 395862 395895 395929 395962 395996 396029 396062 396104 396146 396187 396229 396271 396313 396354 396396 396438 396479 396521 396563 396605 396646 396688 396730 396771 396813 396855 396896 396938 396980 397022 397063 397105 397147 397188 397230 397272 397314 397355 397397 397439 397480 397522 397564 397606 397647 397689 397731 397772 397814 397856 397897 397939 397981 398023 398064 398106 398148 398189 398231 398273 398315 398356 398398 398440 398481 398523 398565 398607 398648 398690 398732 398773 398815 398857 398898 398940 398982 399024 399065 399107 399149 399190 399232 399274 399316 399357 399399 399441 399482 399524 399566 399608 399649 399691 399733 399774 399816 399858 399899 399941 399983 400025 400066 400108 400150 400191 400233 400275 400317 400358 400400 400442 400483 400525 400567 400609 400650 400692 400734 400775 400817 400859 400900 400942 400984 401026 401067 401109 401151 401192 401234 401276 401318 401359 401401 401443 401484 401526 401568 401610 401651 401693 401735 401776 401818 401860 401901 401943 401985 402027 402068 402110 402152 402193 402235 402277 402319 402360 402402 402444 402485 402527 402569 402611 402652 402694 402736 402777 402819 402861 402902 402944 402986 403028 403069 403111 403153 403194 403236 403278 403320 403361 403403 403445 403486 403528 403570 403612 403653 403695 403737 403778 403820 403862 403903 403945 403987 404029 404070 404112 404154 404195 404237 404279 404321 404362 404404 404446 404487 404529 404571 404613 404654 404696 404738 404779 404821 404863 404904 404946 404988 405030 405071 405113 405155 405196 405238 405280 405322 405363 405405 405447 405488 405530 405572 405614 405655 405697 405739 405780 405822 405864 405905 405947 405989 406031 406072 406114 406156 406197 406239 406281 406323 406364 406406 406448 406489 406531 406573 406615 406656 406698 406740 406781 406823 406865 406906 406948 406990 407032 407073 407115 407157 407198 407240 407274 407307 407340 407374 407407 407440 407474 407507 407540 407574 407607 407641 407674 407707 407741 407774 407807 407841 407874 407907 407941 407974 408008 408041 408074 408116 408158 408199 408241 408283 408325 408366 408408 408450 408491 408533 408575 408617 408658 408700 408742 408783 408825 408867 408908 408950 408992 409034 409075 409117 409159 409200 409242 409284 409326 409367 409409 409451 409492 409534 409576 409618 409659 409701 409743 409784 409826 409868 409909 409951 409993 410035 410076 410118 410160 410201 410243 410285 410327 410368 410410 410452 410493 410535 410577 410619 410660 410702 410744 410785 410827 410869 410910 410952 410994 411036 411077 411119 411161 411202 411244 411286 411328 411369 411411 411453 411494 411536 411578 411620 411661 411703 411745 411786 411828 411870 411911 411953 411995 412037 412078 412120 412162 412203 412245 412287 412329 412370 412412 412454 412495 412537 412579 412621 412662 412704 412746 412787 412829 412871 412912 412954 412996 413038 413079 413113 413146 413179 413213 413246 413280 413313 413346 413380 413413 413446 413480 413513 413546 413580 413613 413647 413680 413713 413747 413788 413830 413872 413913 413955 413997 414039 414080 414122 414164 414205 414247 414289 414331 414372 414414 414456 414497 414539 414581 414623 414664 414706 414748 414789 414831 414873 414914 414956 414998 415040 415081 415123 415165 415206 415248 415290 415332 415373 415415 415457 415498 415540 415582 415624 415665 415707 415749 415790 415832 415874 415915 415957 415999 416041 416082 416124 416166 416207 416249 416291 416333 416374 416416 416458 416499 416541 416583 416625 416666 416708 416750 416791 416833 416875 416916 416958 417000 417042 417083 417125 417167 417208 417250 417292 417334 417375 417417 417459 417500 417542 417584 417626 417667 417709 417751 417792 417834 417876 417917 417959 418001 418043 418084 418126 418168 418209 418251 418293 418335 418376 418418 418460 418501 418543 418585 418627 418668 418710 418752 418793 418835 418877 418918 418960 419002 419044 419085 419127 419169 419210 419252 419294 419336 419377 419419 419461 419502 419544 419586 419628 419669 419711 419753 419794 419836 419878 419919 419961 420003 420045 420086 420128 420170 420211 420253 420295 420337 420378 420420 420462 420503 420545 420587 420629 420670 420712 420754 420795 420837 420879 420920 420962 421004 421046 421087 421129 421171 421212 421254 421296 421338 421379 421421 421463 421504 421546 421588 421630 421671 421713 421755 421796 421838 421880 421921 421963 422005 422047 422088 422130 422172 422213 422255 422297 422339 422380 422422 422464 422505 422547 422589 422631 422672 422714 422756 422789 422822 422856 422889 422922 422964 423006 423048 423089 423131 423173 423214 423256 423298 423340 423381 423423 423465 423506 423548 423590 423632 423673 423715 423757 423798 423840 423882 423923 423965 424007 424049 424090 424132 424174 424215 424257 424299 424341 424382 424424 424466 424507 424549 424591 424633 424674 424716 424758 424799 424841 424883 424924 424966 425008 425050 425091 425133 425175 425216 425258 425300 425342 425383 425425 425467 425508 425550 425592 425634 425675 425717 425759 425800 425842 425884 425925 425967 426009 426051 426092 426134 426176 426217 426259 426301 426343 426384 426426 426468 426509 426551 426593 426635 426676 426718 426760 426801 426843 426885 426926 426968 427010 427052 427093 427135 427177 427218 427260 427302 427344 427385 427427 427469 427510 427552 427594 427636 427677 427719 427761 427802 427844 427886 427927 427969 428011 428053 428094 428136 428178 428219 428261 428303 428345 428386 428428 428470 428511 428553 428595 428637 428678 428720 428762 428803 428845 428887 428928 428970 429012 429054 429095 429137 429179 429220 429262 429304 429346 429387 429429 429471 429512 429554 429596 429638 429679 429721 429763 429804 429846 429888 429929 429971 430013 430055 430096 430138 430180 430221 430263 430297 430330 430363 430397 430430 430463 430497 430530 430563 430597 430630 430664 430697 430730 430764 430797 430830 430864 430897 430930 430972 431014 431056 431097 431139 431181 431222 431264 431306 431348 431389 431431 431473 431514 431556 431598 431640 431681 431723 431765 431806 431848 431890 431931 431973 432015 432057 432098 432140 432182 432223 432265 432307 432349 432390 432432 432474 432515 432557 432599 432641 432682 432724 432766 432807 432849 432891 432932 432974 433016 433058 433099 433141 433183 433224 433266 433308 433350 433391 433433 433475 433516 433558 433600 433642 433683 433725 433767 433808 433850 433892 433933 433975 434017 434059 434100 434142 434184 434225 434267 434309 434351 434392 434434 434476 434517 434559 434601 434643 434684 434726 434768 434809 434851 434893 434934 434976 435018 435060 435101 435143 435185 435226 435268 435310 435352 435393 435435 435477 435518 435560 435602 435644 435685 435727 435769 435810 435852 435894 435935 435977 436019 436061 436102 436144 436186 436227 436269 436311 436353 436394 436436 436478 436519 436561 436603 436645 436686 436728 436770 436811 436853 436895 436936 436978 437020 437062 437103 437145 437187 437228 437270 437312 437354 437395 437437 437479 437520 437562 437604 437646 437687 437729 437771 437812 437854 437896 437937 437979 438021 438063 438104 438146 438188 438229 438271 438305 438338 438371 438405 438438 438471 438505 438538 438571 438605 438638 438672 438705 438738 438772 438805 438838 438872 438905 438938 438980 439022 439064 439105 439147 439189 439230 439272 439314 439356 439397 439439 439481 439522 439564 439606 439648 439689 439731 439773 439814 439856 439898 439939 439981 440023 440065 440106 440148 440190 440231 440273 440315 440357 440398 440440 440482 440523 440565 440607 440649 440690 440732 440774 440815 440857 440899 440940 440982 441024 441066 441107 441149 441191 441232 441274 441316 441358 441399 441441 441483 441524 441566 441608 441650 441691 441733 441775 441816 441858 441900 441941 441983 442025 442067 442108 442150 442192 442233 442275 442317 442359 442400 442442 442484 442525 442567 442609 442651 442692 442734 442776 442817 442859 442901 442942 442984 443026 443068 443109 443151 443193 443234 443276 443318 443360 443401 443443 443485 443526 443568 443610 443652 443693 443735 443777 443818 443860 443902 443943 443985 444027 444069 444110 444152 444194 444235 444277 444319 444361 444402 444444 444486 444527 444569 444611 444653 444694 444736 444778 444819 444861 444903 444944 444986 445028 445070 445111 445153 445195 445236 445278 445320 445362 445403 445445 445487 445528 445570 445612 445654 445695 445737 445779 445820 445862 445904 445945 445987 446029 446071 446112 446154 446196 446237 446279 446321 446363 446404 446446 446488 446529 446571 446613 446655 446696 446738 446780 446821 446863 446905 446946 446988 447030 447072 447113 447155 447197 447238 447280 447322 447364 447405 447447 447489 447530 447572 447614 447656 447697 447739 447781 447822 447864 447906 447947 447989 448031 448073 448114 448156 448198 448239 448281 448323 448365 448406 448448 448490 448531 448573 448615 448657 448698 448740 448782 448823 448865 448907 448948 448990 449032 449074 449115 449157 449199 449240 449282 449324 449366 449407 449449 449491 449532 449574 449616 449658 449699 449741 449783 449824 449866 449908 449949 449991 450033 450075 450116 450158 450200 450241 450283 450325 450367 450408 450450 450492 450533 450575 450617 450659 450700 450742 450784 450825 450867 450909 450950 450992 451034 451076 451117 451159 451201 451242 451284 451326 451368 451409 451451 451493 451534 451576 451618 451660 451701 451743 451785 451826 451868 451910 451951 451993 452035 452077 452118 452160 452202 452243 452285 452327 452369 452410 452452 452494 452535 452577 452619 452661 452702 452744 452786 452827 452869 452911 452952 452994 453036 453078 453119 453161 453203 453244 453286 453328 453370 453411 453453 453495 453536 453578 453620 453662 453703 453745 453787 453828 453870 453912 453953 453995 454037 454079 454120 454162 454204 454245 454287 454329 454371 454412 454454 454496 454537 454579 454621 454663 454704 454746 454788 454829 454871 454913 454954 454996 455038 455080 455121 455163 455205 455246 455288 455330 455372 455413 455455 455497 455538 455580 455622 455664 455705 455747 455789 455830 455872 455914 455955 455997 456039 456081 456122 456164 456206 456247 456289 456331 456373 456414 456456 456498 456539 456581 456623 456665 456706 456748 456790 456831 456873 456915 456956 456998 457040 457082 457123 457165 457207 457248 457290 457324 457357 457390 457424 457457 457490 457524 457557 457590 457624 457657 457691 457724 457757 457791 457824 457857 457891 457924 457957 457991 458024 458058 458091 458124 458158 458191 458224 458258 458291 458325 458358 458391 458425 458458 458491 458525 458558 458591 458625 458658 458692 458725 458758 458792 458825 458858 458892 458925 458958 458992 459025 459059 459092 459125 459159 459192 459225 459259 459292 459326 459359 459392 459426 459459 459492 459526 459559 459592 459626 459659 459693 459726 459759 459793 459826 459859 459893 459926 459959 459993 460026 460060 460093 460126 460160 460193 460226 460260 460293 460327 460360 460393 460427 460460 460502 460543 460585 460627 460669 460710 460752 460794 460835 460877 460919 460960 461002 461044 461086 461127 461169 461211 461252 461294 461336 461378 461419 461461 461503 461544 461586 461628 461670 461711 461753 461795 461836 461878 461920 461961 462003 462045 462087 462128 462170 462212 462253 462295 462337 462379 462420 462462 462504 462545 462587 462629 462671 462712 462754 462796 462837 462879 462921 462962 463004 463046 463088 463129 463171 463213 463254 463296 463338 463380 463421 463463 463505 463546 463588 463630 463672 463713 463755 463797 463838 463880 463922 463963 464005 464047 464089 464130 464172 464214 464255 464297 464339 464381 464422 464464 464506 464547 464589 464631 464673 464714 464756 464798 464839 464881 464923 464964 465006 465048 465090 465131 465173 465215 465256 465298 465340 465382 465423 465465 465507 465548 465590 465632 465674 465715 465757 465799 465840 465882 465924 465965 466007 466049 466091 466132 466174 466216 466257 466299 466341 466383 466424 466466 466508 466549 466591 466633 466675 466716 466758 466800 466841 466883 466925 466966 467008 467050 467092 467133 467175 467217 467258 467300 467342 467384 467425 467467 467509 467550 467592 467634 467676 467717 467759 467801 467842 467884 467926 467967 468009 468051 468093 468134 468176 468218 468259 468301 468343 468385 468426 468468 468510 468551 468593 468635 468677 468718 468760 468802 468843 468885 468927 468968 469010 469052 469094 469135 469177 469219 469260 469302 469344 469386 469427 469469 469511 469552 469594 469636 469678 469719 469761 469803 469844 469886 469928 469969 470011 470053 470095 470136 470178 470220 470261 470303 470345 470387 470428 470470 470512 470553 470595 470637 470679 470720 470762 470804 470845 470887 470929 470970 471012 471054 471096 471137 471179 471221 471262 471304 471346 471388 471429 471471 471513 471554 471596 471638 471680 471721 471763 471805 471846 471888 471930 471971 472013 472055 472097 472138 472180 472222 472263 472305 472347 472389 472430 472472 472514 472555 472597 472639 472681 472722 472764 472806 472847 472889 472931 472972 473014 473056 473098 473139 473181 473223 473264 473306 473348 473390 473431 473473 473515 473556 473598 473640 473682 473723 473765 473807 473848 473890 473932 473973 474015 474057 474099 474140 474182 474224 474265 474307 474349 474391 474432 474474 474516 474557 474599 474641 474683 474724 474766 474808 474849 474891 474933 474974 475016 475058 475100 475141 475183 475225 475266 475308 475350 475392 475433 475475 475517 475558 475600 475642 475684 475725 475767 475809 475850 475892 475934 475975 476017 476059 476101 476142 476184 476226 476267 476309 476351 476393 476434 476476 476518 476559 476601 476643 476685 476726 476768 476810 476851 476893 476935 476976 477018 477060 477102 477143 477185 477227 477268 477310 477352 477394 477435 477477 477519 477560 477602 477644 477686 477727 477769 477811 477852 477894 477936 477977 478019 478061 478103 478144 478186 478228 478269 478311 478353 478395 478436 478478 478520 478561 478603 478645 478687 478728 478770 478812 478853 478895 478937 478978 479020 479062 479104 479145 479187 479229 479270 479312 479354 479396 479437 479479 479521 479562 479604 479646 479688 479729 479771 479813 479854 479896 479938 479979 480021 480063 480105 480146 480188 480230 480271 480313 480355 480397 480438 480480 480522 480563 480605 480647 480689 480730 480772 480814 480855 480897 480939 480980 481022 481064 481106 481147 481189 481231 481272 481314 481356 481398 481439 481481 481523 481564 481606 481648 481690 481731 481773 481815 481856 481898 481940 481981 482023 482065 482107 482148 482190 482232 482273 482315 482357 482399 482440 482482 482524 482565 482607 482649 482691 482732 482774 482816 482849 482882 482916 482949 482982 483016 483049 483083 483116 483149 483183 483216 483249 483283 483316 483350 483383 483416 483450 483483 483516 483550 483583 483616 483650 483683 483717 483750 483783 483817 483858 483900 483942 483983 484017 484050 484084 484117 484150 484184 484217 484250 484284 484317 484359 484401 484442 484484 484526 484567 484609 484651 484693 484734 484776 484818 484859 484901 484943 484984 485026 485068 485110 485151 485193 485235 485276 485318 485360 485402 485443 485485 485527 485568 485610 485652 485694 485735 485777 485819 485860 485902 485944 485985 486027 486069 486111 486152 486194 486236 486277 486319 486361 486403 486444 486486 486528 486569 486611 486653 486695 486736 486778 486820 486861 486903 486945 486986 487028 487070 487112 487153 487195 487237 487278 487320 487362 487404 487445 487487 487529 487570 487612 487654 487696 487737 487779 487821 487862 487904 487946 487987 488029 488071 488113 488154 488196 488238 488279 488321 488363 488405 488446 488488 488530 488571 488613 488655 488697 488738 488780 488822 488863 488905 488947 488988 489030 489072 489114 489155 489197 489239 489280 489322 489364 489406 489447 489489 489531 489572 489614 489656 489698 489739 489781 489823 489864 489906 489948 489989 490031 490073 490115 490156 490198 490240 490281 490323 490365 490407 490448 490490 490532 490573 490615 490657 490699 490740 490782 490824 490865 490907 490949 490990 491032 491074 491116 491157 491199 491241 491282 491324 491366 491408 491449 491491 491533 491574 491616 491658 491700 491741 491783 491825 491866 491908 491950 491991 492033 492075 492117 492158 492200 492242 492283 492325 492367 492409 492450 492492 492534 492575 492617 492659 492701 492742 492784 492826 492859 492892 492926 492959 492992 493026 493059 493093 493126 493159 493201 493243 493284 493326 493368 493410 493451 493493 493535 493576 493618 493660 493702 493743 493785 493827 493868 493910 493952 493993 494035 494077 494119 494160 494202 494244 494285 494327 494369 494411 494452 494494 494536 494577 494619 494661 494703 494744 494786 494828 494869 494911 494953 494994 495036 495078 495120 495161 495203 495245 495286 495328 495370 495412 495453 495495 495537 495578 495620 495662 495704 495745 495787 495829 495870 495912 495954 495995 496037 496079 496121 496162 496204 496246 496287 496329 496371 496413 496454 496496 496538 496579 496621 496663 496705 496746 496788 496830 496871 496913 496955 496996 497038 497080 497122 497163 497205 497247 497288 497330 497372 497414 497455 497497 497539 497580 497622 497664 497706 497747 497789 497831 497872 497914 497956 497997 498039 498081 498123 498164 498206 498248 498289 498331 498373 498415 498456 498498 498540 498581 498623 498665 498707 498748 498790 498832 498873 498915 498957 498998 499040 499082 499124 499165 499207 499249 499290 499332 499374 499416 499457 499499 499541 499582 499624 499666 499708 499749 499791 499833 499874 499916 499958 499999 500041 500083 500125 500166 500208 500250 500291 500333 500375 500417 500458 500500 500542 500583 500625 500667 500709 500750 500792 500834 500875 500917 500959 501000 501042 501084 501126 501167 501209 501251 501292 501334 501376 501418 501459 501501 501543 501584 501626 501668 501710 501751 501793 501835 501876 501918 501960 502001 502043 502085 502127 502168 502210 502252 502293 502335 502377 502419 502460 502502 502544 502585 502627 502669 502711 502752 502794 502836 502877 502919 502961 503002 503044 503086 503128 503169 503211 503253 503294 503336 503378 503420 503461 503503 503545 503586 503628 503670 503712 503753 503795 503837 503878 503920 503962 504003 504045 504087 504129 504170 504212 504254 504295 504337 504379 504421 504462 504504 504546 504587 504629 504671 504713 504754 504796 504838 504879 504921 504963 505004 505046 505088 505130 505171 505213 505255 505296 505338 505380 505422 505463 505505 505547 505588 505630 505672 505714 505755 505797 505839 505880 505922 505964 506005 506047 506089 506131 506172 506214 506256 506297 506339 506381 506423 506464 506506 506548 506589 506631 506673 506715 506756 506798 506840 506881 506923 506965 507006 507048 507090 507132 507173 507215 507257 507298 507340 507382 507424 507465 507507 507549 507590 507632 507674 507716 507757 507799 507841 507882 507924 507966 508007 508049 508091 508133 508174 508216 508258 508299 508341 508383 508425 508466 508508 508550 508591 508633 508675 508708 508742 508775 508808 508842 508875 508908 508942 508975 509008 509042 509075 509109 509142 509175 509217 509259 509300 509342 509376 509409 509442 509476 509509 509542 509576 509609 509642 509676 509709 509743 509776 509809 509843 509876 509909 509943 509976 510009 510043 510076 510110 510143 510176 510210 510243 510276 510310 510343 510377 510410 510443 510477 510510 510543 510577 510610 510643 510677 510710 510744 510777 510810 510844 510877 510910 510944 510977 511010 511044 511077 511111 511144 511177 511211 511244 511277 511311 511344 511378 511411 511444 511478 511511 511544 511578 511611 511644 511678 511711 511745 511778 511811 511845 511878 511911 511945 511978 512011 512045 512078 512112 512145 512178 512212 512245 512278 512312 512345 512379 512412 512445 512479 512512 512545 512579 512612 512645 512679 512712 512746 512779 512812 512846 512879 512912 512946 512979 513012 513046 513079 513113 513146 513179 513213 513246 513279 513313 513346 513388 513430 513471 513513 513555 513596 513638 513680 513722 513763 513805 513847 513888 513930 513972 514013 514055 514097 514139 514180 514222 514264 514305 514347 514389 514431 514472 514514 514556 514597 514639 514681 514723 514764 514806 514848 514889 514931 514973 515014 515056 515098 515140 515181 515223 515265 515306 515348 515390 515432 515473 515515 515557 515598 515640 515682 515724 515765 515807 515849 515890 515932 515974 516015 516057 516099 516141 516182 516224 516266 516307 516349 516391 516433 516474 516516 516558 516599 516641 516683 516725 516766 516808 516850 516891 516933 516975 517016 517058 517100 517142 517183 517225 517267 517308 517350 517392 517434 517475 517517 517559 517600 517642 517684 517726 517767 517809 517851 517892 517934 517976 518017 518059 518101 518143 518184 518218 518251 518284 518318 518351 518385 518418 518451 518485 518518 518551 518585 518618 518651 518685 518718 518752 518785 518818 518852 518885 518918 518952 518985 519018 519052 519085 519119 519152 519185 519227 519269 519310 519352 519394 519436 519477 519519 519561 519602 519644 519686 519728 519769 519811 519853 519894 519936 519978 520019 520061 520103 520145 520186 520228 520270 520311 520353 520395 520437 520478 520520 520562 520603 520645 520687 520729 520770 520812 520854 520895 520937 520979 521020 521062 521104 521146 521187 521229 521271 521312 521354 521396 521438 521479 521521 521563 521604 521646 521688 521730 521771 521813 521855 521896 521938 521980 522021 522063 522105 522147 522188 522230 522272 522313 522355 522389 522422 522455 522489 522522 522555 522589 522622 522655 522689 522722 522756 522789 522822 522856 522889 522922 522956 522989 523022 523056 523089 523123 523156 523189 523223 523256 523289 523323 523356 523390 523423 523456 523490 523523 523556 523590 523623 523656 523690 523723 523757 523790 523823 523857 523890 523923 523957 523990 524023 524057 524090 524124 524157 524190 524224 524257 524290 524324 524357 524391 524424 524457 524491 524524 524557 524591 524624 524657 524691 524724 524758 524791 524824 524858 524899 524941 524983 525024 525066 525108 525150 525191 525233 525275 525316 525358 525400 525442 525483 525525 525567 525608 525650 525692 525734 525775 525817 525859 525900 525942 525984 526025 526067 526109 526151 526192 526234 526276 526317 526359 526401 526443 526484 526526 526568 526609 526651 526693 526735 526776 526818 526860 526901 526943 526985 527026 527068 527110 527152 527193 527235 527277 527318 527360 527402 527444 527485 527527 527569 527610 527652 527694 527736 527777 527819 527861 527894 527927 527961 527994 528027 528061 528094 528128 528161 528194 528228 528261 528294 528328 528361 528395 528428 528461 528495 528528 528561 528595 528628 528661 528695 528728 528762 528795 528828 528862 528895 528928 528962 528995 529028 529062 529095 529129 529162 529195 529229 529262 529295 529329 529362 529396 529429 529462 529496 529529 529562 529596 529629 529662 529696 529729 529763 529796 529829 529863 529896 529929 529963 529996 530029 530071 530113 530155 530196 530238 530280 530321 530363 530405 530447 530488 530530 530572 530613 530655 530697 530739 530780 530822 530864 530905 530947 530989 531030 531072 531114 531156 531197 531239 531281 531322 531364 531406 531448 531489 531531 531573 531614 531656 531698 531740 531781 531823 531865 531906 531948 531990 532031 532073 532115 532157 532198 532240 532282 532323 532365 532407 532449 532490 532532 532574 532615 532657 532699 532741 532782 532824 532866 532907 532949 532991 533032 533074 533116 533158 533199 533241 533283 533324 533366 533408 533450 533491 533533 533575 533616 533658 533700 533742 533783 533825 533867 533908 533950 533992 534033 534075 534117 534159 534200 534242 534284 534325 534367 534409 534451 534492 534534 534576 534617 534659 534701 534743 534784 534826 534868 534909 534951 534993 535034 535076 535118 535160 535201 535243 535285 535326 535368 535410 535452 535493 535535 535577 535618 535660 535702 535744 535785 535827 535869 535910 535952 535994 536035 536077 536119 536161 536202 536244 536286 536327 536369 536411 536453 536494 536536 536578 536619 536661 536703 536745 536786 536828 536870 536911 536953 536995 537036 537078 537120 537162 537203 537245 537287 537328 537370 537412 537454 537495 537537 537579 537620 537662 537704 537746 537787 537829 537871 537904 537937 537971 538004 538037 538071 538104 538138 538171 538204 538238 538271 538304 538338 538371 538413 538455 538496 538538 538571 538605 538638 538671 538705 538738 538772 538805 538838 538872 538905 538938 538972 539005 539038 539080 539122 539164 539205 539239 539272 539305 539339 539372 539406 539439 539472 539506 539539 539572 539606 539639 539672 539706 539748 539789 539831 539873 539906 539939 539973 540006 540039 540073 540106 540140 540173 540206 540240 540273 540306 540340 540373 540415 540457 540498 540540 540582 540623 540665 540707 540749 540790 540832 540874 540915 540957 540999 541040 541082 541124 541166 541207 541249 541291 541332 541374 541416 541458 541499 541541 541583 541624 541666 541708 541750 541791 541833 541875 541916 541958 542000 542041 542083 542125 542167 542208 542250 542292 542333 542375 542417 542459 542500 542542 542584 542625 542667 542709 542751 542792 542834 542876 542917 542959 543001 543042 543084 543126 543168 543209 543251 543293 543334 543376 543418 543460 543501 543543 543585 543626 543668 543710 543752 543793 543835 543877 543918 543960 544002 544043 544085 544127 544169 544210 544252 544294 544335 544377 544419 544461 544502 544544 544586 544627 544669 544711 544744 544778 544811 544844 544878 544911 544944 544978 545011 545044 545078 545111 545145 545178 545211 545245 545278 545311 545345 545378 545412 545445 545478 545512 545545 545578 545612 545645 545678 545712 545745 545779 545812 545845 545879 545912 545945 545979 546012 546045 546079 546112 546146 546179 546212 546246 546279 546312 546346 546379 546413 546446 546479 546513 546546 546579 546613 546646 546679 546713 546746 546780 546813 546846 546880 546913 546946 546980 547013 547046 547080 547113 547147 547180 547213 547247 547280 547313 547347 547380 547414 547447 547480 547514 547547 547589 547630 547672 547714 547756 547797 547839 547881 547922 547964 548006 548047 548089 548131 548173 548214 548256 548298 548339 548381 548423 548465 548506 548548 548590 548631 548673 548715 548757 548798 548840 548882 548923 548965 549007 549048 549090 549132 549174 549215 549257 549299 549340 549382 549424 549466 549507 549549 549591 549632 549674 549716 549758 549799 549841 549883 549924 549966 550008 550049 550091 550133 550175 550216 550258 550300 550341 550383 550425 550467 550508 550550 550592 550633 550675 550717 550759 550800 550842 550884 550925 550967 551009 551050 551092 551134 551176 551217 551259 551301 551342 551384 551426 551468 551509 551551 551593 551634 551676 551718 551760 551801 551843 551885 551926 551968 552010 552051 552093 552135 552177 552218 552260 552302 552343 552385 552427 552469 552510 552552 552594 552635 552677 552719 552761 552802 552844 552886 552927 552969 553011 553052 553094 553136 553178 553219 553261 553303 553344 553386 553428 553470 553511 553553 553595 553636 553678 553720 553762 553803 553845 553887 553928 553970 554012 554053 554095 554137 554179 554220 554262 554304 554345 554387 554429 554471 554512 554554 554596 554637 554679 554721 554763 554804 554846 554888 554929 554971 555013 555054 555096 555138 555180 555221 555263 555305 555346 555388 555422 555455 555488 555522 555555 555588 555622 555655 555688 555722 555755 555789 555822 555855 555889 555922 555955 555989 556022 556055 556089 556122 556156 556189 556222 556256 556289 556322 556356 556389 556423 556456 556489 556523 556556 556589 556623 556656 556689 556723 556756 556790 556823 556856 556890 556923 556956 556990 557023 557056 557090 557123 557157 557190 557223 557257 557290 557323 557357 557390 557424 557457 557490 557524 557557 557590 557624 557657 557690 557724 557757 557791 557824 557857 557891 557924 557957 557991 558024 558057 558091 558124 558158 558191 558224 558258 558291 558324 558358 558391 558425 558458 558491 558525 558558 558591 558625 558658 558691 558725 558758 558792 558825 558858 558892 558925 558958 558992 559025 559058 559092 559125 559159 559192 559225 559259 559292 559325 559359 559392 559426 559459 559492 559526 559559 559592 559626 559659 559692 559726 559759 559793 559826 559859 559893 559926 559959 559993 560026 560059 560093 560126 560160 560193 560226 560260 560293 560326 560360 560393 560427 560460 560493 560527 560560 560593 560627 560660 560693 560727 560760 560794 560827 560860 560894 560927 560960 560994 561027 561060 561094 561127 561161 561194 561227 561261 561294 561327 561361 561394 561428 561461 561494 561528 561561 561594 561628 561661 561694 561728 561761 561795 561828 561861 561895 561928 561961 561995 562028 562061 562095 562128 562162 562195 562228 562262 562295 562328 562362 562395 562429 562462 562495 562529 562562 562595 562629 562662 562695 562729 562762 562796 562829 562862 562896 562929 562962 562996 563029 563062 563096 563129 563163 563196 563229 563263 563296 563329 563363 563396 563430 563463 563496 563530 563563 563596 563630 563663 563696 563730 563763 563797 563830 563863 563897 563930 563963 563997 564030 564063 564097 564130 564164 564197 564230 564264 564297 564330 564364 564397 564431 564464 564497 564531 564564 564597 564631 564664 564697 564731 564764 564798 564831 564864 564898 564931 564964 564998 565031 565064 565098 565131 565165 565198 565231 565265 565298 565331 565365 565398 565432 565465 565498 565532 565565 565598 565632 565665 565698 565732 565765 565799 565832 565865 565899 565932 565965 565999 566032 566065 566099 566132 566166 566199 566232 566266 566299 566332 566366 566399 566433 566466 566499 566533 566566 566599 566633 566666 566699 566733 566766 566800 566833 566866 566900 566933 566966 567000 567033 567066 567100 567133 567167 567200 567233 567267 567300 567333 567367 567400 567434 567467 567500 567534 567567 567600 567634 567667 567700 567734 567767 567801 567834 567867 567901 567934 567967 568001 568034 568067 568101 568134 568168 568201 568234 568268 568301 568334 568368 568401 568435 568468 568501 568535 568568 568601 568635 568668 568701 568735 568768 568802 568835 568868 568902 568935 568968 569002 569035 569068 569102 569135 569169 569202 569235 569277 569319 569360 569402 569444 569486 569527 569569 569611 569652 569694 569736 569778 569819 569861 569903 569944 569986 570028 570069 570111 570153 570195 570236 570278 570320 570361 570403 570445 570487 570528 570570 570612 570653 570695 570737 570779 570820 570862 570904 570945 570987 571029 571070 571112 571154 571196 571237 571279 571321 571362 571404 571446 571488 571529 571571 571613 571654 571696 571738 571780 571821 571863 571905 571946 571988 572030 572071 572113 572155 572197 572238 572280 572322 572363 572405 572447 572489 572530 572572 572614 572655 572697 572739 572781 572822 572864 572906 572947 572989 573031 573072 573106 573139 573173 573206 573239 573273 573306 573339 573373 573406 573440 573473 573506 573540 573573 573606 573640 573673 573706 573740 573773 573807 573840 573873 573907 573940 573973 574007 574040 574073 574107 574140 574174 574207 574240 574274 574307 574340 574374 574407 574441 574474 574507 574541 574574 574607 574641 574674 574707 574741 574774 574808 574841 574874 574908 574949 574991 575033 575074 575108 575141 575175 575208 575241 575275 575308 575341 575375 575408 575442 575475 575508 575542 575575 575608 575642 575675 575708 575742 575775 575809 575842 575875 575909 575942 575975 576009 576042 576075 576109 576142 576176 576209 576242 576276 576309 576342 576376 576409 576443 576476 576509 576543 576576 576609 576643 576676 576709 576743 576776 576810 576843 576876 576910 576943 576976 577010 577043 577076 577110 577143 577177 577210 577243 577277 577310 577343 577377 577410 577444 577477 577510 577544 577577 577610 577644 577677 577710 577744 577777 577811 577844 577877 577911 577944 577977 578011 578044 578077 578111 578144 578178 578211 578244 578278 578311 578344 578378 578411 578445 578478 578511 578545 578578 578611 578645 578678 578711 578745 578778 578812 578845 578878 578912 578945 578978 579012 579045 579078 579120 579162 579204 579245 579287 579329 579370 579412 579454 579496 579537 579579 579621 579662 579704 579746 579779 579813 579846 579879 579913 579946 579979 580013 580046 580079 580113 580146 580180 580213 580246 580280 580313 580346 580380 580413 580447 580480 580513 580547 580580 580613 580647 580680 580713 580747 580780 580814 580847 580880 580914 580947 580980 581014 581047 581080 581122 581164 581206 581247 581289 581331 581372 581414 581456 581498 581539 581581 581623 581664 581706 581748 581781 581815 581848 581881 581915 581948 581981 582015 582048 582081 582115 582148 582182 582215 582248 582282 582315 582348 582382 582415 582449 582482 582515 582549 582582 582615 582649 582682 582715 582749 582782 582816 582849 582882 582916 582949 582982 583016 583049 583082 583116 583149 583183 583216 583249 583283 583316 583349 583383 583416 583458 583500 583541 583583 583625 583666 583708 583750 583792 583833 583875 583917 583950 583983 584017 584050 584083 584117 584150 584184 584217 584250 584284 584317 584350 584384 584417 584451 584484 584517 584551 584584 584617 584651 584684 584717 584751 584784 584818 584851 584884 584918 584951 584984 585018 585051 585084 585118 585151 585185 585218 585251 585285 585318 585351 585385 585418 585452 585485 585518 585552 585585 585618 585652 585685 585718 585752 585785 585819 585852 585885 585919 585952 585985 586019 586052 586085 586119 586152 586186 586219 586252 586286 586319 586352 586386 586419 586453 586486 586519 586553 586586 586619 586653 586686 586719 586753 586786 586820 586853 586886 586920 586953 586986 587020 587053 587086 587120 587153 587187 587220 587253 587287 587320 587353 587387 587420 587454 587487 587520 587554 587587 587620 587654 587687 587720 587754 587787 587821 587854 587887 587921 587954 587987 588021 588054 588087 588121 588154 588188 588221 588254 588288 588321 588354 588388 588421 588455 588488 588521 588555 588588 588621 588655 588688 588721 588755 588788 588822 588855 588888 588922 588955 588988 589022 589055 589088 589122 589155 589189 589222 589255 589289 589322 589355 589389 589422 589456 589489 589522 589556 589589 589622 589656 589689 589722 589756 589789 589823 589856 589889 589923 589956 589989 590023 590056 590089 590123 590156 590190 590223 590256 590290 590323 590356 590390 590423 590457 590490 590523 590557 590590 590623 590657 590690 590723 590757 590790 590824 590857 590890 590924 590957 590990 591024 591057 591090 591124 591157 591191 591224 591257 591291 591324 591357 591391 591424 591458 591491 591524 591558 591591 591624 591658 591691 591724 591758 591791 591825 591858 591891 591925 591958 591991 592025 592058 592091 592125 592158 592192 592225 592258 592292 592325 592358 592392 592425 592459 592492 592525 592559 592592 592625 592659 592692 592725 592759 592792 592826 592859 592892 592926 592959 592992 593026 593059 593092 593126 593159 593193 593226 593259 593293 593326 593359 593393 593426 593460 593493 593526 593560 593593 593626 593660 593693 593726 593760 593793 593827 593860 593893 593927 593960 593993 594027 594060 594093 594127 594160 594194 594227 594260 594294 594327 594360 594394 594427 594461 594494 594527 594561 594594 594627 594661 594694 594727 594761 594794 594828 594861 594894 594928 594961 594994 595028 595061 595094 595128 595161 595195 595228 595261 595295 595328 595361 595395 595428 595462 595495 595528 595562 595595 595628 595662 595695 595728 595762 595795 595829 595862 595895 595929 595962 595995 596029 596062 596095 596129 596162 596196 596229 596262 596296 596329 596362 596396 596429 596463 596496 596529 596563 596596 596629 596663 596696 596729 596763 596796 596830 596863 596896 596930 596963 596996 597030 597063 597096 597130 597163 597197 597230 597263 597297 597330 597363 597397 597430 597464 597497 597530 597564 597597 597630 597664 597697 597730 597764 597797 597831 597864 597897 597931 597964 597997 598031 598064 598097 598131 598164 598198 598231 598264 598306 598348 598389 598431 598473 598515 598556 598598 598640 598681 598723 598765 598807 598848 598890 598932 598973 599015 599057 599098 599140 599182 599224 599265 599307 599349 599390 599432 599474 599516 599557 599599 599641 599682 599724 599766 599808 599849 599891 599933 599974 600016 600058 600099 600133 600166 600200 600233 600266 600300 600333 600366 600400 600433 600467 600500 600533 600567 600600 600633 600667 600700 600733 600767 600800 600834 600867 600900 600934 600967 601000 601034 601067 601100 601134 601167 601201 601234 601267 601301 601334 601367 601401 601434 601468 601501 601534 601568 601601 601634 601668 601701 601734 601768 601801 601835 601868 601901 601935 601968 602001 602035 602068 602101 602135 602168 602202 602235 602268 602302 602335 602368 602402 602435 602469 602502 602535 602569 602602 602635 602669 602702 602735 602769 602802 602836 602869 602902 602936 602969 603002 603036 603069 603102 603136 603169 603203 603236 603269 603303 603336 603369 603403 603436 603478 603520 603561 603603 603645 603686 603728 603770 603812 603853 603895 603937 603978 604020 604062 604103 604145 604187 604229 604270 604312 604354 604395 604437 604479 604521 604562 604604 604646 604687 604729 604771 604813 604854 604896 604938 604979 605021 605063 605104 605146 605188 605230 605271 605313 605355 605396 605438 605480 605522 605563 605605 605647 605688 605730 605772 605814 605855 605897 605939 605980 606022 606064 606105 606147 606189 606231 606272 606314 606356 606397 606439 606481 606523 606564 606606 606648 606689 606731 606773 606815 606856 606898 606940 606981 607023 607065 607106 607148 607190 607232 607273 607315 607357 607398 607440 607482 607524 607565 607607 607649 607690 607732 607774 607816 607857 607899 607941 607982 608024 608066 608107 608149 608191 608233 608274 608316 608358 608399 608441 608483 608525 608566 608608 608650 608691 608733 608775 608817 608858 608900 608942 608983 609025 609067 609108 609142 609175 609209 609242 609275 609309 609342 609375 609409 609442 609476 609509 609542 609576 609609 609642 609676 609709 609742 609776 609809 609843 609876 609909 609943 609976 610009 610043 610076 610109 610143 610176 610210 610243 610276 610310 610343 610376 610410 610443 610477 610510 610543 610577 610610 610643 610677 610710 610743 610777 610810 610844 610877 610910 610944 610977 611010 611044 611077 611110 611144 611177 611211 611244 611277 611311 611344 611377 611411 611444 611478 611511 611544 611578 611611 611644 611678 611711 611744 611778 611811 611845 611878 611911 611945 611986 612028 612070 612111 612153 612195 612237 612278 612312 612345 612378 612412 612445 612487 612529 612570 612612 612654 612695 612737 612779 612812 612846 612879 612912 612946 612979 613012 613046 613079 613112 613146 613179 613213 613246 613279 613313 613346 613379 613413 613446 613480 613513 613546 613580 613613 613646 613680 613713 613746 613780 613813 613847 613880 613913 613947 613980 614013 614047 614080 614113 614155 614197 614239 614280 614322 614364 614405 614447 614489 614531 614572 614614 614656 614697 614739 614781 614823 614864 614906 614948 614989 615031 615073 615114 615156 615198 615240 615281 615323 615365 615406 615448 615490 615532 615573 615615 615657 615698 615740 615782 615824 615865 615907 615949 615990 616032 616074 616115 616157 616199 616241 616282 616324 616366 616407 616449 616491 616533 616574 616616 616658 616699 616741 616783 616825 616866 616908 616950 616991 617033 617075 617116 617158 617200 617242 617283 617325 617367 617408 617450 617492 617534 617575 617617 617659 617700 617742 617784 617826 617867 617909 617951 617992 618034 618076 618117 618159 618201 618243 618284 618326 618368 618409 618451 618493 618535 618576 618618 618660 618701 618743 618785 618827 618868 618910 618952 618993 619035 619077 619118 619160 619202 619244 619285 619327 619369 619410 619452 619494 619536 619577 619619 619661 619702 619744 619786 619828 619869 619911 619953 619994 620036 620078 620119 620161 620203 620245 620286 620328 620370 620411 620453 620495 620537 620578 620620 620662 620703 620745 620787 620820 620854 620887 620920 620954 620987 621020 621054 621087 621120 621154 621187 621221 621254 621287 621321 621354 621387 621421 621454 621488 621521 621554 621588 621621 621654 621688 621721 621754 621788 621821 621855 621888 621921 621955 621988 622021 622055 622088 622121 622155 622188 622222 622255 622288 622322 622355 622388 622422 622455 622489 622522 622555 622589 622622 622655 622689 622722 622755 622789 622822 622856 622889 622922 622956 622989 623022 623056 623089 623122 623156 623189 623223 623256 623289 623323 623356 623389 623423 623456 623490 623523 623556 623590 623623 623656 623690 623723 623756 623790 623823 623857 623890 623923 623957 623990 624023 624057 624090 624123 624157 624190 624224 624257 624290 624324 624357 624390 624424 624457 624491 624524 624557 624591 624624 624657 624691 624724 624757 624791 624824 624858 624891 624924 624958 624991 625024 625058 625091 625124 625158 625191 625225 625258 625291 625325 625358 625391 625425 625458 625492 625525 625558 625592 625625 625658 625692 625725 625758 625792 625825 625859 625892 625925 625959 625992 626025 626059 626092 626125 626159 626192 626226 626259 626292 626326 626359 626392 626426 626459 626493 626526 626559 626593 626626 626659 626693 626726 626759 626793 626826 626860 626893 626926 626960 626993 627026 627060 627093 627126 627160 627193 627227 627260 627293 627327 627360 627393 627427 627460 627494 627527 627560 627594 627627 627660 627694 627727 627760 627794 627827 627861 627894 627927 627961 628002 628044 628086 628127 628169 628211 628253 628294 628336 628378 628419 628461 628503 628545 628586 628628 628670 628711 628753 628795 628837 628878 628920 628962 629003 629045 629087 629128 629170 629212 629254 629295 629337 629379 629420 629462 629504 629546 629587 629629 629671 629712 629754 629796 629838 629879 629921 629963 630004 630046 630088 630129 630171 630213 630255 630296 630338 630380 630421 630463 630505 630547 630588 630630 630672 630713 630755 630797 630839 630880 630922 630964 631005 631047 631089 631130 631172 631214 631256 631297 631339 631381 631422 631464 631506 631548 631589 631631 631673 631714 631756 631798 631840 631881 631923 631965 632006 632048 632090 632131 632173 632215 632257 632298 632340 632382 632423 632465 632507 632549 632590 632632 632674 632715 632757 632799 632841 632882 632924 632966 633007 633049 633091 633132 633174 633216 633258 633299 633341 633383 633424 633466 633508 633550 633591 633633 633666 633700 633733 633766 633800 633833 633867 633900 633933 633967 634000 634033 634067 634100 634133 634167 634200 634234 634267 634300 634334 634367 634400 634434 634467 634501 634534 634567 634601 634634 634667 634701 634734 634767 634801 634834 634868 634901 634934 634968 635001 635034 635068 635101 635134 635168 635201 635235 635268 635301 635335 635368 635401 635435 635468 635502 635535 635568 635602 635635 635668 635702 635735 635768 635802 635835 635869 635902 635935 635969 636002 636035 636069 636102 636135 636169 636202 636236 636269 636302 636336 636369 636402 636436 636469 636503 636536 636569 636603 636636 636669 636703 636736 636769 636803 636836 636870 636903 636936 636970 637003 637036 637070 637103 637136 637170 637203 637237 637270 637303 637337 637370 637403 637437 637470 637504 637537 637570 637604 637637 637670 637704 637737 637770 637804 637837 637871 637904 637937 637971 638004 638037 638071 638104 638137 638171 638204 638238 638271 638304 638338 638371 638404 638438 638471 638505 638538 638571 638605 638638 638671 638705 638738 638771 638805 638838 638872 638905 638938 638972 639005 639038 639072 639105 639138 639172 639205 639239 639272 639305 639339 639372 639405 639439 639472 639506 639539 639572 639606 639639 639672 639706 639739 639772 639806 639839 639873 639906 639939 639973 640006 640039 640073 640106 640139 640173 640206 640240 640273 640306 640340 640373 640406 640440 640473 640507 640540 640573 640607 640640 640673 640707 640740 640773 640807 640840 640874 640907 640940 640974 641007 641040 641074 641107 641140 641174 641207 641241 641274 641307 641341 641374 641407 641441 641474 641508 641541 641574 641608 641641 641683 641724 641766 641808 641841 641875 641908 641941 641975 642016 642058 642100 642141 642183 642225 642267 642308 642350 642392 642433 642475 642517 642559 642600 642642 642684 642725 642767 642809 642851 642892 642934 642976 643017 643059 643101 643142 643184 643226 643268 643309 643351 643393 643434 643476 643518 643560 643601 643643 643685 643726 643768 643810 643852 643893 643935 643977 644018 644060 644102 644143 644185 644227 644269 644310 644352 644394 644435 644477 644519 644561 644602 644644 644686 644727 644769 644811 644853 644894 644936 644978 645019 645061 645103 645144 645186 645228 645270 645311 645353 645395 645436 645478 645520 645562 645603 645645 645687 645728 645770 645812 645854 645895 645937 645979 646020 646062 646104 646145 646187 646229 646271 646312 646354 646396 646437 646479 646521 646563 646604 646646 646688 646729 646771 646813 646855 646896 646938 646980 647021 647063 647105 647146 647188 647230 647272 647313 647355 647397 647438 647480 647522 647564 647605 647647 647689 647730 647772 647814 647856 647897 647939 647981 648022 648064 648106 648147 648189 648231 648273 648314 648356 648398 648439 648481 648523 648565 648606 648648 648690 648731 648773 648815 648857 648898 648940 648982 649023 649065 649107 649148 649190 649232 649274 649315 649357 649399 649440 649482 649524 649566 649607 649649 649691 649732 649774 649816 649858 649899 649941 649983 650024 650066 650108 650149 650191 650233 650275 650316 650358 650400 650441 650483 650525 650567 650608 650650 650692 650733 650775 650817 650859 650900 650942 650984 651025 651067 651109 651150 651192 651234 651276 651317 651359 651401 651442 651484 651526 651568 651609 651651 651693 651734 651776 651818 651860 651901 651943 651985 652026 652068 652110 652151 652193 652235 652277 652318 652360 652402 652443 652485 652527 652569 652610 652652 652694 652735 652777 652819 652861 652902 652944 652986 653027 653069 653111 653152 653186 653219 653253 653286 653319 653353 653386 653419 653453 653486 653520 653553 653586 653620 653653 653686 653720 653753 653786 653820 653853 653887 653920 653953 653987 654020 654053 654087 654120 654153 654187 654220 654254 654287 654320 654354 654387 654420 654454 654487 654521 654554 654587 654621 654654 654687 654721 654754 654787 654821 654854 654888 654921 654954 654988 655021 655054 655088 655121 655154 655188 655221 655255 655288 655321 655355 655388 655421 655455 655488 655522 655555 655588 655622 655655 655688 655722 655755 655788 655822 655855 655889 655922 655955 655989 656022 656055 656089 656122 656155 656189 656222 656256 656289 656322 656356 656389 656422 656456 656489 656523 656556 656589 656623 656656 656689 656723 656756 656789 656823 656856 656890 656923 656956 656990 657023 657056 657090 657123 657156 657190 657223 657257 657290 657323 657357 657390 657423 657457 657490 657524 657557 657590 657624 657657 657690 657724 657757 657790 657824 657857 657891 657924 657957 657991 658024 658057 658091 658124 658157 658191 658224 658258 658291 658324 658358 658391 658424 658458 658491 658525 658558 658591 658625 658658 658691 658725 658758 658791 658825 658858 658892 658925 658958 658992 659025 659058 659092 659125 659158 659192 659225 659259 659292 659325 659359 659392 659425 659459 659492 659534 659576 659617 659659 659701 659742 659784 659826 659868 659909 659951 659993 660034 660076 660118 660159 660201 660243 660285 660326 660368 660410 660451 660493 660535 660577 660618 660660 660702 660743 660785 660827 660869 660910 660952 660994 661035 661077 661119 661160 661202 661244 661286 661327 661369 661411 661452 661494 661536 661578 661619 661661 661703 661744 661786 661828 661870 661911 661953 661995 662036 662078 662120 662161 662203 662245 662287 662328 662370 662412 662453 662495 662537 662579 662620 662662 662704 662745 662787 662829 662871 662912 662954 662996 663037 663079 663121 663162 663204 663246 663288 663329 663371 663413 663454 663496 663538 663580 663621 663663 663705 663746 663788 663830 663863 663897 663930 663963 663997 664030 664063 664097 664130 664163 664197 664230 664264 664297 664330 664364 664397 664430 664464 664497 664531 664564 664597 664631 664664 664697 664731 664764 664797 664831 664864 664898 664931 664964 664998 665031 665064 665098 665131 665164 665198 665231 665265 665298 665331 665365 665398 665431 665465 665498 665532 665565 665598 665632 665665 665698 665732 665765 665798 665832 665865 665899 665932 665965 665999 666032 666065 666099 666132 666165 666199 666232 666266 666299 666332 666374 666416 666457 666499 666541 666583 666624 666666 666708 666749 666791 666833 666875 666916 666958 667000 667041 667083 667125 667166 667208 667250 667292 667333 667375 667417 667458 667500 667534 667567 667600 667634 667667 667709 667750 667792 667834 667876 667917 667959 668001 668042 668084 668126 668167 668209 668251 668293 668334 668376 668418 668459 668501 668543 668585 668626 668668 668710 668751 668793 668835 668877 668918 668960 669002 669043 669085 669127 669168 669210 669252 669294 669335 669377 669419 669460 669502 669544 669586 669627 669669 669711 669752 669794 669836 669869 669903 669936 669969 670003 670036 670069 670103 670136 670169 670203 670236 670270 670303 670336 670370 670403 670436 670470 670503 670537 670570 670603 670637 670670 670703 670737 670770 670803 670837 670870 670904 670937 670970 671004 671037 671070 671104 671137 671170 671204 671237 671271 671304 671337 671371 671404 671437 671471 671504 671538 671571 671604 671638 671671 671704 671738 671771 671804 671838 671871 671905 671938 671971 672005 672038 672071 672105 672138 672171 672205 672238 672272 672305 672338 672372 672405 672438 672472 672505 672539 672572 672605 672639 672672 672705 672739 672772 672805 672839 672872 672906 672939 672972 673006 673039 673072 673106 673139 673172 673206 673239 673273 673306 673339 673373 673406 673439 673473 673506 673540 673573 673606 673640 673673 673706 673740 673773 673806 673840 673873 673907 673940 673973 674007 674040 674073 674107 674140 674173 674207 674240 674274 674307 674340 674374 674407 674440 674474 674507 674541 674574 674607 674641 674674 674707 674741 674774 674807 674841 674874 674908 674941 674974 675008 675041 675074 675108 675141 675174 675208 675241 675275 675308 675341 675375 675408 675441 675475 675508 675542 675575 675608 675642 675675 675708 675742 675775 675808 675842 675875 675909 675942 675975 676009 676042 676075 676109 676142 676175 676209 676242 676276 676309 676342 676376 676409 676442 676476 676509 676551 676593 676634 676676 676718 676759 676801 676843 676885 676926 676968 677010 677051 677093 677135 677176 677218 677260 677302 677343 677385 677427 677468 677510 677552 677594 677635 677677 677719 677760 677802 677844 677886 677927 677969 678011 678052 678094 678136 678177 678219 678261 678303 678344 678386 678428 678469 678511 678553 678595 678636 678678 678720 678761 678803 678845 678887 678928 678970 679012 679053 679095 679137 679178 679220 679262 679304 679345 679387 679429 679470 679512 679554 679596 679637 679679 679721 679762 679804 679846 679888 679929 679971 680013 680054 680096 680138 680179 680221 680263 680305 680346 680388 680430 680471 680513 680555 680597 680638 680680 680722 680763 680805 680847 680889 680930 680972 681014 681055 681097 681139 681180 681222 681264 681306 681347 681389 681431 681472 681514 681556 681598 681639 681681 681723 681764 681806 681848 681890 681931 681973 682015 682056 682098 682140 682181 682223 682265 682307 682348 682390 682432 682473 682515 682557 682599 682640 682682 682724 682765 682807 682849 682891 682932 682974 683016 683057 683099 683141 683182 683224 683266 683308 683349 683391 683433 683474 683516 683558 683600 683641 683683 683725 683766 683808 683850 683892 683933 683975 684017 684058 684100 684142 684183 684225 684267 684309 684350 684392 684434 684475 684517 684551 684584 684617 684651 684684 684717 684751 684784 684817 684851 684884 684918 684951 684984 685018 685051 685084 685118 685151 685184 685226 685268 685310 685351 685393 685435 685476 685518 685560 685602 685643 685685 685727 685768 685810 685852 685894 685935 685977 686019 686060 686102 686144 686185 686227 686269 686311 686352 686394 686436 686477 686519 686561 686603 686644 686686 686728 686769 686811 686853 686895 686936 686978 687020 687061 687103 687145 687186 687228 687270 687312 687353 687395 687437 687478 687520 687562 687604 687645 687687 687729 687770 687812 687854 687896 687937 687979 688021 688062 688104 688146 688187 688229 688271 688313 688354 688396 688438 688479 688521 688563 688605 688646 688688 688730 688771 688813 688855 688897 688938 688980 689022 689063 689105 689147 689188 689230 689272 689314 689355 689397 689439 689480 689522 689564 689606 689647 689689 689731 689772 689814 689856 689898 689939 689981 690023 690064 690106 690148 690189 690231 690273 690315 690356 690398 690440 690481 690523 690565 690607 690648 690690 690732 690773 690815 690857 690899 690940 690982 691024 691065 691107 691149 691190 691232 691274 691316 691357 691399 691441 691482 691524 691566 691608 691649 691691 691733 691774 691816 691858 691900 691941 691983 692025 692066 692108 692150 692191 692233 692275 692317 692358 692400 692442 692483 692525 692567 692609 692650 692692 692734 692775 692817 692859 692901 692942 692984 693026 693067 693109 693151 693192 693234 693276 693318 693359 693401 693443 693484 693526 693568 693610 693651 693693 693735 693776 693818 693860 693902 693943 693985 694027 694068 694110 694152 694193 694235 694277 694319 694360 694402 694444 694485 694527 694569 694611 694652 694694 694736 694777 694819 694861 694903 694944 694986 695028 695061 695094 695128 695161 695194 695228 695261 695295 695328 695361 695395 695428 695461 695495 695528 695562 695595 695628 695662 695695 695728 695762 695795 695828 695862 695895 695929 695962 695995 696029 696062 696095 696129 696162 696195 696229 696262 696296 696329 696362 696396 696429 696462 696496 696529 696563 696596 696629 696663 696696 696729 696763 696796 696829 696863 696896 696930 696963 696996 697030 697063 697096 697130 697163 697196 697230 697263 697297 697330 697363 697405 697447 697488 697530 697572 697614 697655 697697 697739 697780 697822 697864 697906 697947 697989 698031 698072 698114 698156 698197 698239 698281 698323 698364 698406 698448 698489 698531 698573 698615 698656 698698 698740 698781 698823 698865 698907 698948 698990 699032 699073 699115 699157 699198 699240 699282 699324 699365 699407 699449 699490 699532 699574 699616 699657 699699 699741 699782 699824 699866 699908 699949 699991 700033 700074 700116 700158 700199 700241 700283 700325 700366 700408 700450 700491 700533 700575 700617 700658 700700 700742 700783 700825 700867 700909 700950 700992 701034 701075 701117 701159 701200 701242 701284 701326 701367 701409 701451 701492 701534 701576 701618 701659 701701 701743 701784 701826 701868 701910 701951 701993 702035 702068 702101 702135 702168 702201 702235 702268 702302 702335 702368 702410 702452 702493 702535 702577 702619 702660 702702 702744 702785 702827 702869 702911 702952 702994 703036 703069 703102 703136 703169 703202 703236 703269 703303 703336 703369 703411 703453 703494 703536 703578 703620 703661 703703 703745 703786 703828 703870 703912 703953 703995 704037 704078 704120 704162 704203 704245 704287 704329 704370 704412 704454 704495 704537 704579 704621 704662 704704 704746 704787 704829 704871 704913 704954 704996 705038 705079 705121 705163 705204 705246 705288 705330 705371 705413 705455 705496 705538 705572 705605 705638 705672 705705 705738 705772 705805 705838 705872 705905 705939 705972 706005 706039 706072 706105 706139 706172 706205 706239 706272 706306 706339 706372 706406 706439 706472 706506 706539 706573 706606 706639 706673 706706 706739 706773 706806 706839 706873 706906 706940 706973 707006 707040 707073 707106 707140 707173 707206 707240 707273 707307 707340 707373 707407 707440 707473 707507 707540 707574 707607 707640 707674 707707 707749 707790 707832 707874 707916 707957 707999 708041 708082 708124 708166 708207 708249 708291 708333 708374 708416 708458 708499 708541 708583 708625 708666 708708 708750 708791 708833 708875 708917 708958 709000 709042 709083 709125 709167 709208 709250 709292 709334 709375 709417 709459 709500 709542 709576 709609 709642 709676 709709 709742 709776 709809 709842 709876 709909 709943 709976 710009 710043 710076 710109 710143 710176 710209 710243 710276 710310 710343 710376 710410 710443 710476 710510 710543 710577 710610 710643 710677 710710 710743 710777 710810 710843 710877 710910 710944 710977 711010 711044 711077 711110 711144 711177 711210 711244 711277 711311 711344 711377 711411 711444 711477 711511 711544 711586 711628 711669 711711 711753 711794 711836 711878 711920 711961 712003 712045 712086 712128 712170 712211 712253 712295 712337 712378 712420 712462 712503 712545 712587 712629 712670 712712 712754 712795 712837 712879 712921 712962 713004 713046 713087 713129 713171 713212 713254 713296 713338 713379 713421 713463 713504 713546 713588 713630 713671 713713 713755 713796 713838 713880 713922 713963 714005 714047 714088 714130 714172 714213 714255 714297 714339 714380 714422 714464 714505 714547 714589 714631 714672 714714 714756 714797 714839 714881 714923 714964 715006 715048 715089 715131 715173 715214 715256 715298 715340 715381 715423 715465 715506 715548 715590 715632 715673 715715 715757 715798 715840 715882 715924 715965 716007 716049 716090 716132 716174 716215 716257 716299 716341 716382 716424 716466 716507 716549 716591 716633 716674 716716 716758 716799 716841 716883 716925 716966 717008 717050 717091 717133 717175 717216 717258 717300 717342 717383 717425 717467 717508 717550 717592 717634 717675 717717 717759 717800 717842 717884 717926 717967 718009 718051 718092 718134 718176 718217 718259 718301 718343 718384 718426 718468 718509 718551 718593 718635 718676 718718 718760 718801 718843 718885 718927 718968 719010 719052 719093 719135 719177 719218 719260 719302 719344 719385 719427 719469 719510 719552 719594 719636 719677 719719 719761 719802 719844 719886 719928 719969 720011 720053 720086 720119 720153 720186 720219 720253 720286 720320 720353 720386 720420 720453 720486 720520 720553 720587 720620 720653 720687 720720 720753 720787 720820 720853 720887 720920 720954 720987 721020 721054 721087 721120 721154 721187 721220 721254 721287 721321 721354 721387 721421 721454 721487 721521 721554 721588 721621 721654 721688 721721 721754 721788 721821 721854 721888 721921 721955 721988 722021 722055 722088 722121 722155 722188 722221 722263 722305 722347 722388 722430 722472 722513 722555 722597 722639 722680 722722 722764 722805 722847 722889 722931 722972 723014 723056 723097 723139 723181 723222 723264 723306 723348 723389 723431 723473 723514 723556 723598 723640 723681 723723 723765 723806 723848 723890 723932 723973 724015 724057 724098 724140 724182 724223 724265 724307 724349 724390 724432 724474 724515 724557 724599 724641 724682 724724 724766 724807 724849 724891 724933 724974 725016 725058 725099 725141 725183 725224 725266 725308 725350 725391 725433 725475 725516 725558 725600 725642 725683 725725 725767 725808 725850 725892 725934 725975 726017 726059 726100 726142 726184 726225 726267 726309 726351 726392 726434 726476 726517 726559 726601 726643 726684 726726 726768 726809 726851 726893 726935 726976 727018 727060 727101 727143 727185 727226 727268 727310 727352 727393 727435 727477 727518 727560 727602 727644 727685 727727 727769 727810 727852 727894 727936 727977 728019 728061 728102 728144 728186 728227 728269 728311 728353 728394 728428 728461 728494 728528 728561 728603 728645 728686 728728 728770 728811 728853 728895 728928 728962 728995 729028 729062 729103 729145 729187 729228 729270 729312 729354 729395 729437 729479 729520 729562 729604 729646 729687 729729 729771 729812 729854 729896 729938 729979 730021 730063 730104 730146 730188 730229 730271 730313 730355 730396 730438 730480 730521 730563 730605 730647 730688 730730 730772 730813 730855 730897 730939 730980 731022 731064 731097 731130 731164 731197 731230 731264 731297 731331 731364 731397 731431 731464 731497 731531 731564 731598 731631 731664 731698 731731 731764 731798 731831 731864 731898 731931 731965 731998 732031 732065 732098 732131 732165 732198 732231 732265 732298 732332 732365 732398 732440 732482 732523 732565 732607 732649 732690 732732 732774 732815 732857 732899 732941 732982 733024 733066 733107 733149 733191 733232 733274 733316 733358 733399 733441 733483 733524 733566 733608 733650 733691 733733 733775 733816 733858 733900 733942 733983 734025 734067 734108 734150 734192 734233 734275 734317 734359 734400 734442 734484 734525 734567 734609 734651 734692 734734 734776 734817 734859 734901 734943 734984 735026 735068 735109 735151 735193 735234 735276 735318 735360 735401 735443 735485 735526 735568 735610 735652 735693 735735 735777 735818 735860 735902 735944 735985 736027 736069 736110 736152 736194 736235 736277 736319 736361 736402 736444 736486 736527 736569 736611 736653 736694 736736 736778 736819 736861 736903 736945 736986 737028 737070 737111 737153 737195 737236 737278 737320 737362 737403 737445 737487 737528 737570 737612 737654 737695 737737 737779 737820 737862 737904 737946 737987 738029 738071 738112 738154 738196 738237 738279 738321 738363 738404 738446 738488 738529 738571 738613 738655 738696 738738 738780 738821 738863 738905 738947 738988 739030 739072 739113 739155 739197 739238 739280 739322 739364 739405 739447 739489 739530 739572 739614 739656 739697 739739 739781 739822 739864 739906 739948 739989 740031 740073 740114 740156 740198 740239 740281 740323 740365 740406 740448 740490 740531 740573 740615 740657 740698 740740 740782 740823 740865 740907 740949 740990 741032 741074 741115 741157 741199 741240 741282 741324 741366 741407 741449 741491 741532 741574 741616 741658 741699 741741 741783 741824 741866 741908 741950 741991 742033 742075 742116 742158 742200 742241 742283 742325 742367 742408 742450 742492 742533 742575 742617 742659 742700 742742 742784 742825 742867 742909 742951 742992 743034 743076 743117 743159 743201 743242 743284 743326 743368 743409 743451 743493 743534 743576 743618 743660 743701 743743 743785 743826 743868 743910 743952 743993 744035 744077 744118 744160 744202 744243 744285 744327 744369 744410 744452 744494 744535 744577 744619 744661 744702 744744 744786 744827 744869 744911 744953 744994 745036 745078 745119 745161 745203 745244 745286 745328 745370 745411 745453 745495 745536 745578 745620 745662 745703 745745 745787 745828 745870 745912 745954 745995 746037 746079 746120 746162 746204 746245 746287 746329 746371 746412 746454 746496 746537 746579 746621 746663 746704 746746 746788 746829 746871 746913 746955 746996 747038 747080 747121 747163 747205 747246 747288 747330 747372 747413 747455 747497 747538 747580 747622 747664 747705 747747 747789 747830 747872 747914 747956 747997 748039 748081 748122 748164 748206 748247 748289 748331 748373 748414 748456 748498 748539 748581 748623 748665 748706 748748 748790 748831 748873 748915 748957 748998 749040 749082 749123 749165 749207 749248 749290 749332 749374 749415 749457 749499 749540 749582 749624 749666 749707 749749 749791 749832 749874 749916 749958 749999 750041 750083 750124 750166 750208 750249 750291 750333 750375 750416 750458 750500 750541 750583 750625 750667 750708 750750 750792 750833 750875 750917 750959 751000 751042 751084 751125 751167 751209 751250 751292 751334 751376 751417 751451 751484 751517 751551 751584 751618 751651 751684 751718 751751 751784 751818 751851 751884 751918 751951 751985 752018 752051 752085 752118 752151 752185 752218 752251 752285 752318 752352 752385 752418 752452 752485 752518 752552 752585 752619 752652 752685 752719 752752 752785 752819 752852 752885 752919 752952 752986 753019 753052 753086 753119 753152 753186 753219 753252 753286 753319 753353 753386 753419 753453 753486 753519 753553 753586 753620 753653 753686 753720 753753 753786 753820 753853 753886 753920 753953 753987 754020 754053 754087 754120 754153 754187 754220 754253 754287 754320 754354 754387 754420 754454 754487 754520 754554 754587 754621 754654 754687 754721 754754 754787 754821 754854 754887 754921 754954 754988 755021 755054 755088 755121 755154 755188 755221 755254 755288 755321 755355 755388 755421 755455 755488 755521 755555 755588 755622 755655 755688 755722 755755 755788 755822 755855 755888 755922 755955 755989 756022 756055 756089 756122 756155 756189 756222 756255 756289 756322 756356 756389 756422 756456 756489 756522 756556 756589 756623 756656 756689 756723 756756 756798 756839 756881 756923 756965 757006 757048 757090 757123 757156 757190 757223 757256 757290 757323 757357 757390 757423 757465 757507 757548 757590 757632 757674 757715 757757 757799 757840 757882 757924 757966 758007 758049 758091 758132 758174 758216 758257 758299 758341 758383 758424 758466 758508 758549 758591 758633 758675 758716 758758 758800 758841 758883 758925 758967 759008 759050 759092 759133 759175 759217 759258 759300 759342 759384 759425 759467 759509 759550 759592 759634 759676 759717 759759 759801 759842 759884 759926 759968 760009 760051 760093 760134 760176 760218 760259 760301 760343 760385 760426 760468 760510 760551 760593 760635 760677 760718 760760 760802 760843 760885 760927 760969 761010 761052 761094 761135 761177 761219 761260 761302 761344 761386 761427 761469 761511 761552 761594 761636 761678 761719 761761 761803 761844 761886 761928 761970 762011 762053 762095 762136 762178 762220 762261 762295 762328 762362 762395 762428 762462 762495 762528 762562 762595 762629 762662 762695 762729 762762 762795 762829 762862 762895 762929 762962 762996 763029 763062 763096 763129 763162 763196 763229 763262 763296 763329 763363 763396 763429 763463 763496 763529 763563 763596 763630 763663 763696 763730 763763 763796 763830 763863 763896 763930 763963 763997 764030 764063 764097 764130 764163 764197 764230 764263 764297 764330 764364 764397 764430 764472 764514 764555 764597 764639 764681 764722 764764 764806 764847 764889 764931 764973 765014 765056 765098 765139 765181 765223 765264 765306 765348 765390 765431 765473 765515 765556 765598 765640 765682 765723 765765 765807 765848 765890 765932 765974 766015 766057 766099 766140 766182 766224 766265 766307 766349 766391 766432 766474 766516 766557 766599 766641 766683 766724 766766 766808 766849 766891 766933 766975 767016 767058 767100 767141 767183 767225 767266 767308 767350 767392 767433 767475 767517 767558 767600 767642 767684 767725 767767 767809 767850 767892 767934 767976 768017 768059 768101 768142 768184 768226 768267 768309 768351 768393 768434 768476 768518 768559 768601 768635 768668 768701 768735 768768 768810 768851 768893 768935 768977 769018 769060 769102 769143 769185 769227 769268 769310 769352 769394 769435 769477 769519 769560 769602 769644 769686 769727 769769 769811 769852 769894 769936 769969 770003 770036 770069 770103 770136 770169 770203 770236 770269 770303 770336 770370 770403 770436 770478 770520 770561 770603 770645 770687 770728 770770 770812 770853 770895 770937 770979 771020 771062 771104 771137 771170 771204 771237 771270 771312 771354 771396 771437 771479 771521 771562 771604 771646 771688 771729 771771 771813 771854 771896 771938 771980 772021 772063 772105 772146 772188 772230 772271 772313 772355 772397 772438 772480 772522 772563 772605 772647 772689 772730 772772 772814 772855 772897 772939 772981 773022 773064 773106 773147 773189 773231 773272 773314 773356 773398 773439 773481 773523 773564 773606 773648 773690 773731 773773 773815 773856 773898 773940 773982 774023 774065 774107 774148 774190 774232 774273 774307 774340 774374 774407 774440 774482 774524 774565 774607 774649 774691 774732 774774 774816 774857 774899 774941 774983 775024 775066 775108 775149 775191 775233 775274 775316 775358 775400 775441 775483 775525 775566 775608 775650 775692 775733 775775 775817 775858 775900 775942 775984 776025 776067 776109 776150 776192 776234 776275 776317 776359 776401 776442 776484 776526 776567 776609 776651 776693 776734 776776 776818 776859 776901 776943 776985 777026 777068 777110 777151 777193 777235 777276 777318 777360 777402 777443 777485 777527 777568 777610 777652 777694 777735 777777 777819 777860 777902 777944 777986 778027 778069 778111 778152 778194 778236 778277 778319 778361 778403 778444 778486 778528 778569 778611 778653 778695 778736 778778 778820 778861 778903 778945 778987 779028 779070 779112 779153 779195 779237 779278 779320 779362 779404 779445 779487 779529 779570 779612 779654 779696 779737 779779 779821 779862 779904 779946 779988 780029 780071 780113 780154 780196 780238 780279 780321 780363 780405 780446 780488 780530 780571 780613 780655 780697 780738 780780 780822 780863 780905 780947 780989 781030 781072 781114 781155 781197 781239 781280 781322 781364 781406 781447 781489 781531 781572 781614 781656 781698 781739 781781 781823 781864 781906 781948 781990 782031 782073 782115 782156 782198 782240 782281 782323 782365 782407 782448 782482 782515 782548 782582 782615 782649 782682 782715 782749 782782 782815 782849 782882 782915 782949 782991 783032 783074 783116 783157 783199 783241 783282 783324 783366 783408 783449 783491 783533 783574 783616 783658 783700 783741 783783 783825 783866 783908 783950 783992 784033 784075 784117 784158 784200 784242 784283 784325 784367 784409 784450 784492 784534 784575 784617 784659 784701 784742 784784 784826 784867 784909 784951 784993 785034 785076 785118 785159 785201 785243 785284 785326 785368 785410 785451 785493 785535 785576 785618 785660 785702 785743 785785 785827 785868 785910 785952 785994 786035 786077 786119 786160 786202 786244 786285 786327 786369 786411 786452 786494 786536 786577 786619 786661 786703 786744 786786 786828 786869 786911 786953 786995 787036 787078 787120 787161 787203 787245 787286 787328 787370 787412 787453 787495 787537 787578 787620 787662 787704 787745 787787 787829 787870 787912 787954 787996 788037 788079 788121 788162 788204 788246 788287 788329 788371 788413 788454 788496 788538 788579 788621 788663 788705 788746 788788 788830 788871 788913 788955 788997 789038 789080 789122 789163 789205 789247 789288 789330 789372 789414 789455 789497 789539 789580 789622 789664 789706 789747 789789 789831 789872 789914 789956 789998 790039 790081 790123 790164 790206 790248 790289 790331 790373 790415 790456 790498 790540 790581 790623 790665 790707 790748 790790 790832 790873 790915 790957 790999 791040 791082 791124 791165 791207 791249 791290 791332 791374 791416 791457 791499 791541 791582 791624 791666 791708 791749 791791 791833 791874 791916 791958 792000 792041 792083 792125 792166 792208 792250 792291 792333 792375 792417 792458 792500 792542 792583 792625 792667 792709 792750 792792 792834 792875 792917 792959 793001 793042 793084 793126 793167 793209 793251 793292 793334 793376 793418 793459 793501 793543 793584 793626 793668 793710 793751 793793 793835 793876 793918 793960 794002 794043 794085 794127 794168 794210 794252 794293 794335 794377 794419 794460 794502 794544 794585 794627 794669 794711 794752 794794 794836 794877 794919 794961 795003 795044 795086 795128 795169 795211 795253 795294 795336 795378 795420 795461 795503 795545 795586 795628 795670 795712 795753 795795 795837 795878 795920 795962 796004 796045 796087 796129 796170 796212 796254 796295 796337 796379 796421 796462 796504 796546 796587 796629 796671 796713 796754 796796 796838 796879 796921 796963 797005 797046 797088 797130 797171 797213 797255 797296 797338 797380 797422 797463 797505 797547 797588 797630 797672 797714 797755 797797 797839 797880 797922 797964 798006 798047 798089 798131 798172 798214 798256 798297 798339 798381 798423 798464 798506 798548 798589 798631 798673 798715 798756 798798 798840 798881 798923 798965 799007 799048 799090 799132 799173 799215 799257 799298 799340 799382 799424 799465 799507 799549 799590 799632 799674 799716 799757 799799 799841 799882 799924 799966 800008 800049 800091 800133 800174 800216 800258 800299 800341 800383 800425 800466 800508 800550 800591 800633 800675 800717 800758 800800 800842 800883 800925 800967 801009 801050 801092 801134 801175 801217 801259 801300 801342 801384 801426 801467 801509 801551 801592 801634 801676 801718 801759 801801 801843 801884 801926 801968 802010 802051 802093 802135 802176 802218 802260 802301 802343 802385 802427 802468 802510 802552 802593 802635 802677 802719 802760 802802 802844 802885 802927 802969 803011 803052 803094 803136 803177 803219 803261 803302 803344 803386 803428 803469 803511 803553 803594 803636 803678 803720 803761 803803 803845 803886 803928 803970 804012 804053 804095 804137 804178 804220 804262 804303 804345 804387 804429 804470 804512 804554 804595 804637 804679 804721 804762 804804 804846 804887 804929 804971 805013 805054 805096 805138 805179 805221 805263 805304 805346 805388 805430 805471 805513 805555 805596 805638 805680 805722 805763 805805 805847 805888 805930 805972 806014 806055 806097 806139 806180 806222 806264 806305 806347 806389 806431 806472 806514 806556 806597 806639 806681 806723 806764 806806 806848 806889 806931 806973 807015 807056 807098 807140 807181 807223 807265 807306 807348 807390 807432 807473 807515 807557 807598 807640 807682 807724 807765 807807 807849 807890 807932 807974 808016 808057 808099 808141 808182 808224 808266 808307 808349 808391 808433 808474 808516 808558 808599 808641 808683 808725 808766 808808 808850 808891 808933 808975 809017 809058 809100 809142 809183 809225 809267 809308 809350 809392 809434 809475 809517 809559 809600 809642 809684 809726 809767 809809 809851 809892 809934 809976 810018 810059 810101 810143 810184 810226 810268 810309 810351 810393 810435 810476 810518 810560 810601 810643 810685 810727 810768 810810 810852 810893 810935 810977 811019 811060 811102 811144 811185 811227 811269 811310 811352 811394 811436 811477 811519 811561 811602 811644 811686 811728 811769 811811 811853 811894 811936 811978 812020 812061 812103 812145 812186 812228 812270 812311 812353 812395 812437 812478 812520 812562 812603 812645 812687 812729 812770 812812 812854 812895 812937 812979 813021 813062 813104 813146 813187 813229 813271 813312 813354 813396 813438 813479 813521 813563 813604 813646 813688 813730 813771 813813 813855 813896 813938 813980 814022 814063 814105 814147 814188 814230 814272 814313 814355 814397 814439 814480 814522 814564 814605 814647 814689 814731 814772 814814 814856 814897 814939 814981 815023 815064 815106 815148 815189 815231 815273 815314 815356 815398 815440 815481 815523 815565 815606 815648 815690 815732 815773 815815 815857 815898 815940 815982 816024 816065 816107 816149 816190 816232 816274 816315 816357 816399 816441 816482 816524 816566 816607 816649 816691 816733 816774 816816 816858 816899 816941 816983 817025 817066 817108 817150 817191 817233 817275 817316 817358 817400 817442 817483 817525 817567 817608 817650 817692 817734 817775 817817 817859 817900 817942 817984 818026 818067 818109 818151 818192 818234 818276 818317 818351 818384 818418 818451 818484 818518 818551 818584 818618 818651 818685 818718 818751 818785 818818 818851 818885 818918 818951 818985 819018 819052 819085 819118 819152 819185 819218 819252 819285 819318 819352 819385 819419 819452 819485 819519 819552 819585 819619 819652 819686 819719 819752 819786 819819 819852 819886 819919 819952 819986 820019 820053 820086 820119 820153 820186 820219 820253 820286 820319 820353 820386 820420 820453 820486 820520 820553 820586 820620 820653 820687 820720 820753 820787 820820 820853 820887 820920 820953 820987 821020 821054 821087 821120 821154 821187 821220 821254 821287 821320 821354 821387 821421 821454 821487 821529 821571 821612 821654 821696 821738 821779 821821 821863 821904 821946 821988 822030 822071 822113 822155 822196 822238 822280 822321 822363 822405 822447 822488 822530 822572 822613 822655 822697 822739 822780 822822 822864 822905 822947 822989 823031 823072 823114 823156 823197 823239 823281 823322 823364 823406 823448 823489 823531 823573 823614 823656 823698 823740 823781 823823 823865 823906 823948 823990 824032 824073 824115 824157 824198 824240 824282 824323 824365 824407 824449 824490 824532 824574 824615 824657 824699 824741 824782 824824 824866 824907 824949 824991 825033 825074 825116 825158 825199 825241 825283 825324 825366 825408 825450 825491 825533 825575 825616 825658 825700 825742 825783 825825 825867 825908 825950 825992 826034 826075 826117 826159 826192 826225 826259 826292 826325 826359 826392 826426 826459 826492 826526 826559 826592 826626 826659 826693 826726 826759 826793 826826 826859 826893 826926 826959 826993 827026 827060 827093 827126 827160 827193 827226 827260 827293 827326 827360 827393 827427 827460 827493 827527 827560 827593 827627 827660 827694 827727 827760 827794 827827 827860 827894 827927 827960 827994 828036 828077 828119 828161 828202 828244 828286 828327 828369 828411 828453 828494 828536 828578 828619 828661 828703 828745 828786 828828 828870 828911 828953 828995 829037 829078 829120 829162 829203 829245 829287 829328 829370 829412 829454 829495 829537 829579 829620 829662 829704 829746 829787 829829 829871 829912 829954 829996 830038 830079 830121 830163 830204 830246 830288 830329 830371 830413 830455 830496 830538 830580 830621 830663 830705 830747 830788 830830 830872 830913 830955 830997 831039 831080 831122 831164 831205 831247 831289 831330 831372 831414 831456 831497 831539 831581 831622 831664 831706 831748 831789 831831 831873 831914 831956 831998 832040 832081 832123 832165 832206 832248 832290 832331 832373 832415 832457 832498 832540 832582 832623 832665 832707 832749 832790 832832 832874 832915 832957 832999 833041 833082 833124 833166 833207 833249 833291 833332 833374 833416 833458 833499 833541 833583 833624 833666 833708 833750 833791 833833 833875 833916 833958 834000 834042 834083 834125 834167 834208 834250 834292 834333 834375 834417 834459 834500 834542 834584 834625 834667 834709 834751 834792 834834 834876 834917 834959 835001 835043 835084 835126 835168 835209 835251 835293 835334 835376 835418 835460 835501 835543 835585 835626 835668 835710 835752 835793 835835 835877 835918 835960 836002 836044 836085 836127 836169 836210 836252 836294 836335 836377 836419 836461 836502 836544 836586 836627 836669 836711 836753 836794 836836 836878 836919 836961 837003 837045 837086 837128 837170 837211 837253 837295 837336 837378 837420 837462 837503 837537 837570 837603 837637 837670 837704 837737 837770 837804 837837 837870 837904 837937 837970 838004 838037 838071 838104 838137 838171 838204 838237 838271 838304 838337 838371 838404 838438 838471 838504 838538 838571 838604 838638 838671 838705 838738 838771 838805 838838 838871 838905 838938 838971 839005 839038 839072 839105 839138 839172 839205 839238 839272 839305 839338 839372 839405 839439 839472 839505 839539 839572 839605 839639 839672 839706 839739 839772 839806 839839 839872 839906 839939 839972 840006 840039 840073 840106 840139 840173 840206 840239 840273 840306 840339 840381 840423 840465 840506 840548 840590 840631 840673 840715 840757 840798 840840 840882 840923 840965 841007 841049 841090 841132 841174 841215 841257 841299 841340 841374 841407 841441 841474 841507 841549 841591 841632 841674 841716 841758 841799 841841 841883 841924 841966 842008 842050 842091 842133 842175 842216 842258 842300 842341 842383 842425 842467 842508 842550 842592 842633 842675 842717 842759 842800 842842 842884 842925 842967 843009 843051 843092 843134 843176 843217 843259 843301 843342 843384 843426 843468 843509 843551 843593 843634 843676 843718 843760 843801 843843 843885 843926 843968 844010 844052 844093 844135 844177 844218 844260 844302 844343 844385 844427 844469 844510 844552 844594 844635 844677 844719 844761 844802 844844 844886 844927 844969 845011 845053 845094 845136 845178 845219 845261 845303 845344 845386 845428 845470 845511 845553 845595 845636 845678 845720 845762 845803 845845 845887 845928 845970 846012 846054 846095 846137 846179 846220 846262 846304 846345 846387 846429 846471 846512 846554 846596 846637 846679 846721 846763 846804 846846 846888 846929 846971 847013 847055 847096 847138 847180 847221 847263 847305 847346 847388 847430 847472 847513 847555 847597 847638 847680 847722 847764 847805 847847 847889 847930 847972 848014 848056 848097 848139 848181 848222 848264 848306 848347 848389 848431 848473 848514 848556 848598 848639 848681 848723 848765 848806 848848 848890 848931 848973 849015 849057 849098 849140 849182 849223 849265 849307 849348 849390 849432 849474 849515 849557 849599 849640 849682 849724 849766 849807 849849 849891 849932 849974 850016 850058 850099 850141 850183 850224 850266 850308 850349 850391 850433 850475 850516 850558 850600 850641 850683 850725 850767 850808 850850 850892 850933 850975 851017 851059 851100 851142 851184 851225 851267 851309 851350 851392 851434 851476 851517 851559 851601 851642 851684 851726 851768 851809 851851 851893 851934 851976 852018 852060 852101 852143 852185 852226 852268 852310 852351 852393 852435 852477 852518 852560 852602 852643 852685 852727 852769 852810 852852 852894 852935 852977 853019 853061 853102 853144 853186 853227 853269 853311 853352 853394 853436 853478 853519 853561 853603 853644 853686 853728 853770 853811 853853 853895 853936 853978 854020 854062 854103 854145 854187 854228 854270 854312 854353 854395 854437 854479 854520 854562 854604 854645 854687 854729 854771 854812 854854 854896 854937 854979 855021 855063 855104 855146 855188 855229 855271 855313 855354 855396 855438 855480 855521 855563 855605 855646 855688 855730 855772 855813 855855 855897 855938 855980 856022 856064 856105 856147 856189 856230 856272 856314 856355 856397 856439 856481 856522 856564 856606 856647 856689 856731 856773 856814 856856 856898 856939 856981 857023 857065 857106 857148 857190 857231 857273 857315 857356 857398 857440 857482 857523 857565 857607 857648 857690 857732 857774 857815 857857 857899 857940 857982 858024 858066 858107 858149 858191 858232 858274 858316 858357 858399 858441 858483 858524 858566 858608 858649 858691 858733 858775 858816 858858 858900 858941 858983 859025 859067 859108 859150 859192 859233 859275 859317 859358 859400 859442 859484 859525 859567 859609 859650 859692 859734 859776 859817 859859 859901 859942 859984 860026 860068 860109 860151 860193 860234 860276 860318 860359 860401 860443 860485 860526 860568 860610 860651 860693 860735 860777 860818 860860 860902 860943 860985 861027 861069 861110 861152 861194 861235 861277 861319 861360 861402 861444 861486 861527 861569 861611 861652 861694 861736 861778 861819 861861 861894 861928 861961 861994 862028 862061 862095 862128 862161 862195 862228 862261 862295 862328 862361 862395 862428 862462 862495 862528 862562 862595 862628 862662 862695 862729 862762 862795 862829 862862 862895 862929 862962 862995 863029 863062 863096 863129 863162 863196 863229 863262 863296 863329 863362 863396 863429 863463 863496 863529 863563 863596 863629 863663 863696 863730 863763 863796 863830 863863 863896 863930 863963 863996 864030 864063 864097 864130 864163 864197 864230 864263 864297 864330 864363 864397 864430 864464 864497 864530 864564 864597 864630 864664 864697 864731 864764 864797 864831 864864 864897 864931 864964 864997 865031 865064 865098 865131 865164 865198 865231 865264 865298 865331 865364 865398 865431 865465 865498 865531 865565 865598 865631 865665 865698 865732 865765 865798 865832 865865 865898 865932 865965 865998 866032 866065 866099 866132 866165 866199 866232 866265 866299 866332 866365 866399 866432 866466 866499 866532 866566 866599 866632 866666 866699 866733 866766 866799 866833 866866 866899 866933 866966 866999 867033 867066 867100 867133 867166 867200 867241 867283 867325 867366 867408 867450 867492 867533 867575 867617 867658 867700 867742 867784 867825 867867 867909 867950 867992 868034 868076 868117 868159 868201 868242 868284 868326 868367 868409 868451 868493 868534 868576 868618 868659 868701 868743 868785 868826 868868 868910 868951 868993 869035 869077 869118 869160 869202 869243 869285 869327 869368 869410 869452 869494 869535 869577 869619 869660 869702 869744 869786 869827 869869 869911 869952 869994 870036 870078 870119 870161 870203 870244 870286 870328 870369 870411 870453 870495 870536 870578 870620 870661 870703 870745 870787 870828 870870 870912 870953 870995 871037 871079 871120 871162 871204 871245 871287 871329 871370 871412 871454 871496 871537 871579 871621 871662 871704 871746 871788 871829 871871 871913 871954 871996 872038 872080 872121 872163 872205 872246 872288 872330 872371 872413 872455 872497 872538 872580 872622 872663 872705 872747 872789 872830 872872 872914 872955 872997 873039 873081 873122 873164 873206 873247 873289 873331 873372 873414 873456 873498 873539 873573 873606 873639 873673 873706 873740 873773 873806 873840 873873 873915 873956 873998 874040 874082 874123 874165 874207 874248 874290 874332 874373 874415 874457 874499 874540 874582 874624 874665 874707 874749 874791 874832 874874 874916 874957 874999 875041 875083 875124 875166 875208 875249 875291 875333 875374 875416 875458 875500 875541 875583 875625 875666 875708 875750 875792 875833 875875 875917 875958 876000 876042 876084 876125 876167 876209 876242 876275 876309 876342 876375 876409 876442 876476 876509 876542 876576 876609 876642 876676 876709 876743 876776 876809 876843 876876 876909 876943 876976 877009 877043 877076 877110 877143 877176 877210 877243 877276 877310 877343 877376 877410 877443 877477 877510 877543 877577 877610 877643 877677 877710 877744 877777 877810 877844 877877 877910 877944 877977 878010 878044 878077 878111 878144 878177 878211 878244 878277 878311 878344 878377 878411 878444 878478 878511 878544 878578 878611 878644 878678 878711 878753 878795 878836 878878 878920 878961 879003 879045 879087 879128 879170 879212 879253 879295 879337 879378 879412 879445 879479 879512 879545 879579 879612 879645 879679 879712 879746 879779 879812 879846 879879 879912 879946 879979 880012 880046 880079 880113 880146 880179 880213 880246 880279 880313 880346 880379 880413 880446 880480 880513 880546 880580 880613 880646 880680 880713 880747 880780 880813 880847 880880 880913 880947 880980 881013 881047 881089 881130 881172 881214 881255 881297 881339 881380 881414 881447 881481 881514 881547 881581 881614 881647 881681 881714 881748 881781 881814 881848 881881 881914 881948 881981 882014 882048 882090 882131 882173 882215 882256 882298 882340 882381 882423 882465 882507 882548 882590 882632 882673 882715 882757 882799 882840 882882 882924 882965 883007 883049 883091 883132 883174 883216 883257 883299 883341 883382 883424 883466 883508 883549 883591 883633 883674 883716 883758 883800 883841 883883 883925 883966 884008 884050 884092 884133 884175 884217 884258 884300 884342 884383 884425 884467 884509 884550 884592 884634 884675 884717 884759 884801 884842 884884 884926 884967 885009 885051 885093 885134 885176 885218 885259 885301 885343 885384 885426 885468 885510 885551 885593 885635 885676 885718 885760 885802 885843 885885 885927 885968 886010 886052 886094 886135 886177 886219 886260 886302 886344 886385 886427 886469 886511 886552 886594 886636 886677 886719 886761 886803 886844 886886 886928 886969 887011 887053 887095 887136 887178 887220 887261 887303 887345 887386 887428 887470 887512 887553 887595 887637 887678 887720 887762 887804 887845 887887 887929 887970 888012 888054 888096 888137 888179 888221 888262 888304 888346 888387 888429 888471 888513 888554 888596 888638 888679 888721 888763 888805 888846 888888 888930 888971 889013 889055 889097 889138 889180 889222 889263 889305 889347 889388 889430 889472 889514 889555 889597 889639 889680 889722 889764 889806 889847 889889 889931 889972 890014 890056 890098 890139 890181 890223 890264 890306 890348 890389 890431 890473 890515 890556 890598 890640 890681 890723 890765 890807 890848 890890 890932 890973 891015 891057 891099 891140 891182 891224 891265 891307 891349 891390 891432 891474 891516 891557 891599 891641 891682 891724 891766 891808 891849 891891 891933 891974 892016 892058 892100 892141 892183 892225 892266 892308 892350 892391 892433 892475 892517 892558 892600 892642 892683 892725 892767 892809 892850 892892 892934 892975 893017 893059 893101 893142 893184 893226 893267 893309 893351 893392 893434 893476 893518 893559 893601 893643 893684 893726 893768 893810 893851 893893 893935 893976 894018 894060 894102 894143 894185 894227 894268 894310 894352 894393 894435 894477 894519 894560 894602 894644 894685 894727 894769 894811 894852 894894 894936 894977 895019 895061 895103 895144 895186 895228 895269 895311 895353 895394 895436 895478 895520 895561 895603 895645 895686 895728 895770 895812 895853 895895 895937 895978 896020 896062 896104 896145 896187 896229 896270 896312 896354 896395 896437 896479 896521 896562 896604 896646 896687 896729 896771 896813 896854 896896 896938 896979 897021 897063 897105 897146 897188 897230 897271 897313 897355 897396 897438 897480 897522 897563 897605 897647 897688 897730 897772 897814 897855 897897 897939 897980 898022 898064 898106 898147 898189 898231 898272 898314 898356 898397 898439 898481 898523 898564 898606 898648 898689 898731 898773 898815 898856 898898 898940 898981 899023 899065 899107 899148 899190 899232 899273 899315 899357 899398 899440 899482 899524 899565 899607 899649 899690 899732 899766 899799 899832 899866 899899 899932 899966 899999 900032 900066 900099 900133 900166 900199 900233 900266 900299 900333 900366 900399 900433 900466 900500 900533 900566 900600 900633 900666 900700 900733 900767 900800 900833 900867 900900 900933 900967 901000 901033 901067 901100 901134 901167 901200 901234 901267 901300 901334 901367 901400 901434 901467 901501 901534 901567 901601 901634 901667 901701 901734 901768 901801 901834 901868 901901 901934 901968 902001 902034 902068 902101 902135 902168 902201 902235 902268 902301 902335 902368 902401 902435 902468 902502 902535 902568 902602 902635 902668 902702 902735 902769 902802 902835 902869 902902 902935 902969 903002 903035 903069 903102 903136 903169 903202 903236 903269 903302 903336 903369 903402 903436 903469 903503 903536 903569 903603 903636 903669 903703 903736 903770 903803 903836 903870 903903 903936 903970 904003 904036 904070 904103 904137 904170 904203 904237 904270 904303 904337 904370 904403 904437 904470 904504 904537 904570 904604 904637 904670 904704 904737 904771 904804 904837 904871 904904 904937 904971 905004 905037 905071 905104 905138 905171 905204 905238 905279 905321 905363 905404 905446 905488 905530 905571 905613 905655 905696 905738 905780 905822 905863 905905 905947 905988 906030 906072 906114 906155 906197 906239 906280 906322 906364 906405 906447 906489 906531 906572 906614 906656 906697 906739 906781 906823 906864 906906 906948 906989 907031 907073 907115 907156 907198 907240 907281 907323 907365 907406 907448 907490 907532 907573 907615 907657 907698 907740 907782 907824 907865 907907 907949 907990 908032 908074 908116 908157 908199 908241 908282 908324 908366 908407 908449 908491 908533 908574 908616 908658 908699 908741 908783 908825 908866 908908 908950 908991 909033 909075 909117 909158 909200 909242 909283 909325 909367 909408 909442 909475 909509 909542 909575 909609 909642 909675 909709 909742 909784 909826 909867 909909 909951 909992 910034 910076 910118 910159 910201 910243 910284 910326 910368 910409 910451 910493 910535 910576 910618 910660 910701 910743 910785 910827 910868 910910 910952 910993 911035 911077 911119 911160 911202 911244 911285 911327 911369 911410 911452 911494 911536 911577 911619 911661 911702 911744 911786 911828 911869 911911 911953 911994 912036 912078 912120 912161 912203 912245 912286 912328 912370 912411 912453 912495 912537 912578 912620 912662 912703 912745 912787 912829 912870 912912 912954 912995 913037 913079 913121 913162 913204 913246 913287 913329 913371 913412 913454 913496 913538 913579 913621 913663 913704 913746 913788 913830 913871 913913 913955 913996 914038 914080 914122 914163 914205 914247 914288 914330 914372 914413 914455 914497 914539 914580 914622 914664 914705 914747 914789 914831 914872 914914 914956 914997 915039 915081 915123 915164 915206 915248 915289 915331 915373 915414 915456 915498 915540 915581 915623 915665 915706 915748 915790 915832 915873 915915 915957 915998 916040 916082 916124 916165 916207 916249 916290 916332 916374 916415 916457 916499 916541 916582 916624 916666 916707 916749 916791 916833 916874 916916 916958 916999 917041 917083 917125 917166 917208 917250 917291 917333 917375 917416 917458 917500 917542 917583 917625 917667 917708 917750 917792 917834 917875 917917 917959 918000 918042 918084 918126 918167 918209 918251 918292 918334 918376 918417 918459 918501 918543 918584 918626 918668 918709 918751 918793 918835 918876 918918 918960 919001 919043 919085 919127 919168 919210 919252 919293 919335 919377 919418 919460 919502 919544 919585 919627 919669 919710 919752 919794 919836 919877 919919 919961 920002 920044 920086 920128 920169 920211 920253 920294 920336 920378 920419 920461 920503 920545 920586 920628 920670 920711 920753 920795 920837 920878 920920 920962 921003 921045 921087 921129 921170 921212 921254 921295 921337 921379 921420 921462 921504 921546 921587 921629 921671 921712 921754 921796 921838 921879 921921 921963 922004 922046 922088 922130 922171 922213 922255 922296 922338 922380 922421 922463 922505 922547 922588 922630 922672 922713 922755 922797 922839 922880 922922 922964 923005 923047 923089 923131 923172 923214 923256 923297 923339 923381 923422 923464 923506 923548 923589 923631 923673 923714 923756 923798 923840 923881 923923 923956 923990 924023 924056 924090 924132 924173 924215 924257 924298 924340 924382 924423 924465 924507 924549 924590 924632 924674 924715 924757 924799 924841 924882 924924 924966 925007 925049 925091 925133 925174 925216 925258 925299 925341 925383 925424 925466 925508 925550 925591 925633 925675 925716 925758 925800 925842 925883 925925 925967 926008 926050 926092 926134 926175 926217 926259 926300 926342 926384 926425 926467 926509 926551 926592 926634 926676 926717 926759 926793 926826 926859 926893 926926 926968 927009 927051 927093 927135 927176 927218 927260 927301 927343 927385 927426 927468 927510 927552 927593 927635 927677 927718 927760 927802 927844 927885 927927 927969 928010 928052 928094 928136 928177 928219 928261 928302 928344 928386 928427 928469 928511 928553 928594 928636 928678 928719 928761 928803 928845 928886 928928 928970 929011 929053 929095 929137 929178 929220 929262 929303 929345 929387 929428 929470 929512 929554 929595 929637 929679 929720 929762 929804 929846 929887 929929 929971 930012 930054 930096 930138 930179 930221 930263 930304 930346 930388 930429 930471 930513 930555 930596 930638 930680 930721 930763 930805 930847 930888 930930 930972 931013 931055 931097 931139 931180 931222 931264 931305 931347 931389 931430 931464 931497 931531 931564 931597 931631 931664 931697 931731 931764 931798 931831 931864 931898 931931 931964 931998 932031 932064 932098 932131 932165 932198 932231 932265 932298 932331 932365 932398 932431 932465 932498 932532 932565 932598 932632 932665 932698 932732 932765 932799 932832 932865 932899 932932 932965 932999 933032 933065 933099 933132 933166 933199 933232 933266 933299 933332 933366 933399 933432 933474 933516 933558 933599 933641 933683 933724 933766 933808 933850 933891 933933 933975 934016 934058 934100 934142 934183 934225 934267 934308 934350 934392 934433 934475 934517 934559 934600 934642 934684 934725 934767 934809 934851 934892 934934 934967 935001 935034 935067 935101 935134 935168 935201 935234 935268 935301 935334 935368 935401 935434 935468 935501 935535 935568 935601 935635 935668 935701 935735 935768 935802 935835 935868 935902 935935 935968 936002 936035 936068 936102 936135 936169 936202 936235 936269 936302 936335 936369 936402 936435 936469 936502 936536 936569 936602 936636 936669 936702 936736 936769 936803 936836 936869 936903 936936 936969 937003 937036 937069 937103 937136 937170 937203 937236 937270 937303 937336 937370 937403 937436 937470 937503 937537 937570 937603 937637 937670 937703 937737 937770 937804 937837 937870 937904 937937 937970 938004 938037 938070 938104 938137 938171 938204 938237 938271 938304 938337 938371 938404 938437 938471 938504 938538 938571 938604 938638 938671 938704 938738 938771 938805 938838 938871 938905 938938 938971 939005 939038 939071 939105 939138 939172 939205 939238 939272 939305 939338 939372 939405 939438 939472 939505 939539 939572 939605 939639 939672 939705 939739 939772 939806 939839 939872 939906 939939 939972 940006 940039 940072 940106 940139 940173 940206 940239 940273 940306 940339 940373 940406 940439 940473 940506 940540 940573 940606 940640 940673 940706 940740 940773 940807 940840 940873 940907 940940 940973 941007 941040 941073 941107 941140 941174 941207 941240 941274 941307 941340 941374 941407 941440 941474 941507 941541 941574 941607 941641 941674 941707 941741 941774 941808 941841 941874 941908 941941 941974 942008 942041 942074 942108 942141 942175 942208 942241 942275 942308 942341 942375 942408 942441 942475 942508 942542 942575 942608 942642 942675 942708 942742 942775 942809 942842 942875 942909 942942 942975 943009 943042 943075 943109 943151 943192 943234 943276 943317 943359 943401 943442 943484 943526 943568 943609 943651 943693 943734 943776 943818 943860 943901 943943 943985 944026 944068 944110 944152 944193 944235 944277 944318 944360 944402 944443 944485 944527 944569 944610 944652 944694 944735 944777 944819 944861 944902 944944 944986 945027 945069 945111 945153 945194 945236 945278 945319 945361 945403 945444 945486 945528 945570 945611 945653 945695 945736 945778 945820 945862 945903 945945 945987 946028 946070 946112 946154 946195 946237 946279 946320 946362 946404 946445 946487 946529 946571 946612 946654 946696 946737 946779 946821 946863 946904 946946 946988 947029 947071 947113 947155 947196 947238 947280 947321 947363 947405 947446 947488 947530 947572 947613 947655 947697 947738 947780 947822 947864 947905 947947 947989 948030 948072 948114 948156 948197 948239 948281 948322 948364 948406 948447 948489 948531 948573 948614 948656 948698 948739 948781 948823 948865 948906 948948 948990 949031 949073 949115 949148 949182 949215 949248 949282 949315 949348 949382 949415 949448 949482 949515 949549 949582 949615 949649 949682 949715 949749 949782 949816 949849 949882 949916 949949 949982 950016 950049 950082 950116 950149 950183 950216 950249 950283 950316 950349 950383 950416 950449 950483 950516 950550 950583 950616 950650 950683 950716 950750 950783 950817 950850 950883 950917 950950 950983 951017 951050 951083 951117 951150 951184 951217 951250 951284 951317 951350 951384 951417 951450 951484 951517 951551 951584 951617 951651 951684 951717 951751 951784 951818 951851 951884 951918 951951 951984 952018 952051 952084 952118 952151 952185 952218 952251 952285 952318 952351 952385 952418 952451 952485 952518 952552 952585 952618 952652 952685 952718 952752 952785 952819 952852 952885 952919 952952 952985 953019 953052 953085 953119 953152 953186 953219 953252 953286 953319 953352 953386 953419 953452 953486 953519 953553 953586 953619 953653 953686 953719 953753 953786 953820 953853 953886 953920 953953 953986 954020 954053 954086 954120 954162 954203 954245 954287 954328 954370 954412 954453 954495 954537 954579 954620 954662 954704 954745 954787 954829 954871 954912 954954 954996 955037 955079 955121 955163 955204 955246 955288 955329 955371 955413 955454 955496 955538 955580 955621 955663 955705 955746 955788 955830 955872 955913 955955 955997 956038 956080 956122 956164 956205 956247 956289 956330 956372 956414 956455 956497 956539 956581 956622 956664 956706 956747 956789 956831 956873 956914 956956 956998 957039 957081 957123 957165 957206 957248 957290 957331 957373 957415 957456 957498 957540 957582 957623 957665 957707 957748 957790 957832 957874 957915 957957 957999 958040 958082 958124 958166 958207 958249 958291 958332 958374 958416 958457 958499 958541 958583 958624 958666 958708 958749 958791 958833 958875 958916 958958 959000 959041 959083 959125 959167 959208 959250 959292 959333 959375 959417 959458 959500 959542 959584 959625 959667 959709 959750 959792 959834 959876 959917 959959 960001 960042 960084 960126 960168 960209 960251 960293 960334 960376 960418 960459 960501 960543 960585 960626 960668 960710 960751 960793 960835 960877 960918 960960 961002 961043 961085 961127 961169 961210 961252 961294 961335 961377 961419 961460 961502 961544 961586 961627 961669 961711 961752 961794 961836 961878 961919 961961 962003 962044 962086 962128 962170 962211 962253 962295 962336 962378 962420 962461 962503 962545 962587 962628 962670 962712 962753 962795 962837 962879 962920 962962 963004 963045 963087 963129 963171 963212 963254 963296 963337 963379 963421 963462 963504 963546 963588 963629 963671 963713 963754 963796 963838 963880 963921 963963 964005 964046 964088 964130 964172 964213 964255 964297 964338 964380 964422 964463 964505 964547 964589 964630 964672 964714 964755 964797 964839 964881 964922 964964 965006 965047 965089 965131 965173 965214 965256 965298 965339 965381 965423 965464 965506 965548 965590 965631 965673 965715 965756 965798 965840 965882 965923 965965 966007 966048 966090 966132 966174 966215 966257 966299 966340 966382 966424 966465 966507 966549 966591 966632 966674 966716 966757 966799 966841 966883 966924 966966 967008 967049 967091 967133 967166 967200 967233 967266 967300 967333 967366 967400 967433 967466 967500 967533 967567 967600 967633 967667 967700 967733 967767 967800 967834 967867 967900 967934 967967 968000 968034 968067 968100 968134 968167 968201 968234 968267 968301 968334 968367 968401 968434 968467 968501 968534 968568 968601 968634 968676 968718 968759 968801 968843 968885 968926 968968 969010 969051 969093 969135 969177 969218 969260 969302 969343 969385 969427 969468 969510 969552 969594 969635 969677 969719 969760 969802 969844 969886 969927 969969 970011 970052 970094 970136 970178 970219 970261 970303 970344 970386 970428 970469 970511 970553 970595 970636 970678 970720 970761 970803 970845 970887 970928 970970 971012 971053 971095 971137 971179 971220 971262 971304 971345 971387 971429 971470 971512 971554 971596 971637 971679 971721 971762 971804 971846 971888 971929 971971 972013 972054 972096 972138 972180 972221 972263 972305 972346 972388 972430 972471 972513 972555 972597 972638 972680 972722 972763 972805 972847 972889 972930 972972 973014 973055 973097 973139 973181 973222 973264 973306 973347 973389 973431 973472 973514 973556 973598 973639 973681 973723 973764 973806 973848 973890 973931 973973 974015 974056 974098 974140 974182 974223 974265 974307 974348 974390 974432 974473 974515 974557 974599 974640 974682 974724 974765 974807 974849 974891 974932 974974 975016 975057 975099 975141 975183 975224 975266 975308 975349 975391 975433 975474 975516 975558 975600 975641 975683 975725 975766 975808 975850 975892 975933 975975 976017 976058 976100 976142 976184 976225 976267 976309 976350 976392 976434 976475 976517 976559 976601 976642 976684 976726 976767 976809 976851 976893 976934 976976 977018 977059 977101 977143 977185 977226 977268 977310 977351 977393 977435 977476 977518 977560 977602 977643 977685 977727 977768 977810 977852 977894 977935 977977 978019 978060 978102 978144 978186 978227 978269 978311 978352 978394 978436 978477 978519 978561 978603 978644 978686 978728 978769 978811 978853 978895 978936 978978 979020 979061 979103 979145 979187 979228 979270 979312 979353 979395 979437 979478 979520 979562 979604 979645 979687 979729 979770 979812 979854 979896 979937 979979 980021 980062 980104 980146 980188 980229 980271 980313 980346 980379 980413 980446 980479 980521 980563 980605 980646 980688 980730 980771 980813 980855 980897 980938 980980 981022 981063 981105 981147 981189 981230 981272 981314 981355 981397 981439 981480 981522 981564 981606 981647 981689 981731 981772 981814 981856 981898 981939 981981 982023 982064 982106 982148 982190 982231 982273 982315 982356 982398 982440 982481 982523 982565 982607 982648 982690 982732 982773 982815 982857 982899 982940 982982 983024 983065 983107 983149 983191 983232 983274 983316 983357 983399 983441 983482 983524 983566 983608 983649 983691 983733 983774 983816 983858 983900 983941 983983 984025 984066 984108 984150 984192 984233 984275 984317 984358 984400 984442 984483 984525 984567 984609 984650 984692 984734 984775 984817 984859 984901 984942 984984 985026 985067 985109 985151 985193 985234 985276 985318 985359 985401 985443 985484 985526 985568 985610 985651 985693 985735 985776 985818 985852 985885 985918 985952 985985 986018 986052 986085 986118 986152 986185 986219 986252 986285 986319 986352 986385 986419 986452 986485 986519 986552 986586 986619 986652 986686 986719 986752 986786 986819 986853 986886 986919 986953 986986 987019 987053 987086 987119 987153 987186 987220 987253 987286 987320 987353 987386 987420 987453 987486 987520 987553 987587 987620 987653 987687 987720 987753 987787 987820 987854 987887 987920 987954 987987 988020 988054 988087 988120 988154 988187 988221 988254 988287 988321 988362 988404 988446 988487 988529 988571 988613 988654 988696 988738 988779 988821 988863 988905 988946 988988 989030 989071 989113 989155 989197 989238 989280 989322 989363 989405 989447 989488 989530 989572 989614 989655 989697 989739 989780 989822 989864 989906 989947 989989 990031 990072 990114 990156 990198 990239 990281 990323 990364 990406 990448 990489 990531 990573 990615 990656 990698 990740 990781 990823 990865 990907 990948 990990 991032 991073 991115 991157 991199 991240 991282 991324 991365 991407 991449 991490 991532 991574 991616 991657 991699 991741 991782 991824 991866 991908 991949 991991 992033 992074 992116 992158 992200 992241 992283 992325 992366 992408 992450 992491 992533 992575 992617 992658 992700 992742 992783 992825 992867 992909 992950 992992 993034 993075 993117 993159 993201 993242 993284 993326 993367 993409 993451 993492 993534 993576 993618 993659 993701 993743 993784 993826 993868 993910 993951 993993 994035 994076 994118 994160 994202 994243 994285 994327 994368 994410 994452 994493 994535 994577 994619 994660 994702 994744 994785 994827 994869 994911 994952 994994 995036 995077 995119 995161 995203 995244 995286 995328 995369 995411 995453 995494 995536 995578 995620 995661 995703 995745 995786 995828 995870 995912 995953 995995 996037 996078 996120 996162 996204 996245 996287 996329 996370 996412 996454 996495 996537 996579 996621 996662 996704 996746 996787 996829 996871 996913 996954 996996 997038 997079 997121 997163 997205 997246 997288 997330 997371 997413 997455 997496 997538 997580 997622 997663 997705 997747 997788 997830 997872 997914 997955 997997 998039 998080 998122 998164 998206 998247 998289 998331 998372 998414 998456 998497 998539 998581 998623 998664 998706 998748 998789 998831 998873 998915 998956 998998 999040 999081 999123 999165 999207 999248 999290 999332 999373 999415 999457 999498 999540 999582 999624 999665 999707 999749 999790 999832 999874 999916 999957 999999 1000041 1000082 1000124 1000166 1000208 1000249 1000291 1000333 1000366 1000399 1000433 1000466 1000499 1000533 1000566 1000600 1000633 1000666 1000700 1000733 1000766 1000800 1000833 1000867 1000900 1000933 1000967 1001000 1001033 1001067 1001100 1001133 1001167 1001200 1001234 1001267 1001300 1001334 1001367 1001400 1001434 1001467 1001500 1001534 1001567 1001601 1001634 1001667 1001701 1001734 1001767 1001801 1001834 1001876 1001918 1001959 1002001 1002043 1002084 1002126 1002168 1002210 1002251 1002293 1002335 1002376 1002418 1002460 1002501 1002543 1002585 1002627 1002668 1002710 1002752 1002793 1002835 1002877 1002919 1002960 1003002 1003044 1003085 1003127 1003169 1003211 1003252 1003294 1003336 1003377 1003419 1003461 1003502 1003544 1003586 1003628 1003669 1003711 1003753 1003794 1003836 1003870 1003903 1003936 1003970 1004003 1004036 1004070 1004103 1004136 1004170 1004203 1004237 1004270 1004303 1004337 1004370 1004403 1004437 1004470 1004503 1004537 1004570 1004604 1004637 1004670 1004704 1004737 1004770 1004804 1004837 1004871 1004904 1004937 1004971 1005004 1005037 1005071 1005104 1005137 1005171 1005204 1005238 1005271 1005304 1005338 1005371 1005404 1005438 1005471 1005504 1005546 1005588 1005630 1005671 1005713 1005755 1005796 1005838 1005880 1005922 1005963 1006005 1006047 1006088 1006130 1006172 1006214 1006255 1006297 1006339 1006380 1006422 1006464 1006505 1006547 1006589 1006631 1006672 1006714 1006756 1006797 1006839 1006881 1006923 1006964 1007006 1007048 1007089 1007131 1007173 1007215 1007256 1007298 1007340 1007381 1007423 1007465 1007506 1007548 1007590 1007632 1007673 1007715 1007757 1007798 1007840 1007882 1007924 1007965 1008007 1008049 1008090 1008132 1008174 1008216 1008257 1008299 1008341 1008382 1008424 1008466 1008507 1008549 1008591 1008633 1008674 1008716 1008758 1008799 1008841 1008883 1008925 1008966 1009008 1009050 1009091 1009133 1009175 1009217 1009258 1009300 1009342 1009383 1009425 1009467 1009508 1009550 1009592 1009634 1009675 1009717 1009759 1009800 1009842 1009884 1009926 1009967 1010009 1010051 1010092 1010134 1010176 1010218 1010259 1010301 1010343 1010384 1010426 1010468 1010509 1010551 1010593 1010635 1010676 1010710 1010743 1010776 1010810 1010843 1010877 1010910 1010943 1010977 1011010 1011043 1011077 1011110 1011143 1011177 1011210 1011244 1011277 1011310 1011344 1011377 1011410 1011444 1011477 1011510 1011544 1011577 1011611 1011644 1011677 1011711 1011744 1011777 1011811 1011844 1011878 1011911 1011944 1011978 1012011 1012044 1012078 1012111 1012144 1012178 1012211 1012245 1012278 1012311 1012345 1012378 1012411 1012445 1012478 1012511 1012545 1012578 1012612 1012645 1012678 1012712 1012745 1012778 1012812 1012845 1012879 1012912 1012945 1012979 1013012 1013045 1013079 1013112 1013145 1013179 1013212 1013246 1013279 1013312 1013346 1013379 1013412 1013446 1013479 1013512 1013546 1013579 1013613 1013646 1013679 1013713 1013746 1013779 1013813 1013846 1013880 1013913 1013946 1013980 1014013 1014046 1014080 1014113 1014146 1014180 1014213 1014247 1014280 1014313 1014347 1014380 1014413 1014447 1014480 1014513 1014547 1014580 1014614 1014647 1014680 1014714 1014747 1014780 1014814 1014847 1014881 1014914 1014947 1014981 1015014 1015047 1015081 1015114 1015147 1015181 1015214 1015248 1015281 1015314 1015348 1015381 1015414 1015448 1015481 1015514 1015548 1015581 1015615 1015648 1015681 1015715 1015748 1015781 1015815 1015848 1015882 1015915 1015948 1015982 1016015 1016048 1016082 1016115 1016148 1016182 1016215 1016249 1016282 1016315 1016349 1016382 1016415 1016449 1016482 1016515 1016549 1016582 1016616 1016649 1016682 1016716 1016749 1016782 1016816 1016849 1016883 1016916 1016949 1016983 1017016 1017049 1017083 1017116 1017149 1017183 1017216 1017250 1017283 1017316 1017350 1017383 1017416 1017450 1017483 1017516 1017550 1017583 1017617 1017650 1017683 1017717 1017750 1017783 1017817 1017850 1017884 1017917 1017950 1017984 1018017 1018050 1018084 1018117 1018150 1018184 1018217 1018251 1018284 1018317 1018351 1018384 1018417 1018451 1018484 1018517 1018551 1018584 1018618 1018651 1018684 1018718 1018751 1018784 1018818 1018851 1018885 1018918 1018951 1018985 1019018 1019051 1019085 1019118 1019151 1019185 1019218 1019252 1019285 1019318 1019352 1019385 1019418 1019452 1019485 1019518 1019552 1019585 1019619 1019652 1019685 1019719 1019752 1019785 1019819 1019852 1019886 1019919 1019952 1019986 1020019 1020052 1020086 1020119 1020152 1020186 1020219 1020253 1020286 1020319 1020353 1020386 1020419 1020453 1020486 1020519 1020553 1020586 1020620 1020653 1020686 1020720 1020753 1020786 1020820 1020853 1020887 1020920 1020953 1020987 1021020 1021053 1021087 1021120 1021153 1021187 1021220 1021254 1021287 1021320 1021354 1021387 1021420 1021454 1021487 1021520 1021554 1021587 1021621 1021654 1021687 1021721 1021754 1021787 1021821 1021854 1021888 1021921 1021954 1021988 1022021 1022054 1022088 1022121 1022154 1022188 1022221 1022255 1022288 1022321 1022355 1022388 1022421 1022455 1022488 1022521 1022555 1022588 1022622 1022655 1022688 1022722 1022755 1022788 1022822 1022855 1022889 1022922 1022955 1022989 1023022 1023055 1023089 1023122 1023155 1023189 1023222 1023256 1023289 1023322 1023356 1023397 1023439 1023481 1023522 1023564 1023606 1023648 1023689 1023731 1023773 1023814 1023856 1023898 1023940 1023981 1024023 1024065 1024106 1024148 1024190 1024232 1024273 1024315 1024357 1024398 1024440 1024482 1024523 1024565 1024607 1024649 1024690 1024732 1024774 1024815 1024857 1024899 1024941 1024982 1025024 1025066 1025107 1025149 1025191 1025233 1025274 1025316 1025358 1025399 1025441 1025483 1025524 1025566 1025608 1025650 1025691 1025733 1025775 1025816 1025858 1025900 1025942 1025983 1026025 1026067 1026108 1026150 1026192 1026234 1026275 1026317 1026359 1026400 1026442 1026484 1026525 1026567 1026609 1026651 1026692 1026734 1026776 1026817 1026859 1026901 1026943 1026984 1027026 1027068 1027109 1027151 1027193 1027235 1027276 1027318 1027360 1027401 1027443 1027485 1027526 1027568 1027610 1027652 1027693 1027735 1027777 1027818 1027860 1027902 1027944 1027985 1028027 1028069 1028110 1028152 1028194 1028236 1028277 1028319 1028361 1028402 1028444 1028486 1028527 1028569 1028611 1028653 1028694 1028736 1028778 1028819 1028861 1028903 1028945 1028986 1029028 1029070 1029111 1029153 1029195 1029237 1029278 1029320 1029362 1029403 1029445 1029487 1029528 1029570 1029612 1029654 1029695 1029737 1029779 1029820 1029862 1029904 1029946 1029987 1030029 1030071 1030112 1030154 1030196 1030238 1030279 1030321 1030363 1030404 1030446 1030488 1030529 1030571 1030613 1030655 1030696 1030738 1030780 1030821 1030863 1030905 1030947 1030988 1031030 1031072 1031113 1031155 1031197 1031239 1031280 1031322 1031364 1031405 1031447 1031489 1031530 1031572 1031614 1031656 1031697 1031739 1031781 1031822 1031864 1031906 1031948 1031989 1032031 1032073 1032114 1032156 1032198 1032240 1032281 1032323 1032365 1032406 1032448 1032490 1032531 1032573 1032615 1032657 1032698 1032740 1032782 1032823 1032865 1032907 1032949 1032990 1033032 1033074 1033115 1033157 1033199 1033241 1033282 1033324 1033366 1033407 1033449 1033491 1033532 1033566 1033599 1033633 1033666 1033699 1033733 1033766 1033799 1033833 1033866 1033900 1033933 1033966 1034000 1034033 1034066 1034100 1034133 1034166 1034200 1034233 1034267 1034300 1034333 1034367 1034400 1034433 1034467 1034500 1034533 1034567 1034600 1034634 1034667 1034700 1034734 1034767 1034800 1034834 1034867 1034901 1034934 1034967 1035001 1035034 1035067 1035101 1035134 1035167 1035201 1035234 1035268 1035301 1035334 1035368 1035401 1035434 1035468 1035501 1035534 1035568 1035601 1035635 1035668 1035701 1035735 1035768 1035801 1035835 1035868 1035902 1035935 1035968 1036002 1036035 1036068 1036102 1036135 1036168 1036202 1036235 1036269 1036302 1036335 1036369 1036402 1036435 1036469 1036502 1036535 1036569 1036602 1036636 1036669 1036702 1036736 1036769 1036802 1036836 1036869 1036903 1036936 1036969 1037003 1037036 1037069 1037103 1037136 1037169 1037203 1037236 1037270 1037303 1037336 1037370 1037403 1037436 1037470 1037503 1037536 1037570 1037603 1037637 1037670 1037703 1037737 1037770 1037803 1037837 1037870 1037904 1037937 1037970 1038004 1038037 1038070 1038104 1038137 1038170 1038204 1038237 1038271 1038304 1038337 1038371 1038404 1038437 1038471 1038504 1038537 1038571 1038604 1038638 1038671 1038704 1038738 1038771 1038804 1038838 1038871 1038905 1038938 1038971 1039005 1039038 1039071 1039105 1039138 1039171 1039205 1039238 1039272 1039305 1039338 1039372 1039405 1039438 1039472 1039505 1039538 1039572 1039605 1039639 1039672 1039705 1039739 1039772 1039805 1039839 1039872 1039906 1039939 1039972 1040006 1040039 1040072 1040106 1040139 1040172 1040206 1040239 1040273 1040306 1040339 1040373 1040406 1040439 1040473 1040506 1040539 1040573 1040606 1040640 1040673 1040706 1040740 1040773 1040806 1040840 1040873 1040907 1040940 1040973 1041007 1041040 1041073 1041107 1041140 1041173 1041207 1041240 1041274 1041307 1041340 1041374 1041407 1041440 1041474 1041507 1041540 1041574 1041607 1041641 1041674 1041707 1041749 1041791 1041832 1041874 1041916 1041958 1041999 1042041 1042083 1042124 1042166 1042208 1042250 1042291 1042333 1042375 1042416 1042458 1042500 1042541 1042583 1042625 1042667 1042708 1042750 1042792 1042833 1042875 1042917 1042959 1043000 1043042 1043084 1043125 1043167 1043209 1043251 1043292 1043334 1043376 1043417 1043459 1043501 1043542 1043584 1043626 1043668 1043709 1043751 1043793 1043834 1043876 1043918 1043960 1044001 1044043 1044085 1044126 1044168 1044210 1044252 1044293 1044335 1044377 1044410 1044443 1044477 1044510 1044543 1044585 1044627 1044669 1044710 1044752 1044794 1044835 1044877 1044919 1044961 1045002 1045044 1045086 1045127 1045169 1045211 1045244 1045278 1045311 1045344 1045378 1045411 1045444 1045478 1045511 1045544 1045578 1045611 1045645 1045678 1045711 1045745 1045778 1045811 1045845 1045878 1045912 1045945 1045978 1046012 1046045 1046078 1046112 1046145 1046178 1046212 1046245 1046279 1046312 1046345 1046379 1046412 1046445 1046479 1046512 1046545 1046579 1046612 1046646 1046679 1046712 1046754 1046796 1046837 1046879 1046913 1046946 1046979 1047013 1047046 1047088 1047129 1047171 1047213 1047255 1047296 1047338 1047380 1047413 1047446 1047480 1047513 1047546 1047588 1047630 1047672 1047713 1047747 1047780 1047813 1047847 1047880 1047914 1047947 1047980 1048014 1048047 1048089 1048130 1048172 1048214 1048256 1048297 1048339 1048381 1048422 1048464 1048506 1048547 1048589 1048631 1048673 1048714 1048756 1048798 1048839 1048881 1048923 1048965 1049006 1049048 1049090 1049131 1049173 1049215 1049257 1049298 1049340 1049382 1049423 1049465 1049507 1049548 1049590 1049632 1049674 1049715 1049757 1049799 1049840 1049882 1049924 1049966 1050007 1050049 1050091 1050132 1050174 1050216 1050258 1050299 1050341 1050383 1050424 1050466 1050508 1050549 1050591 1050633 1050675 1050716 1050758 1050800 1050841 1050883 1050925 1050967 1051008 1051050 1051092 1051133 1051175 1051217 1051259 1051300 1051342 1051384 1051425 1051467 1051509 1051550 1051592 1051634 1051676 1051717 1051759 1051801 1051842 1051884 1051926 1051968 1052009 1052051 1052093 1052134 1052176 1052218 1052260 1052301 1052343 1052385 1052426 1052468 1052510 1052551 1052593 1052635 1052677 1052718 1052760 1052802 1052843 1052885 1052927 1052969 1053010 1053052 1053094 1053135 1053177 1053219 1053261 1053302 1053344 1053386 1053427 1053469 1053511 1053552 1053594 1053636 1053678 1053719 1053761 1053803 1053844 1053886 1053928 1053970 1054011 1054053 1054095 1054136 1054178 1054220 1054262 1054303 1054345 1054387 1054428 1054470 1054512 1054553 1054595 1054637 1054679 1054720 1054762 1054804 1054845 1054887 1054929 1054971 1055012 1055054 1055096 1055137 1055179 1055221 1055263 1055304 1055346 1055388 1055429 1055471 1055513 1055554 1055596 1055638 1055680 1055721 1055763 1055805 1055846 1055888 1055930 1055972 1056013 1056055 1056097 1056138 1056180 1056222 1056264 1056305 1056347 1056389 1056430 1056472 1056514 1056555 1056597 1056639 1056681 1056722 1056764 1056806 1056847 1056889 1056931 1056973 1057014 1057056 1057098 1057139 1057181 1057223 1057265 1057306 1057348 1057390 1057431 1057473 1057515 1057556 1057598 1057640 1057682 1057723 1057765 1057807 1057848 1057890 1057932 1057974 1058015 1058057 1058099 1058140 1058182 1058224 1058266 1058307 1058349 1058391 1058432 1058474 1058516 1058557 1058599 1058641 1058683 1058724 1058766 1058808 1058849 1058891 1058933 1058975 1059016 1059058 1059100 1059141 1059183 1059225 1059267 1059308 1059350 1059392 1059433 1059475 1059517 1059558 1059600 1059642 1059684 1059725 1059767 1059809 1059850 1059892 1059934 1059976 1060017 1060059 1060101 1060142 1060184 1060226 1060268 1060309 1060351 1060393 1060434 1060476 1060518 1060559 1060601 1060643 1060685 1060726 1060768 1060810 1060851 1060893 1060935 1060977 1061018 1061060 1061102 1061143 1061185 1061227 1061260 1061294 1061327 1061360 1061394 1061427 1061460 1061494 1061527 1061560 1061594 1061627 1061661 1061694 1061727 1061761 1061794 1061827 1061861 1061894 1061928 1061961 1061994 1062028 1062061 1062094 1062128 1062161 1062194 1062228 1062261 1062295 1062328 1062361 1062395 1062428 1062461 1062495 1062528 1062561 1062595 1062628 1062662 1062695 1062728 1062762 1062795 1062828 1062862 1062895 1062937 1062979 1063020 1063062 1063104 1063145 1063187 1063229 1063271 1063312 1063354 1063396 1063437 1063479 1063521 1063562 1063604 1063646 1063688 1063729 1063771 1063813 1063854 1063896 1063938 1063980 1064021 1064063 1064105 1064146 1064188 1064230 1064272 1064313 1064355 1064397 1064438 1064480 1064522 1064563 1064605 1064647 1064689 1064730 1064772 1064814 1064855 1064897 1064939 1064981 1065022 1065064 1065106 1065147 1065189 1065231 1065273 1065314 1065356 1065398 1065439 1065481 1065523 1065564 1065606 1065648 1065690 1065731 1065773 1065815 1065856 1065898 1065940 1065982 1066023 1066065 1066107 1066148 1066190 1066232 1066274 1066315 1066357 1066399 1066440 1066482 1066524 1066565 1066607 1066649 1066691 1066732 1066774 1066816 1066857 1066899 1066941 1066983 1067024 1067066 1067108 1067149 1067191 1067233 1067275 1067316 1067358 1067400 1067441 1067483 1067525 1067566 1067608 1067650 1067692 1067733 1067775 1067817 1067858 1067900 1067942 1067984 1068025 1068067 1068109 1068150 1068192 1068234 1068276 1068317 1068359 1068401 1068442 1068484 1068526 1068567 1068609 1068651 1068693 1068734 1068776 1068818 1068859 1068901 1068943 1068985 1069026 1069068 1069110 1069151 1069193 1069235 1069277 1069318 1069360 1069402 1069443 1069485 1069527 1069568 1069610 1069652 1069694 1069735 1069777 1069819 1069860 1069902 1069944 1069986 1070027 1070069 1070111 1070152 1070194 1070236 1070278 1070319 1070361 1070403 1070444 1070486 1070528 1070569 1070611 1070653 1070695 1070736 1070778 1070820 1070861 1070903 1070945 1070987 1071028 1071070 1071112 1071153 1071195 1071237 1071279 1071320 1071362 1071404 1071445 1071487 1071529 1071570 1071612 1071654 1071696 1071737 1071771 1071804 1071837 1071871 1071904 1071938 1071971 1072004 1072038 1072071 1072104 1072138 1072171 1072204 1072238 1072280 1072321 1072363 1072405 1072446 1072488 1072530 1072571 1072605 1072638 1072672 1072705 1072738 1072772 1072805 1072838 1072872 1072905 1072939 1072972 1073005 1073039 1073072 1073105 1073139 1073172 1073205 1073239 1073281 1073322 1073364 1073406 1073447 1073489 1073531 1073572 1073614 1073656 1073698 1073739 1073781 1073823 1073864 1073906 1073940 1073973 1074006 1074040 1074073 1074115 1074156 1074198 1074240 1074282 1074323 1074365 1074407 1074448 1074490 1074532 1074573 1074615 1074657 1074699 1074740 1074782 1074824 1074865 1074907 1074949 1074991 1075032 1075074 1075116 1075157 1075199 1075241 1075283 1075324 1075366 1075408 1075449 1075491 1075533 1075574 1075616 1075658 1075700 1075741 1075783 1075825 1075866 1075908 1075950 1075992 1076033 1076075 1076117 1076158 1076200 1076242 1076284 1076325 1076367 1076409 1076450 1076492 1076534 1076575 1076617 1076659 1076701 1076742 1076784 1076826 1076867 1076909 1076951 1076993 1077034 1077076 1077118 1077159 1077201 1077243 1077285 1077326 1077368 1077410 1077451 1077493 1077535 1077576 1077618 1077660 1077702 1077743 1077785 1077827 1077868 1077910 1077952 1077994 1078035 1078077 1078110 1078144 1078177 1078210 1078244 1078277 1078311 1078344 1078377 1078411 1078444 1078477 1078511 1078544 1078577 1078611 1078644 1078678 1078711 1078744 1078778 1078811 1078844 1078878 1078911 1078945 1078978 1079011 1079045 1079078 1079111 1079145 1079178 1079211 1079245 1079278 1079312 1079345 1079378 1079412 1079445 1079478 1079512 1079545 1079578 1079612 1079645 1079679 1079712 1079745 1079779 1079812 1079845 1079879 1079912 1079946 1079979 1080012 1080046 1080079 1080121 1080162 1080204 1080246 1080288 1080329 1080371 1080413 1080454 1080496 1080538 1080579 1080621 1080663 1080705 1080746 1080788 1080830 1080871 1080913 1080955 1080997 1081038 1081080 1081122 1081163 1081205 1081247 1081289 1081330 1081372 1081414 1081455 1081497 1081539 1081580 1081622 1081664 1081706 1081747 1081789 1081831 1081872 1081914 1081956 1081998 1082039 1082081 1082123 1082164 1082206 1082248 1082290 1082331 1082373 1082415 1082456 1082498 1082540 1082581 1082623 1082665 1082707 1082748 1082790 1082832 1082873 1082915 1082957 1082999 1083040 1083082 1083124 1083165 1083207 1083249 1083291 1083332 1083374 1083416 1083457 1083499 1083541 1083582 1083624 1083666 1083708 1083749 1083791 1083833 1083874 1083916 1083958 1084000 1084041 1084083 1084125 1084166 1084208 1084250 1084292 1084333 1084375 1084417 1084458 1084500 1084542 1084583 1084625 1084667 1084709 1084750 1084792 1084834 1084875 1084917 1084959 1085001 1085042 1085084 1085126 1085167 1085209 1085251 1085293 1085334 1085376 1085418 1085459 1085501 1085543 1085584 1085626 1085668 1085710 1085751 1085793 1085835 1085876 1085918 1085960 1086002 1086043 1086085 1086127 1086168 1086210 1086252 1086294 1086335 1086377 1086419 1086460 1086502 1086544 1086585 1086627 1086669 1086711 1086752 1086794 1086836 1086877 1086919 1086961 1087003 1087044 1087086 1087128 1087169 1087211 1087253 1087295 1087336 1087378 1087420 1087461 1087503 1087545 1087586 1087628 1087670 1087712 1087753 1087795 1087837 1087878 1087920 1087962 1088004 1088045 1088087 1088129 1088170 1088212 1088254 1088296 1088337 1088379 1088421 1088462 1088504 1088546 1088587 1088629 1088671 1088713 1088754 1088796 1088838 1088879 1088921 1088963 1089005 1089046 1089088 1089130 1089171 1089213 1089255 1089297 1089338 1089380 1089422 1089463 1089505 1089547 1089588 1089630 1089672 1089714 1089755 1089797 1089839 1089880 1089922 1089964 1090006 1090047 1090089 1090131 1090172 1090214 1090256 1090298 1090339 1090381 1090423 1090464 1090506 1090548 1090589 1090631 1090673 1090715 1090756 1090798 1090840 1090881 1090923 1090965 1091007 1091048 1091090 1091132 1091173 1091215 1091257 1091299 1091340 1091382 1091424 1091465 1091507 1091549 1091590 1091632 1091674 1091716 1091757 1091799 1091841 1091882 1091924 1091966 1092008 1092049 1092091 1092133 1092174 1092216 1092258 1092300 1092341 1092383 1092425 1092466 1092508 1092550 1092591 1092633 1092675 1092717 1092758 1092800 1092842 1092883 1092925 1092967 1093009 1093050 1093092 1093134 1093175 1093217 1093259 1093301 1093342 1093384 1093426 1093467 1093509 1093551 1093592 1093634 1093676 1093718 1093759 1093801 1093843 1093884 1093926 1093968 1094010 1094051 1094093 1094135 1094176 1094218 1094260 1094302 1094343 1094385 1094427 1094468 1094510 1094552 1094593 1094635 1094677 1094719 1094760 1094802 1094844 1094885 1094927 1094969 1095011 1095052 1095094 1095136 1095177 1095219 1095261 1095303 1095344 1095386 1095428 1095469 1095511 1095553 1095594 1095636 1095678 1095720 1095761 1095803 1095845 1095886 1095928 1095970 1096012 1096053 1096095 1096137 1096178 1096220 1096262 1096304 1096345 1096387 1096429 1096470 1096512 1096554 1096595 1096637 1096679 1096721 1096762 1096804 1096846 1096887 1096929 1096971 1097013 1097054 1097096 1097138 1097179 1097221 1097263 1097305 1097346 1097388 1097430 1097471 1097513 1097555 1097596 1097638 1097680 1097722 1097763 1097805 1097847 1097888 1097930 1097972 1098014 1098055 1098097 1098139 1098180 1098222 1098264 1098306 1098347 1098389 1098431 1098472 1098514 1098556 1098597 1098639 1098681 1098723 1098764 1098806 1098848 1098889 1098931 1098973 1099015 1099056 1099098 1099140 1099181 1099223 1099265 1099307 1099348 1099390 1099432 1099473 1099515 1099557 1099598 1099640 1099682 1099724 1099765 1099807 1099849 1099890 1099932 1099974 1100016 1100057 1100099 1100141 1100182 1100224 1100266 1100308 1100349 1100391 1100433 1100474 1100516 1100558 1100599 1100641 1100683 1100725 1100766 1100808 1100850 1100891 1100933 1100975 1101017 1101058 1101100 1101142 1101183 1101225 1101267 1101309 1101350 1101392 1101434 1101475 1101517 1101559 1101600 1101642 1101684 1101726 1101767 1101809 1101851 1101892 1101934 1101976 1102018 1102059 1102101 1102143 1102184 1102226 1102268 1102310 1102351 1102393 1102435 1102476 1102518 1102560 1102601 1102643 1102685 1102727 1102768 1102810 1102852 1102893 1102935 1102977 1103019 1103060 1103102 1103144 1103185 1103227 1103269 1103311 1103352 1103394 1103436 1103477 1103519 1103561 1103602 1103644 1103686 1103728 1103769 1103811 1103853 1103894 1103936 1103978 1104020 1104061 1104103 1104145 1104186 1104228 1104270 1104303 1104337 1104370 1104403 1104437 1104470 1104503 1104537 1104570 1104603 1104637 1104670 1104704 1104737 1104770 1104804 1104837 1104870 1104904 1104937 1104971 1105004 1105037 1105071 1105104 1105137 1105171 1105204 1105237 1105271 1105304 1105338 1105371 1105404 1105438 1105471 1105504 1105538 1105571 1105604 1105638 1105671 1105705 1105738 1105771 1105805 1105838 1105871 1105905 1105938 1105972 1106005 1106038 1106072 1106105 1106138 1106172 1106205 1106238 1106272 1106305 1106339 1106372 1106405 1106439 1106472 1106505 1106539 1106572 1106605 1106639 1106672 1106706 1106739 1106772 1106806 1106839 1106872 1106906 1106939 1106973 1107006 1107039 1107073 1107106 1107139 1107173 1107206 1107239 1107273 1107306 1107340 1107373 1107406 1107440 1107473 1107506 1107540 1107573 1107606 1107640 1107673 1107707 1107740 1107773 1107815 1107857 1107898 1107940 1107982 1108024 1108065 1108107 1108149 1108190 1108232 1108274 1108316 1108357 1108399 1108441 1108482 1108524 1108566 1108607 1108649 1108691 1108733 1108774 1108816 1108858 1108899 1108941 1108983 1109025 1109066 1109108 1109150 1109191 1109233 1109275 1109317 1109358 1109400 1109442 1109483 1109525 1109567 1109608 1109650 1109692 1109734 1109775 1109817 1109859 1109900 1109942 1109984 1110026 1110067 1110109 1110151 1110192 1110234 1110276 1110318 1110359 1110401 1110443 1110484 1110526 1110568 1110609 1110651 1110693 1110735 1110776 1110818 1110860 1110901 1110943 1110985 1111027 1111068 1111110 1111152 1111193 1111235 1111277 1111319 1111360 1111402 1111444 1111485 1111527 1111569 1111610 1111652 1111694 1111736 1111777 1111819 1111861 1111902 1111944 1111986 1112028 1112069 1112111 1112153 1112194 1112236 1112278 1112320 1112361 1112403 1112445 1112486 1112528 1112570 1112611 1112653 1112695 1112737 1112778 1112820 1112862 1112903 1112945 1112987 1113029 1113070 1113112 1113145 1113179 1113212 1113245 1113279 1113312 1113346 1113379 1113412 1113446 1113479 1113512 1113546 1113579 1113612 1113646 1113679 1113713 1113746 1113779 1113821 1113863 1113904 1113946 1113980 1114013 1114046 1114080 1114113 1114146 1114180 1114213 1114246 1114280 1114313 1114347 1114380 1114413 1114447 1114480 1114513 1114547 1114580 1114613 1114647 1114680 1114714 1114747 1114780 1114814 1114847 1114880 1114914 1114947 1114989 1115031 1115072 1115114 1115147 1115181 1115214 1115247 1115281 1115323 1115364 1115406 1115448 1115489 1115531 1115573 1115614 1115656 1115698 1115740 1115781 1115823 1115865 1115906 1115948 1115990 1116032 1116073 1116115 1116157 1116198 1116240 1116282 1116324 1116365 1116407 1116449 1116490 1116532 1116574 1116615 1116657 1116699 1116741 1116782 1116824 1116866 1116907 1116949 1116991 1117033 1117074 1117116 1117158 1117199 1117241 1117283 1117325 1117366 1117408 1117450 1117491 1117533 1117575 1117616 1117658 1117700 1117742 1117783 1117825 1117867 1117908 1117950 1117992 1118034 1118075 1118117 1118159 1118200 1118242 1118284 1118326 1118367 1118409 1118451 1118492 1118534 1118576 1118617 1118659 1118701 1118743 1118784 1118826 1118868 1118909 1118951 1118985 1119018 1119051 1119085 1119118 1119160 1119201 1119243 1119285 1119327 1119368 1119410 1119452 1119493 1119535 1119577 1119618 1119660 1119702 1119744 1119785 1119827 1119869 1119910 1119952 1119986 1120019 1120052 1120086 1120119 1120161 1120202 1120244 1120286 1120319 1120353 1120386 1120419 1120453 1120486 1120519 1120553 1120586 1120619 1120661 1120703 1120745 1120786 1120828 1120870 1120911 1120953 1120987 1121020 1121053 1121087 1121120 1121162 1121203 1121245 1121287 1121329 1121370 1121412 1121454 1121495 1121537 1121579 1121620 1121662 1121704 1121746 1121787 1121821 1121854 1121887 1121921 1121954 1121988 1122021 1122054 1122088 1122121 1122163 1122204 1122246 1122288 1122330 1122371 1122413 1122455 1122496 1122538 1122580 1122621 1122663 1122705 1122747 1122788 1122830 1122872 1122913 1122955 1122989 1123022 1123055 1123089 1123122 1123164 1123205 1123247 1123289 1123331 1123372 1123414 1123456 1123497 1123539 1123581 1123622 1123664 1123706 1123748 1123789 1123831 1123873 1123914 1123956 1123998 1124040 1124081 1124123 1124165 1124206 1124248 1124290 1124332 1124373 1124415 1124457 1124498 1124540 1124582 1124623 1124665 1124707 1124749 1124790 1124832 1124874 1124915 1124957 1124999 1125041 1125082 1125124 1125166 1125207 1125249 1125291 1125333 1125374 1125416 1125458 1125499 1125541 1125583 1125624 1125666 1125708 1125750 1125791 1125833 1125875 1125916 1125958 1126000 1126042 1126083 1126125 1126167 1126208 1126250 1126292 1126334 1126375 1126417 1126459 1126500 1126542 1126584 1126625 1126667 1126709 1126751 1126792 1126834 1126876 1126917 1126959 1127001 1127043 1127084 1127126 1127168 1127209 1127251 1127293 1127335 1127376 1127418 1127460 1127501 1127543 1127585 1127626 1127668 1127710 1127752 1127793 1127835 1127877 1127918 1127960 1128002 1128044 1128085 1128127 1128169 1128210 1128252 1128294 1128336 1128377 1128419 1128461 1128502 1128544 1128586 1128627 1128669 1128711 1128753 1128794 1128836 1128878 1128919 1128961 1129003 1129045 1129086 1129128 1129170 1129211 1129253 1129295 1129328 1129362 1129395 1129428 1129462 1129495 1129528 1129562 1129595 1129628 1129662 1129695 1129729 1129762 1129795 1129829 1129862 1129895 1129929 1129962 1129996 1130029 1130062 1130096 1130129 1130162 1130196 1130229 1130262 1130296 1130329 1130363 1130396 1130429 1130463 1130496 1130529 1130563 1130596 1130629 1130663 1130696 1130730 1130763 1130796 1130838 1130880 1130921 1130963 1130997 1131030 1131063 1131097 1131130 1131163 1131197 1131230 1131263 1131297 1131330 1131364 1131397 1131430 1131464 1131505 1131547 1131589 1131630 1131664 1131697 1131731 1131764 1131797 1131831 1131864 1131897 1131931 1131964 1132006 1132048 1132089 1132131 1132173 1132214 1132256 1132298 1132340 1132381 1132423 1132465 1132506 1132548 1132590 1132631 1132665 1132698 1132732 1132765 1132798 1132832 1132865 1132898 1132932 1132965 1132999 1133032 1133065 1133099 1133132 1133174 1133215 1133257 1133299 1133341 1133382 1133424 1133466 1133507 1133549 1133591 1133632 1133674 1133716 1133758 1133799 1133841 1133883 1133924 1133966 1134008 1134050 1134091 1134133 1134175 1134216 1134258 1134300 1134342 1134383 1134425 1134467 1134508 1134550 1134592 1134633 1134675 1134717 1134759 1134800 1134842 1134884 1134925 1134967 1135009 1135051 1135092 1135134 1135176 1135217 1135259 1135301 1135343 1135384 1135426 1135468 1135509 1135551 1135593 1135634 1135676 1135718 1135760 1135801 1135843 1135885 1135926 1135968 1136010 1136052 1136093 1136135 1136177 1136218 1136260 1136302 1136344 1136385 1136427 1136469 1136510 1136552 1136594 1136635 1136677 1136719 1136761 1136802 1136844 1136886 1136927 1136969 1137011 1137053 1137094 1137136 1137178 1137219 1137261 1137303 1137345 1137386 1137428 1137470 1137511 1137553 1137595 1137636 1137678 1137720 1137762 1137803 1137845 1137887 1137928 1137970 1138012 1138054 1138095 1138137 1138179 1138220 1138262 1138304 1138346 1138387 1138429 1138471 1138512 1138554 1138596 1138637 1138679 1138721 1138763 1138804 1138846 1138888 1138929 1138971 1139013 1139055 1139096 1139138 1139180 1139221 1139263 1139305 1139347 1139388 1139430 1139472 1139513 1139555 1139597 1139638 1139680 1139722 1139764 1139805 1139847 1139889 1139930 1139972 1140014 1140056 1140097 1140139 1140172 1140206 1140239 1140272 1140306 1140348 1140389 1140431 1140473 1140506 1140539 1140573 1140606 1140639 1140673 1140706 1140740 1140773 1140806 1140840 1140873 1140906 1140940 1140973 1141007 1141040 1141073 1141107 1141140 1141173 1141207 1141240 1141273 1141307 1141340 1141374 1141407 1141440 1141474 1141507 1141540 1141574 1141607 1141640 1141682 1141724 1141766 1141807 1141841 1141874 1141907 1141941 1141974 1142008 1142041 1142074 1142108 1142141 1142183 1142224 1142266 1142308 1142341 1142375 1142408 1142441 1142475 1142508 1142541 1142575 1142608 1142641 1142675 1142708 1142742 1142775 1142808 1142842 1142875 1142908 1142942 1142975 1143009 1143042 1143075 1143109 1143142 1143175 1143209 1143242 1143275 1143309 1143342 1143376 1143409 1143442 1143476 1143509 1143542 1143576 1143609 1143642 1143676 1143709 1143743 1143776 1143809 1143843 1143876 1143909 1143943 1143976 1144010 1144043 1144076 1144110 1144143 1144176 1144210 1144243 1144276 1144310 1144343 1144377 1144410 1144443 1144477 1144510 1144543 1144577 1144610 1144643 1144677 1144710 1144744 1144777 1144810 1144844 1144877 1144910 1144944 1144977 1145011 1145044 1145077 1145111 1145144 1145177 1145211 1145244 1145277 1145311 1145344 1145378 1145411 1145444 1145478 1145511 1145544 1145578 1145611 1145644 1145678 1145711 1145745 1145778 1145811 1145845 1145878 1145911 1145945 1145978 1146020 1146062 1146103 1146145 1146178 1146212 1146245 1146278 1146312 1146345 1146379 1146412 1146445 1146479 1146520 1146562 1146604 1146645 1146679 1146712 1146746 1146779 1146812 1146846 1146879 1146912 1146946 1146979 1147013 1147046 1147079 1147113 1147146 1147179 1147213 1147246 1147279 1147313 1147355 1147396 1147438 1147480 1147513 1147546 1147580 1147613 1147646 1147680 1147713 1147747 1147780 1147813 1147855 1147897 1147938 1147980 1148022 1148064 1148105 1148147 1148189 1148230 1148272 1148314 1148356 1148397 1148439 1148481 1148522 1148564 1148606 1148647 1148689 1148731 1148773 1148814 1148856 1148898 1148939 1148981 1149023 1149065 1149106 1149148 1149190 1149231 1149273 1149315 1149357 1149398 1149440 1149482 1149523 1149565 1149607 1149648 1149690 1149732 1149774 1149815 1149857 1149899 1149940 1149982 1150024 1150066 1150107 1150149 1150191 1150232 1150274 1150316 1150358 1150399 1150441 1150483 1150524 1150566 1150608 1150649 1150691 1150733 1150775 1150816 1150858 1150900 1150941 1150983 1151025 1151067 1151108 1151150 1151192 1151233 1151275 1151317 1151359 1151400 1151442 1151484 1151517 1151550 1151584 1151617 1151650 1151692 1151734 1151776 1151817 1151859 1151901 1151942 1151984 1152026 1152068 1152109 1152151 1152193 1152234 1152276 1152318 1152360 1152401 1152443 1152485 1152526 1152568 1152610 1152651 1152693 1152735 1152777 1152818 1152860 1152902 1152943 1152985 1153019 1153052 1153085 1153119 1153152 1153185 1153219 1153252 1153285 1153319 1153352 1153386 1153419 1153452 1153486 1153519 1153552 1153586 1153619 1153652 1153686 1153719 1153753 1153786 1153819 1153853 1153886 1153919 1153953 1153986 1154020 1154053 1154086 1154120 1154153 1154186 1154220 1154253 1154286 1154320 1154353 1154387 1154420 1154453 1154487 1154520 1154553 1154587 1154620 1154653 1154687 1154720 1154754 1154787 1154820 1154862 1154904 1154945 1154987 1155029 1155071 1155112 1155154 1155196 1155237 1155279 1155321 1155363 1155404 1155446 1155488 1155529 1155571 1155613 1155654 1155696 1155738 1155780 1155821 1155863 1155905 1155946 1155988 1156030 1156072 1156113 1156155 1156197 1156238 1156280 1156322 1156364 1156405 1156447 1156489 1156530 1156572 1156614 1156655 1156697 1156739 1156781 1156822 1156864 1156906 1156947 1156989 1157031 1157073 1157114 1157156 1157198 1157239 1157281 1157323 1157365 1157406 1157448 1157490 1157531 1157573 1157615 1157656 1157698 1157740 1157782 1157823 1157865 1157907 1157948 1157990 1158024 1158057 1158090 1158124 1158157 1158190 1158224 1158257 1158290 1158324 1158357 1158391 1158424 1158457 1158491 1158524 1158557 1158591 1158624 1158657 1158691 1158724 1158758 1158791 1158824 1158858 1158891 1158924 1158958 1158991 1159025 1159058 1159091 1159125 1159158 1159191 1159225 1159258 1159291 1159325 1159358 1159392 1159425 1159458 1159492 1159525 1159558 1159592 1159625 1159658 1159692 1159725 1159759 1159792 1159825 1159859 1159892 1159925 1159959 1159992 1160026 1160059 1160092 1160126 1160159 1160192 1160226 1160259 1160292 1160326 1160359 1160393 1160426 1160459 1160493 1160526 1160559 1160593 1160626 1160659 1160693 1160726 1160760 1160793 1160826 1160860 1160893 1160926 1160960 1160993 1161035 1161077 1161118 1161160 1161202 1161243 1161285 1161327 1161360 1161394 1161427 1161460 1161494 1161527 1161560 1161594 1161627 1161660 1161702 1161744 1161786 1161827 1161869 1161911 1161952 1161994 1162028 1162061 1162094 1162128 1162161 1162194 1162228 1162261 1162294 1162328 1162370 1162411 1162453 1162495 1162536 1162578 1162620 1162661 1162703 1162745 1162787 1162828 1162870 1162912 1162953 1162995 1163037 1163079 1163120 1163162 1163204 1163245 1163287 1163329 1163371 1163412 1163454 1163496 1163537 1163579 1163621 1163662 1163704 1163746 1163788 1163829 1163871 1163913 1163954 1163996 1164038 1164080 1164121 1164163 1164205 1164246 1164288 1164330 1164372 1164413 1164455 1164497 1164538 1164580 1164622 1164663 1164705 1164747 1164789 1164830 1164872 1164914 1164955 1164997 1165039 1165081 1165122 1165164 1165206 1165247 1165289 1165331 1165373 1165414 1165456 1165498 1165539 1165581 1165623 1165664 1165706 1165748 1165790 1165831 1165873 1165915 1165956 1165998 1166040 1166082 1166123 1166165 1166207 1166248 1166290 1166332 1166374 1166415 1166457 1166499 1166540 1166582 1166624 1166665 1166707 1166749 1166791 1166832 1166874 1166916 1166957 1166999 1167041 1167083 1167124 1167166 1167208 1167249 1167291 1167333 1167366 1167400 1167433 1167466 1167500 1167533 1167566 1167600 1167633 1167666 1167700 1167733 1167767 1167800 1167833 1167867 1167900 1167933 1167967 1168000 1168034 1168067 1168100 1168134 1168167 1168200 1168234 1168267 1168300 1168334 1168367 1168401 1168434 1168467 1168501 1168534 1168567 1168601 1168634 1168667 1168701 1168734 1168768 1168801 1168834 1168868 1168901 1168934 1168968 1169001 1169035 1169068 1169101 1169135 1169168 1169201 1169235 1169268 1169301 1169335 1169368 1169402 1169435 1169468 1169502 1169535 1169568 1169602 1169635 1169668 1169702 1169735 1169769 1169802 1169835 1169869 1169902 1169935 1169969 1170002 1170036 1170069 1170102 1170136 1170169 1170202 1170236 1170269 1170302 1170336 1170369 1170403 1170436 1170469 1170503 1170544 1170586 1170628 1170669 1170711 1170753 1170795 1170836 1170878 1170920 1170961 1171003 1171045 1171087 1171128 1171170 1171212 1171253 1171295 1171337 1171379 1171420 1171462 1171504 1171545 1171587 1171629 1171670 1171712 1171754 1171796 1171837 1171879 1171921 1171962 1172004 1172046 1172088 1172129 1172171 1172213 1172254 1172296 1172338 1172380 1172421 1172463 1172505 1172546 1172588 1172630 1172671 1172713 1172755 1172797 1172838 1172880 1172922 1172963 1173005 1173047 1173089 1173130 1173172 1173214 1173255 1173297 1173339 1173381 1173422 1173464 1173506 1173547 1173589 1173631 1173672 1173714 1173756 1173798 1173839 1173881 1173923 1173964 1174006 1174048 1174090 1174131 1174173 1174215 1174256 1174298 1174340 1174382 1174423 1174465 1174507 1174548 1174590 1174632 1174673 1174715 1174757 1174799 1174840 1174882 1174924 1174965 1175007 1175049 1175091 1175132 1175174 1175216 1175257 1175299 1175341 1175383 1175424 1175466 1175508 1175549 1175591 1175633 1175674 1175716 1175758 1175800 1175841 1175883 1175925 1175966 1176008 1176050 1176092 1176133 1176175 1176217 1176258 1176300 1176342 1176384 1176425 1176467 1176509 1176550 1176592 1176634 1176675 1176717 1176759 1176801 1176842 1176884 1176926 1176967 1177009 1177051 1177093 1177134 1177176 1177218 1177259 1177301 1177343 1177385 1177426 1177468 1177510 1177551 1177593 1177635 1177676 1177718 1177760 1177802 1177843 1177885 1177927 1177968 1178010 1178052 1178094 1178135 1178177 1178219 1178260 1178302 1178344 1178386 1178427 1178469 1178511 1178552 1178594 1178636 1178677 1178719 1178761 1178803 1178844 1178886 1178928 1178969 1179011 1179053 1179095 1179136 1179178 1179220 1179261 1179303 1179345 1179387 1179428 1179470 1179512 1179553 1179595 1179637 1179678 1179720 1179762 1179804 1179845 1179887 1179929 1179970 1180012 1180054 1180096 1180137 1180179 1180221 1180262 1180304 1180346 1180388 1180429 1180471 1180513 1180554 1180596 1180638 1180679 1180721 1180763 1180805 1180846 1180888 1180930 1180971 1181013 1181055 1181097 1181138 1181180 1181222 1181263 1181305 1181347 1181389 1181430 1181472 1181514 1181555 1181597 1181639 1181680 1181722 1181764 1181806 1181847 1181889 1181931 1181972 1182014 1182056 1182098 1182139 1182181 1182223 1182264 1182306 1182348 1182390 1182431 1182473 1182515 1182556 1182598 1182640 1182681 1182723 1182765 1182807 1182848 1182890 1182932 1182973 1183015 1183057 1183099 1183140 1183182 1183224 1183265 1183307 1183349 1183391 1183432 1183474 1183516 1183557 1183599 1183641 1183682 1183724 1183766 1183808 1183849 1183891 1183933 1183974 1184016 1184058 1184100 1184141 1184183 1184225 1184266 1184308 1184350 1184392 1184433 1184475 1184517 1184558 1184600 1184642 1184683 1184725 1184767 1184809 1184850 1184892 1184934 1184975 1185017 1185059 1185101 1185142 1185184 1185226 1185267 1185309 1185351 1185393 1185434 1185476 1185518 1185559 1185601 1185643 1185684 1185726 1185768 1185810 1185851 1185893 1185935 1185976 1186018 1186060 1186102 1186143 1186185 1186227 1186268 1186310 1186352 1186385 1186419 1186452 1186485 1186519 1186560 1186602 1186644 1186685 1186727 1186769 1186811 1186852 1186894 1186936 1186977 1187019 1187061 1187103 1187144 1187186 1187228 1187269 1187311 1187353 1187395 1187436 1187478 1187520 1187561 1187603 1187645 1187686 1187728 1187770 1187812 1187853 1187895 1187937 1187978 1188020 1188062 1188104 1188145 1188187 1188220 1188254 1188287 1188320 1188354 1188396 1188437 1188479 1188521 1188562 1188604 1188646 1188687 1188729 1188771 1188813 1188854 1188896 1188938 1188979 1189021 1189063 1189105 1189146 1189188 1189230 1189271 1189313 1189355 1189397 1189438 1189480 1189522 1189563 1189605 1189647 1189688 1189730 1189772 1189814 1189855 1189897 1189939 1189980 1190022 1190064 1190106 1190147 1190189 1190231 1190272 1190314 1190356 1190398 1190439 1190481 1190523 1190564 1190606 1190648 1190689 1190731 1190773 1190815 1190856 1190898 1190940 1190981 1191023 1191057 1191090 1191123 1191157 1191190 1191232 1191273 1191315 1191357 1191399 1191440 1191482 1191524 1191565 1191607 1191649 1191690 1191732 1191774 1191816 1191857 1191899 1191941 1191982 1192024 1192066 1192108 1192149 1192191 1192233 1192274 1192316 1192358 1192400 1192441 1192483 1192525 1192566 1192608 1192650 1192691 1192733 1192775 1192817 1192858 1192900 1192942 1192983 1193025 1193067 1193109 1193150 1193192 1193234 1193275 1193317 1193359 1193401 1193442 1193484 1193526 1193559 1193592 1193626 1193659 1193692 1193726 1193759 1193793 1193826 1193859 1193893 1193926 1193959 1193993 1194026 1194060 1194093 1194126 1194160 1194193 1194226 1194260 1194293 1194326 1194360 1194393 1194427 1194460 1194493 1194527 1194560 1194593 1194627 1194660 1194693 1194727 1194760 1194794 1194827 1194860 1194894 1194927 1194960 1194994 1195027 1195061 1195094 1195127 1195161 1195194 1195227 1195261 1195294 1195327 1195361 1195403 1195444 1195486 1195528 1195569 1195611 1195653 1195694 1195736 1195778 1195820 1195861 1195903 1195945 1195986 1196028 1196070 1196112 1196153 1196195 1196237 1196278 1196320 1196362 1196404 1196445 1196487 1196529 1196570 1196612 1196654 1196695 1196737 1196779 1196821 1196862 1196904 1196946 1196987 1197029 1197071 1197113 1197154 1197196 1197238 1197279 1197321 1197363 1197405 1197446 1197488 1197530 1197571 1197613 1197655 1197696 1197738 1197780 1197822 1197863 1197905 1197947 1197988 1198030 1198072 1198114 1198155 1198197 1198239 1198280 1198322 1198364 1198406 1198447 1198489 1198531 1198572 1198614 1198656 1198697 1198739 1198781 1198823 1198864 1198906 1198948 1198989 1199031 1199073 1199115 1199156 1199198 1199231 1199265 1199298 1199331 1199365 1199407 1199448 1199490 1199532 1199573 1199615 1199657 1199698 1199740 1199782 1199824 1199865 1199907 1199949 1199990 1200032 1200074 1200116 1200157 1200199 1200241 1200282 1200324 1200366 1200408 1200449 1200491 1200533 1200574 1200616 1200658 1200699 1200741 1200783 1200825 1200866 1200908 1200950 1200991 1201033 1201075 1201117 1201158 1201200 1201242 1201283 1201325 1201367 1201409 1201450 1201492 1201534 1201575 1201617 1201659 1201700 1201742 1201784 1201826 1201867 1201909 1201951 1201992 1202034 1202076 1202118 1202159 1202201 1202243 1202284 1202326 1202368 1202410 1202451 1202493 1202535 1202576 1202618 1202660 1202701 1202743 1202785 1202827 1202868 1202910 1202952 1202993 1203035 1203077 1203119 1203160 1203202 1203244 1203285 1203327 1203369 1203411 1203452 1203494 1203536 1203577 1203619 1203661 1203702 1203744 1203786 1203828 1203869 1203911 1203953 1203994 1204036 1204078 1204120 1204161 1204203 1204245 1204286 1204328 1204370 1204412 1204453 1204495 1204537 1204578 1204620 1204662 1204703 1204745 1204787 1204829 1204870 1204912 1204954 1204995 1205037 1205079 1205121 1205162 1205204 1205246 1205287 1205329 1205371 1205413 1205454 1205496 1205538 1205579 1205621 1205663 1205704 1205746 1205788 1205830 1205871 1205913 1205955 1205996 1206038 1206080 1206122 1206163 1206205 1206247 1206288 1206330 1206372 1206414 1206455 1206497 1206539 1206580 1206622 1206664 1206705 1206739 1206772 1206806 1206839 1206872 1206914 1206956 1206997 1207039 1207081 1207123 1207164 1207206 1207248 1207289 1207331 1207373 1207406 1207440 1207473 1207506 1207540 1207581 1207623 1207665 1207706 1207748 1207790 1207832 1207873 1207915 1207957 1207998 1208040 1208082 1208124 1208165 1208207 1208249 1208290 1208332 1208374 1208416 1208457 1208499 1208541 1208582 1208624 1208666 1208707 1208749 1208791 1208833 1208874 1208916 1208958 1208999 1209041 1209083 1209125 1209166 1209208 1209250 1209291 1209333 1209375 1209417 1209458 1209500 1209542 1209583 1209625 1209667 1209708 1209750 1209792 1209834 1209875 1209917 1209959 1210000 1210042 1210084 1210126 1210167 1210209 1210251 1210292 1210334 1210376 1210418 1210459 1210501 1210543 1210584 1210626 1210668 1210709 1210751 1210793 1210835 1210876 1210918 1210960 1211001 1211043 1211085 1211127 1211168 1211210 1211252 1211293 1211335 1211377 1211419 1211460 1211502 1211544 1211585 1211627 1211669 1211710 1211752 1211794 1211836 1211877 1211919 1211961 1212002 1212044 1212100 1212155 1212211 1212253 1212294 1212336 1212378 1212420 1212461 1212503 1212545 1212586 1212628 1212670 1212711 1212753 1212795 1212837 1212878 1212920 1212962 1213003 1213045 1213079 1213112 1213145 1213179 1213212 1213254 1213295 1213337 1213379 1213412 1213446 1213479 1213512 1213546 1213587 1213629 1213671 1213712 1213754 1213796 1213838 1213879 1213921 1213963 1214004 1214046 1214088 1214130 1214171 1214213 1214255 1214296 1214338 1214380 1214422 1214463 1214505 1214547 1214588 1214630 1214672 1214713 1214755 1214797 1214839 1214880 1214922 1214964 1215005 1215047 1215089 1215131 1215172 1215214 1215256 1215297 1215339 1215381 1215423 1215464 1215506 1215548 1215589 1215631 1215673 1215714 1215756 1215798 1215840 1215881 1215923 1215965 1216006 1216048 1216090 1216132 1216173 1216215 1216257 1216298 1216340 1216382 1216424 1216465 1216507 1216549 1216590 1216632 1216674 1216715 1216757 1216799 1216841 1216882 1216924 1216966 1217007 1217049 1217091 1217133 1217174 1217216 1217258 1217299 1217341 1217383 1217425 1217466 1217508 1217550 1217591 1217633 1217675 1217716 1217758 1217800 1217842 1217883 1217925 1217967 1218008 1218050 1218092 1218134 1218175 1218217 1218259 1218300 1218342 1218384 1218426 1218467 1218509 1218551 1218592 1218634 1218676 1218717 1218759 1218801 1218843 1218884 1218926 1218968 1219009 1219051 1219093 1219135 1219176 1219218 1219260 1219301 1219343 1219385 1219427 1219468 1219510 1219552 1219593 1219635 1219677 1219718 1219760 1219802 1219844 1219885 1219927 1219969 1220010 1220052 1220094 1220136 1220177 1220219 1220261 1220302 1220344 1220386 1220428 1220469 1220511 1220553 1220594 1220636 1220678 1220719 1220761 1220803 1220845 1220886 1220928 1220970 1221011 1221053 1221095 1221137 1221178 1221220 1221262 1221303 1221345 1221387 1221429 1221470 1221512 1221554 1221595 1221637 1221679 1221720 1221762 1221804 1221846 1221887 1221929 1221971 1222012 1222054 1222096 1222138 1222179 1222221 1222263 1222304 1222346 1222388 1222430 1222471 1222513 1222555 1222596 1222638 1222680 1222721 1222763 1222805 1222847 1222888 1222930 1222972 1223013 1223055 1223097 1223139 1223180 1223222 1223264 1223305 1223347 1223389 1223431 1223472 1223514 1223556 1223597 1223639 1223681 1223722 1223764 1223806 1223848 1223889 1223931 1223973 1224014 1224056 1224098 1224140 1224181 1224223 1224265 1224306 1224348 1224390 1224432 1224473 1224515 1224557 1224598 1224640 1224682 1224723 1224765 1224807 1224849 1224890 1224932 1224974 1225015 1225057 1225099 1225141 1225182 1225224 1225266 1225307 1225349 1225391 1225433 1225474 1225516 1225558 1225599 1225641 1225683 1225724 1225766 1225808 1225850 1225891 1225933 1225975 1226016 1226058 1226100 1226142 1226183 1226225 1226267 1226308 1226350 1226392 1226434 1226475 1226517 1226559 1226592 1226625 1226659 1226692 1226725 1226759 1226792 1226826 1226859 1226892 1226926 1226959 1226992 1227026 1227059 1227093 1227126 1227159 1227193 1227226 1227259 1227293 1227326 1227359 1227393 1227426 1227460 1227493 1227526 1227560 1227593 1227626 1227660 1227693 1227726 1227760 1227793 1227827 1227860 1227893 1227935 1227977 1228018 1228060 1228102 1228144 1228185 1228227 1228269 1228310 1228352 1228394 1228436 1228477 1228519 1228561 1228602 1228644 1228686 1228727 1228769 1228811 1228853 1228894 1228936 1228978 1229019 1229061 1229103 1229145 1229186 1229228 1229270 1229311 1229353 1229395 1229437 1229478 1229520 1229562 1229603 1229645 1229687 1229728 1229762 1229795 1229829 1229862 1229895 1229937 1229979 1230020 1230062 1230104 1230146 1230187 1230229 1230271 1230312 1230354 1230396 1230438 1230479 1230521 1230563 1230604 1230646 1230688 1230729 1230771 1230813 1230855 1230896 1230938 1230980 1231021 1231063 1231105 1231147 1231188 1231230 1231272 1231313 1231355 1231397 1231439 1231480 1231522 1231564 1231605 1231647 1231689 1231730 1231772 1231814 1231856 1231897 1231939 1231981 1232022 1232064 1232106 1232148 1232189 1232231 1232273 1232314 1232356 1232398 1232440 1232481 1232523 1232565 1232606 1232648 1232690 1232731 1232773 1232815 1232857 1232898 1232940 1232982 1233023 1233065 1233107 1233149 1233190 1233232 1233274 1233315 1233357 1233399 1233441 1233482 1233524 1233566 1233607 1233649 1233691 1233732 1233774 1233816 1233858 1233899 1233941 1233983 1234024 1234066 1234108 1234150 1234191 1234233 1234275 1234316 1234358 1234400 1234442 1234483 1234525 1234567 1234608 1234650 1234692 1234733 1234775 1234817 1234859 1234900 1234942 1234984 1235025 1235067 1235109 1235151 1235192 1235234 1235276 1235317 1235359 1235401 1235443 1235484 1235526 1235568 1235609 1235651 1235693 1235734 1235776 1235818 1235860 1235901 1235943 1235985 1236026 1236068 1236110 1236152 1236193 1236235 1236277 1236318 1236360 1236402 1236444 1236485 1236527 1236569 1236610 1236652 1236694 1236735 1236777 1236819 1236861 1236902 1236944 1236986 1237027 1237069 1237111 1237153 1237194 1237236 1237278 1237319 1237361 1237403 1237445 1237486 1237528 1237570 1237611 1237653 1237695 1237736 1237778 1237820 1237862 1237903 1237945 1237987 1238028 1238070 1238112 1238154 1238195 1238237 1238279 1238320 1238362 1238404 1238446 1238487 1238529 1238571 1238612 1238654 1238696 1238737 1238779 1238821 1238863 1238904 1238946 1238988 1239029 1239071 1239113 1239155 1239196 1239238 1239280 1239321 1239363 1239405 1239447 1239488 1239530 1239572 1239613 1239655 1239697 1239738 1239780 1239822 1239864 1239905 1239947 1239989 1240030 1240072 1240114 1240156 1240197 1240239 1240281 1240322 1240364 1240406 1240448 1240489 1240531 1240573 1240614 1240656 1240698 1240739 1240781 1240823 1240865 1240906 1240948 1240990 1241031 1241073 1241107 1241140 1241173 1241207 1241240 1241273 1241307 1241340 1241373 1241407 1241440 1241474 1241507 1241540 1241574 1241607 1241640 1241674 1241707 1241740 1241774 1241807 1241841 1241874 1241907 1241941 1241974 1242007 1242041 1242074 1242108 1242141 1242174 1242208 1242241 1242274 1242308 1242341 1242374 1242408 1242450 1242491 1242533 1242575 1242616 1242658 1242700 1242741 1242783 1242825 1242867 1242908 1242942 1242975 1243008 1243042 1243075 1243117 1243159 1243200 1243242 1243284 1243325 1243367 1243409 1243451 1243492 1243534 1243576 1243617 1243659 1243701 1243742 1243784 1243826 1243868 1243909 1243951 1243993 1244034 1244076 1244118 1244160 1244201 1244243 1244285 1244326 1244368 1244410 1244452 1244493 1244535 1244577 1244618 1244660 1244702 1244743 1244785 1244827 1244869 1244910 1244952 1244994 1245035 1245077 1245119 1245161 1245202 1245244 1245286 1245327 1245369 1245411 1245444 1245478 1245511 1245544 1245578 1245619 1245661 1245703 1245744 1245786 1245828 1245870 1245911 1245953 1245995 1246036 1246078 1246120 1246162 1246203 1246245 1246287 1246328 1246370 1246412 1246454 1246495 1246537 1246579 1246620 1246662 1246704 1246745 1246779 1246812 1246846 1246879 1246912 1246946 1246979 1247012 1247046 1247079 1247113 1247146 1247179 1247213 1247246 1247279 1247313 1247346 1247379 1247413 1247446 1247480 1247513 1247546 1247580 1247621 1247663 1247705 1247746 1247788 1247830 1247872 1247913 1247947 1247980 1248013 1248047 1248080 1248122 1248164 1248205 1248247 1248289 1248330 1248372 1248414 1248456 1248497 1248539 1248581 1248622 1248664 1248706 1248747 1248789 1248831 1248873 1248914 1248948 1248981 1249014 1249048 1249081 1249123 1249165 1249206 1249248 1249290 1249331 1249373 1249415 1249457 1249498 1249540 1249582 1249623 1249665 1249707 1249748 1249790 1249832 1249874 1249915 1249957 1249999 1250040 1250082 1250124 1250166 1250207 1250249 1250291 1250332 1250374 1250416 1250449 1250483 1250516 1250549 1250583 1250624 1250666 1250708 1250749 1250791 1250833 1250875 1250916 1250958 1251000 1251041 1251083 1251125 1251167 1251208 1251250 1251292 1251333 1251375 1251417 1251459 1251500 1251542 1251584 1251617 1251650 1251684 1251717 1251750 1251792 1251834 1251876 1251917 1251959 1252001 1252042 1252084 1252126 1252168 1252209 1252251 1252293 1252334 1252376 1252418 1252460 1252501 1252543 1252585 1252626 1252668 1252710 1252751 1252793 1252835 1252877 1252918 1252960 1253002 1253043 1253085 1253127 1253169 1253210 1253252 1253294 1253335 1253377 1253419 1253461 1253502 1253544 1253586 1253627 1253669 1253711 1253752 1253794 1253836 1253878 1253919 1253961 1254003 1254044 1254086 1254128 1254170 1254211 1254253 1254295 1254336 1254378 1254420 1254462 1254503 1254545 1254587 1254628 1254670 1254712 1254753 1254795 1254837 1254879 1254920 1254962 1255004 1255045 1255087 1255129 1255171 1255212 1255254 1255296 1255337 1255379 1255421 1255463 1255504 1255546 1255588 1255629 1255671 1255713 1255754 1255796 1255838 1255880 1255921 1255963 1256005 1256046 1256088 1256130 1256172 1256213 1256255 1256297 1256338 1256380 1256422 1256464 1256505 1256547 1256589 1256630 1256672 1256714 1256755 1256797 1256839 1256881 1256922 1256964 1257006 1257047 1257089 1257131 1257173 1257214 1257256 1257298 1257339 1257381 1257423 1257465 1257506 1257548 1257590 1257631 1257673 1257715 1257756 1257798 1257840 1257882 1257923 1257965 1258007 1258048 1258090 1258132 1258174 1258215 1258257 1258299 1258340 1258382 1258424 1258466 1258507 1258549 1258591 1258632 1258674 1258716 1258757 1258799 1258841 1258883 1258924 1258966 1259008 1259049 1259091 1259133 1259175 1259216 1259258 1259300 1259341 1259383 1259425 1259467 1259508 1259550 1259592 1259633 1259675 1259717 1259758 1259800 1259842 1259884 1259925 1259967 1260009 1260050 1260092 1260134 1260176 1260217 1260259 1260301 1260342 1260384 1260426 1260468 1260509 1260551 1260593 1260634 1260676 1260718 1260759 1260801 1260843 1260885 1260926 1260968 1261010 1261051 1261093 1261135 1261177 1261218 1261260 1261302 1261343 1261385 1261427 1261469 1261510 1261552 1261594 1261635 1261677 1261719 1261760 1261802 1261844 1261886 1261927 1261969 1262011 1262052 1262094 1262136 1262178 1262219 1262261 1262303 1262344 1262386 1262428 1262470 1262511 1262553 1262595 1262636 1262678 1262720 1262761 1262803 1262845 1262887 1262928 1262970 1263012 1263053 1263095 1263137 1263179 1263220 1263262 1263304 1263345 1263387 1263429 1263471 1263512 1263554 1263596 1263637 1263679 1263721 1263762 1263804 1263846 1263888 1263929 1263971 1264013 1264054 1264096 1264138 1264180 1264221 1264263 1264305 1264346 1264388 1264430 1264472 1264513 1264555 1264597 1264638 1264680 1264722 1264763 1264805 1264847 1264889 1264930 1264972 1265014 1265055 1265097 1265139 1265181 1265222 1265264 1265306 1265347 1265389 1265431 1265473 1265514 1265556 1265598 1265639 1265681 1265723 1265764 1265806 1265848 1265890 1265931 1265973 1266015 1266056 1266098 1266140 1266182 1266223 1266265 1266307 1266348 1266390 1266432 1266474 1266515 1266557 1266599 1266640 1266682 1266724 1266765 1266807 1266849 1266891 1266932 1266974 1267016 1267057 1267099 1267141 1267183 1267224 1267266 1267308 1267349 1267391 1267433 1267475 1267516 1267558 1267600 1267641 1267683 1267725 1267766 1267808 1267850 1267892 1267933 1267975 1268017 1268058 1268100 1268142 1268184 1268225 1268267 1268309 1268350 1268392 1268434 1268476 1268517 1268559 1268601 1268642 1268684 1268726 1268767 1268809 1268851 1268893 1268934 1268976 1269018 1269059 1269101 1269143 1269185 1269226 1269268 1269310 1269351 1269393 1269435 1269477 1269518 1269560 1269602 1269643 1269685 1269727 1269768 1269810 1269852 1269894 1269935 1269977 1270019 1270060 1270102 1270144 1270186 1270227 1270269 1270311 1270352 1270394 1270436 1270478 1270519 1270561 1270603 1270644 1270686 1270728 1270769 1270811 1270853 1270895 1270936 1270978 1271020 1271061 1271103 1271145 1271187 1271228 1271270 1271312 1271353 1271395 1271437 1271479 1271520 1271562 1271604 1271645 1271687 1271729 1271770 1271812 1271854 1271896 1271937 1271979 1272021 1272062 1272104 1272146 1272188 1272229 1272271 1272313 1272354 1272396 1272438 1272480 1272521 1272563 1272605 1272646 1272688 1272730 1272771 1272813 1272855 1272897 1272938 1272980 1273022 1273063 1273105 1273147 1273189 1273230 1273272 1273314 1273355 1273397 1273439 1273481 1273522 1273564 1273606 1273647 1273689 1273731 1273772 1273814 1273856 1273898 1273939 1273973 1274006 1274039 1274073 1274106 1274140 1274173 1274206 1274240 1274273 1274306 1274340 1274373 1274406 1274440 1274473 1274507 1274540 1274573 1274607 1274640 1274673 1274707 1274740 1274773 1274815 1274857 1274899 1274940 1274982 1275024 1275065 1275107 1275149 1275191 1275232 1275274 1275316 1275357 1275399 1275441 1275483 1275524 1275566 1275608 1275649 1275691 1275733 1275774 1275816 1275858 1275900 1275941 1275975 1276008 1276041 1276075 1276108 1276142 1276175 1276208 1276242 1276275 1276308 1276342 1276375 1276408 1276442 1276484 1276525 1276567 1276609 1276650 1276692 1276734 1276775 1276817 1276859 1276901 1276942 1276984 1277026 1277067 1277109 1277143 1277176 1277209 1277243 1277276 1277309 1277343 1277376 1277409 1277443 1277485 1277526 1277568 1277610 1277651 1277693 1277735 1277776 1277818 1277860 1277902 1277943 1277985 1278027 1278068 1278110 1278152 1278194 1278235 1278277 1278319 1278360 1278402 1278444 1278477 1278511 1278544 1278577 1278611 1278644 1278677 1278711 1278744 1278777 1278811 1278844 1278878 1278911 1278944 1278978 1279011 1279044 1279078 1279111 1279145 1279178 1279211 1279245 1279278 1279311 1279345 1279378 1279411 1279445 1279478 1279512 1279545 1279578 1279612 1279645 1279678 1279712 1279745 1279778 1279812 1279845 1279879 1279912 1279945 1279979 1280012 1280045 1280079 1280112 1280146 1280179 1280212 1280246 1280279 1280312 1280346 1280379 1280412 1280446 1280479 1280513 1280546 1280579 1280613 1280646 1280679 1280713 1280746 1280779 1280813 1280846 1280880 1280913 1280946 1280980 1281013 1281046 1281080 1281113 1281147 1281180 1281213 1281247 1281280 1281313 1281347 1281380 1281413 1281447 1281480 1281514 1281547 1281580 1281614 1281647 1281680 1281714 1281747 1281780 1281814 1281847 1281881 1281914 1281947 1281981 1282014 1282047 1282081 1282114 1282148 1282181 1282214 1282248 1282281 1282314 1282348 1282381 1282414 1282448 1282481 1282515 1282548 1282581 1282615 1282648 1282681 1282715 1282748 1282781 1282815 1282848 1282882 1282915 1282948 1282982 1283015 1283048 1283082 1283115 1283149 1283182 1283215 1283249 1283282 1283324 1283365 1283407 1283449 1283491 1283532 1283574 1283616 1283657 1283699 1283741 1283782 1283824 1283866 1283908 1283949 1283983 1284016 1284049 1284083 1284116 1284150 1284183 1284216 1284250 1284283 1284316 1284350 1284383 1284416 1284450 1284483 1284517 1284550 1284583 1284617 1284650 1284683 1284717 1284750 1284783 1284825 1284867 1284909 1284950 1284992 1285034 1285075 1285117 1285159 1285201 1285242 1285284 1285326 1285367 1285409 1285451 1285493 1285534 1285576 1285618 1285659 1285701 1285743 1285784 1285826 1285868 1285910 1285951 1285993 1286035 1286076 1286118 1286160 1286202 1286243 1286285 1286327 1286368 1286410 1286452 1286494 1286535 1286577 1286619 1286660 1286702 1286744 1286785 1286827 1286869 1286911 1286952 1286994 1287036 1287077 1287119 1287161 1287203 1287244 1287286 1287328 1287369 1287411 1287453 1287495 1287536 1287578 1287620 1287661 1287703 1287745 1287786 1287828 1287870 1287912 1287953 1287987 1288020 1288053 1288087 1288120 1288162 1288204 1288245 1288287 1288329 1288370 1288412 1288454 1288487 1288521 1288554 1288587 1288621 1288654 1288687 1288721 1288754 1288787 1288821 1288854 1288888 1288921 1288954 1288988 1289021 1289054 1289088 1289121 1289163 1289205 1289246 1289288 1289321 1289355 1289388 1289421 1289455 1289488 1289522 1289555 1289588 1289622 1289663 1289705 1289747 1289788 1289822 1289855 1289889 1289922 1289955 1289989 1290022 1290055 1290089 1290122 1290164 1290206 1290247 1290289 1290331 1290372 1290414 1290456 1290498 1290539 1290581 1290623 1290664 1290706 1290748 1290789 1290831 1290873 1290915 1290956 1290998 1291040 1291081 1291123 1291165 1291207 1291248 1291290 1291323 1291357 1291390 1291423 1291457 1291490 1291524 1291557 1291590 1291624 1291665 1291707 1291749 1291790 1291832 1291874 1291916 1291957 1291991 1292024 1292057 1292091 1292124 1292166 1292208 1292249 1292291 1292324 1292358 1292391 1292424 1292458 1292500 1292541 1292583 1292625 1292666 1292708 1292750 1292791 1292825 1292858 1292892 1292925 1292958 1292992 1293025 1293058 1293092 1293125 1293159 1293192 1293225 1293259 1293292 1293325 1293359 1293392 1293425 1293459 1293492 1293526 1293559 1293592 1293626 1293659 1293692 1293726 1293759 1293792 1293834 1293876 1293918 1293959 1294001 1294043 1294084 1294126 1294168 1294210 1294251 1294293 1294335 1294376 1294418 1294460 1294502 1294543 1294585 1294627 1294660 1294693 1294727 1294760 1294793 1294827 1294860 1294894 1294927 1294960 1294994 1295027 1295060 1295094 1295127 1295161 1295194 1295227 1295261 1295294 1295327 1295361 1295394 1295427 1295461 1295494 1295528 1295561 1295594 1295628 1295661 1295694 1295728 1295761 1295794 1295828 1295861 1295895 1295928 1295961 1295995 1296028 1296061 1296095 1296128 1296162 1296195 1296228 1296262 1296295 1296328 1296362 1296395 1296428 1296462 1296495 1296529 1296562 1296595 1296629 1296662 1296695 1296729 1296762 1296795 1296837 1296879 1296921 1296962 1296996 1297029 1297062 1297096 1297129 1297163 1297196 1297229 1297263 1297296 1297329 1297363 1297396 1297429 1297463 1297496 1297530 1297563 1297596 1297630 1297663 1297696 1297730 1297763 1297796 1297830 1297863 1297897 1297930 1297963 1297997 1298030 1298063 1298097 1298130 1298164 1298197 1298230 1298264 1298297 1298330 1298364 1298397 1298430 1298464 1298497 1298531 1298564 1298597 1298631 1298664 1298697 1298731 1298764 1298797 1298831 1298864 1298898 1298931 1298964 1298998 1299031 1299064 1299098 1299131 1299165 1299198 1299231 1299265 1299298 1299331 1299365 1299398 1299431 1299465 1299498 1299532 1299565 1299598 1299632 1299665 1299698 1299732 1299765 1299798 1299840 1299882 1299924 1299965 1299999 1300032 1300065 1300099 1300132 1300174 1300216 1300257 1300299 1300341 1300382 1300424 1300466 1300508 1300549 1300591 1300633 1300674 1300716 1300758 1300799 1300841 1300883 1300925 1300966 1301000 1301033 1301066 1301100 1301133 1301167 1301200 1301233 1301267 1301300 1301333 1301367 1301400 1301433 1301467 1301500 1301534 1301567 1301600 1301634 1301667 1301700 1301734 1301767 1301800 1301834 1301867 1301901 1301934 1301967 1302001 1302034 1302067 1302101 1302134 1302168 1302201 1302234 1302268 1302301 1302334 1302368 1302401 1302434 1302468 1302501 1302535 1302568 1302601 1302635 1302668 1302701 1302735 1302768 1302801 1302835 1302868 1302902 1302935 1302968 1303002 1303035 1303068 1303102 1303135 1303177 1303219 1303260 1303302 1303344 1303385 1303427 1303469 1303511 1303552 1303594 1303636 1303677 1303719 1303761 1303802 1303844 1303886 1303928 1303969 1304011 1304053 1304094 1304136 1304178 1304220 1304261 1304303 1304345 1304386 1304428 1304470 1304512 1304553 1304595 1304637 1304678 1304720 1304762 1304803 1304845 1304887 1304929 1304970 1305012 1305054 1305095 1305137 1305179 1305221 1305262 1305304 1305346 1305387 1305429 1305471 1305513 1305554 1305596 1305638 1305679 1305721 1305763 1305804 1305838 1305871 1305905 1305938 1305971 1306005 1306038 1306071 1306105 1306138 1306180 1306222 1306263 1306305 1306347 1306388 1306430 1306472 1306514 1306555 1306597 1306639 1306680 1306722 1306764 1306805 1306839 1306872 1306906 1306939 1306972 1307006 1307039 1307072 1307106 1307139 1307181 1307223 1307264 1307306 1307348 1307389 1307431 1307473 1307515 1307556 1307598 1307640 1307681 1307723 1307765 1307806 1307848 1307890 1307932 1307973 1308015 1308057 1308098 1308140 1308182 1308224 1308265 1308307 1308349 1308390 1308432 1308474 1308507 1308541 1308574 1308607 1308641 1308682 1308724 1308766 1308807 1308849 1308891 1308933 1308974 1309016 1309058 1309099 1309141 1309183 1309225 1309266 1309308 1309350 1309391 1309433 1309475 1309517 1309558 1309600 1309642 1309683 1309725 1309767 1309808 1309850 1309892 1309934 1309975 1310017 1310059 1310100 1310142 1310184 1310226 1310267 1310309 1310351 1310392 1310434 1310476 1310518 1310559 1310601 1310643 1310684 1310726 1310768 1310809 1310851 1310893 1310935 1310976 1311018 1311060 1311101 1311143 1311185 1311227 1311268 1311310 1311352 1311393 1311435 1311477 1311519 1311560 1311602 1311644 1311685 1311727 1311769 1311810 1311852 1311894 1311936 1311977 1312019 1312061 1312102 1312144 1312186 1312228 1312269 1312311 1312353 1312394 1312436 1312478 1312520 1312561 1312603 1312645 1312686 1312728 1312770 1312811 1312853 1312895 1312937 1312978 1313020 1313062 1313103 1313145 1313187 1313229 1313270 1313312 1313354 1313395 1313437 1313479 1313521 1313562 1313604 1313646 1313687 1313729 1313771 1313812 1313854 1313896 1313938 1313979 1314021 1314063 1314104 1314146 1314188 1314230 1314271 1314313 1314355 1314396 1314438 1314480 1314522 1314563 1314605 1314647 1314688 1314730 1314772 1314813 1314855 1314897 1314939 1314980 1315022 1315064 1315105 1315147 1315189 1315231 1315272 1315314 1315356 1315397 1315439 1315481 1315523 1315564 1315606 1315648 1315689 1315731 1315773 1315814 1315856 1315898 1315940 1315981 1316023 1316065 1316106 1316148 1316190 1316232 1316273 1316315 1316357 1316398 1316440 1316482 1316524 1316565 1316607 1316649 1316690 1316732 1316774 1316815 1316857 1316899 1316941 1316982 1317024 1317066 1317107 1317149 1317191 1317233 1317274 1317316 1317358 1317399 1317441 1317483 1317525 1317566 1317608 1317650 1317691 1317733 1317775 1317816 1317858 1317900 1317942 1317983 1318025 1318067 1318108 1318150 1318192 1318234 1318275 1318317 1318359 1318400 1318442 1318484 1318526 1318567 1318609 1318651 1318692 1318734 1318776 1318817 1318859 1318901 1318943 1318984 1319026 1319068 1319109 1319151 1319193 1319235 1319276 1319318 1319360 1319401 1319443 1319485 1319518 1319552 1319585 1319618 1319652 1319693 1319735 1319777 1319818 1319860 1319902 1319944 1319985 1320027 1320069 1320110 1320152 1320194 1320236 1320277 1320319 1320361 1320402 1320444 1320486 1320528 1320569 1320611 1320653 1320694 1320736 1320778 1320819 1320861 1320903 1320945 1320986 1321028 1321070 1321111 1321153 1321195 1321237 1321278 1321320 1321362 1321403 1321445 1321487 1321529 1321570 1321612 1321654 1321695 1321737 1321779 1321820 1321862 1321904 1321946 1321987 1322029 1322071 1322112 1322154 1322196 1322238 1322279 1322321 1322363 1322404 1322446 1322488 1322530 1322571 1322613 1322655 1322696 1322738 1322780 1322821 1322863 1322905 1322947 1322988 1323030 1323072 1323113 1323155 1323197 1323239 1323280 1323322 1323364 1323405 1323447 1323489 1323531 1323572 1323614 1323656 1323697 1323739 1323781 1323822 1323864 1323906 1323948 1323989 1324031 1324073 1324114 1324156 1324198 1324240 1324281 1324323 1324365 1324406 1324448 1324490 1324532 1324573 1324615 1324657 1324698 1324740 1324782 1324823 1324865 1324907 1324949 1324990 1325032 1325074 1325115 1325157 1325199 1325241 1325282 1325324 1325366 1325407 1325449 1325491 1325533 1325574 1325616 1325658 1325699 1325741 1325783 1325824 1325866 1325908 1325950 1325991 1326033 1326075 1326116 1326158 1326200 1326242 1326283 1326325 1326367 1326408 1326450 1326492 1326534 1326575 1326617 1326659 1326700 1326742 1326784 1326825 1326867 1326909 1326951 1326992 1327034 1327076 1327117 1327159 1327201 1327243 1327284 1327326 1327368 1327409 1327451 1327493 1327535 1327576 1327618 1327660 1327701 1327743 1327785 1327826 1327868 1327910 1327952 1327993 1328035 1328077 1328118 1328160 1328202 1328244 1328285 1328327 1328369 1328410 1328452 1328494 1328536 1328577 1328619 1328661 1328702 1328744 1328786 1328827 1328869 1328911 1328953 1328994 1329036 1329078 1329119 1329161 1329203 1329245 1329286 1329328 1329370 1329411 1329453 1329495 1329537 1329578 1329620 1329662 1329703 1329745 1329787 1329828 1329870 1329912 1329954 1329995 1330037 1330079 1330120 1330162 1330204 1330246 1330287 1330329 1330371 1330412 1330454 1330496 1330538 1330579 1330621 1330663 1330704 1330746 1330788 1330829 1330871 1330913 1330955 1330996 1331038 1331080 1331121 1331163 1331205 1331247 1331288 1331330 1331372 1331413 1331455 1331497 1331539 1331580 1331622 1331664 1331705 1331747 1331789 1331830 1331872 1331914 1331956 1331997 1332039 1332081 1332122 1332164 1332206 1332248 1332289 1332331 1332373 1332414 1332456 1332498 1332540 1332581 1332623 1332665 1332706 1332748 1332790 1332831 1332873 1332915 1332957 1332998 1333040 1333082 1333123 1333165 1333207 1333249 1333290 1333332 1333374 1333415 1333457 1333499 1333541 1333582 1333624 1333666 1333707 1333749 1333791 1333832 1333874 1333916 1333958 1333999 1334041 1334083 1334124 1334166 1334208 1334250 1334291 1334333 1334375 1334416 1334458 1334500 1334542 1334583 1334625 1334667 1334708 1334750 1334792 1334833 1334875 1334917 1334959 1335000 1335042 1335084 1335125 1335167 1335209 1335251 1335292 1335334 1335376 1335417 1335459 1335501 1335543 1335584 1335626 1335668 1335709 1335751 1335793 1335834 1335876 1335918 1335960 1336001 1336043 1336085 1336126 1336168 1336210 1336252 1336293 1336335 1336377 1336418 1336460 1336502 1336544 1336585 1336627 1336669 1336710 1336752 1336794 1336835 1336877 1336919 1336961 1337002 1337044 1337086 1337127 1337169 1337211 1337253 1337294 1337336 1337378 1337419 1337461 1337503 1337545 1337586 1337628 1337670 1337711 1337753 1337795 1337836 1337878 1337920 1337962 1338003 1338045 1338087 1338128 1338170 1338212 1338254 1338295 1338337 1338379 1338420 1338462 1338504 1338546 1338587 1338629 1338671 1338712 1338754 1338796 1338837 1338879 1338921 1338963 1339004 1339046 1339088 1339129 1339171 1339213 1339255 1339296 1339338 1339380 1339421 1339463 1339505 1339547 1339588 1339630 1339672 1339713 1339755 1339797 1339838 1339880 1339922 1339964 1340005 1340047 1340089 1340130 1340172 1340214 1340256 1340297 1340339 1340381 1340422 1340464 1340506 1340548 1340589 1340631 1340673 1340714 1340756 1340798 1340839 1340881 1340923 1340965 1341006 1341048 1341090 1341131 1341173 1341215 1341257 1341298 1341340 1341382 1341423 1341465 1341507 1341549 1341590 1341632 1341674 1341715 1341757 1341799 1341840 1341882 1341924 1341966 1342007 1342049 1342091 1342132 1342174 1342216 1342258 1342299 1342341 1342383 1342424 1342466 1342508 1342550 1342591 1342633 1342675 1342716 1342758 1342800 1342841 1342883 1342925 1342967 1343008 1343050 1343092 1343133 1343175 1343217 1343259 1343300 1343342 1343384 1343425 1343467 1343509 1343551 1343592 1343634 1343676 1343717 1343759 1343801 1343842 1343884 1343926 1343968 1344009 1344051 1344093 1344134 1344176 1344218 1344260 1344301 1344343 1344385 1344426 1344468 1344510 1344552 1344593 1344635 1344677 1344718 1344760 1344802 1344843 1344885 1344927 1344969 1345010 1345052 1345094 1345135 1345177 1345219 1345261 1345302 1345344 1345386 1345427 1345469 1345511 1345553 1345594 1345636 1345678 1345719 1345761 1345803 1345844 1345886 1345928 1345970 1346011 1346053 1346095 1346136 1346178 1346220 1346262 1346303 1346345 1346387 1346428 1346470 1346512 1346554 1346595 1346637 1346679 1346720 1346762 1346804 1346845 1346887 1346929 1346971 1347012 1347054 1347096 1347137 1347179 1347221 1347263 1347304 1347346 1347388 1347429 1347471 1347513 1347555 1347596 1347638 1347680 1347721 1347763 1347805 1347846 1347888 1347930 1347972 1348013 1348055 1348097 1348138 1348180 1348222 1348264 1348305 1348347 1348389 1348430 1348472 1348514 1348556 1348597 1348639 1348681 1348722 1348764 1348806 1348847 1348889 1348931 1348973 1349014 1349056 1349098 1349139 1349181 1349223 1349265 1349306 1349348 1349390 1349431 1349473 1349515 1349557 1349598 1349640 1349682 1349723 1349765 1349807 1349848 1349890 1349932 1349974 1350015 1350057 1350099 1350140 1350182 1350224 1350266 1350307 1350349 1350391 1350432 1350474 1350516 1350558 1350599 1350641 1350683 1350724 1350766 1350808 1350849 1350891 1350933 1350975 1351016 1351058 1351100 1351141 1351183 1351225 1351267 1351308 1351350 1351392 1351433 1351475 1351517 1351559 1351600 1351642 1351684 1351725 1351767 1351809 1351850 1351892 1351934 1351976 1352017 1352059 1352101 1352142 1352184 1352226 1352268 1352309 1352351 1352393 1352434 1352476 1352518 1352560 1352601 1352643 1352685 1352726 1352768 1352810 1352851 1352893 1352935 1352977 1353018 1353060 1353102 1353143 1353185 1353227 1353269 1353310 1353352 1353394 1353435 1353477 1353519 1353561 1353602 1353644 1353686 1353727 1353769 1353811 1353852 1353894 1353936 1353978 1354019 1354061 1354103 1354144 1354186 1354228 1354270 1354311 1354353 1354395 1354436 1354478 1354520 1354562 1354603 1354645 1354687 1354728 1354770 1354812 1354853 1354895 1354937 1354979 1355020 1355062 1355104 1355145 1355187 1355229 1355271 1355312 1355354 1355396 1355437 1355479 1355521 1355563 1355604 1355646 1355688 1355729 1355771 1355813 1355854 1355896 1355938 1355980 1356021 1356063 1356105 1356146 1356188 1356230 1356272 1356313 1356355 1356397 1356438 1356480 1356522 1356564 1356605 1356647 1356689 1356730 1356772 1356814 1356855 1356897 1356939 1356981 1357022 1357064 1357106 1357147 1357189 1357231 1357273 1357314 1357356 1357398 1357439 1357481 1357523 1357565 1357606 1357648 1357690 1357731 1357773 1357815 1357856 1357898 1357940 1357982 1358023 1358065 1358107 1358148 1358190 1358232 1358274 1358315 1358357 1358399 1358440 1358482 1358524 1358566 1358607 1358649 1358691 1358732 1358774 1358816 1358857 1358899 1358941 1358983 1359024 1359066 1359108 1359149 1359191 1359233 1359275 1359316 1359358 1359400 1359441 1359483 1359525 1359567 1359608 1359650 1359692 1359733 1359775 1359817 1359858 1359900 1359942 1359984 1360025 1360067 1360109 1360150 1360192 1360234 1360276 1360317 1360359 1360401 1360442 1360484 1360526 1360568 1360609 1360651 1360693 1360734 1360776 1360818 1360859 1360901 1360943 1360985 1361026 1361068 1361110 1361151 1361193 1361235 1361277 1361318 1361360 1361402 1361443 1361485 1361527 1361569 1361610 1361652 1361694 1361735 1361777 1361819 1361860 1361902 1361944 1361986 1362027 1362069 1362111 1362152 1362194 1362236 1362278 1362319 1362361 1362403 1362444 1362486 1362528 1362570 1362611 1362653 1362695 1362736 1362778 1362820 1362861 1362903 1362945 1362987 1363028 1363070 1363112 1363153 1363195 1363237 1363279 1363320 1363362 1363404 1363445 1363487 1363529 1363571 1363612 1363654 1363696 1363737 1363779 1363821 1363862 1363904 1363946 1363988 1364029 1364071 1364113 1364154 1364196 1364238 1364280 1364321 1364363 1364405 1364446 1364488 1364530 1364572 1364613 1364655 1364697 1364738 1364780 1364822 1364863 1364905 1364947 1364989 1365030 1365072 1365114 1365155 1365197 1365239 1365281 1365322 1365364 1365406 1365447 1365489 1365531 1365573 1365614 1365656 1365698 1365739 1365781 1365823 1365864 1365906 1365948 1365990 1366031 1366073 1366115 1366156 1366198 1366240 1366282 1366323 1366365 1366407 1366448 1366490 1366532 1366574 1366615 1366657 1366699 1366740 1366782 1366824 1366865 1366907 1366949 1366991 1367032 1367074 1367116 1367157 1367199 1367241 1367283 1367324 1367366 1367408 1367449 1367491 1367533 1367575 1367616 1367658 1367700 1367741 1367783 1367825 1367866 1367908 1367950 1367992 1368033 1368075 1368117 1368158 1368200 1368242 1368284 1368325 1368367 1368409 1368450 1368492 1368534 1368576 1368617 1368659 1368701 1368742 1368784 1368826 1368867 1368909 1368951 1368993 1369034 1369076 1369118 1369159 1369201 1369243 1369285 1369326 1369368 1369410 1369451 1369493 1369535 1369577 1369618 1369660 1369702 1369743 1369785 1369827 1369868 1369910 1369952 1369994 1370035 1370077 1370119 1370160 1370202 1370244 1370286 1370327 1370369 1370411 1370452 1370494 1370536 1370578 1370619 1370661 1370703 1370744 1370786 1370828 1370869 1370911 1370953 1370995 1371036 1371078 1371120 1371161 1371203 1371245 1371287 1371328 1371370 1371412 1371453 1371495 1371537 1371579 1371620 1371662 1371704 1371745 1371787 1371829 1371870 1371912 1371954 1371996 1372037 1372079 1372121 1372162 1372204 1372246 1372288 1372329 1372371 1372413 1372454 1372496 1372538 1372580 1372621 1372663 1372705 1372746 1372788 1372830 1372871 1372913 1372955 1372997 1373038 1373080 1373122 1373163 1373205 1373247 1373289 1373330 1373372 1373414 1373455 1373497 1373539 1373581 1373622 1373664 1373706 1373747 1373789 1373831 1373872 1373914 1373956 1373998 1374039 1374081 1374123 1374164 1374206 1374248 1374290 1374331 1374373 1374415 1374456 1374498 1374540 1374582 1374623 1374665 1374707 1374748 1374790 1374832 1374873 1374915 1374957 1374999 1375040 1375082 1375124 1375165 1375207 1375249 1375291 1375332 1375374 1375416 1375457 1375499 1375541 1375583 1375624 1375666 1375708 1375749 1375791 1375833 1375874 1375916 1375958 1376000 1376041 1376083 1376125 1376166 1376208 1376250 1376292 1376333 1376375 1376417 1376458 1376500 1376542 1376584 1376625 1376667 1376709 1376750 1376792 1376834 1376875 1376917 1376959 1377001 1377042 1377084 1377126 1377167 1377209 1377251 1377293 1377334 1377376 1377418 1377459 1377501 1377543 1377585 1377626 1377668 1377710 1377751 1377793 1377835 1377876 1377918 1377960 1378002 1378043 1378085 1378127 1378168 1378210 1378252 1378294 1378335 1378377 1378419 1378460 1378502 1378544 1378586 1378627 1378669 1378711 1378752 1378794 1378836 1378877 1378919 1378961 1379003 1379044 1379086 1379128 1379169 1379211 1379253 1379295 1379336 1379378 1379420 1379461 1379503 1379545 1379587 1379628 1379670 1379712 1379753 1379795 1379837 1379878 1379920 1379962 1380004 1380045 1380087 1380129 1380170 1380212 1380254 1380296 1380337 1380379 1380421 1380462 1380504 1380546 1380588 1380629 1380671 1380713 1380754 1380796 1380838 1380879 1380921 1380963 1381005 1381046 1381088 1381130 1381171 1381213 1381255 1381297 1381338 1381380 1381422 1381463 1381505 1381547 1381589 1381630 1381672 1381714 1381755 1381797 1381839 1381880 1381922 1381964 1382006 1382047 1382089 1382131 1382172 1382214 1382256 1382298 1382339 1382381 1382423 1382464 1382506 1382548 1382590 1382631 1382673 1382715 1382756 1382798 1382840 1382881 1382923 1382965 1383007 1383048 1383090 1383132 1383173 1383215 1383257 1383299 1383340 1383382 1383424 1383465 1383507 1383549 1383591 1383632 1383674 1383716 1383757 1383799 1383841 1383882 1383924 1383966 1384008 1384049 1384091 1384133 1384174 1384216 1384258 1384300 1384341 1384383 1384425 1384466 1384508 1384550 1384592 1384633 1384675 1384717 1384758 1384800 1384842 1384883 1384925 1384967 1385009 1385050 1385092 1385134 1385175 1385217 1385259 1385301 1385342 1385384 1385426 1385467 1385509 1385551 1385593 1385634 1385676 1385718 1385759 1385801 1385843 1385884 1385926 1385968 1386010 1386051 1386093 1386135 1386176 1386218 1386260 1386302 1386343 1386385 1386427 1386468 1386510 1386552 1386594 1386635 1386677 1386719 1386760 1386802 1386844 1386885 1386927 1386969 1387011 1387052 1387094 1387136 1387177 1387219 1387261 1387303 1387344 1387386 1387428 1387469 1387511 1387553 1387595 1387636 1387678 1387720 1387761 1387803 1387845 1387886 1387928 1387970 1388012 1388053 1388095 1388137 1388178 1388220 1388262 1388304 1388345 1388387 1388429 1388470 1388512 1388554 1388596 1388637 1388679 1388721 1388762 1388804 1388846 1388887 1388929 1388971 1389013 1389054 1389096 1389138 1389179 1389221 1389263 1389305 1389346 1389388 1389430 1389471 1389513 1389555 1389597 1389638 1389680 1389722 1389763 1389805 1389847 1389888 1389930 1389972 1390014 1390055 1390097 1390139 1390180 1390222 1390264 1390306 1390347 1390389 1390431 1390472 1390514 1390556 1390598 1390639 1390681 1390723 1390764 1390806 1390848 1390889 1390931 1390973 1391015 1391056 1391098 1391140 1391181 1391223 1391265 1391307 1391348 1391390 1391432 1391473 1391515 1391557 1391599 1391640 1391682 1391724 1391765 1391807 1391849 1391890 1391932 1391974 1392016 1392057 1392099 1392141 1392182 1392224 1392266 1392308 1392349 1392391 1392433 1392474 1392516 1392558 1392600 1392641 1392683 1392725 1392766 1392808 1392850 1392891 1392933 1392975 1393017 1393058 1393100 1393142 1393183 1393225 1393267 1393309 1393350 1393392 1393434 1393475 1393517 1393559 1393601 1393642 1393684 1393726 1393767 1393809 1393851 1393892 1393934 1393976 1394018 1394059 1394101 1394143 1394184 1394226 1394268 1394310 1394351 1394393 1394435 1394476 1394518 1394560 1394602 1394643 1394685 1394727 1394768 1394810 1394852 1394893 1394935 1394977 1395019 1395060 1395102 1395144 1395185 1395227 1395269 1395311 1395352 1395394 1395436 1395477 1395519 1395561 1395603 1395644 1395686 1395728 1395769 1395811 1395853 1395894 1395936 1395978 1396020 1396061 1396103 1396145 1396186 1396228 1396270 1396312 1396353 1396395 1396437 1396478 1396520 1396562 1396604 1396645 1396687 1396729 1396770 1396812 1396854 1396895 1396937 1396979 1397021 1397062 1397104 1397146 1397187 1397229 1397271 1397313 1397354 1397396 1397438 1397479 1397521 1397563 1397605 1397646 1397688 1397730 1397771 1397813 1397855 1397896 1397938 1397980 1398022 1398063 1398105 1398147 1398188 1398230 1398272 1398314 1398355 1398397 1398439 1398480 1398522 1398564 1398606 1398647 1398689 1398731 1398772 1398814 1398856 1398897 1398939 1398981 1399023 1399064 1399106 1399148 1399189 1399231 1399273 1399315 1399356 1399398 1399440 1399481 1399523 1399565 1399607 1399648 1399690 1399732 1399773 1399815 1399857 1399898 1399940 1399982 1400024 1400065 1400107 1400149 1400190 1400232 1400274 1400316 1400357 1400399 1400441 1400482 1400524 1400566 1400608 1400649 1400691 1400733 1400774 1400816 1400858 1400899 1400941 1400983 1401025 1401066 1401108 1401150 1401191 1401233 1401275 1401317 1401358 1401400 1401442 1401483 1401525 1401567 1401609 1401650 1401692 1401734 1401775 1401817 1401859 1401900 1401942 1401984 1402026 1402067 1402109 1402151 1402192 1402234 1402276 1402318 1402359 1402401 1402443 1402484 1402526 1402568 1402610 1402651 1402693 1402735 1402776 1402818 1402860 1402901 1402943 1402985 1403027 1403068 1403110 1403152 1403193 1403235 1403277 1403319 1403360 1403402 1403444 1403485 1403527 1403569 1403611 1403652 1403694 1403736 1403777 1403819 1403861 1403902 1403944 1403986 1404028 1404069 1404111 1404153 1404194 1404236 1404278 1404320 1404361 1404403 1404445 1404486 1404528 1404570 1404612 1404653 1404695 1404737 1404778 1404820 1404862 1404903 1404945 1404987 1405029 1405070 1405112 1405154 1405195 1405237 1405279 1405321 1405362 1405404 1405446 1405487 1405529 1405571 1405613 1405654 1405696 1405738 1405779 1405821 1405863 1405904 1405946 1405988 1406030 1406071 1406113 1406155 1406196 1406238 1406280 1406322 1406363 1406405 1406447 1406488 1406530 1406572 1406614 1406655 1406697 1406739 1406780 1406822 1406864 1406905 1406947 1406989 1407031 1407072 1407114 1407156 1407197 1407239 1407281 1407323 1407364 1407406 1407448 1407489 1407531 1407573 1407615 1407656 1407698 1407740 1407781 1407823 1407865 1407906 1407948 1407990 1408032 1408073 1408115 1408157 1408198 1408240 1408282 1408324 1408365 1408407 1408449 1408490 1408532 1408574 1408616 1408657 1408699 1408741 1408782 1408824 1408866 1408907 1408949 1408991 1409033 1409074 1409116 1409158 1409199 1409241 1409283 1409325 1409366 1409408 1409450 1409491 1409533 1409575 1409617 1409658 1409700 1409742 1409783 1409825 1409867 1409908 1409950 1409992 1410034 1410075 1410117 1410159 1410200 1410242 1410284 1410326 1410367 1410409 1410451 1410492 1410534 1410576 1410618 1410659 1410701 1410743 1410784 1410826 1410868 1410909 1410951 1410993 1411035 1411076 1411118 1411160 1411201 1411243 1411285 1411327 1411368 1411410 1411452 1411493 1411535 1411577 1411619 1411660 1411702 1411744 1411785 1411827 1411869 1411910 1411952 1411994 1412036 1412077 1412119 1412161 1412202 1412244 1412286 1412328 1412369 1412411 1412453 1412494 1412536 1412578 1412620 1412661 1412703 1412745 1412786 1412828 1412870 1412911 1412953 1412995 1413037 1413078 1413120 1413162 1413203 1413245 1413287 1413329 1413370 1413412 1413454 1413495 1413537 1413579 1413621 1413662 1413704 1413746 1413787 1413829 1413871 1413912 1413954 1413996 1414038 1414079 1414121 1414163 1414204 1414246 1414288 1414330 1414371 1414413 1414455 1414496 1414538 1414580 1414622 1414663 1414705 1414747 1414788 1414830 1414872 1414913 1414955 1414997 1415039 1415080 1415122 1415164 1415205 1415247 1415289 1415331 1415372 1415414 1415456 1415497 1415539 1415581 1415623 1415664 1415706 1415748 1415789 1415831 1415873 1415914 1415956 1415998 1416040 1416081 1416123 1416165 1416206 1416248 1416290 1416332 1416373 1416415 1416457 1416498 1416540 1416582 1416624 1416665 1416707 1416749 1416790 1416832 1416874 1416915 1416957 1416999 1417041 1417082 1417124 1417166 1417207 1417249 1417291 1417333 1417374 1417416 1417458 1417499 1417541 1417583 1417625 1417666 1417708 1417750 1417791 1417833 1417875 1417916 1417958 1418000 1418042 1418083 1418125 1418167 1418208 1418250 1418292 1418334 1418375 1418417 1418459 1418500 1418542 1418584 1418626 1418667 1418709 1418751 1418792 1418834 1418876 1418917 1418959 1419001 1419043 1419084 1419126 1419168 1419209 1419251 1419293 1419335 1419376 tests/vfr/v1_end_less_than_start.txt0000664000175000017500000000005514741067256017213 0ustar aniolaniol# timecode format v1 Assume 29.970030 20,0,25tests/vfr/v1_fully_contained.txt0000664000175000017500000000006614741067256016351 0ustar aniolaniol# timecode format v1 Assume 29.970030 0,50,10 10,40,10tests/vfr/v1_too_many_parts.txt0000664000175000017500000000005714741067256016230 0ustar aniolaniol# timecode format v1 Assume 29.970030 0,10,24,8tests/vfr/v1_bad_seperators.txt0000664000175000017500000000005714741067256016167 0ustar aniolaniol# timecode format v1 Assume 29.970030 0;20;24.2tests/vfr/v2_empty.txt0000664000175000017500000000002514741067256014324 0ustar aniolaniol# timecode format v2 tests/vfr/v2_nolen.txt0000664000175000017500000000006014741067256014300 0ustar aniolaniol# timecode format v2 0.00000 100.00000 200.00000tests/vfr/v2_100_frames_30_fps.txt0000664000175000017500000000224314741067256016201 0ustar aniolaniol# timecode format v2 0.000000 33.000000 67.000000 100.000000 133.000000 167.000000 200.000000 233.000000 267.000000 300.000000 333.000000 367.000000 400.000000 433.000000 467.000000 500.000000 533.000000 567.000000 600.000000 633.000000 667.000000 700.000000 733.000000 767.000000 800.000000 833.000000 867.000000 900.000000 933.000000 967.000000 1000.000000 1033.000000 1067.000000 1100.000000 1133.000000 1167.000000 1200.000000 1233.000000 1267.000000 1300.000000 1333.000000 1367.000000 1400.000000 1433.000000 1467.000000 1500.000000 1533.000000 1567.000000 1600.000000 1633.000000 1667.000000 1700.000000 1733.000000 1767.000000 1800.000000 1833.000000 1867.000000 1900.000000 1933.000000 1967.000000 2000.000000 2033.000000 2067.000000 2100.000000 2133.000000 2167.000000 2200.000000 2233.000000 2267.000000 2300.000000 2333.000000 2367.000000 2400.000000 2433.000000 2467.000000 2500.000000 2533.000000 2567.000000 2600.000000 2633.000000 2667.000000 2700.000000 2733.000000 2767.000000 2800.000000 2833.000000 2867.000000 2900.000000 2933.000000 2967.000000 3000.000000 3033.000000 3067.000000 3100.000000 3133.000000 3167.000000 3200.000000 3233.000000 3267.000000 3300.000000 tests/vfr/v1_override_over_1000.txt0000664000175000017500000000006314741067256016501 0ustar aniolaniol# timecode format v1 Assume 29.970030 50,100,1000.1tests/vfr/v1_override_zero.txt0000664000175000017500000000005414741067256016045 0ustar aniolaniol# timecode format v1 Assume 29.970030 0,10,0tests/vfr/v2_out_of_order.txt0000664000175000017500000000006514741067256015660 0ustar aniolaniol# timecode format v2 0000.00000 2000.00000 1000.00000tests/vfr/v1_assume_30_with_override.txt0000664000175000017500000000004714741067256017722 0ustar aniolaniol# timecode format v1 Assume 30 20,50,19tests/vfr/v1_start_end_overlap.txt0000664000175000017500000000006314741067256016702 0ustar aniolaniol# timecode format v1 Assume 29.970030 0,1,25 1,2,25tests/vfr/v2_number_in_comment.txt0000664000175000017500000000020314741067256016664 0ustar aniolaniol# timecode format v2 0000.00000 #1000.00000 1000.00000 2000.00000 3000.00000 4000.00000 5000.00000 6000.00000 7000.00000 8000.00000tests/vfr/validate_different.txt0000664000175000017500000000004214741067256016375 0ustar aniolaniol# timecode format v2 0 100 201 300tests/vfr/v1_assume_over_1000.txt0000664000175000017500000000004314741067256016155 0ustar aniolaniol# timecode format v1 Assume 1000.1 tests/vfr/validate_longer.txt0000664000175000017500000000004614741067256015721 0ustar aniolaniol# timecode format v2 0 100 200 300 400tests/vfr/v2_comments.txt0000664000175000017500000000050714741067256015020 0ustar aniolaniol# timecode format v2 0000.00000 # why does this format even have comments? 1000.00000 # I can see them being vaguely useful in v1 timecodes 2000.00000 # I guess we could stick the name of the writing program in a comment 3000.00000 # but really, what's the point? 4000.00000 #nospace 5000.00000 6000.00000 7000.00000 8000.00000tests/vfr/v2_100_frames_30_with_override.txt0000664000175000017500000000075214741067256020266 0ustar aniolaniol# timecode format v2 0 33 67 100 133 167 200 233 267 300 333 367 400 433 467 500 533 567 600 633 667 719 772 825 877 930 982 1035 1088 1140 1193 1246 1298 1351 1404 1456 1509 1561 1614 1667 1719 1772 1825 1877 1930 1982 2035 2088 2140 2193 2246 2298 2332 2365 2398 2432 2465 2498 2532 2565 2598 2632 2665 2698 2732 2765 2798 2832 2865 2898 2932 2965 2998 3032 3065 3098 3132 3165 3198 3232 3265 3298 3332 3365 3398 3432 3465 3498 3532 3565 3598 3632 3665 3698 3732 3765 3798 3832 3865 3898 tests/vfr/empty.txt0000664000175000017500000000000014741067256013706 0ustar aniolanioltests/vfr/v1_assume_30.txt0000664000175000017500000000003714741067256014767 0ustar aniolaniol# timecode format v1 Assume 30 tests/vfr/v1_out_of_order.txt0000664000175000017500000000006714741067256015661 0ustar aniolaniol# timecode format v1 Assume 29.970030 50,100,25 0,10,25tests/vfr/validate_shorter.txt0000664000175000017500000000003614741067256016120 0ustar aniolaniol# timecode format v2 0 100 200tests/vfr/v2_1fps.txt0000664000175000017500000000016714741067256014046 0ustar aniolaniol# timecode format v2 0000.00000 1000.00000 2000.00000 3000.00000 4000.00000 5000.00000 6000.00000 7000.00000 8000.00000tests/vfr/v1_start_equals_end.txt0000664000175000017500000000011014741067256016515 0ustar aniolaniol# timecode format v1 Assume 29.970030 0,0,25 1,1,25 2,2,25 3,3,25 4,4,25tests/vfr/v2_len_3_10.txt0000664000175000017500000000016614741067256014474 0ustar aniolaniol# timecode format v2 0.00000 100.00000 200.00000 201.00000 202.00000 203.00000 204.00000 205.00000 206.00000 207.00000tests/vfr/v1_mode5.txt0000664000175000017500000001263114741067256014204 0ustar aniolaniol# timecode format v1 Assume 29.970030 # TDecimate v1.0.3 by tritical # Mode 5 - Auto-generated mkv timecodes file 10,93,23.976024 99,146,23.976024 157,164,23.976024 175,178,23.976024 219,238,23.976024 329,340,23.976024 401,424,23.976024 455,466,23.976024 532,543,23.976024 569,584,23.976024 605,616,23.976024 647,658,23.976024 664,683,23.976024 714,721,23.976024 747,762,23.976024 768,775,23.976024 801,808,23.976024 824,827,23.976024 883,890,23.976024 926,945,23.976024 951,962,23.976024 1013,1028,23.976024 1114,1129,23.976024 1145,1156,23.976024 1182,1205,23.976024 1256,1271,23.976024 1292,1307,23.976024 1318,1321,23.976024 1362,1381,23.976024 1402,1409,23.976024 1455,1470,23.976024 1491,1494,23.976024 1520,1531,23.976024 1572,1579,23.976024 1605,1608,23.976024 1619,1654,23.976024 3110,3141,23.976024 3177,3208,23.976024 3214,3216,17.982018 3547,3554,23.976024 3560,3563,23.976024 3569,3571,17.982018 3627,3634,23.976024 3645,3656,23.976024 3662,3673,23.976024 3684,3763,23.976024 3804,3807,23.976024 3818,3825,23.976024 4231,4398,23.976024 4409,4436,23.976024 4502,4569,23.976024 4625,4860,23.976024 4931,5394,23.976024 5405,5532,23.976024 5573,5608,23.976024 5619,5670,23.976024 5746,5853,23.976024 5899,5958,23.976024 5974,6529,23.976024 6555,6658,23.976024 6669,6752,23.976024 6758,6809,23.976024 6860,6887,23.976024 6898,7257,23.976024 7313,7324,23.976024 7330,7801,23.976024 7817,7820,23.976024 7836,7839,23.976024 7855,7858,23.976024 7874,7897,23.976024 7993,8168,23.976024 8304,8911,23.976024 8917,9148,23.976024 9219,9254,23.976024 9275,9334,23.976024 9365,9412,23.976024 9418,9445,23.976024 9481,9552,23.976024 9558,9569,23.976024 9575,9602,23.976024 9608,9703,23.976024 9779,9822,23.976024 9843,10010,23.976024 10016,10027,23.976024 10073,10076,23.976024 10087,10090,23.976024 10101,10140,23.976024 10156,10159,23.976024 10175,10386,23.976024 10397,10420,23.976024 10431,10698,23.976024 10724,10843,23.976024 10864,11079,23.976024 11085,11260,23.976024 11281,11456,23.976024 11477,11916,23.976024 12012,12547,23.976024 12578,12581,23.976024 12592,12795,23.976024 12806,13177,23.976024 13193,13196,23.976024 13317,13432,23.976024 13463,13538,23.976024 13614,13685,23.976024 13751,13938,23.976024 13954,13957,23.976024 13973,13976,23.976024 13992,13995,23.976024 14011,14114,23.976024 14200,14387,23.976024 14803,14894,23.976024 14950,14953,23.976024 15074,15089,23.976024 15130,15145,23.976024 15196,15207,23.976024 15638,15681,23.976024 15782,15917,23.976024 16003,16010,23.976024 16016,16023,23.976024 16064,16223,23.976024 16439,16574,23.976024 16815,16818,23.976024 16824,17091,23.976024 17282,17385,23.976024 17461,17488,23.976024 17494,17545,23.976024 17746,17937,23.976024 17958,18193,23.976024 18264,18375,23.976024 18386,18401,23.976024 18412,18463,23.976024 18529,18572,23.976024 18633,18836,23.976024 18902,19049,23.976024 19055,19062,23.976024 19068,19115,23.976024 19156,19611,23.976024 19772,19779,23.976024 19790,19905,23.976024 19971,20070,23.976024 20076,20103,23.976024 20119,20134,23.976024 20140,20211,23.976024 20217,20408,23.976024 20424,21271,23.976024 21367,21478,23.976024 21534,21761,23.976024 21847,21870,23.976024 21876,22363,23.976024 22524,22675,23.976024 22686,22741,23.976024 22817,22832,23.976024 22883,22890,23.976024 22911,23334,23.976024 23500,23599,23.976024 23610,23949,23.976024 23955,24018,23.976024 24024,24131,23.976024 24192,24227,23.976024 24473,24616,23.976024 24767,25078,23.976024 25124,25403,23.976024 25409,25536,23.976024 25612,25899,23.976024 25945,25992,23.976024 26043,26166,23.976024 26547,26790,23.976024 27036,27099,23.976024 27105,27120,23.976024 27166,27169,23.976024 27175,27182,23.976024 27188,27191,23.976024 27202,27517,23.976024 27568,27779,23.976024 27795,27802,23.976024 27823,27838,23.976024 27844,27939,23.976024 28000,28579,23.976024 28685,28812,23.976024 28833,28836,23.976024 28867,28870,23.976024 28876,28963,23.976024 28969,28988,23.976024 28994,28997,23.976024 29008,29015,23.976024 29021,29036,23.976024 29047,29066,23.976024 29072,29219,23.976024 29265,29268,23.976024 29284,29287,23.976024 29298,29313,23.976024 29329,29496,23.976024 29502,29505,23.976024 29541,29544,23.976024 29555,29558,23.976024 29669,29672,23.976024 29683,29686,23.976024 29707,29710,23.976024 29721,29808,23.976024 29814,29845,23.976024 29901,29976,23.976024 30067,30074,23.976024 30085,30092,23.976024 30103,30222,23.976024 30318,30697,23.976024 30703,30742,23.976024 30748,30811,23.976024 30817,30872,23.976024 30928,31019,23.976024 31025,31200,23.976024 31206,31217,23.976024 31223,31330,23.976024 31331,31333,17.982018 31334,31353,23.976024 31359,31362,23.976024 31368,31679,23.976024 31720,31763,23.976024 31769,32036,23.976024 32077,32088,23.976024 32094,32149,23.976024 32155,32182,23.976024 32208,32215,23.976024 32221,32240,23.976024 32246,32277,23.976024 32283,32306,23.976024 32312,32843,23.976024 32869,32896,23.976024 32912,32927,23.976024 32938,32961,23.976024 33107,33122,23.976024 33148,33223,23.976024 33229,33236,23.976024 33257,33260,23.976024 33271,33274,23.976024 33285,33312,23.976024 33323,33330,23.976024 33336,33339,23.976024 33345,33352,23.976024 33383,33402,23.976024 33468,33471,23.976024 33557,33560,23.976024 33566,33585,23.976024 33651,33714,23.976024 33725,33740,23.976024 33751,33782,23.976024 33788,34047,23.976024 34053,36444,23.976024 # vfr stats: 71.60% film 28.40% video # vfr stats: 30461 - film 12080 - video 42541 - total # vfr stats: longest vid section - 1455 frames # vfr stats: # of detected vid sections - 245tests/vfr/v1_too_few_parts.txt0000664000175000017500000000005214741067256016040 0ustar aniolaniol# timecode format v1 Assume 29.970030 0,10tests/vfr/v1_assume_int.txt0000664000175000017500000000004614741067256015337 0ustar aniolaniol# timecode format v1 Assume 25 0,10,30tests/vfr/validate_base.txt0000664000175000017500000000004214741067256015341 0ustar aniolaniol# timecode format v2 0 100 200 300tests/meson.build0000664000175000017500000000370014741067256013366 0ustar aniolaniolgtest_ver = '>=1.14.0' gtest_dep = dependency('gtest', fallback : ['gtest', 'gtest_dep'], version : gtest_ver) gmock_dep = dependency('gmock', fallback : ['gtest', 'gmock_dep'], version : gtest_ver) tests_deps = [ gtest_dep, gmock_dep, ] tests_src = [ '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', ] tests_inc = include_directories('support') tests_args = [] # force UTF8 for MSVC if host_machine.system() == 'windows' tests_args += ['/utf-8'] elif host_machine.system() == 'darwin' tests_args += ['-DGTEST_HAS_POSIX_RE=0'] endif runner = executable( 'gtest-main', tests_src, include_directories: [tests_inc, libaegisub_inc, deps_inc], dependencies: [tests_deps, deps], cpp_args: tests_args, link_with: libaegisub, ) 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 tests_data_des = meson.project_build_root() custom_target('setup-test-data', input: runner, output: 'applied_test_setup', command: [setup_sh, tests_data_des], build_by_default: true ) tests/setup.bat0000664000175000017500000000123014741067256013050 0ustar aniolaniolcd %1 icacls data /grant:r %USERNAME%:F /T rd /s /q data mkdir data copy nul data\file mkdir data\dir echo {"Video" : ["Entry One", "Entry Two"]} > data/mru_ok.json echo {"Video" : [1, 3]} > data/mru_invalid.json < nul set /p ="1234567890" > data\ten_bytes copy nul data\touch_mod_time mkdir data\dir_iterator 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 mkdir data\vfr mkdir data\vfr\in mkdir data\vfr\out xcopy "%~dp0\vfr" data\vfr\in mkdir data\keyframe xcopy "%~dp0\keyframe" data\keyframe ping -n 2 127.0.0.1 > nul tests/options/0000775000175000017500000000000014741067256012717 5ustar aniolanioltests/options/null.json0000664000175000017500000000002014741067256014554 0ustar aniolaniol{"Null" : null} tests/options/all_bool.json0000664000175000017500000000004614741067256015375 0ustar aniolaniol{"1" : true, "2" : true, "3" : true } tests/options/string.json0000664000175000017500000000003614741067256015117 0ustar aniolaniol{"String" : "This is a test"} tests/setup.sh0000775000175000017500000000120514741067256012721 0ustar aniolaniold=$(dirname $0)/ if test -d data; then chmod 777 data/* chmod -R 777 data/ fi rm -rf data mkdir -p data touch data/file mkdir data/dir echo '{"Video" : ["Entry One", "Entry Two"]}' > data/mru_ok.json echo '{"Video" : [1, 3]}' > data/mru_invalid.json printf %s '1234567890' > data/ten_bytes touch -r $0 data/touch_mod_time mkdir data/options cp $d/options/* data/options mkdir data/dir_iterator touch data/dir_iterator/1.a touch data/dir_iterator/2.a touch data/dir_iterator/1.b touch data/dir_iterator/2.b mkdir data/vfr mkdir data/vfr/in mkdir data/vfr/out cp $d/vfr/* data/vfr/in/ mkdir data/keyframe cp $d/keyframe/* data/keyframe tests/support/0000775000175000017500000000000014741067256012740 5ustar aniolanioltests/support/tests_pre.h0000664000175000017500000000004714741067256015122 0ustar aniolaniol#include "../../libaegisub/lagi_pre.h" tests/support/util.cpp0000664000175000017500000000261314741067256014423 0ustar aniolaniol// Copyright (c) 2013, 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 "util.h" #include #include #include namespace util { bool compare(const std::string &file1, const std::string &file2) { std::stringstream ss1, ss2; std::ifstream if1(file1.c_str(), std::ios::binary), if2(file2.c_str(), std::ios::binary); ss1 << if1.rdbuf(); ss2 << if2.rdbuf(); return ss1.str() == ss2.str(); } int write_rand(const char *path) { int value = rand(); std::ofstream of(path); of << value; return value; } int read_written_rand(const char *path) { int value; std::ifstream i(path); i >> value; return value; } } tests/support/main.cpp0000664000175000017500000000246514741067256014377 0ustar aniolaniol// Copyright (c) 2010, Amar Takhar // // 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. #include #include #include #include #include #include #include int main(int argc, char **argv) { agi::dispatch::Init([](agi::dispatch::Thunk) { }); agi::util::InitLocale(); agi::log::log = new agi::log::LogSink; agi::log::log->Subscribe(std::make_unique("./")); ::testing::InitGoogleTest(&argc, argv); srand(time(nullptr)); int retval = RUN_ALL_TESTS(); delete agi::log::log; return retval; } tests/support/util.h0000664000175000017500000000177114741067256014074 0ustar aniolaniol// Copyright (c) 2013, 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 namespace util { bool compare(std::string const& file1, std::string const& file2); int write_rand(const char *path); int read_written_rand(const char *path); } tests/support/main.h0000664000175000017500000000154314741067256014040 0ustar aniolaniol// Copyright (c) 2010, Amar Takhar // // 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. #include namespace { class libagi : public ::testing::Test { }; } tools/0000775000175000017500000000000014741067256011222 5ustar aniolanioltools/strip-icu.py0000664000175000017500000002156414741067256013523 0ustar aniolaniol# 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/ # A script to strip all of the data we don't use out of ICU's data files # Run from $ICU_ROOT/icu4c/source/data from __future__ import unicode_literals import re import os # Remove stuff we don't use at all from the Makefile def delete_matching(filename, strs): exprs = [re.compile(s) for s in strs] with open(filename, encoding='utf-8') as f: lines = [line for line in f if not any(r.match(line) for r in exprs)] with open(filename, 'w', encoding='utf-8') as f: for line in lines: f.write(line) REMOVE_SUBDIRS=['LOCSRCDIR', 'CURRSRCDIR', 'ZONESRCDIR', 'COLSRCDIR', 'RBNFSRCDIR', 'TRANSLITSRCDIR'] delete_matching('Makefile.in', ['^-include .*%s' % s for s in REMOVE_SUBDIRS]) delete_matching('Makefile.in', ['^CNV_FILES']) with open('misc/misclocal.mk', 'w', encoding='utf-8') as f: f.write('MISC_SOURCE = supplementalData.txt likelySubtags.txt icuver.txt icustd.txt metadata.txt') # Remove data we don't need from the lang and region files def parse_txt(filename): root = {} cur = root stack = [root] comment = False for line in open(filename, encoding='utf-8'): line = line.strip() if len(line) == 0: continue if '//' in line: continue if '/*' in line: comment = True continue if comment: if '*/' in line: comment = False continue if line == '}': stack.pop() cur = stack[-1] continue if line.endswith('{'): obj = {} cur[line[:-1]] = obj cur = obj stack.append(obj) continue m = re.match('(.*){"(.*)"}', line) if m: cur[m.group(1)] = m.group(2) return root def remove_sections(root): for child in root.values(): child.pop('Keys', None) child.pop('LanguagesShort', None) child.pop('Types', None) child.pop('Variants', None) child.pop('codePatterns', None) child.pop('localeDisplayPattern', None) child.pop('CountriesShort', None) child.pop('Scripts%stand-alone', None) def remove_languages(root): for lang, child in root.items(): # We only care about a language's name in that language lang = lang.split('_')[0] trimmed = {} v = child.get('Languages', {}).get(lang) if v: trimmed[lang] = v child['Languages'] = trimmed # Scripts which are actually used by stuff SCRIPTS = ['Cyrl', 'Latn', 'Arab', 'Vaii', 'Hans', 'Hant'] def remove_scripts(root): for lang, child in root.items(): v = child.get('Scripts') if not v: continue trimmed = {} for script in SCRIPTS: if v.get(script): trimmed[script] = v[script] child['Scripts'] = trimmed def write_dict(name, value, out, indent): if len(value) == 0: return child_indent = indent + ' ' out.write(indent) out.write(name) out.write('{\n') for k in sorted(value.keys()): v = value[k] if type(v) == dict: write_dict(k, v, out, child_indent) else: out.write(('%s%s{"%s"}\n' % (child_indent, k, v))) out.write(indent) out.write('}\n') def write_file(root, filename): with open(filename, 'w', encoding='utf-8') as f: for k, v in root.items(): write_dict(k, v, f, '') def minify_lang(filename): f = parse_txt(filename) remove_sections(f) remove_languages(f) remove_scripts(f) write_file(f, filename) for name in os.listdir('lang'): if not name.endswith('.txt'): continue minify_lang('lang/' + name) # gather information about which language+region combinations actually exist, # so that we can drop all others def gather_regions(): langs = { 'af': ['ZA'], 'am': ['ET'], 'ar': ['AE', 'BH', 'DZ', 'EG', 'IQ', 'JO', 'KW', 'LB', 'LY', 'MA', 'OM', 'QA', 'SA', 'SY', 'TN', 'YE'], 'arn': ['CL'], 'as': ['IN'], 'az': ['AZ', 'AZ'], 'ba': ['RU'], 'be': ['BY'], 'bg': ['BG'], 'bn': ['BD', 'IN'], 'bo': ['CN'], 'br': ['FR'], 'bs': ['BA', 'BA'], 'ca': ['ES'], 'co': ['FR'], 'cs': ['CZ'], 'cy': ['GB'], 'da': ['DK'], 'de': ['AT', 'CH', 'DE', 'LI', 'LU'], 'div': ['MV'], 'el': ['GR'], 'en': ['029', 'AU', 'BZ', 'CA', 'GB', 'IE', 'IN', 'JM', 'MY', 'NZ', 'PH', 'SG', 'TT', 'US', 'ZA', 'ZW'], 'es': ['AR', 'BO', 'CL', 'CO', 'CR', 'DO', 'EC', 'ES', 'GT', 'HN', 'MX', 'NI', 'PA', 'PE', 'PR', 'PY', 'SV', 'US', 'UY', 'VE'], 'et': ['EE'], 'eu': ['ES'], 'fa': ['IR'], 'fi': ['FI'], 'fil': ['PH'], 'fo': ['FO'], 'fr': ['BE', 'CA', 'CH', 'FR', 'LU', 'MC'], 'fy': ['NL'], 'ga': ['IE'], 'gl': ['ES'], 'gsw': ['FR'], 'gu': ['IN'], 'ha': ['NG'], 'he': ['IL'], 'hi': ['IN'], 'hr': ['BA', 'HR'], 'hu': ['HU'], 'hy': ['AM'], 'id': ['ID'], 'ig': ['NG'], 'ii': ['CN'], 'is': ['IS'], 'it': ['CH', 'IT'], 'iu': ['CA', 'CA'], 'ja': ['JP'], 'ka': ['GE'], 'kk': ['KZ'], 'kl': ['GL'], 'km': ['KH'], 'kn': ['IN'], 'ko': ['KR'], 'kok': ['IN'], 'ky': ['KG'], 'lb': ['LU'], 'lo': ['LA'], 'lt': ['LT'], 'lv': ['LV'], 'mi': ['NZ'], 'mk': ['MK'], 'ml': ['IN'], 'mn': ['CN', 'MN'], 'moh': ['CA'], 'mr': ['IN'], 'ms': ['BN', 'MY'], 'mt': ['MT'], 'nb': ['NO'], 'ne': ['NP'], 'nl': ['BE', 'NL'], 'nn': ['NO'], 'nso': ['ZA'], 'oc': ['FR'], 'or': ['IN'], 'pa': ['IN'], 'pl': ['PL'], 'prs': ['AF'], 'ps': ['AF'], 'pt': ['BR', 'PT'], 'qut': ['GT'], 'quz': ['BO', 'EC', 'PE'], 'rm': ['CH'], 'ro': ['RO'], 'ru': ['RU'], 'rw': ['RW'], 'sa': ['IN'], 'sah': ['RU'], 'se': ['FI', 'NO', 'SE'], 'si': ['LK'], 'sk': ['SK'], 'sl': ['SI'], 'sma': ['NO', 'SE'], 'smj': ['NO', 'SE'], 'smn': ['FI'], 'sms': ['FI'], 'sq': ['AL'], 'sr': ['BA', 'BA', 'SP', 'YU'], 'sv': ['FI', 'SE'], 'sw': ['KE', 'TZ'], 'syr': ['SY'], 'ta': ['IN'], 'te': ['IN'], 'tg': ['TJ'], 'th': ['TH'], 'tk': ['TM'], 'tn': ['ZA'], 'tr': ['TR'], 'tt': ['RU'], 'tzm': ['DZ'], 'ug': ['CN'], 'uk': ['UA'], 'ur': ['PK'], 'uz': ['UZ', 'UZ'], 'vi': ['VN'], 'wee': ['DE'], 'wen': ['DE'], 'wo': ['SN'], 'xh': ['ZA'], 'yo': ['NG'], 'zh': ['CN', 'HK', 'MO', 'SG', 'TW'], 'zu': ['ZA'] } for name in os.listdir('region'): if not name.endswith('.txt'): continue parts = name[:-4].split('_') if len(parts) == 1: continue if not parts[0] in langs: langs[parts[0]] = [] langs[parts[0]].extend(parts[1:]) return langs REGIONS = gather_regions() def remove_countries(root): for lang, child in root.items(): v = child.get('Countries', {}) if not v: continue # We only care about the names for regions in the languages used in # those regions lang = lang.split('_')[0] regions = REGIONS.get(lang) if not regions: del child['Countries'] continue trimmed = {} for region in regions: name = v.get(region) if name: trimmed[region] = name child['Countries'] = trimmed def minify_region(filename): f = parse_txt(filename) remove_sections(f) remove_countries(f) write_file(f, filename) for name in os.listdir('region'): if not name.endswith('.txt'): continue minify_region('region/' + name) tools/repack-thes-dict.cpp0000664000175000017500000000537614741067256015070 0ustar aniolaniol// Copyright (c) 2013, 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. #include #include #include #include #include #include #include #include #include #include #include namespace { using boost::phoenix::placeholders::_1; void convert(std::string const& path) { std::unique_ptr idx(agi::io::Open(path + ".idx")); std::unique_ptr dat(agi::io::Open(path + ".dat")); std::ostringstream idx_out_buffer; agi::io::Save idx_out(path + ".out.idx"); agi::io::Save dat_out(path + ".out.dat"); idx_out.Get() << "UTF-8\n"; dat_out.Get() << "UTF-8\n"; std::string encoding_name; getline(*idx, encoding_name); agi::charset::IconvWrapper conv(encoding_name.c_str(), "utf-8"); std::string unused_entry_count; getline(*idx, unused_entry_count); int entry_count = 0; for (auto const& line : agi::line_iterator(*idx, encoding_name)) { std::vector chunks; boost::split(chunks, line, _1 == '|'); if (chunks.size() != 2) continue; if (chunks[0].find(' ') != std::string::npos) continue; ++entry_count; idx_out_buffer << chunks[0] << '|' << dat_out.Get().tellp() << '\n'; dat->seekg(atoi(chunks[1].c_str())); agi::line_iterator iter{*dat, encoding_name}; dat_out.Get() << *iter << '\n'; std::vector header; boost::split(header, *iter, _1 == '|'); int meanings = atoi(header[1].c_str()); for (int i = 0; i < meanings; ++i) dat_out.Get() << *++iter << '\n'; } idx_out.Get() << entry_count << '\n' << idx_out_buffer.str(); } } int main(int argc, char *argv[]) { if (argc != 2) { printf("usage: respack-thes-dict \n"); return 1; } agi::dispatch::Init([](agi::dispatch::Thunk f) { }); agi::util::InitLocale(); agi::log::log = new agi::log::LogSink; convert(argv[1]); } tools/osx-bundle-restart-helper.m0000664000175000017500000000556614741067256016433 0ustar aniolaniol/* Copyright (c) 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. */ #include #include #include #include #include #include @import Foundation; /* Return codes: 1: Error in kqueue() 2: Error in kevent() 3: Timed out waiting for parent to exit 4: Error in execve() If none of those happen the requested command is execve()'d. */ int main(int argc, char *argv[], char *env[]) { int queue = kqueue(); if (queue == -1) { perror("Error in: kqueue()"); return 1; } struct kevent event[1]; EV_SET(event, getppid(), EVFILT_PROC, EV_ADD|EV_ENABLE|EV_ONESHOT, NOTE_EXIT, 0, 0); printf("restart-helper: waiting for pid %d\n", getppid()); struct kevent change[1]; struct timespec timeout = { 30, 0 }; int nchange = kevent(queue, change, 1, event, 1, &timeout); if (nchange < 0) { perror("restart-helper: Error in kevent()"); return 2; } if (nchange == 0) { printf("restart-helper: Timed out waiting for pid %d\n", getppid()); return 3; } if (change[0].flags & EV_ERROR) { perror("restart-helper: Error in event"); return 2; } close(queue); printf("restart-helper: Executing '%s'\n", argv[1]); @try { [NSTask launchedTaskWithLaunchPath:[NSString stringWithUTF8String:argv[1]] arguments:@[]]; } @catch (NSException *e) { printf("restart-helper: Error launching program: %s\n", e.description.UTF8String); return 4; } return 0; } tools/respack.lua0000775000175000017500000000416614741067256013367 0ustar aniolaniol#!/usr/bin/env luajit -- 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/ if not arg or #arg == 0 then arg = {...} end if #arg ~= 3 then io.stdout:write('Usage: [in] [out]
[out]\n') os.exit(1) end 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 io.stdout:write("Manifest: " .. arg[1] .. " CPP: " .. arg[2] .. " Header: " .. arg[3] .. '\n') local manifest = try_open(arg[1], 'r') local out_cpp = try_open(arg[2], 'w') local out_h = try_open(arg[3], 'w') local path = arg[1]:match'(.*/).*' or '' out_cpp:write('#include "libresrc.h"\n') for line in manifest:lines() do if line:find('.') then local file = try_open(path..line, 'rb') local id = line:gsub('^.*/', ''):gsub('%.[a-z]+$', '') out_cpp:write("const unsigned char " .. id .. "[] = {") local len = 0 while true do local bytes = file:read(65536) if not bytes then break end for i = 1, #bytes do if len > 0 then out_cpp:write(',') end out_cpp:write(string.format('%d', bytes:byte(i))) len = len + 1 end end out_cpp:write('};\n') out_h:write(string.format('extern const unsigned char %s[%d];\n', id, len)) file:close() end end tools/version.ps10000664000175000017500000000616214741067256013341 0ustar aniolaniol#!/usr/bin/env powershell param ( [Parameter(Position = 0, Mandatory = $false)] [string]$BuildRoot = $null, [Parameter(Position = 1, Mandatory = $false)] [string]$SourceRoot = $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" } 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' $version = @{} if (Test-Path $gitVersionHeaderPath) { Get-Content $gitVersionHeaderPath | %{$_.Trim()} | ?{$_} | %{ switch -regex ($_) { $defineNumberMatch { $version[$Matches[1]] = [int]$Matches[2]; } $defineStringMatch { $version[$Matches[1]] = $Matches[2]; } } } } $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 -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] $version['INSTALLER_VERSION'] = $gitVersionString = ($Matches[1..3] -join '.') + @("-$($Matches[4])",'')[!$Matches[4]] } else { 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] $version['INSTALLER_VERSION'] = ($Matches[1..3] -join '.') 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())`""} } } "`n#define $($_.Key) $($fmtValue)" } | Out-File -FilePath $gitVersionHeaderPath -Encoding utf8 tools/version.sh0000775000175000017500000000552414741067256013254 0ustar aniolaniol#!/bin/sh builddir="$1" srcdir="$2" if test "x$3" = "xdist"; then builddir="$MESON_PROJECT_DIST_ROOT" fi version_h_path="${builddir}/git_version.h" root_version_h_path="${srcdir}/git_version.h" if test -e "${root_version_h_path}"; then # If there is a git_version.h in the project root (as would be generated by meson dist), # copy it to the build folder so it's picked up by the following logic if ! cmp -s "${version_h_path}" "${root_version_h_path}"; then cp "${root_version_h_path}" "${version_h_path}" fi fi # If no git repo try to read from the existing git_version.h, for building from tarballs if ! test -d "${srcdir}/.git"; then if test -f "${version_h_path}"; then while read line; do set -- $line 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 exit 0 else echo "invalid git_version.h" exit 2 fi else echo "git repo not found and no cached git_version.h" exit 2 fi fi osx_bundle_sed_path="${builddir}/osx-bundle.sed" last_svn_revision=6962 last_svn_hash="16cd907fe7482cb54a7374cd28b8501f138116be" # Check if the commit exists first, it doesn't exist in shallow clones. if [ "$(git cat-file -t $last_svn_hash 2> /dev/null)" = "commit" ]; then git_revision=$(expr $last_svn_revision + $(git rev-list --count $last_svn_hash..HEAD)) else git_revision=0 fi git_version_str=$(git describe --tags --exact-match 2> /dev/null) installer_version='0.0.0' resource_version='0, 0, 0' if test x$git_version_str != x; then git_version_str="${git_version_str##v}" tagged_release=1 if [ $(echo $git_version_str | grep '^[0-9]\.[0-9]\.[0-9]$') ]; then installer_version=$git_version_str resource_version=$(echo $git_version_str | sed 's/\./, /g') fi else git_branch="$(git symbolic-ref HEAD 2> /dev/null)" || git_branch="(unnamed branch)" git_branch="${git_branch##refs/heads/}" git_hash=$(git rev-parse --short HEAD) git_version_str="${git_revision}-${git_branch}-${git_hash}" tagged_release=0 fi build_date="$(date "+%Y-%m-%d %H:%M %Z")" new_version_h="\ #define BUILD_GIT_VERSION_NUMBER ${git_revision} #define BUILD_GIT_VERSION_STRING \"${git_version_str}\" #define TAGGED_RELEASE ${tagged_release} #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 "${osx_bundle_sed}" > "${osx_bundle_sed_path}" ;; esac tools/osx-fix-libs.py0000664000175000017500000001311514741067256014121 0ustar aniolaniol#!/usr/bin/env python3 import re 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 goodlist = [] badlist = [] badlist_orig = [] link_map = {} def otool(cmdline): with subprocess.Popen(['otool'] + cmdline, stdout=subprocess.PIPE, encoding='utf-8') as p: return p.stdout.readlines() def get_rpath(lib): info = otool(['-l', lib]) commands = [] command = [] for line in info: line = line.strip() if line.startswith("Load command "): commands.append(command) command = [] else: command.append(line) commands.append(command) # yuck return [line.split()[1] for command in commands if "cmd LC_RPATH" in command for line in command if line.startswith("path")] def collectlibs(lib, masterlist, targetdir): global goodlist, link_map liblist = otool(['-L', lib]) locallist = [] for l in liblist: l = otool_libname_extract(l) if not l: continue l = l.group(1) l_orig = l if l.startswith("@rpath/"): rpath = get_rpath(lib) if not rpath: print(f"{lib} uses @rpath but has no rpath set!") exit(-1) # all cases of libs using rpath so far just had a single directory in rpath... # so let's just hope it stays that way and worry about the other cases when we get to them if len(rpath) >= 2: print(f"Warning: {lib} uses @rpath with more than one entry in rpath. Guessing one entry...") l = os.path.join(rpath[0], l[len("@rpath/"):]) if l.startswith("@loader_path/"): l = os.path.join(os.path.dirname(lib), l[len("@loader_path/"):]) if is_bad_lib(l): if l not in badlist: badlist.append(l) if l_orig not in badlist_orig: badlist_orig.append(l_orig) 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: basename = os.path.basename(check) target = os.path.join(targetdir, basename) if os.path.islink(target): # If a library was a symlink to a file with the same name in another directory, # this could otherwise cause a FileNotFoundError os.remove(target) 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 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) elif l not in goodlist and l not in masterlist: goodlist.append(l) masterlist.extend(locallist) for l in locallist: collectlibs(l, masterlist, targetdir) 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 badlist_orig: libbase = os.path.basename(lib) if libbase in link_map: print("%s -> @executable_path/%s (REMAPPED)" % (lib, libbase)) libbase = link_map[libbase] else: print("%s -> @executable_path/%s" % (lib, 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] 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.") print() print("All done!") tools/osx-dmg.sh0000775000175000017500000000702514741067256013143 0ustar aniolaniol#!/bin/sh # USAGE: osx-dmg.sh [Bundle Directory] "[Package Name]" # # Amar Takhar # # ------------------------------------------------------------------------------------- # This script is based on osx-dmg.sh from the Inkscape Project http://www.inkscape.org/ # # Jean-Olivier Irisson # Michael Wybrow # # Copyright (C) 2006-2010 # Released under GNU GPL, read the file 'COPYING' from the Inkscape project for more # information. set -e 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 echo 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 "${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 "${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 "${DMG_RW_PATH}" |awk '/GUID_partition_scheme/ {print $1}'` echo "Device name: ${DEV_NAME}" echo echo "---- Setting root icon using SetFile ----" SetFile -a C "/Volumes/${PKG_NAME_VOLUME}" echo if test -n "${SET_STYLE}"; then echo "---- Running AppleScript to set style ----" SCRIPT_TMP=`mktemp /tmp/aegisub_dmg_as.XXX` 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} /usr/bin/osascript ${SCRIPT_TMP}.scpt open "/Volumes/${PKG_NAME_VOLUME}" echo "********************************************************" echo "Please move the window to the center of the screen then" echo "close it." echo "********************************************************" echo echo "PRESS ENTER WHEN DONE" open "/Volumes/${PKG_NAME_VOLUME}" read -e DUMB hdiutil detach "${DEV_NAME}" 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" "${SRC_DIR}/packages/osx_dmg/DS_Store" SetFile -a v "${SRC_DIR}/packages/osx_dmg/DS_Store" hdiutil detach "${DEV_NAME}" rm -rf "${DMG_TMP_DIR}" "${DMG_RW_PATH}" ${SCRIPT_TMP}.scpt ${SCRIPT_TMP} exit 0 else echo "---- Installing DS_Store ----" cp -v "${SRC_DIR}/packages/osx_dmg/DS_Store" "/Volumes/${PKG_NAME_VOLUME}/.DS_Store" fi echo echo "---- Detaching ----" echo /usr/bin/hdiutil detach "${DEV_NAME}" -force /usr/bin/hdiutil detach "${DEV_NAME}" -force echo echo "---- Compressing ----" /usr/bin/hdiutil convert "${DMG_RW_PATH}" -format UDBZ -imagekey bzip2-level=9 -o "${DMG_PATH}" echo "---- Removing temp dmg \"${DMG_RW_PATH}\" ----" rm -rf "${DMG_RW_PATH}" echo echo "Done!" tools/osx-bundle.sh0000775000175000017500000000676214741067256013654 0ustar aniolaniol#!/bin/sh set -e SRC_DIR="${1}" BUILD_DIR="${2}" WX_PREFIX="" FONTCONFIG_CONF_DIR="${4}" DICT_DIR="${5}" MESON_BUILD_OSX_BUNDLE="${6}" 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 echo "---- Directory Structure ----" mkdir -v "${PKG_DIR}" mkdir -v "${PKG_DIR}/Contents" mkdir -v "${PKG_DIR}/Contents/MacOS" mkdir -v "${PKG_DIR}/Contents/Resources" mkdir -v "${PKG_DIR}/Contents/SharedSupport" mkdir -v "${PKG_DIR}/Contents/SharedSupport/dictionaries" echo echo "---- Copying Skel Files ----" if ! test -f "${BUILD_DIR}/osx-bundle.sed"; then echo echo "NOT FOUND: ${BUILD_DIR}/osx-bundle.sed" exit 1 fi # used by osx-bundle.sed 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 -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 "${BUILD_DIR}/languages" echo echo "---- Installing files ----" CURRENT_DIR=`pwd` cd ${BUILD_DIR} ninja install cd ${CURRENT_DIR} echo echo "---- Copying dictionaries ----" if test -f "${DICT_DIR}"; then cp -v "${DICT_DIR}/*" "${PKG_DIR}/Contents/SharedSupport/dictionaries" else mkdir -p "${BUILD_DIR}/dictionaries" if ! test -f "${BUILD_DIR}/dictionaries/en_US.aff"; then echo "Specified dictionary directory ${DICT_DIR} not found. Downloading dictionaries:" curl -L "https://raw.githubusercontent.com/TypesettingTools/Aegisub-dictionaries/master/dicts/en_US.aff" -o "${BUILD_DIR}/dictionaries/en_US.aff" curl -L "https://raw.githubusercontent.com/TypesettingTools/Aegisub-dictionaries/master/dicts/en_US.dic" -o "${BUILD_DIR}/dictionaries/en_US.dic" fi cp -v "${BUILD_DIR}/dictionaries/en_US.aff" "${PKG_DIR}/Contents/SharedSupport/dictionaries" cp -v "${BUILD_DIR}/dictionaries/en_US.dic" "${PKG_DIR}/Contents/SharedSupport/dictionaries" fi echo echo "---- Copying Aegisub locale files ----" # Let Aqua know that aegisub supports english. English strings are # 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" ## 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 python3 "${SRC_DIR}/tools/osx-fix-libs.py" "${PKG_DIR}/Contents/MacOS/aegisub" || exit $? echo echo "Done creating \"${PKG_DIR}\"" tools/apply-manifest.py0000664000175000017500000000043414741067256014526 0ustar aniolaniol#!/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() tools/respack.py0000775000175000017500000000206514741067256013232 0ustar aniolaniol#!/usr/bin/env python3 import sys, 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))) tools/win-installer-setup.ps10000664000175000017500000001073214741067256015600 0ustar aniolaniol#!/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 $GitHeaders = @{} if (Test-Path 'Env:GITHUB_TOKEN') { $GitHeaders = @{ 'Authorization' = 'Bearer ' + $Env:GITHUB_TOKEN } } # DepCtrl 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 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" -Headers $GitHeaders -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" -Headers $GitHeaders -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 if(!$?) { Exit $LASTEXITCODE } meson compile -C build if(!$?) { Exit $LASTEXITCODE } Set-Location $DepsDir } # VC++ redistributable if (!(Test-Path VC_redist)) { $redistDir = New-Item -ItemType Directory VC_redist Invoke-WebRequest https://aka.ms/vs/17/release/VC_redist.x64.exe -OutFile "$redistDir\VC_redist.x64.exe" -UseBasicParsing } # Dictionaries if (!(Test-Path dictionaries)) { New-Item -ItemType Directory dictionaries Invoke-WebRequest https://raw.githubusercontent.com/TypesettingTools/Aegisub-dictionaries/master/dicts/en_US.aff -OutFile dictionaries/en_US.aff -UseBasicParsing Invoke-WebRequest https://raw.githubusercontent.com/TypesettingTools/Aegisub-dictionaries/master/dicts/en_US.dic -OutFile dictionaries/en_US.dic -UseBasicParsing } # Installer localization if (!(Test-Path innosetup-langs)) { New-Item -ItemType Directory innosetup-langs Invoke-WebRequest https://raw.github.com/jrsoftware/issrc/main/Files/Languages/Unofficial/Greek.isl -OutFile innosetup-langs/Greek.isl -UseBasicParsing Invoke-WebRequest https://raw.github.com/jrsoftware/issrc/main/Files/Languages/Unofficial/Basque.isl -OutFile innosetup-langs/Basque.isl -UseBasicParsing Invoke-WebRequest https://raw.github.com/jrsoftware/issrc/main/Files/Languages/Unofficial/Galician.isl -OutFile innosetup-langs/Galician.isl -UseBasicParsing Invoke-WebRequest https://raw.github.com/jrsoftware/issrc/main/Files/Languages/Unofficial/Indonesian.isl -OutFile innosetup-langs/Indonesian.isl -UseBasicParsing Invoke-WebRequest https://raw.github.com/jrsoftware/issrc/main/Files/Languages/Unofficial/SerbianCyrillic.isl -OutFile innosetup-langs/SerbianCyrillic.isl -UseBasicParsing Invoke-WebRequest https://raw.github.com/jrsoftware/issrc/main/Files/Languages/Unofficial/SerbianLatin.isl -OutFile innosetup-langs/SerbianLatin.isl -UseBasicParsing Invoke-WebRequest https://raw.github.com/jrsoftware/issrc/main/Files/Languages/Unofficial/ChineseSimplified.isl -OutFile innosetup-langs/ChineseSimplified.isl -UseBasicParsing Invoke-WebRequest https://raw.github.com/jrsoftware/issrc/main/Files/Languages/Unofficial/ChineseTraditional.isl -OutFile innosetup-langs/ChineseTraditional.isl -UseBasicParsing } # Aegisub localization Set-Location $BuildRoot meson compile aegisub-gmo if(!$?) { Exit $LASTEXITCODE } # Invoke InnoSetup $IssUrl = Join-Path $InstallerDir "aegisub_depctrl.iss" iscc $IssUrl if(!$?) { Exit $LASTEXITCODE }