Commit Graph

15398 Commits

Author SHA1 Message Date
florian
d8ff85846f * don't reuse mm registers used by child nodes
git-svn-id: trunk@24897 -
2013-06-14 20:52:36 +00:00
florian
e81d2d1f3b * basic avx support for floating point operations (use -Cfavx to activate)
git-svn-id: trunk@24896 -
2013-06-14 20:03:01 +00:00
sergei
6a8e4f0381 * MIPS: generate real instructions, not macros, for comparisons with $zero.
* g_concatcopy, g_concatcopy_unaligned: call a_cmp_reg_reg_label instead of duplicating code.

git-svn-id: trunk@24895 -
2013-06-14 07:27:48 +00:00
sergei
fb88cc4257 * TCGMIPS.a_load_reg_reg: reduce code duplication, and don't generate same register move for OS_32->OS_S32 and vice versa. Such moves explode into at least 4 instructions if register needs spilling, after which they are no longer recognized and cannot be removed by reg.allocator. So it's much better not to generate them in first place.
* Implemented overflow checking for multiplication, no longer generate MULO and MULOU macros.

git-svn-id: trunk@24894 -
2013-06-14 00:12:17 +00:00
sergei
7e0ae2e984 * MIPS: fixed cgsize2subreg to return correct result for float registers.
- TCGMIPS.getfpuregister override is no longer necessary with the above fix.

git-svn-id: trunk@24893 -
2013-06-13 23:50:20 +00:00
svenbarth
b6bfa864d4 Disallow the usage of the inline assembler inside generics, because there are currently two problems:
1. At least on x86 the assembler reader initializes the parameter location informations which results in InternalError 200301231
2. Assembler tokens are not stored in the token stream and thus won't be reproduced during specialization

x86/rax86int.pas, tx86intreader.Assemble:
  * check for "parse_generic" before calling generate_parameter_info
pstatmnt.pas, assembler_block & statement:
  * generate an error message if an asm statement should be parsed inside a generic

+ added test

git-svn-id: trunk@24892 -
2013-06-13 19:42:49 +00:00
svenbarth
2e186a91fa Add support for integer constants to SetPEFlags and SetPEOptFlags. This is Delphi compatible.
scandir.pas:
  + add function "get_peflag_const" to retrieve the value of a constant
  * dir_setpeflags & dir_setpeoptflags: first check for an identifier (value is retrieved through "get_peflag_const") and then read a value

+ added messages for illegal parameters for SetPEFlags and SetPEOptFlags respectively
+ added tests

git-svn-id: trunk@24887 -
2013-06-13 10:51:42 +00:00
nickysn
4840a33b80 * also return true in is_calljmp() for the A_JCXZ instruction on the i8086
git-svn-id: trunk@24886 -
2013-06-12 23:42:45 +00:00
nickysn
511b1f37c1 * write the segment of aitconst_farptr on a separate line to avoid long symbol truncation, due to line length limit; this fixes compilation of sysutils in the medium memory model
git-svn-id: trunk@24879 -
2013-06-12 01:32:18 +00:00
nickysn
bb06899ec7 * clarified the comment for aitconst_farptr
git-svn-id: trunk@24868 -
2013-06-10 21:35:29 +00:00
nickysn
fa9c26f76f + medium memory model added to the compiler help messages
git-svn-id: trunk@24867 -
2013-06-10 21:04:54 +00:00
nickysn
d387182bd6 * when doing a pointer comparison on i8086, don't cast a far pointer to a near one (pchar), but use a far one instead
git-svn-id: trunk@24866 -
2013-06-10 20:53:11 +00:00
nickysn
894d400a7b + added is_farpointer(tdef) and is_hugepointer(tdef) helper functions to defutil
git-svn-id: trunk@24865 -
2013-06-10 20:50:05 +00:00
nickysn
70dbd7f667 * far pointer aware conversion of method pointer to plain procvar
git-svn-id: trunk@24863 -
2013-06-10 09:56:45 +00:00
sergei
562714129f * MIPS: get completely rid of LI macro, generate equivalent CPU instructions instead.
git-svn-id: trunk@24862 -
2013-06-10 02:07:21 +00:00
nickysn
6046edd8f9 + i8086/n8086cnv.pas added to lazarus project
git-svn-id: trunk@24861 -
2013-06-10 01:19:22 +00:00
nickysn
b342588af1 + i8086 specific far proc aware implementation of ttypeconvnode.second_proc_to_procvar
git-svn-id: trunk@24860 -
2013-06-10 01:19:01 +00:00
nickysn
9dbbffba61 + added trefaddr.addr_seg for referencing the segment of a symbol
git-svn-id: trunk@24859 -
2013-06-10 01:16:37 +00:00
nickysn
57e84dc0b4 * set the proper size for far procsyms in tcgloadnode.pass_generate_code
git-svn-id: trunk@24858 -
2013-06-10 01:06:02 +00:00
nickysn
c9096ef806 * far pointer fix in taddrnode.pass_typecheck
git-svn-id: trunk@24857 -
2013-06-09 23:07:30 +00:00
nickysn
b81f0ab50d + implemented tcg8086.a_call_reg_far; very hacky, but still better than doing a near call, when it should be far
git-svn-id: trunk@24856 -
2013-06-09 22:16:40 +00:00
nickysn
62316da236 * a_call_reg moved to a_call_reg_near
git-svn-id: trunk@24855 -
2013-06-09 22:09:39 +00:00
nickysn
e4a1230356 + added support for far pointer constants in the assembly output
git-svn-id: trunk@24854 -
2013-06-09 22:01:04 +00:00
nickysn
604b7c9deb + added cg.a_call_ref_near and a_call_ref_far
git-svn-id: trunk@24853 -
2013-06-09 20:22:47 +00:00
nickysn
6431ebe7f3 * treat the nil node as equal to near, far and all the special x86 pointer types
git-svn-id: trunk@24851 -
2013-06-09 19:04:03 +00:00
nickysn
2809ed6fb9 * updated tfiledef.setsize to support the size of textrec in the medium memory model
git-svn-id: trunk@24850 -
2013-06-09 18:22:47 +00:00
nickysn
435a97059d + enabled the command line option for the medium memory model
git-svn-id: trunk@24847 -
2013-06-09 17:57:42 +00:00
nickysn
b5c032874f * set the po_far flag by default in far code memory models
git-svn-id: trunk@24846 -
2013-06-09 17:54:29 +00:00
nickysn
093b87f50d * far code support for the internal type
git-svn-id: trunk@24845 -
2013-06-09 17:53:54 +00:00
nickysn
bfd65ea550 * use tprocvardef(def).size (which takes into account far code/data) to determine cgsize for procvars in def_cgsize
git-svn-id: trunk@24844 -
2013-06-09 17:51:56 +00:00
nickysn
1029636dfe * far proc fixes in tcgcallnode.pass_generate_code
git-svn-id: trunk@24837 -
2013-06-09 14:21:03 +00:00
sergei
b9bbe8ba67 * tai_const.getcopy: Check that 'sym' is assigned before trying to call its method. Mantis #24574.
git-svn-id: trunk@24836 -
2013-06-09 14:19:09 +00:00
nickysn
b6c979e55f + added tabstractprocdef.address_size which returns the actual address size of the proc, taking into account far procs
git-svn-id: trunk@24835 -
2013-06-09 13:39:13 +00:00
nickysn
3631198b34 + declare the text segment with class=code in the nasm header for far code memory models also
git-svn-id: trunk@24834 -
2013-06-09 13:01:40 +00:00
nickysn
9a6c242f97 + emit proper far calls/jmps for addr_far in the nasm assembly output
git-svn-id: trunk@24833 -
2013-06-09 12:59:44 +00:00
nickysn
f5a9442910 + added the appropriate startup code names for each memory model
git-svn-id: trunk@24832 -
2013-06-09 12:44:03 +00:00
nickysn
3280514d2b * in i8086 far code models, put the code in a section called module_name+'_TEXT', so each unit gets a separate code segment
git-svn-id: trunk@24831 -
2013-06-09 12:26:33 +00:00
nickysn
b74af9fda0 * declare the text segment with class=code on i8086-msdos
git-svn-id: trunk@24830 -
2013-06-09 12:13:52 +00:00
nickysn
af54de6d56 + added tcg8086.a_call_name_far and .a_call_name_static_far; a_call_name and a_call_name_static overriden and call near or far depending on the memory model
git-svn-id: trunk@24828 -
2013-06-09 10:54:30 +00:00
nickysn
ec497ae11e + the regular tcgx86.a_call_name and .a_call_name_static moved to .a_call_name_near and .a_call_name_static_near, because a_call_name and a_call_name_static are going to be overriden in tcg8086
git-svn-id: trunk@24827 -
2013-06-09 10:42:39 +00:00
nickysn
2279e51a95 + added trefaddr.addr_far for emitting far calls
git-svn-id: trunk@24826 -
2013-06-09 10:24:06 +00:00
nickysn
c1984bdf56 * take into account far code and far data in tprocvardef.size
git-svn-id: trunk@24823 -
2013-06-08 23:32:47 +00:00
sergei
86637a9ff9 * MIPS: pi_needs_got is necessary when doing unsigned to float conversions (it uses a global constant) and also if procedure does any calls in PIC mode.
git-svn-id: trunk@24822 -
2013-06-08 23:29:50 +00:00
sergei
5fe8b516d4 * Put string with unit name into sec_rodata_norel (other strings are already there since r23017, this one was missed).
git-svn-id: trunk@24821 -
2013-06-08 22:59:18 +00:00
nickysn
5966cc088d * got rid of tpointerdef.update_savesize, overrode size instead
git-svn-id: trunk@24819 -
2013-06-08 21:23:16 +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
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