From 3f4111ac3727e55063ca5fb475545cacb47cf2e2 Mon Sep 17 00:00:00 2001 From: nickysn Date: Fri, 17 Jan 2014 23:04:46 +0000 Subject: [PATCH] * 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 - --- compiler/i8086/n8086add.pas | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/i8086/n8086add.pas b/compiler/i8086/n8086add.pas index eb6f8050c1..5479cf88dc 100644 --- a/compiler/i8086/n8086add.pas +++ b/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,