3.75 Complex
★
ISO C99 includes extensions to support complex numbers. Any floating-point type can be modified with the keyword complex
. Here are some sample functions that work with complex data and that call some of the associated library functions:
When compiled, GCC generates the following assembly code for these functions:
Based on these examples, determine the following:
A. How are complex arguments passed to a function?
param # | real part | img part |
1 | %xmm0 | %xmm1 |
2 | %xmm2 | %xmm3 |
3 | %xmm4 | %xmm5 |
B. How are complex values returned from a function?
return %xmm0 as real part, %xmm1 as img part.
Last updated