This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

function arguments


Hi there.

I face a problem about dealing with float-type function arguments.
Assume that an arch has general registers with 32-bit and floating-point
registers with 64-bit.
For example based on MIPS, assuming we write the following code.

float f = 1.23;
printf("%f\n", f);

If we compile this code, a generated assembly code is like:

cvt.d.s $f0,$f0
lui     $2,%hi($LC5)
addiu   $4,$2,%lo($LC5)
mfc1    $6,$f1
mfc1    $5,$f0
jal     printf

this mips assembly looks fp regs as 32-bit, so loading data to argument
regs from fp regs with mfc1. I want to modify them as follows because we
have 32-bit gpr and 64-bit fpr.

cvt.d.s $f0,$f0
lui     $2,%hi($LC5)
addiu   $4,$2,%lo($LC5)
mfc1h   $6,$f0           # upper 32-bit
mfc1    $5,$f0           # lower 32-bit
jal     printf

Is this an issue of move insns? I thought so at first though, now I
think it's an issue of function args.
Which parts of a Machine Discription or Macros/Functions should I modify?

I need your help.

-- 
Shinpei Kato <shinny@j02.itscom.net>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]