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: KHMan
Subject: Re: [Tinycc-devel] The inline assembly clobber for floating point register stack `%st' not implemented?
Date: Tue, 20 Jan 2015 19:50:45 +0800
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 1/20/2015 7:39 PM, YX Hao wrote:
This serial of functions in 'math.h' all use "st":
http://en.cppreference.com/w/c/numeric/math/rint
and
http://blogs.msdn.com/b/vcblog/archive/2013/07/19/c99-library-support-in-visual-studio-2013.aspx

----- Original Message ----- From: "Sergey Korshunoff"
Sent: Tuesday, January 20, 2015 4:41 PM

I'm assumed that "st" register can be considered  by tcc as "memory"
specification. This assumption allowed me to build a nimrod compiler
for windows. Not tested if it works.

fistpl pops the stack, so the entire 8087 stack (st) is clobbered.

2015-01-19 14:37 GMT+03:00, YX Hao
Hi,

From: "Sergey Korshunoff"
Sent: Monday, January 19, 2015 1:14 AM


Hi! Another question:  Compiling a nimrod compiler by
i386-win-tcc I
got  the following error:
/usr/local/lib/win32/include/math.h:541: error: invalid clobber
register
'st'


Go into include/math.h:541:

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

__asm__ __volatile__("Instruction List" : Output : Input :
Clobber/Modify);

Guide to Inline Assembly:
http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html

Clobber List:
http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html#ss5.3

st:
http://sourceware.org/binutils/docs-2.25/as/i386_002dRegs.html#i386_002dRegs


Anyone know more abount it?

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia




reply via email to

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