瀏覽代碼

Merged revisions 10826,10829 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r10826 | yury | 2008-04-27 23:47:52 +0300 (Вс, 27 апр 2008) | 1 line

* Fixed loading of single floating point values from memory to register for ARM hardfloat.
........
r10829 | yury | 2008-04-28 00:03:57 +0300 (Пн, 28 апр 2008) | 1 line

* Adjust precision checks for arm.
........

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

yury 17 年之前
父節點
當前提交
3453fb6256
共有 2 個文件被更改,包括 5 次插入3 次删除
  1. 3 1
      compiler/arm/cgcpu.pas
  2. 2 2
      tests/test/units/math/ttrig1.pp

+ 3 - 1
compiler/arm/cgcpu.pas

@@ -1110,7 +1110,7 @@ unit cgcpu;
        var
        var
          oppostfix:toppostfix;
          oppostfix:toppostfix;
        begin
        begin
-         case tosize of
+         case fromsize of
            OS_32,
            OS_32,
            OS_F32:
            OS_F32:
              oppostfix:=PF_S;
              oppostfix:=PF_S;
@@ -1123,6 +1123,8 @@ unit cgcpu;
              InternalError(200309021);
              InternalError(200309021);
          end;
          end;
          handle_load_store(list,A_LDF,oppostfix,reg,ref);
          handle_load_store(list,A_LDF,oppostfix,reg,ref);
+         if fromsize<>tosize then
+           a_loadfpu_reg_reg(list,fromsize,tosize,reg,reg);
        end;
        end;
 
 
 
 

+ 2 - 2
tests/test/units/math/ttrig1.pp

@@ -88,7 +88,7 @@ for i:=1 to 8 do
   Ref := i*10;
   Ref := i*10;
   Value := arctan(tan(i*10/float(180)*pi))/pi*float(180);
   Value := arctan(tan(i*10/float(180)*pi))/pi*float(180);
   Delta := Value - Ref;
   Delta := Value - Ref;
-  if Abs(Delta) > 1E-14 then
+  if Abs(Delta) > {$ifdef cpuarm} 1E-13 {$else} 1E-14 {$endif} then
     begin
     begin
       writeln('  Error for ArcTan(',i*10,') was:',Value,' should be:',Ref);
       writeln('  Error for ArcTan(',i*10,') was:',Value,' should be:',Ref);
       halt(1);
       halt(1);
@@ -101,7 +101,7 @@ for i:=-1 downto -8 do
   Ref := i*10;
   Ref := i*10;
   Value := arctan(tan(i*10/float(180)*pi))/pi*float(180);
   Value := arctan(tan(i*10/float(180)*pi))/pi*float(180);
   Delta := Value - Ref;
   Delta := Value - Ref;
-  if Abs(Delta) > 1E-14 then
+  if Abs(Delta) > {$ifdef cpuarm} 1E-13 {$else} 1E-14 {$endif} then
     begin
     begin
       writeln('  Error for ArcTan(',i*10,') was:',Value,' should be:',Ref);
       writeln('  Error for ArcTan(',i*10,') was:',Value,' should be:',Ref);
       halt(1);
       halt(1);