Commit Graph

15341 Commits

Author SHA1 Message Date
florian
ac819b0b97 * jvm lazarus project file properly named
git-svn-id: trunk@24352 -
2013-04-28 08:39:20 +00:00
nickysn
40ab132efa * replaced tcgint(lo(x)) with longint(lo(x)) and tcgint(hi(x)) with longint(hi(x)) in cg64f32.pas, which should fix some of the const sign expansion regressions on some 32-bit architectures
git-svn-id: trunk@24351 -
2013-04-28 07:42:56 +00:00
nickysn
99d3b453a4 * got rid of the i8086 nasm warning 'segment attributes specified on redeclaration of segment'
git-svn-id: trunk@24336 -
2013-04-26 22:17:42 +00:00
nickysn
3853d06ac0 + added n8086cal.pas, based on n386cal.pas; this pulls in nx86cal.pas as well and fixes compilation of the system unit on i8086 after the merge of the i8086 branch to trunk
git-svn-id: trunk@24335 -
2013-04-26 20:19:57 +00:00
florian
a07af824ea * properly fix raise node handling on x86-64 after r24288
git-svn-id: trunk@24334 -
2013-04-26 20:17:54 +00:00
yury
e212901658 * ppudump: JSON output of constants, records, arrays, class refs.
git-svn-id: trunk@24333 -
2013-04-26 15:55:29 +00:00
yury
12825a2f09 * Fixed unused var note.
git-svn-id: trunk@24332 -
2013-04-26 10:29:35 +00:00
yury
b4ba96fa5a * ppudump: JSON output of properties and global vars.
git-svn-id: trunk@24331 -
2013-04-26 10:26:42 +00:00
pierre
4f8fcb7f15 Revert commit 24324 for ncgflow.pas unit to fix win64 cycle
git-svn-id: trunk@24328 -
2013-04-26 09:38:57 +00:00
florian
3d7033d81e * Makefiles regenerated
git-svn-id: trunk@24325 -
2013-04-25 20:25:57 +00:00
florian
0e41df598e * merge i8086 branch by Nikolay Nikolov
git-svn-id: trunk@24324 -
2013-04-25 20:23:51 +00:00
yury
3dd976c06f * ppudump: Fixed writing of float values.
git-svn-id: trunk@24318 -
2013-04-25 10:31:45 +00:00
yury
d265e8d3be * ppudump: JSON output of classes.
git-svn-id: trunk@24317 -
2013-04-25 10:03:29 +00:00
yury
7ad68debc9 * ppudump: Work in progress on JSON output. Implemented procedure definition.
git-svn-id: trunk@24316 -
2013-04-25 06:56:38 +00:00
yury
61ac7580b7 * ppudump: Work in progress on JSON output.
git-svn-id: trunk@24311 -
2013-04-23 15:16:34 +00:00
yury
432f5059fc * ppudump:
- Use -Ft and Fj options to set the text and JSON output formats.
  - Get version string from compiler sources.

git-svn-id: trunk@24306 -
2013-04-23 09:49:41 +00:00
marco
e6dc52bac8 * enable sections smartlinking for *BSD, seems to work nowadays.
git-svn-id: trunk@24304 -
2013-04-22 18:03:28 +00:00
marco
8b411a549c * functionname without () is a recursive call in Miso. Mantis #24309, though
that remains open for the documentation.

git-svn-id: trunk@24303 -
2013-04-22 17:45:14 +00:00
Jonas Maebe
abc79bc4cf * override tcgraisenode.pass_1 so that the JVM raise support will keep
working after r24288 is merged to trunk

git-svn-id: trunk@24301 -
2013-04-22 14:47:06 +00:00
Jonas Maebe
c4b62f86a1 * renamed ppudump directory introduced by r24298 to ppuutils to fix
compilation on unix platforms (the ppudump binary name conflicted with
    with the directory name)

git-svn-id: trunk@24300 -
2013-04-22 14:37:37 +00:00
yury
85c2d144c5 * ppudump: Started implementation of JSON output. Output of unit header info has been implemented.
git-svn-id: trunk@24299 -
2013-04-22 14:08:53 +00:00
yury
6327854259 * Move ppudump.pp to a sub-folder as preparation for adding JSON output units.
git-svn-id: trunk@24298 -
2013-04-22 11:19:25 +00:00
yury
187153a557 * ppudump: commented unused local vars.
git-svn-id: trunk@24297 -
2013-04-22 10:45:33 +00:00
yury
eca2b52a03 * ppudump: Implemented wrappers for write and writeln in order to be able to turn off default output when JSON output is selected.
git-svn-id: trunk@24296 -
2013-04-22 10:35:11 +00:00
florian
926dd1b41e * command line compilation of i8086 fixed
git-svn-id: branches/i8086@24291 -
2013-04-21 18:32:09 +00:00
nickysn
5ed1222e64 * changed the default i8086 calling convention to pocall_pascal
git-svn-id: branches/i8086@24290 -
2013-04-21 18:03:36 +00:00
florian
709ba5e053 + introduce cnf_call_never_returns to signal the dfa if a call node never returns
* get rid of  tcgraisenode.pass_generate_code, it is replaced by compiler proc. call nodes generated in pass_1

git-svn-id: branches/i8086@24288 -
2013-04-21 16:53:25 +00:00
nickysn
57777945a8 * fixed bug in thlcgobj.g_array_rtti_helper introduced in the previous commit
git-svn-id: branches/i8086@24284 -
2013-04-21 13:34:49 +00:00
nickysn
a5c5b05362 * initial support for system procs that use calling conventions that push left to right on i8086 or i386
git-svn-id: branches/i8086@24282 -
2013-04-21 13:26:12 +00:00
nickysn
5caadbbc40 + added method tabstractprocdef.is_pushleftright that exists on all platforms and returns whether parameters must be loaded left to right
git-svn-id: branches/i8086@24281 -
2013-04-21 09:49:34 +00:00
nickysn
51d61cc593 * define the i8086 default calling convention separately from the other x86 architectures
git-svn-id: branches/i8086@24272 -
2013-04-19 23:30:53 +00:00
florian
f3ef5a1f9c + jvm lazarus project file
git-svn-id: trunk@24271 -
2013-04-19 16:50:55 +00:00
sergei
d54d38b4ab * Moved all code responsible for writing VMTs and interface wrappers (nobj.TVMTWriter, ncgutil.gen_intf_wrappers, ptype.write_persistent_type_info) into a new unit ncgvmt.pas.
This improves compiling speed a bit (two iterations over symtables replaced by one, code generator is created once per unit rather than once per class).
In perspective it makes possible to reduce amount of generated smartlink sections and global labels.

git-svn-id: trunk@24269 -
2013-04-19 13:31:27 +00:00
sergei
9dc5b07a68 * COFF: fixed setting section flags. Content type and access bits must be set for non-loadable sections as well.
* Changed .reloc sections to be non-loadable, all Windows DLLs have it that way (and ld produces the same as well).

git-svn-id: trunk@24262 -
2013-04-17 19:51:38 +00:00
florian
e1233e0111 * asizeint => longint, it is unlikely that an variant record well ever have more than 2^31 branches
git-svn-id: trunk@24260 -
2013-04-16 16:49:42 +00:00
Jonas Maebe
9023148bb1 * fixed compilation of JVM rtls after r24188 (there is no JMP_BUF type
on that platform)

git-svn-id: trunk@24259 -
2013-04-16 10:08:58 +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
1312fd72f2 * tmoddivnode.pass_typecheck: in the case of unsigned div/mod positive_const, check also the upper bound of the const, so it doesn't get truncated
git-svn-id: branches/i8086@24247 -
2013-04-14 21:56:32 +00:00
nickysn
fef3732884 * i8086 compilation fixes
git-svn-id: branches/i8086@24244 -
2013-04-14 16:34:02 +00:00
nickysn
3152df6e7f * fixed bugs in tx86inlinenode, introduced in r24237
git-svn-id: branches/i8086@24243 -
2013-04-14 16:16:47 +00:00
florian
99f2e57e42 * better error reporting
git-svn-id: trunk@24242 -
2013-04-14 15:51:25 +00:00
florian
2fdd3e2d0a + introduce tvariantrecbranch to be able to store
all needed information for iso compatible variant records
* new for variant records as required by iso pascal
+ tests

git-svn-id: trunk@24241 -
2013-04-14 15:50:42 +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
c916105db8 - rm ti8086procinfo.allocate_got_register as it isn't used on the i8086
git-svn-id: branches/i8086@24238 -
2013-04-14 14:35:51 +00:00
nickysn
97ca0fa323 - removed ti8086inlinenode.second_round_real, second_trunc_real and load_fpu_location as they mostly repeat the code in tx86inlinenode.load_fpu_location; tx86inlinenode.load_fpu_location adapted for i8086 instead
git-svn-id: branches/i8086@24237 -
2013-04-14 14:25:22 +00:00
sergei
02a288fd89 * MIPS addnode: rewritten almost completely:
* shorter by 280 lines
  * generates actual instructions instead of macros
  * uses immediate operands for constants when possible
  * 64-bit and float comparisons use LOC_JUMP as location

git-svn-id: trunk@24236 -
2013-04-14 12:12:36 +00:00
sergei
b86372ccec + Internal linker: process unreferenced .pdata sections on x86_64-win64, restores the possibility to use GAS on win64 (which got broken by introducing SEH).
git-svn-id: trunk@24235 -
2013-04-13 18:52:50 +00:00
nickysn
3870f76cda * ncgutil: set pushexceptaddr_frametype_cgsize and setjmp_result_cgsize according to cpu16bitaddr, instead of cpu16bitalu
git-svn-id: branches/i8086@24233 -
2013-04-12 13:38:18 +00:00
nickysn
107a6f6552 * i8086 versions of i386*.inc and r386*.inc renamed to i8086*.inc and r8086*.inc
git-svn-id: branches/i8086@24232 -
2013-04-12 12:06:28 +00:00
pierre
8a6e057fca Merge forgotten go32v2 2.6.0 branch changes back into trunk.
* Change it also in TInternalLinkerGo32v2.DefaultLinkScript method.
------------------------------------------------------------------------
r20578 | pierre | 2012-03-22 17:34:35 +0100 (Thu, 22 Mar 2012) | 1 line

 Force _environ to be the same as __environ
------------------------------------------------------------------------

git-svn-id: trunk@24229 -
2013-04-12 10:25:13 +00:00
nickysn
70a0d2989c * fixed tmoddivnode.pass_typecheck on 64-bit CPUs; I was wrong about uint64 div uint64 producing int64 on 64-bit CPUs; this fixes make cycle on e.g. x86_64
git-svn-id: branches/i8086@24226 -
2013-04-11 19:51:01 +00:00
sergei
c3f8086598 + Internal linker: base support for sections that aren't referenced but must be linked if section referenced by them is linked (like win64 .pdata). Actual handling is still to be implemented in descendant classes.
git-svn-id: trunk@24224 -
2013-04-11 17:42:09 +00:00
nickysn
3c6df5bedc * use is_nativeuint() in ninl.get_str_int_func(), instead of the ifdef sequence
git-svn-id: branches/i8086@24217 -
2013-04-09 20:39:58 +00:00
florian
7ac7d8a4b6 + define UNICODE as well as FPC_UNICODESTRINGS
git-svn-id: trunk@24214 -
2013-04-09 13:05:29 +00:00
nickysn
7a15fd0444 * in the case of (uint8 div/mod small_positive_const), convert the const to unsigned, so that we don't do a 16-bit division on 8-bit CPUs
git-svn-id: branches/i8086@24209 -
2013-04-08 18:08:10 +00:00
nickysn
3558766390 * first attempt to simplify tmoddivnode.pass_typecheck handling of all cpu native int sizes
git-svn-id: branches/i8086@24208 -
2013-04-08 17:11:33 +00:00
svenbarth
8353d53b69 Fix for Mantis #22433.
pdecsub.pas, parse_parameter_dec:
  * allow inline specialization for array types in mode Delphi

+ added test

git-svn-id: trunk@24207 -
2013-04-08 14:51:42 +00:00
florian
ec69ed5b3c * spelling fixed
git-svn-id: trunk@24205 -
2013-04-08 11:50:09 +00:00
florian
f80b6f4774 * arm thumb: take care of large offsets in interface wrappers
git-svn-id: trunk@24203 -
2013-04-07 21:56:37 +00:00
florian
dee35abf41 * arm thumb: let all registers used in a ldr/str operation interfere with the "hi" registers
git-svn-id: trunk@24202 -
2013-04-07 21:39:30 +00:00
florian
36a32e153d + arm thumb: tarmloadparentfpnode moves the stack pointer to a different register to avoid illegal instruction encodings
git-svn-id: trunk@24201 -
2013-04-07 21:29:12 +00:00
florian
e41b7b1b94 * arm thumb: strh/ldrh does not allow stack pointer based references with offset
git-svn-id: trunk@24200 -
2013-04-07 21:27:59 +00:00
florian
877c6e9ce9 * formatting
git-svn-id: trunk@24199 -
2013-04-07 21:26:56 +00:00
florian
b41728c129 * estimatedtempsize should be a longint to avoid warnings on 8 bit targets
git-svn-id: trunk@24198 -
2013-04-07 21:01:18 +00:00
florian
7ba197a221 * fix stack parameter handling for arm thumb
* fix entry/exit code generation for arm thumb

git-svn-id: trunk@24197 -
2013-04-07 21:01:15 +00:00
florian
f9ef8e90da + a_op_const_reg_reg for arm thumb taking care of availability of add sp,sp, ...
* handle references with base and index on arm thumb correctly

git-svn-id: trunk@24196 -
2013-04-07 21:01:11 +00:00
florian
9bbc24b5e3 * r13 might be used only under certain circumstance in memory reference on arm thumb
git-svn-id: trunk@24195 -
2013-04-07 21:01:08 +00:00
florian
79334242a2 * arm thumb uses always the stack pointer as frame pointer
git-svn-id: trunk@24194 -
2013-04-07 21:01:05 +00:00
florian
52070e26e1 * arm thumb uses always the stack pointer as frame pointer
git-svn-id: trunk@24192 -
2013-04-07 21:00:58 +00:00
florian
f25a905904 * fix register allocation initalization for arm thumb
* avoid that the register allocator creates code which writes to frame/stack pointer

git-svn-id: trunk@24190 -
2013-04-07 21:00:50 +00:00
florian
4e4cc4e289 * support neg instruction for spilling
git-svn-id: trunk@24189 -
2013-04-07 21:00:47 +00:00
florian
075abd6220 + support of stackframesize for arm thumb
+ estimatedtempsize to get a good estimatation for architectures which require to know the stack size before

git-svn-id: trunk@24188 -
2013-04-07 21:00:38 +00:00
nickysn
0dcbb4f1cc * refactored tunaryplusnode.pass_typecheck as well
git-svn-id: branches/i8086@24185 -
2013-04-07 16:50:30 +00:00
nickysn
a3117beb12 * refactored tunaryminusnode.pass_typecheck to handle all native int sizes generically, without ifdefs
git-svn-id: branches/i8086@24184 -
2013-04-07 16:45:52 +00:00
svenbarth
70886d1727 Fix the exception reported in Mantis #24072. This does not mean though that the bug is fixed, because the bug itself is related to the topic "partial specialization".
symtable.pas, sym_is_owned_by:
	* instead of checking in which symtables to not look, specify in which tables to look (namely object- and recordsymtables)

git-svn-id: trunk@24180 -
2013-04-07 13:44:56 +00:00
Jonas Maebe
8b8a786823 * moved ARM/x86 ifdef'ed code from ncgcal to virtual methods
git-svn-id: trunk@24179 -
2013-04-07 13:42:06 +00:00
Jonas Maebe
3a03586ca9 * give an error when declaring a class as conforming to a forward-declared
interface: the compiler does not/cannot check whether the class
    implements all required methods in that case, and it moreover leads to
    crashes (mantis #24184). Older versions of Delphi did allow this (and
    don't check whether the interface methods are implemented either), but
    that's simply a (similar) bug in Delphi that has been fixed in XE at
    least
  * fixed compilation of webtbs/tw2727 after this fix

git-svn-id: trunk@24177 -
2013-04-07 12:18:31 +00:00
nickysn
0473cbf70f * refactored the add node type check pass to handle all native integer sizes with the same common code, without ifdefs
git-svn-id: branches/i8086@24174 -
2013-04-07 11:03:08 +00:00
nickysn
2486009d37 + support u64bit as well in defutil.range_to_basetype
git-svn-id: branches/i8086@24173 -
2013-04-07 10:57:27 +00:00
nickysn
59976c3ac8 * use FixNonCommutativeOpcodes in agx86int.pas as well (fixes compilation for i386)
git-svn-id: branches/i8086@24168 -
2013-04-06 23:23:25 +00:00
nickysn
d88855566a + added defutil.is_nativesint and is_nativeuint
git-svn-id: branches/i8086@24167 -
2013-04-06 23:03:12 +00:00
nickysn
70d02e6942 + added defutil.is_nativeint and is_nativeord
git-svn-id: branches/i8086@24166 -
2013-04-06 22:58:04 +00:00
nickysn
7bce3c5208 * reverse the order of checks for determining the native int type (e.g. 8086 in large memory model would have 32-bit addresses, but a 16-bit native int)
git-svn-id: branches/i8086@24165 -
2013-04-06 22:44:07 +00:00
florian
ad0b0455d8 * extended comment
git-svn-id: branches/i8086@24152 -
2013-04-04 21:06:10 +00:00
nickysn
c3aaa37c0c * fixed a bug which caused non commutative fpu instructions to be wrong when using an intel-style external assembler and compiling a smartlinked unit
git-svn-id: branches/i8086@24151 -
2013-04-04 20:17:50 +00:00
florian
b817b6f62a * enable section smartlinking on all linux targets
git-svn-id: trunk@24146 -
2013-04-04 09:43:00 +00:00
nickysn
889e8650f1 * fixed compiler crash due to infinite recursion when compiling boolean to longint conversion on a 16 or 8-bit CPU
git-svn-id: branches/i8086@24135 -
2013-04-03 00:16:41 +00:00
sergei
999c3a0a02 * COFF linker: postpone import section generation until unreferenced sections (and imports) are removed, and put all remaining imports into a single section. This is much more efficient than generating multiple smart-linkable import sections and immediately discarding a good half of them.
git-svn-id: trunk@24123 -
2013-04-02 05:46:32 +00:00
nickysn
848eeceded * use min and max in defutil.get_common_intdef
git-svn-id: branches/i8086@24120 -
2013-04-01 20:25:42 +00:00
nickysn
949210e808 + added min and max functions for Tconstexprint
git-svn-id: branches/i8086@24119 -
2013-04-01 20:23:14 +00:00
florian
43b6139b66 + setlocalloc resets currentregloc
git-svn-id: trunk@24118 -
2013-04-01 19:52:46 +00:00
florian
364f170765 * cosmetic formatting changes
git-svn-id: trunk@24117 -
2013-04-01 19:52:43 +00:00
florian
7155808570 + ttempcreatenode.printnodedata writes tempinitcode node
git-svn-id: trunk@24116 -
2013-04-01 19:52:39 +00:00
nickysn
a8d72cc11a * bug fix in defutil.get_common_intdef
git-svn-id: branches/i8086@24115 -
2013-04-01 19:25:11 +00:00
nickysn
8a1178e4e9 * regenerated makefiles
git-svn-id: branches/i8086@24114 -
2013-04-01 17:30:11 +00:00
nickysn
873d5f7d05 * makefiles regenerated
git-svn-id: branches/i8086@24103 -
2013-04-01 02:02:53 +00:00
sergei
cded05ccef + MIPS linker: support linking PIC object files with non-PIC ones, by routing absolute calls into PIC code through stubs that load R25.
git-svn-id: trunk@24098 -
2013-03-31 19:58:52 +00:00
nickysn
526c3b9c9b * val, str and read/write(ln) now use is_oversizedint/ord to determine which helper function to use; this also clears the warnings that prevented compilation of the 64-bit targets
git-svn-id: branches/i8086@24092 -
2013-03-31 16:27:26 +00:00
nickysn
9c435a0bcb + added is_8/16bit and is_oversizedint/is_oversizedord helper functions in defutil.pas
git-svn-id: branches/i8086@24091 -
2013-03-31 16:25:22 +00:00
nickysn
7b8e18ba40 * updated aint to tcgint in jvm/hlcgcpu.pas as well (needed after r23761)
git-svn-id: branches/i8086@24088 -
2013-03-31 12:52:56 +00:00
nickysn
91038d6d0a * prevent compilation warning due to function result not being set in tinlinenode.first_seg
git-svn-id: branches/i8086@24084 -
2013-03-30 20:32:52 +00:00
nickysn
be761ba232 * sequences that check for cpu64bitaddr made to also check for cpu32bitaddr instead of cpu32bitalu. this fixes ppcjvm compilation
git-svn-id: branches/i8086@24083 -
2013-03-30 20:31:52 +00:00
nickysn
4d8adbf5ff + implemented Seg() for i8086 (small/tiny memory model)
git-svn-id: branches/i8086@24071 -
2013-03-30 13:04:58 +00:00
nickysn
917a1eb0f2 * the default Seg() handling moved to virtual methods, so that they can be overriden in the i8086 code generator
git-svn-id: branches/i8086@24070 -
2013-03-30 12:08:24 +00:00
nickysn
f270263d3d * default stack size for msdos changed to 4096 bytes
git-svn-id: branches/i8086@24066 -
2013-03-30 11:00:46 +00:00
nickysn
324b4a8a0a * declare the .bss sections with class=bss, so wlink treats them as bss sections and leaves them out of the executable
git-svn-id: branches/i8086@24064 -
2013-03-30 00:49:11 +00:00
florian
9375529430 + put guids in a constant pool as well
git-svn-id: trunk@24061 -
2013-03-29 18:48:55 +00:00
sergei
e4949e3044 + ELF linker: finish support for imported symbol versions.
git-svn-id: trunk@24056 -
2013-03-29 15:17:48 +00:00
florian
1ab42714c3 + fix compilation by adding a Int32 type, no sure why it is needed
git-svn-id: branches/i8086@24055 -
2013-03-29 15:15:12 +00:00
florian
fef7832790 * enable absolute for i8086-msdos
git-svn-id: branches/i8086@24054 -
2013-03-29 15:13:29 +00:00
sergei
29c0266fb9 + Added values for DT_FLAGS and DT_FLAGS_1 dynamic tags.
git-svn-id: trunk@24053 -
2013-03-29 14:46:44 +00:00
sergei
c5bf2ecb65 + MIPS linker: added ELF header flags, TLS relocations and an utility procedure to handle endianness.
git-svn-id: trunk@24052 -
2013-03-29 14:11:27 +00:00
florian
40af7b2817 + add msdos target to ppudump
git-svn-id: branches/i8086@24051 -
2013-03-29 10:46:34 +00:00
nickysn
615d6e4a51 * internal compiler handling of Val() fixed for 16/8-bit CPUs
git-svn-id: branches/i8086@24049 -
2013-03-29 01:38:21 +00:00
Jonas Maebe
9973a5737f * don't give an error when calling a class method on an object typecasted
into a class reference (problem introduced by r23976)

git-svn-id: trunk@24039 -
2013-03-28 18:45:09 +00:00
Jonas Maebe
4daa40f480 * reorder register parameters to minimise the number of register conflicts,
which usually (but not always) results in better register allocation

git-svn-id: trunk@24038 -
2013-03-28 18:44:57 +00:00
nickysn
1e28790e99 * fpc_PushExceptAddr's parameter Ft changed from LongInt to SmallInt on 16-bit CPUs for better efficiency
git-svn-id: branches/i8086@24036 -
2013-03-28 15:44:50 +00:00
sergei
1d32b107f5 * Made address comparison 64-bit safe.
* Referencing a section is basically referencing its AT_SECTION symbol, fixed reporting in map file.

git-svn-id: trunk@24029 -
2013-03-28 10:44:09 +00:00
Jonas Maebe
4992fd1c88 * prevent previously freed temp blocks from getting lost occasionally (can
significantly reduce the stack frame size, more than 3 times in one place
    in the compiler)

git-svn-id: trunk@24025 -
2013-03-27 17:16:34 +00:00
Jonas Maebe
477eeadaca * made alloctemp more generic
git-svn-id: trunk@24023 -
2013-03-27 17:16:26 +00:00
nickysn
5cda24a0b6 * fixed a lot of int64 const bugs on 16/8-bit CPUs by changing typecasts from aint to tcgint
git-svn-id: branches/i8086@24019 -
2013-03-27 01:01:15 +00:00
nickysn
f780d37d5e * proper defines of aitconst_ptr, aitconst_ptr_unaligned and aitconst_aint for 16-bit and 8-bit CPUs
git-svn-id: branches/i8086@24015 -
2013-03-27 00:01:30 +00:00
Jonas Maebe
262593c571 * "can not" -> "cannot"
git-svn-id: trunk@24012 -
2013-03-26 18:35:38 +00:00
nickysn
b79569ed2f * Borland Pascal compatibility for 16-bit CPUs: int16 shl int32 now produces int32; this fixes writeln(longint) on the i8086-msdos target
git-svn-id: branches/i8086@24011 -
2013-03-26 00:59:04 +00:00
nickysn
e16e08b2b6 + added CPU 286 nasm directive to the i8086 assembly output in order to catch 386+ instructions; the RTL now compiles without generating any 386+ instructions
git-svn-id: branches/i8086@24010 -
2013-03-26 00:57:38 +00:00
nickysn
53ad3fc662 + Str() handling in the compiler fixed for 16/8-bit CPU support
git-svn-id: branches/i8086@24009 -
2013-03-25 23:58:09 +00:00
nickysn
8fa9105151 + 16-bit and 8-bit CPU support added in the internal handling of read/readln/write/writeln
git-svn-id: branches/i8086@24007 -
2013-03-25 23:23:48 +00:00
pierre
702effaad0 Force use of PIC compatible calling for register variable calls as procvars might be internal or external and thus require PIC
git-svn-id: trunk@24005 -
2013-03-25 21:53:31 +00:00
nickysn
44ef72e1a4 * use the generic implementation of abs for the i8086
git-svn-id: branches/i8086@24004 -
2013-03-25 21:43:47 +00:00
nickysn
8d75441b6e * do not generate prefetchnt instructions on the i8086
git-svn-id: branches/i8086@24003 -
2013-03-25 19:18:18 +00:00
nickysn
f38114b34b * the result of FPC_SETJMP changed to 16-bit int on 16-bit CPUs
git-svn-id: branches/i8086@24001 -
2013-03-25 18:12:18 +00:00
florian
b231c049c9 * arm thumb knows only positively growing stacks
git-svn-id: trunk@24000 -
2013-03-25 17:56:13 +00:00
florian
93fcd9152e * arm thumb supports only tst reg1,reg2
git-svn-id: trunk@23997 -
2013-03-25 17:53:54 +00:00
nickysn
eefc9eed90 * do not use 'NEAR' conditional jumps on the i8086, because they are 386+
git-svn-id: branches/i8086@23993 -
2013-03-25 00:24:35 +00:00
nickysn
1f5d384a1e * i8086 fix in tx86casenode.genlinearlist
git-svn-id: branches/i8086@23990 -
2013-03-24 23:03:06 +00:00
nickysn
29c7d38e43 * 16-bit ALU fixes in tcgcasenode.genlinearcmplist
git-svn-id: branches/i8086@23989 -
2013-03-24 22:40:27 +00:00
florian
64bc09ae58 * fixes several issues with arm thumb stack frame
git-svn-id: trunk@23988 -
2013-03-24 21:40:23 +00:00
nickysn
284f1c904a * fixed a parameter pushing order bug on the i8086
git-svn-id: branches/i8086@23986 -
2013-03-24 20:41:51 +00:00
florian
b434b7bc7d * armv6-m has no blx <immediate>
git-svn-id: trunk@23983 -
2013-03-24 20:24:15 +00:00
florian
ac4a6accd3 + SVC instruction
git-svn-id: trunk@23980 -
2013-03-24 20:22:06 +00:00
florian
07762e5c25 + proper assembler command line parameters for arm thumb
git-svn-id: trunk@23979 -
2013-03-24 20:21:22 +00:00
nickysn
af5614e52d * i8086 parameter alignment fixes
git-svn-id: branches/i8086@23978 -
2013-03-24 20:15:39 +00:00
florian
89b4939cec * correctly handle stackframes with size>508 for arm thumb
git-svn-id: trunk@23977 -
2013-03-24 18:51:23 +00:00
Jonas Maebe
1601f6bea8 * treat methods called via records the same as records called via objects
without virtual methods: they may initialise the instance (mantis #23667)

git-svn-id: trunk@23976 -
2013-03-24 16:27:02 +00:00
florian
79d5d83f6c * fixed lazy english
git-svn-id: trunk@23975 -
2013-03-23 19:29:30 +00:00
florian
8c882f4235 * revert accidently committed file
git-svn-id: branches/i8086@23974 -
2013-03-23 19:27:21 +00:00
florian
1f978ba9fe * 16 bit targets cannot use Word and Longint as array index
git-svn-id: branches/i8086@23973 -
2013-03-23 19:25:00 +00:00
nickysn
e944e142b8 * first_parm_offset is 4 on i8086, not 8
git-svn-id: branches/i8086@23970 -
2013-03-23 01:47:31 +00:00
nickysn
1646f53d59 * fixed the 'unresolved externals' linker error when smartlinking msdos executables
git-svn-id: branches/i8086@23968 -
2013-03-23 00:47:12 +00:00
nickysn
a1ee8ab9bc * suppress annoying wlib header
git-svn-id: branches/i8086@23967 -
2013-03-23 00:08:52 +00:00
nickysn
fb12778f0e + add static libraries to the wlink script for the msdos target
git-svn-id: branches/i8086@23966 -
2013-03-23 00:05:50 +00:00
nickysn
f2242568bb * msdos omf library suffix changed to .lib
git-svn-id: branches/i8086@23965 -
2013-03-22 23:47:36 +00:00
nickysn
ac64663e70 + openwatcom wlib support added
git-svn-id: branches/i8086@23964 -
2013-03-22 23:44:33 +00:00
sergei
6f1997f5e5 + MIPS: added profiling support
git-svn-id: trunk@23950 -
2013-03-21 13:40:50 +00:00
Jonas Maebe
e621bff943 * don't make a deep copy of records (and in the future, objects) in with-
statements on the JVM target (mantis #24089)

git-svn-id: trunk@23945 -
2013-03-20 16:23:25 +00:00
svenbarth
376bd046aa Don't allow "static" for class operators or normal methods (except in objects).
pdecsub.pas, pd_static:
  * check whether the given pd is an operator or a class method not inside an Object and generate an error if either of these is true
msg/errore.msg, msgidx.inc, msgtxt.inc:
  * add a message to inform that a certain procedure directive is not allowed

+ added tests

git-svn-id: trunk@23944 -
2013-03-20 10:46:55 +00:00
florian
bac18a0094 * properly read asizeints from ppus on 16 bit targets
git-svn-id: branches/i8086@23939 -
2013-03-19 21:33:46 +00:00
florian
911ac847f7 * regenerated several automatically generated files after last changes
git-svn-id: branches/i8086@23936 -
2013-03-19 20:12:48 +00:00
florian
24f9d0d770 * cancel warning on i8086 because it stops compilation (the compiler is normally build with -Sew)
git-svn-id: branches/i8086@23933 -
2013-03-19 20:10:52 +00:00
florian
981570fe32 + added i8086 related stuff to compiler Makefile.fpc
git-svn-id: branches/i8086@23932 -
2013-03-19 20:09:45 +00:00
Jonas Maebe
0ad9f345dd * handle explicit typecasts of procdefs to procvardefs always via
proc_to_procdef, because a methodpointer may have to be discarded

git-svn-id: trunk@23929 -
2013-03-19 13:23:51 +00:00
Jonas Maebe
5152c86932 * set the location size of load nodes of procsyms without methodpointer/
framepointer
  * fixed conversion of procedure of object/nested procedure into a procvar
    that only contains the code address

git-svn-id: trunk@23928 -
2013-03-19 12:27:57 +00:00
Jonas Maebe
8b7071c8e8 * fixed recording generics token line info on big endian systems
git-svn-id: trunk@23926 -
2013-03-18 13:29:15 +00:00
nickysn
7b9fd7b9f4 * instruction size fixes in tcg8086.g_intf_wrapper
git-svn-id: branches/i8086@23925 -
2013-03-18 13:07:05 +00:00
nickysn
c4cee15481 * bug fix in tcg8086.a_load_reg_reg for loading larger register to a smaller one
git-svn-id: branches/i8086@23914 -
2013-03-18 01:03:37 +00:00
nickysn
b930c9a0db * all the remaining cases of the 'in' operator fixed (hopefully) for i8086
git-svn-id: branches/i8086@23905 -
2013-03-17 20:38:44 +00:00
florian
c345ed8945 * generate branches for arm-thumb which are always sufficient big, the optimizer can fix this later on
git-svn-id: trunk@23904 -
2013-03-17 20:26:06 +00:00
nickysn
8ca0b443b8 * another case of the 'in' operator fixed for i8086 ('x in const', when use_small=false and genjumps=false)
git-svn-id: branches/i8086@23903 -
2013-03-17 20:18:57 +00:00
nickysn
d7c9603351 * i8086 fixes for the 'in' operator in the case of 'unsigned,small,non_constant IN smallset'
git-svn-id: branches/i8086@23901 -
2013-03-17 17:40:15 +00:00
florian
d4613fe961 * update init_settings.setalloc in SetCompileMode if changeinit is set
git-svn-id: trunk@23898 -
2013-03-17 16:42:34 +00:00
florian
5a6e879248 * patch by Aleksa Todorovic: store relative include paths in PPUs, resolves #9961
git-svn-id: trunk@23897 -
2013-03-17 16:22:00 +00:00
nickysn
e6c8ac6694 * use the generic tcgaddnode.second_addsmallset on i8086, because the BTx instructions are 386+
git-svn-id: branches/i8086@23895 -
2013-03-17 15:40:54 +00:00
nickysn
a68dfed450 * defutil.is_smallset updated for 8/16-bit CPUs
git-svn-id: branches/i8086@23894 -
2013-03-17 15:31:57 +00:00
florian
fdde11fcc8 - -CPPAKCSET=NORMAL and CPPAKCSET=DEFAULT should set setalloc to 0 as $PACKSET=... with the same parameters does
git-svn-id: trunk@23893 -
2013-03-17 15:10:33 +00:00
florian
7511968f2b + warn if one of the linux libc startup code files is not found
git-svn-id: trunk@23892 -
2013-03-17 14:51:19 +00:00
florian
20a534e63f * fixed code which causes range check errors when compiled with -Cr
git-svn-id: trunk@23889 -
2013-03-17 14:24:50 +00:00
Jonas Maebe
e1e11f81e3 * fixed using readstr/writestr inside routines called from the parameter
list of another readstr/writestr expression (mantis #23912)

git-svn-id: trunk@23888 -
2013-03-17 14:23:33 +00:00
nickysn
cbf3b14e20 * yet another 8/16-bit ALU fix in thlcg2ll.location_force_reg
git-svn-id: branches/i8086@23887 -
2013-03-17 12:55:06 +00:00
florian
784641ec46 * delay parsing of the closing SEMICOLON of a uses clause till the
unit map is updated to avoid symbols not being found, resolves #8611

git-svn-id: trunk@23886 -
2013-03-17 11:06:04 +00:00
sergei
1c652eb8f9 MIPS procinfo improvements:
- Removed TMIPSProcInfo.needs_frame_pointer, it duplicates pi_needs_stackframe flag.
- Don't save RA for leaf procedures.
* GP is caller-saved register, it does not need saving/restoring as nonvolatile registers. Handle its restore position as a "normal" temp, whose offset is known before secondpass. This allows to handle PIC calls without involving GAS macro processing.

git-svn-id: trunk@23885 -
2013-03-17 08:43:39 +00:00
florian
d5985b4f0e * patch by Christophe Staïesse to implement more ISO-like read behaviour in iso mode, resolves #24060
git-svn-id: trunk@23884 -
2013-03-17 08:27:21 +00:00
nickysn
43dba74a5c + implemented 64-bit shl and shr for i8086
git-svn-id: branches/i8086@23882 -
2013-03-17 02:11:25 +00:00
nickysn
fbc41991f9 * i8086 fixes in tcgx86.a_op_reg_reg for 16-bit OP_SHR,OP_SHL,OP_SAR,OP_ROL,OP_ROR
git-svn-id: branches/i8086@23881 -
2013-03-17 00:05:05 +00:00
nickysn
f75ff8cc26 + enable the div helper for i8086
git-svn-id: branches/i8086@23880 -
2013-03-16 23:20:18 +00:00
nickysn
a9640ad9c6 + insert type conversion for the div result when cpuneedsdiv32helper is used
git-svn-id: branches/i8086@23879 -
2013-03-16 23:12:39 +00:00
nickysn
1dbca4c403 * 16-bit ALU fixes in tmoddivnode.pass_typecheck
git-svn-id: branches/i8086@23878 -
2013-03-16 22:50:09 +00:00
florian
88455bbb02 * 32 bit comparison normally result in LOC_FLAGS on 16 bit CPUs
git-svn-id: branches/i8086@23875 -
2013-03-16 20:02:36 +00:00
florian
636129ed8c * fix interface wrapper generation for i8086
git-svn-id: branches/i8086@23873 -
2013-03-16 19:57:36 +00:00
florian
d6f0a1a0df * do not generate scaled indicies for case table jumps for i8086
git-svn-id: branches/i8086@23872 -
2013-03-16 19:52:53 +00:00
nickysn
5dd5add67a * proper implementation of ti8086addnode.second_cmp64bit
git-svn-id: branches/i8086@23871 -
2013-03-16 19:01:15 +00:00
nickysn
56d2830beb + implemented 32-bit comparisons on the i8086
git-svn-id: branches/i8086@23870 -
2013-03-16 18:13:11 +00:00
nickysn
a274e62724 + added defutil.is_32bit helper function, similar to is_64bit
git-svn-id: branches/i8086@23869 -
2013-03-16 17:54:52 +00:00
florian
edd4c1ce4b * proper fix to avoid sp relative adressing as r23867 tries
git-svn-id: branches/i8086@23868 -
2013-03-16 16:51:31 +00:00
nickysn
01106a0968 * support stack relative addresses in a_loadfpu_reg_ref on the i8086
git-svn-id: branches/i8086@23867 -
2013-03-16 16:05:38 +00:00
nickysn
573ea10ef3 * fixed val when the 'code' parameter is the same size as the native CPU int type, but unsigned
git-svn-id: branches/i8086@23859 -
2013-03-16 12:42:37 +00:00
nickysn
b178a038f5 * set the FileRec size for i8086
git-svn-id: branches/i8086@23858 -
2013-03-16 12:07:39 +00:00
nickysn
a0e683bed6 * set the proper TextRec size for i8086
git-svn-id: branches/i8086@23854 -
2013-03-16 10:45:57 +00:00
florian
380bc56e32 + create a default heap on embedded targets and register this default heap
* sysutils for the embedded target depends on a working heap manager

git-svn-id: trunk@23853 -
2013-03-16 10:37:18 +00:00
nickysn
f4b5b4ce0f * implemented Trunc() and Round() for i8086
git-svn-id: branches/i8086@23852 -
2013-03-16 03:34:23 +00:00
masta
d60049a1fd Removing duplicated hash functions in compiler/cclasses.pas
FPHash was duplicated 4 times for different input types. I've
consolidated it to a single function with 3 proxy-functions which can be
inlined.

I've also modified the hash function itself slightly, it now resembled
the original DJB hash and seems to perform a tiny bit better.

git-svn-id: trunk@23850 -
2013-03-16 00:50:45 +00:00
nickysn
fdf831b4c6 * i8086 fix in tinlinenode.pass_typecheck for trunc and round
git-svn-id: branches/i8086@23849 -
2013-03-15 17:03:33 +00:00
pierre
8e2fcd6bfe Enable use of dllprt0 for netbsd
git-svn-id: trunk@23848 -
2013-03-15 16:21:22 +00:00
pierre
18ece9cf75 Also use VERSION in scripts for openbsd and netbsd
git-svn-id: trunk@23844 -
2013-03-15 15:39:32 +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
0683409703 + added i8086 to the CpuAddrBitSize and CpuAluBitSize const arrays in the 'ppu' unit
git-svn-id: branches/i8086@23839 -
2013-03-15 00:10:05 +00:00
nickysn
7d212a7e79 * default to intel assembler for delphi/tp7 modes also on i8086
git-svn-id: branches/i8086@23838 -
2013-03-14 22:19:10 +00:00
nickysn
99212c0f9c * define FPC_HAS_TYPE_EXTENDED for i8086; undefine FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE
git-svn-id: branches/i8086@23837 -
2013-03-14 21:11:10 +00:00
nickysn
30d661734c + enable tprocdef.fpu_used for i8086 also
git-svn-id: branches/i8086@23835 -
2013-03-14 16:33:37 +00:00
nickysn
89de81d4a9 + added n8086inl to the lazarus project ppc8086.lpi
git-svn-id: branches/i8086@23834 -
2013-03-14 16:31:34 +00:00
nickysn
e95d22d0f8 + added ti8086inlinenode
git-svn-id: branches/i8086@23833 -
2013-03-14 15:15:32 +00:00
pierre
1ad6aacb78 * Also use dllprt0 for openbsd
git-svn-id: trunk@23829 -
2013-03-14 13:51:16 +00:00
nickysn
44ce37369e * support 32-bit parameters that have a pair of two 16-bit locations in tcg8086.a_load_reg_cgpara
git-svn-id: branches/i8086@23825 -
2013-03-14 13:07:06 +00:00
nickysn
e956ffc27b * bug fix in the 32-bit parameters handling in tcg8086.a_load_const_cgpara
git-svn-id: branches/i8086@23824 -
2013-03-14 12:19:06 +00:00
sergei
6245bfd74f + ELF linker: load e_ident and e_flags from ELF header into properties of TElfObjData, necessary for targets that must be able to link together object files of different flavors.
git-svn-id: trunk@23821 -
2013-03-14 08:34:17 +00:00
nickysn
edc382aa76 * 16-bit ALU fixes in tshlshrnode.pass_typecheck
git-svn-id: branches/i8086@23817 -
2013-03-13 18:00:28 +00:00
nickysn
f048e3fd3b + support 16-bit pointers (i8086 near pointers) in defutil.def_cgsize
git-svn-id: branches/i8086@23816 -
2013-03-13 17:19:21 +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
ea282ab4b3 * many int64 fixes
git-svn-id: branches/i8086@23812 -
2013-03-12 23:18:36 +00:00
nickysn
79f43c22e9 * fixed passing of int64 constants as parameters
git-svn-id: branches/i8086@23811 -
2013-03-12 18:04:38 +00:00
nickysn
4e640511fb * tcgunaryminusnode.second_64bit fixed for < 32-bit CPUs
git-svn-id: branches/i8086@23810 -
2013-03-12 16:27:26 +00:00
nickysn
d0c43f50f0 * fixed ti8086addnode.second_add64bit
git-svn-id: branches/i8086@23809 -
2013-03-12 16:25:44 +00:00
nickysn
8645d8e6cb * fixed implementation of a_op64_reg_reg for i8086
git-svn-id: branches/i8086@23808 -
2013-03-12 16:24:28 +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
763ed6835a + added n8086mat to the lazarus project
git-svn-id: branches/i8086@23806 -
2013-03-12 14:31:30 +00:00
nickysn
19cbff220e + added unit n8086mat, based on n386mat; TODO: adapt to i8086
git-svn-id: branches/i8086@23805 -
2013-03-12 14:30:26 +00:00
nickysn
8d2b7df6d6 * fixed functions returning longint on i8086
git-svn-id: branches/i8086@23803 -
2013-03-12 13:35:19 +00:00
paul
e379daaf9c compiler, rtl: move cpXXXX.pas files from compiler to RTL\charmaps directory and cleanup them, enable charmaps building for the majority of targets
git-svn-id: trunk@23799 -
2013-03-12 01:35:25 +00:00
paul
3682fddc49 compiler: minor optimization of tscannerfile.recordtoken
git-svn-id: trunk@23798 -
2013-03-12 01:32:07 +00:00
nickysn
8d6017348a * fixed the defines of OS_PAIR and OS_SPAIR for cpus with 16-bit or 8-bit ALU
git-svn-id: branches/i8086@23797 -
2013-03-12 01:00:40 +00:00
nickysn
d72d496478 * enable cpuneedsmulhelper for the 32-bit multiplication
git-svn-id: branches/i8086@23796 -
2013-03-11 23:43:00 +00:00
nickysn
2872fb95b5 * i8086 multiplication fixes; 16-bit multiplication now works; 32-bit still doesn't
git-svn-id: branches/i8086@23795 -
2013-03-11 22:31:17 +00:00
nickysn
ee005a9c1b - rm forgotten debug writeln
git-svn-id: branches/i8086@23792 -
2013-03-11 20:41:09 +00:00
nickysn
48bba896a5 * cpu16bitalu fixes in tcgshlshrnode.second_integer
git-svn-id: branches/i8086@23791 -
2013-03-11 16:13:25 +00:00
nickysn
78cf362a90 * fixed passing of constant longint parameters
git-svn-id: branches/i8086@23788 -
2013-03-11 01:08:59 +00:00
nickysn
ec3d9ebc8a wlink support added and made the default
git-svn-id: branches/i8086@23787 -
2013-03-10 21:41:59 +00:00
florian
2c7b34cda1 * don't apply cse on static variables being regable
git-svn-id: trunk@23785 -
2013-03-10 20:29:52 +00:00
nickysn
da37d03dd7 alink support added and enabled by default
git-svn-id: branches/i8086@23784 -
2013-03-10 19:25:57 +00:00
florian
8c24a85462 * turn off stack frame stripping for i8086 for now, it cannot do sp relative addressing
git-svn-id: branches/i8086@23783 -
2013-03-10 18:53:49 +00:00
florian
b321f867c6 + trgintcpu.add_cpu_interferences for i8086 so references are properly build
* empty make_simple_ref code path for i8086

git-svn-id: branches/i8086@23782 -
2013-03-10 18:51:42 +00:00
nickysn
28f8a8e51d i8086-msdos linking with tlink support added
git-svn-id: branches/i8086@23781 -
2013-03-10 18:28:20 +00:00
florian
c2baf7b4c0 Merge r23058
git-svn-id: trunk@23776 -
2013-03-10 16:37:57 +00:00
florian
c0d4f189e9 * and takes three operands
git-svn-id: trunk@23775 -
2013-03-10 16:16:50 +00:00
florian
be81b89147 * fix bugs in previous commit
git-svn-id: trunk@23774 -
2013-03-10 14:33:10 +00:00
florian
086ae4b999 Merge r22905 and r22906
git-svn-id: trunk@23773 -
2013-03-10 10:45:34 +00:00
sergei
5e46732bc8 + One more missing call to unget_para (MIPS-specific)
git-svn-id: trunk@23766 -
2013-03-10 04:08:43 +00:00
nickysn
7d883e7d52 implemented tcg8086.g_flags2reg and g_flags2ref
git-svn-id: branches/i8086@23764 -
2013-03-09 23:45:42 +00:00
nickysn
8d346d162b added n8086add.pas (copy of n386add.pas), TODO: adapt to i8086
git-svn-id: branches/i8086@23762 -
2013-03-09 23:17:23 +00:00
nickysn
a03f0d84ea high level code generator: const types changed from aint to tcgint to avoid problems on < 32-bit cpus; ppcjvm should also be updated, but isn't yet
git-svn-id: branches/i8086@23761 -
2013-03-09 22:16:03 +00:00
nickysn
e2ba9f14e1 initial implementation of tcg8086.a_op_const_reg; supports 32-bit add, sub, and, or, xor
git-svn-id: branches/i8086@23759 -
2013-03-09 21:07:43 +00:00
nickysn
11f0b0b5aa tlocation.value (for LOC_CONSTANTs) changed to TCGInt to avoid trouble on < 32-bit cpus
git-svn-id: branches/i8086@23758 -
2013-03-09 20:57:19 +00:00