* 64 bit multiplications for sparc64 fixed

git-svn-id: trunk@36675 -
This commit is contained in:
florian 2017-07-07 22:18:16 +00:00
parent 47bdbb2d1f
commit 25950b8575
2 changed files with 14 additions and 2 deletions

View File

@ -102,7 +102,7 @@ interface
A_NONE,A_MOV,A_ADD,A_AND,A_UDIV,A_SDIV,A_SMUL,A_UMUL,A_NEG,A_NOT,A_OR,A_SRA,A_SLL,A_SRL,A_SUB,A_XOR,A_NONE,A_NONE
),
(
A_NONE,A_MOV,A_ADD,A_AND,A_UDIV,A_SDIV,A_SMUL,A_UMUL,A_NEG,A_NOT,A_OR,A_SRAX,A_SLLX,A_SRLX,A_SUB,A_XOR,A_NONE,A_NONE
A_NONE,A_MOV,A_ADD,A_AND,A_UDIV,A_SDIV,A_MULX,A_MULX,A_NEG,A_NOT,A_OR,A_SRAX,A_SLLX,A_SRLX,A_SUB,A_XOR,A_NONE,A_NONE
)
);

View File

@ -45,12 +45,14 @@ interface
public
function pass_1: tnode; override;
function use_generic_mul32to64: boolean; override;
function use_generic_mul64bit : boolean; override;
end;
implementation
uses
systems,
globals,globtype,
cutils,verbose,
paramgr,procinfo,
aasmtai,aasmdata,aasmcpu,defutil,
@ -477,7 +479,7 @@ interface
location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
{$ifdef SPARC64}
location.register:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
current_asmdata.CurrAsmList.Concat(taicpu.op_reg_reg_reg(multops[unsigned],left.location.register,right.location.register,location.register));
current_asmdata.CurrAsmList.Concat(taicpu.op_reg_reg_reg(A_MULX,left.location.register,right.location.register,location.register));
{$else SPARC64}
location.register64.reglo:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
location.register64.reghi:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
@ -496,6 +498,16 @@ interface
end;
function tsparcaddnode.use_generic_mul64bit: boolean;
begin
{$ifdef SPARC64}
result:=(cs_check_overflow in current_settings.localswitches);
{$else SPARC64}
result:=inherited;
{$endif SPARC64}
end;
function tsparcaddnode.pass_1: tnode;
begin
result:=inherited pass_1;