mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-05 16:50:11 +01:00
* Using x86-specific capability of shifting with carry flag helps to reduce amount of instructions.
git-svn-id: trunk@27899 -
This commit is contained in:
parent
1ebff1a963
commit
ed46a07f62
@ -184,9 +184,10 @@ implementation
|
||||
cg.ungetcpuregister(current_asmdata.CurrAsmList,NR_EAX);
|
||||
if m_add then
|
||||
begin
|
||||
emit_reg_reg(A_SUB,S_L,NR_EDX,hreg1);
|
||||
emit_const_reg(A_SHR,S_L,1,hreg1);
|
||||
{ addition can overflow, shift first bit considering carry,
|
||||
then shift remaining bits in regular way. }
|
||||
emit_reg_reg(A_ADD,S_L,hreg1,NR_EDX);
|
||||
emit_const_reg(A_RCR,S_L,1,NR_EDX);
|
||||
dec(s);
|
||||
end;
|
||||
if s<>0 then
|
||||
|
||||
Loading…
Reference in New Issue
Block a user