tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] x86-64 floating point arguments use the wrong registers


From: Phillip McNallen
Subject: [Tinycc-devel] x86-64 floating point arguments use the wrong registers
Date: Sun, 20 Mar 2016 00:40:09 -0500

Hello,

 

Functions with floating point arguments(in x86-64) don’t use the proper calling convention.

Float values should be passed in XMM0 – XMM3

 

double sum(double a, double b)  {

    return (a+b);

}

Generates this:

mov         qword ptr [rbp+10h],rcx 

mov         qword ptr [rbp+18h],rdx 

movq        xmm0,mmword ptr [rbp+10h] 

addsd       xmm0,mmword ptr [rbp+18h] 

 

 

This same function does however leave the result in XMM0 as it should.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]