@@ -172,11 +172,16 @@ floating-point register in the ABI. The ISA might have wider
172172floating-point registers than the ABI.
173173
174174For the purposes of this section, "struct" refers to a C struct with its
175- hierarchy flattened, including any array fields. That is, struct ` { struct
175+ hierarchy flattened, including any array fields. That is, ` struct { struct
176176{ float f[ 1] ; } g[ 2] ; }` and ` struct { float f; float g; }` are
177177treated the same. Fields containing empty structs or unions are ignored while
178178flattening, even in C++, unless they have nontrivial copy constructors or
179- destructors.
179+ destructors. Attributes such as ` aligned ` or ` packed ` do not interfere with a
180+ struct's eligibility for being passed in registers according to the rules
181+ below. i.e. ` struct { int i; double d; } ` and `struct
182+ __ attribute__ ((__ packed__ )) { int i; double d }` are treated the same, as are
183+ ` struct { float f; float g; } ` and `struct { float f; float g __ attribute__
184+ ((aligned (8))); }`.
180185
181186A real floating-point argument is passed in a floating-point argument
182187register if it is no more than FLEN bits wide and at least one floating-point
@@ -195,13 +200,13 @@ A complex floating-point number, or a struct containing just one complex
195200floating-point number, is passed as though it were a struct containing two
196201floating-point reals.
197202
198- A struct containing one floating-point real and one integer, in either
199- order, is passed in a floating-point register and an integer register,
200- with the integer zero- or sign-extended as though it were a scalar,
201- provided the floating-point real is no more than FLEN bits wide and the
202- integer is no more than XLEN bits wide, and at least one floating-point
203- argument register and at least one integer argument register is available.
204- Otherwise, it is passed according to the integer calling convention.
203+ A struct containing one floating-point real and one integer (or bitfield) , in
204+ either order, is passed in a floating-point register and an integer register,
205+ with the integer zero- or sign-extended as though it were a scalar, provided
206+ the floating-point real is no more than FLEN bits wide and the integer is no
207+ more than XLEN bits wide, and at least one floating-point argument register
208+ and at least one integer argument register is available. Otherwise, it is
209+ passed according to the integer calling convention.
205210
206211Unions are never flattened and are always passed according to the integer
207212calling convention.
0 commit comments