Commit Graph

480 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
nickysn
9272bf59b2 + added x86 (i8086, i386 and x86_64) intrinsics fpc_x86_get_cs/ss/ds/es/fs/gs
for getting the value of x86 segment registers

git-svn-id: trunk@39433 -
2018-07-11 14:19:40 +00:00
nickysn
8e6205aca6 * changed the visibility of the writeport and readport methods in the ports unit
objects to private (since they should be accessed only through the default
  indexed property)

git-svn-id: trunk@39421 -
2018-07-09 14:55:20 +00:00
nickysn
3673f03841 * set the stdcall calling convention explicitly for each method, that requires
it, instead of using {$calling stdcall} in the go32v2 ports unit

git-svn-id: trunk@39402 -
2018-07-06 15:59:26 +00:00
nickysn
0ea3570b96 * moved the interface and implementation parts of the go32v2 ports unit to
include files portsh.inc and ports.inc in the i386 rtl directory

git-svn-id: trunk@39397 -
2018-07-06 15:52:18 +00:00
nickysn
ff2fff365f + added x86 compiler intrinsics fpc_x86_sti and fpc_x86_cli, which generate the
'sti' and 'cli' instructions

git-svn-id: trunk@39388 -
2018-07-04 16:48:34 +00:00
nickysn
a1bf5e2f07 + also added the fpc_x86_*port* intrinsics to the i386 system unit
git-svn-id: trunk@39369 -
2018-07-03 22:42:03 +00:00
nickysn
26a3ac3fd4 * moved the fpc_in_x86_*port* constants to the system unit in cpuinnr.inc in the
i8086, i386 and x86_64 rtl directories. This is done for consistency with
  other compiler internal function numbers (which are declared in innr.inc).

git-svn-id: trunk@39367 -
2018-07-03 21:30:43 +00:00
nickysn
39dc58de09 - removed one asm instruction from i386's StrEnd() implementation
git-svn-id: trunk@37615 -
2017-11-23 16:43:51 +00:00
nickysn
3d108d5e51 + enabled the i386 asm optimized strcomp (was previously disabled due to wrong ifndef)
git-svn-id: trunk@37614 -
2017-11-23 16:16:05 +00:00
florian
ff86c80176 * cpu specific header file for the system unit: cpuh.inc, moved several declarations into it
git-svn-id: trunk@37542 -
2017-11-01 16:33:30 +00:00
pierre
efafecbf9f Also use .byte version of emms instruction
git-svn-id: trunk@37011 -
2017-08-21 13:47:47 +00:00
pierre
239b623027 Fix typo in last commit
git-svn-id: trunk@37010 -
2017-08-21 13:37:54 +00:00
pierre
d1e091d5a3 Use .byte substitutes for ldmxcsr and stmxcsr instructions
if OLD_ASSEMBLER macro is defined.

  Do not use PIC code for fpc_exp_real if OLD_ASSEMBLER is defined
  (this generates unsupported relocations for GNU assembler 2.6 used by EMX)

git-svn-id: trunk@37009 -
2017-08-21 13:29:29 +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
pierre
f4ecf87a50 Add conditional FASTMOVE_DISABLE_SSE3 to be able to discard SSE specific code, needed for Watcom Assembler support
git-svn-id: trunk@36848 -
2017-08-04 20:51:58 +00:00
florian
7213a13081 * split fpc_mul_<64 bit> into separate procedures with and without overflow checking
git-svn-id: trunk@35454 -
2017-02-19 19:15:14 +00:00
Károly Balogh
0e54f616b5 merged i386 int64 mod helper fix by Max Nazhalov (Mantis 30240)
git-svn-id: trunk@34059 -
2016-07-03 21:20:07 +00:00
svenbarth
535621faaa Rename FPC_HAS_INDIRECT_MAIN_INFORMATION to FPC_HAS_INDIRECT_ENTRY_INFORMATION which is more logical considering the record's name
git-svn-id: trunk@33950 -
2016-06-11 20:38:22 +00:00
Károly Balogh
963c4aa1f8 * fixed the sign handling of i386 fpc_div_int64 helper (Mantis 30166)
git-svn-id: trunk@33753 -
2016-05-22 16:57:30 +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
17256e8387 * fpc_exp_real: replaced pushing immediate values on stack with Darwin-style PIC. This change increases performance on Intel E7200 almost twice. On AMD CPUs performance increase is not that large, but still noticeable.
git-svn-id: trunk@33131 -
2016-02-28 16:03:02 +00:00
florian
77cf67b59a o unified interface of i386 and x86-64 cpu unit:
+ InterlockedCompareExchange128Support for i386 always returning false
  + AESSupport for i386
  + dummy InterlockedCompareExchange128 for i386 throwing an rte 217

git-svn-id: trunk@32857 -
2016-01-05 15:23:26 +00:00
Jonas Maebe
12030f904a - removed FPC_HAS_VALGRINDBOOL-related checks, FPC 2.6.4 has it
git-svn-id: trunk@31691 -
2015-09-15 11:51:45 +00:00
nickysn
d39bfec4d2 + added missing i386 system unit includes fastmove.inc and int64p.inc to makefile.cpu
git-svn-id: trunk@30131 -
2015-03-07 22:35:23 +00:00
Károly Balogh
88b58c3580 i386: added signed 64bit div/mod helpers in assembly. we have some 64bit heavy code where a direct helper results in about 8-10% of performance advantage compared to going through the generic wrapper + the unsigned function
git-svn-id: trunk@28261 -
2014-07-24 21:06:23 +00:00
sergei
a8bc2085e8 - Delete strpas.inc files, no longer used, their contents has been merged into corresponding $(CPU).inc.
git-svn-id: trunk@27833 -
2014-05-31 00:49:40 +00:00
sergei
fc5f45f65c * sqr(real) and sqrt(real): remove typeconv node inserted by initial call processing (see explanation in comments), allowing these functions to be evaluated using precision of argument. In particular, sqrt(single) and sqrt(double) now emit 'sqrtss' and 'sqrtsd' instructions on x86 targets with -Cfsse3. Non-x86 targets already have the necessary support in code generators.
* abs(real): handle the same way as sqrt and sqr, i.e. without casting to bestreal and back.

git-svn-id: trunk@27808 -
2014-05-21 14:53:47 +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
6810d643c4 * Fixed exp() result for +-Inf input, must be +Inf or 0, not NaN. This is mathematically correct and consistent with generic implementation of this function.
git-svn-id: trunk@27553 -
2014-04-12 21:18:57 +00:00
sergei
57c762c8d2 + Inserted license header for AMath routines.
git-svn-id: trunk@27552 -
2014-04-12 20:45:44 +00:00
sergei
bd58adfcc9 + Added credits for functions reused from AMath/DAMath libraries.
git-svn-id: trunk@27518 -
2014-04-10 20:29:49 +00:00
sergei
217bac7a0b - Removed fpc_pi_real compilerproc, it is no longer used. At least two releases (2.6.2 and 2.6.4) emit Pi directly as a constant.
git-svn-id: trunk@27500 -
2014-04-07 09:16:24 +00:00
sergei
2981f73aaa - Removed redundant functions "power", they were neither used nor accessible through interface. The actual function "power" is located in Math unit.
git-svn-id: trunk@27499 -
2014-04-07 09:04:13 +00:00
sergei
d251c131a5 * i386: replaced fpc_exp_real with a port from AMath library. It has better accuracy and is faster on CPUs that suffer penalties from changing x87 control word.
git-svn-id: trunk@27367 -
2014-03-30 09:41:06 +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
florian
5d57f38619 + functions for FMA and AVX2 detection
git-svn-id: trunk@27202 -
2014-03-20 15:47:51 +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
0255eb880e - Removed mathuh.inc files which are identical for all targets (except m68k, see below), their contents moved into math.pp.
+ m68k/mathu.inc: added stub implementations for missing functions.

git-svn-id: trunk@27180 -
2014-03-18 20:01:15 +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
sergei
78e726b34f * i386: Somewhat optimized fpc_mul_qword routine, got rid from variable 'r', registers esi and edi. Also ignore overflow checking when both operands have their high dwords equal to zero, because in such case multiplication cannot overflow.
git-svn-id: trunk@26511 -
2014-01-18 19:28:00 +00:00
nickysn
4eb9043ac7 * x87 optimized version of math.log2() for i8086, i386 and x86_64
git-svn-id: trunk@26266 -
2013-12-22 23:21:41 +00:00
sergei
74f9d719f1 * i386-win32 setjmp and longjmp: if SEH support is enabled, save/restore head of exception registration chain. Without this, a longjmp out of a function with exception frame(s) will leave these exception frames below ESP, which will fail integrity checks in OS and cause process termination if an exception occurs later on (or they may be overwritten by subsequent operations on stack and, again, cause undesired results).
* Additionally, use a branchless sequence to fix up result of longjmp.

git-svn-id: trunk@26238 -
2013-12-16 10:12:36 +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
nickysn
e4b05477e1 * put the cld instructions behind {$ifdef FPC_ENABLED_CLD} in i386/strings*.inc
* strupper and strlower were missing a cld, so it was added to them as well.

git-svn-id: trunk@25591 -
2013-09-28 12:06:47 +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