Commit Graph

14264 Commits

Author SHA1 Message Date
florian
ff12d63248 + generic popcnt support
git-svn-id: trunk@22290 -
2012-09-02 20:59:44 +00:00
florian
b782918434 * first draft to support the popcnt instruction, works so far for x86 with a real popcnt instruction
git-svn-id: trunk@22289 -
2012-09-02 20:59:39 +00:00
florian
5b13ef1025 + added sse/avx instructions sets introduced during the last years
git-svn-id: trunk@22287 -
2012-09-02 20:55:12 +00:00
Jonas Maebe
62c8e47547 + override unnecessary abstract thlcgobj methods with internal errors
git-svn-id: trunk@22281 -
2012-09-02 14:32:31 +00:00
Jonas Maebe
56378f907f * keep track of required stack frame alignment (this information is however
not yet actually used for anything)

git-svn-id: trunk@22280 -
2012-09-02 14:32:26 +00:00
Jonas Maebe
b1dc518ac4 * removed systems_need_16_byte_stack_alignment and use target_info.stackalign instead
git-svn-id: trunk@22279 -
2012-09-02 14:32:21 +00:00
Jonas Maebe
bd31004fdb + describe for each supported target the default guaranteed stack alignment
git-svn-id: trunk@22278 -
2012-09-02 14:32:12 +00:00
Jonas Maebe
a5cb157091 * enable specifying the alignment mismatch of the frame/stack pointer
relative to the normal stack alignment of the target (e.g., when using
    ebp as framepointer, all addresses are offset 8 to the stack pointer) in
    the temp generator. This enables allocating temps/locals with the correct
    alignment as long as the required alignment is not bigger than the
    guaranteed stack pointer alignment (fixes mantis #15582 on systems where
    the stack pointer is at least aligned to 16 bytes; e.g., not yet on
    i386-platforms other than darwin)

git-svn-id: trunk@22277 -
2012-09-02 14:32:05 +00:00
Jonas Maebe
4cae00f97a * never use a linear table for enum<->string translation when two enums have
the same value (mantis #22570)

git-svn-id: trunk@22276 -
2012-08-31 18:51:59 +00:00
Jonas Maebe
9feee08eba * mark Java inner interfaces as "static abstract" like javac, solves the
"Illegal class modifiers in class SomeClass 0x209" when implementing
    such interfaces in code compiled by Eclipse's internal compiler

git-svn-id: trunk@22272 -
2012-08-30 22:30:32 +00:00
Jonas Maebe
952ac1ffa6 * only use indirect symbol loads for (weak)external and private_external
symbols on darwin/ppc and darwin/i386, and also for common symbols on
    darwin/ppc, as they're not required for other kinds of symbols on those
    platforms (gcc doesn't use them either with -O1 and higher; it does use
    them always for darwin/ppc64 except for local symbols, and hence so do we)

git-svn-id: trunk@22271 -
2012-08-30 21:30:38 +00:00
Jonas Maebe
8a4c12ab36 * include -Oofastmath in -O4
git-svn-id: trunk@22268 -
2012-08-30 08:00:33 +00:00
Jonas Maebe
01b5e2b6f6 * use the parsed node type for checking the validity of default parameter
values instead of a default based on the resulting constsym (more robust)

git-svn-id: trunk@22267 -
2012-08-29 16:09:13 +00:00
Jonas Maebe
ad054831bb * save/restore itype and implementsgetter fields of timplementedinterface
to/from ppu, because it can be required while resolving type casts
    (mantis #22741)

git-svn-id: trunk@22266 -
2012-08-29 16:07:55 +00:00
pierre
c501e6db5f Partial fix for bug report 22744
git-svn-id: trunk@22265 -
2012-08-29 14:35:06 +00:00
pierre
f1687fe8a6 Do not include CPUMIPS32 in extradefines for mips/mipsel systems as it is added in options unit
Do not include MIPSEL in extradefines for system_mipsel_linux as this forbids cross-compilation

git-svn-id: trunk@22263 -
2012-08-28 13:51:29 +00:00
Jonas Maebe
33f5de990d * fixed indentation
git-svn-id: trunk@22255 -
2012-08-26 21:04:51 +00:00
Jonas Maebe
f5de7e34d3 * only remove the calculation of unused parameters of inline routines if
they don't have explicit side-effects, and if -Oodeadvalues (part of -O4)
    is active (because it can result in the removal of range check errors,
    segmentation faults, etc)

git-svn-id: trunk@22254 -
2012-08-26 21:04:46 +00:00
Jonas Maebe
eeda54b7eb * fixed copy-paste error in -O4 description
git-svn-id: trunk@22253 -
2012-08-26 21:04:40 +00:00
Jonas Maebe
a080669771 * disabled arrayconstructorn,arrayconstructorrangen as cseinvariants
(fixes lazarus compilation)

git-svn-id: trunk@22251 -
2012-08-26 17:59:21 +00:00
Jonas Maebe
68d9e95120 * if the size of an operand is not explicitly forced in intel assembler
(e.g. via "dword ptr"), let the size of accessed fields in memory
    expressions override the default size (mantis #18019)

git-svn-id: trunk@22250 -
2012-08-26 17:05:31 +00:00
Jonas Maebe
2be5c8b9af * same change as in r22240 for darwin/ppc(64)
git-svn-id: trunk@22246 -
2012-08-26 08:58:48 +00:00
Jonas Maebe
4d0e4e1b56 * treat "[var + rip]" in intel assembler mode as addr_pic_no_got on x86-64
(mantis #22665)
  + support "[var wrt ..gotpcrel]" nasm/yasm syntax in intel assembler mode
    for GOT-relative accesses on x86-64, + give an error when trying to do
    this on win64 (it doesn't have a GOT)
  * moved code that give a warning when using GOT-relative accesses to
    static data on x86-64 from the AT&T reader to rax86 so it's also
    active for the Intel assembler reader
  + added warning when not using GOT-relative accesses (but plain
    RIP-relative instead) to global data on non-Win64 x86-64

git-svn-id: trunk@22243 -
2012-08-25 15:12:49 +00:00
Jonas Maebe
2c43e084f0 * disabled "[reg].offset globalvar" pic syntax in intel assembler mode for
x86-64, because it does not specify whether the code should be got-based
    or not

git-svn-id: trunk@22242 -
2012-08-25 15:12:44 +00:00
Jonas Maebe
289486346b * factored out code to decide when an asmsym for a staticvarsym has to be
global, and no longer make it global for all symbols when smartlinking
    is enabled on systems that use section-based smartlinking

git-svn-id: trunk@22241 -
2012-08-25 15:12:39 +00:00
Jonas Maebe
35c70a6c96 * copy the darwin got register to a new register when using it, so it
cannot get modified

git-svn-id: trunk@22240 -
2012-08-25 15:12:34 +00:00
Jonas Maebe
f7dbe6d7a6 * use a different register constant for EIP and RIP (fixes external
assembler writers on x86-64 after r22181, the shift in positions
    caused every occurrence of RIP to become EIP in the assembler code)

git-svn-id: trunk@22234 -
2012-08-24 18:49:17 +00:00
Jonas Maebe
eeb98ae2f8 * write objectdef fieldtypes in appenddef_object() instead of in
beforeappenddef() to prevent endless loops in certain circular
    class reference situations (mantis #22527)

git-svn-id: trunk@22233 -
2012-08-24 16:52:46 +00:00
masta
d8af83d252 Introduce a version of MatchInstruction for multiple instructions
It is the same as the normal MatchInstruction function but supports to
be called with a set of TAsmOps instead of a single op.

git-svn-id: trunk@22231 -
2012-08-24 15:54:36 +00:00
florian
6b73bc45c5 * check constant for being a valid offset
git-svn-id: trunk@22230 -
2012-08-24 09:16:47 +00:00
florian
58a85e79ce * set index register correctly * index register might not be changed
git-svn-id: trunk@22229 -
2012-08-24 09:16:38 +00:00
florian
245d8286d5 + LookForPostindexedPattern
git-svn-id: trunk@22228 -
2012-08-24 09:16:26 +00:00
masta
012da673a8 Use MatchInstruction in OpCmp2OpS
MatchInstruction keeps the code a bit more readable and compact.

git-svn-id: trunk@22226 -
2012-08-23 23:08:26 +00:00
pierre
9ad6285fe2 * Fix 64-bit OP_ADD and OP_SUB operations (no overflow support yet)
git-svn-id: trunk@22225 -
2012-08-23 22:05:41 +00:00
florian
a016bc5ced * white space change
git-svn-id: trunk@22224 -
2012-08-23 21:04:31 +00:00
florian
f2ccd6e400 * when doing the AddSubLdr2Ldr optimization check also if the source register of the add is modified before the load
git-svn-id: trunk@22223 -
2012-08-23 21:04:21 +00:00
florian
4e2de05667 * don't apply the AddSubLdr2Ldr optimization if the base register in the reference is used/modified during the ldr/str
git-svn-id: trunk@22222 -
2012-08-23 21:04:11 +00:00
florian
d89b742109 * apply Add/SubLdr2Ldr only if no condition flags are involved
git-svn-id: trunk@22221 -
2012-08-23 21:04:02 +00:00
florian
73d540e7b5 * unsigned byte ldr/str allow also an offset of max. +/-4095
git-svn-id: trunk@22220 -
2012-08-23 21:03:52 +00:00
florian
9d20a73986 * optimize also str/ldrb/h/d
git-svn-id: trunk@22219 -
2012-08-23 21:03:44 +00:00
florian
1b3e03d72d + DEBUG_AOPTCPU to turn off peephole optimizer messages
git-svn-id: trunk@22218 -
2012-08-23 21:03:34 +00:00
florian
8a20ccc5f9 + Add/SubLdr2Ldr optimization
git-svn-id: trunk@22217 -
2012-08-23 21:03:24 +00:00
florian
ca5078f9cf + RegModifiedBetween
git-svn-id: trunk@22216 -
2012-08-23 21:03:14 +00:00
Jonas Maebe
85765364ee * properly compare parameter lists involving pointers to or classrefdefs of
forward defined types by maing sure that we always compare typesyms in
    that case instead of the forwarddefs (mantis #22705)

git-svn-id: trunk@22215 -
2012-08-23 20:58:22 +00:00
masta
b9fa9da629 Small fixes to OpCmp2OpS
1.) For UMULL and UMLAL support we would have to make sure the following
code checks RdHi and RdLo, which is currently not supported.
The former code would transform the following

  umull r0, r1, r2, r3
  cmp   r0, #0
  bne   .LSomething

into

  umulls r0,r1,r2,r3
  bne    .LSomething

which is wrong. UMULL has a 64bit result in r1+r0 and checks the full 64bit for 0
before setting the Z flag.

2.) Support MLA.

3.) Support MI/PL/NE/EQ for all instructions. As all of them are setting
the N and Z flags in the same way only based on the result of the
operation not on its input values.

N:=Result[31];
Z:=Result = 0;

Wurst

git-svn-id: trunk@22213 -
2012-08-23 14:22:29 +00:00
pierre
7587145320 Add possibility to test sparc elf generator with -dTEST_AGSPARC_ELF
git-svn-id: trunk@22212 -
2012-08-23 12:59:45 +00:00
pierre
926d39e604 * Fix compilation of sparc/cpuelf unit
git-svn-id: trunk@22209 -
2012-08-23 12:32:02 +00:00
sergei
c529356693 * Split most CPU-specific code from ogelf.pas into newly created cpuelf.pas units in CPU subdirectories.
git-svn-id: trunk@22208 -
2012-08-23 11:49:49 +00:00
pierre
91bfa84952 Correct code after change in set_common_funcretloc_info which made the call to ret_in_param always return false
git-svn-id: trunk@22206 -
2012-08-23 09:50:47 +00:00
florian
3ad32b6e4e * opcode spelling fixed
git-svn-id: trunk@22204 -
2012-08-23 08:55:07 +00:00