sergei
d70a880f33
* SPARC: properly justify parameters on stack with size less than 4, fixes failure on tests/cg/tcalext5.pp
...
git-svn-id: trunk@26294 -
2013-12-28 09:23:10 +00:00
sergei
176d8434e4
* SPARC: completely rewrote PIC-related code, got it twice shorter in source lines and much less instructions in generated code.
...
+ Enable registers %i0..%i5 and %o7 for use by reg.allocator.
Some notable properties of this implementation are:
o pi_needs_got flag can be safely set during pass 2, so not setting it occasionally in pass 1 does not result in internal error.
o Reg.allocator configuration is independent from PIC. If procedure requires GOT, register %l7 is allocated at the prologue, making it unavailable to RA.
o GOT is stored in fixed %l7 register, but it is trivial to switch over to virtual register.
git-svn-id: trunk@26293 -
2013-12-27 19:53:38 +00:00
sergei
1a3b46967e
+ Two more checks for access to global data and setting the pi_needs_got flag, intended for targets that require decision about PIC code generation strictly before pass 2.
...
git-svn-id: trunk@26292 -
2013-12-27 13:41:36 +00:00
sergei
eaba90dda7
* SPARC: since peephole optimizer recognizes only one conditional branching instruction, generate all branches using A_Bxx opcode, and change it to A_FBxx if necessary when writing assembler. This enables optimization of floating-point branches.
...
* Assembler reader: rewrote branch condition matching part, don't try to match integer suffixes to floating-point branches and vice versa.
git-svn-id: trunk@26290 -
2013-12-27 06:45:49 +00:00
sergei
890d757573
+ SPARC: override g_external_wrapper method and emit PIC-safe jump without distance limit. Mantis #25455 .
...
git-svn-id: trunk@26286 -
2013-12-26 07:37:22 +00:00
nickysn
fdd36b4603
* on i8086 with regvars on, do not notify the register allocator of moves to BX.
...
This fixes compilation of unit math (and the whole RTL) with regvars enabled.
git-svn-id: trunk@26282 -
2013-12-25 12:19:21 +00:00
sergei
e6a9bfdc1d
* SPARC, g_concatcopy and g_concatcopy_unaligned: removed strange (probably long outdated) comments and unnecessary operations.
...
* g_concatcopy: avoid taking address of references if possible.
git-svn-id: trunk@26281 -
2013-12-25 10:45:25 +00:00
sergei
03fb83cc01
* SPARC: fixed PIC interface wrappers for non-virtual methods. The fix uses branching with 8 MB distance limit, but in particular case of interface wrappers this limit applies to code size of a single unit, not to entire program, and is therefore hard enough to reach.
...
git-svn-id: trunk@26279 -
2013-12-25 08:13:10 +00:00
nickysn
420f30bacd
* fixed the handling of OS_PAIR/OS_SPAIR-sized parameters in ncgutil.gen_load_cgpara_loc. This fixes 32-bit regvar'd parameters on i8086.
...
git-svn-id: trunk@26278 -
2013-12-24 23:07:44 +00:00
yury
eea69a2947
* ppudump: Fixed json and xml output of inline types in array declaration.
...
git-svn-id: trunk@26277 -
2013-12-24 12:32:55 +00:00
nickysn
af49e50a3c
* do not cause an internal error when location_reg2string is called on a
...
location where the registers have been translated (i.e. not imaginary), but
GetNextReg is necessary to get some of the registers (only on 16/8-bit CPUs).
The missing registers are indicated as '??'. This avoids a crash when
compiling a system unit on i8086 with regvars enabled and withous -sr, while
still giving the full list of registers when compiling with -sr.
git-svn-id: trunk@26276 -
2013-12-24 00:01:28 +00:00
nickysn
338d72f564
* extracted the code from psub.translate_registers for generating the name of
...
the registers from a tlocation to a new function called location_reg2string
+ added support for 16-bit and 8-bit ALUs in location_reg2string
git-svn-id: trunk@26275 -
2013-12-23 22:58:32 +00:00
yury
996ee048be
* ppudump: Properly handle type definitions inside a class definition for json and xml output.
...
git-svn-id: trunk@26273 -
2013-12-23 14:45:03 +00:00
nickysn
99770d367f
* 16-bit and 8-bit ALU fixes in tcgtempdeletenode.pass_generate_code
...
git-svn-id: trunk@26272 -
2013-12-23 14:09:28 +00:00
nickysn
39c54bf077
* handle ait_varloc in the nasm writer. This allows compiling the system unit
...
for i8086 with regvars and -sr for debugging purposes.
git-svn-id: trunk@26271 -
2013-12-23 13:27:22 +00:00
yury
bc14407ffe
* ppudump: Deref index -1 is valid for absolute symbols. Handle this.
...
git-svn-id: trunk@26270 -
2013-12-23 12:26:28 +00:00
sergei
65d24e000f
* SPARC: generate PIC prologue as recommended by ABI, it does not require FPC_GETGOT helper.
...
git-svn-id: trunk@26264 -
2013-12-22 14:20:18 +00:00
sergei
6469d41e2a
* SPARC: removed 32 bit shift code, and adjusted 64-bit shifts to take advantage of 3-address instructions (a port of r26142 for MIPS)
...
git-svn-id: trunk@26263 -
2013-12-22 14:09:24 +00:00
sergei
58cc531dd9
* SPARC: convert from int64/qword to float using genmath helpers. Removes dependency on softfloat code.
...
git-svn-id: trunk@26262 -
2013-12-22 14:02:34 +00:00
sergei
5ccdfcf106
* SPARC: optimized a_op_const_reg and a_op_const_reg_reg, take advantage of optimize_op_const functionality.
...
git-svn-id: trunk@26261 -
2013-12-22 13:54:49 +00:00
sergei
9a486d73ba
+ SPARC: support FNEGd/FNEGq internal instructions, and use them to implement floating-point negation more efficiently.
...
git-svn-id: trunk@26259 -
2013-12-21 16:27:24 +00:00
sergei
8ecad469a6
* Reverted r26256 since it produced wrong results if argument of inc/dec is actually unaligned. Added description of the issue and slightly increased node complexity at which address is cached, so operations on record/class fields do not take address.
...
git-svn-id: trunk@26258 -
2013-12-21 10:33:38 +00:00
sergei
c3fe0c7379
* On SPARC, using shifts for zero-extending to OS_16 is more efficient than ANDing with 65535 (two instructions and no temp registers vs. three instructions and a temp register).
...
git-svn-id: trunk@26257 -
2013-12-20 19:00:44 +00:00
sergei
b376f56bf3
* Use typed pointer to store address of x when processing inc(x)/dec(x) with range checking enabled. This preserves alignment of x and prevents generating unaligned code on alignment-sensitive targets.
...
git-svn-id: trunk@26256 -
2013-12-20 17:13:41 +00:00
sergei
5cd0684d45
* tcg.a_load_ref_reg_unaligned: if loading signed 16-bit value, treat upper half as signed 8-bit to ensure that result is properly extended. This routine is used only by SPARC target (other CPUs use specific implementations), and it generates pretty inefficient code, therefore it's probably worth to drop it altogether and implement SPARC-specific version. Mantis #25440 .
...
git-svn-id: trunk@26255 -
2013-12-20 17:07:00 +00:00
sergei
f2096de53a
* tcg386.g_proc_exit: instead of recalculating stack size, use current_procinfo.final_localsize which was calculated in g_proc_entry.
...
* tcgx86.g_proc_entry: don't over-allocate stack in SEH finalizer procedures.
git-svn-id: trunk@26251 -
2013-12-19 10:32:32 +00:00
sergei
258e8c58a4
+ Added trecorddef.buildderefimpl, necessary since advanced records have been implemented. Fixes compiler crash on webtbs/tw18688.pp on x86_64-win64.
...
git-svn-id: trunk@26250 -
2013-12-18 16:26:50 +00:00
nickysn
be5f49b3e5
* tx86addnode.second_cmpfloat: on i8086 only load the high byte of the FPU
...
status word after fstsw (and before sahf), because 8-bit memory transfers are
faster on the i8088, due to the 8-bit data bus
git-svn-id: trunk@26245 -
2013-12-16 23:52:28 +00:00
nickysn
ada9ccf6a6
* tx86addnode.second_cmpfloat: do not emit a fwait after fstsw as my own testing
...
on a true i8087 showed that the fwait isn't necessary
git-svn-id: trunk@26244 -
2013-12-16 23:17:44 +00:00
sergei
6ea9ce1077
* Force managed types to be always returned in parameters, independent of target (primitive types were already handled that way; the patch affects small records with fields of managed types).
...
* Generating code to finalize result on exception at callee side is no longer necessary.
git-svn-id: trunk@26228 -
2013-12-13 19:54:46 +00:00
nickysn
a7b4953795
+ proper (i.e. not broken) implementation of arctan() for the 8087 and 80287
...
git-svn-id: trunk@26226 -
2013-12-12 23:46:51 +00:00
sergei
179586f589
+ SEH support for Win32. Enable by cycling with OPT=-dTEST_WIN32_SEH.
...
Although basic things work (no regressions in test suite, also with TEST_OPT=-O2), there are some secondary issues/TODOs:
- Exception frame around PASCALMAIN is not properly removed in DLLs
- No stack traces yet
- Stack overallocated in finalizer procedures, their entry/exit code needs cleanup
- Signals unit is probably completely broken.
git-svn-id: trunk@26225 -
2013-12-12 12:43:46 +00:00
sergei
1ee9373fa6
* Changed function create_pd into method of ttryfinallynode, so it can be reused for Win32 SEH and, in the future, for DWARF-based exception handling on other targets.
...
* Additional two minor changes: reset po_delphi_nested_cc on result, so it is independent of current {$modeswitch nestedprocvar} state, and removed call to alloc_proc_symbol (which belongs to pass 2).
git-svn-id: trunk@26222 -
2013-12-12 08:38:06 +00:00
sergei
ffba5aee60
* MIPS: emit PIC-friendly instruction sequences instead of "J" when fixing up branches outside of 128K range. Resolves #25399 .
...
git-svn-id: trunk@26215 -
2013-12-11 10:56:07 +00:00
sergei
0e0273d53f
* Partially reverted r26192, preserving registers in presence of exceptions needs a different solution.
...
git-svn-id: trunk@26210 -
2013-12-10 12:43:24 +00:00
Jeppe Johansen
d24cbbf9f5
Changed debug information to dwarf for ARM_embedded, and set local minimum alignment to 4.
...
Fixed a bug where ARMv7M targets would not use the DIV instructions.
Moved many size-optimizing Thumb2 peephole optimizations to PostPeepHoleOptsCpu. Previously those optimizations could make it impossible to reuse the shared arm peephole optimizations.
Reenabled a fixed MLA/MLS peephole optimization.
Refactored some FindRegDealloc+regLoadedWithNewValue into RegEndOfLife calls.
Fixed some broken UXTB/UXTH optimizations. Previously they would also match UXT* instructions with ROR shifter ops.
git-svn-id: trunk@26198 -
2013-12-08 16:50:15 +00:00
florian
5aae381d10
* as nodes can appear directly in statements for checking of type conversions
...
git-svn-id: trunk@26195 -
2013-12-08 09:05:28 +00:00
sergei
e26ce9e442
* Fix code generation of for-loops. Keeping a copy of to-value in register during pass 2 is basically a hack, because register may be destroyed if an exception is raised and handled in loop body. This went unnoticed because generic setjmp-based exception handling is restoring registers to the state at entry to try block, and Win64 SEH also has some register-preserving features. However, for Win32 SEH it is not true.
...
Instead, to-value is now copied to a temp during pass 1, and this temp is forced into memory if loop body contains try..finally or try..except block.
git-svn-id: trunk@26192 -
2013-12-07 09:18:18 +00:00
sergei
563b74b16a
* Cleanup code generation for try..finally nodes.
...
git-svn-id: trunk@26191 -
2013-12-07 07:31:59 +00:00
sergei
f508442a7e
* Emit everything to the same asmlist (fixing copy-paste error).
...
git-svn-id: trunk@26187 -
2013-12-06 07:10:39 +00:00
nickysn
09a3fc74e3
* use the fwait prefixed FSTCW, followed by FWAIT, instead of FNSTCW in
...
tx86inlinenode.second_trunc_real, when generating code for the 8087
git-svn-id: trunk@26186 -
2013-12-05 23:33:33 +00:00
nickysn
2d45ea43af
* use the 'wait' prefix (on the same line as the instruction), instead of
...
'db 09bh' (on the previous line) for the fwait prefixed 8087 instructions in
the nasm assembly output, because it looks prettier this way :)
git-svn-id: trunk@26185 -
2013-12-05 21:31:16 +00:00
sergei
f42c1b3720
* Return dynamic arrays in parameter, this was the only managed type still returned in register. Returning managed types in registers requires catching and re-raising exceptions at callee side in order to finalize result and avoid memory leaks. While such behavior makes little difference with generic setjmp-based exception handling, it becomes very inefficient as SEH-styled exception handling is being introduced.
...
The new behavior is also Delphi-compatible.
git-svn-id: trunk@26180 -
2013-12-04 13:43:22 +00:00
nickysn
3555b76495
- rm FDISI,FENI,FSAVE,FSTCW,FSTENV and FSTSW from the requires_fwait_on_8087()
...
list, because these instructions already have a built in FWAIT prefix even
when targeting the 287/387+ both with the internal asm writer and with the
NASM back end.
git-svn-id: trunk@26178 -
2013-12-03 23:56:45 +00:00
nickysn
e9a4896565
- rm the 287/387+ FPU instructions from the requires_fwait_on_8087() list
...
git-svn-id: trunk@26176 -
2013-12-03 22:48:52 +00:00
Károly Balogh
71e492db1b
made arm-linux system unit compilable on anything but Thumb2 after r26161
...
git-svn-id: trunk@26175 -
2013-12-03 16:36:34 +00:00
yury
7e8ce16f6b
* ppudump: Output the "default" option for properties.
...
git-svn-id: trunk@26173 -
2013-12-03 14:31:33 +00:00
Jonas Maebe
2274150698
* fixed compilation with -Oodfa on big endian systems
...
git-svn-id: trunk@26169 -
2013-12-02 13:42:48 +00:00
florian
4aebcdaa94
* enable node dfa for life information with -O3:
...
- all known issues with it are fixed
- the resulting warnings about uninitialized warnings are better than that ones from the old code
- with node dfa in place, stuff like dead store removal, strength reduction and ssa can be finished now
- drawback: with node dfa enabled, the compiler is 2-3% slower, there is still some room for improvement though
git-svn-id: trunk@26165 -
2013-12-01 17:02:19 +00:00
florian
6924cc0458
* optimize CheckAndWarn
...
git-svn-id: trunk@26164 -
2013-12-01 17:02:17 +00:00
florian
35206c3d93
* make ResetProcessing more efficient
...
git-svn-id: trunk@26163 -
2013-12-01 17:02:15 +00:00
florian
e914612423
* the win64 exception handling code messes with asm nodes, so mark the helper procedure that they contain assembler
...
git-svn-id: trunk@26162 -
2013-12-01 17:02:13 +00:00
florian
4d5119bf1c
* fixes several issues which cause warnings by the dfa code when using it to detect uninitialized variables
...
git-svn-id: trunk@26161 -
2013-12-01 17:02:08 +00:00
florian
99eadb91b3
* run CheckAndWarn to get proper locations for warnings about uninitialized variables
...
* several fixes to liveness analysis
* get rid of old version defines
+ tests
git-svn-id: trunk@26159 -
2013-12-01 17:01:51 +00:00
florian
c357212b45
+ search crt* files also in /usr/lib/x86_64-linux-gnu, multiarch supporting distros require this
...
git-svn-id: trunk@26158 -
2013-12-01 15:39:05 +00:00
sergei
409e176ded
* Factored reusable (SEH-related) piece of code into separate procedure.
...
git-svn-id: trunk@26157 -
2013-12-01 11:47:12 +00:00
sergei
d72478eb64
* Function tjvmaddnode.cmpnode2topcmp is, in fact, not specific to any target. Moved it to generic tcgaddnode and reused in tmipsaddnode, where the same functionality was implemented in different way.
...
git-svn-id: trunk@26151 -
2013-11-28 11:52:47 +00:00
sergei
e16e19b170
* MIPS: removed specific handling of 32-bit shifts, generic code does the job just well.
...
* Tweak 64-bit shifts to take advantage of 3-address instructions (i.e. don't operate on same register).
git-svn-id: trunk@26142 -
2013-11-27 11:33:52 +00:00
Jonas Maebe
5e0589f0a5
* fixed debug information for strings (index starts from 1, not from 0)
...
(mantis #25226 )
git-svn-id: trunk@26140 -
2013-11-26 19:59:53 +00:00
sergei
2a112ad01b
* MIPS: don't optimize reference twice for 64-bit loads and stores. Now loading/storing 64-bit value to global variable takes typically 3 instructions.
...
git-svn-id: trunk@26139 -
2013-11-25 14:27:35 +00:00
sergei
97a706c672
+ Add definitions for ELF header flags.
...
git-svn-id: trunk@26137 -
2013-11-25 13:59:12 +00:00
sergei
06735eaefc
+ MIPS peephole optimizer: eliminate redundant moves of floating point registers.
...
git-svn-id: trunk@26136 -
2013-11-25 13:57:19 +00:00
sergei
0bef197c84
* MIPS unary minus node: override the entire second_float method, not just emit_float_sign_change. Makes use of two-address neg.d/neg.s instructions, eliminating extra register moves.
...
git-svn-id: trunk@26135 -
2013-11-25 13:54:38 +00:00
Jonas Maebe
7be4e20307
* also don't put a value in registers if it is converted from a type that can
...
be held in one kind of register to a type that can be held in another kind
of register (mantis #25361 )
git-svn-id: trunk@26128 -
2013-11-24 12:49:23 +00:00
Károly Balogh
34702dbfc5
fixed staticlibprefix for Amiga and MorphOS
...
git-svn-id: trunk@26127 -
2013-11-24 04:19:59 +00:00
Károly Balogh
3d07b35d77
do not append directory separator when it is already there, as // equals /../ on Amiga, fixes smartlinked RTL build
...
git-svn-id: trunk@26126 -
2013-11-24 03:09:24 +00:00
Károly Balogh
ba89914471
use the new HASAMIGA instead of the non-existing AmigaShell
...
git-svn-id: trunk@26124 -
2013-11-24 01:22:07 +00:00
Károly Balogh
da3603e663
introduce HASAMIGA define to easily identify various Amiga flavors (similarly to HASUNIX)
...
git-svn-id: trunk@26123 -
2013-11-24 01:19:52 +00:00
nickysn
6fdadb6248
* 8087 fixes in tx86addnode.second_cmpfloat:
...
- use FSTSW instead of FNSTSW
- insert a FWAIT after the FSTSW, because the value is immediately loaded
afterwards by the integer unit of the CPU
git-svn-id: trunk@26110 -
2013-11-19 23:22:49 +00:00
nickysn
7ae59a62c5
* emit a FWAIT after a floating point store, when targeting the 8087 and 80287
...
git-svn-id: trunk@26109 -
2013-11-19 23:11:26 +00:00
paul
6e7cc22207
compiler: don't allow to assign to for-in loop variable (bug #0025318 )
...
git-svn-id: trunk@26108 -
2013-11-19 05:29:37 +00:00
nickysn
0020a2ed10
+ when targeting the i8087, emit FWAIT prefix manually for the 8087 instructions
...
that require it in the NASM asm writer, since NASM doesn't do it itself.
git-svn-id: trunk@26107 -
2013-11-19 01:26:57 +00:00
nickysn
12b2f86e99
+ added function requires_fwait_on_8087(), which checks whether a given
...
instruction needs adding a FWAIT prefix on the i8087.
git-svn-id: trunk@26106 -
2013-11-18 23:38:57 +00:00
nickysn
85e1f444c5
* is_ecx_used modified to only check the callee side, but after a call to
...
init_paraloc_info to ensure that the callee side paraloc info is created.
git-svn-id: trunk@26103 -
2013-11-17 15:46:56 +00:00
nickysn
fbca7ee2cb
* check callerside if calleeside isn't available in is_ecx_used. Based on the
...
patch by Do-wan Kim, mantis #25269 .
git-svn-id: trunk@26101 -
2013-11-16 19:39:15 +00:00
sergei
bca2c464da
* Don't generate x87 instructions for sin and cos on win64, somehow managed to not commit this part in r25995. Mantis #17273 .
...
git-svn-id: trunk@26094 -
2013-11-15 10:37:59 +00:00
Jonas Maebe
b6d279d4aa
* don't transform div-by-power-of-2 into a shift when overflow checking is
...
enabled (mantis #23849 )
git-svn-id: trunk@26089 -
2013-11-14 15:47:49 +00:00
Jonas Maebe
9b1a36fcdb
* don't call buildderef for the local symtable of procdefs unless we will
...
write it to the ppu
git-svn-id: trunk@26083 -
2013-11-13 20:52:38 +00:00
florian
92508a9801
* take of life of tlabelnode.left, the test does not test this however because I'am not aware of any example to force a left node for a label
...
git-svn-id: trunk@26082 -
2013-11-13 19:26:37 +00:00
sergei
3ce0b33302
* Win64 SEH: when creating a finalization procedure, put its def into the same symtable with sym. By default, defs are added into symtablestack.top, which may be set to something temporary like exceptsymtable. In such cases it is possible that def is destroyed before sym, leaving sym with invalid pointers.
...
git-svn-id: trunk@26077 -
2013-11-13 12:27:27 +00:00
pierre
2370669f86
Avoid infinite recursion on generic classes for IDE browser
...
git-svn-id: trunk@26068 -
2013-11-12 16:39:20 +00:00
Jonas Maebe
864a72ee69
* fixed (harmless) range errors
...
git-svn-id: trunk@26067 -
2013-11-12 16:11:17 +00:00
nickysn
dc432918da
+ enabled the use of the DIV/IDIV instruction for 16-bit div/mod on i8086
...
* ti8086.moddivnode.pass_generate_code: use cg.a_op_const_reg, instead of
emit_const_reg, in order to support generating plain 8086/8088 code
(shr/shl/sar reg,const is 186+ if const is >= 2).
git-svn-id: trunk@26063 -
2013-11-11 22:34:41 +00:00
nickysn
bd083c0b8e
* ti8086moddivnode.pass_generate_code converted to 16-bit. Note that this code
...
is still not active, due to the cpuneedsdiv32helper define, but will
eventually be enabled for 16-bit divisions.
git-svn-id: trunk@26062 -
2013-11-11 21:01:13 +00:00
Jonas Maebe
8d1fb0ee1c
* added a safety check to gen_load_cgpara_loc()
...
git-svn-id: trunk@26024 -
2013-11-10 23:27:05 +00:00
Jonas Maebe
8a0caea0c0
+ override g_save_registers() and g_restore_registers() with do-nothing versions
...
for high level code generator targets
git-svn-id: trunk@26023 -
2013-11-10 21:33:38 +00:00
Jonas Maebe
1b6e4e572f
- removed duplicate thlcg2ll a_label method (it's declared the same in
...
thlcgobj and not virtual in either class)
git-svn-id: trunk@26022 -
2013-11-10 21:32:39 +00:00
Jonas Maebe
8cdde466bb
* include fpcdefs.inc
...
git-svn-id: trunk@26021 -
2013-11-10 21:30:55 +00:00
Jonas Maebe
62e1df9e76
* fixed indentation
...
git-svn-id: trunk@26020 -
2013-11-10 21:25:34 +00:00
Jonas Maebe
c1cec52897
* fixed alignment of bitpacked arrays of ordinals/enums: the prevous code
...
always returned the alignment of enum/ordinal by itself, which could be
either bigger or smaller than what was required
* for non-bitpacked regular arrays, always use the alignment of the elements
instead of sometimes the natural alignment of the size of the elements
(which can be different)
git-svn-id: trunk@26019 -
2013-11-10 21:22:28 +00:00
nickysn
dea947f87b
* fixed tcgx86.a_op_const_ref for shl/shr/sar/rol/ror on i8086 and x86_64
...
git-svn-id: trunk@26018 -
2013-11-10 20:39:47 +00:00
florian
412dc6586f
* the writestr helper initializes the target string, so mark it as being written
...
before the call to the helper to get proper life information
git-svn-id: trunk@26017 -
2013-11-10 20:20:40 +00:00
florian
8be7cfa05f
* check the scope of a variable when checking dfa based uninitialized variables,
...
dfa is procedure local only so consider only variables of the current scope
git-svn-id: trunk@26016 -
2013-11-10 20:20:38 +00:00
florian
57586b69c7
* implicit try...finally frames are added after dfa so we don't have to take care if the subroutine needs/uses those or not
...
git-svn-id: trunk@26015 -
2013-11-10 20:20:36 +00:00
florian
3cb747f4a7
* mark the node which is the entry of the user code with a flag
...
* check for uninitialized variables at the node which is marked as the start of the user code
git-svn-id: trunk@26014 -
2013-11-10 20:20:27 +00:00
florian
24d88edf37
* fixes arm building after 26004
...
git-svn-id: trunk@26012 -
2013-11-10 17:46:03 +00:00
Jonas Maebe
f348e89112
- removed too early assignment of have_first_symbol:=true, making the later
...
check of "if not have_first_symbol and dosub then" always evaluate to
false (found by looking at the results of constant propagation :)
git-svn-id: trunk@26011 -
2013-11-10 15:08:28 +00:00
florian
a0f0d0de40
* make use of the noreturn directive for internalerror
...
* clean up of the internalerror procedure variable in the constexp unit
git-svn-id: trunk@26004 -
2013-11-10 09:01:03 +00:00
florian
1d4a4d0684
+ noreturn directive
...
git-svn-id: trunk@26003 -
2013-11-10 09:00:59 +00:00
nickysn
039979fdcc
* handle 4-byte records in registers as well in location_force_mem on i8086
...
git-svn-id: trunk@26002 -
2013-11-09 21:57:29 +00:00
Jonas Maebe
0302453912
* disabled the lea->add transformation added in r25907 because it breaks
...
webtbs/tw15694.pp. Such transformation require liveness analysis of
the flags
git-svn-id: trunk@26001 -
2013-11-09 18:42:23 +00:00
nickysn
b8de1370a0
* fixed assignment of i8086 method pointers, when the source is in a register
...
git-svn-id: trunk@25999 -
2013-11-09 16:50:56 +00:00
sergei
2b1e5f7014
* Mantis #17273 : don't generate x87 instructions on win64 target.
...
git-svn-id: trunk@25995 -
2013-11-08 13:31:07 +00:00
pierre
a091c26750
* Use mips everywhere for big endian mips target
...
git-svn-id: trunk@25992 -
2013-11-07 21:38:43 +00:00
nickysn
d0f988f7a8
* don't use LEA in the code generator on i8086, as this breaks it quite badly.
...
While it is possible to use 16-bit LEA on the i8086, it's probably not worth
doing it in the code generator, because of the unpleasant register
restrictions that 16-bit references have.
git-svn-id: trunk@25989 -
2013-11-07 17:00:58 +00:00
Jonas Maebe
2bb67ec47d
* corrected usage of CPUNO32BITOPS
...
git-svn-id: trunk@25988 -
2013-11-07 15:20:15 +00:00
florian
bbabb77ec9
* disable 32 bit operation optimization for powerpc64
...
git-svn-id: trunk@25979 -
2013-11-06 21:11:08 +00:00
florian
424d5cafb2
* cleanup
...
* handling of result node simplified
git-svn-id: trunk@25978 -
2013-11-06 21:11:06 +00:00
florian
cca520abd9
+ warn for uninitialized out parameters when dfa is enabled
...
git-svn-id: trunk@25977 -
2013-11-06 21:11:03 +00:00
florian
722c59bcb1
* use the correct node in CalcLife
...
git-svn-id: trunk@25976 -
2013-11-06 21:11:01 +00:00
florian
2fc4a7fdd7
* better DFA debugging information
...
git-svn-id: trunk@25975 -
2013-11-06 21:10:58 +00:00
florian
89f34965e9
* fix dfa of for nodes, loopiteration node introduced to get proper life information for the loop
...
git-svn-id: trunk@25974 -
2013-11-06 21:10:55 +00:00
florian
63757c84ad
* fix life information of block nodes
...
git-svn-id: trunk@25973 -
2013-11-06 21:10:52 +00:00
florian
1e4737c46d
* fix life information of for nodes
...
git-svn-id: trunk@25972 -
2013-11-06 21:10:50 +00:00
florian
31f3bb900c
* fix UpdateLifeInfo if n<>node
...
git-svn-id: trunk@25971 -
2013-11-06 21:10:48 +00:00
florian
1f05011113
* set successor of blocknodes properly
...
git-svn-id: trunk@25970 -
2013-11-06 21:10:45 +00:00
florian
b3c2a8ddb1
* set always resultnode as last node
...
git-svn-id: trunk@25969 -
2013-11-06 21:10:43 +00:00
florian
0a762e416f
* always create a resultnode, also for procedures
...
git-svn-id: trunk@25968 -
2013-11-06 21:10:40 +00:00
florian
1fb3c2e0c2
* the successor of the last node is the resultnode if one exists
...
* create def/use info for temp. nodes
git-svn-id: trunk@25967 -
2013-11-06 21:10:38 +00:00
florian
20942d8b45
* fix life information generation of for nodes
...
git-svn-id: trunk@25966 -
2013-11-06 21:10:34 +00:00
florian
fa8abf7fcb
* handle constructors correctly during dfa: the result note must point to self
...
* handle inline nodes correctly during dfa: they can create/destroy defs
git-svn-id: trunk@25965 -
2013-11-06 21:10:32 +00:00
florian
6f03d04fe1
* when using a pointer as array, the pointer is never written, only read
...
git-svn-id: trunk@25964 -
2013-11-06 21:10:30 +00:00
florian
9fdd64e94c
* indention and new line fixes
...
git-svn-id: trunk@25963 -
2013-11-06 21:10:28 +00:00
florian
1a4584f4c6
+ dead store elimination, based on a patch by Jeppe Johansen
...
git-svn-id: trunk@25962 -
2013-11-06 21:10:26 +00:00
florian
aef0841fe4
* unified internalerror
...
git-svn-id: trunk@25961 -
2013-11-06 21:10:23 +00:00
florian
b928b1e9c9
* reorganized generic optimization switches
...
git-svn-id: trunk@25959 -
2013-11-06 21:10:17 +00:00
florian
e8787c4b48
+ constant propagation, based on a patch by Jeppe Johansen
...
git-svn-id: trunk@25958 -
2013-11-06 21:10:15 +00:00
florian
d39b9059d6
* improve simplification of arithmetic nodes, based on a patch by Jeppe Johansen
...
git-svn-id: trunk@25957 -
2013-11-06 21:10:13 +00:00
Jonas Maebe
3ed60082d3
* don't generate typed constant initialisers for set and enum constants
...
declared local to functions on the JVM target, because we don't generate
field constants for them (fixes run time error when declaring a symbolic
enum/set constant in a function on the JVM target)
git-svn-id: trunk@25953 -
2013-11-06 16:10:58 +00:00
Jonas Maebe
3c7ad95f7d
* simplified RegInInstruction() and fixed range errors
...
git-svn-id: trunk@25950 -
2013-11-06 10:46:22 +00:00
Jonas Maebe
98a230d20f
* don't call swapendian for shortint (it's 1 byte -> upcast to word and then
...
swapped, which is wrong)
git-svn-id: trunk@25949 -
2013-11-06 09:44:29 +00:00
Károly Balogh
628149d923
support label offsets for ARM like GAS, allows things like ADR r4, .label + 256
...
git-svn-id: trunk@25938 -
2013-11-05 18:10:54 +00:00
Károly Balogh
b67e4fb8b3
added the ADR ARM pseudo instruction to instruction list
...
git-svn-id: trunk@25936 -
2013-11-05 13:16:33 +00:00
florian
b147693cc5
* comment updated
...
git-svn-id: trunk@25913 -
2013-11-01 20:22:46 +00:00
florian
1843ed59b5
* set p to a valid instruction
...
git-svn-id: trunk@25912 -
2013-11-01 20:09:28 +00:00
florian
ce9398f8d8
* do not reuse register on x86 either
...
git-svn-id: trunk@25911 -
2013-11-01 20:08:30 +00:00
florian
f132a804d6
+ handle 32 bit references on x86-64 so lea can be used for 32 bit arithmetics
...
git-svn-id: trunk@25909 -
2013-11-01 19:01:39 +00:00
florian
7fc1d70e49
* do reg2=reg1*const by lea if possible
...
git-svn-id: trunk@25908 -
2013-11-01 19:01:36 +00:00
florian
a16ceb6cdf
* replace lea by add if possible
...
git-svn-id: trunk@25907 -
2013-11-01 19:01:33 +00:00
florian
80f8f66c6e
* set file positions correctly in PeepHoleOptPass1
...
git-svn-id: trunk@25906 -
2013-11-01 19:01:31 +00:00
florian
4148637c8c
* fold mov/lea/mov as well if possible
...
git-svn-id: trunk@25905 -
2013-11-01 19:01:29 +00:00
florian
524cde8140
+ MatchReference
...
* refactored some code
git-svn-id: trunk@25904 -
2013-11-01 19:01:26 +00:00
florian
440cb33e80
* continue to use lea to adjust the stack pointer, it is the recommended way
...
git-svn-id: trunk@25903 -
2013-11-01 19:01:24 +00:00
florian
5eb578a44c
* generate sub instead of add from lea if appropriate
...
git-svn-id: trunk@25902 -
2013-11-01 19:01:22 +00:00
florian
f56d2d4b09
* be able to replace lea by add when spilling
...
git-svn-id: trunk@25901 -
2013-11-01 19:01:20 +00:00
florian
d575a435c3
* some debugging infrastructure
...
git-svn-id: trunk@25900 -
2013-11-01 19:01:17 +00:00
florian
bfbb0c5b9d
* optimize mov/lea
...
git-svn-id: trunk@25899 -
2013-11-01 19:01:14 +00:00
florian
3c58cad96b
* make use of lea if possible
...
git-svn-id: trunk@25898 -
2013-11-01 19:01:11 +00:00
florian
945b318012
+ get rid of unnecessary 64 bit conversions too if one of the operands is 8 or 16 bit
...
git-svn-id: trunk@25897 -
2013-11-01 19:01:09 +00:00
florian
d201bcb1cd
* get rid of 64 bit operations on 64 bit targets as well if possible
...
git-svn-id: trunk@25896 -
2013-11-01 19:01:06 +00:00
florian
c8743c4826
* support 32 bit operations on x86-64 in the code generator
...
git-svn-id: trunk@25895 -
2013-11-01 19:01:02 +00:00
Jonas Maebe
7b97752d0b
- removed commented out duplicate thlcg.getmmregister()
...
git-svn-id: trunk@25887 -
2013-10-31 12:30:53 +00:00
nickysn
8bfe2a56dd
* optimized SAR by 31 to use only one SAR instruction in tcg8086.a_op_const_reg
...
git-svn-id: trunk@25883 -
2013-10-30 16:53:59 +00:00
nickysn
f288859fba
* i386 optimization - remove the test/or %y, %y instruction in the sequence:
...
shl/sal/shr/sar $x, %y
test/or %y, %y
jz/jnz/setz/setnz/cmovz/cmovnz ...
git-svn-id: trunk@25881 -
2013-10-29 17:34:32 +00:00
sergei
66e82f1655
+ i386: generate optimized code for 64-bit arithmetic shifts by constant amount. Shifts by 63 and by less than 32 take just two instructions, shifts by 32..62 bits are done with 3 instructions.
...
git-svn-id: trunk@25880 -
2013-10-29 16:10:13 +00:00
sergei
486a7ef81e
* tx86inlinenode.second_popcnt: use emit_ref_reg instead of appending instruction directly, this provides proper PIC handling of the reference. emit_reg_reg part is not strictly necessary, but done for consistency.
...
git-svn-id: trunk@25878 -
2013-10-28 16:40:42 +00:00
sergei
6a08ca3f0b
* tmoddivnode.firstoptimize improvements/fixes:
...
* Fixed misplaced parentheses, which were preventing optimization of "unsigned mod power_of_two" into "and" expressions.
* Handling "signed div power_of_two": properly delete the temp node, removes warnings when compiled with "-dEXTDEBUG". This however requires another temp node for storing the result.
* Replaced direct calls to "fpc_sarint64" with inline nodes (in_sar_x_y), allowing target-specific optimizations to take place.
git-svn-id: trunk@25877 -
2013-10-28 15:55:13 +00:00
sergei
9ad98a2c4d
* Handle "SarInt64" always as internal procedure, introduced virtual method tinlinenode.first_sar that by default converts it into call to "fpc_sarint64" unless target CPU is 64-bit. This provides a point to insert target-specific optimizations.
...
git-svn-id: trunk@25876 -
2013-10-28 14:31:36 +00:00
nickysn
12b1e0cbfd
+ tell wlink to add dwarf debug info to the executable when -gw2/3/4 is used
...
git-svn-id: trunk@25874 -
2013-10-27 20:30:00 +00:00
nickysn
9f979eb5c6
* put the i8086-msdos dwarf debug sections in USE32 class=DWARF segments because
...
wlink wants them this way
git-svn-id: trunk@25873 -
2013-10-27 20:28:43 +00:00
nickysn
93a706f1a0
+ allow smartlinking and dwarf debug info at the same time for i8086-msdos
...
git-svn-id: trunk@25872 -
2013-10-27 20:26:34 +00:00
nickysn
90a092e585
+ added enum Tdwarf_addr with the values of DW_AT_address_class (to be used for
...
the i8086-msdos debug info)
git-svn-id: trunk@25871 -
2013-10-27 18:40:59 +00:00
Jonas Maebe
c693a91e18
* fixed compilation after r25847 (mantis #25237 )
...
git-svn-id: trunk@25870 -
2013-10-27 17:35:04 +00:00
Jonas Maebe
353c15fb34
* fixed size of temporary register used to evaluate smallset<=/>=smallset
...
git-svn-id: trunk@25869 -
2013-10-27 17:34:59 +00:00
florian
17dcd2fa31
* get rid of unneeded 64 bit multiplications, it makes also for signed operations no difference if a calculation is carried out with 32 or 64 bit, if the result is casted to 32 bin again
...
git-svn-id: trunk@25868 -
2013-10-27 16:47:37 +00:00
florian
0eeb3e8d49
* check if the pointer is really assigned when trying to remove unneeded jumps
...
git-svn-id: trunk@25867 -
2013-10-27 16:47:34 +00:00
nickysn
e6a4435330
+ support the aitconst_XXbit_unaligned const types in the NASM asm writer. This
...
fixes DWARF support when using NASM.
git-svn-id: trunk@25866 -
2013-10-27 15:21:30 +00:00
paul
d16606b04c
compiler: revert r25852 since 10.9 is already handled
...
git-svn-id: trunk@25864 -
2013-10-27 14:17:29 +00:00
sergei
fbf6192aff
* tmipsaddnode.second_addfloat: don't bother reusing locations, always allocate a new register for result.
...
git-svn-id: trunk@25857 -
2013-10-26 18:15:24 +00:00
sergei
dd472dbfb0
* MIPS: when converting int to real, use a floating point constant directly, instead of emulating it with integers. tai_real_64bit already handles all endian issues.
...
git-svn-id: trunk@25856 -
2013-10-26 18:12:25 +00:00
sergei
40239e8bcc
* Elaborating removal of branches with delay slots: ignore reg. deallocations that are inserted by RA between branch and its delay slot instruction.
...
* Also skip possible ait_marker's between branch and its immediately following target (which was preventing certain optimizations of "exit" statements on all targets because procedure's exit label is always preceded by location marker).
git-svn-id: trunk@25855 -
2013-10-26 17:45:01 +00:00
florian
de2e4632c5
* if a build-id is generated, put it into flash
...
git-svn-id: trunk@25853 -
2013-10-26 14:19:14 +00:00
paul
43b9308929
compiler: also skip crt1.o for osx 10.9
...
git-svn-id: trunk@25852 -
2013-10-26 13:36:40 +00:00
Jonas Maebe
40eafc3d82
* don't try to post-process embedded executables when linking is
...
disabled
git-svn-id: trunk@25851 -
2013-10-26 10:01:05 +00:00
svenbarth
c077adf499
Fix for Mantis #25132
...
defcmp.pas, objectdef_is_related:
* use "equal_defs" instead of "=", as the former also handles equivalence of specializations
+ added test
git-svn-id: trunk@25848 -
2013-10-25 19:50:56 +00:00
svenbarth
798bb91e90
Extract tdef.is_related plus its overrides in tobjectdef, trecorddef and tstringdef into a new function def_is_related in unit defcmp.
...
defcmp.pas:
+ add new function "def_is_related" which combines the "is_related" overloads of "tobjectdef", "trecorddef" and "tstringdef" (it returns "false" for other def types which is what "tdef.is_related" did)
* compare_defs_ext & compatible_childmethod_resultdef: change call from "x.is_related" to "def_is_related(x,...)"
symtype.pas, tdef:
- remove "is_related" method
symdef.pas:
- remove "is_related" in "tobjectdef", "trecorddef" and "tstringdef"
* tobjectdef.needs_inittable: for checking whether a Corba interface somehow inherits from a IInterface don't use "is_related" anymore (we want to avoid the dependency after all), but mimic the necessary functionality of "def_is_related"
htypechk.pas, nadd.pas, ncal.pas, ncnv.pas, ngtcon.pas, nld.pas, optvirt.pas, pdecobj.pas, pdecvar.pas, pexpr.pas, pgenutil.pas:
* change call from "x.is_related" to "def_is_related(x,...)"
symtable.pas
+ use unit defcmp
* change call from "x.is_related" to "def_is_related(x,...)"
jvm/njvmcnv.pas, jvm/njvmflw.pas:
* change call from "x.is_related" to "def_is_related(x,...)"
git-svn-id: trunk@25847 -
2013-10-25 19:44:27 +00:00
Jonas Maebe
b70e64dc67
* fixed some bugs in the camelCase conversion performed on the JVM target by
...
-CTlowercaseprocstart
o convert all consecutive uppercase characters at the start to lowercase
instead of only the first one. Exception: if there is more than one
such character and the last one is followed by a lowercase character,
assume the last uppercase character belongs to the second word (like
in FPCIsGreat) and don't lowercase that one
+ test
git-svn-id: trunk@25845 -
2013-10-23 22:44:45 +00:00
svenbarth
76f6de5cf1
Refactor tobjectdef.find_implemented_interface out into unit defcmp so that the recently introduced cycle between symdef and defcmp can be broken again.
...
defcmp.pas:
+ add function "find_implemented_interface"
* change method call of "find_implemented_interface" into function call
symdef.pas:
- tobjectdef: remove method "find_implemented_interface"
- remove use of unit "defcmp"
pgenutil.pas:
* change method call of "find_implemented_interface" into function call
+ add use of unit "defcmp"
ncgcnv.pas, ncnv.pas, pdecobj.pas, pdecsub.pas, pdecvar.pas:
* change method call of "find_implemented_interface" into function call
git-svn-id: trunk@25844 -
2013-10-23 19:05:00 +00:00
Jonas Maebe
555634b755
* (re)set upper bits of register when appropriate for all operations in
...
a_op_reg_reg() (except for NOT, which was already handled correctly)
+ test
git-svn-id: trunk@25840 -
2013-10-22 07:41:52 +00:00
nickysn
a0723ccfd5
* also check if ECX is nonvolatile in is_ecx_used. Not strictly necessary for the current set of i386 calling conventions, but good as an extra safety precaution in case new calling conventions are added or the code is adapted and used on other platforms.
...
git-svn-id: trunk@25839 -
2013-10-21 16:48:58 +00:00
svenbarth
d908dbeec1
Fix for Mantis #25215 .
...
compiler/scanner.pas, tscannerfile.readtoken:
* after trying to read a _INTCONST check whether a valid first character for an identifier follows and give a syntax error if that is not the case
+ added test
git-svn-id: trunk@25835 -
2013-10-20 12:15:49 +00:00
svenbarth
d91d4afb0f
Fix for Mantis #25210 .
...
compiler/pdecobj.pas, object_dec:
* since revision 25518 the global symtable of the current module is no longer popped and pushed again so that the defaware symtablestack can add the helper; thus we need to do this not only for static symtables, but for global ones as well
* adjusted comment to reflect current situation
git-svn-id: trunk@25834 -
2013-10-20 11:33:01 +00:00
nickysn
645cd11b9d
* fixed the assignment of global functions to nested procvars in i8086 far code
...
models
git-svn-id: trunk@25831 -
2013-10-19 20:42:39 +00:00
nickysn
378afb69b2
* optimization in tcg386.g_intf_wrapper: use the much more efficient case 1
...
for virtual methods, that use the register calling convention, but have at
least one free register (i.e. not used as a parameter and not required to be
preserved by the function)
git-svn-id: trunk@25830 -
2013-10-19 17:40:38 +00:00
nickysn
bfd31e7516
* optimizations in tcg8086.g_copyvaluepara_openarray:
...
- when elesize=2, avoid the SHR CX,1 instruction
- use rep movsw even for odd elesizes, unless cs_opt_size is set
git-svn-id: trunk@25829 -
2013-10-19 15:07:55 +00:00
nickysn
aca22a59f7
* optimizations in tcg386.g_copyvaluepara_openarray in order to avoid the
...
second IMUL
git-svn-id: trunk@25828 -
2013-10-19 12:56:58 +00:00
nickysn
0f69362edd
- rm LEA reg,imm from x86ins.dat, as that's not a valid x86 instruction,
...
using it in inline asm causes an internal error and removing it didn't show
any regressions after running the testsuite on i386-linux.
git-svn-id: trunk@25827 -
2013-10-18 23:26:58 +00:00
nickysn
ff9ce0d20d
* tcg8086.g_copyvaluepara_openarray improvements:
...
- use a_op_const_reg for the multiplication, instead of emitting directly
instructions, which are 186+
- avoid using IMUL twice, when the element size is not power of two
- rm the system_i386_win32 leftovers
git-svn-id: trunk@25826 -
2013-10-18 22:35:51 +00:00
nickysn
8744fbefbb
* add $parentfp as a first parameter on i8086, instead of last. This makes
...
regular non-nested procedures compatible with nested var procvars and fixes
the tmaclocalprocparam*.pp tests on i8086
git-svn-id: trunk@25825 -
2013-10-18 21:37:06 +00:00
nickysn
7e7ab2fd4d
* also handle nested proc ptrs in thlcgcpu.location_force_mem on i8086
...
git-svn-id: trunk@25824 -
2013-10-18 20:09:01 +00:00
nickysn
ef51c8c5a2
* fixed the interface wrapper code generation for virtual methods on i8086 in
...
the medium memory model
git-svn-id: trunk@25817 -
2013-10-18 12:11:50 +00:00
nickysn
116d3746ca
* fixed the stack offset to the self parameter when generating an interface
...
wrapper for a virtual method in tcg8086.g_intf_wrapper
git-svn-id: trunk@25816 -
2013-10-18 10:56:04 +00:00
nickysn
83aa50de74
* emit a far jmp in the interface wrapper on i8086 in far code memory models
...
git-svn-id: trunk@25812 -
2013-10-17 21:55:45 +00:00
nickysn
4aa010eedc
+ support LEA with 16-bit operand size
...
git-svn-id: trunk@25808 -
2013-10-17 16:11:08 +00:00
Jonas Maebe
8dd956cbde
* convert unicode/widestring constants to ansistring in resourcestring
...
declarations (mantis #25198 )
git-svn-id: trunk@25807 -
2013-10-17 12:43:39 +00:00
nickysn
814e1297ed
* tcg8086.g_adjust_self_value fixed for far code memory models
...
git-svn-id: trunk@25798 -
2013-10-15 23:34:18 +00:00
nickysn
7ff97d9b7d
* specify AT_DATA when refering to the 'RESSTR' symbols; among other things,
...
this fixes resourcestring constants in the i8086 memory model.
git-svn-id: trunk@25796 -
2013-10-15 22:06:16 +00:00
nickysn
bf07fc077b
* specify AT_DATA in all references to the tobjectdef.vmt_mangledname symbol.
...
This fixes a lot of bugs, related to objects and classes in the i8086 medium
memory model
git-svn-id: trunk@25794 -
2013-10-15 18:56:27 +00:00
nickysn
e160dab697
+ added i8086 to the list of supported CPUs by FPC.exe
...
git-svn-id: trunk@25792 -
2013-10-15 13:29:51 +00:00
Jonas Maebe
a28917086b
* updated *crt1* linking logic for OS X 10.8+:
...
o don't link by default
o when generating profiling info, link gcrt1.o and specify "-no_new_main"
linker parameter
* don't use version-specific crt1.o files when targetting the
iPhoneSimulator platform
* don't link a crt1.o file when targetting iOS 6 or later
(all info from
http://llvm.org/svn/llvm-project/cfe/trunk/lib/Driver/Tools.cpp )
git-svn-id: trunk@25789 -
2013-10-14 21:38:38 +00:00
Jonas Maebe
10ae87f11c
* fixed LdrLdr2LdrMov optimisation in case the first and second ldr have
...
a different size (disable it in that case) + test
git-svn-id: trunk@25778 -
2013-10-14 12:49:34 +00:00
Jonas Maebe
5276159e77
* correct ofset for saving floating point registers + explanation behind
...
the calculation (fixes make cycle on ARMHF)
git-svn-id: trunk@25777 -
2013-10-14 12:49:31 +00:00
Jonas Maebe
31a3122b91
* fixed LsrAnd2Lsr test by replacing the existing buggy check with comparing
...
the outcome of the original and the optimised sequence and seeing whether
it's same + test
git-svn-id: trunk@25776 -
2013-10-14 12:49:28 +00:00
Károly Balogh
74af6d0dab
enabled hardware mul reg, reg codepath for ColdFire too, accelerates tfloattostr test (thus some of the SoftFPU code) by a magnitude...
...
git-svn-id: trunk@25770 -
2013-10-13 21:36:24 +00:00
sergei
142d20ca30
* MIPS: cleanup assembler reader, MIPS references allow only a single register in parentheses.
...
git-svn-id: trunk@25768 -
2013-10-13 21:22:04 +00:00
sergei
e10e383b8e
* MIPS: ".set macro"/".set nomacro" directives around ".cprestore" are necessary only when offset is outside smallint range. Otherwise they just clutter the assembler file.
...
git-svn-id: trunk@25767 -
2013-10-13 20:23:43 +00:00
Károly Balogh
97864d7cbd
trying harder to commit compilable code (manual merge fail)
...
git-svn-id: trunk@25764 -
2013-10-13 18:31:43 +00:00
nickysn
c51c75936b
* 16/8-bit ALU fixes in ncgutil.gen_free_symtable
...
git-svn-id: trunk@25762 -
2013-10-13 16:48:15 +00:00
nickysn
1dabaf5ded
* 16/8-bit ALU fixes in ncgutil.add_regvars
...
git-svn-id: trunk@25761 -
2013-10-13 16:41:32 +00:00
nickysn
d1f0eea902
* 16/8-bit ALU fixes in ncgutil.gen_alloc_regvar
...
git-svn-id: trunk@25760 -
2013-10-13 16:31:16 +00:00
Károly Balogh
3b99974847
set up register A6 to be saved as well. this will only happen in case A6 is not used as framepointer
...
git-svn-id: trunk@25759 -
2013-10-13 16:12:32 +00:00
Károly Balogh
e5eac1bd44
make the array of registers to use depending on wheter we have an FP or not, and which register we have as FP
...
git-svn-id: trunk@25758 -
2013-10-13 16:06:35 +00:00
nickysn
fd05d0c14e
* 16/8-bit ALU fix in maybechangeloadnodereg. This fixes the tbopr and trox2
...
tests on i8086.
git-svn-id: trunk@25752 -
2013-10-13 11:35:56 +00:00
nickysn
f6e846c574
+ added the NEC V20/V30 instructions
...
git-svn-id: trunk@25750 -
2013-10-11 21:27:56 +00:00
Károly Balogh
db49a169cb
handle more locations in tm68knotnode, fixes several tests failing to compile with 200203223
...
git-svn-id: trunk@25746 -
2013-10-11 02:51:23 +00:00
Károly Balogh
aedf2dc20d
fixed spilling operation type for A_LEA, fixes test tb0112 to compile, but still fails to run
...
git-svn-id: trunk@25745 -
2013-10-11 02:03:48 +00:00
Károly Balogh
275031a0dd
fix a bogus R_INTREGISTER to be R_ADDRESSREGISTER in getopstr()
...
git-svn-id: trunk@25744 -
2013-10-10 22:24:56 +00:00
Károly Balogh
fe3d11118c
add string version of the new instructions to the right place. removed one more duplicate table.
...
git-svn-id: trunk@25743 -
2013-10-10 22:12:40 +00:00
Károly Balogh
dfe2f253f9
added 68040 CPU type, MOVE16 and ColdFire V4 extra instructions
...
git-svn-id: trunk@25742 -
2013-10-10 22:01:58 +00:00
Károly Balogh
280ee919b7
removed several debug writeln()s
...
git-svn-id: trunk@25741 -
2013-10-10 21:20:20 +00:00
Károly Balogh
bcab04538c
removed unused table, cleanups
...
git-svn-id: trunk@25740 -
2013-10-10 21:19:15 +00:00
Károly Balogh
4c5f273bc5
removed redundant instruction table only used for ugly debug, and the ugly debug code itself
...
git-svn-id: trunk@25739 -
2013-10-10 21:16:07 +00:00
sergei
a5ae26da7e
* Moved SkipEntryExitMarker method from ARM optimizer to the base one, since it is not target-dependent. Now it can be reused by other targets.
...
git-svn-id: trunk@25738 -
2013-10-10 21:12:49 +00:00
sergei
90d66595c2
* typecheck_real_to_currency: generate inline round() node instead of direct call to fpc_round_real, this allows target-specific processing to take place and possibly emit more efficient code.
...
* Provide x86_64 SSE versions of fpc_trunc_real and fpc_round_real, strictly they are not necessary after the above change to code generation, but it still reduces size of system unit by avoiding compilation of related generic code.
git-svn-id: trunk@25735 -
2013-10-10 12:46:51 +00:00
svenbarth
6fef9a2c80
Correctly implement g_intf_wrapper. Fixes nearly 200 tests and now the cross compiled compiler is at least able to print the help (compiling a simple program does not work yet though).
...
m68k/cgcpu.pas, tcg68k:
+ override g_adjust_self_value as we don't do register allocation for the wrapper we need to adjust the Self value using the scratch registers (could be improved however) and we also can not use the offset that the original procedure in tcg uses
* fix g_intf_wrapper by using the correct operations and loading the correct (virtual) method offset
git-svn-id: trunk@25728 -
2013-10-09 19:56:17 +00:00
florian
babbc21afd
* fix handling of register sets on m68k: it is required that they are stored as two tcpuregistersets because address registers and data registers have different register types
...
git-svn-id: trunk@25726 -
2013-10-09 18:15:06 +00:00
paul
1c578de28c
compiler:
...
* don't allow to apply the same hint directive twice
* change parser_e_proc_dir_not_allowed to more generic variant parser_e_dir_not_allowed - they are similar and 'procedure' prefix does not give more information about the error.
* maybe_parse_hint_directives() uses procdef settings for initial values
+ add tests
git-svn-id: trunk@25720 -
2013-10-08 04:56:42 +00:00
Jonas Maebe
9619ed8b4b
- undo hack from r25713
...
* fix maybe_parse_hint_directives() when it is called multiple times for a
procdef that has a deprecation message specified (fixes crashes
reported in #25101/#25165)
git-svn-id: trunk@25719 -
2013-10-07 20:54:26 +00:00
nickysn
8fad859161
* the default packrecords setting changed to 1 on i8086 for Turbo Pascal 7
...
compatibility
git-svn-id: trunk@25718 -
2013-10-07 20:42:17 +00:00
nickysn
9d1ba65cec
* {$PackRecords NORMAL}, {$PackRecords DEFAULT} and {$ALIGN RESET} now set
...
packrecords to default_settings.packrecords, instead of 0
git-svn-id: trunk@25717 -
2013-10-07 20:41:19 +00:00
yury
b293f7e5c4
* ppudump: Do not skip unnamed inline array type definitions such as "var arr: array of integer";
...
git-svn-id: trunk@25716 -
2013-10-07 20:15:13 +00:00
svenbarth
a4683461cf
Fix around 25 tests (under them all tcalval* tests!) by indeed using the save/restore registers code I adjusted earlier.
...
m68k/cgcpu.pas, tcg68k:
- remove g_save_registers and g_restore_registers which DID NOT CALL inherited!
- also remove commented methods g_save_all_registers & g_restore_all_registers
git-svn-id: trunk@25715 -
2013-10-07 19:36:21 +00:00
paul
82243b5c9d
compiler: temporary disable hint directive parse if objectivec1 modeswitch set
...
git-svn-id: trunk@25713 -
2013-10-07 14:31:29 +00:00
paul
8f6f0d63a0
compiler: check modeswitches first
...
git-svn-id: trunk@25712 -
2013-10-07 13:17:22 +00:00
paul
912384594b
fpc: allow hint directives between other procedure directives in Delphi mode (issue #25101 )
...
git-svn-id: trunk@25710 -
2013-10-07 10:59:53 +00:00
nickysn
0aff18ac61
+ implemented tcg64f8086.a_op64_ref_reg
...
git-svn-id: trunk@25707 -
2013-10-07 00:17:03 +00:00
nickysn
3cdbf9a805
+ implemented tcg64f8086.a_op64_const_ref
...
git-svn-id: trunk@25706 -
2013-10-06 23:56:25 +00:00
nickysn
3bdd3d9a4e
+ optimization in tcg64f8086.a_op64_const_reg for OP_ADD and OP_SUB when the
...
lowest 48, 32 or 16 bits of the constant are zeros
git-svn-id: trunk@25705 -
2013-10-06 23:43:38 +00:00
nickysn
88c7ca96c5
+ optimization in tcg8086.a_op_const_reg and .a_op_const_ref for 32-bit OP_ADD
...
and OP_SUB when the low 16 bits of the const are 0
git-svn-id: trunk@25704 -
2013-10-06 23:23:06 +00:00
nickysn
8f44e729cc
* tcg8086.a_op_const_ref and .a_op_const_reg: when splitting a 32-bit OP_AND,
...
OP_OR or OP_XOR operation into two 16-bit parts, call a_op_const_reg/ref
recursively for the 16-bit parts, so certain optimizations can be done if the
low or high 16-bit of the const are $ffff.
git-svn-id: trunk@25703 -
2013-10-06 23:02:07 +00:00
Károly Balogh
1f11c39a5d
* huge m68k/cgcpu.pas cleanup and improvement commit
...
- removed the ancient DEBUG_CHARLIE silliness... :)
- moved some repeated code patterns into separate functions
- rewrote most of of tcg68k.a_op_const_reg and tcg68k.a_op_reg_reg
- smarter code generation in tcg68k.a_cmp_const_reg_label
- added support for MULU/MULS on Coldfire in a case which is often used by the CG to index arrays to be used instead of the RTL helpers, this results in a *HUGE* speedup in tw5086 for example
git-svn-id: trunk@25702 -
2013-10-06 22:16:37 +00:00
nickysn
67fdcb02f2
* in tcgx86.make_simple_ref, on the i8086, emit 'mov es, reg', instead of
...
'push reg/pop es', since that is a lot faster on 8088..80386
git-svn-id: trunk@25700 -
2013-10-06 19:52:38 +00:00
florian
304d7ef7a1
* restores atari support/rtl partially
...
git-svn-id: trunk@25699 -
2013-10-06 19:36:59 +00:00
nickysn
6be9627e74
* use all kinds of copy and not just copy_string in Tcgx86.g_concatcopy, when
...
segments are specified on the i8086
git-svn-id: trunk@25698 -
2013-10-06 19:04:13 +00:00
Károly Balogh
b1b90211f1
fixed spilling operation type for lots of operations (thanks Florian), fixes a few endless loops in the testsuite, at least
...
git-svn-id: trunk@25696 -
2013-10-06 16:51:39 +00:00
florian
6391fd39aa
* optimize also tail calls, if it is a simple procedure
...
git-svn-id: trunk@25688 -
2013-10-06 13:51:38 +00:00
florian
440a592d68
* project file updated for newer lazarus versions
...
git-svn-id: trunk@25685 -
2013-10-06 13:13:53 +00:00
florian
f95b225157
* fix wrong constant temp handling, introduced in r24953, resolves #24915
...
git-svn-id: trunk@25684 -
2013-10-06 13:08:52 +00:00
nickysn
9ed0d6d40d
* updated ppudump after r25672
...
git-svn-id: trunk@25673 -
2013-10-06 00:45:03 +00:00
nickysn
f165cee058
+ save the absolute variable's segment to the ppu file after r25666
...
* incremented the ppu version
git-svn-id: trunk@25672 -
2013-10-06 00:32:10 +00:00