Commit Graph

40 Commits

Author SHA1 Message Date
Jonas Maebe
8b9e90dc7a * keep track of whether a routine has a C-style variadic parameter in the
procoptions even when it's through an array-of-const parameter
  * always call create_varargs_paraloc_info() instead of create_paraloc_info()
    in the former case, even when no varargs parameters are specified (because
    on some platforms even some non-variadic parameters need to be passed
    differently, such as on ARM with gnueabihf)

git-svn-id: trunk@41420 -
2019-02-23 15:42:45 +00:00
nickysn
d9925f7074 - removed pocall_far16 from the supported calling conventions of the i8086
code generator

git-svn-id: trunk@38938 -
2018-05-06 15:14:40 +00:00
nickysn
eb95dcb85f - removed pocall_mwpascal from the supported calling conventions of the i8086
code generator

git-svn-id: trunk@38937 -
2018-05-06 14:40:08 +00:00
nickysn
4fbc658184 - removed check for system_i386_wince in i8086's cpupara
git-svn-id: trunk@38936 -
2018-05-06 14:30:05 +00:00
nickysn
0a12bc4697 - removed pocall_oldfpccall from the supported calling conventions of the i8086
code generator

git-svn-id: trunk@38935 -
2018-05-06 14:07:31 +00:00
nickysn
9a6e490699 * changed the 'register' and 'cdecl' calling conventions on i8086, so they don't
modify the SI and DI registers. For 'register', this makes it compatible with
  Borland C++'s __fastcall calling convention, while 'cdecl' becomes compatible
  with Borland C, Microsoft C and Watcom C.

git-svn-id: trunk@38824 -
2018-04-23 16:12:16 +00:00
nickysn
518cdf9674 * replaced the saved_XXX_registers arrays with virtual methods inside
tcpuparamanager, very similar to the existing get_volatile_registers_XXX. The
  new methods are called get_saved_registers_XXX, where XXX is the register
  type ("int", "address", "fpu" or "mm")

git-svn-id: trunk@38794 -
2018-04-19 21:22:16 +00:00
nickysn
a73aabcc39 * support loading longint in dx:ax when using the 'register' calling convention
on i8086. This is compatible with Borland C++ 3.1's _fastcall. Note that
  passing parameters in multiple registers is not yet implemented, so using this
  will cause internal errors, but these will be fixed later (and the 'register'
  calling convention was never officially supported on i8086).

git-svn-id: trunk@38784 -
2018-04-18 15:36:55 +00:00
nickysn
91707deba7 * changed the registers, used by the 'register' calling convention on i8086 to
ax,dx,bx instead of ax,dx,cx, because that makes it more compatible with
  Borland C++ 3.1's _fastcall calling convention

git-svn-id: trunk@38783 -
2018-04-18 13:46:56 +00:00
nickysn
f1b6be2d74 + only allocate a result variable for asm routines on i8086, if they are
returned in a parameter. This improves TP7 compatibility.

git-svn-id: trunk@38246 -
2018-02-15 17:51:03 +00:00
nickysn
b2665b43aa - removed darwin-i386 stuff from i8086's cpupara
git-svn-id: trunk@38240 -
2018-02-14 15:47:03 +00:00
Jonas Maebe
fa3b0ca312 * support marking defs created via the getreusable*() class methods as
"don't free even if not registered"; use for defs that may not be written
    to a ppu file, but that must nevertheless survive the compilation of the
    current module
  * mark all defs created for para locations as "don't free even if not
    registered", because we don't discard and recalculate all para locations
    after a module has been compiled (since that's not needed)
   o solves issues if the paralocations for a routine in the interface of
     unit A are calculated while the implementation of unit B gets
     compiled, and a new reusable type is allocated at that point which
     is not used anywhere else (after r32160)

git-svn-id: trunk@32235 -
2015-11-04 20:46:18 +00:00
Jonas Maebe
f402b0d7df * changed getpointerdef() into a tpointerdef.getreusable() class method
o allows removing the ugly x86 hacks

git-svn-id: trunk@31144 -
2015-06-22 08:17:49 +00:00
florian
b4fc11fe06 * implemented r30870 for all platforms: pass dyn. array parameters like pointer parameters so typically in a register
git-svn-id: trunk@30878 -
2015-05-17 12:29:28 +00:00
Jonas Maebe
61e4a1b811 + added tasmlist parameter to getintparaloc() (needed for llvm)
git-svn-id: trunk@30429 -
2015-04-04 14:29:16 +00:00
Jonas Maebe
bd203a5b57 * synchronised with trunk till r30240
git-svn-id: branches/hlcgllvm@30241 -
2015-03-15 19:44:58 +00:00
Jonas Maebe
2e126bb723 - removed darwin/i386 special case code from i8086 code generator
git-svn-id: trunk@30204 -
2015-03-14 18:35:50 +00:00
Jonas Maebe
bacd303208 * synchronized with trunk up to r27758
git-svn-id: branches/hlcgllvm@27779 -
2014-05-12 16:12:34 +00:00
nickysn
3dfc6ac7e1 * fixed the passing of extended floating type parameters on i8086 for
pocall_register after r24761 (it is the same change as in r24766, but for
  pocall_register)

git-svn-id: trunk@27709 -
2014-05-01 16:45:49 +00:00
nickysn
906412411f * fixed the passing of pushaddr paramaters for pocall_register in i8086 far data
memory models

git-svn-id: trunk@27708 -
2014-05-01 16:43:35 +00:00
nickysn
6fe362a1b0 + added method is_far to i8086's tcpuprocdef and tcpuprocvardef
+ added helper function to i8086's symcpu is_proc_far that dispatches the call
  to the proper is_far method (because we can't make a cpu specific descendant
  of tabstractprocdef and add it there)
* all checks for (po_far in procoptions) in the i8086 code generator replaced
  with calls to is_proc_far

git-svn-id: trunk@27559 -
2014-04-13 12:41:46 +00:00
nickysn
e725af86fe * fixed the handling of the register parameters of i8086 interrupt procedures
git-svn-id: trunk@27502 -
2014-04-07 22:19:10 +00:00
nickysn
ee7a6dfc2e * set the para sizes correctly for push_addr_params in i8086 far data memory
models. This breaks compilation of the system unit in the compact and large
  memory models once again, but the generated code wasn't correct in the first
  place, so it's not really a loss.

git-svn-id: trunk@27275 -
2014-03-25 00:40:48 +00:00
Jonas Maebe
99de108c68 * renamed all paramanagers to tcpuparamanager so the llvm paramanager can
derive from them without ifdefs

git-svn-id: branches/hlcgllvm@26039 -
2013-11-11 11:15:27 +00:00
nickysn
4b93fa1323 * set all the i8086 calling conventions' volatile registers to be the same as the 'pascal' calling convention; this should make cdecl compatible with 16-bit C compilers
git-svn-id: trunk@25128 -
2013-07-18 21:01:41 +00:00
nickysn
6fdd48878f * adjust parameters of far procedures for the extra segment that's pushed on the stack by the far call instruction
git-svn-id: trunk@24818 -
2013-06-08 20:42:13 +00:00
Jonas Maebe
7f2750f188 * missing part of r24776, using a build server also has pitfalls :/
git-svn-id: trunk@24777 -
2013-06-02 14:35:29 +00:00
nickysn
75451181c9 * fixed the passing of the extended floating type parameters on i8086 after r24761
git-svn-id: trunk@24766 -
2013-06-02 12:03:16 +00:00
Jonas Maebe
7566ddcc8f * add a tdef to each parameter location and set it for all target
backends (not yet used, will be used in high level code generator)

git-svn-id: trunk@24761 -
2013-06-02 10:24:02 +00:00
nickysn
ecb5a4866d * refactored the int64 result passing in ax:bx:cx:dx to use 4 paralocs, instead of the GetNextReg hack
git-svn-id: trunk@24527 -
2013-05-19 12:50:15 +00:00
nickysn
3665ed4b03 + enabled returning int64 in ax:bx:cx:dx for the i8086
git-svn-id: trunk@24502 -
2013-05-14 22:45:57 +00:00
nickysn
6b2f59c3e0 + preparations for returning int64 in ax:bx:cx:dx on i8086
git-svn-id: trunk@24498 -
2013-05-14 22:19:17 +00:00
nickysn
28c05c1ed5 * document the fact that ti8086paramanager.getintparaloc allocates a 16-bit parameter, and not a 32-bit one
git-svn-id: branches/i8086@24255 -
2013-04-15 22:08:11 +00:00
nickysn
8ce2f0c56b - rm the i386 specific code from ti8086paramanager.ret_in_param
git-svn-id: branches/i8086@24239 -
2013-04-14 14:43:42 +00:00
nickysn
af5614e52d * i8086 parameter alignment fixes
git-svn-id: branches/i8086@23978 -
2013-03-24 20:15:39 +00:00
nickysn
a66f7b61c6 * disable ret_in_param for floats, as they can be returned in a floating point register, and because enabling ret_in_param for them screws up badly the internprocs that handle floats
git-svn-id: branches/i8086@23840 -
2013-03-15 01:12:00 +00:00
nickysn
c438f3b53a * 386 changed to 8086 in various class names and comments
git-svn-id: branches/i8086@23813 -
2013-03-12 23:22:52 +00:00
nickysn
4ea86a445e * fixed functions returning int64 on i8086
git-svn-id: branches/i8086@23807 -
2013-03-12 15:09:24 +00:00
nickysn
8d2b7df6d6 * fixed functions returning longint on i8086
git-svn-id: branches/i8086@23803 -
2013-03-12 13:35:19 +00:00
nickysn
eff0894a66 all the extra i8086 units added
git-svn-id: branches/i8086@23718 -
2013-03-08 00:04:45 +00:00