Liboil -> Orc
Nicolas Boulay
nicolas.boulay at gmail.com
Fri Mar 5 16:38:14 UTC 2010
C'est la version "inline", il y a aussi une syntaxe d'assembleur plus
classique. Cela force à à avoir une vision "claire" des native_array.
.function orc_add2_rshift_add_s16_22
.dest 2 d1 int16_t
.source 2 s1 int16_t
.source 2 s2 int16_t
.temp 2 t1
addw t1, s1, s2
addw t1, t1, 2
shrsw t1, t1, 2
addw d1, d1, t1
.function orc_add2_rshift_sub_s16_22
.dest 2 d1 int16_t
.source 2 s1 int16_t
.source 2 s2 int16_t
.temp 2 t1
addw t1, s1, s2
addw t1, t1, 2
shrsw t1, t1, 2
subw d1, d1, t1
.function orc_add2_rshift_add_s16_11
.dest 2 d1 int16_t
.source 2 s1 int16_t
.source 2 s2 int16_t
.temp 2 t1
avgsw t1, s1, s2
#addw t1, s1, s2
#addw t1, t1, 1
#shrsw t1, t1, 1
addw d1, d1, t1
.function orc_add_s16
.dest 2 d1 int16_t
.source 2 s1 int16_t
.source 2 s2 int16_t
addw d1, s1, s2
2010/3/5 Pierre-Alexandre Voye <ontologiae at gmail.com>:
> Example of code (from Dirac) using orc :
>
> void
> orc_add2_rshift_add_s16_22_op (int16_t * d1, const int16_t * s1, const
> int16_t * s2, const int16_t * s3, int n)
> {
> OrcExecutor _ex, *ex = &_ex;
> static int p_inited = 0;
> static OrcProgram *p = 0;
>
> if (!p_inited) {
> orc_once_mutex_lock ();
> if (!p_inited) {
> OrcCompileResult result;
>
> p = orc_program_new ();
> orc_program_set_name (p, "orc_add2_rshift_add_s16_22_op");
> orc_program_set_backup_function (p,
> _backup_orc_add2_rshift_add_s16_22_op);
> orc_program_add_destination (p, 2, "d1");
> orc_program_add_source (p, 2, "s1");
> orc_program_add_source (p, 2, "s2");
> orc_program_add_source (p, 2, "s3");
> orc_program_add_constant (p, 2, 2, "c1");
> orc_program_add_constant (p, 2, 2, "c2");
> orc_program_add_temporary (p, 2, "t1");
>
> orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3);
> orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1);
> orc_program_append (p, "shrsw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2);
> orc_program_append (p, "addw", ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1);
>
> result = orc_program_compile (p);
> }
> p_inited = TRUE;
> orc_once_mutex_unlock ();
> }
> ex->program = p;
>
> ex->n = n;
> ex->arrays[ORC_VAR_D1] = d1;
> ex->arrays[ORC_VAR_S1] = (void *)s1;
> ex->arrays[ORC_VAR_S2] = (void *)s2;
> ex->arrays[ORC_VAR_S3] = (void *)s3;
>
> orc_executor_run (ex);
> }
>
> 2010/3/5 Pierre-Alexandre Voye <ontologiae at gmail.com>
>>
>> So orc is an assembler with speciifc language which produce code at
>> compile time, or at runtime for ARM, SSE, MMX, Altivec, etc...:
>> http://www.schleef.org/orc/documentation/orc-concepts.html
>>
>> Its language is a sort of special assembler :
>> http://www.schleef.org/orc/documentation/orc-opcodes.html
>>
>> 2010/3/5 Nicolas Boulay <nicolas.boulay at gmail.com>
>>>
>>> The liboil C library project have change to a generic vectorised
>>> assembler (at runtime or static).
>>>
>>> http://www.schleef.org/blog/category/orc/
>>> http://code.entropywave.com/projects/orc/
>>>
>>> This is more generic than liboil but need more work to generate the
>>> pattern.
>>>
>>> Regards,
>>> Nicolas
>>>
>
>
> --
> ---------------------
> Isaac Project - http://www.lisaac.org/
>
> _______________________________________________
> Lisaac-devel mailing list
> Lisaac-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/lisaac-devel
>
>
More information about the Lisaac-devel
mailing list