OilFunctionImpl

OilFunctionImpl — Functions for manipulating function implementations.

Functions

Types and Values

Description

Functions

oil_impl_get_by_index ()

OilFunctionImpl *
oil_impl_get_by_index (int i);

Returns a pointer to the function implementation with index i .

Parameters

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.

Parameters

impl

an OilFunctionImpl

 

Returns

1 if the implementation can be executed, otherwise 0


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.

Parameters

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().

Parameters

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().

Parameters

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().

Parameters

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().

Parameters

function

name of function

 

klass

name of class to declare (without oil_ prefix)

 

...

other classes this implementation uses

 

Types and Values

OilFunctionImpl

typedef struct {
} OilFunctionImpl;

An opaque structure representing a function implementation.


enum OilImplFlag

Implementation flags.

OIL_IMPL_FLAG_REF : is the reference implementation for the class.

OIL_IMPL_FLAG_OPT : was compiled with alternate CFLAGS as specified by --enable-alternate-optimization.

OIL_IMPL_FLAG_ASM : is written in assembly code.

OIL_IMPL_FLAG_DISABLED : is disabled. This can be set either in the source code or during library initialization.

OIL_IMPL_FLAG_CMOV : uses the i386 instruction cmov or its variants.

OIL_IMPL_FLAG_MMX : uses MMX instructions.

OIL_IMPL_FLAG_SSE : uses SSE instructions.

OIL_IMPL_FLAG_MMXEXT : uses AMD's extended MMX instructions. These are a subset of what Intel calls SSE2. If an implementation uses only AMD's extended MMX instructions, it should set this flag, and not OIL_IMPL_FLAG_SSE2 .

OIL_IMPL_FLAG_SSE2 : uses SSE2 instructions. This flag implies OIL_IMPL_FLAG_SSE and OIL_IMPL_FLAG_MMXEXT .

OIL_IMPL_FLAG_3DNOW : uses 3DNow! instructions.

OIL_IMPL_FLAG_3DNOWEXT : uses extended 3DNow! instructions.

OIL_IMPL_FLAG_SSE3 : uses SSE3 instructions. This flag implies OIL_IMPL_FLAG_SSE2 .

OIL_IMPL_FLAG_SSSE3 : uses SSSE3 instructions. This flag implies OIL_IMPL_FLAG_SSE3 .

OIL_IMPL_FLAG_ALTIVEC : uses Altivec instructions.

Members

OIL_IMPL_FLAG_REF

   

OIL_IMPL_FLAG_OPT

   

OIL_IMPL_FLAG_ASM

   

OIL_IMPL_FLAG_DISABLED

   

OIL_IMPL_FLAG_CMOV

   

OIL_IMPL_FLAG_MMX

   

OIL_IMPL_FLAG_SSE

   

OIL_IMPL_FLAG_MMXEXT

   

OIL_IMPL_FLAG_SSE2

   

OIL_IMPL_FLAG_3DNOW

   

OIL_IMPL_FLAG_3DNOWEXT

   

OIL_IMPL_FLAG_SSE3

   

OIL_IMPL_FLAG_ALTIVEC

   

OIL_IMPL_FLAG_EDSP

   

OIL_IMPL_FLAG_ARM6

   

OIL_IMPL_FLAG_VFP

   

OIL_IMPL_FLAG_SSSE3

   

OIL_CPU_FLAG_MASK

#define OIL_CPU_FLAG_MASK 0xffff0000

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