04.01.2015 Views

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Compiler-specific Features<br />

4.1.18 __value_in_regs<br />

The __value_in_regs qualifier instructs the compiler to return a structure of up to four<br />

integer words in integer registers or up to four floats or doubles in floating-point<br />

registers rather than using memory.<br />

__value_in_regs is a function qualifier. It affects the type of a function.<br />

Syntax<br />

__value_in_regs return-type function-name([argument-list]);<br />

Where:<br />

return-type<br />

is the type of a structure of up to four words in size.<br />

Usage<br />

Declaring a function __value_in_regs can be useful when calling functions that return<br />

more than one result.<br />

Restrictions<br />

A C++ function cannot return a __value_in_regs structure if the structure requires copy<br />

constructing.<br />

If a virtual function declared as __value_in_regs is to be overridden, the overriding<br />

function must also be declared as __value_in_regs. If the functions do not match, the<br />

compiler generates an error.<br />

Errors<br />

Where the structure returned in a function qualified by __value_in_regs is too big, a<br />

warning is produced and the __value_in_regs structure is then ignored.<br />

Example<br />

typedef struct int64_struct<br />

{<br />

unsigned int lo;<br />

unsigned int hi;<br />

} int64_struct;<br />

__value_in_regs extern<br />

int64_struct mul64(unsigned a, unsigned b);<br />

4-20 Copyright © 2007-2010 <strong>ARM</strong>. All rights reserved. <strong>ARM</strong> DUI 0348C<br />

Non-Confidential,<br />

ID101213

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!