瀏覽代碼

* use IMUL even for unsigned multiplication on x86_64, when overflow checking is
off

git-svn-id: trunk@26499 -

nickysn 11 年之前
父節點
當前提交
2459518bdd
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      compiler/x86_64/nx64add.pas

+ 3 - 1
compiler/x86_64/nx64add.pas

@@ -49,8 +49,10 @@ interface
 
 
     procedure tx8664addnode.second_addordinal;
     procedure tx8664addnode.second_addordinal;
     begin
     begin
-      { filter unsigned MUL opcode, which requires special handling }
+      { filter unsigned MUL opcode, which requires special handling.
+        Note that when overflow checking is off, we can use IMUL instead. }
       if (nodetype=muln) and
       if (nodetype=muln) and
+        (cs_check_overflow in current_settings.localswitches) and
         (not(is_signed(left.resultdef)) or
         (not(is_signed(left.resultdef)) or
          not(is_signed(right.resultdef))) then
          not(is_signed(right.resultdef))) then
       begin
       begin