Commit Graph

41790 Commits

Author SHA1 Message Date
Jonas Maebe
a4c938c042 * changed some random data label names to match the label names outputted by
current clang versions, works around some bugs (or at least backward
    incompatibilities) in the Xcode 5 linker when targeting ARM

git-svn-id: trunk@26334 -
2013-12-31 00:28:46 +00:00
Jonas Maebe
5cbcfca33f * changed some Objective-C section declarations to match what's outputted by
current clang versions

git-svn-id: trunk@26333 -
2013-12-31 00:28:41 +00:00
Jonas Maebe
32b149c622 * moved a bunch of tprocdef fields that are only required when compiling the
procdef to a dynamically allocated record that is not created when loading
    the procdef from ppu

git-svn-id: trunk@26332 -
2013-12-31 00:28:28 +00:00
sergei
471d0a5164 + SPARC: support optimized 32x32 to 64 bit multiplications.
git-svn-id: trunk@26331 -
2013-12-30 23:40:47 +00:00
sergei
4168388235 + SPARC: support 8 and 16-bit arithmetic shifts.
git-svn-id: trunk@26330 -
2013-12-30 23:37:21 +00:00
michael
399129693f * Initialize token more correct in case of * / + -
git-svn-id: trunk@26329 -
2013-12-30 21:58:14 +00:00
nickysn
5d0814016d * improvements and fixes in tcg8086.a_load_reg_reg and .a_load_ref_reg:
o When expanding from a OS_8 to a 16-bit or 32-bit tcgsize, use the R_SUBH
    subregister to initialize the high 16 bits of the register to zero. This
    generates shorter and faster code, without increasing register
    interferences, because R_SUBH has the same register constraints on i8086 as
    R_SUBL, which is already used on the same imaginary register.
  o After performing operations on the 8-bit subparts of a register that was
    initially 16-bit, call makeregsize(OS_16) to notify the register allocator
    that the register is once again 16-bit.

git-svn-id: trunk@26328 -
2013-12-30 21:20:10 +00:00
Jonas Maebe
bf59a848b4 * fixed compilation of genmath.inc for the JVM target. In the future, please
use the new float64low/high() for getting the low/high longint and
    float64setlow/high() to set it

git-svn-id: trunk@26327 -
2013-12-30 14:30:59 +00:00
Jonas Maebe
de59d6ac11 * prevent endless loop when writing an invalid utf-8 sequence longer than
32 bytes using writestr to a unicode/widestring

git-svn-id: trunk@26326 -
2013-12-30 14:30:56 +00:00
sergei
63c1a05718 * SPARC: Removed hacks with g1_used that were used for g_intf_wrapper to be operational without initialized reg.allocator, and replaced them with a proper solution (which is basically a clone from MIPS cg).
git-svn-id: trunk@26321 -
2013-12-30 13:08:51 +00:00
marco
3369466d16 * remove finherithandles for wince like r25981 did in mantis #22271 fro win32
git-svn-id: trunk@26320 -
2013-12-30 13:08:50 +00:00
sergei
05489d6e05 * SPARC: fixed g_intf_wrapper for non-virtual methods once again, my initial assumption was not correct: a wrapper does not necessarily reference methods from the class that implements the interface, it may be methods from parent classes, which can be located arbitrarily far away in address space.
Now using code from g_external_wrapper, which has no distance limit and is only one instruction longer.

git-svn-id: trunk@26319 -
2013-12-30 11:51:57 +00:00
sergei
bf94257310 * SPARC: simplified and fixed a_load_const_reg method, was generating redundant instructions for constants with non-zero bits 10..12.
git-svn-id: trunk@26318 -
2013-12-30 09:59:41 +00:00
Jonas Maebe
d2b8275b99 + support for arbitrary encodings in readstr/writestr
o set the code page of the temporary "text" file to utf-8 for writestr with
     unicodestring/widestring as destination, so that no data loss can occur
     (+ properly deal with cases whereby part of an utf-8 character is
      written to the textbuf in this case)
   o explicitly pass the code page of the destination ansistring for writestr
     with ansistring as destination and set it for the temporary "text" file
   o set the code page of the text file for readstr

git-svn-id: trunk@26317 -
2013-12-29 19:18:49 +00:00
Jonas Maebe
ddf08b4eb7 * call TranslatePlaceholderCP() when comparing code pages to avoid
unnecessary conversions between CP_ACP and the current actual
    DefaultSystemCodePage
  * call TranslatePlaceholderCP() when changing the code page of a
    text file because in some cases this code page is passed directly
    to widestringmanager.Wide2AnsiMoveProc() (which does not perform any
    translation itself)

git-svn-id: trunk@26316 -
2013-12-29 19:18:36 +00:00
nickysn
f69a76b5b1 * generate shorter code on 8-bit and 16-bit CPUs in thlcg2ll.location_force_reg,
when converting a LOC_JUMP location to a (OS_INT<x<=32)-bit reg location
  (the optimization is similar to r26314, but is for non 64-bit destinations).

git-svn-id: trunk@26315 -
2013-12-29 19:07:35 +00:00
nickysn
9ec84d1259 * generate shorter code on 8 and 16-bit CPUs in thlcg2ll.location_force_reg,
when converting a LOC_JUMP location to a 64-bit reg location by only setting
  the low OS_INT-sized register to 0 or 1 in the false/true label parts and then
  initializing the remaining registers (obtainable via GetNextReg()) to 0 in the
  common part after the jumps.

git-svn-id: trunk@26314 -
2013-12-29 17:28:35 +00:00
nickysn
6d48b32115 * fixes and improvements in tcg8086.a_load_reg_reg for the case when the src and
dest are subregisters of the same superregister, but of different sizes:
   o Do not emit spurious moves from a register to the same register.
   o Correctly support the case when converting from 16-bit to 32-bit int.
     Previously it didn't work correctly, because in this particular case, due
     to the way the GetNextReg scheme works, we have reg1=reg2.

git-svn-id: trunk@26313 -
2013-12-29 17:15:58 +00:00
nickysn
4e795eca99 * fixes for 16 and 8-bit ALUs in thlcg2ll.location_force_reg for the cases when
converting from a LOC_FLAGS or LOC_JUMP location to a 64-bit reg location.
  This fixes test/cg/tcnvint1.pp on i8086 after r26301.

git-svn-id: trunk@26312 -
2013-12-29 14:30:41 +00:00
florian
27f6fd1c2c * use new shl/shr constant folding (of r26295) only if forinline is set
* explicitly simplify tree after constant propagation

git-svn-id: trunk@26311 -
2013-12-29 14:09:03 +00:00
florian
be3749301f * fix possible issues due to new behaviour of constant shifting
git-svn-id: trunk@26310 -
2013-12-29 12:21:25 +00:00
sergei
34cde7a07a * SPARC, tsparcaddnode.second_cmp64bit: don't copy LOC_CREGISTER locations, and handle comparison with constants without loading them into register (if possible).
git-svn-id: trunk@26309 -
2013-12-29 10:12:19 +00:00
florian
739166f3e7 * fix test
git-svn-id: trunk@26308 -
2013-12-29 10:03:41 +00:00
sergei
f8a60522d4 - SPARC: removed 3 code generator methods, they provide no difference in generated code from generic code generator.
git-svn-id: trunk@26307 -
2013-12-29 10:00:09 +00:00
nickysn
f2e73b5e6f + added 32-bit and 64-bit unsigned asm optimized multiplication routines for
i8086, contributed by Max Nazhalov

git-svn-id: trunk@26306 -
2013-12-28 22:43:45 +00:00
florian
880201e56c + pointerconstn is also a constant node
git-svn-id: trunk@26305 -
2013-12-28 20:20:00 +00:00
florian
4258fe6765 * adapt exponent used in test to supported float type
git-svn-id: trunk@26304 -
2013-12-28 20:19:58 +00:00
florian
de3a116a28 * handle records with size 0 as function results correctly
git-svn-id: trunk@26303 -
2013-12-28 20:19:56 +00:00
florian
561ec1f782 * unified internal errors
git-svn-id: trunk@26302 -
2013-12-28 20:19:54 +00:00
florian
2081b9cad7 * do not convert a boolean to a 32 bit int first when converting to a 64 bit int, this causes data loss when casting e.g. a qwordbool to a qword
git-svn-id: trunk@26301 -
2013-12-28 20:19:51 +00:00
florian
b47f1c4176 * disable constant propagation for tests which will cause a regression because const. prop. causes a compile time error while the tests expect a runtime error
git-svn-id: trunk@26300 -
2013-12-28 20:19:49 +00:00
florian
be807d6cef + tests for dead store removal
git-svn-id: trunk@26299 -
2013-12-28 20:19:46 +00:00
florian
27ac68cdc7 * be more careful when removing dead stores
* take care also of staticvarsyms when removing dead stores

git-svn-id: trunk@26298 -
2013-12-28 20:19:42 +00:00
florian
e9777503d1 * check addr_taken when propagating constants
* do constant propagation on static var syms as well

git-svn-id: trunk@26297 -
2013-12-28 20:19:40 +00:00
florian
b1ee6f282c * set successor node for load nodes as well, they can be generated when inlining
git-svn-id: trunk@26296 -
2013-12-28 20:19:38 +00:00
florian
89663e499b * fold shifting of constants equally to cpus
* test adapted, e.g. 1 shl 63 needs now an explicit cast to qword for the one: qword(1) shl 63

git-svn-id: trunk@26295 -
2013-12-28 20:19:35 +00:00
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
reiniero
076ff1f47a * fcl-db: dbase: follow upstream commit r319:
When filtering, the RecNo was wrong
  Corrects RecNo when filtering

git-svn-id: trunk@26291 -
2013-12-27 13:12:07 +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
marco
59aa032986 * Mantis #25276, improvements for CHMCMD anchor handling, specially combined
with errorhandling.

git-svn-id: trunk@26289 -
2013-12-26 18:36:55 +00:00
marco
b2a4b4cfda * mantis #25278 ascii table and #25239 (redundant help buttons) parts.
git-svn-id: trunk@26288 -
2013-12-26 17:14:50 +00:00
sergei
62a5ba14a3 + SPARC: support finalization routine supplied by dynamic linker.
+ Added "stack not executable" marker.

git-svn-id: trunk@26287 -
2013-12-26 09:09:23 +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
marco
104cbc0160 * redundant buttons removed, mantis #25239
git-svn-id: trunk@26285 -
2013-12-25 21:10:11 +00:00
marco
504ede1834 * add copyright from original header kindly submitted
by translator Valdinilson Lourenco da Cunha. Mantis #23323
   The copyright part of the header seemed to be mostly a general Cairo
   header.

git-svn-id: trunk@26284 -
2013-12-25 16:47:19 +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
c3c682fe3f * Changed test so it provides different exit codes depending on the failed assertion.
git-svn-id: trunk@26280 -
2013-12-25 10:33:16 +00:00