# Return values Functions can return values up to 32 bits in size (including structures) in register R0 and up to 64 bits in size (including structures) in the R1:0 register pair. For return values larger than 64 bits, the caller allocates space in its frame large enough to hold the return value. The space is aligned according to the normal alignment rules for the returned type ([Memory alignment](https://docs.qualcomm.com/doc/80-N3040-23/topic/data-types.html#memory-alignment)). The caller passes an extra argument at the beginning of the parameter list (in R0) containing an address of the allocated space. ## Example: typedef struct { int a; int b; int c; } S; S foo(int x) { S s; ... return s; } void bar(int y) { S s = foo(y); } Copy to clipboard This code will be automatically converted by the compiler to the following: void foo(S *hidden, int x) { S s; ... *hidden = s; } void bar(int y) { S s; foo(&s, y); } Copy to clipboard Last Published: Oct 06, 2026 [Previous Topic HVX Calling Conventions for vXi1 Call Operands](https://docs.qualcomm.com/bundle/publicresource/80-N3040-23/topics/parameter-passing.md) [Next Topic Register usage across calls](https://docs.qualcomm.com/bundle/publicresource/80-N3040-23/topics/register-usage-across-calls.md)