[Liboil] Simple scalar operations in ORC possible?

Nghia Ho nghiaho12 at yahoo.com
Tue Mar 8 18:58:56 PST 2011

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.

.function add_scalar
.dest 4 dst float
.source 4 src float
.floatparam 4 val
addf dst, src, val

is slower then simply doing something like

for(int i=0; i < N; i++) 
      data[i] += val;

An example of the execution time for 100,000 loops are:

orc: 26.264 ms
normal: 0.47 ms

From: Mattijs Janssens <m.janssens at opencfd.co.uk>
To: liboil at lists.freedesktop.org
Sent: Wed, 9 March, 2011 2:56:36 AM
Subject: Re: [Liboil] Simple scalar operations in ORC possible?

On Tuesday 08 Mar 2011 12:28:32 Nghia Ho wrote:
> Hi,
> I've been trying to figure out how to use ORC to do something simple like
> (pseudo-code):
> data[] = {1,2,3,4,5,6 .....}
> data = data + 10;
> where all the values in data is added by 10. But I can't seem to find any
> obvious opcode that can do this. Is this even possible?

From http://code.entropywave.com/documentation/orc/orc-opcodes.html

followed by 

Liboil mailing list
Liboil at lists.freedesktop.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/liboil/attachments/20110308/978fbd12/attachment.htm>

More information about the Liboil mailing list