ORC – The Oil Runtime Compiler
(and OIL stands for Optimized Inner Loops)
Orc is a just-in-time compiler implemented as a library and set of associated tools for compiling and executing simple programs that operate on arrays of data. Orc is unlike other general-purpose JIT engines: the Orc bytecode and language is designed so that it can be readily converted into SIMD instructions. This translates to interesting language features and limitations: Orc has built-in capability for SIMD-friendly operations such as shuffling, saturated addition and subtraction, but only works on arrays of data. This makes Orc good for applications such as image processing, audio processing, array math, and signal analysis.
The Orc language is an assembly-like language, where the programmer specifies the operations to be done on each element of one or several arrays. The Orc tools then convert this into an intermediate form (as C source code) that includes the bytecode, functions for automatically calling the compiled bytecode from C, and backup functions (in C) that are used when Orc is not available or unable to compile the bytecode into efficient SIMD code. Orc generates code optimized for the specific processor that is running, using instruction sets that are available.
Since Orc creates backup functions, you can optionally use many Orc-using libraries and applications without actually having the Orc library — this is useful for transitioning an application into using Orc. However, when Orc is disabled, the application is unable to use the SIMD code generated by Orc.
Orc’s most unique feature is that a program can generate Orc bytecode at runtime and it will be compiled into efficient SIMD code. For example, in a program that composes am image from two source images, instead of having a large number of functions that handle every combination of image type and composing operation, the Orc bytecode can be generated at runtime to read from the source images, compose, and write to the final image. (This is humorously referred to as Grand Unification by the author.)
Orc is currently in a API and ABI stable release series (0.4). An API/ABI break is anticipated to coincide with the release of GStreamer 1.0.
Binaries for Orc are part of the GStreamer SDK.