Commit Graph

531 Commits

Author SHA1 Message Date
pierre
11e743e5b8 Use FPC_INCLUDE_LONGWORD_TO_DOUBLE for m68k
git-svn-id: trunk@23181 -
2012-12-18 15:11:48 +00:00
Jonas Maebe
2dac1c445a - disabled Stabs support on 64 bit targets (mantis #23365)
* show a warning if an unsupported debug format is selected

git-svn-id: trunk@23056 -
2012-11-24 13:15:58 +00:00
florian
a42b934c69 * introduce FPC_SUPPORT_X87_TYPES_ON_WIN64 define which allows to build
a win64 compiler support the x87 types extended and comp/currency handled by the FPU, this
  requires to use a i386 compiler as starting compiler and cross compilation because the starting
  compiler must support the 80 bit extended type

git-svn-id: trunk@23023 -
2012-11-18 17:30:51 +00:00
florian
f142019343 * set default cpu type to armv7a when compiling for armhf
git-svn-id: trunk@22845 -
2012-10-24 19:09:16 +00:00
florian
970405c0f3 o merging r22801 of Jeppe Johansen
git-svn-id: trunk@22812 -
2012-10-21 19:05:59 +00:00
Jeppe Johansen
4e84431dde Fix some optimizations which assume that there are 3 operands
Add simple Mul+Sub/Mul+Add into MLS/MLA optimizations
Fix some other small issues in the optimizer
Implement Interlocked* functions with proper use of LDREX/STREX

git-svn-id: branches/laksen/arm-embedded@22801 -
2012-10-21 16:20:52 +00:00
Jonas Maebe
614436d8cb * added pocall_mwpascal to cdecl_pocalls so we no longer have to explicitly
add it everywhere in the paramanagers (where it was often forgotten)
  - removed places where it was explicitly added to cdecl_pocalls checks
  + test

git-svn-id: trunk@22616 -
2012-10-12 08:41:03 +00:00
florian
ca5fabda6d * cleanup some unused units from uses clauses
git-svn-id: trunk@22433 -
2012-09-21 18:53:46 +00:00
florian
d63ebe6464 * bsr implementation for armv5+ using clz
git-svn-id: trunk@22310 -
2012-09-04 12:56:38 +00:00
florian
9be3ca04ad * split FPC_HAS_INTERNAL_BSX_* defines into FPC_HAS_INTERNAL_BSF_* and FPC_HAS_INTERNAL_BSR_*
git-svn-id: trunk@22308 -
2012-09-04 12:56:18 +00:00
florian
ff12d63248 + generic popcnt support
git-svn-id: trunk@22290 -
2012-09-02 20:59:44 +00:00
florian
b782918434 * first draft to support the popcnt instruction, works so far for x86 with a real popcnt instruction
git-svn-id: trunk@22289 -
2012-09-02 20:59:39 +00:00
Jonas Maebe
f5b1c64d36 * default to VFPv2 on Darwin/ARM (all iOS devices ever released until
now support it, and the VFPv2 code has been very stable for quite
    some time already)

git-svn-id: trunk@22120 -
2012-08-19 09:36:46 +00:00
florian
b8ab3d48f6 * fix compilation on non avr/arm architectures
git-svn-id: trunk@22093 -
2012-08-15 16:02:36 +00:00
florian
895aa0d752 * reworked cpuflags for avr
+ define cpuflags in options unit so user programs can access them

git-svn-id: trunk@22089 -
2012-08-15 15:48:59 +00:00
Jonas Maebe
ed8087c71a * check with parameters that must be followed by either nothing or a +/-,
are indeed never followed by other characters (prevents typos such as
    -EnabledFeature instead of -dEnableFeature from simply switching of
    linking)

git-svn-id: trunk@22065 -
2012-08-12 13:30:36 +00:00
florian
4d86d25c6c * -O4 switch for optimizations which are correct but which might have unexpected effects
like field reordering (possible problems cracker classes) or using ebp as normal register (broken
      stack traces from dump_stack)
    + niln is also valid in a cse domain
    * parameters passed by reference shall have a complexity >1
    * load nodes from outer scopes shall have a complexity >1
    * better cse debugging
    + more node types added to cse
    * consider parameters passed by reference in cse
    * take care of cse in parameters in simple cases

git-svn-id: trunk@22050 -
2012-08-09 18:58:54 +00:00
florian
58a7baa62b * build an armhf armv6 compiler if it is built by an armhf armv6 compiler
git-svn-id: trunk@21966 -
2012-07-24 17:11:09 +00:00
pierre
ecddfb7838 + Added FPC_LOCALS_ARE_STACK_REG_RELATIVE system macro for MIPS cpu
git-svn-id: trunk@21893 -
2012-07-12 08:54:06 +00:00
masta
59c726c829 Support ABS intrinsic on ARM
This code will generate the following sequence on arm:
r1=dst
r0=src

movs r1, r0
rsbmi r1, r0, #0

movs will set the N-flag when the MSB of r0 is set, if it is set, rsb
will calculate dst:=0-src;

git-svn-id: trunk@21678 -
2012-06-21 20:12:36 +00:00
pierre
600dd162af Merge of rev21557 by Foxsen
Make macro MIPS/CPUMIPS/MIPS32 common for big endian and little endian mips processors
use MIPSEL* for little endian systems
use MIPSEB* for big endian systems

git-svn-id: trunk@21599 -
2012-06-13 22:25:38 +00:00
pierre
2b90b444bf Differentiate mips/mipsel default system macros
git-svn-id: trunk@21546 -
2012-06-08 10:08:24 +00:00
pierre
d6d237d688 * Patch from Fuxin Zhang: FPC_HAS_INTERNAL_SAR set for mips and mipsel CPUs
git-svn-id: trunk@21532 -
2012-06-07 23:07:32 +00:00
Jonas Maebe
7dbfd9dc81 * don't say a config file is empty if it only contains #define, #undef,
#write and/or #include statements (mantis #20504)

git-svn-id: trunk@21345 -
2012-05-20 15:00:53 +00:00
sergei
78c0215447 Preparations to native threadvar support:
- i386/cgcpu.pas: removed segment check, rejecting references with segment here is too early. These references are passed to tcgx86.a_loadaddr_ref_reg, which can generate required code for them (or reject if they are not allowed for the target).
- ncgld.pas: removed "not tf_section_threadvars in target_info" condition, it is inverse to one on the following line, making non-generic branch impossible to execute.
+ Define FPC_SECTION_THREADVARS macro if corresponding flag is set for the target.

git-svn-id: trunk@21210 -
2012-05-03 16:26:44 +00:00
Jonas Maebe
aee5380ae0 * merged trunk up to r20882
o support for the new codepage-aware ansistrings in the jvm branch
   o empty ansistrings are now always represented by a nil pointer rather than
     by an empty string, because an empty string also has a code page which
     can confuse code (although this will make ansistrings harder to use
     in Java code)
   o more string helpers code shared between the general and jvm rtl
   o support for indexbyte/word in the jvm rtl (warning: first parameter
     is an open array rather than an untyped parameter there, so
     indexchar(pcharvar^,10,0) will be equivalent to
     indexchar[pcharvar^],10,0) there, which is different from what is
     intended; changing it to an untyped parameter wouldn't help though)
   o default() support is not yet complete
   o calling fpcres is currently broken due to limitations in
     sysutils.executeprocess() regarding handling unix quoting and
     the compiler using the same command lines for scripts and directly
     calling external programs
   o compiling the Java compiler currently requires adding ALLOW_WARNINGS=1
     to the make command line

git-svn-id: branches/jvmbackend@20887 -
2012-04-15 15:54:10 +00:00
Tomas Hajny
2cb7b4cf0f * fixed a silly bug from r20694
git-svn-id: trunk@20852 -
2012-04-11 21:12:03 +00:00
Jonas Maebe
7aa3b99fb5 + -CN/{$CHECKLOWADDRLOADS+/-} switch to enable explicit checks for accesses
to low addresses in case the target cpu/OS does not support this (enabled
    for reads on AIX/PPC because on AIX the first 16KB are readable)

git-svn-id: trunk@20832 -
2012-04-11 18:05:50 +00:00
florian
d1e16c3cd4 + define CPUX86 on i386 and CPUX64 on x86-64, resolves #21670
git-svn-id: trunk@20726 -
2012-04-06 21:05:09 +00:00
Tomas Hajny
b12c38984b * fpc binary supported options made localizable and not shown separately from those handled by ppc* any longer
git-svn-id: trunk@20694 -
2012-04-02 22:11:21 +00:00
Jonas Maebe
6ba8dc7146 + support for the ARM hard float EABI on Linux (patch by Peter Green):
o new eabihf (hard float) abi
   o vfpv3_d16 variant of VFP (default variant used by EABI assemblers: VFPv3
     with only 16 double registers instead of 32) and pass it to GNU as
   o make the odd numbered single precision floating point VFP registers
     available for explicit allocation for use by the calling convention
  * fixed copy/paste error in stdname of S30 register
  -> use -dFPC_ARMHF to create an ARM eabi hard float compiler
  (mantis #21554)

git-svn-id: trunk@20660 -
2012-03-29 20:50:09 +00:00
svenbarth
bf5695c455 Allow unsetting the option for C-operators (-Sc-).
git-svn-id: trunk@20639 -
2012-03-27 11:40:10 +00:00
Jonas Maebe
4fd9d98dbb * correctly set default version for iPhoneOSVersionMin rather than for
MacOSXVersionMin when targeting iOS/iphonesim

git-svn-id: trunk@20536 -
2012-03-18 11:05:36 +00:00
Jonas Maebe
eb2cccffda + -WM<X> and -WP<x> command line parameters to specify the minimally required
Mac OS X/iOS version for the compiler code
   o such a parameter is not passed, extract the information from the
     environment variables MACOSX_DEPLOYMENT_TARGET/IPHONEOS_DEPLOYMENT_TARGET,
     like gcc
   o if neither the parameter nor the environment variable is used, use preset
     default values
   o pass on this version setting on to the Darwin linker
   o use this setting to determine which version of the startup code (crt1.o
     etc) to use, if any (based on information gathered from the GCC sources)
   o define a symbol called MAC_OS_X_VERSION_MIN_REQUIRED/
     IPHONE_OS_VERSION_MIN_REQUIRED based on this parameter
   o for usage information, see
     http://wiki.freepascal.org/FPC_New_Features_Trunk#Support_for_specifying_and_querying_the_deployment_version

git-svn-id: trunk@20503 -
2012-03-10 19:31:57 +00:00
sergei
92f927976e * Rewrote fpc_dynarray_copy to trim out-of-range arguments instead of raising range error. Makes behavior Delphi-compatible and resolves #21396.
* Changed copying the entire array to use range 0..high(sizeint) instead of -1..-2.

git-svn-id: trunk@20468 -
2012-03-04 04:41:52 +00:00
pierre
4a351f42fe Commit some MIPS changes
git-svn-id: trunk@20219 -
2012-02-02 23:43:52 +00:00
sergei
cbad0abab5 + Platform-specific exception support for x86_64-win64. Enable by cycling with OPT=-dTEST_WIN64_SEH.
git-svn-id: trunk@20098 -
2012-01-16 23:13:31 +00:00
florian
e0d7af703a * proper feature handling for gba
* slinebreak shall be a real constant

git-svn-id: trunk@19973 -
2012-01-05 17:27:02 +00:00
sergei
49700e675c * Changed code generation for variant assignments to typecast arguments to TVarData instead of using pointers. Fixes one (probably the ugliest one) case of non-disposed temp variables:
When arguments are temps, they are supposed to be released by tcgcallnode.release_para_temps. However, taking address with taddrnode effectively changes original location of temp to some LOC_REGISTER, tcgcallnode.release_para_temps no longer sees the original location and therefore does not free such temps.

git-svn-id: trunk@19959 -
2012-01-03 19:31:58 +00:00
florian
2dc2d65b1a + on windows, search %ALLUSERSPROFILE% and %USERPROFILE% for fpc.cfg
git-svn-id: trunk@19927 -
2011-12-30 16:20:27 +00:00
Jonas Maebe
0d5b2b84a8 + Android/JVM target, including a translation of the Android r14 SDK
(= Android 4.0) java headers: java.*, javax.*, org.*, junit.*, android.*).
    The RTL can also be used to target earlier versions of the Android
    platform, but you manually have to take care of not using APIs that
    weren't available yet. Adding separate units for separate platform
    versions would only partly solve the problem, because some of the
    classes used inside the system unit have also changed across
    versions.

    Use -Tandroid while compiling to select the Android OS as target
    platform.

git-svn-id: branches/jvmbackend@19830 -
2011-12-12 02:34:34 +00:00
Jonas Maebe
74510f9069 + generic infrastructure for target-specific switches
+ -CTcompactintarrayinit command line option to change the code generation
    for typed array of some kind of integer-type initialization so that it
    takes up less space in the bytecode (because the bytecode for all
    routines, including the class initialization code that contains the
    typed constant init code, is limited 64kb, large array or multiple
    array constants could fairly easily bump into that limit)

git-svn-id: branches/jvmbackend@19638 -
2011-11-14 22:57:41 +00:00
florian
c12a4989d0 + use cpurox define in the compiler for CPUs having internal ror/rol support
+ optimize (i shl x) or (i shr (bitsizeof(i)-x)) and friends into rol/ror(x,i)

git-svn-id: trunk@19635 -
2011-11-13 18:40:34 +00:00
florian
73a084d662 * fixes bootstrapping with 2.6.0
git-svn-id: trunk@19491 -
2011-10-15 12:42:33 +00:00
paul
21ac5dfb3b compiler: output ansistring constants in explicit codepage if codepage is explicitly defined using either $codepage directive or compiler switch or for SystemCodepage modeswitch
git-svn-id: trunk@19462 -
2011-10-11 08:58:56 +00:00
marco
cf7b43948a * cmdstr is ansistring now. Running ppc386 "" could cause access of string[1] while length(string)=0
git-svn-id: trunk@19394 -
2011-10-06 18:16:12 +00:00
florian
a6d01c09aa * make compiler compilable with 2.4.4 rtl
git-svn-id: trunk@19269 -
2011-09-28 18:54:32 +00:00
florian
d7f7a9bb76 * patch by Alexander Shishkin to clean up $ifopt usage by $push/$pop, resolves #20346
git-svn-id: trunk@19256 -
2011-09-27 20:22:40 +00:00
Jonas Maebe
f96f5f9e94 + {$VARPARACOPYOUTCHECK+/-} / -Cv switch to enable checking
var-parameters on the JVM target for changes to the value passed
    as var-parameter during the function call (because they are handled
    via copy-in/copy-out, this may indicate unexpected bahviour later on).

    out-parameters are checked in the same way, except if the out-parameter
    is a local variable because then reading it before the call may result
    in a bytecode verification error (since the variable may not yet be
    initialized)

git-svn-id: branches/jvmbackend@19153 -
2011-09-19 19:59:26 +00:00
Jonas Maebe
6cb32de339 + support for help screen lines prefixed by 'J' to mark them as JVM-specific
git-svn-id: branches/jvmbackend@19152 -
2011-09-19 19:59:19 +00:00