瀏覽代碼

* floating compares fixed
* unary minus for floats fixed

florian 21 年之前
父節點
當前提交
a50e082468
共有 4 個文件被更改,包括 58 次插入16 次删除
  1. 6 2
      compiler/arm/cpubase.pas
  2. 6 2
      compiler/arm/itcpugas.pas
  3. 17 9
      compiler/arm/narmadd.pas
  4. 29 3
      compiler/arm/narmmat.pas

+ 6 - 2
compiler/arm/cpubase.pas

@@ -62,7 +62,7 @@ unit cpubase;
               A_ADF,A_DVF,A_FDV,A_FML,A_FRD,A_MUF,A_POL,A_PW,A_RDF,
               A_RMF,A_RPW,A_RSF,A_SUF,A_ABS,A_ACS,A_ASN,A_ATN,A_COS,
               A_EXP,A_LOG,A_LGN,A_MVF,A_MNF,A_NRM,A_RND,A_SIN,A_SQT,A_TAN,A_URD,
-              A_CMF,A_CNF
+              A_CMF,A_CMFE,A_CNF
               { VPA coprocessor codes }
               );
 
@@ -570,7 +570,11 @@ unit cpubase;
 end.
 {
   $Log$
-  Revision 1.27  2004-03-06 20:35:19  florian
+  Revision 1.28  2004-03-13 18:45:40  florian
+    * floating compares fixed
+    * unary minus for floats fixed
+
+  Revision 1.27  2004/03/06 20:35:19  florian
     * fixed arm compilation
     * cleaned up code generation for exported linux procedures
 

+ 6 - 2
compiler/arm/itcpugas.pas

@@ -51,7 +51,7 @@ interface
             'adf','dvf','fdv','fml','frd','muf','pol','pw','rdf',
             'rmf','rpw','rsf','suf','abs','acs','asn','atn','cos',
             'exp','log','lgn','mvf','mnf','nrm','rnd','sin','sqt','tan','urd',
-            'cmf','cnf'
+            'cmf','cmfe','cnf'
             { VPA coprocessor codes }
             );
 
@@ -113,7 +113,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.2  2003-11-17 23:23:47  florian
+  Revision 1.3  2004-03-13 18:45:40  florian
+    * floating compares fixed
+    * unary minus for floats fixed
+
+  Revision 1.2  2003/11/17 23:23:47  florian
     + first part of arm assembler reader
 
   Revision 1.1  2003/11/12 16:05:39  florian

+ 17 - 9
compiler/arm/narmadd.pas

@@ -122,7 +122,6 @@ interface
     procedure tarmaddnode.second_addfloat;
       var
         op : TAsmOp;
-        instr : taicpu;
       begin
         case aktfputype of
           fpu_fpa,
@@ -157,10 +156,9 @@ interface
               else
                 location.register:=right.location.register;
 
-              instr:=taicpu.op_reg_reg_reg(op,
-                 location.register,left.location.register,right.location.register);
-              instr.oppostfix:=cgsize2fpuoppostfix[def_cgsize(resulttype.def)];
-              exprasmlist.concat(instr);
+              exprasmlist.concat(setoppostfix(taicpu.op_reg_reg_reg(op,
+                 location.register,left.location.register,right.location.register),
+                 cgsize2fpuoppostfix[def_cgsize(resulttype.def)]));
 
               release_reg_left_right;
 
@@ -189,12 +187,18 @@ interface
         location_reset(location,LOC_FLAGS,OS_NO);
         location.resflags:=getresflags(true);
 
-        exprasmlist.concat(taicpu.op_reg_reg(A_CMF,
-           left.location.register,right.location.register));
+        if nodetype in [equaln,unequaln] then
+          exprasmlist.concat(setoppostfix(taicpu.op_reg_reg(A_CMF,
+             left.location.register,right.location.register),
+             cgsize2fpuoppostfix[def_cgsize(resulttype.def)]))
+        else
+          exprasmlist.concat(setoppostfix(taicpu.op_reg_reg(A_CMFE,
+             left.location.register,right.location.register),
+             cgsize2fpuoppostfix[def_cgsize(resulttype.def)]));
 
         release_reg_left_right;
         location_reset(location,LOC_FLAGS,OS_NO);
-        location.resflags:=getresflags(true);
+        location.resflags:=getresflags(false);
       end;
 
 
@@ -339,7 +343,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.12  2004-03-11 22:41:37  florian
+  Revision 1.13  2004-03-13 18:45:40  florian
+    * floating compares fixed
+    * unary minus for floats fixed
+
+  Revision 1.12  2004/03/11 22:41:37  florian
     + second_cmpfloat implemented, needs probably to be fixed
 
   Revision 1.11  2004/01/26 19:05:56  florian

+ 29 - 3
compiler/arm/narmmat.pas

@@ -31,9 +31,15 @@ interface
 
     type
       tarmnotnode = class(tcgnotnode)
-         procedure second_boolean;override;
+        procedure second_boolean;override;
       end;
 
+
+      tarmunaryminusnode = class(tcgunaryminusnode)
+        procedure second_float;override;
+      end;
+
+
 implementation
 
     uses
@@ -94,13 +100,33 @@ implementation
           end;
       end;
 
+{*****************************************************************************
+                               TARMUNARYMINUSNODE
+*****************************************************************************}
+
+    procedure tarmunaryminusnode.second_float;
+      begin
+        secondpass(left);
+        location_reset(location,LOC_FPUREGISTER,def_cgsize(resulttype.def));
+        location_force_fpureg(exprasmlist,left.location,false);
+        location:=left.location;
+        exprasmlist.concat(setoppostfix(taicpu.op_reg_reg_const(A_RSF,
+          location.register,left.location.register,0),
+          cgsize2fpuoppostfix[def_cgsize(resulttype.def)]));
+      end;
+
 
 begin
    cnotnode:=tarmnotnode;
+   cunaryminusnode:=tarmunaryminusnode;
 end.
 {
   $Log$
-  Revision 1.5  2004-01-28 15:36:47  florian
+  Revision 1.6  2004-03-13 18:45:40  florian
+    * floating compares fixed
+    * unary minus for floats fixed
+
+  Revision 1.5  2004/01/28 15:36:47  florian
     * fixed another couple of arm bugs
 
   Revision 1.4  2003/11/02 14:30:03  florian
@@ -108,4 +134,4 @@ end.
 
   Revision 1.3  2003/08/27 00:27:56  florian
     + same procedure as very day: today's work on arm
-}
+}