From 7a15fd044431ab376622c53ab00c84a4056f2140 Mon Sep 17 00:00:00 2001 From: nickysn Date: Mon, 8 Apr 2013 18:08:10 +0000 Subject: [PATCH] * in the case of (uint8 div/mod small_positive_const), convert the const to unsigned, so that we don't do a 16-bit division on 8-bit CPUs git-svn-id: branches/i8086@24209 - --- compiler/nmat.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/nmat.pas b/compiler/nmat.pas index 0c57dff7c1..5371ea0402 100644 --- a/compiler/nmat.pas +++ b/compiler/nmat.pas @@ -243,7 +243,7 @@ implementation { Additionally, do the same for cardinal/qwords and other positive types, but } { always in a way that a smaller type is converted to a bigger type } { (webtbs/tw8870) } - if (rd.ordtype in [u16bit,u32bit,u64bit]) and + if (rd.ordtype in [u8bit,u16bit,u32bit,u64bit]) and ((is_constintnode(left) and (tordconstnode(left).value >= 0)) or (not is_signed(ld) and @@ -252,7 +252,7 @@ implementation inserttypeconv(left,right.resultdef); ld:=torddef(left.resultdef); end; - if (ld.ordtype in [u16bit,u32bit,u64bit]) and + if (ld.ordtype in [u8bit,u16bit,u32bit,u64bit]) and ((is_constintnode(right) and (tordconstnode(right).value >= 0)) or (not is_signed(rd) and