[Liboil] Simple scalar operations in ORC possible?

jcupitt at gmail.com jcupitt at gmail.com
Tue Mar 8 08:54:09 PST 2011


On 8 March 2011 15:56, Mattijs Janssens <m.janssens at opencfd.co.uk> wrote:
>> 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
>
>        loadpl
> followed by
>        addl
> ?

Actually, you don't need to load, you can just add directly.

// make a byte constant with the value 10
orc_program_add_constant (program, 1, 10, "tenb");

// in the loop, add to data
orc_program_append_str (program, "addssb", "data", "data", "tenb");

John


More information about the Liboil mailing list