[llvm-commits] [llvm] r110576 - in /llvm/trunk: lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/CellSPU/SPUISelLowering.h lib/Target/CellSPU/SPUInstrInfo.td lib/Target/CellSPU/SPUNodes.td lib/Target/CellSPU/SPURegisterInfo.cpp test/CodeGen/CellSP...

Kalle.Raiskila at nokia.com Kalle.Raiskila at nokia.com
Wed Aug 11 04:19:44 PDT 2010


On Tue, 2010-08-10 at 19:12 +0200, Bob Wilson wrote:
> On Aug 10, 2010, at 3:53 AM, Kalle.Raiskila at nokia.com wrote:
> > b) to the best of my understanding, v2i32 has to be legal if it is to be
> > used in return values and function parameters.
> 
> The types of return values and function parameters are also legalized.  If you pass an argument with a non-legal type, it should be promoted or expanded to make it legal.

The problem here was that v2i32 gets expanded to two i32s instead of
promoted to one v4i32. Is it possible to force promotion somehow?


> 
> But, if your target doesn't have any scalar
>  32-bit registers, passing i32 arguments is going to be a pretty
>  "interesting" regardless....

This is indeed the case. SPU's native wordlength is 32, but all general
purpose registers are 4-way vectors (128bit). And all instructions are
SIMD vector instructions. Where i32s are needed (e.g. memory address)
only the first slot of the vector register is used. This is the way i32s
are "emulated" in the SPU backend. And this is how I tried to "emulate"
v2i32s too.

"Interesting", eih? :)


kalle





More information about the llvm-commits mailing list