diff options
author | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2012-11-04 16:27:29 +0000 |
---|---|---|
committer | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2012-11-04 16:27:29 +0000 |
commit | f3f725708f79ac307751566dec29cc2cf2cc8ab4 (patch) | |
tree | 6329ae9a4dac944ed576346dd8299cd893f6101f /rtl/x86_64 | |
parent | 9667e2fc91e9ef95ee2fbf9c2612293d18674d32 (diff) | |
download | fpc-f3f725708f79ac307751566dec29cc2cf2cc8ab4.tar.gz |
* fix sincos for x86-64 windows resolves #23268
* changed to intel assembler to be more readble
* test for sincos extended
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@22925 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'rtl/x86_64')
-rw-r--r-- | rtl/x86_64/mathu.inc | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/rtl/x86_64/mathu.inc b/rtl/x86_64/mathu.inc index 4aff373de8..13b970b2d1 100644 --- a/rtl/x86_64/mathu.inc +++ b/rtl/x86_64/mathu.inc @@ -33,8 +33,8 @@ asm fldt theta fsincos {$ifdef WIN64} - fstpt (%r8) - fstpt (%rdx) + fstpl (%r8) + fstpl (%rdx) {$else WIN64} fstpt (%rsi) fstpt (%rdi) @@ -44,20 +44,16 @@ asm {$endif FPC_HAS_TYPE_EXTENDED} +{$asmmode intel} procedure sincos(theta : double;out sinus,cosinus : double);assembler; var t : double; asm - movd %xmm0,t - fldl t + movsd qword ptr t,xmm0 + fld qword ptr t fsincos -{$ifdef WIN64} - fstpl (%r8) - fstpl (%rdx) -{$else WIN64} - fstpl (%rsi) - fstpl (%rdi) -{$endif WIN64} + fstp qword ptr [cosinus] + fstp qword ptr [sinus] fwait end; @@ -66,20 +62,16 @@ procedure sincos(theta : single;out sinus,cosinus : single);assembler; var t : single; asm - movss %xmm0,t - flds t + movsd dword ptr t,xmm0 + fld dword ptr t fsincos -{$ifdef WIN64} - fstps (%r8) - fstps (%rdx) -{$else WIN64} - fstps (%rsi) - fstps (%rdi) -{$endif WIN64} + fstp dword ptr [cosinus] + fstp dword ptr [sinus] fwait end; +{$asmmode gas} function GetRoundMode: TFPURoundingMode; begin {$ifndef FPC_HAS_TYPE_EXTENDED} |