Browse Source

Merged revisions 6918-6920 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r6918 | florian | 2007-03-18 18:35:22 +0100 (Sun, 18 Mar 2007) | 2 lines

* fixed assembling of cvt(t)ss2si

........
r6919 | florian | 2007-03-18 21:11:38 +0100 (Sun, 18 Mar 2007) | 2 lines

* test for win64 fixed

........
r6920 | florian | 2007-03-18 21:25:58 +0100 (Sun, 18 Mar 2007) | 2 lines

* reset fpu on win64 as well, certain operations like ln use it

........

git-svn-id: branches/fixes_2_2@6922 -

joost 18 years ago
parent
commit
3fe886c7b2

+ 4 - 4
compiler/i386/i386tab.inc

@@ -7158,14 +7158,14 @@
     opcode  : A_CVTSS2SI;
     opcode  : A_CVTSS2SI;
     ops     : 2;
     ops     : 2;
     optypes : (ot_reg32 or ot_bits64,ot_memory,ot_none);
     optypes : (ot_reg32 or ot_bits64,ot_memory,ot_none);
-    code    : #193#219#208#2#15#45#72;
+    code    : #219#193#208#2#15#45#72;
     flags   : if_katmai or if_sse
     flags   : if_katmai or if_sse
   ),
   ),
   (
   (
     opcode  : A_CVTSS2SI;
     opcode  : A_CVTSS2SI;
     ops     : 2;
     ops     : 2;
     optypes : (ot_reg32 or ot_bits64,ot_xmmreg,ot_none);
     optypes : (ot_reg32 or ot_bits64,ot_xmmreg,ot_none);
-    code    : #211#219#208#2#15#45#72;
+    code    : #219#211#208#2#15#45#72;
     flags   : if_katmai or if_sse
     flags   : if_katmai or if_sse
   ),
   ),
   (
   (
@@ -7186,14 +7186,14 @@
     opcode  : A_CVTTSS2SI;
     opcode  : A_CVTTSS2SI;
     ops     : 2;
     ops     : 2;
     optypes : (ot_reg32 or ot_bits64,ot_memory,ot_none);
     optypes : (ot_reg32 or ot_bits64,ot_memory,ot_none);
-    code    : #193#219#208#2#15#44#72;
+    code    : #219#193#208#2#15#44#72;
     flags   : if_katmai or if_sse
     flags   : if_katmai or if_sse
   ),
   ),
   (
   (
     opcode  : A_CVTTSS2SI;
     opcode  : A_CVTTSS2SI;
     ops     : 2;
     ops     : 2;
     optypes : (ot_reg32 or ot_bits64,ot_xmmreg,ot_none);
     optypes : (ot_reg32 or ot_bits64,ot_xmmreg,ot_none);
-    code    : #211#219#208#2#15#44#72;
+    code    : #219#211#208#2#15#44#72;
     flags   : if_katmai or if_sse
     flags   : if_katmai or if_sse
   ),
   ),
   (
   (

+ 2 - 2
compiler/x86/aasmcpu.pas

@@ -2176,11 +2176,11 @@ implementation
               end;
               end;
             219 :
             219 :
               begin
               begin
+                bytes[0]:=$f3;
+                objdata.writebytes(bytes,1);
 {$ifdef x86_64}
 {$ifdef x86_64}
                 maybewriterex;
                 maybewriterex;
 {$endif x86_64}
 {$endif x86_64}
-                bytes[0]:=$f3;
-                objdata.writebytes(bytes,1);
               end;
               end;
             220 :
             220 :
               begin
               begin

+ 4 - 4
compiler/x86/x86ins.dat

@@ -2302,8 +2302,8 @@ xmmreg,reg32|64       \323\333\321\2\x0F\x2A\110      KATMAI,SSE
 
 
 [CVTSS2SI]
 [CVTSS2SI]
 (Ch_Wop2, Ch_Rop1, Ch_None)
 (Ch_Wop2, Ch_Rop1, Ch_None)
-reg32|64,mem          \301\333\320\2\x0F\x2D\110      KATMAI,SSE
-reg32|64,xmmreg       \323\333\320\2\x0F\x2D\110      KATMAI,SSE
+reg32|64,mem          \333\301\320\2\x0F\x2D\110      KATMAI,SSE
+reg32|64,xmmreg       \333\323\320\2\x0F\x2D\110      KATMAI,SSE
 
 
 [CVTTPS2PI]
 [CVTTPS2PI]
 (Ch_Wop2, Ch_Rop1, Ch_None)
 (Ch_Wop2, Ch_Rop1, Ch_None)
@@ -2312,8 +2312,8 @@ mmxreg,xmmreg         \323\331\2\x0F\x2C\110          KATMAI,SSE,MMX
 
 
 [CVTTSS2SI]
 [CVTTSS2SI]
 (Ch_Wop2, Ch_Rop1, Ch_None)
 (Ch_Wop2, Ch_Rop1, Ch_None)
-reg32|64,mem          \301\333\320\2\x0F\x2C\110      KATMAI,SSE
-reg32|64,xmmreg       \323\333\320\2\x0F\x2C\110      KATMAI,SSE
+reg32|64,mem          \333\301\320\2\x0F\x2C\110      KATMAI,SSE
+reg32|64,xmmreg       \333\323\320\2\x0F\x2C\110      KATMAI,SSE
 
 
 [DIVPS]
 [DIVPS]
 (Ch_Mop2, Ch_Rop1, Ch_None)
 (Ch_Mop2, Ch_Rop1, Ch_None)

+ 4 - 4
compiler/x86_64/x8664tab.inc

@@ -7116,14 +7116,14 @@
     opcode  : A_CVTSS2SI;
     opcode  : A_CVTSS2SI;
     ops     : 2;
     ops     : 2;
     optypes : (ot_reg32 or ot_bits64,ot_memory,ot_none);
     optypes : (ot_reg32 or ot_bits64,ot_memory,ot_none);
-    code    : #193#219#208#2#15#45#72;
+    code    : #219#193#208#2#15#45#72;
     flags   : if_katmai or if_sse
     flags   : if_katmai or if_sse
   ),
   ),
   (
   (
     opcode  : A_CVTSS2SI;
     opcode  : A_CVTSS2SI;
     ops     : 2;
     ops     : 2;
     optypes : (ot_reg32 or ot_bits64,ot_xmmreg,ot_none);
     optypes : (ot_reg32 or ot_bits64,ot_xmmreg,ot_none);
-    code    : #211#219#208#2#15#45#72;
+    code    : #219#211#208#2#15#45#72;
     flags   : if_katmai or if_sse
     flags   : if_katmai or if_sse
   ),
   ),
   (
   (
@@ -7144,14 +7144,14 @@
     opcode  : A_CVTTSS2SI;
     opcode  : A_CVTTSS2SI;
     ops     : 2;
     ops     : 2;
     optypes : (ot_reg32 or ot_bits64,ot_memory,ot_none);
     optypes : (ot_reg32 or ot_bits64,ot_memory,ot_none);
-    code    : #193#219#208#2#15#44#72;
+    code    : #219#193#208#2#15#44#72;
     flags   : if_katmai or if_sse
     flags   : if_katmai or if_sse
   ),
   ),
   (
   (
     opcode  : A_CVTTSS2SI;
     opcode  : A_CVTTSS2SI;
     ops     : 2;
     ops     : 2;
     optypes : (ot_reg32 or ot_bits64,ot_xmmreg,ot_none);
     optypes : (ot_reg32 or ot_bits64,ot_xmmreg,ot_none);
-    code    : #211#219#208#2#15#44#72;
+    code    : #219#211#208#2#15#44#72;
     flags   : if_katmai or if_sse
     flags   : if_katmai or if_sse
   ),
   ),
   (
   (

+ 3 - 2
rtl/x86_64/x86_64.inc

@@ -595,11 +595,12 @@ const
 Procedure SysResetFPU;
 Procedure SysResetFPU;
 begin
 begin
   asm
   asm
-{$ifndef WIN64}
+{ Win64 uses the fpu for ln etc. so we've to reset it as well
+  $ifndef WIN64}
     { initialize fpu }
     { initialize fpu }
     fninit
     fninit
     fwait
     fwait
-{$endif WIN64}
+{ $endif WIN64}
 {$ifdef FPC_PIC}
 {$ifdef FPC_PIC}
     movq fpucw@GOTPCREL(%rip),%rax
     movq fpucw@GOTPCREL(%rip),%rax
     fldcw (%rax)
     fldcw (%rax)

+ 1 - 1
tests/tbs/tb0281.pp

@@ -1,7 +1,7 @@
 { Old file: tbs0333.pp }
 { Old file: tbs0333.pp }
 {  }
 {  }
 
 
-{$if not(defined(CPUI386)) and not(defined(CPUX86_64))}
+{$if (not(defined(CPUI386)) and not(defined(CPUX86_64))) or defined(FPC_COMP_IS_INT64)}
   {$define COMP_IS_INT64}
   {$define COMP_IS_INT64}
 {$endif}
 {$endif}