Commit Graph

102 Commits

Author SHA1 Message Date
J. Gareth "Curious Kit" Moreton
6f24c8b4ef * x86: Code generation fixes where FLAGS
register is not properly allocated.
2022-04-27 20:46:32 +00:00
florian
637976e83f * patch by Marģers to unify internal error numbers, resolves #37888
git-svn-id: trunk@47103 -
2020-10-13 19:59:01 +00:00
florian
8c5606b41d + support mmx shifting
git-svn-id: trunk@38367 -
2018-02-27 21:40:12 +00:00
florian
c1de51454c ti386shlshrnode.second_64bit:
* do not reused register
  * copy data to a new register only if really necessary

git-svn-id: trunk@38266 -
2018-02-17 12:45:15 +00:00
nickysn
af235cae86 * use TEST CL,32 instead of TEST ECX,32 in the beginning of a 64-bit shl/shr
sequence on i386

git-svn-id: trunk@35856 -
2017-04-19 21:30:31 +00:00
nickysn
d7b8d8dd54 * don't emit the "SUB ECX,32" instruction on i386, when doing a 64-bit shift by
reg, with a value >=32. The instruction is redundant, because the SHL/SHR
  instructions already AND mask the shift count by 31.

git-svn-id: trunk@35836 -
2017-04-18 15:09:20 +00:00
nickysn
7e8c89435f * avoid the AND instruction in the i386 shr64/shl64 code, by using TEST+JZ,
instead of CMP+JL

git-svn-id: trunk@35830 -
2017-04-18 11:36:48 +00:00
nickysn
6580dfee39 * generate better i386 code for 64-bit shl/shr, by masking the shift count by
63, instead of comparing it to 64 and branching. Note that, although this
  changes the behaviour of 64-bit shifts by values larger than 64 (when stored
  in a variable), it actually makes them consistent with both the code,
  generated on x86_64, as well as with 64-bit shift by constant on i386 itself.

git-svn-id: trunk@35727 -
2017-04-04 16:28:54 +00:00
sergei
5356f17fa5 * i386: switch the div/mod node to shared code, leaving in place the specific optimization for division by power of 2.
git-svn-id: trunk@27975 -
2014-06-15 16:20:53 +00:00
sergei
ed46a07f62 * Using x86-specific capability of shifting with carry flag helps to reduce amount of instructions.
git-svn-id: trunk@27899 -
2014-06-08 14:01:41 +00:00
sergei
92cf25b9a5 * Reworked i386 division by constant optimization to reuse code from powerpc64. The algorithm is slightly different, signed version is one instruction shorter, unsigned one is one instruction longer (typically). The new algorithm is easily scalable for x86_64 target, unlike the old one.
git-svn-id: trunk@27884 -
2014-06-07 00:20:05 +00:00
Jonas Maebe
edd42aa42a * moved subsetref/reg and bit_set/test support from cgobj to hlcgobj for
future use by high level code generator targets
   o this in turn required that all a_load*_loc* methods are called via
     hlcg rather than via cg, since a location can be a subsetref/reg and
     and those are no longer handled in tcg
   o that then required moving several force_location_* routines into
     thlcg because they use a_load_loc*, but did not take tdef size
     parameters (which are required by the thlcg a_load_loc* routines)
   o the only practical consequence is that from now on, you have to
     use hlcg.location_force_mem/reg() (fpureg not yet) and
     hlcg.gen_load_loc_cgpara() instead of the removed versions from ncgutil,
     and hlcg.a_load*loc*() instead of cg.a_load*loc* if a subsetref/reg
     might be involved

git-svn-id: trunk@21287 -
2012-05-13 12:33:10 +00:00
Jonas Maebe
9ec3cc2022 * fixed sign of location.size for divmodn, 64 shlshrn and for muln
git-svn-id: trunk@9646 -
2008-01-05 21:35:42 +00:00
daniel
9adb202a92 * Rework the constexprint to allow operations from low(int64) to high(qword).
+ Some initial work on a formaldef which also carries the typinfo of a parameter.

git-svn-id: trunk@7639 -
2007-06-13 07:41:18 +00:00
peter
658c46b903 * remove tdictionary and tindexarray
* symtables based on TFPHashObjectList and TFPObjectList
  * rename torddef.typ to torddef.ordtype
  * rename tfloatdef.typ to tfloatdef.floattype
  * rename tdef.deftype to tdef.typ
  * remove obsolete browser code, browcol is kept so the ide
    can still be compiled

git-svn-id: trunk@5192 -
2006-11-03 00:30:30 +00:00
florian
85d63d9fa9 * settings refactored
git-svn-id: trunk@5094 -
2006-10-30 18:02:58 +00:00
peter
3078a1927f * remove ttype
* rename old ttype variables *type to *def
  * rename resulttypepass to pass_typecheck
  * rename pass_2 to pass_generate_code

git-svn-id: trunk@5077 -
2006-10-29 22:19:39 +00:00
peter
b7fe6797bf Merged revisions 2921-2922,2925 via svnmerge from
http://svn.freepascal.org/svn/fpc/branches/linker/compiler

........
r2921 | peter | 2006-03-15 08:35:00 +0100 (Wed, 15 Mar 2006) | 2 lines

  * pass ObjectWriter to ObjectOuput

........
r2922 | peter | 2006-03-15 12:40:30 +0100 (Wed, 15 Mar 2006) | 2 lines

  * refactor asmdata

........
r2925 | peter | 2006-03-15 16:09:39 +0100 (Wed, 15 Mar 2006) | 3 lines

  * add cfi to asmdata
  * move asmlist, asmcfi, asmdata to own unit

........

git-svn-id: trunk@2932 -
2006-03-16 08:52:22 +00:00
peter
588cccb3ca * remove some obsolete i386 specific code
* use a_optimize_const to remove useless opcodes

git-svn-id: trunk@2910 -
2006-03-13 16:37:08 +00:00
peter
d8dc5679e3 * aktcputype and aktoptimizecputype was missing in the previous optimization commits
git-svn-id: trunk@2907 -
2006-03-13 12:29:56 +00:00
peter
b6e35a200e * rewrite of optimizer options
git-svn-id: trunk@2901 -
2006-03-13 09:05:50 +00:00
peter
4bee83c736 * range check errors
git-svn-id: trunk@2402 -
2006-02-02 09:03:02 +00:00
florian
bec0daebfa + optimized <dword> div <const dword>
git-svn-id: trunk@1993 -
2005-12-19 22:19:43 +00:00
peter
5942d23b1b * fix range error
git-svn-id: trunk@1974 -
2005-12-16 17:24:00 +00:00
florian
3582108be1 * signed divisions with constants are always done without idiv
git-svn-id: trunk@1965 -
2005-12-15 22:36:48 +00:00
peter
a3ab2053c9 * support multiple asmlabel types, renamed getlabel to
getjumplabel and added type para to getlabel for specific types
  * moved lineinfo generation from assemble and aggas to dbgstabs

git-svn-id: trunk@1120 -
2005-09-18 21:16:10 +00:00
fpc
790a4fe2d3 * log and id tags removed
git-svn-id: trunk@42 -
2005-05-21 09:42:41 +00:00
fpc
50778076c3 initial import
git-svn-id: trunk@1 -
2005-05-16 18:37:41 +00:00
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
peter
c95a859f0a * generic tlocation
* move tlocation to cgutils
2004-10-31 21:45:02 +00:00
peter
65c3ba277c * ungetregister is now only used for cpuregisters, renamed to
ungetcpuregister
  * renamed (get|unget)explicitregister(s) to ..cpuregister
  * removed location-release/reference_release
2004-09-25 14:23:54 +00:00
florian
8a9758c5e2 * logs truncated 2004-06-20 08:55:28 +00:00
peter
7dd6b85e01 * fix shl/shr with value > 63 2004-05-23 14:10:17 +00:00
florian
c37035a450 * common addnode code for x86-64 and i386 2004-01-20 12:59:36 +00:00
florian
ace2d682b0 * rtl and compiler compile with -Cfsse2 2003-12-26 13:19:16 +00:00
florian
06442fa677 + $fputype directive support
+ single data type operations with sse unit
  * fixed more x86-64 stuff
2003-12-25 01:07:09 +00:00
peter
41bf3e473c * int64 shl/shr > 63 returns 0 2003-12-10 17:28:41 +00:00
peter
fb81b7ebbb * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
* tregisteralloctor renamed to trgobj
  * removed rgobj from a lot of units
  * moved location_* and reference_* to cgobj
  * first things for mmx register allocation
2003-10-10 17:48:13 +00:00
daniel
b2343f4b16 * Register allocator splitted, ans abstract now 2003-10-09 21:31:37 +00:00
peter
70fe77ca7c * procinfo unit contains tprocinfo
* cginfo renamed to cgbase
  * moved cgmessage to verbose
  * fixed ppc and sparc compiles
2003-10-01 20:34:48 +00:00
peter
540691bf02 * optimized releasing of registers 2003-09-29 20:58:55 +00:00
peter
47d211aa2e * fix register leaks 2003-09-28 21:48:20 +00:00
peter
6a8d5eb25d * NEWRA branch merged 2003-09-03 15:55:00 +00:00
peter
b7d99ec934 * paraloc splitted in callerparaloc,calleeparaloc
* sparc calling convention updates
2003-07-02 22:18:04 +00:00
peter
0dceec9a64 * current_procdef removed, use current_procinfo.procdef instead 2003-06-13 21:19:30 +00:00
peter
d91c880148 * cg.a_load_* get a from and to size specifier
* makeregsize only accepts newregister
  * i386 uses generic tcgnotnode,tcgunaryminus
2003-06-03 21:11:09 +00:00
daniel
41e0bc4cec * Register allocator finished 2003-06-03 13:01:59 +00:00
peter
0e11419a26 * load_loc_reg update 2003-05-31 15:04:31 +00:00
peter
437ce7f8a2 * removed some unit dependencies 2003-05-22 21:32:28 +00:00
peter
47489f2376 * firstpass uses expectloc
* checks if there are differences between the expectloc and
    location.loc from secondpass in EXTDEBUG
2003-04-22 23:50:22 +00:00