mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-05 01:29:30 +01:00
made it possible to override the decision from the cgs, if a certain muln needs a helper
git-svn-id: trunk@36347 -
This commit is contained in:
parent
6ca8b1374b
commit
b755524c38
@ -73,6 +73,12 @@ interface
|
|||||||
{ full 64 bit multiplies. }
|
{ full 64 bit multiplies. }
|
||||||
function use_generic_mul64bit: boolean; virtual;
|
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
|
{ shall be overriden if the target cpu supports
|
||||||
an fma instruction
|
an fma instruction
|
||||||
}
|
}
|
||||||
@ -3159,6 +3165,16 @@ implementation
|
|||||||
end;
|
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 taddnode.pass_1 : tnode;
|
||||||
|
|
||||||
function isconstsetfewelements(p : tnode) : boolean;
|
function isconstsetfewelements(p : tnode) : boolean;
|
||||||
@ -3345,8 +3361,7 @@ implementation
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$ifdef cpuneedsmulhelper}
|
{$ifdef cpuneedsmulhelper}
|
||||||
if (nodetype=muln) and not(torddef(resultdef).ordtype in [u8bit,s8bit
|
if use_mul_helper then
|
||||||
{$if defined(cpu16bitalu) or defined(avr)},u16bit,s16bit{$endif}]) then
|
|
||||||
begin
|
begin
|
||||||
result := nil;
|
result := nil;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user