mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-08 10:39:29 +02:00
* NASM writer: don't force 'near' size for all non-far branches and calls, it disables NASM's capability to optimize branches into short form where possible, and thus only increases size of generated code.
- LDS and LES instructions do not exist on x86_64. git-svn-id: trunk@27932 -
This commit is contained in:
parent
07626f029a
commit
c28271ab99
@ -408,7 +408,9 @@ interface
|
||||
begin
|
||||
if not ((opcode = A_LEA) or (opcode = A_LGS) or
|
||||
(opcode = A_LSS) or (opcode = A_LFS) or
|
||||
{$ifndef x86_64}
|
||||
(opcode = A_LES) or (opcode = A_LDS) or
|
||||
{$endif x86_64}
|
||||
// (opcode = A_SHR) or (opcode = A_SHL) or
|
||||
// (opcode = A_SAR) or (opcode = A_SAL) or
|
||||
(opcode = A_OUT) or (opcode = A_IN)) then
|
||||
@ -472,23 +474,10 @@ interface
|
||||
else
|
||||
begin
|
||||
if ai.opsize=S_FAR then
|
||||
AsmWrite('far ')
|
||||
else
|
||||
begin
|
||||
{ NEAR forces NASM to emit near jumps, which are 386+ }
|
||||
{$ifndef i8086}
|
||||
if not(
|
||||
(ai.opcode=A_JCXZ) or (ai.opcode=A_JECXZ) or
|
||||
{$ifdef x86_64}
|
||||
(ai.opcode=A_JRCXZ) or
|
||||
{$endif x86_64}
|
||||
(ai.opcode=A_LOOP) or (ai.opcode=A_LOOPE) or
|
||||
(ai.opcode=A_LOOPNE) or (ai.opcode=A_LOOPNZ) or
|
||||
(ai.opcode=A_LOOPZ)
|
||||
) then
|
||||
AsmWrite('NEAR ');
|
||||
{$endif i8086}
|
||||
end;
|
||||
AsmWrite('far ');
|
||||
{ else
|
||||
AsmWrite('near ') just disables short branches, increasing code size.
|
||||
Omitting it does not cause any bad effects, tested with nasm 2.11. }
|
||||
|
||||
AsmWrite(o.ref^.symbol.name);
|
||||
if SmartAsm then
|
||||
|
Loading…
Reference in New Issue
Block a user