From b755524c38e0e81c3db40076380b0a848e968138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1roly=20Balogh?= Date: Fri, 26 May 2017 18:42:21 +0000 Subject: [PATCH] made it possible to override the decision from the cgs, if a certain muln needs a helper git-svn-id: trunk@36347 - --- compiler/nadd.pas | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/compiler/nadd.pas b/compiler/nadd.pas index 2d063997af..b492fb6052 100644 --- a/compiler/nadd.pas +++ b/compiler/nadd.pas @@ -73,6 +73,12 @@ interface { full 64 bit multiplies. } function use_generic_mul64bit: boolean; virtual; +{$ifdef cpuneedsmulhelper} + { override to customize to decide if the code generator } + { can handle a given multiply node directly, or it needs helpers } + function use_mul_helper: boolean; virtual; +{$endif cpuneedsmulhelper} + { shall be overriden if the target cpu supports an fma instruction } @@ -3159,6 +3165,16 @@ implementation end; +{$ifdef cpuneedsmulhelper} + function taddnode.use_mul_helper: boolean; + begin + result:=(nodetype=muln) and + not(torddef(resultdef).ordtype in [u8bit,s8bit + {$if defined(cpu16bitalu) or defined(avr)},u16bit,s16bit{$endif}]); + end; +{$endif cpuneedsmulhelper} + + function taddnode.pass_1 : tnode; function isconstsetfewelements(p : tnode) : boolean; @@ -3345,8 +3361,7 @@ implementation else begin {$ifdef cpuneedsmulhelper} - if (nodetype=muln) and not(torddef(resultdef).ordtype in [u8bit,s8bit - {$if defined(cpu16bitalu) or defined(avr)},u16bit,s16bit{$endif}]) then + if use_mul_helper then begin result := nil;