Commit Graph

201 Commits

Author SHA1 Message Date
yury
1b3a3a7983 * Removed lot of unused local vars. It is useful to turn on the notes in options. :)
git-svn-id: trunk@44053 -
2020-01-28 18:45:33 +00:00
Jonas Maebe
1e3f72403e * renamed getintparaloc to getcgtempparaloc
o it can be used for more than integer parameters

git-svn-id: trunk@43781 -
2019-12-24 22:12:25 +00:00
florian
e0041a8244 * compilation of x86 and PowerPC fixed
git-svn-id: trunk@43158 -
2019-10-09 19:26:59 +00:00
Jonas Maebe
3fee990218 * on Mach-O, PECOFF and ELF platforms, write local symbols as hidden/
private_extern (or plain global in case of PECOFF, as the effect is
    the same there): visible across object files, but they become local
    when linked into a binary/library. This enables cross-unit inlining
    of functions accessig implementation-only symbols.

git-svn-id: trunk@42340 -
2019-07-07 21:33:43 +00:00
Jonas Maebe
281b3ad276 * fix case completeness and unreachable code warnings in compiler that would
be introduced by the next commit

git-svn-id: trunk@42046 -
2019-05-12 14:29:03 +00:00
Jonas Maebe
07bd4ba517 * let all the case code generation work with tconstexprint instead of aint,
so it also works for 32 bit targets and a high level code generator
    (where aint is still 32 bit, but 64 bit operations are not decomposed)

git-svn-id: trunk@41441 -
2019-02-24 19:58:37 +00:00
florian
0cc3be49fa * GAS readers and writers can handle section flags
git-svn-id: trunk@39998 -
2018-10-20 18:23:24 +00:00
florian
d4cf97a755 * wrong ifdef exposed by warning with -O3 fixed
git-svn-id: trunk@39989 -
2018-10-20 09:16:51 +00:00
Jonas Maebe
0b246f3dbd * converted Boolean8 to an internal type, and mapped Boolean to the
new internal pasbool1(type) (part of mantis #34411)
   o apply the _Bool x86-64 parameter passing rules only to pasbool1

git-svn-id: trunk@39949 -
2018-10-16 21:14:18 +00:00
pierre
ada8891d9e Also allow clang assembler for powerpc64-darwin target
git-svn-id: trunk@39580 -
2018-08-06 16:13:05 +00:00
Jonas Maebe
4686f61002 * keep track of the temp position separately from the offset in references,
so that they can still be freed after the reference has been changed
    (e.g. in case of array indexing or record field accesses) (mantis #33628)

git-svn-id: trunk@38814 -
2018-04-22 17:03:16 +00:00
pierre
9e3a6368cb Generate error if CR field of C var is zero, as it leads to invalid instruction for conditional branching
git-svn-id: trunk@38494 -
2018-03-10 22:02:29 +00:00
pierre
269849dd59 Update cgsize2string (EXTDEBUG only function)
git-svn-id: trunk@38493 -
2018-03-10 21:59:22 +00:00
pierre
ed695624ab Add clang as assembler for powerpc-darwin (powerpc64 is apparently not yet supported for MachO format)
git-svn-id: trunk@38161 -
2018-02-08 09:38:16 +00:00
nickysn
2af5c9d508 * changed type used for section alignment from byte/shortint to longint, so the
internal object writer and the internal linker support object files with
  sections with alignment >=256

git-svn-id: trunk@37518 -
2017-10-25 15:47:29 +00:00
Károly Balogh
903548b21a morphos: added legacy GNU AS support for the ancient AS version, which is still bundled as default in the SDK. switches off named sections support in the assembler generator
git-svn-id: trunk@36487 -
2017-06-11 23:36:40 +00:00
Károly Balogh
3deb3fb03b powerpc: indentation and whitespace fixes. no functional changes.
git-svn-id: trunk@36485 -
2017-06-11 13:02:47 +00:00
pierre
f7c2ab2e7c aggas.pas: Make WriteSection method of TGNUAssembler class virtual.
ppcgen/agppcgas.pas: Override WriteSection method in TPPCAIXAssembler class
  to compute required alignment for base sections.

git-svn-id: trunk@36227 -
2017-05-16 11:58:33 +00:00
pierre
1342d0792f Fix powerpc cycle for AIX target
git-svn-id: trunk@35275 -
2017-01-10 23:21:49 +00:00
Jonas Maebe
880d438704 * renamed t<cpuname>procinfo to tcpuprocinfo for all targets, so we can
inherit from it for LLVM without a thousand ifdefs

git-svn-id: trunk@35141 -
2016-12-16 22:41:21 +00:00
Károly Balogh
1dd375cd61 powerpc: improved version of int_to_bool casting. now both also passes the improved version of tb0625
git-svn-id: trunk@35109 -
2016-12-11 16:00:27 +00:00
svenbarth
0c372f0beb * fix compilation of Rtti unit on PowerPC: converting a Int64 to a Boolean failed (in this case with an internal error)
+ added a test though we should probably extend tcnvint2.pp to test converting ints to different sized boolean types...

git-svn-id: trunk@35101 -
2016-12-10 19:13:07 +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
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
pierre
89c1b68b14 * Delete regvars unit.
This unit was empty unless OLDREGVARS macro was set,
    but this does not compile and no change has been made since 2011.

  * Remove regvars from all _USES clauses.

git-svn-id: trunk@34808 -
2016-11-06 14:01:39 +00:00
svenbarth
74db27ca15 * due to the removal of addr_load_indirect also revert the changes to refaddr2str(_darwin)
git-svn-id: trunk@34580 -
2016-09-30 14:13:26 +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
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
pierre
c327a07414 Avoid memory leak for InstrWriter field in powerpc TAssembler descendants
git-svn-id: trunk@34402 -
2016-08-30 21:21:59 +00:00
pierre
be9e097841 Use new class TAsmDataDef as ancestor for TPPCASmData
git-svn-id: trunk@34376 -
2016-08-25 22:27: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
Jonas Maebe
14bab6c85d * fixed ppc jump table generation in case a jump table has cases for the
lowest and highest element of the type of the case expression, and the
    lowest element <> 0 (mantis #29906)

git-svn-id: trunk@33630 -
2016-05-03 09:00:52 +00:00
Károly Balogh
e04bddc143 fixed build for MorphOS, which uses a heavily patched old GNU AS, and it doesn't know the -a32 argument
git-svn-id: trunk@33547 -
2016-04-22 23:52:28 +00:00
Jonas Maebe
70cfe1dc23 * fixed cross-assembling from Linux/ppc(32|64) to the "other bitness"
git-svn-id: trunk@33537 -
2016-04-20 22:17:08 +00:00
florian
4ccc75e2e8 + be able to specify endianess in the assembler command line
+ pass endianess to the powerpc assembler (GNU only), so an unified be/le GNU assembler can used to build powerpc64le

git-svn-id: trunk@32894 -
2016-01-09 14:28:25 +00:00
Jonas Maebe
da696057ab * converted register_maybe_adjust_setbase() to the high level code generator
git-svn-id: trunk@32591 -
2015-12-05 18:03:37 +00:00
Jonas Maebe
a32605bd38 * don't force setelementn's into a 32 bit modifiable register if they were
already in a register, as this changes the result location into a size
    different from what resultdef says (and only in that specific case)
   o modified the ppc code so that it always forces a setelementn to uinttype,
     as that is the size that is expected by the operations later on

git-svn-id: trunk@32296 -
2015-11-12 20:55:33 +00:00
Jonas Maebe
1131b08d6d * changed idtext of as_darwin to AS-DARWIN, so it can be explicitly
selected via -Aas-darwin (since it compares uppercased strings)

git-svn-id: trunk@31808 -
2015-09-24 06:49:29 +00:00
Jonas Maebe
8155d759dc - reverted r31806, it breaks building on non-Darwin (mantis #28716)
git-svn-id: trunk@31807 -
2015-09-24 06:44:12 +00:00
Jonas Maebe
c0b451e788 - removed as_darwin, since there is no difference with as_gas (there is no
GNU as from binutils for Darwin, and Apple's "as" is based on an old
    version of GNU as)
   o this will not cause any backward compatibility problems, as the
     previous identifier for as_darwin was "AS-Darwin" and the compiler
     compared the uppercase value of the -A parameter to the identifier,
     so it was not explicitly selectable earlier. The new name is "AS",
     so it is explicitly selectable via -Aas like on other platforms.

git-svn-id: trunk@31806 -
2015-09-23 21:25:38 +00:00
Jonas Maebe
991e1f49bd * store a pointer to the used tasminfo record in every assembler writer, so
that we can use assembler writers with different conventions from the
    currently set target_asm (e.g. an x86 assembler writer for inline assembly
    in LLVM IR)

git-svn-id: trunk@31628 -
2015-09-12 23:32:13 +00:00
Jonas Maebe
b3d0197f98 * factored out the output file handling (mostly writing data) from the
external assembler writer, so we can reuse the archtecture-specific
    writers to write inline assembly in LLVM IR files

git-svn-id: trunk@31625 -
2015-09-12 23:32:01 +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
florian
b222d0b663 * correctly handle LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF in second_int_to_bool, resolves issue #28007
git-svn-id: trunk@30765 -
2015-05-02 13:52:50 +00:00
Jonas Maebe
9079227c56 * don't give an internalerror when trying to prefetch a regvar or even
something without a location at all; it's a hint/optional operation,
    so if there's nothing to prefetch just don't do anything
    (mantis #27811)

git-svn-id: trunk@30502 -
2015-04-08 20:35:13 +00:00
Jonas Maebe
61e4a1b811 + added tasmlist parameter to getintparaloc() (needed for llvm)
git-svn-id: trunk@30429 -
2015-04-04 14:29:16 +00:00
Jonas Maebe
bd203a5b57 * synchronised with trunk till r30240
git-svn-id: branches/hlcgllvm@30241 -
2015-03-15 19:44:58 +00:00