瀏覽代碼

* emit MUL instead of IMUL in ti8086addnode.second_mul when overflow checking is
off and the multiplication is 16->16

git-svn-id: trunk@26495 -

nickysn 11 年之前
父節點
當前提交
3f4111ac37
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      compiler/i8086/n8086add.pas

+ 7 - 0
compiler/i8086/n8086add.pas

@@ -616,6 +616,13 @@ interface
     begin
       pass_left_right;
 
+      { MUL is faster than IMUL on the 8086 & 8088 (and equal in speed on 286+),
+        but it's only safe to use in place of IMUL when overflow checking is off
+        and we're doing a 16-bit>16-bit multiplication }
+      if not (cs_check_overflow in current_settings.localswitches) and
+        (not is_32bitint(resultdef)) then
+        unsigned:=true;
+
       {The location.register will be filled in later (JM)}
       location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
       { Mul supports registers and references, so if not register/reference,