فهرست منبع

Fix bugs caused by swapping of operands in float comparisons.

git-svn-id: branches/laksen/riscv_new@39697 -
Jeppe Johansen 7 سال پیش
والد
کامیت
2af0ca8546
1فایلهای تغییر یافته به همراه2 افزوده شده و 5 حذف شده
  1. 2 5
      compiler/riscv/nrvadd.pas

+ 2 - 5
compiler/riscv/nrvadd.pas

@@ -292,6 +292,8 @@ implementation
         singleprec , inv: boolean;
       begin
         pass_left_and_right;
+        if (nf_swapped in flags) then
+          swapleftright;
 
         hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
         hlcg.location_force_fpureg(current_asmdata.CurrAsmList,right.location,right.resultdef,true);
@@ -375,11 +377,6 @@ implementation
             internalerror(200403182);
         end;
 
-        // get the operands in the correct order, there are no special cases
-        // here, everything is register-based
-        if (nf_swapped in flags) and (not cmpop) then
-          swapleftright;
-
         // put both operands in a register
         hlcg.location_force_fpureg(current_asmdata.CurrAsmList,right.location,right.resultdef,true);
         hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);