[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] The inline assembly clobber for floating point regist
From: |
Roy Tam |
Subject: |
Re: [Tinycc-devel] The inline assembly clobber for floating point register stack `%st' not implemented? |
Date: |
Wed, 21 Jan 2015 13:55:06 +0800 |
Hello,
2015-01-21 1:14 GMT+08:00 Sergey Korshunoff <address@hidden>:
> There is patch for the win32/include/math.h which removes "t", "st"
>
I wonder why not just have %t,%st implemented?
I wrote a small hack for that about half year ago.
http://lists.gnu.org/archive/html/tinycc-devel/2014-08/msg00024.html
> 2015-01-20 18:25 GMT+03:00, Sergey Korshunoff <address@hidden>:
>> Because I don't know how to handle a "t" constraint right, a math.h
>> can be rewritten
>> like:
>> long lrint (double x)
>> {
>> long retval;
>> __asm__ __volatile__ (
>> "fldl %1\n"
>> "fistpl %0\n" : "=m" (retval) : "m" (x) );
>> return retval;
>> }
>> insteed of the
>> long lrint (double x)
>> {
>> long retval;
>> __asm__ __volatile__ ("fistpl %0" : "=m" (retval) : "t" (x) : "st");
>> return retval;
>> }
>>
>> 2015-01-20 17:43 GMT+03:00, Sergey Korshunoff <address@hidden>:
>>> 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
>>>
>>
>
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>
- Re: [Tinycc-devel] Is this a duplicate ASM operation?, (continued)
- Re: [Tinycc-devel] Is this a duplicate ASM operation?, Sergey Korshunoff, 2015/01/18
- [Tinycc-devel] The inline assembly clobber for floating point register stack `%st' not implemented?, YX Hao, 2015/01/19
- Re: [Tinycc-devel] The inline assembly clobber for floating point register stack `%st' not implemented?, Sergey Korshunoff, 2015/01/20
- Re: [Tinycc-devel] The inline assembly clobber for floating point register stack `%st' not implemented?, YX Hao, 2015/01/20
- Re: [Tinycc-devel] The inline assembly clobber for floating point register stack `%st' not implemented?, KHMan, 2015/01/20
- Re: [Tinycc-devel] The inline assembly clobber for floating point register stack `%st' not implemented?, Sergey Korshunoff, 2015/01/20
- Re: [Tinycc-devel] The inline assembly clobber for floating point register stack `%st' not implemented?, Sergey Korshunoff, 2015/01/20
- Re: [Tinycc-devel] The inline assembly clobber for floating point register stack `%st' not implemented?, Sergey Korshunoff, 2015/01/20
- Re: [Tinycc-devel] The inline assembly clobber for floating point register stack `%st' not implemented?, Sergey Korshunoff, 2015/01/20
- Re: [Tinycc-devel] The inline assembly clobber for floating point register stack `%st' not implemented?, Sergey Korshunoff, 2015/01/20
- Re: [Tinycc-devel] The inline assembly clobber for floating point register stack `%st' not implemented?,
Roy Tam <=
- Re: [Tinycc-devel] The inline assembly clobber for floating point register stack `%st' not implemented?, Sergey Korshunoff, 2015/01/21
- Re: [Tinycc-devel] The inline assembly clobber for floating point register stack `%st' not implemented?, YX Hao, 2015/01/20