Commit Graph

43945 Commits

Author SHA1 Message Date
sergei
499ff505c8 * m68k: further improved code generation for comparison nodes, support LOC_REFERENCE for 32-bit compares and omit low dword, when possible, for 64-bit ones.
git-svn-id: trunk@28297 -
2014-08-02 12:37:40 +00:00
sergei
b4d9d97a03 * m68k: don't do replace spilling if spilltemp.offset exceeds 16 bits on Coldfire targets.
git-svn-id: trunk@28296 -
2014-08-02 12:33:32 +00:00
sergei
3da5de0e5f + m68k, do_spill_replace: support more cases.
+ support spilling at offsets >32767, tested only to generate assemble-able code, support of large stack frames needs more changes elsewhere.

git-svn-id: trunk@28295 -
2014-08-01 20:32:48 +00:00
marco
98b4e77b4f * fixed 64-bit issue.
git-svn-id: trunk@28288 -
2014-08-01 10:18:17 +00:00
Mattias Gaertner
0d4fa26c51 fpreadtif: fixed read LZW stream at end of a bit length increase, bug #22724
git-svn-id: trunk@28287 -
2014-08-01 07:41:01 +00:00
lacak
00f85c52ab fcl-db: oracle:
- for ftBlob parameters binding use temporary LOBs instead of long varraw to bypass 64KB limit of current implementation
- initial support for NCLOB data type (if client uses for NCHAR "variable width" charset (like UTF-8) then there is character length <> byte length which is currently not handled correctly)

git-svn-id: trunk@28286 -
2014-08-01 05:48:24 +00:00
masta
7a0c79de60 Fix for AndLsl2Lsl in ARM Peephole optimizer
AndLsl2Lsl assigned the wrong register to the remaining instruction, and
also did not check for the register.

git-svn-id: trunk@28285 -
2014-07-31 23:09:33 +00:00
masta
85d208fea4 Fix ARM LoadScheduler in case of Pre/PostIndexed addressing
There was an interference between the load scheduler and then
Str/LdrAdd/Sub2Str/Ldr peephole optimizer.

ldrb r0, [r2]
ldrb r1, [r2, #1]
orr r3, r0, r1
add r2, r2, #2

got changed pre-regalloc to:
ldrb r1, [r2, #1]
ldrb r0, [r2]
orr r3, r0, r1
add r2, r2, #2

and the peephole optimizer collapsed the add into the second ldrd:
ldrb r1, [r2, #1]
ldrb r0, [r2], #2
orr r3, r0, r1

Then the post-peephole optimizer changed that into:
ldrb r0, [r2], #2
ldrb r1, [r2, #1]
orr r3, r0, r1

so r1 got loaded from a modified base-register.

This patch prevents the scheduler from moving an ldr-instruction if it
uses Pre/Post-indexing and the instruction before it uses the
base-register.

git-svn-id: trunk@28284 -
2014-07-31 19:57:09 +00:00
sergei
2c8264c42b * m68k: partially improved code generation for comparisons.
git-svn-id: trunk@28283 -
2014-07-31 18:44:07 +00:00
sergei
01c8ee158d - removed unused variables
git-svn-id: trunk@28282 -
2014-07-31 18:35:55 +00:00
michael
9efce39e06 * Optimized version of SHA1 and MD5 hashes (speed doubles on x64) by Engkin
git-svn-id: trunk@28281 -
2014-07-31 12:12:54 +00:00
sergei
cf2b4a4dbd * softfpu cleanup: use Pascal boolean types where appropriate, use 64-bit overload of shift64RightJamming() to simplify things.
git-svn-id: trunk@28280 -
2014-07-30 23:39:10 +00:00
masta
66aca1b104 Optimize generic 64-bit division code
FPC_{DIV,MOD}_QWORD now check if both inputs have their upper 32bit set
to zero and in that case use 32-bit division instead, which many
plattforms can either do in hardware or have optimized assembly code
for.

git-svn-id: trunk@28279 -
2014-07-30 17:07:29 +00:00
michael
347742ba80 * For large times, use [[hh:]nn:]ss date/time format
git-svn-id: trunk@28278 -
2014-07-30 14:53:37 +00:00
michael
7a096b20f6 * For large times, use [[hh:]nn:]ss date/time format
git-svn-id: trunk@28277 -
2014-07-30 14:53:29 +00:00
michael
1a6d734ca8 * Correct formatdatetime string
git-svn-id: trunk@28276 -
2014-07-30 14:52:42 +00:00
sergei
a42ecadddf + m68k: implemented overflow checking (does not work for multiplication yet).
+ support references as source operands for 64-bit AND and OR operations.

git-svn-id: trunk@28275 -
2014-07-30 01:46:25 +00:00
sergei
9b9ea15d68 + m68k: initial implementation of do_spill_replace (supports only MOVE instructions for now). Tested with qemu for Coldfire target.
git-svn-id: trunk@28274 -
2014-07-30 01:20:59 +00:00
Károly Balogh
1a4d6d79c5 new division helpers for ARM by Nico Erfurth. on our ARMv5 core hardware they're 22%-36% faster than the generic ones for the most common case.
git-svn-id: trunk@28273 -
2014-07-29 17:39:55 +00:00
marco
968ddb6ad9 * add two implicit units, mantis #26533
git-svn-id: trunk@28272 -
2014-07-28 14:40:07 +00:00
nickysn
235a37fad4 * moved the pass_1 handling of vecnodes for arraydefs to a new virtual method
tvecnode.first_arraydef. This will allow overriding it in the i8086 code
  generator in order to handle huge arrays.

git-svn-id: trunk@28271 -
2014-07-26 16:18:57 +00:00
nickysn
36d63b953e + added an i8086 specific boolean property is_huge to the tarraydef. For now it
will only be used for indexing huge pointers (i.e. only huge arrays with the
  ado_IsConvertedPointer array option will be supported). In the distant future,
  regular huge arrays may be supported as well (but that would require
  substantially more work, including adding hugeness support to other structures
  such as records, objects and classes, so I'm not planning on doing it anytime
  soon).

git-svn-id: trunk@28270 -
2014-07-26 13:27:46 +00:00
nickysn
4b1e5f1c9a * in the vecnode, when indexing a pointer[], convert right to
tpointerdef.pointer_arithmetic_int_type instead of sinttype

git-svn-id: trunk@28269 -
2014-07-26 12:24:50 +00:00
nickysn
e6c5c35d65 * tarraydef.create_from_pointer changed to require the actual pointerdef as a
parameter, instead of the element def. This will allow e.g. creating huge
  arrays from huge pointers on i8086.

git-svn-id: trunk@28268 -
2014-07-26 10:39:18 +00:00
svenbarth
d46ae01589 Fix inlining of record methods across units if the unit with the method definitions is already compiled.
symdef.pas:
  + tabstractrecorddef: implement buildderefimpl and derefimpl which works on the symtable (especially derefimpl is important here)
  - trecorddef & tobjectdef: remove buildderefimpl; it's already handled by the tabstractrecorddef one now
  - tobjectdef: remove the part of derefimpl that's already handled by tabstractrecorddef

git-svn-id: trunk@28267 -
2014-07-25 22:01:23 +00:00
sergei
0d96963459 * Do not promote integer comparison operations to native size if one side is a constant and its value is within range of opposite side. Instead, cast the constant to type of the opposite side.
Comparisons are already not promoted if sides are equally signed, but this wasn't true for "unsigned vs constant" case, because constants are preferably parsed as signed.
The change considerably improves generated code for i386 and even more considerably for m68k. Tested on i386-win32.

git-svn-id: trunk@28266 -
2014-07-25 21:40:22 +00:00
sergei
a0934e897e * i386: improvements to 64-bit comparison code, also serves as a good base for m68k target:
* Better handling of LOC_CREGISTER locations.
  + Support direct compares of constants with references.
  + Optimize away comparison of low dword when its result is constant (cases of "less" and "greater or equal" comparing against a constant with zero low dword).

git-svn-id: trunk@28263 -
2014-07-25 13:21:44 +00:00
Károly Balogh
88b58c3580 i386: added signed 64bit div/mod helpers in assembly. we have some 64bit heavy code where a direct helper results in about 8-10% of performance advantage compared to going through the generic wrapper + the unsigned function
git-svn-id: trunk@28261 -
2014-07-24 21:06:23 +00:00
sergei
bd5ce35130 * m68k: completely replaced 64-bit comparison code with a clone of i386 implementation. No optimizations yet, but it already makes system unit about 300 instructions shorter due to changing node location to LOC_JUMP.
* Cleaned up 32-bit comparison code and implemented one of the optimizations (TST instruction for comparison with constant zero which can act directly on references). This makes system unit shorter by about 1000 instructions.

git-svn-id: trunk@28260 -
2014-07-24 19:44:41 +00:00
nickysn
86726a5dc8 * return ptrsinttype instead of sinttype in pointerdef.pointer_arithmetic_int_type
git-svn-id: trunk@28259 -
2014-07-24 15:17:15 +00:00
nickysn
33dac14554 * defutil.get_int_type_for_pointer_arithmetic replaced with a virtual method
tpointerdef.pointer_arithmetic_int_type

git-svn-id: trunk@28258 -
2014-07-24 14:18:57 +00:00
nickysn
bb48761652 * taddnode.pass_typecheck_internal: always pass a tpointerdef to
get_int_type_for_pointer_arithmetic, even when adding a zero-based array with
  a number

git-svn-id: trunk@28257 -
2014-07-24 13:28:19 +00:00
sergei
dac52f503c * m68k: fixed extension in a_load_ref_reg. Existing code cleans only bits 16-31 when loading a 8-bit register from 16-bit reference, and leaves garbage in bits 8-15.
git-svn-id: trunk@28256 -
2014-07-24 12:17:29 +00:00
sergei
4d73dd4977 * Report all failed cases instead of halting at the first failure.
git-svn-id: trunk@28255 -
2014-07-24 12:05:33 +00:00
sergei
a61321b4bd * m68k "rts" instruction has code $4e75 ($4e74 is "rtd" which is wrong here)
git-svn-id: trunk@28254 -
2014-07-24 12:03:34 +00:00
sergei
4e9500fee8 * Extended the test for m68k.
git-svn-id: trunk@28253 -
2014-07-23 19:34:15 +00:00
Jonas Maebe
5836478bce * add alignment for .lcomm data in AIX, required for int64 data put in bss
in case it's passed to interlocked* (requires 8 byte alignment, default
    is 4). Supported in AIX 5.3 and later
    (http://www-01.ibm.com/support/docview.wss?uid=isg1IY90802) and
    GNU binutils 2.24 or later

git-svn-id: trunk@28252 -
2014-07-23 14:06:09 +00:00
Jonas Maebe
2c7a1b4e91 * fixed optimisation from r25067 for the generic case where a signed value
is converted to a larger unsigned value (e.g. OS_S16 -> OS_32)

git-svn-id: trunk@28251 -
2014-07-23 14:06:06 +00:00
Jonas Maebe
d5895a4d98 - removed ppc-specific a_load_const_cgpara: not necessary, and in fact wrong
in case the para location size is larger than the source size

git-svn-id: trunk@28250 -
2014-07-23 14:06:03 +00:00
sergei
ad2963783e * m68k-linux startup code:
+ initialize __stkptr variable (was missing, causing any stack check to fail)
 + non-executable stack marker.

git-svn-id: trunk@28249 -
2014-07-23 13:55:38 +00:00
nickysn
9a569b9e57 * use P/TTinyHeapMemBlockSize in RegisterTinyHeapBlock as well
git-svn-id: trunk@28248 -
2014-07-22 12:51:20 +00:00
nickysn
6f8a329b4c * use pointer arithmetic for doing address calculations, with a newly introduced
pointer type TTinyHeapPointerArithmeticType, instead of using ptruint. This
  will allow us to use a huge pointer in i8086 far data memory models, in order
  to allow the heap to exceed 64k.

git-svn-id: trunk@28247 -
2014-07-21 23:02:49 +00:00
nickysn
3b9ab33910 * added type TTinyHeapFreeBlockSize, which holds the size of a free memory block
in the tiny heap

git-svn-id: trunk@28246 -
2014-07-21 17:05:52 +00:00
nickysn
1dc09538d0 * introduce a type TTinyHeapMemBlockSize, which holds the size of an allocated
memory block in the tiny heap

git-svn-id: trunk@28245 -
2014-07-20 16:31:40 +00:00
svenbarth
856ae9d3cf Fix for Mantis #26482.
pgenutil.pas, generate_specialization:
  * also search for the generic type in general if it was previously found in a record/class as there might be a non-generic type (or one with a different number of parameters) defined elsewhere

+ added test

git-svn-id: trunk@28244 -
2014-07-20 15:47:18 +00:00
marco
f0f628798b * fixes from José Mejuto, mantis #26352 generating a parameter if the tlb says the param is there but the string is empty in the tlb + small cleanups
git-svn-id: trunk@28243 -
2014-07-20 14:49:37 +00:00
svenbarth
f1bfb398e4 Fix for Mantis #26456.
symtable.pas, searchsym_in_helper:
  * check whether extendeddef is assigned as this function is called when parsing the extended type and it was not found (the second pass is to display a more accurate error message and was added some weeks ago)

+ added test

git-svn-id: trunk@28242 -
2014-07-20 13:40:01 +00:00
marco
2fdb701f9a * fix for compilation breakage due to windows header fix. (reported by Reinier on ML)
git-svn-id: trunk@28241 -
2014-07-20 10:53:25 +00:00
marco
a4a11cb149 * startupinfo was declared with lpTstr. splitted in the usual A/W/- variants
git-svn-id: trunk@28240 -
2014-07-19 22:22:49 +00:00
nickysn
84a18e57bc + added test for the error checking for nil-number; tests already exist for
nil+number and number+nil, so this was the only one missing

git-svn-id: trunk@28235 -
2014-07-18 12:09:27 +00:00