Commit Graph

442 Commits

Author SHA1 Message Date
nickysn
ca46040728 + added 16-bit versions of the InterLocked* functions for i8086
git-svn-id: trunk@35149 -
2016-12-18 00:17:10 +00:00
Jonas Maebe
868370d727 + InterlockedCompareExchangePointer() alias for InterlockedCompareExchange(pointer)
(mantis #29964)

git-svn-id: trunk@34599 -
2016-10-02 12:57:07 +00:00
svenbarth
a2c9c75e97 Convert Insert() and Delete() to intrinsics in preparation for dynamic array support for these two procedures.
Since overloading compilerprocs does not work each procedure got its own unique name, but they are using the new compilerproc extension to map them to the Insert and Delete symbol so that error messages can be shown with the respective name for the procedure declarations instead of fpc_shortstr_delete for example.

git-svn-id: trunk@33895 -
2016-06-03 21:25:49 +00:00
svenbarth
788393c298 Change WideString initialization to work correctly with indirect main information as well
rtl/inc/systemh.inc & rtl/java/jsystemh_types.inc:
  - TEntryInformation: remove WideInitTables
rtl/win/sysosh.inc:
  + TEntyrInformationOS: add WideInitTables
rtl/win/syswin.inc:
  * adjust WStrInitTablesTable, so that it is now a pointer and can be used both with direct and indirect main entry
  * InitWin32Widestrings: WStrInitTablesTable is now a pointer
rtl/win32/sysinit.inc:
  * WideInitTables has moved to the OS specific part of the entry information
rtl/win32/system.pp:
  * OsSetupEntryinformation: setup WStrInitTablesTable

git-svn-id: trunk@33571 -
2016-04-29 13:13:14 +00:00
Károly Balogh
1192978152 m68k: software mod/div and mul helper requirement has nothing to do with the softfpu, CF and plain 68k simply needs it
git-svn-id: trunk@33532 -
2016-04-18 02:20:08 +00:00
florian
bb1f2b8062 * make NativeInt and NativeUInt unique types, resolves #29444
git-svn-id: trunk@33234 -
2016-03-13 15:30:38 +00:00
svenbarth
7b67ead440 Pass further main program data through the indirect entry information.
rtl/inc/systemh.inc:
  + TEntryInformation: add Pointer fields ResourceStringTables, ResStrInitTables, WideInitTables (for targets with separate WideString type) and ResLocation (not used on Windows, but since most other targets don't have Windows' resource system it's not part of OS)
rtl/java/jsystemh_types.inc:
  + TEntryInformation: adjust for consistency reasons
rtl/win32/sysinit.inc:
  * SysInitEntryInformation: initialize with pointers to the correct tables

git-svn-id: trunk@33027 -
2016-01-29 16:51:27 +00:00
svenbarth
3da7675eb1 Add a possiblity for targets to specify additional fields for TEntryInformation using an optional sub record called TEntryInformationOS
rtl/inc/systemh.inc:
  + add field OS of type TEntryInformationOS if the target specifies HAS_ENTRYINFORMATION_OS
rtl/java/jsystemh_types.inc:
  + same adjustments as above for consistency reasons despite it being not used there anyway

git-svn-id: trunk@33024 -
2016-01-29 15:32:33 +00:00
svenbarth
b525cecad8 - get rid of the calling convention modifier for PascalMain as it's generated using the default calling convention anyway (without any parameters this luckily doesn't matter that much ;) )
(Note: adjusted merge info as in my packages branch there is a less complete commit for this)

git-svn-id: trunk@33023 -
2016-01-29 14:51:15 +00:00
nickysn
0f6b5161e6 * the 'count' parameter of Move and FillChar on i8086 made 16-bit unsigned,
instead of signed (BP7 compatibility)

git-svn-id: trunk@32443 -
2015-11-21 17:55:47 +00:00
marco
08f9400070 * adding puint64 mantis #29020
git-svn-id: trunk@32351 -
2015-11-16 20:39:38 +00:00
marco
d95b95e648 * fix for #28940 also add PSizeUint
git-svn-id: trunk@32257 -
2015-11-06 15:54:54 +00:00
Jonas Maebe
80902035e0 * moved excepth.inc include from the system unit implementation to interface
so that we can still find the type definitions in it once we don't store
    the entire implementation symtable to the ppu anymore

git-svn-id: trunk@32151 -
2015-10-25 19:21:54 +00:00
michael
8161c1135c * Add offset to Pos functions, Delphi XE 8 compatible.
git-svn-id: trunk@31464 -
2015-08-31 13:05:37 +00:00
marco
8cf0c3bcb6 * camel case paramcount as per mantis #28503
git-svn-id: trunk@31307 -
2015-08-10 08:17:46 +00:00
michael
81fa382c42 * Rename WriteExceptionToStdErr -> WriteErrorsToStdErr
git-svn-id: trunk@30555 -
2015-04-12 15:37:46 +00:00
michael
94e57aa463 * Moved WriteExceptionToStdErr to system unit, so it is observed even in absence of sysutils (bug ID 27708)
git-svn-id: trunk@30551 -
2015-04-12 13:58:49 +00:00
nickysn
28dc9fe68b * fixed definition of the ALUSInt type on 16-bit CPUs
git-svn-id: trunk@30453 -
2015-04-05 21:47:32 +00:00
florian
134457fb8c + define types depending on the ALU register size of the CPU, e. g. for most 8 Bit CPUs this is different from Ptr(U)Int, and e.g. also for the far pointer memory models of i8086
git-svn-id: trunk@30451 -
2015-04-05 21:25:03 +00:00
Jonas Maebe
6a70c84258 + internal bsr/bsf support for ppc32 and ppc64
git-svn-id: trunk@30152 -
2015-03-09 16:48:34 +00:00
Jonas Maebe
ff020a3be4 + "Utf8CodePointLen(pansichar,MaxLookAhead,IncludeCombiningDiacriticalMarks):
sizeint"  function that returns:
   <0: invalid sequence detected after processing "-result" bytes
   0:  incomplete (may still be valid if MaxLookAhead is increased)
   >0: sequence of result bytes forms a codepoint (+ combining diacritical
       marks if that parameter was true)

git-svn-id: trunk@30047 -
2015-03-01 17:12:17 +00:00
Jonas Maebe
416d0b3974 * enable internal handling of 64 bit sar() on AArch64
git-svn-id: trunk@29983 -
2015-02-23 22:57:15 +00:00
Jonas Maebe
a8d05b66e2 + AArch64 internal bsf/bsr support
git-svn-id: trunk@29979 -
2015-02-23 22:57:02 +00:00
Jonas Maebe
03f8a15904 * enable internal handling of 32 and 64 bit rotates on AArch64
git-svn-id: trunk@29977 -
2015-02-23 22:56:56 +00:00
Jonas Maebe
b0112fa63f + initial AArch64 support in systemh.inc, options.pas, version.pas and
psystem.pas

git-svn-id: trunk@29903 -
2015-02-23 22:52:04 +00:00
sergei
7666cd5c0e + Overloaded procedure dump_stack that calls CaptureBacktrace, thus encapsulating internals of stack traversing.
* Use this new procedure in heaptrc unit.

git-svn-id: trunk@29713 -
2015-02-15 20:00:24 +00:00
svenbarth
2d454dc8fa Move DynLibs support to System unit using a manager approach like for Threads, WideStrings, etc.. This is needed so that we can support features like "delayed" and loading of dynamic packages.
Each port that allows the usage of dynamic libraries should call InitSystemDynLibs during initialization of the System unit.
The DynLibs unit has been adjusted to be a forwarder for the functions that now reside in the System unit (for backwards compatiblity just in case). Additionally the unit will register the DynLibsManager if it doesn't reside in the System unit anyway.
Currently only the Windows targets (Win32, Win64 and WinCE) implement the DynLibsManager inside the System unit. For other systems using the LoadLibrary, etc. functions will lead to a run error/exception.
If a port wants to implement its own DynLibsManager then it needs to define DISABLE_NO_DYNLIBS_MANAGER. TLibHandle, NilHandle and optionally TOrdinalEntry (it's set to SizeUInt otherwise) should be defined in sysdlh.inc which needs to be enabled using the define FPC_SYSTEM_HAS_SYSDLH (because there are targets which have FEATURE_DYNLIBS enabled, but don't support them... e.g. powerpc-wii -.-).
The DynLibsManager contains methods for loading a library based on a RawByteString and based on a UnicodeString. BOTH should be implemented, but internally one can forward to the other.
The loading by ordinal *can* be be implemented. If it is set to Nil then the implementation of GetProcAddress(lib,ordinal) will return Nil.

+ new functions SetDynLibsManager and GetDynLibsManager to set and retrieve the current DynLibsManager
* provide interface of DynLibs unit in unit System

git-svn-id: trunk@29613 -
2015-02-03 20:00:00 +00:00
marco
6db1f5bfa8 * Delphi compat changes pchar->pansichar. add pppansichar to systemh.inc
git-svn-id: trunk@29375 -
2015-01-03 13:54:59 +00:00
marco
4733e50de5 * system unit additions from mantis #27206. Exports some dynarray related RTTI functions.
git-svn-id: trunk@29364 -
2015-01-01 00:21:40 +00:00
florian
7180d184c5 + implements TExtended80Rec, TDoubleRec, TSingleRec
+ test

git-svn-id: trunk@29084 -
2014-11-16 20:47:33 +00:00
Jonas Maebe
ff583bde6c * made setstring() a compiler intrinsic so it can set the compile-time
code page of ansistrings (mantis #26735)

git-svn-id: trunk@28813 -
2014-10-12 20:27:06 +00:00
florian
714901ce45 * fixes feature defines after recent changes
git-svn-id: trunk@28743 -
2014-10-04 18:12:09 +00:00
nickysn
16c5849fc6 + added HexStr() overload for huge pointers
git-svn-id: trunk@28180 -
2014-07-07 15:13:29 +00:00
sergei
04d8e8a5dc * On 64-bit targets, handle abs(int64) internally, using the same code as for abs(longint), i.e. without branching. Both generic and x86-specific pass 2 code is already suitable for different operand sizes, only type checking needs removal of excessive conversions to 32 bits.
git-svn-id: trunk@27989 -
2014-06-17 18:45:11 +00:00
michael
17e34abc62 * Fix for bug ID #18551
git-svn-id: trunk@27773 -
2014-05-11 17:02:56 +00:00
michael
4258d71a2d * Fixed bug #26053 (NoErrMsg variable for Delphi compatibility)
git-svn-id: trunk@27764 -
2014-05-11 10:15:29 +00:00
nickysn
dfa1f3e0a3 * NativeInt and NativeUInt redefined as aliases to PtrInt/PtrUInt, so now they
become 32-bit in some i8086 memory models. Added comment explaining why they
  were introduced (delphi compatibility) and why they shouldn't be used in the
  FPC RTL.

git-svn-id: trunk@27238 -
2014-03-23 14:06:47 +00:00
nickysn
a176c2d4f5 + add overloaded versions of HexStr(pointer) for i8086 near and far pointers
- rm ifdefs for i8086 far code memory model when doing stack traces. The
  compiler will now choose the correct overload of HexStr according to the
  CodePointer type.

git-svn-id: trunk@27163 -
2014-03-16 17:40:31 +00:00
sergei
baa18dfcb4 * Introduced a new function CaptureBacktrace, using it to handle most of back-tracing in heaptrc unit.
* Use StackTop instead of StackBottom+StackLength in a few remaining locations.

git-svn-id: trunk@27141 -
2014-03-15 05:16:37 +00:00
sergei
3a55c4301e * Since StackTop=StackBottom+StackLength, any two variables are sufficient to describe stack, the third one is redundant.
* As a first part of cleanup, replaced StackTop with function returning StackBottom+StackLength.
* On Win32 and Win64, StackTop returns the stack base from TIB instead.

git-svn-id: trunk@27119 -
2014-03-12 19:48:03 +00:00
florian
7eace968e7 + UNICODESTRINGS feature flag
git-svn-id: trunk@27026 -
2014-03-07 21:25:38 +00:00
nickysn
b3e6248547 * define PNativeInt and PNativeUint as ^NativeInt and ^NativeUint, instead of
PPtrInt/PPtrUint, because on i8086 in the far data memory models the pointer
  size is different than the native int size.

git-svn-id: trunk@26911 -
2014-03-01 13:23:32 +00:00
nickysn
48edf78003 * make BSR/BSF return byte, instead of cardinal on 16/8-bit targets
git-svn-id: trunk@26591 -
2014-01-26 19:56:31 +00:00
pierre
5761e944ba Fix m68k linux rtl compilation
git-svn-id: trunk@26407 -
2014-01-07 13:51:24 +00:00
sergei
4168388235 + SPARC: support 8 and 16-bit arithmetic shifts.
git-svn-id: trunk@26330 -
2013-12-30 23:37:21 +00:00
nickysn
180ddf2ddd + i8086 FPU detection code updated to also identify the FPU type (8087/287/387+)
and initialize the Test8087 global variable.

git-svn-id: trunk@26200 -
2013-12-08 20:50:52 +00:00
nickysn
870d432468 + reenabled the new str<->float conversion code on i8086 after the fix in r26005
git-svn-id: trunk@26013 -
2013-11-10 18:29:17 +00:00
nickysn
7516b87382 * (temporarily) disabled the new str<->float code on the i8086, because it
causes a lot of wrong conversions and thus a lot of testsuite failures.

git-svn-id: trunk@25993 -
2013-11-08 08:22:35 +00:00
Jonas Maebe
21eeec9981 + re-implementation of real->string and string->real conversion routines
based on the Grisu1 algorithm. This corrects several precision issues
    with the previous code used to perform such conversions (patch by
    Max Nazhalov, mantis #25241)
   o adaptation of several tests to deal with the better precision of these
     routines compared to the previous version
  Please don't remove the real2str.inc file yet, it's still used by the
  JVM target for now

git-svn-id: trunk@25888 -
2013-10-31 12:39:27 +00:00
sergei
9ad98a2c4d * Handle "SarInt64" always as internal procedure, introduced virtual method tinlinenode.first_sar that by default converts it into call to "fpc_sarint64" unless target CPU is 64-bit. This provides a point to insert target-specific optimizations.
git-svn-id: trunk@25876 -
2013-10-28 14:31:36 +00:00