[LLVMdev] [Discussion] Portable SIMD programming using LLVM?
baldrick at free.fr
Fri Apr 1 02:30:05 PDT 2011
> Almost modern processor families support SIMD instruction sets but the
> instruction set designs for each platform have different combinations of
> operations. The portable SIMD here is to make an uniform system of SIMD
> operations at all power-of-2 field widths.
> For example, for simd_add on SSE2, I want to have all the following operations
> supported, simd<2^x>::add(a, b) for 2<=2^x<=register_size(register_size equals
> 128 in SSE2). However, SSE2 only supports simd_add on field widths of 8, 16, 32,
> or 64. Hence, simulation for simd_add on field widths of 2, 4 and 128 is needed.
> *At mean time, I want the simulation to be as good as possible*.
LLVM already does this: if you use a vector type that is not natively supported
then operations on it are simulated using either vector operations in another
vector type or scalar operations if no suitable vector type exists.
More information about the llvm-dev