[LLVMdev] Vector code

Chris Lattner sabre at nondot.org
Thu May 8 11:13:01 PDT 2008


On Thu, 8 May 2008, Nicolas Capens wrote:
> Thanks for the advise, but I'm actually not trying to compile code from
> text. For now I'm just trying to construct the function directly. Think of
> it as the vector equivalent of the HowToUseJIT.cpp example.

There is a one to one mapping between text and IR.  If you understand what 
to generate it is much easier to generate it.  Otherwise, if you have a 
specific question, we can help answer that.

-Chris

> -----Original Message-----
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
> Behalf Of Chris Lattner
> Sent: Thursday, 08 May, 2008 19:14
> To: LLVM Developers Mailing List
> Subject: Re: [LLVMdev] Vector code
>
> On Thu, 8 May 2008, Nicolas Capens wrote:
>> I'm trying to use LLVM to generate SIMD code at runtime (in particular
> Intel
>> SSE). But I'm having a bit of trouble understanding how to create even the
>> simplest function; adding two vectors of four single-precision
>> floating-point elements. I can get it to add the elements one at a time
> but
>> not using one vector instruction.
>
> I'd suggest writing code in C and seeing what llvm-gcc does with it.
> You can also look at (for example) llvm/test/CodeGen/X86/*.ll for many
> examples.
>
> -Chris
>
>

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list