Browse Source

* use the eqz instruction instead of "xor 1" in twasmwhilerepeatnode.pass_generate_code_condition for reversing the condition

git-svn-id: branches/wasm@48030 -
nickysn 4 năm trước cách đây
mục cha
commit
0a923963a9
1 tập tin đã thay đổi với 3 bổ sung5 xóa
  1. 3 5
      compiler/wasm32/nwasmflw.pas

+ 3 - 5
compiler/wasm32/nwasmflw.pas

@@ -69,11 +69,9 @@ begin
   secondpass(left);
 
   // reversing the condition
-  // todo: there should be a better approach
-  if not (lnf_checknegate in loopflags) then begin
-    current_asmdata.CurrAsmList.concat(taicpu.op_const(a_i32_const,1) );
-    current_asmdata.CurrAsmList.concat(taicpu.op_none(a_i32_xor) );
-  end;
+  if not (lnf_checknegate in loopflags) then
+    current_asmdata.CurrAsmList.concat(taicpu.op_none(a_i32_eqz));
+
   current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br_if,1) );
 end;