diff options
author | daniel <daniel@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2005-07-10 14:03:35 +0000 |
---|---|---|
committer | daniel <daniel@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2005-07-10 14:03:35 +0000 |
commit | 8aa31033034d0d8964c08f17118d82ba6c015568 (patch) | |
tree | 53187660ae8f9ae576a6160b3512fc64462b0d19 /compiler/x86 | |
parent | 44e32ad6d11f5c26a3084677a7718dd07980daa3 (diff) | |
download | fpc-8aa31033034d0d8964c08f17118d82ba6c015568.tar.gz |
* Improve automatic adding of operand size.
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@611 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/x86')
-rw-r--r-- | compiler/x86/rax86.pas | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/compiler/x86/rax86.pas b/compiler/x86/rax86.pas index 5c0e92b33a..624fde9b11 100644 --- a/compiler/x86/rax86.pas +++ b/compiler/x86/rax86.pas @@ -559,20 +559,28 @@ begin {$endif ATTOP} end; - if (ops=1) and (opcode=A_INT) then - siz:=S_B; - - if (ops=1) and (opcode=A_RET) then - siz:=S_W; - - if (ops=1) and (opcode=A_PUSH) then + {It is valid to specify some instructions without operand size.} + if siz=S_NO then begin - {We are a 32 compiler, assume 32-bit by default. This is Delphi compatible - but bad coding practise.} - siz:=S_L; - message(asmr_w_unable_to_determine_reference_size_using_dword); + if (ops=1) and (opcode=A_INT) then + siz:=S_B; + if (ops=1) and (opcode=A_RET) then + siz:=S_W; + if (ops=1) and (opcode=A_PUSH) then + begin + {We are a 32 compiler, assume 32-bit by default. This is Delphi compatible + but bad coding practise.} + siz:=S_L; + message(asmr_w_unable_to_determine_reference_size_using_dword); + end; + if (opcode=A_JMP) or (opcode=A_CALL) then + if ops=1 then + siz:=S_NEAR + else + siz:=S_FAR; end; + { GNU AS interprets FDIV without operand differently for version 2.9.1 and 2.10 we add explicit args to it !! } |