<div class="gmail_quote">2009/8/27 David Schleef <span dir="ltr"><<a href="mailto:ds@entropywave.com">ds@entropywave.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wed, Aug 26, 2009 at 08:43:59PM +0800, cee1 wrote:<br>
> ORC concerns how to define a higher level assembly code and translate it to<br>
> native assembly code for each architecture. (dave, am I right ?)<br>
<br>
</div>That's about 10% of what Orc does. Orc, plus a .orc file to<br>
describe liboil functions, is a complete replacement for liboil.<br>
(Er, sort of. Orc can't create code for about 10% of liboil<br>
functions.)<br>
<div class="im"><br>
> ORC can also be thought as something in the toolchain. A "complier" (ORC)<br>
> plus a "test tool" (oil), I don't think there is any overlap between ORC and<br>
> oil.<br>
<br>
</div>Orc has testing built in. Not only does the Orc test suite create<br>
a bunch of functions, execute them, and compare the results to<br>
reference functions (similar to liboil), the command-line parser<br>
(orcc) will also create a test program for a developer to put in<br>
their own test suite to do the same level of testing on any function<br>
he/she writes. And if you want to be overly careful and do all<br>
the tests at runtime, you can do that, too.<br>
<br>
The only major feature of liboil that is missing from Orc is speed<br>
testing. In Orc, speed testing is only a minor feature, since<br>
it's only relevant when hacking on the code generator. And my<br>
manual tests indicate that the generated code is so fast that the<br>
code generator is not a concern. There are more interesting<br>
low-hanging fruit.<br>
<br>
Even in the new Orc world, there is a place for something like<br>
liboil, for those cases where people still need some hand-crafted<br>
assembly. Keep in mind that simple hand-crafted assembly can be<br>
accomplished using user-defined Orc opcodes. For those cases<br>
where you really need to write 100's of lines of assembly, the<br>
tools in liboil are extremely useful. But forking is unlikely to<br>
be the answer -- the correct answer is likely to export a few<br>
internal functions in the API and build tools around that.<br>
<br>
Liboil is now in desperate need of an ABI bump and thorough cleaning<br>
to remove any functions that can be done with Orc, under the<br>
assumption that the remaining bits of liboil would have any value.<br>
I have very little interest in doing this. So a lot of the things<br>
you want to do are welcome in mainline liboil. And if there's an<br>
ABI bump, things like splitting the library into parts could be<br>
acceptable as well.<br>
<br>
<br>
<br>
dave...<br>
<br>
</blockquote></div>Hi dave,<div>Thanks for the explanation.</div><div><br></div><div>Some thoughts:</div><div>1) liboil and oil defines a model: a public function symbol which is bound to one of a series implements. Orc will generate only one proper implement for such a function symbol(again, am I right?). This applies well to the case of inline assembly optimization, but what if approximation algorithm optimization? I think we still need the model of one public function symbol, multiple implements.</div>
<div><br></div><div>2) Does Orc perform runtime test like liboil? Sometimes, developers may want to customize the process of testing, e.g. embed oprofile to do performance analysis. So extension-friendly APIs make sense, but performing runtime test will a) may not be accurate. b) either pull too many dependencies. c) or have some duplicate code to implement some features(e.g. OilString in liboil and GString in glib)</div>
<div><br></div><div>3) How to generate code in runtime? fork a process and exec "as"?</div><div><br></div><div>Regards,</div><div>cee1</div>