[LLVMdev] avoid live range overlap of "vector" registers

Tzu-Chien Chiu tzuchien.chiu at gmail.com
Tue May 10 19:25:11 PDT 2005


On  Tue May 10 2005, Chris Lattner wrote:
>On Tue, 10 May 2005, Morten Ofstad wrote:
>> Actually, I think it would be better to define the registers as a machine 
>> value type for packed float x4, and providing some 'extract' and 'inject' 
>> instructions to access individual components... There should also be a 
>> 'shuffle' instruction (corresponding to the SSE PSHUF instruction) to change 
>> the individual components around.
>
>You're right, that would be a better way to go.  To start, I would suggest 
>adding extract/inject intrinsics (not instructions) because it is easier. 
>If you're interested in doing this, there is documentation for this here:

quote <http://llvm.cs.uiuc.edu/docs/LangRef.html#intrinsics>:
"To do this, extend the default implementation of the
IntrinsicLowering class to handle the intrinsic. Code generators use
this class to lower intrinsics they do not understand to raw LLVM
instructions that they do."

but to which llvm instructions should the extract/inject (or
shuffle/pack) intrinsics be lowered? llvm instruction does not allow
to access the individual scalar value in a packed value.




More information about the llvm-dev mailing list