[LLVMdev] Header in bitcode format 3.0?

Renato Golin renato.golin at arm.com
Thu May 12 02:24:17 PDT 2011


On 12 May 2011 09:13, Duncan Sands <baldrick at free.fr> wrote:
> I think in that case the front-end is supposed to extract the bits passed in
> registers and pass them as registers (i.e. as float/integer parameters) and
> pass the rest of the struct (i.e. the bit that is passed on the stack) as a
> byval parameter.

That's not what the EABI says.

Chapter 6.1.2 of the AAPCS list the only cases (floating point
literals or homogeneous aggregates) in which it does use the VFP
registers. For all other cases (as per 6.1.2.2), it uses the base
standard.

In AAPCS_VFP mode, the code below returns the structure in {d0, d1}:

typedef struct { double x; double y; } vector;
vector g() {
  vector a = { 1.2, 2.3 };
  return a;
}

the code below return the structure as a pointer:

struct Foo {
  int a;
  double b;
};

struct Foo f() {
  struct Foo f = { 42, 3.14 };
  return f;
}


cheers,
--renato



More information about the llvm-dev mailing list