2
0
Эх сурвалжийг харах

+ apply excess precision also to unary minus nodes
* made excess precision really working

git-svn-id: trunk@48840 -

florian 4 жил өмнө
parent
commit
272a0e3e26
2 өөрчлөгдсөн 16 нэмэгдсэн , 4 устгасан
  1. 5 1
      compiler/nadd.pas
  2. 11 3
      compiler/nmat.pas

+ 5 - 1
compiler/nadd.pas

@@ -1939,7 +1939,11 @@ implementation
               not(tfloatdef(left.resultdef).floattype in [s64comp,s64currency]) then
              begin
                if cs_excessprecision in current_settings.localswitches then
-                 resultrealdef:=pbestrealtype^
+                 begin
+                   resultrealdef:=pbestrealtype^;
+                   inserttypeconv(right,resultrealdef);
+                   inserttypeconv(left,resultrealdef);
+                 end
                else
                  resultrealdef:=left.resultdef
              end

+ 11 - 3
compiler/nmat.pas

@@ -97,7 +97,7 @@ implementation
       systems,
       verbose,globals,cutils,compinnr,
       globtype,constexp,
-      symconst,symtype,symdef,
+      symconst,symtype,symdef,symcpu,
       defcmp,defutil,
       htypechk,pass_1,
       cgbase,
@@ -966,10 +966,18 @@ implementation
            exit;
 
          resultdef:=left.resultdef;
-         if (left.resultdef.typ=floatdef) or
-            is_currency(left.resultdef) then
+         if is_currency(left.resultdef) then
            begin
            end
+         else if left.resultdef.typ=floatdef then
+           begin
+             if not(tfloatdef(left.resultdef).floattype in [s64comp,s64currency]) and
+               (cs_excessprecision in current_settings.localswitches) then
+               begin
+                 inserttypeconv(left,pbestrealtype^);
+                 resultdef:=left.resultdef
+               end;
+           end
 {$ifdef SUPPORT_MMX}
          else if (cs_mmx in current_settings.localswitches) and
            is_mmx_able_array(left.resultdef) then