Commit Graph

1032 Commits

Author SHA1 Message Date
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
nickysn
518cdf9674 * replaced the saved_XXX_registers arrays with virtual methods inside
tcpuparamanager, very similar to the existing get_volatile_registers_XXX. The
  new methods are called get_saved_registers_XXX, where XXX is the register
  type ("int", "address", "fpu" or "mm")

git-svn-id: trunk@38794 -
2018-04-19 21:22:16 +00:00
florian
71e71ad267 * fix currency division on non x86 32 bit targets
* disable fix for #33439 during bootstrapping with 3.0.x, as 3.0.x cannot compile the currency division without the fix above

git-svn-id: trunk@38558 -
2018-03-17 22:44:44 +00:00
florian
208c2cce52 * fix case table detection for thumb
git-svn-id: trunk@38418 -
2018-03-05 21:44:19 +00:00
Károly Balogh
dbb91b5ef0 arm-netbsd: added platform define and dummy rtl files so the build passes for this platform. port not functional yet
git-svn-id: trunk@38412 -
2018-03-05 15:38:46 +00:00
florian
c3a0a4e252 + support fmrrd/fmdrr, resolves #32398
git-svn-id: trunk@38270 -
2018-02-17 16:32:11 +00:00
florian
cd41312a8f * fixes not(<qwordbool>) on arm
* fixes not(<(q/l)wordbool>) on avr

git-svn-id: trunk@38263 -
2018-02-16 22:38:35 +00:00
Jonas Maebe
1b66995754 * factored out check to determine whether a variable can be subscripted in
inline assembly, and fixed check after r35959 (mantis #32318)
   o can also subscript parameters passed by value on the stack
   o can also subscript local variables, the parameters passed by reference
     that are subsequently copied into a local

git-svn-id: trunk@37886 -
2018-01-01 14:29:21 +00:00
florian
4cf2a2672a changes to fix #32043
* changed most of the variables in the assembler readers used to store constants from aint to tcgint 
  as aint has only the size of the accumular while some CPUs (AVR) allow larger constants in instructions
+ allow access to absolute symbols with address type in inline assembler
* allow absolute addresses in avr inline assembler
+ tests

git-svn-id: trunk@37411 -
2017-10-06 21:07:19 +00:00
florian
5b755661d8 + patch by Simon Ameis: adds all the STM32F091* microcontroller units to the list of supported ARM MCUs, resolves issue #32484
git-svn-id: trunk@37378 -
2017-10-01 18:59:01 +00:00
Jeppe Johansen
09a8cafcd7 Restricted MlaCmp>Mlas optimization to only work in ARM mode.
git-svn-id: trunk@36602 -
2017-06-26 18:14:46 +00:00
Jeppe Johansen
f3889a191b Generate bx lr exit instruction in Thumb-2 instead of mov pc,lr as bx lr will trigger an exception return but mov doesn't.
git-svn-id: trunk@36597 -
2017-06-26 08:05:31 +00:00
Jonas Maebe
61af0fb72d * only take into account the location of the parameter at the callee side to
determine whether it's in a register if it's a pure assembler routine
  * you can't "index" implicit pointers either using their fields

git-svn-id: trunk@36287 -
2017-05-21 20:17:11 +00:00
nickysn
efc5e339d0 * use an enum instead of integer constants to represent inline numbers
* compinnr.inc include file converted to a unit
* inline number field size stored in ppu increased from byte to longint
* inlines in the parse tree (when written with the -vp option) now printed with
  their enum name, instead of number

git-svn-id: trunk@36174 -
2017-05-10 14:41:43 +00:00
yury
2ae3ce79bb * ARM: Never use the "BLX label" instruction. Use "BL label" instead.
The linker will always change BL to BLX if necessary, but not vice versa (linker version dependent).
  "BLX label" ALWAYS changes the instruction set. It changes a processor in ARM state to Thumb state,
  or a processor in Thumb state to ARM state.

git-svn-id: trunk@36086 -
2017-05-04 15:55:55 +00:00
yury
95094e9a8f * Removed unused vars.
git-svn-id: trunk@36073 -
2017-05-04 10:38:49 +00:00
Jonas Maebe
aa82e00615 * fixed check to determine whether a record parameter can be subscripted
directly in inline assembly: that's only possible if it's a register
    parameter where the address of the record was passed (rather than the
    record itself), or if a parameter has been explicitly typecasted in
    Intel-style assembly using ".size"

git-svn-id: trunk@35959 -
2017-04-26 19:43:35 +00:00
florian
4868b83157 * do not generate always debug messages in the arm assembler optimizer
git-svn-id: trunk@35891 -
2017-04-22 09:37:18 +00:00
florian
50dba9ad66 * if both labels of a case label are equal, we still cannot skip the comparison in a jump tree, resolves #31589
git-svn-id: trunk@35880 -
2017-04-21 19:32:27 +00:00
florian
73c46a5988 - removed unused constants
git-svn-id: trunk@35664 -
2017-03-26 13:06:34 +00:00
florian
971280f082 + tarmcasenode.genjmptreeentry
git-svn-id: trunk@35649 -
2017-03-23 21:37:12 +00:00
yury
3bedccf946 * ARM scheduler need to move register de-allocs located before the instruction. Also preserve order of allocs and de-allocs.
git-svn-id: trunk@35552 -
2017-03-09 19:05:15 +00:00
yury
fe0e30030f * In ARM scheduler move all needed additional items with an instruction:
- all reg allocs and PIC labeels before the instruction;
  - all reg deallocs and reg syncs after the instruction.

  It fixes bug #31135.

git-svn-id: trunk@35545 -
2017-03-09 12:26:02 +00:00
Jonas Maebe
4c68ea1000 * use pocalls_cdecl and cstylearrayofconst more consistently instead of
ad hoc set constants containing varying number cdecl-like calling
    conventions
   o added pocall_sysv_abi_cdecl and pocall_ms_abi_cdecl to cstylearrayofconst
   o also allow C-style blocks with mwpascal instead of cdecl (mwpascal = cdecl
     with "const" = "constref" for record parameters)
   o did not touch cases related to name mangling and import/export names,
     because those are a real mess and easily break things left and right :/

git-svn-id: trunk@35479 -
2017-02-25 11:46:35 +00:00
florian
c961c72c30 * tarmtypeconvnode.first_int_to_real should call the generic method in the parent class, if soft fpu code is generated, resolves #31350
git-svn-id: trunk@35430 -
2017-02-12 16:05:13 +00:00
Jonas Maebe
015f034904 * reverted r35424, wasn't ready for commit yet
git-svn-id: trunk@35426 -
2017-02-11 21:21:44 +00:00
Jonas Maebe
4d9617da97 * fixed check to determine whether a record parameter can be subscripted
directly in inline assembly: that's only possible if it's a register
    parameter where the address of the record was passed (rather than the
    record itself)

git-svn-id: trunk@35424 -
2017-02-11 19:57:08 +00:00
florian
b41989adfa * offset of vstr/vld is limited to +/- 1020, take care of this during spilling
git-svn-id: trunk@35396 -
2017-02-04 18:42:02 +00:00
Jeppe Johansen
7e75457a3e Added more Nordic Semi controllers. Created a new unit for NRF52x controllers with a more precise register naming following Nordic SDK conventions.
Patch from Paul Mitchell.

git-svn-id: trunk@35274 -
2017-01-10 20:30:20 +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
f5f895e2a3 syscalls: unify call reference creation across 4 different CPU archs. less copypasted code, brings x86_64 AROS support up to speed
git-svn-id: trunk@35034 -
2016-12-02 09:29:09 +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
b28221349e - removed aoptcs unit and (dummy) units that used it
o remenants of a long abandoned attempt at adding a generic
     assembler CSE optimiser

git-svn-id: trunk@34886 -
2016-11-13 16:06:14 +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
Károly Balogh
657aa06360 arm: arm-aros syscall support
git-svn-id: trunk@34809 -
2016-11-06 14:31:42 +00:00
marcus
86940dfb32 AROS: added arm-aros target to compiler and fpcmake
git-svn-id: trunk@34805 -
2016-11-06 10:51:45 +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
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
Jeppe Johansen
6a1c1e4f29 Added support for NRF52832 controllers.
git-svn-id: trunk@34170 -
2016-07-22 10:01:10 +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
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
yury
3c6d4f1ee2 * Removed unused vars.
git-svn-id: trunk@33308 -
2016-03-21 09:21:24 +00:00
Károly Balogh
e0c21b6f8b ARM: avoid some range check errors, while running a compiler compiled with -CR
git-svn-id: trunk@33257 -
2016-03-16 10:08:44 +00:00
Jonas Maebe
38fd0efa3b * don't conditionalise BL on ARM, because it may have to be converted to
BLX at link time
   o related to the change introduced in r32788

git-svn-id: trunk@33199 -
2016-03-06 17:44:08 +00:00
florian
cb4773432b + hardfloat directive (arm only): use hard float calling conventions regardless of the abi, resolves #29715
git-svn-id: trunk@33196 -
2016-03-06 15:47:31 +00:00
florian
c564acd378 * fix assembling of vfnm*
git-svn-id: trunk@33189 -
2016-03-06 13:33:29 +00:00
florian
e1546303f8 + enable use of vfma and friends on arm when doing fastmath optimizations
git-svn-id: trunk@33188 -
2016-03-06 13:33:27 +00:00