Re: Can a C function return TWO integers in registers on MIPS?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pan ruochen wrote:
Hi All,

I'm writing code in C language for MIPS execption handler.
There is a function which returns two integers. For optimizing
the performance, I want gcc to generate code where these two integers
are returned in registers v0 & v1, instead of in memory.
Can gcc do this?


For the n32 and n64 ABIs, structures that fit in 16 bytes or less are returned in V0 and V1 (or f0 and f2 if the struct contains only two floating point elements).

For o32 all structs are returned in memory allocated by the caller.

As the other poster mentioned, there are GCC options that change the ABI that might help you, but you must be careful as the code will not interact well with ABI conforming code.

David Daney


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux