Commit Graph

1140 Commits

Author SHA1 Message Date
Jonas Maebe
338c064beb * moved x86-specific tpointerdef functionality to architecture-specific
descendants

git-svn-id: trunk@27397 -
2014-03-30 21:04:36 +00:00
Jonas Maebe
dae5d1ff62 + added class reference types of the architecture-specific t*def/t*sym
classes

git-svn-id: trunk@27396 -
2014-03-30 21:04:32 +00:00
Jonas Maebe
4a79481c51 * isolated segment-related functionality of tabsolutevarsym into i386/i8086-
specific descendent classes and moved the code that deals with this in the
    code generator also to target-specific classes -> only ifdefs left in
    pdecvar

git-svn-id: trunk@27379 -
2014-03-30 15:42:53 +00:00
Jonas Maebe
b57c95043f + support overriding tdef/tsym methods with target-specific functionality:
o made all (non-abstract) tdef and tsym constructors virtual
   o added c*def/c*sym classref types for every (non-abstract) t*def/t*sym
     class
   o added cpusym unit for every architecture that derives a tcpu*def/tcpu*sym
     class from the base classes, and initialises the c*def/c*sym classes with
     them. This is done so that the llvm target will be able to derive from
     the tcpu*def/sym classes without umpteen ifdefs, and it also means that
     the WPO can devirtualise everything because the c* variables are only
     initialised with one class type
   o replaced all t*def/t*sym constructor calls with c*def/c*sym constructor
     calls

git-svn-id: trunk@27361 -
2014-03-29 22:31:55 +00:00
nickysn
26b53607f8 + added method reference_reset_base with support for different pointer types to
the high level code generator. All hlcg code, except for the jvm code
  generator, updated to use the new method. I didn't update jvm (it still uses
  the method from cgutils), because I'm not familiar with that platform, so I
  might get the types wrong.

git-svn-id: trunk@27309 -
2014-03-28 00:01:18 +00:00
sergei
31edfdc05f * i386: push references with size OS_F64 using less instructions.
git-svn-id: trunk@27300 -
2014-03-27 14:48:23 +00:00
florian
842e027a9f + prove of concept how FMA4 could be supported in inline assembler
git-svn-id: trunk@27214 -
2014-03-20 21:25:38 +00:00
florian
a79be2b05c + support for FMA instructions in inline assembler
+ extended avx test code with FMA

git-svn-id: trunk@27209 -
2014-03-20 20:06:56 +00:00
florian
aa107b914c * merged avx2 branch, developed by Torsten Grundke
git-svn-id: trunk@27200 -
2014-03-20 12:03:52 +00:00
sergei
c003f934c5 * Included cs_opt_peephole into genericlevel1optimizerswitches, so it is re-enabled for all targets after r27106.
- Removed cs_opt_peephole from level1optimizerswicthes on i386 and i8086, it is redundant due to the above change.

git-svn-id: trunk@27147 -
2014-03-15 21:23:29 +00:00
sergei
46f8e78d1f + Support GOT/gp-relative constants in GAS and internal assemblers, MIPS and i386.
* Change MIPS jump tables in PIC mode to use gp-relative constants, making them ABI-compliant and not requiring dynamic relocations.

git-svn-id: trunk@26886 -
2014-02-26 14:54:47 +00:00
sergei
2c02e8a726 - i386, x86_64, SPARC: removed paramanager.getintparaloc overrides, it is handled by generic implementation since r24716.
(This probably can be removed for all targets, but I don't want to do it without prior testing).

git-svn-id: trunk@26870 -
2014-02-24 16:01:14 +00:00
florian
13cb468a8e * fixed modification information for some avx instructions
git-svn-id: trunk@26840 -
2014-02-22 15:52:33 +00:00
florian
cbefdcf887 * patch by Martin Friebe to avoid wrong debugger output, resolves #25584
git-svn-id: trunk@26794 -
2014-02-16 10:11:20 +00:00
florian
0d6cc46a5e + CPU type corei
git-svn-id: trunk@26790 -
2014-02-16 08:27:27 +00:00
florian
be0a29da95 * fix modification information for bmi instructions
git-svn-id: trunk@26738 -
2014-02-08 21:38:21 +00:00
florian
1df293679d * fixed setting of pi_uses_exception flags and unified usage, they should be set in pass_1
git-svn-id: trunk@26729 -
2014-02-08 14:59:07 +00:00
Jonas Maebe
a1eb9a0f99 * fixed spilling of CMOVcc instruction: it "reads" operand two (in the sense
that the value of operand two is used/kept in case the condition is false)
    (fixes mantis #25672)

git-svn-id: trunk@26674 -
2014-02-05 00:27:21 +00:00
Jonas Maebe
ba5297be37 * support disabling the i386 peephole optimizer with -Oonopeephole
git-svn-id: trunk@26673 -
2014-02-05 00:27:16 +00:00
sergei
0d3f36eebf - Remove references to global variable 'cg' from methods of tcg and some of its descendants.
git-svn-id: trunk@26665 -
2014-02-03 12:27:48 +00:00
florian
8989a40b4f * more flags to mark changes fixed
git-svn-id: trunk@26626 -
2014-01-30 17:34:28 +00:00
florian
060aa2a7fe + SSE and AVX unit cpu flags
git-svn-id: trunk@26587 -
2014-01-26 12:37:52 +00:00
florian
2ec5a649d7 * set Ch_* for more operations
* Ch_* flags for VMOVSD and VMOVSS are now set for the 2 operand variants

git-svn-id: trunk@26586 -
2014-01-26 12:37:50 +00:00
pierre
1cec09f979 Add -Caoldwin32gnu ABI option to cope with 'ret $4' issues in old GNU mingw32 C compiler (version below 4.7)
git-svn-id: trunk@26536 -
2014-01-20 22:47:46 +00:00
florian
a752e3542d + more x86 cpu flags
git-svn-id: trunk@26513 -
2014-01-18 21:03:09 +00:00
nickysn
1de847c754 * fixed error in comment
git-svn-id: trunk@26507 -
2014-01-18 17:00:10 +00:00
florian
7028210817 + tzcnt assembler instruction
git-svn-id: trunk@26506 -
2014-01-18 12:11:50 +00:00
sergei
3a3197ae9c + i386: inline 64-bit multiplications if overflow checking is disabled and not optimizing for size. Rough testing on Core 2 Duo shows speed improvement by factor of 5, even despite inlined code does not check for zero upper dwords.
git-svn-id: trunk@26504 -
2014-01-18 11:41:55 +00:00
nickysn
5d75bf4f92 * always use IMUL instead of MUL on i386, when doing a 32->32 multiplication
without overflow checking

git-svn-id: trunk@26498 -
2014-01-18 02:56:51 +00:00
florian
e210d5f30e + cpu_capabilites for x86_64 and i386
* take advantage of bmi2 instruction rorx

git-svn-id: trunk@26482 -
2014-01-16 21:47:28 +00:00
sergei
75894722d4 * Factored a reusable piece of code into separate method.
git-svn-id: trunk@26481 -
2014-01-16 16:43:06 +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
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
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
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
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
florian
1843ed59b5 * set p to a valid instruction
git-svn-id: trunk@25912 -
2013-11-01 20:09:28 +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
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
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
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
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