tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] The inline assembly clobber for floating point regist


From: Sergey Korshunoff
Subject: Re: [Tinycc-devel] The inline assembly clobber for floating point register stack `%st' not implemented?
Date: Tue, 20 Jan 2015 17:43:29 +0300

Handling of the "t" spec needs to be improved. I take patch for it
from the this mail list (2014)
tcc don't load a function parameter into the float stack.
There is asm of the gcc and tcc:

long lrint (double x)
{
    long retval;
    __asm__ __volatile__ ("fistpl %0"  : "=m" (retval) : "t" (x) : "st");
      return retval;
}

gcc:
  push   %ebp
  mov    %esp,%ebp
  sub    $0x4,%esp
  fldl      0x8(%ebp)    # !!!
  fistpl  -0x4(%ebp)
  mov   -0x4(%ebp),%eax
  leave
  ret

tcc:
  push   %ebp
  mov    %esp,%ebp
  sub    $0x4,%esp
  fistpl -0x4(%ebp)    # where is fldl ???
  mov  -0x4(%ebp),%eax
  jmp    14 <lrint+0x14>
  leave
  ret



reply via email to

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