Commit Graph

2822 Commits

Author SHA1 Message Date
sergei
dcb46051c4 * Get rid of last softfloat dependencies in genmath.inc. Replaced remaining calls to float_raise with expressions which generate appropriate floating-point exceptions at runtime. This is probably somewhat slower on actual softfloat targets, but the change only affects exceptional control flow, so not a significant issue.
git-svn-id: trunk@27198 -
2014-03-20 11:04:00 +00:00
sergei
fffc317759 * Replaced fpc_round_real with new implementation, having the following important properties:
- it does not directly depend on softfloat stuff.
  - it triggers 'inexact' condition in a way compatible to hardware instructions (second assertion in webtbs/tw3157.pp now works correctly).

git-svn-id: trunk@27197 -
2014-03-20 05:33:33 +00:00
sergei
825900671b * Typo in r27184.
git-svn-id: trunk@27196 -
2014-03-20 04:27:51 +00:00
nickysn
4c8e947f0c * changed the shortstring index variables that were previously longint and were later changed to sizeint (in r26917) to ObjpasInt after r27142
git-svn-id: trunk@27185 -
2014-03-19 15:35:21 +00:00
sergei
fcfed19c84 * Fixed one of the C porting bugs (wonder how many are still left...)
git-svn-id: trunk@27184 -
2014-03-19 15:32:29 +00:00
sergei
13da05a778 * Factored direct access to softfloat_exception_flags into a helper procedure.
git-svn-id: trunk@27179 -
2014-03-18 16:36:47 +00:00
sergei
5f985602fb * Replaced fpc_ln_real with modern port from fdlibm/uclibc, it has even better accuracy than damath library.
git-svn-id: trunk@27172 -
2014-03-17 14:54:27 +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
nickysn
3ec4c378aa + added the ObjpasInt type (an integer type equivalent to Objpas.Integer) to the
system unit implementation part.

git-svn-id: trunk@27142 -
2014-03-15 12:19:04 +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
sergei
5ddb267d57 * Clean up/refactor stack back-tracing code, reducing overall amount of checks and rejecting range from StackBottom to <current frame>.
git-svn-id: trunk@27097 -
2014-03-11 16:29:20 +00:00
sergei
3b5552ae75 - Killed 'goto'.
git-svn-id: trunk@27096 -
2014-03-11 15:16:00 +00:00
sergei
2f05e8b389 * PushExceptObject and dump_stack: use get_caller_stackinfo instead of get_caller_addr and get_caller_frame.
git-svn-id: trunk@27094 -
2014-03-11 12:51:46 +00:00
sergei
54e561dfa4 * Assign CharLengthPCharProc and CodePointLengthProc always in initunicodestringmanager, doing it in initwidestringmanager only complicates things.
git-svn-id: trunk@27086 -
2014-03-10 20:18:30 +00:00
sergei
a7563fd0c8 * Added {$ifdef ver2_6} around stuff which is no longer used but needed for bootstrapping.
git-svn-id: trunk@27038 -
2014-03-08 23:13:10 +00:00
florian
7eace968e7 + UNICODESTRINGS feature flag
git-svn-id: trunk@27026 -
2014-03-07 21:25:38 +00:00
Jeppe Johansen
9b79f2f68d Added support for 8-bit CPU's in RTL. Mostly for missing implementations of int<->string conversion and console/text output.
git-svn-id: trunk@26958 -
2014-03-04 20:00:03 +00:00
nickysn
ad45bc17ec * local variables in fpc_AnsiStr_Concat_multi changed from longint to nativeint
git-svn-id: trunk@26926 -
2014-03-02 19:24:24 +00:00
nickysn
0d1342a791 * don't call FinalizeHeap from InternalExit if FPC_NO_DEFAULT_HEAP is defined.
This reduces i8086-msdos executable sizes by 1.5-1.7k depending on the memory
  model.

git-svn-id: trunk@26919 -
2014-03-02 11:38:11 +00:00
nickysn
65fe978b71 * various shortstring index variables changed from longint to sizeint (generates
more efficient code on i8086)

git-svn-id: trunk@26917 -
2014-03-01 21:44:08 +00:00
nickysn
73e6ffe675 * the TableCount and InitCount fields in the INITFINAL table changed to
nativeint (generates smaller and more efficient code on i8086)

git-svn-id: trunk@26913 -
2014-03-01 14:33:10 +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
640f6ea300 * return nil in SysTinyReallocMem, when the size parameter is 0
git-svn-id: trunk@26892 -
2014-02-26 23:31:50 +00:00
nickysn
858efec84e * handle SysTinyFreeMem(nil) properly (i.e. succeed silently, without writing to
nil pointer memory)

git-svn-id: trunk@26890 -
2014-02-26 22:01:50 +00:00
michael
aac74f4d0a * Patch from Inoussa Ouedraogo to make assigning widechar to variant Delphi 2009+ compatible (Bug ID 25719)
git-svn-id: trunk@26873 -
2014-02-25 08:53:03 +00:00
sergei
04f32c2a01 * Do not attempt to retrieve caller context if initial frame is not between StackTop and frame pointer of current procedure (aka stack bottom). Reverts part of r21843, fixing regression of tests/test/cg/traise6.pp after r26843.
r26843 caused regression because it removed exception handlers, causing condition "if ExceptAddrStack<>nil" in HandleErrorAddrFrame() to become False, so it wasn't raising another exception (which would halt with code 217) but terminating directly with code 216.

git-svn-id: trunk@26850 -
2014-02-23 10:20:54 +00:00
sergei
ae81e0889b * Updated internal declarations of RTTI structures to match their counterparts in typinfo unit and actual data generated by compiler. It went unnoticed this far because fields whose location differ with and without 'packed' record attribute are not used by internal routines, and tests use declarations from typinfo unit (the declarations in question are not in interface, so tests cannot be done against them).
This eliminates a lot of unaligned code on SPARC and ARM. 

git-svn-id: trunk@26845 -
2014-02-22 19:26:25 +00:00
sergei
b26e36431a * Instead of three individual try..except blocks in fpc_pushexceptobject, guard the entire procedure at the caller side (it is called only from fpc_raiseexception). This additionally guards against possible crashes in getmem() due to corrupted heap. Furthermore, try..except block is not necessary at all for such one-time purposes.
git-svn-id: trunk@26843 -
2014-02-22 17:18:21 +00:00
sergei
d004607876 * fpc_raiseexception does not return a result.
git-svn-id: trunk@26837 -
2014-02-22 15:18:31 +00:00
sergei
749ff6b19d * fpc_popobjectstack: clean up.
git-svn-id: trunk@26836 -
2014-02-22 14:44:29 +00:00
florian
f7785be945 * make the dwarf line info reader more fault tolerant, patch by Martin Friebe, resolves #24900
git-svn-id: trunk@26812 -
2014-02-18 20:36:25 +00:00
sergei
a1dfaa54dd * Fixed exception handling in constructors of TP-style objects to correctly handle cases of statically allocated objects (must call destructor but do not free memory) and objects without destructor (must free memory if it was allocated dynamically).
+ Test extended.

git-svn-id: trunk@26676 -
2014-02-05 18:19:13 +00:00
sergei
1626667374 * Object helper routines review/improvement for alignment-sensitive targets:
- Replaced duplicate local declarations of pvmt/tvmt with pobjectvmt/tobjectvmt
    (name change needed because tvmt is already used for class-style VMTs)
  - Removed 'packed' attribute from tobjectvmt, since it is always aligned.
  * Use appropriate typecasts to generate aligned memory accesses where possible.

git-svn-id: trunk@26659 -
2014-02-03 01:18:19 +00:00
nickysn
f4f35ad47b * changed ExceptTryLevel from longint to nativeint (because i8086)
git-svn-id: trunk@26658 -
2014-02-03 00:48:11 +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
sergei
aadb407e31 * Convert int64 to double in more straightforward way.
git-svn-id: trunk@26557 -
2014-01-21 14:33:56 +00:00
sergei
6dd845a183 * Removed TTabCoef type and unused zero members in coefficient arrays (the actual number of coefficients is passed to polevl/p1evl anyways).
* Use sizeint type instead of integer (the latter is 16-bit, resulting in unneeded adjustments on non-x86 targets).

git-svn-id: trunk@26556 -
2014-01-21 14:32:38 +00:00
nickysn
5c8aa6e5b0 * fpc_mul_integer and fpc_mul_longint: fallback directly to the unsigned
multiplication routine in case overflow checking is not used

git-svn-id: trunk@26524 -
2014-01-19 23:06:34 +00:00
Tomas Hajny
1a430d8110 * GetProcAddr added for OS/2, type of argument for ordinal target specific now
git-svn-id: trunk@26521 -
2014-01-19 21:15:26 +00:00
nickysn
34cf432600 * in the generic implementation of fpc_mul_int64, fallback directly to
fpc_mul_qword directly in case overflow checking is not used

git-svn-id: trunk@26483 -
2014-01-17 01:25:41 +00:00
svenbarth
6273192ce1 + Add a new overload to DynLibs to allow loading by Ordinal only. This needs specific operating system support however and will return Nil (using a default implementation) if ordinals are not supported.
+ Implement overload for the three supported Windows targets.

git-svn-id: trunk@26457 -
2014-01-14 15:23:55 +00:00
florian
15df4a4f80 + support iso pascal like program parameters in iso mode
git-svn-id: trunk@26437 -
2014-01-12 20:17:51 +00:00
florian
e841027a48 * fixes handling of typed files in iso mode
git-svn-id: trunk@26436 -
2014-01-12 20:17:48 +00:00
marco
f09374a197 * winsock(and -2), sockets and gpm to rtl-extra.
git-svn-id: trunk@26426 -
2014-01-11 19:45:37 +00:00
paul
932349020c rtl: deprecate winwidestringalloc
git-svn-id: trunk@26421 -
2014-01-11 14:16:49 +00:00
pierre
5761e944ba Fix m68k linux rtl compilation
git-svn-id: trunk@26407 -
2014-01-07 13:51:24 +00:00
marco
dea2c743d5 * Initial active version of
rtl-extra : objects matrix ucomplex
   rtl-objpas: convutil(s) dateutil(s) stdconvs variants varutils
   

git-svn-id: trunk@26398 -
2014-01-05 19:20:15 +00:00
nickysn
c2ba9ebfe5 + added different mul helpers for the 32 to 64-bit muls, since they can usually
be implemented more efficiently than the 64 to 64-bit ones.

git-svn-id: trunk@26386 -
2014-01-05 03:01:18 +00:00
paul
7b1f586131 rtl: remove unneeded charset classes
git-svn-id: trunk@26375 -
2014-01-04 08:59:20 +00:00