Commit Graph

15352 Commits

Author SHA1 Message Date
nickysn
aa63efc27e * emit a far ret instruction in the exit code of far procedures
git-svn-id: trunk@24817 -
2013-06-08 20:40:50 +00:00
nickysn
a9c949e551 * the memory model const sets introduced in r24812 moved to i8086/cpuinfo.pas
git-svn-id: trunk@24816 -
2013-06-08 19:52:28 +00:00
nickysn
381c996e53 + added po_far to tprocoptions
git-svn-id: trunk@24815 -
2013-06-08 16:34:30 +00:00
nickysn
fcc84e5d96 + added the x86/*.pas files to ppc8086.lpi for easier access from the lazarus project inspector
git-svn-id: trunk@24814 -
2013-06-08 16:33:56 +00:00
nickysn
9eecec4910 + added const sets for the i8086 memory models based on the code and data model type
git-svn-id: trunk@24812 -
2013-06-08 14:36:12 +00:00
nickysn
e28852d07d * prt0 startup code file for small model renamed to prt0s
git-svn-id: trunk@24809 -
2013-06-05 16:41:39 +00:00
sergei
2868a30cce + Added mips32r2 opcodes needed for pic32.
* Output registers of type R_SPECIALREGISTER as numbers.
+ For MTC0/MFC0 instructions, set type of first operand to R_SPECIALREGISTER, since it designates a coprocessor register.

git-svn-id: trunk@24799 -
2013-06-03 20:01:30 +00:00
sergei
cc8772cf92 * sizeof(x), typeof(x): if "x" is typenode, request GOT for PIC because a global VMT label will be loaded.
* typeinfo(x): transform into rttinode (which does request GOT) during pass 1, so pass 2 is not needed. 

git-svn-id: trunk@24798 -
2013-06-03 18:07:32 +00:00
nickysn
b409d600ee + implemented the tiny memory model for i8086-msdos; we now produce working dos .com files as well
git-svn-id: trunk@24793 -
2013-06-02 23:02:10 +00:00
Jeppe Johansen
f3273fa87d Optimize Add/Sub+Ldr/Str by using preindexed references
git-svn-id: trunk@24789 -
2013-06-02 21:51:12 +00:00
Jeppe Johansen
2d823452b7 The scheduler pass of the ARM optimizer left markers in the instruction list, which could prevent further peephole optimizations
git-svn-id: trunk@24781 -
2013-06-02 16:37:41 +00:00
nickysn
7edabc64e6 * rm support for Mem without segment on i8086
git-svn-id: trunk@24780 -
2013-06-02 16:20:26 +00:00
nickysn
dd0d2d6bf5 * fixed the spurious compiler warnings and added proper rangechecking when using Mem[] on i8086
git-svn-id: trunk@24779 -
2013-06-02 15:18:05 +00:00
Jeppe Johansen
570b40faed Signed modulus by 2 on ARM with no division is optimized to a series of instructions instead of calling fpc_mod_longint.
An ASR is removed from signed division by 2.

git-svn-id: trunk@24778 -
2013-06-02 14:44:06 +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
Jonas Maebe
9938169d2c * don't use the paracgsize in get_paraloc_def(), because it generally
contains the tcgsize of the entire parameter rather than only of
    what is left (-> calculate it from the remaining parameter length)

git-svn-id: trunk@24776 -
2013-06-02 14:05:07 +00:00
sergei
4e873d0561 + Determine early (before pass 2) whether managed parameters/locals/temps will cause the procedure to reference RTTI labels and, therefore, need GOT.
+ trttinode also sets pi_needs_got flag.

git-svn-id: trunk@24767 -
2013-06-02 13:09:47 +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
sergei
4b820a1ca5 - Removed tcgloadnode.generate_picvaraccess, it is never used and is not necessary because PIC stuff is handled at lower levels.
git-svn-id: trunk@24764 -
2013-06-02 10:49:17 +00:00
Jonas Maebe
109317e460 + full support for parameter passing in the high level code generator
(equivalent to what exists in tcgobj)
   o unfortunately it can't be generally enabled for all existing targets
     by overriding/disabling the tcgobj equivalents, because several targets
     call these methods inside other tcgcpu methods and we can't call the high
     level code generator methods from the low level code generator (so right
     now there's quite a bit of code duplication)

git-svn-id: trunk@24763 -
2013-06-02 10:24:13 +00:00
Jonas Maebe
7d9f98e516 + def_cgmmsize() that returns a vector tcgsize for arraydefs (as generated
for certain parameter locations in the x86-64 parameter manager)
  * full support for vector types in the high level code generator by
    translating arraydefs passed to a_*mm*() methods into vector tcgsizes

git-svn-id: trunk@24762 -
2013-06-02 10:24:08 +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
Jonas Maebe
53ba7fbb8b * support formaldef in def_cgsize (-> OS_ADDR)
git-svn-id: trunk@24760 -
2013-06-02 10:23:54 +00:00
Jonas Maebe
dd15ee5bf2 * removed superfluous checks (push_addr_param() already checks for those)
git-svn-id: trunk@24759 -
2013-06-02 10:23:47 +00:00
Jonas Maebe
4e210e57c2 * use the correct type (pointer to object type) when loading the function
result of a TP-style object constructor

git-svn-id: trunk@24758 -
2013-06-02 10:23:40 +00:00
nickysn
e2241d97a2 * i8086 optimizations for 32-bit OP_SAR with const >= 16
git-svn-id: trunk@24757 -
2013-06-02 09:35:30 +00:00
nickysn
55a071692e * i8086 optimizations in op_const_reg for 32-bit OP_SHL and OP_SHR with const >= 16
git-svn-id: trunk@24756 -
2013-06-02 08:58:50 +00:00
nickysn
90ecd72286 * x86_64 compilation fixed after r24752
git-svn-id: trunk@24755 -
2013-06-01 22:38:07 +00:00
nickysn
ec76b2cf40 * refactored the segment-in-integer-register reference support, so it's handled in make_simple_ref, instead of all over the place in the code generator
git-svn-id: trunk@24752 -
2013-06-01 22:18:09 +00:00
Jonas Maebe
978b5530ec * renamed getmmcgsize to getintmmcgsize + comment
git-svn-id: trunk@24744 -
2013-06-01 18:32:14 +00:00
Jonas Maebe
2dd75e707e * renamed thlcgobj.tcgsize2orddef to defutil.cgsize_orddef
git-svn-id: trunk@24743 -
2013-06-01 18:28:15 +00:00
nickysn
525246f61b * support i8086 far references in tx86addnode.emit_op_right_left
git-svn-id: trunk@24737 -
2013-06-01 17:51:58 +00:00
nickysn
1e8b192b3d * support far references in second_cmp32bit for i8086
git-svn-id: trunk@24736 -
2013-06-01 17:51:18 +00:00
nickysn
c9c882c30a * always use 16-bit pushes for pushing/popping the segment registers on i8086 in Tcgx86.g_concatcopy
git-svn-id: trunk@24735 -
2013-06-01 17:49:49 +00:00
Károly Balogh
76d7527909 also return nil for the empty env vars in the generic implementation in GetEnvPChar
git-svn-id: trunk@24733 -
2013-06-01 17:40:34 +00:00
Jonas Maebe
f985149163 * fixed compilation after r24661 (added dummy overloads for newly
implemented LOC_MMREGISTER hlcgobj methods)

git-svn-id: trunk@24731 -
2013-06-01 16:48:11 +00:00
nickysn
e243b6b869 * never use the 66h prefix when pushing/popping segment registers on i8086, as the stack is aligned on 2 bytes there
git-svn-id: trunk@24729 -
2013-06-01 16:03:14 +00:00
nickysn
c2e3fb5918 + emit proper interrupt procedure entry/exit code on i8086
git-svn-id: trunk@24728 -
2013-06-01 15:50:11 +00:00
Károly Balogh
a11c113429 reverted the link object search change
git-svn-id: trunk@24727 -
2013-06-01 15:35:59 +00:00
Károly Balogh
36bf03372b handle the cases where f contains an absolute path
git-svn-id: trunk@24726 -
2013-06-01 15:22:58 +00:00
Károly Balogh
e7094cf1d6 fix redundant searches in FindObjectFile, if the object was found on the first try
git-svn-id: trunk@24725 -
2013-06-01 15:21:57 +00:00
paul
5ff7bb884e compiler: don't skip objc class/protocols in case of initrtti, fixed crash of dynamic array/record which contains a objc class/protocol and requires an initialization
git-svn-id: trunk@24723 -
2013-06-01 14:45:10 +00:00
nickysn
cb81153cc4 * fixed tcgnotnode.second_64bit for 8/16-bit cpus after r24678
git-svn-id: trunk@24719 -
2013-06-01 14:05:53 +00:00
sergei
4714dc2218 + paramgr.pas: provide generic implementation of getintparaloc(). Once this method has been changed to use the procdef, it can reuse 'regular' parameter locations created by create_paraloc_info, so separate cpu-specific implementations of getintparaloc are no longer necessary.
* parabase.pas: fixed tcgpara.getcopy, it should not modify the source object.

git-svn-id: trunk@24716 -
2013-06-01 13:47:33 +00:00
Jonas Maebe
3456f20546 * changed checks for support of opmm* calls in hlcg2ll from mms_movescalar
to whether the argument is a float type (the check is there to determine
    whether def_cgsize() can give us a correct result, which it can for
    floating point types but not yet for arrays used as vectors)

git-svn-id: trunk@24685 -
2013-06-01 08:28:32 +00:00
florian
44a7ef600f * improve register handling for not and unary minus operator by using a new register for the destination
git-svn-id: trunk@24678 -
2013-05-31 21:32:58 +00:00
florian
4056194e7c * don't ignore by accident the next instruction after a newly inserted constant pool
git-svn-id: trunk@24677 -
2013-05-31 21:29:08 +00:00
florian
3a393f839e * do not reuse register locations on arm fpa/vfp
git-svn-id: trunk@24676 -
2013-05-31 21:29:05 +00:00
masta
8c32802fcf Added LdrbAnd2Ldrb Peephole optimizer for arm
Changes the following code:
  ldrb dst1, [REF]
  and  dst2, dst1, #255
  # dealloc dst1
to
  ldrb dst2, [REF]

git-svn-id: trunk@24672 -
2013-05-31 17:36:54 +00:00
nickysn
10b3ce1ba5 * fixed an opsize bug in ti8086addnode.second_add64bit, which caused 32-bit instructions to be emitted
git-svn-id: trunk@24670 -
2013-05-31 17:13:38 +00:00