<HTML><BODY><div>Hi!</div><div>Thanks for the fixes!</div><div>LGTM</div><div> </div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;"><div><br>> >>+-- Those `rn` variables before and after `main_payload` are<br>> >>+-- required to generate enough register pressure (for GPR). Amount<br>> >>+-- of repeats is empirical.<br>> >>+-- Additional `test_f(...)` wrapper is needed for IR_VLOAD usage,<br>> >>+-- when `main_payload` is just `...`.<br>> >>+local function generate_payload(n_fillers, main_payload)<br>> >>+ local code_chunk = 'local function test_f(...)\n'<br>> >>+ code_chunk = code_chunk .. 'local r\n'<br>> >>+ for i = 1, n_fillers do<br>> >>+ code_chunk = code_chunk .. ('local rup%d\n'):format(i)<br>> >>+ end<br>> >>+ code_chunk = code_chunk .. 'for _ = 1, 4 do\n'<br>> >>+ for i = 1, n_fillers do<br>> >>+ code_chunk = code_chunk ..<br>> >>+ ('local r%d = ffi.cast("int", %d)\n'):format(i, i)<br>> >>+ end<br>> >>+ code_chunk = code_chunk .. 'r = ' .. main_payload .. '\n'<br>> >>+ for i = 1, n_fillers do<br>> >>+ code_chunk = code_chunk .. ('rup%d = r%d\n'):format(i, i)<br>> >>+ end<br>> >>+ code_chunk = code_chunk .. 'end\nend\n'<br>> >>+ code_chunk = code_chunk .. 'return test_f'<br>> >>+ local f, err = loadstring(code_chunk, 'test_function')<br>> >>+ assert(type(f) == 'function', err)<br>> >>+ f = f()<br>> >>+ assert(type(f) == 'function', 'returned generated value is not a function')<br>> >>+ return f<br>> >>+end<br>> >That section is really hard to read, is there any way to make it more<br>> >readable? I believe even slight reformatting might help.<br><br>I've add the additional empty lines to separate cycle's body<br>generation.<br>Does it help?</div></blockquote><div>Yes, that is way better, thanks.</div><div><div>--<br>Best regards,</div><div>Maxim Kokryashkin</div></div><div> </div></BODY></HTML>