<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Thanks for that. I've been playing around with it a bit and noticed some possible short comings, probably due to my lack of knowledge. It seems every time you call the orc generated function there is some overheard that makes it perform no better than straight C code for simple stuff. Like for example this function that adds a scalar value to an array of float.<br><br>.function add_scalar<br>.dest 4 dst float<br>.source 4 src float<br>.floatparam 4 val<br>addf dst, src, val<br><br>is slower then simply doing something like<br><br>for(int i=0; i < N; i++) <br> data[i] += val;<br><br>An example of the execution time for 100,000 loops are:<br><br>orc: 26.264 ms<br>normal: 0.47 ms<br></div><div style="font-family: times new roman,new york,times,serif; font-size:
12pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Mattijs Janssens <m.janssens@opencfd.co.uk><br><b><span style="font-weight: bold;">To:</span></b> liboil@lists.freedesktop.org<br><b><span style="font-weight: bold;">Sent:</span></b> Wed, 9 March, 2011 2:56:36 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Liboil] Simple scalar operations in ORC possible?<br></font><br>On Tuesday 08 Mar 2011 12:28:32 Nghia Ho wrote:<br>> Hi,<br>> <br>> I've been trying to figure out how to use ORC to do something simple like<br>> (pseudo-code):<br>> <br>> data[] = {1,2,3,4,5,6 .....}<br>> data = data + 10;<br>> <br>> where all the values in data is added by 10. But I can't seem to find any<br>> obvious opcode that can do this. Is this even possible?<br><br>From <a
href="http://code.entropywave.com/documentation/orc/orc-opcodes.html" target="_blank">http://code.entropywave.com/documentation/orc/orc-opcodes.html</a><br><br> loadpl<br>followed by <br> addl<br>?<br><br>Mattijs<br>_______________________________________________<br>Liboil mailing list<br><a ymailto="mailto:Liboil@lists.freedesktop.org" href="mailto:Liboil@lists.freedesktop.org">Liboil@lists.freedesktop.org</a><br><a href="http://lists.freedesktop.org/mailman/listinfo/liboil" target="_blank">http://lists.freedesktop.org/mailman/listinfo/liboil</a><br></div></div>
</div><br>
</body></html>