Commit Graph

110 Commits

Author SHA1 Message Date
florian
9a7a015109 * properly handle result size for avx/sse based frac function, resolves #38248
git-svn-id: trunk@47839 -
(cherry picked from commit b28aa5c684)
2021-08-24 23:26:25 +02:00
florian
f6dee4c3e0 * process fma intrinsic parameters in an order which takes care of multiple x87 stack parameters, resolves #38295
(cherry picked from commit 9592c033e5)

# Conflicts:
#	.gitattributes
2021-08-24 00:14:05 +02:00
florian
055283f9cb * set register size correctly for popcnt(<byte>), resolves #37400
(cherry picked from commit ed158f1e52)

# Conflicts:
#	.gitattributes
2021-08-21 16:36:43 +02: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
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
6cd88a24dc * release al/ax/eax immediately after the 'in', before (instead of after) moving
it to the destination imaginary register. This generates better code.

git-svn-id: trunk@39380 -
2018-07-04 13:09:47 +00:00
nickysn
f34710faa0 + use the in and out instructions with immediate constant port number for ports
that are evaluated as a compile-time constant in the range 0..255

git-svn-id: trunk@39365 -
2018-07-03 20:15:20 +00:00
nickysn
fdc896ad0a + inline support for the x86 'in' and 'out' instructions. Currently only enabled
in the i8086-msdos 'ports' unit, but will be enabled on other targets (e.g.
  go32v2) in the future as well. 32-bit 'in' and 'out' not inlined on i8086, but
  will be on i386 and x86_64.

git-svn-id: trunk@39362 -
2018-07-03 17:01:42 +00:00
Jonas Maebe
4686f61002 * keep track of the temp position separately from the offset in references,
so that they can still be freed after the reference has been changed
    (e.g. in case of array indexing or record field accesses) (mantis #33628)

git-svn-id: trunk@38814 -
2018-04-22 17:03:16 +00:00
florian
98bd768521 * remove type cast of the parameter of int(...), if an instruction is available which can be used directly
git-svn-id: trunk@38335 -
2018-02-24 23:13:27 +00:00
nickysn
16d7eefbca + adapted and enabled the x86 specific abs() code generation for i8086, because
it generates slightly better code, than the generic implementation

git-svn-id: trunk@37161 -
2017-09-10 12:12:34 +00:00
florian
358bfb4858 * SSE4.1+ implementation of int(...)
git-svn-id: trunk@36285 -
2017-05-21 15:28:34 +00:00
florian
12dec14859 * try to break dependency chains when generating vsqrt instructions
git-svn-id: trunk@36282 -
2017-05-21 11:35:33 +00:00
florian
8eec29b139 + enable support for a processor specific frac function
* implemented inlined frac support for CPUs with SSE4.1+

git-svn-id: trunk@36281 -
2017-05-21 11:12:59 +00:00
nickysn
efc5e339d0 * use an enum instead of integer constants to represent inline numbers
* compinnr.inc include file converted to a unit
* inline number field size stored in ppu increased from byte to longint
* inlines in the parse tree (when written with the -vp option) now printed with
  their enum name, instead of number

git-svn-id: trunk@36174 -
2017-05-10 14:41:43 +00:00
florian
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +00:00
Jonas Maebe
a25ebbba3e + added volatility information to all memory references
o separate information for reading and writing, because e.g. in a
     try-block, only the writes to local variables and parameters are
     volatile (they have to be committed immediately in case the next
     instruction causes an exception)
   o for now, only references to absolute memory addresses are marked
     as volatile
   o the volatily information is (should be) properly maintained throughout
     all code generators for all archictures with this patch
   o no optimizers or other compiler infrastructure uses the volatility
     information yet
   o this functionality is not (yet) exposed at the language level, it
     is only for internal code generator use right now

git-svn-id: trunk@34996 -
2016-11-27 18:17:37 +00:00
pierre
1e9491550d nutils.pas: Add new procedure:
procedure node_change_local_switch(p : tnode;cs : tlocalswitch;enable : boolean);
    to add/remove cs local switch from all p tnode tree localsettings.

    modify second_prefetch implementation in arm, ppcgen and x86 subdirectories
    to use node_change_local_settings to temporarily disabled
    checkpointer local switch, as prefetch is allowed even on unaccessible addresses.
    (previous code was buggy because I frogot that each node has it own localswitches).

git-svn-id: trunk@34576 -
2016-09-29 21:34:34 +00:00
pierre
fe4e2956c6 Disable checkpointer call when handling left of prefetch node
git-svn-id: trunk@34559 -
2016-09-24 07:34:10 +00:00
florian
e5f63779bb * pass S_NO instead of S_XMM to *SQRTSS/SD as size as the memory location is 32/64 bit
git-svn-id: trunk@34540 -
2016-09-18 20:05:25 +00:00
Jonas Maebe
aa1be3276f - removed default value of _typ parameter of TAsmData.(Weak)RefAsmSymbol():
it was AT_NONE, which is invalid and should never be used
  * explicitly pass the correct value for all calls to those methods elsewhere
    in the compiler

git-svn-id: trunk@34250 -
2016-08-05 07:09:16 +00:00
florian
e4baf67722 * do not write any size suffix for cvt*ss2si, doing so makes no sense as the size of the single and the integer might be different on x86-64, resolves issue #30101
git-svn-id: trunk@33661 -
2016-05-08 18:50:53 +00:00
florian
0232a0d979 * several inlined math function do not need a non-constant register for the argument
git-svn-id: trunk@33649 -
2016-05-04 18:15:33 +00:00
Jonas Maebe
da696057ab * converted register_maybe_adjust_setbase() to the high level code generator
git-svn-id: trunk@32591 -
2015-12-05 18:03:37 +00:00
yury
e04a3b4ac6 * Removed unused vars for x86 compiler.
git-svn-id: trunk@31743 -
2015-09-17 15:20:15 +00:00
Jonas Maebe
1bcc276dcf * remove implicit typecast to extended automatically inserted for trunc/round
(due to the declaration in the system unit) on x86_64 if this allows us
    to use SSE code instead (mantis #28366)

git-svn-id: trunk@31192 -
2015-07-03 21:01:18 +00:00
Jonas Maebe
9079227c56 * don't give an internalerror when trying to prefetch a regvar or even
something without a location at all; it's a hint/optional operation,
    so if there's nothing to prefetch just don't do anything
    (mantis #27811)

git-svn-id: trunk@30502 -
2015-04-08 20:35:13 +00:00
florian
de17e9fa1c + cpu capability CPUX86_HAS_CMOV
git-svn-id: trunk@29776 -
2015-02-21 20:47:40 +00:00
florian
8207e0ef22 + make use of vfnmsub*/vfmsub*/vfnmadd* instructions if possible
git-svn-id: trunk@27721 -
2014-05-02 21:07:46 +00:00
florian
33602db802 * try to registers more cleverly during fma code generation
git-svn-id: trunk@27671 -
2014-04-26 18:11:13 +00:00
florian
18233f2c0c * fix compilation of i8086 compiler
git-svn-id: trunk@27566 -
2014-04-13 19:28:59 +00:00
florian
d88d644925 + support for FMA intrinsic: if there is no hardware support, the compiler throws an error.
Currently it is implemented only for x86-CPUs supporting the FMA extension. While it would
  be possible to implement it in software or simulate fma(<single>,<single>,<single>) using
  double operations, it makes no sense in my opinion to do so.

git-svn-id: trunk@27564 -
2014-04-13 19:21:54 +00:00
Jonas Maebe
d452686c39 * moved pbestrealtype from symdef to symcpu
git-svn-id: trunk@27441 -
2014-04-01 21:41:37 +00:00
Jonas Maebe
6b16c05a98 * fixed compilation for i8086 with 2.6.x (it gave an unreachable code
warning)

git-svn-id: trunk@27358 -
2014-03-29 22:31:43 +00:00
sergei
e4819e863b + Consider target_info.cprefix in symbol names.
git-svn-id: trunk@27315 -
2014-03-28 09:07:58 +00:00
Jonas Maebe
4065483a50 * completed thlcgobj.location_force_fpureg(), use it everywhere and removed
ncgutil/thlcg2ll.location_force_fpureg()

git-svn-id: trunk@27071 -
2014-03-10 09:01:05 +00:00
florian
c00d752813 + create avx code in abs as well
* improved abs code generation with sse(2)

git-svn-id: trunk@26838 -
2014-02-22 15:35:14 +00:00
florian
1882ab8d5a * i8086 has no cpu_capabilites
git-svn-id: trunk@26791 -
2014-02-16 08:27:29 +00:00
florian
84f7f5f934 * popcnt has a separate cpuid flag so we should separate it from sse
git-svn-id: trunk@26789 -
2014-02-16 08:27:24 +00:00
nickysn
a7b4953795 + proper (i.e. not broken) implementation of arctan() for the 8087 and 80287
git-svn-id: trunk@26226 -
2013-12-12 23:46:51 +00:00
nickysn
09a3fc74e3 * use the fwait prefixed FSTCW, followed by FWAIT, instead of FNSTCW in
tx86inlinenode.second_trunc_real, when generating code for the 8087

git-svn-id: trunk@26186 -
2013-12-05 23:33:33 +00:00
sergei
bca2c464da * Don't generate x87 instructions for sin and cos on win64, somehow managed to not commit this part in r25995. Mantis #17273.
git-svn-id: trunk@26094 -
2013-11-15 10:37:59 +00:00
sergei
2b1e5f7014 * Mantis #17273: don't generate x87 instructions on win64 target.
git-svn-id: trunk@25995 -
2013-11-08 13:31:07 +00:00
sergei
486a7ef81e * tx86inlinenode.second_popcnt: use emit_ref_reg instead of appending instruction directly, this provides proper PIC handling of the reference. emit_reg_reg part is not strictly necessary, but done for consistency.
git-svn-id: trunk@25878 -
2013-10-28 16:40:42 +00:00
florian
fc72490166 * handle LOC_*FPUREGISTER correctly when using sse2 sqr, resolve #26408
git-svn-id: trunk@24909 -
2013-06-16 18:48:08 +00:00
florian
e81d2d1f3b * basic avx support for floating point operations (use -Cfavx to activate)
git-svn-id: trunk@24896 -
2013-06-14 20:03:01 +00:00
Jonas Maebe
2dd75e707e * renamed thlcgobj.tcgsize2orddef to defutil.cgsize_orddef
git-svn-id: trunk@24743 -
2013-06-01 18:28:15 +00:00
Jonas Maebe
5051453806 + support for LOC_(C)MMREGISTER in hlcg
o migrated location_force_mmregister_scalar from ncgutil to hlcgobj

git-svn-id: trunk@24661 -
2013-05-31 12:05:14 +00:00
nickysn
2b583bb265 * do not use fsin and fcos on 286-, since they're 387+
git-svn-id: trunk@24596 -
2013-05-25 15:24:53 +00:00
nickysn
09249b31b8 * use the generic implementation of second_IncludeExclude in case the cpu is earlier than 386, since then it does not support BTR and BTS
git-svn-id: trunk@24593 -
2013-05-25 14:18:55 +00:00