mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 18:29:28 +02:00
* in the i8086 64-bit shl code, use jcxz instead of test cx,cx+jz when
optimization target is 386 or earlier (or when optimizing for size) git-svn-id: trunk@32060 -
This commit is contained in:
parent
dc92c3eb09
commit
6ece867305
@ -493,14 +493,24 @@ implementation
|
||||
we've already handled them earlier as a special case }
|
||||
if right.nodetype<>ordconstn then
|
||||
begin
|
||||
if (cs_opt_size in current_settings.optimizerswitches) or
|
||||
(current_settings.optimizecputype<=cpu_386) then
|
||||
begin
|
||||
ai:=Taicpu.Op_Sym(A_JCXZ,S_W,l3);
|
||||
ai.is_jmp := True;
|
||||
current_asmdata.CurrAsmList.Concat(ai);
|
||||
end
|
||||
else
|
||||
begin
|
||||
emit_reg_reg(A_TEST,S_W,NR_CX,NR_CX);
|
||||
cg.a_jmp_flags(current_asmdata.CurrAsmList,F_E,l3);
|
||||
end;
|
||||
emit_const_reg(A_CMP,S_L,64,NR_CX);
|
||||
cg.a_jmp_flags(current_asmdata.CurrAsmList,F_L,l1);
|
||||
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_XOR,OS_32,hreg64lo,hreg64lo);
|
||||
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_XOR,OS_32,hreg64hi,hreg64hi);
|
||||
cg.a_jmp_always(current_asmdata.CurrAsmList,l3);
|
||||
cg.a_label(current_asmdata.CurrAsmList,l1);
|
||||
emit_reg_reg(A_TEST,S_W,NR_CX,NR_CX);
|
||||
cg.a_jmp_flags(current_asmdata.CurrAsmList,F_E,l3);
|
||||
end;
|
||||
cg.a_label(current_asmdata.CurrAsmList,l2);
|
||||
if nodetype=shln then
|
||||
|
Loading…
Reference in New Issue
Block a user