Commit Graph

1291 Commits

Author SHA1 Message Date
florian
d0b2701693 * similiar fix for i386 as done in r34984 for x86-64
git-svn-id: trunk@35016 -
2016-11-29 20:41:33 +00:00
Jonas Maebe
a25ebbba3e + added volatility information to all memory references
o separate information for reading and writing, because e.g. in a
     try-block, only the writes to local variables and parameters are
     volatile (they have to be committed immediately in case the next
     instruction causes an exception)
   o for now, only references to absolute memory addresses are marked
     as volatile
   o the volatily information is (should be) properly maintained throughout
     all code generators for all archictures with this patch
   o no optimizers or other compiler infrastructure uses the volatility
     information yet
   o this functionality is not (yet) exposed at the language level, it
     is only for internal code generator use right now

git-svn-id: trunk@34996 -
2016-11-27 18:17:37 +00:00
florian
48fbd569fd * support for the CDQE instruction, by Emelyanov Roman, resolves #30978
git-svn-id: trunk@34982 -
2016-11-27 12:42:22 +00:00
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
b5660401fe * Some cleanup for AVX part of internal assembler. Functionality is not changed.
git-svn-id: trunk@34948 -
2016-11-21 07:49:43 +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
8e55231640 - Removed what's called "GAS bugfix" for VCVTDQ2PD instruction. Rationale:
o "Intel instruction set reference" states that source operand can be XMM register or memory, so GAS behavior
    is correct. If any other assembler expects an YMM register, it must be fixed elsewhere.
  o x86ins.dat does not allow YMM register as source operand for VCVTDQ2PD, and instructions are checked for validity
    before writing them out, therefore this code was simply never executed.

git-svn-id: trunk@34924 -
2016-11-20 04:23:41 +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
sergei
d5ffc2da97 * Force OPR_LOCAL operand into reference whenever subscripting is used, so that all record fields are handled in same way regardless of their offset. Previously, operand was changed to reference only by fields with non-zero offset (see logic in tcgasmnode.ResolveRef method).
git-svn-id: trunk@34911 -
2016-11-18 05:56:12 +00:00
Jonas Maebe
86876ed114 * MaybeRecordOffset: initialise "mangledname" variable
git-svn-id: trunk@34857 -
2016-11-09 19:51:36 +00:00
Jonas Maebe
74a49b5f91 * restructured the the TExternalAssembler constructors so that the
hack for the Jasmin descendent is no longer needed

git-svn-id: trunk@34852 -
2016-11-09 19:51:20 +00:00
florian
781d6f31a8 * more getsupreg(...)<>/=getsupreg(...) replaced by SuperRegisterEqual which is more safe, the former could break as the register could have different register types
git-svn-id: trunk@34746 -
2016-10-20 18:32:23 +00:00
florian
cf2a3d8160 + new debug message
* turn off accidently turned on DEBUG_AOPTCPU

git-svn-id: trunk@34731 -
2016-10-16 16:37:51 +00:00
florian
fe0ce2f456 * TX86AsmOptimizer.OptPass1MOV should be left, after an optimization has been carried out, instead the outer loop should call it again, resolves issue #30277
git-svn-id: trunk@34724 -
2016-10-15 19:36:18 +00:00
florian
239c6639d7 + additional debug message
git-svn-id: trunk@34722 -
2016-10-15 17:51:09 +00:00
florian
76961dbc70 * fixes MovOpMov2Op
git-svn-id: trunk@34721 -
2016-10-15 15:03:27 +00:00
florian
8e9f4af801 * fixed checking of operands of MovOpMov2Op
* MovOpMov2Op optimization got proper naming

git-svn-id: trunk@34719 -
2016-10-15 15:03:24 +00:00
florian
4109f88e08 * AllocRegBetween always extends the processed register to the whole super register and takes care of this while removing (de)/allocs
git-svn-id: trunk@34718 -
2016-10-15 15:03:23 +00:00
florian
57ca8647b3 * better peephole optimization tracing
git-svn-id: trunk@34698 -
2016-10-09 13:41:38 +00:00
svenbarth
c8202061dc * get rid of addr_load_indirect again by having tcgx86 provide an internal implementation of both make_simple_ref() and a_load_ref_reg() so that make_direct_ref() can call the latter (and the latter the former) without fear of inifinite recursive calls due to the symbol; a_load_ref_reg() is additionally declared as "final" as a_load_ref_reg_internal() needs to be overloaded instead (which is the case for tcg8086)
git-svn-id: trunk@34579 -
2016-09-30 14:01:02 +00:00
pierre
1e9491550d nutils.pas: Add new procedure:
procedure node_change_local_switch(p : tnode;cs : tlocalswitch;enable : boolean);
    to add/remove cs local switch from all p tnode tree localsettings.

    modify second_prefetch implementation in arm, ppcgen and x86 subdirectories
    to use node_change_local_settings to temporarily disabled
    checkpointer local switch, as prefetch is allowed even on unaccessible addresses.
    (previous code was buggy because I frogot that each node has it own localswitches).

git-svn-id: trunk@34576 -
2016-09-29 21:34:34 +00:00
pierre
fe4e2956c6 Disable checkpointer call when handling left of prefetch node
git-svn-id: trunk@34559 -
2016-09-24 07:34:10 +00:00
svenbarth
89f7da58ea * fix tcgx86.make_direct_ref: we need to use the register in which we loaded the symbol and combine that with the base register (if it is set) without using an ADD
git-svn-id: trunk@34557 -
2016-09-23 15:37:28 +00:00
Jonas Maebe
27bb656cec * replaced "in_make_direct_ref" field with a trefaddr flag
git-svn-id: trunk@34548 -
2016-09-20 21:43:52 +00:00
Jonas Maebe
e8c9541c04 * don't use ADD in make_direct_ref(), as the flags may be live
git-svn-id: trunk@34547 -
2016-09-20 21:43:45 +00:00
Jonas Maebe
a9073cb50b * don't overwrite the flags in make_simple_ref() if the reference
has no scalefactor (fixup for r14871)

git-svn-id: trunk@34546 -
2016-09-20 21:43:39 +00:00
Jonas Maebe
0afbe85aab * various memory reference alignment fixes
git-svn-id: trunk@34544 -
2016-09-20 21:43:19 +00:00
florian
e5f63779bb * pass S_NO instead of S_XMM to *SQRTSS/SD as size as the memory location is 32/64 bit
git-svn-id: trunk@34540 -
2016-09-18 20:05:25 +00:00
Jeppe Johansen
348c373e9f Fixed two bugs in the x86 peephole optimizer.
git-svn-id: trunk@34497 -
2016-09-10 19:13:48 +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
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
Jonas Maebe
c7ea921066 * renamed thlcgobj.g_external_wrapper() into a_jmp_external_name(), and
moved the code to create the procedure start/end etc. that was at the
    call sites of g_external_wrapper() into the new g_external_wrapper()
    -> got rid of the x86-specific code in expunix, and fixed expunix for
    llvm (e.g. tests/test/tlib1{a,b})

git-svn-id: trunk@34131 -
2016-07-14 15:26:40 +00:00
pierre
40ff777693 * Adapt to TExternCain move to aasmcpu unit
+ Make sure that a lone reference to DGROUP also generates a 'GROUP DGROUP' statement
  + Add %LINE support
  + Add $DEBUG for i8086 nasm

git-svn-id: trunk@34080 -
2016-07-06 07:00:13 +00:00
pierre
38f751573a Copy TExternChain type and AddSymbol procedure to unit aasmcpu from agx86nsm unit
git-svn-id: trunk@34079 -
2016-07-06 06:55:31 +00:00
pierre
fb50d0860b Use BX register instead of AX to reload DS at proc entry if register convention is used
git-svn-id: trunk@34024 -
2016-06-29 20:48:51 +00:00
nickysn
c2305809dc + added an i8086-embedded target support to the compiler (RTL and makefile
support are not done yet)

git-svn-id: trunk@33999 -
2016-06-17 19:15:24 +00:00
florian
d31d24ed16 * r33995 was not complete
git-svn-id: trunk@33997 -
2016-06-16 19:26:43 +00:00
florian
1cbae41cab * proper fix for the issue detected in r33945
git-svn-id: trunk@33995 -
2016-06-15 20:43:52 +00:00
florian
2890927b10 * MovMov2MovMov1 requires that the allocation of the first register is extended
git-svn-id: trunk@33948 -
2016-06-11 19:54:18 +00:00
Jonas Maebe
cf6c7a0a1d * missing instruction type check
git-svn-id: trunk@33945 -
2016-06-10 17:59:18 +00:00
florian
7f44774852 * i386 uses OptPass1And from aoptx86
git-svn-id: trunk@33936 -
2016-06-07 20:01:13 +00:00
florian
ff506eb219 * enabled And2Test optimization
git-svn-id: trunk@33935 -
2016-06-07 20:01:11 +00:00
florian
a5fc8b629a * factored out OptPass1AND from x86-64 and moved it to aoptx86
git-svn-id: trunk@33934 -
2016-06-07 20:01:09 +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
6609e8def2 * correctly set the size of the operation when carrying out Mov Op Mov optimizations
git-svn-id: trunk@33930 -
2016-06-06 21:18:21 +00:00
florian
b274599a47 * made some assembler optimizer methods class methods
git-svn-id: trunk@33929 -
2016-06-06 21:18:20 +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
9ed6638baa * moved MovAnd2Mov optimization to aoptx86
git-svn-id: trunk@33927 -
2016-06-06 21:18:16 +00:00