Commit Graph

1346 Commits

Author SHA1 Message Date
sergei
133fcb5ab2 * Fixed VMOVQ instruction encoding, now assembles correctly also in 32-bit code.
+ Test

git-svn-id: trunk@34949 -
2016-11-21 13:59:44 +00:00
sergei
ebe134febc * Fixed memory reference size for MOVSS instruction, Mantis #29954.
git-svn-id: trunk@34943 -
2016-11-21 03:31:25 +00:00
sergei
870fda34d5 * x86 AT&T reader and writer: cleaned up usage of attsufMM suffix:
* It is now only used to select size of vector instructions (i.e. 128 or 256 bits)
  * Scalar instructions reverted to use attsufINT suffix (selecting between 32 or 64 bits).
  * Additionally, vcvtsi2sd and vcvtsi2ss with rm64 operand are x86_64 only.

git-svn-id: trunk@34942 -
2016-11-21 02:07:13 +00:00
sergei
edf943a4f6 * Changed memory operand size for VMOVSS instruction to 32 bits, Mantis #29957.
git-svn-id: trunk@34918 -
2016-11-18 23:37:01 +00:00
florian
56252d59f0 + support for the PREFETCHTW1 instruction based on a patch by Emelyanov Roman, resolves #30933
git-svn-id: trunk@34917 -
2016-11-18 20:19:39 +00:00
svenbarth
fc5ce63134 * fix for Mantis #30832: instead of checking a procdef's struct for df_generic check the procdef itself, this way global generic methods or generic methods that are part of non-generic classes or records are caught as well.
+ added test

git-svn-id: trunk@34914 -
2016-11-18 14:01:03 +00:00
Károly Balogh
c7c37f66ed * refactored syscall types for unified naming,first bits of ARM AROS syscall support
git-svn-id: trunk@34806 -
2016-11-06 12:41:56 +00:00
Jonas Maebe
0afbe85aab * various memory reference alignment fixes
git-svn-id: trunk@34544 -
2016-09-20 21:43:19 +00:00
Károly Balogh
464ecab542 huge syscall support refactor for Amiga-likes. removed large chunks of ancient duplicated code, and in general tried to make the entire thing more maintainable and cleaner. also added support for AROS EAXBase syscall convention
git-svn-id: trunk@34416 -
2016-09-03 07:57:23 +00:00
yury
649823a246 * Removed unused vars.
git-svn-id: trunk@34405 -
2016-09-01 20:01:54 +00:00
Jonas Maebe
aa1be3276f - removed default value of _typ parameter of TAsmData.(Weak)RefAsmSymbol():
it was AT_NONE, which is invalid and should never be used
  * explicitly pass the correct value for all calls to those methods elsewhere
    in the compiler

git-svn-id: trunk@34250 -
2016-08-05 07:09:16 +00:00
Jonas Maebe
a0efde8167 * automatically generate necessary indirect symbols when a new assembler
symbol is defined
   o removed all places where AB_INDIRECT symbols were explicitly generated
   o only generate AB_INDIRECT symbols for AT_DATA on systems_indirect_var_imports
   o for some symbols an indirect symbol is always required (because they are
     dereferenced by code in RTL units) -> use new AT_DATA_FORCEINDIRECT type

git-svn-id: trunk@34165 -
2016-07-20 20:53:03 +00:00
Jonas Maebe
1cb8c0d00c * specify the def of assembler level symbols defined via
tasmdata.DefineAsmSymbol() and all routines that call it
   o will be used to automatically generate AB_INDIRECT sybols when
     necessary

git-svn-id: trunk@34164 -
2016-07-20 20:52:59 +00:00
florian
7f44774852 * i386 uses OptPass1And from aoptx86
git-svn-id: trunk@33936 -
2016-06-07 20:01:13 +00:00
florian
5e8e21c1be * factored out OpPass2MOV code, x86-64 uses it as well now
git-svn-id: trunk@33932 -
2016-06-06 21:18:24 +00:00
florian
e56147ac6e * integrated mov op mov -> op optimization in aoptx86
* isFoldableArithOp is in aoptx86 now

git-svn-id: trunk@33928 -
2016-06-06 21:18:18 +00:00
florian
ba54f7243e * moved all i386 mov peephole optimization code into OptPass1MOV
git-svn-id: trunk@33908 -
2016-06-04 19:34:18 +00:00
florian
20807f4148 * factored out V<Op> optimizations into OptPass1VOP
* call OptPass1VOP also for i386

git-svn-id: trunk@33878 -
2016-06-01 20:49:35 +00:00
florian
a7516dfb50 * fix modification information of VCOMISS and VCOMISD
git-svn-id: trunk@33874 -
2016-06-01 19:58:43 +00:00
florian
0c13f3ce3e * fix modification information for vand*
git-svn-id: trunk@33593 -
2016-05-01 12:00:25 +00:00
florian
bd54a11f1c + TX86AsmOptimizer.OptPass1VMOVAP for i386 and x86-64
+ new unit aoptutils which helpers for the assembler optimizer

git-svn-id: trunk@33587 -
2016-05-01 09:37:21 +00:00
florian
ec92bc3390 * case of identifiers fixed
* x86-64 uses also the mov $0,... -> xor optimization

git-svn-id: trunk@33553 -
2016-04-24 20:01:43 +00:00
florian
f0e75de730 * properly update allocation info of the involved register when carrying out an MovMovCmp2MovCmp optimization, resolves issue #30052
* few changed to make code more readable

git-svn-id: trunk@33551 -
2016-04-24 15:57:06 +00:00
florian
8d9f6bbe0b * disable some debugging code which does not work anymore due to the unification of the peephole optimizer
git-svn-id: trunk@33546 -
2016-04-22 20:31:25 +00:00
florian
77b4709e7a + i386 compiler tracks now flag usage if needed, so the mov $0,reg -> xor reg,reg transformation can be enabled
git-svn-id: trunk@33545 -
2016-04-22 19:44:26 +00:00
florian
3c2dab9878 * i386 peephole assembler uses largely the common peephole optimizer infrastructure, the resulting code is besides a few improvements the same
git-svn-id: trunk@33542 -
2016-04-21 20:14:01 +00:00
florian
a742df9035 * reverse merged r33524 as it is not safe as test results showed
--- Reverse-merging r33524 into '.':
U    compiler\i386\popt386.pas
U    compiler\x86\cgx86.pas
--- Recording mergeinfo for reverse merge of r33524 into '.':
 U   .

git-svn-id: trunk@33527 -
2016-04-17 11:33:29 +00:00
florian
f576b0c01b * make use of xor reg,reg by generating it directly instead of hoping for the peephole
optimizer which cannot do this properly due to missing information about flags. By doing
  so the size of the compiler executable gets reduced by ~1 %

git-svn-id: trunk@33524 -
2016-04-15 19:27:22 +00:00
florian
2dbcdbe466 + peephole optimizer: change jmp .L1 ... .L1: ret into ret
git-svn-id: trunk@33523 -
2016-04-15 19:11:43 +00:00
Károly Balogh
4ed3a3f09a * re-read the libbase already pushed on the stack for AROS syscalls, instead of trying to re-resolve it. should fix threadvar libbases on AROS.
git-svn-id: trunk@33455 -
2016-04-08 22:42:29 +00:00
florian
406e3c4ac1 + support xgetbv instruction, resolves issue #29958
git-svn-id: trunk@33418 -
2016-04-03 20:53:10 +00:00
florian
8d5cc3dfa4 * (extended and modified) patch by Emelyanov Roman to add suport of RDRAND, RDSEED and TSX instructions set, resolves issue #29893.
In comparison with the original patch, support for a i386 has been added as well as a test program. 
  Further, a small issue with xbegin has been fixed

git-svn-id: trunk@33375 -
2016-03-28 19:08:13 +00:00
nickysn
cf3230b100 - removed IF_CENTAUR and replaced it with IF_CYRIX. Rationale: only 3 Centaur -
specific instructions were marked as CENTAUR, all the others were marked
  CYRIX, so it wasn't an accurate flag at all

git-svn-id: trunk@33326 -
2016-03-25 17:01:11 +00:00
nickysn
5f87ac5d47 + added 486 to the list of supported CPUs on the i8086 and i386 targets
git-svn-id: trunk@33317 -
2016-03-23 15:07:56 +00:00
svenbarth
f297b00f5b Extend the x86 targets by the ability to handle indirect symbols.
x86/cgx86.pas, tcgx86:
  + new method make_direct_ref() which is used to convert an indirect reference into a direct one (uses the boolean field in_make_direct_ref to avoid recursive calls)
  * make_simple_ref: call make_direct_ref() before anything else
  * a_loadaddr_ref_ref: call make_direct_ref() (the loading could probably be folded into the loadaddr method, but for now that is sufficent)
i386/cgcpu.pas, tcg386:
  * a_loadaddr_ref_cgpara: call make_direct_ref(); the same remark as for a_loadaddr_ref_ref() applies here

git-svn-id: trunk@33280 -
2016-03-18 21:45:41 +00:00
svenbarth
77ede2ac9f i386/cgcpu.pas, tcg386:
* a_load_ref_cgpara: call make_simple_ref() before calling the base a_load_ref_cgpara()
x86/cgx86.pas, tcgx86:
  * a_loadfpu_ref_reg, a_loadfpu_reg_ref, g_concatcopy: call make_simple_ref() on the passed references

git-svn-id: trunk@33277 -
2016-03-18 21:22:04 +00:00
svenbarth
570607b1d1 * revert r33273; haven't seen that Florian has already assigned that to himself... Oops
git-svn-id: trunk@33274 -
2016-03-18 14:26:24 +00:00
svenbarth
e4fa7928f9 Fix for Mantis #29527.
i386/popt386.pas, PeepHoleOptPass1:
  * disable the call to RegLoadedWithNewValue() as that method isn't implemented for any of the x86 optimizers (but add a ToDo so that it isn't forgotten)

git-svn-id: trunk@33273 -
2016-03-18 14:24:55 +00:00
sergei
0f301b4c57 * Fixed spilling info for vcvt* instructions, part of Mantis #29783.
git-svn-id: trunk@33208 -
2016-03-09 16:36:30 +00:00
nickysn
80b3e3020a * the SEGFS and SEGGS prefixes are 386+
git-svn-id: trunk@32925 -
2016-01-11 15:51:40 +00:00
nickysn
741a3eedf9 * fixed the cpu level of several 186+ instructions, that were mistakenly marked as either 286+ or 8086+
git-svn-id: trunk@32921 -
2016-01-11 13:22:08 +00:00
nickysn
6037976202 * several imul variants, featuring 32-bit or 64-bit registers marked 386+, instead of 286+
git-svn-id: trunk@32889 -
2016-01-08 17:07:36 +00:00
nickysn
66bad5a1cf * pushf and popf are 8086 level instructions, not 186+
git-svn-id: trunk@32677 -
2015-12-17 15:23:21 +00:00
florian
a3964d9ee0 + support for RDTSCP, resolves issue #28916
git-svn-id: trunk@32652 -
2015-12-13 13:28:51 +00:00
sergei
a78250a78b * x87 FBSTP and FBLD instructions cannot have size suffix in ATT syntax. Mantis #29095.
git-svn-id: trunk@32541 -
2015-11-27 03:59:06 +00:00
yury
78b4950b97 * Fixed calling of external procs for i386 non-darwin targets when PIC is enabled.
git-svn-id: trunk@32536 -
2015-11-26 17:04:55 +00:00
Jonas Maebe
fa3b0ca312 * support marking defs created via the getreusable*() class methods as
"don't free even if not registered"; use for defs that may not be written
    to a ppu file, but that must nevertheless survive the compilation of the
    current module
  * mark all defs created for para locations as "don't free even if not
    registered", because we don't discard and recalculate all para locations
    after a module has been compiled (since that's not needed)
   o solves issues if the paralocations for a routine in the interface of
     unit A are calculated while the implementation of unit B gets
     compiled, and a new reusable type is allocated at that point which
     is not used anywhere else (after r32160)

git-svn-id: trunk@32235 -
2015-11-04 20:46:18 +00:00
yury
6537b99ac3 * i386: Fixed detection of a peephole optimization using CMOV.
git-svn-id: trunk@32115 -
2015-10-21 15:59:12 +00:00
yury
862348c317 * Keep the GOT offset in a virtual register for i386 non-darwin platforms.
It fixes PIC code generation with GOT for i386 with enabled optimizations. Bugs #28667, #28668. 
  Prior the fix I have not been able to compile even RTL with -O2 due to not enough free registers, since EBX is reserved for GOT.

  It can be further optimized to teach register allocator to not spill the GOT register if possible.
  

git-svn-id: trunk@32020 -
2015-10-12 08:02:56 +00:00
florian
c40240990e * popt386 uses now also all routines of aoptx86
git-svn-id: trunk@31894 -
2015-09-29 19:31:33 +00:00
florian
53ea4fb7d4 * unify x86 peephole optimizer helpers
git-svn-id: trunk@31843 -
2015-09-27 09:36:39 +00:00
svenbarth
529677cc79 ncal.pas:
* extend tcallnode with the ability to pass a tspecializationcontext so that tcallcandidates can do a final specialization
  * the final procdef is registered at the end of tcallnode.pass_typecheck

git-svn-id: trunk@31763 -
2015-09-18 14:48:54 +00:00
Jonas Maebe
3c6aa91a96 * factored out the loading of threadvars in its own method, and put the
x86-specific part in nx86ld

git-svn-id: trunk@31639 -
2015-09-12 23:32:53 +00:00
sergei
e542800ea9 * Win64 SEH: Track control flow out of unwind-protected regions in a more precise way and don't generate expensive calls to __fpc_local_unwind when not necessary.
git-svn-id: trunk@31582 -
2015-09-09 18:43:46 +00:00
Jeppe Johansen
3cb9be73bc Moved tcontrollerdatatype out into cpuinfo.
Added cputype and fputype info to tcontrollerdatatype arrays.

git-svn-id: trunk@31574 -
2015-09-07 20:36:54 +00:00
Jonas Maebe
0fc1fd6ac1 * replaced current_procinfo.currtrue/falselabel with storing the true/false
labels of LOC_JUMP in the node's location. This generates some extra jumps
    for short circuit boolean and/or-expressions if optimizations are off, but
    with optimisations enabled the generated code is the same (except for JVM
    because the jump threading optimisation isn't enabled there yet).

git-svn-id: trunk@31431 -
2015-08-27 18:28:57 +00:00
Jonas Maebe
f402b0d7df * changed getpointerdef() into a tpointerdef.getreusable() class method
o allows removing the ugly x86 hacks

git-svn-id: trunk@31144 -
2015-06-22 08:17:49 +00:00
florian
956883b0c7 * pass dyn. arrays in registers when i386 register calling conventions are used
git-svn-id: trunk@30870 -
2015-05-16 20:27:09 +00:00
Jonas Maebe
a04cae2c4b - removed partial Alpha, IA64 and vis backends since they were never nor
will likely ever be finished

git-svn-id: trunk@30836 -
2015-05-09 17:25:11 +00:00
Jonas Maebe
1b43930749 - removed long deprecated/buggy assembler cse optimiser for i386
o bumped ppu version because optimiser settings can be embedded in generic
     token streams

git-svn-id: trunk@30835 -
2015-05-09 17:25:07 +00:00
florian
9f587625e7 + handle not and neg in isFoldableArithOp as well
git-svn-id: trunk@30767 -
2015-05-02 17:20:20 +00:00
florian
7dd1d6aa77 o fixes handling of iso i/o parameters/program parameters:
* explicit reset is needed
  * variable must be declared again

git-svn-id: trunk@30757 -
2015-05-01 20:58:31 +00:00
Jonas Maebe
bd203a5b57 * synchronised with trunk till r30240
git-svn-id: branches/hlcgllvm@30241 -
2015-03-15 19:44:58 +00:00
Jonas Maebe
3d9713b9c8 * has_single_field() now looks recursively into fields that are aggregate
types until it finds a non-aggregate type, and then returns "true" if
    that aggregate (record or array) contains one element
  * it now also returns the type of that element directly rather than a
    tfieldvarsym, since we only care about the type and in case of an array
    there is no field

git-svn-id: trunk@30205 -
2015-03-14 18:35:53 +00:00
Jeppe Johansen
914e9e7b49 Merged from trunk
git-svn-id: branches/laksen/armiw@30146 -
2015-03-08 12:33:46 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
florian
99635658ec * corrects change flags for VSQRTSD
git-svn-id: trunk@30037 -
2015-02-28 22:42:25 +00:00
florian
de17e9fa1c + cpu capability CPUX86_HAS_CMOV
git-svn-id: trunk@29776 -
2015-02-21 20:47:40 +00:00
florian
d6e4af8279 + applied remaining patches of Torsten Grundke: adds gather instructions of avx2
git-svn-id: trunk@29745 -
2015-02-17 21:43:46 +00:00
Jeppe Johansen
47dbec3111 Rebase to trunk revision
git-svn-id: branches/laksen/armiw@29708 -
2015-02-15 16:08:18 +00:00
Tomas Hajny
cfd4252ec3 * EMX should be treated the same way as OS/2 with regard to cdecl (the same C compiler is used)
git-svn-id: trunk@29660 -
2015-02-09 22:52:06 +00:00
florian
06fd4223e9 + optimization setting level4
+ change tail calls into jmp if a ret without constant follows

git-svn-id: trunk@29653 -
2015-02-08 11:24:30 +00:00
florian
35a04ad095 * modified patch of Paul W to replace leave by mov/pop, resolves #26455
git-svn-id: trunk@29633 -
2015-02-05 20:51:12 +00:00
pierre
56f53176e7 Add freebsd, openbsd and OS2 to the list of i386 targets handling records with only one float as normal float
git-svn-id: trunk@29570 -
2015-01-27 22:52:00 +00:00
sergei
ed4e876f4f * Generate exception filters data on i386-win32 and x86_64-win64 without using global labels.
git-svn-id: trunk@29512 -
2015-01-20 13:52:19 +00:00
Jeppe Johansen
901275b4a1 Switch back to emitting BLX instructions and fix calculation of constant offsets(should rarely/never happen).
Add missing fields to other elf targets.

git-svn-id: branches/laksen/armiw@29286 -
2014-12-14 16:28:35 +00:00
florian
5c67fcc43f + change always floating point divisions into multiplications if they are a power of two,
this is an exact operation so it is always allowed
* change only divisions by normal numbers into multiplications

git-svn-id: trunk@29085 -
2014-11-16 20:47:38 +00:00
Tomas Hajny
3ee3542744 * boolean constant instead of IFDEFs for detection of microcontroller support
git-svn-id: trunk@29052 -
2014-11-10 12:34:59 +00:00
Jonas Maebe
8244d366d0 - moved deallocation of NR_PIC_OFFSET_REG from the x86_64 to the i386 code
generator (as it's also allocated for i386 rather than for x86_64)

git-svn-id: trunk@28928 -
2014-10-25 17:47:44 +00:00
Tomas Hajny
09e0734b7c * fix working with short record function results under OS/2
git-svn-id: trunk@28885 -
2014-10-20 15:40:17 +00:00
pierre
aa6b62cf4c Add new procedure option: po_syscall_has_libsym,
include this option only of libsym field
 is non NIL.
 Use this option to only write redef of libsym if needed.
 Adapt ppudump source to this new procedure option.

git-svn-id: trunk@28732 -
2014-10-03 19:26:16 +00:00
sergei
5479b6e722 * Provide initialization of all variables, fixes cycling with OPT="-dTEST_WIN32_SEH -OoDFA".
git-svn-id: trunk@28622 -
2014-09-08 18:08:12 +00:00
Károly Balogh
07ad2a04ac * fix warnings when compiling the compiler with DFA optimizer enabled on i386
git-svn-id: trunk@28497 -
2014-08-20 12:28:44 +00:00
Jonas Maebe
b18ba8e85b * syncrhonised with trunk up till r28471
git-svn-id: branches/hlcgllvm@28495 -
2014-08-19 20:23:11 +00:00
Jonas Maebe
b745dcc64c * moved g_external_wrapper() to the hlcg, and also g_intf_wrapper() because
for some platforms it depends on that routine

git-svn-id: branches/hlcgllvm@28492 -
2014-08-19 20:22:54 +00:00
Jonas Maebe
a637fbe596 * moved all g_exception_*() methods to hlcgobj and cleaned them up (no more
hardcoded registers for the most part)
  + added extra g_exception_discard_reason() that can be called when we only
    want to get rid of the currently pushed exception reason, and don't have
    to load it (so it can do nothing on platforms that don't use push/pop)

git-svn-id: branches/hlcgllvm@28481 -
2014-08-19 20:22:24 +00:00
Károly Balogh
4ee15b84da AROS: syscall (library call) support for based on the Amiga/68k and MorphOS/PPC versions
git-svn-id: trunk@28463 -
2014-08-19 00:39:18 +00:00
Károly Balogh
74581a07af AROS: assembler fixes
git-svn-id: trunk@28439 -
2014-08-18 11:25:55 +00:00
Károly Balogh
4431ba2c08 merged/updated AROS/i386 target to trunk from AROS branch, to support Marcus Sackrow's work on AROS support which will hopefully benefit all Amiga-like targets (classic, MorphOS) on the long run. Compiler only, RTL comes in the next run.
git-svn-id: trunk@28432 -
2014-08-17 18:18:07 +00:00
Jonas Maebe
5c75b6dd6b * synchronised with trunk up till r28402
git-svn-id: branches/hlcgllvm@28403 -
2014-08-13 16:04:30 +00:00
nickysn
94bcb9878a * reimplemented r28329 in a different way, as suggested by Jonas
git-svn-id: trunk@28332 -
2014-08-07 19:36:52 +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
Jonas Maebe
7949bebb8d * synchronised with r28168 of trunk
git-svn-id: branches/hlcgllvm@28169 -
2014-07-05 21:30:28 +00:00
Jonas Maebe
1516661249 + new chlcgobj class reference variable that can be used to call thlcg*
virtual methods even when hlcg doesn't contain a valid instance

git-svn-id: branches/hlcgllvm@28143 -
2014-07-03 22:28:31 +00:00
sergei
5356f17fa5 * i386: switch the div/mod node to shared code, leaving in place the specific optimization for division by power of 2.
git-svn-id: trunk@27975 -
2014-06-15 16:20:53 +00:00
sergei
dc628b8969 * x86: Completely skip instructions that do not exist for target CPU bit width. The existing behavior of writing mnemonics and properties but no encoding allows an invalid instruction to be recognized by assembler reader or even generated by compiler, but it but won't assemble anyway.
git-svn-id: trunk@27934 -
2014-06-11 22:31:40 +00:00
sergei
ed46a07f62 * Using x86-specific capability of shifting with carry flag helps to reduce amount of instructions.
git-svn-id: trunk@27899 -
2014-06-08 14:01:41 +00:00
sergei
92cf25b9a5 * Reworked i386 division by constant optimization to reuse code from powerpc64. The algorithm is slightly different, signed version is one instruction shorter, unsigned one is one instruction longer (typically). The new algorithm is easily scalable for x86_64 target, unlike the old one.
git-svn-id: trunk@27884 -
2014-06-07 00:20:05 +00:00
Jonas Maebe
bacd303208 * synchronized with trunk up to r27758
git-svn-id: branches/hlcgllvm@27779 -
2014-05-12 16:12:34 +00:00
sergei
2ee0c8de45 * i386: For integer comparisons with zero, emit "test $-1,%reg" instead of "test %reg,%reg". It is more spilling-friendly, because it transforms into "test $-1,spilltemp" and does not require a register.
* Improved peephole optimizer to remove these instructions if preceded by flag-setting instruction that operates on same location and followed by conditional jump, and change them back into "test %reg,%reg" otherwise.

git-svn-id: trunk@27617 -
2014-04-20 19:16:58 +00:00
florian
d88d644925 + support for FMA intrinsic: if there is no hardware support, the compiler throws an error.
Currently it is implemented only for x86-CPUs supporting the FMA extension. While it would
  be possible to implement it in software or simulate fma(<single>,<single>,<single>) using
  double operations, it makes no sense in my opinion to do so.

git-svn-id: trunk@27564 -
2014-04-13 19:21:54 +00:00
nickysn
d404d15c1e * forgot to commit the changes to i386/symcpu.pas in r27549
git-svn-id: trunk@27563 -
2014-04-13 18:44:35 +00:00
svenbarth
02495c17bd Fix a typo. The CPU specific version of "ttypesym" should be called "tcputypesym" and not "tcpuypesym".
git-svn-id: trunk@27531 -
2014-04-11 14:30:59 +00:00
Jonas Maebe
d452686c39 * moved pbestrealtype from symdef to symcpu
git-svn-id: trunk@27441 -
2014-04-01 21:41:37 +00:00
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
Jonas Maebe
e9268a0a14 * synchronised with trunk up till r26975
git-svn-id: branches/hlcgllvm@26976 -
2014-03-06 21:36:58 +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
99de108c68 * renamed all paramanagers to tcpuparamanager so the llvm paramanager can
derive from them without ifdefs

git-svn-id: branches/hlcgllvm@26039 -
2013-11-11 11:15:27 +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