Commit Graph

425 Commits

Author SHA1 Message Date
florian
1da4c0c3ce * SinCos overloads added, resolves #22663
git-svn-id: trunk@22139 -
2012-08-19 22:09:03 +00:00
florian
a5754ed02b * more robust get_caller_frame and get_caller_addr for win32 which has always a valid StackTop value
git-svn-id: trunk@21919 -
2012-07-15 21:36:06 +00:00
pierre
f340ef87e3 * get_addr function renamed to get_pc_addr
+ get_caller_stackinfo procedure added.

git-svn-id: trunk@21707 -
2012-06-25 22:17:49 +00:00
pierre
8469741700 + Added additional addr pointer parameter to
get_caller_frame, get_caller_addr and dump_stack
  with default NIL value to systemh.inc.
  + Added new get_addr function.
  system.inc: Use get_addr and get_frame to call
  HandleErrorAddrFrame instead of HandleErrorFrame
  in several error functions.
  Modify dump_stack to use frame and addr parameters.
  Provide a dummy get_addr function returning nil.
  i386/i386.inc, x86_64./x86_64.inc: Provide real
  implementation of get_addr function.

git-svn-id: trunk@21697 -
2012-06-24 21:22:09 +00:00
sergei
6874aa9676 * Replaced i386 assembler IndexByte by more sophisticated implementation, larger in size but faster by factor from 2 (on Athlon X2 L310) to 5 (on Core2Duo E7200) for 512 byte buffers.
git-svn-id: trunk@20188 -
2012-01-28 17:54:36 +00:00
sergei
b9b960ebcf * fpc_pchar_length: fixed exit without restoring EDI register if argument is nil, bug #21135.
git-svn-id: trunk@20156 -
2012-01-22 23:52:46 +00:00
sergei
06192a8137 Values of managed variables are never ever used after decrementing reference on the variable, so there is no point of having a 'decrement reference' as a separate operation. We can always do 'finalize', i.e. clear the contents after decref.
* Modified fpc_ansistr_decr_ref and fpc_widestr_decr_ref so they always zero the pointer passed by reference. Other _decr_ref helpers already do it.
- Removed tcg.g_decrrefcount, calling cg.g_finalize instead.
- finalize_data_node and tcg.g_finalize: removed code generation for zeroing locations, because it is now done by RTL helpers. This further reduces code size.

As a total result of this change and r20118, the size of Lazarus executable is reduced by about 12%.

git-svn-id: trunk@20119 -
2012-01-19 23:11:09 +00:00
sergei
009ee271ec - Cleaned out STR_CONCAT_PROCS define
- i386-specific fpc_shortstr_append_shortstr removed too, because a) it was anyway disabled with STR_CONCAT_PROCS, b) the generic implementation is smaller and probably faster due to optimized Move().

git-svn-id: trunk@19867 -
2011-12-17 17:22:18 +00:00
sergei
724f41a9af - Cleaned out FPC_STRTOSHORTSTRPROC and FPC_STRTOCHARARRAYPROC defines. Somebody had to do it one day.
git-svn-id: trunk@19851 -
2011-12-14 22:40:08 +00:00
Jonas Maebe
c7b83717cb - removed stray "overload" modifiers in the implementation for strcopy and
strlcopy (only existed for generic and i386 versions)

git-svn-id: trunk@19488 -
2011-10-15 11:40:16 +00:00
sergei
b36a930f26 - Cleaned out REGCALL defines
git-svn-id: trunk@19482 -
2011-10-13 17:02:23 +00:00
florian
77c3477b91 * modified patch by LacaK2 to add overloaded versions of string handling routines, which works with WideChar null terminated strings, resolves #19989
git-svn-id: trunk@19337 -
2011-10-03 16:11:46 +00:00
paul
27538f21a4 merge r13489 from cpstrnew branch by florian:
* made tcpstr1 work

git-svn-id: trunk@19086 -
2011-09-17 11:21:00 +00:00
florian
88c2c77319 + is_sse3_cpu, put into cpu unit, so x86-64 and i386 can share source code
git-svn-id: trunk@18785 -
2011-08-20 12:01:48 +00:00
sergei
4ebc34c5e7 * Promoted result type of FPC_PCHAR_LENGTH and FPC_PWIDECHAR_LENGTH to SizeInt.
+ Check for nil pointer in FPC_PWIDECHAR_LENGTH

git-svn-id: trunk@17733 -
2011-06-13 04:59:17 +00:00
Jonas Maebe
abd6d1800e * fixed Darwin i386 compilation with 2.4.x after r17669 (the 2.4.x Darwin
compiler itself also generates a fpc_geteipasebx symbol), mantis #19523

git-svn-id: trunk@17700 -
2011-06-08 22:12:15 +00:00
florian
449c20ce63 * moved pic helpers into system unit, resolves #8119
git-svn-id: trunk@17669 -
2011-06-05 21:16:11 +00:00
florian
cd8913b88e * improved Compare(D)Word as well
git-svn-id: trunk@17651 -
2011-06-03 20:35:55 +00:00
florian
ceb739fbf5 * improved fillchar for small amounts of data
git-svn-id: trunk@17644 -
2011-06-02 20:54:29 +00:00
florian
b6aa04813e * improved comparebyte for small data amounts
git-svn-id: trunk@17642 -
2011-06-02 20:02:26 +00:00
Jonas Maebe
c14574bb56 * don't change the fpu control word in the initialisation code of dynamic
libraries (mantis #16263, #16801)

git-svn-id: trunk@16347 -
2010-11-14 16:00:25 +00:00
florian
5dae691c96 * implementation of bit scan intrinsics by Richard Vida, resolves #17592
git-svn-id: trunk@16174 -
2010-10-16 15:03:30 +00:00
florian
7dc4b6ecc1 + adds mcount calls to syscall assembler helpers for i386 and x86-64, resolves #17140
git-svn-id: trunk@15812 -
2010-08-15 09:11:06 +00:00
florian
24fea58b92 + initial implementation of iso style gotos in iso mode
* made setjmp/longjmp accessible to the compiler by compiler proc, they are used by the iso goto code

git-svn-id: trunk@15711 -
2010-08-05 19:20:46 +00:00
Jonas Maebe
9273856e84 * disallow pusha*/popa* for x86_64 (mantis #14862)
* disallow pushfd/popfd for x86_64 (mantis #14862)
  * fixed assembling popfq with the internal assembler (it needs a rex.w
    prefisx, while pushfq doesn't)
  * changed the default opcode size of pushf/popf/pusha/popa in
    {$asmmode intel} from "native size" to 16 bit (compatible with Intel
    manuals and Kylix; in AT&T mode, the default size for those operations
    remains the native one)
  * changed pushf/popf in rtl/i386/* into pushfd/popfd because of the
    previous change

git-svn-id: trunk@15546 -
2010-07-10 16:22:46 +00:00
florian
31e2f16484 resolves #15453:
* fixes i386 DivMod with negative numbers with a patch from Jonas
* fixes generic DivMod with negative numbers
* test updated

git-svn-id: trunk@14532 -
2010-01-03 14:59:01 +00:00
Jonas Maebe
92ff07deaf * several fixes by Pierre Pede (parts of his patch to mantis #12492)
o fixed gprof under linux/i386
    o fixed pic-compilation of the linux/i386 rtl
    o initialisation of linux shared libraries is now possible with pic-code

git-svn-id: trunk@13703 -
2009-09-12 21:57:41 +00:00
Jonas Maebe
c2c68ddb8f - removed FPC_NEW_BIGENDIAN_SETS define and if(n)defs
* left old cpu-specific set helper code under ifdef FPC_OLD_BIGENDIAN_SETS
    in case someone wants to write new assembler set helpers (although most
    of them should be optimally generated by the compiler already if
    http://wiki.freepascal.org/FPC_HowToDo#Bit.28field.29_getting.2Fsetting_primitives
    are optimally implemented)

git-svn-id: trunk@13582 -
2009-08-23 08:16:40 +00:00
florian
a14db25c64 + procedure DivMod(Dividend: Integer; Divisor: integer; var Result, Remainder: integer); and procedure DivMod(Dividend: cardinal; Divisor: cardinal; var Result, Remainder: cardinal);, resolves #14286
+ assembler implementations of DivMod for i386

git-svn-id: trunk@13508 -
2009-08-09 20:47:06 +00:00
Jonas Maebe
0597c300f4 * applied feature dependencies patch by Sven Barth from mantis #13673 :
o i386/i386.inc used a function (fpc_truely_ansistr_unique) is now
     only included if FPC_HAS_FEATURE_ANSISTRINGS is enabled (all other
     platforms use the Pascal-only implementations)
   o inc/heap.inc relied on threading
   o inc/threads.inc relied on exceptions, consoleio and stackcheck
   o inc/system.inc: just a feature-related "variable not used"-hint

git-svn-id: trunk@13121 -
2009-05-09 20:08:57 +00:00
Jonas Maebe
22aacd2a60 * return 0 for length(pchar(0)), like Kylix does (using corrected and
multi-platform version of patch in r12461, which caused the i386 version
    of fpc_pchar_length to return 0 in all cases, which used tabs, and did
    not include a test case)

git-svn-id: trunk@12464 -
2009-01-01 22:02:17 +00:00
ivost
8046f82416 * Undoing change commited in r12461, it looks like a feature and not a bug ;)
git-svn-id: trunk@12463 -
2009-01-01 21:45:42 +00:00
ivost
fe3263eb08 * i386 version of fpc_pchar_length did not accept NIL strings, maybe we have to check other implementations also
git-svn-id: trunk@12461 -
2009-01-01 21:18:49 +00:00
florian
558cf3ef87 * reset FPU properly after an exception, resolves #12214
git-svn-id: trunk@11820 -
2008-09-25 19:15:54 +00:00
florian
20e632c8d8 * reorganized ror/rol defines
git-svn-id: trunk@11472 -
2008-07-28 13:03:18 +00:00
florian
1afb1aa9cc + ror/rol functions
+ internal compiler support for ror/rol on i386

git-svn-id: trunk@11466 -
2008-07-27 17:12:32 +00:00
Jonas Maebe
f00beea41c * fixed i386/linux rtl compilation and functionality when compiled
without regcall

git-svn-id: trunk@11024 -
2008-05-21 15:20:13 +00:00
yury
5dc6e54925 * Removed inline for procedures with assembler or formal parameters, since inline is not supported for them (compiler warns about that now). Even if there is no inline modifier in interface declaration of procedure, it is possible to specify inline in procedure implementation if needed (e.g. for generic implementations) and inlining will work for them.
git-svn-id: trunk@10629 -
2008-04-12 11:37:49 +00:00
Jonas Maebe
c35e0bf712 - removed fclex at the end of fpc_exp_real because it makes that routine 10+
times slower on P4/Athlon XP cpus, and removing it does not cause any test
    suite regressions

git-svn-id: trunk@10284 -
2008-02-10 21:49:52 +00:00
daniel
0d78460e2e * Disable int_str again.
git-svn-id: trunk@9816 -
2008-01-20 14:47:48 +00:00
peter
2a479654f1 * remove asm for simple math functions so the generic inlined function is
taken. This generates smaller optimized code

git-svn-id: trunk@9796 -
2008-01-19 20:23:27 +00:00
daniel
624bb8e7e1 * Add win32 workaround suggested by Peter.
git-svn-id: trunk@9795 -
2008-01-19 19:32:03 +00:00
peter
f70219cdd8 * add align directives to int_str
git-svn-id: trunk@9793 -
2008-01-19 16:32:39 +00:00
daniel
d12e107800 * Use fpc_geteipasebx.
git-svn-id: trunk@9792 -
2008-01-19 15:24:36 +00:00
daniel
220565fb94 * Remove unused lea from skip loop.
git-svn-id: trunk@9789 -
2008-01-19 08:33:48 +00:00
Jonas Maebe
8c45c66e13 * removed accidentally committed global disable of assembler int_str
* fixed compilation of int_str on darwin/pic
  * disabled int_str for darwin because it crashes

git-svn-id: trunk@9785 -
2008-01-18 23:09:37 +00:00
Jonas Maebe
95c991872b + added exeinfo to implicit units so make install works again
git-svn-id: trunk@9784 -
2008-01-18 23:03:38 +00:00
daniel
b8fdbb1055 * Some final tweaks to asm int_str.
git-svn-id: trunk@9782 -
2008-01-18 22:21:49 +00:00
daniel
f94d457429 * Add Darwin PIC support to assembler int_str again.
* Make it respect the open string boundary
  * Activate it again

git-svn-id: trunk@9781 -
2008-01-18 22:12:16 +00:00
daniel
2ce992b4ae - Disable asm str_int again now that testsuites have run.
git-svn-id: trunk@9665 -
2008-01-07 07:45:58 +00:00