[LLVMdev] 64bit MRV problem: { float, float, float} -> { double, float }
Ralf Karrenberg
Chareos at gmx.de
Mon Jan 25 04:47:59 PST 2010
Hey Duncan,
Duncan Sands wrote:
> That said, you could imagine that in the bitcode the struct
> would be passed as a struct, rather than double+float, and the code
> generators
> would take care of squirting out the appropriate double+float machine
> code.
> Sadly this is not the case: ABI conformance is handled in the front-end.
Ah, I see.
> The fundamental reason for this is that some ABI's (eg: the x86-64
> one) specify
> how parameters are passed based on type information that is available
> in C
> but not in LLVM. For example, a complex number is passed differently
> to a
> struct containing two floats, even though in LLVM a complex number is
> exactly
> the same as a struct containing two floats. So if the code generators
> were to
> take care of everything, then the entire C type system would somehow
> have to
> be represented in LLVM bitcode, just for this. Instead the decision
> was taken
> to require front-ends to deal with this kind of issue. Yes, this
> sucks - but
> no-one came up with a better solution yet.
Thank's a lot for the detailed explanation.
So I guess there is no way to tell the front-end to break the
ABI-compliance in exactly this point... guess I have to figure out some
other workaround then.
Best,
Ralf
More information about the llvm-dev
mailing list