Commit Graph

257 Commits

Author SHA1 Message Date
florian
62f890efa3 * improved floating point signal handling on x86/linux
git-svn-id: branches/debug_eh@41451 -
2019-02-24 20:03:02 +00:00
pierre
239b623027 Fix typo in last commit
git-svn-id: trunk@37010 -
2017-08-21 13:37:54 +00:00
pierre
df7946a9cc * Do not use fastmove.inc if OLD_ASSEMBLER is defined,
as older assembler do not support 64-bit instructions use in there.
    * Use .byte substitutes for ldmxcsr and movaps instructions

git-svn-id: trunk@37008 -
2017-08-21 13:26:44 +00:00
pierre
82aa8c4d2f Use REPE prefix instead of REP before CMPS{B,W,L} instruction (wasm generates an error for REP)
git-svn-id: trunk@36854 -
2017-08-05 19:50:18 +00:00
florian
9b1e6e1976 - removed i386 specific fpc_pchar_length implementation as it is much slower than the generic one which takes advantage of IndexByte
git-svn-id: trunk@33491 -
2016-04-12 18:13:24 +00:00
sergei
b16c6f8ced * i386 and x86_64 changes for Delphi compatibility:
* 'mxcsr' variable made public and renamed to DefaultMXCSR.
  * GetSSECSR and SetSSECSR renamed to GetMXCSR and SetMXCSR, respectively. Previous names continue to exist as deprecated aliases.

git-svn-id: trunk@27656 -
2014-04-25 15:10:12 +00:00
sergei
d1348d3f9b - i386 and x86_64: Once softfloat stuff has been cleaned up, SysResetFPU and SysInitFPU end up doing exactly the same. Removed one of them.
git-svn-id: trunk@27280 -
2014-03-25 10:52:07 +00:00
sergei
8ad5e6fb26 - RTL: cleaned out FPC_FREEMEM_X. We now have a dedicated compilerproc 'fpc_freemem' for this purpose.
git-svn-id: trunk@27232 -
2014-03-23 02:11:38 +00:00
sergei
4952754184 - i386 and x86_64 no longer use any softfloat stuff.
git-svn-id: trunk@27182 -
2014-03-19 12:14:44 +00:00
sergei
6baba5065c * i386: Perform all CPU-related initialization in fpc_cpucodeinit, instead of having it scattered between fpc_cpuinit,fpc_cpucodeinit and check_sse_support. Simplifies things quite a bit.
- check_sse_support and mmx_support are no longer needed, removed.

git-svn-id: trunk@27169 -
2014-03-16 22:20:39 +00:00
sergei
a9b0a92873 * cpuid_support: translated to ATT syntax and optimized a bit.
git-svn-id: trunk@27168 -
2014-03-16 22:05:04 +00:00
nickysn
4b3bf874df * Added CLDs in the RTL i386 inline asm routines, wrapped in {$ifdef
FPC_ENABLED_CLD}.

git-svn-id: trunk@25606 -
2013-09-29 10:53:49 +00:00
florian
bb397e2b2f + has_sse2_support for i386
+ has_sse3_support for i386

git-svn-id: trunk@25287 -
2013-08-18 18:54:56 +00:00
sergei
30a6432a17 + Assembler implementation of SarInt64 for i386.
git-svn-id: trunk@25037 -
2013-07-04 09:43:30 +00:00
florian
8818b58e5d * Bsf/Bsr on x86 handle now correctly 0 as argument, resolves #22783
* generic Bsf implementations handle now correctly 0 as argument
* test extended

git-svn-id: trunk@22327 -
2012-09-05 13:51:45 +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
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
sergei
b36a930f26 - Cleaned out REGCALL defines
git-svn-id: trunk@19482 -
2011-10-13 17:02:23 +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
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
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
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
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
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