Commit Graph

19075 Commits

Author SHA1 Message Date
Károly Balogh
4e964c2ed7 m68k: rewrote fixref and a_load_ref_ref, fixing a bunch of problems on ColdFire, unifying and simplifying the code a lot, and hopefully not killing anything in the process
git-svn-id: trunk@33446 -
2016-04-08 03:27:19 +00:00
Károly Balogh
96fe4313dd m68k: fixed spilling code interfering with some ADDQ/SUBQ/MOV3Q instructions, fixes paszlib failing since r32830
git-svn-id: trunk@33445 -
2016-04-08 03:21:09 +00:00
florian
406e3c4ac1 + support xgetbv instruction, resolves issue #29958
git-svn-id: trunk@33418 -
2016-04-03 20:53:10 +00:00
Jonas Maebe
1e1b36515e * don't narrow expressions that contain a mod/div followed by an "and",
since the mod/div get a different result if calculated using fewer
    bits (mantis #29930)

git-svn-id: trunk@33413 -
2016-04-02 22:09:34 +00:00
Jonas Maebe
8c0d9b581c * don't write the destination register in a_load_ref_reg_unaligned() before
the reference has been used for the last time, as the destination
    register could be the base or index register of the reference

git-svn-id: trunk@33393 -
2016-03-30 20:04:31 +00:00
Jonas Maebe
a5dba44fd3 * fixed sign extension for unaligned loads (mantis #29891, although that
code shouldn't use unaligned loads in the first place)

git-svn-id: trunk@33382 -
2016-03-29 14:52:27 +00:00
Jonas Maebe
322493c195 * fixed overflow checking on AArch64 for signed multiplications with zero
(mantis #29912)

git-svn-id: trunk@33380 -
2016-03-29 09:50:42 +00:00
Jonas Maebe
73a303c899 * no need to call maybeadjustresult() after performing a 64 bit operation
git-svn-id: trunk@33379 -
2016-03-29 09:50:39 +00:00
florian
6e56f5c191 * fixed exe output path
git-svn-id: trunk@33376 -
2016-03-28 20:44:08 +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
b562bcfdbd * fixed the alignment filler in code sections on i8086 to always use nops,
instead of using the optimized instructions for 386+, which assume also a
  32-bit address and operand size, so they didn't work even on a 386+ in real
  mode

git-svn-id: trunk@33371 -
2016-03-28 15:04:28 +00:00
yury
d4d70d3865 * Evaluate currency constant expressions when the currency type is 64-bit integer. Issue #28749.
git-svn-id: trunk@33334 -
2016-03-26 17:48:50 +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
svenbarth
35f8d5427f Revert r31262. Not doing type checking on generics leads to strange warnings (e.g. because variables are not considered as written). I better deal with the compile time errors one at a time than the warnings.
The added test shows such a bogus warning (sadly the test suite can handle the occurence or absense of certain messages yet :/ )

git-svn-id: trunk@33324 -
2016-03-24 20:58:04 +00:00
svenbarth
56ae2d34b2 Ensure that (Bit)SizeOf(GenericParameter) returns a sensible value in case of constants (which are evaluated at compile time unlike if occuring in code)
pdecl.pas, readconstant:
  * instead of 0 return 1 for SizeOf() and 8 for BitSizeOf() if the argument is a generic parameter

git-svn-id: trunk@33323 -
2016-03-24 20:51:58 +00:00
nickysn
9a2f5e01d7 + added range checking for the immediate operand of NEC V20/V30's instructions CLR1, SET1, NOT1 and TEST1
git-svn-id: trunk@33322 -
2016-03-24 16:05:11 +00:00
nickysn
0be6d062ac + added range checking for the imm4 operand of NEC V20/V30's instructions
'EXT reg8,imm4' and 'INS reg8,imm4'

git-svn-id: trunk@33321 -
2016-03-24 15:45:23 +00:00
nickysn
be83ae47b9 + support NEC V20/V30's REPC/REPNC prefixes in the assembler reader
git-svn-id: trunk@33320 -
2016-03-24 14:25:32 +00:00
nickysn
a79676bd1c * fixed assembly of the NEC V20/V30 BRKEM instruction
git-svn-id: trunk@33319 -
2016-03-24 13:38:05 +00:00
nickysn
a376229d80 - removed IF_CYRIX and IF_AMD from the TODO list of instructions, that we're
supposed to handle in the i8086 internal asm instruction level check, because
  these two flags are no longer part of the IF_PLEVEL mask, after r33316

git-svn-id: trunk@33318 -
2016-03-23 15:24:59 +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
nickysn
867a4881ba * changed the codes of the IF_CYRIX and IF_AMD instruction flags, to avoid
messing up the other Intel-compatible processor flag, they're used with

git-svn-id: trunk@33316 -
2016-03-23 14:00:48 +00:00
nickysn
c4343c1a2d * don't call make_simple_ref in tcgx86.g_concatcopy on i8086, because that
screws up the handling of segmented references badly and breaks the large,
  compact and huge memory models completely

git-svn-id: trunk@33314 -
2016-03-22 13:56:10 +00:00
yury
af1ea62ff7 * i386-android: By default set CPU type to PentiumM and FPU to SSSE3 according to Android x86 ABI.
git-svn-id: trunk@33309 -
2016-03-21 09:53:18 +00:00
yury
3c6d4f1ee2 * Removed unused vars.
git-svn-id: trunk@33308 -
2016-03-21 09:21:24 +00:00
yury
cac16fa60e * Small refactor of the arm defaults for better readability.
git-svn-id: trunk@33307 -
2016-03-21 09:19:02 +00:00
Jeppe Johansen
681b06bc90 Fixed more linkerscript errors.
git-svn-id: trunk@33306 -
2016-03-21 08:19:45 +00:00
svenbarth
7845362701 powerpc/agppcmpw.pas:
* getopstr: implement the case that refadr is addr_pic_no_got (we'll have to see whether this really works though...)

git-svn-id: trunk@33289 -
2016-03-19 12:38:53 +00:00
svenbarth
854c67175a powerpc/agppcmpw.pas, TPPCMPWAssembler:
* WriteTree: implement the ait_realconst case by calling WriteRealConstAsBytes
  * WriteTree: remove commented code handling the old constants

git-svn-id: trunk@33288 -
2016-03-19 12:37:17 +00:00
svenbarth
9d4e322cd0 Add AT_FUNCTION or AT_DATA to calls to (Weak)RefAsmSymbol. powerpc-macos needs them.
git-svn-id: trunk@33287 -
2016-03-19 12:29:21 +00:00
svenbarth
464941f039 At least in principle prepare the Mach-O writer for other CPU types.
ogmacho.pas:
  + TMachoObjectOutput: new method current_cpu_type to retrieve the cpu_type_t matching the compiler's target platform
  * TMachoObjectOutput.writedata: initialize cputarget using current_cpu_type and use cputarget instead of CPU_TYPE_I386 in the call to AllocMachoWriter
  * surround the RegisterAssembler call with ifdefs for i386

git-svn-id: trunk@33286 -
2016-03-19 12:22:55 +00:00
svenbarth
e243cc77ea macho.pas:
+ add CPU_TYPE_ARM64 for sake of completeness

git-svn-id: trunk@33285 -
2016-03-19 12:18:16 +00:00
svenbarth
123ef01a7a Forgot to commit this...
systems.pas:
  + add new constant systems_indirect_var_imports to denote all targets that /require/ indirect references for cross-unit variables accesses

git-svn-id: trunk@33284 -
2016-03-18 22:41:51 +00:00
svenbarth
c4449fc5e6 nx86ld.pas, tx86loadnode:
* generate_threadvar_access: pass result of use_indirect_symbol() to RefAsmSymbol() to use an indirect access if necessary

git-svn-id: trunk@33283 -
2016-03-18 22:39:41 +00:00
svenbarth
e4feacf29d Load global variables and typed constants from different units using indirect references if necessary.
ncgld.pas, tcgloadnode:
  + new method use_indirect_symbol to determine whether using an indirect reference is necessary at all
  * generate_threadvar_access & pass_generate_code: pass result of use_indirect_code() to RefAsmSymbol() for using an indirect access if needed

git-svn-id: trunk@33282 -
2016-03-18 22:27:28 +00:00
svenbarth
86b9381673 Add new Delphi compatible switch {$G+/-}, {$IMPORTEDDATA ON/OFF} which handles generation of indirect references for cross unit variable accesses if needed for the target.
globtype.pas:
  + tlocalswitch: extend by cs_imported_data
globals.pas:
  * default_settings: cs_imported_data is set by default (Delphi compatible)
switches.pas:
  * turboSwitchTable: G is used for cs_imported_data
scandir.pas:
  + new directive handler dir_importeddata
  * InitScannerDirectives: handle IMPORTEDDATA with dir_importeddata

git-svn-id: trunk@33281 -
2016-03-18 22:04:57 +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
6722c611cf Generate indirect symbols for global variables and (typed) constants.
Note: It needs to be checked what adjustments will need to be done for JVM and LLVM

Note 2: The indirect symbols will always be generated even if the target won't use them so that assembler code can be consistent among the targets (e.g. i386-win32 needs them while i386-linux does not)

ptconst.pas, read_typed_const:
  * generate the indirect symbol in a read only data section
ngenutil.pas, tnodeutils:
  * insertbsssym: generate the indirect symbol in a read only data section

git-svn-id: trunk@33279 -
2016-03-18 21:40:11 +00:00
svenbarth
3971ba7898 Provide basic facilities to handle indirect symbols that are needed for proper dynamic packages support.
symconst.pas:
  + new constant suffix_indirect which will be used to denote indirect symbols
aasmbase.pas:
  * TAsmsymbind: extend by AB_INDIRECT (which is used to define an indirect symbol) and AB_EXTERNAL_INDIRECT (which is used when an unknown indirect symbol is requested)
  * asmsymbindname: adjust for TAsmsymbind changes
  + new constant asmsymbindindirect which is a set of both indirect asm symbol binds
aasmdata.pas, TAsmData:
  * DefineAsmSymbolByClass: adjust to correctly declare an indirect symbol (with suffix_indirect) if one of the indirect asm symbol binds is used
  * RefAsmSymbol: extend by a boolean parameter which is used to request an indirect symbol (usually AB_EXTERNAL_INDIRECT instead of AB_EXTERNAL)

git-svn-id: trunk@33278 -
2016-03-18 21:34:17 +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
e9fab1bfee Fix for Mantis #29080.
psub.pas, tcgprocinfo.parse_body:
  * ensure that parse_generic and current_genericdef are set correctly when parsing a generic routine
pgenutil.pas, generate_specialization_phase2:
  * when we're specializing inside a generic we don't want to have the routine definitions, so let the compiler assume that the routine is no longer a forward definition

+ added test

git-svn-id: trunk@33275 -
2016-03-18 16:31:23 +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
Jonas Maebe
dcedd62049 * regenerated after r33249
git-svn-id: trunk@33269 -
2016-03-18 12:43:44 +00:00
Jonas Maebe
5919ca84bb * fixed string code page after setstring(rawbytestring,..) (mantis #29833)
git-svn-id: trunk@33268 -
2016-03-18 12:43:42 +00:00
Jeppe Johansen
632de58a5e Fixes #29853
git-svn-id: trunk@33267 -
2016-03-18 10:51:46 +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
nickysn
96f331038d * fixed crash in node_complexity() on the callparan nodes of SetLength() (and
perhaps calaparans of other inline nodes as well?)

git-svn-id: trunk@33256 -
2016-03-15 23:46:46 +00:00
florian
f01edc0a57 * copyright message updated to 2016
git-svn-id: trunk@33249 -
2016-03-13 19:37:57 +00:00
florian
45807056c5 * factored out SymbolCandidateForWarningOrHint
* do not issue a hint if a normal parameter is passed to another procedure by var
+ test

git-svn-id: trunk@33248 -
2016-03-13 19:14:26 +00:00