mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 13:39:36 +02:00
+ tx86addnode.second_opvector makes use of AVX instructions
git-svn-id: trunk@47345 -
This commit is contained in:
parent
af415ddc0d
commit
e46b426ca1
@ -1268,15 +1268,32 @@ unit nx86add;
|
||||
{ we can use only right as left operand if the operation is commutative }
|
||||
if (right.location.loc=LOC_MMREGISTER) and (op in [OP_ADD,OP_MUL]) then
|
||||
begin
|
||||
location.register:=right.location.register;
|
||||
cg.a_opmm_loc_reg(current_asmdata.CurrAsmList,op,tfloat2tcgsize[tfloatdef(left.resultdef).floattype],left.location,location.register,nil);
|
||||
if UseAVX then
|
||||
begin
|
||||
location.register:=cg.getmmregister(current_asmdata.CurrAsmList,OS_VECTOR);
|
||||
cg.a_opmm_loc_reg_reg(current_asmdata.CurrAsmList,op,tfloat2tcgsize[tfloatdef(left.resultdef).floattype],left.location,right.location.register,location.register,nil);
|
||||
end
|
||||
else
|
||||
begin
|
||||
location.register:=right.location.register;
|
||||
cg.a_opmm_loc_reg(current_asmdata.CurrAsmList,op,tfloat2tcgsize[tfloatdef(left.resultdef).floattype],left.location,location.register,nil);
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
location_force_mmreg(current_asmdata.CurrAsmList,left.location,false);
|
||||
location.register:=left.location.register;
|
||||
cg.a_opmm_loc_reg(current_asmdata.CurrAsmList,op,
|
||||
tfloat2tcgsize[tfloatdef(tarraydef(left.resultdef).elementdef).floattype],right.location,location.register,nil);
|
||||
if UseAVX then
|
||||
begin
|
||||
location.register:=cg.getmmregister(current_asmdata.CurrAsmList,OS_VECTOR);
|
||||
cg.a_opmm_loc_reg_reg(current_asmdata.CurrAsmList,op,
|
||||
tfloat2tcgsize[tfloatdef(tarraydef(left.resultdef).elementdef).floattype],right.location,left.location.register,location.register,nil);
|
||||
end
|
||||
else
|
||||
begin
|
||||
location.register:=left.location.register;
|
||||
cg.a_opmm_loc_reg(current_asmdata.CurrAsmList,op,
|
||||
tfloat2tcgsize[tfloatdef(tarraydef(left.resultdef).elementdef).floattype],right.location,location.register,nil);
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user