OilFunctionImpl

OilFunctionImpl — Functions for manipulating function implementations.

Synopsis




            OilFunctionImpl;
OilFunctionImpl* oil_impl_get_by_index      (int i);
int         oil_impl_is_runnable            (OilFunctionImpl *impl);
enum        OilImplFlag;
enum        OilImplFlagI386;
enum        OilImplFlagPowerPC;
#define     OIL_CPU_FLAG_MASK
#define     OIL_DEFINE_IMPL_FULL            (function,klass,flags)
#define     OIL_DEFINE_IMPL                 (function,klass)
#define     OIL_DEFINE_IMPL_REF             (function,klass)
#define     OIL_DEFINE_IMPL_ASM             (function,klass)
#define     OIL_DEFINE_IMPL_DEPENDS         (function,klass,...)

Description

Details

OilFunctionImpl

typedef struct {
} OilFunctionImpl;

An opaque structure representing a function implementation.


oil_impl_get_by_index ()

OilFunctionImpl* oil_impl_get_by_index      (int i);

Returns a pointer to the function implementation with index i.

i : index
Returns : a pointer to a function implementation structure

oil_impl_is_runnable ()

int         oil_impl_is_runnable            (OilFunctionImpl *impl);

Determines whether the function implementation given by impl can be executed by the current CPU.

impl : an OilFunctionImpl
Returns : 1 if the implementation can be executed, otherwise 0

enum OilImplFlag

typedef enum {
  OIL_IMPL_FLAG_REF = (1<<0),
  OIL_IMPL_FLAG_OPT = (1<<1),
  OIL_IMPL_FLAG_ASM = (1<<2),
  OIL_IMPL_FLAG_DISABLED = (1<<3)
} OilImplFlag;

Implementation flags independent of CPU type.


enum OilImplFlagI386

typedef enum {
  OIL_IMPL_FLAG_CMOV = (1<<16),
  OIL_IMPL_FLAG_MMX = (1<<17),
  OIL_IMPL_FLAG_SSE = (1<<18),
  OIL_IMPL_FLAG_MMXEXT = (1<<19),
  OIL_IMPL_FLAG_SSE2 = (1<<20),
  OIL_IMPL_FLAG_3DNOW = (1<<21),
  OIL_IMPL_FLAG_3DNOWEXT = (1<<22),
  OIL_IMPL_FLAG_SSE3 = (1<<23)
} OilImplFlagI386;

Implementation flags for CPU features on i386.


enum OilImplFlagPowerPC

typedef enum {
  OIL_IMPL_FLAG_ALTIVEC = (1<<16)
} OilImplFlagPowerPC;

Implementation flags for CPU features on PowerPC.


OIL_CPU_FLAG_MASK

#define OIL_CPU_FLAG_MASK 0xffff0000

Mask describing which bits in OilImplFlag depend on the current CPU.


OIL_DEFINE_IMPL_FULL()

#define     OIL_DEFINE_IMPL_FULL(function,klass,flags)

Defines a OilFunctionImpl structure for the function function and class klass. CPU-dependent flags in flags will indicate that this implementation requires the given CPU flags.

function : name of function
klass : name of class to declare (without oil_ prefix)
flags : implementation flags and CPU requirements

OIL_DEFINE_IMPL()

#define     OIL_DEFINE_IMPL(function,klass)

Shorthand for defining a C implementation. See OIL_DEFINE_IMPL_FULL().

function : name of function
klass : name of class to declare (without oil_ prefix)

OIL_DEFINE_IMPL_REF()

#define     OIL_DEFINE_IMPL_REF(function,klass)

Shorthand for defining a reference implementation. See OIL_DEFINE_IMPL_FULL().

function : name of function
klass : name of class to declare (without oil_ prefix)

OIL_DEFINE_IMPL_ASM()

#define     OIL_DEFINE_IMPL_ASM(function,klass)

Shorthand for defining an implementation written in inline assembly code. See OIL_DEFINE_IMPL_FULL().

function : name of function
klass : name of class to declare (without oil_ prefix)

OIL_DEFINE_IMPL_DEPENDS()

#define     OIL_DEFINE_IMPL_DEPENDS(function,klass,...)

Shorthand for defining an implementation that uses another Liboil function class. This is not currently used. See OIL_DEFINE_IMPL_FULL().

function : name of function
klass : name of class to declare (without oil_ prefix)
... : other classes this implementation uses