Commit Graph

324 Commits

Author SHA1 Message Date
nickysn
66bad5a1cf * pushf and popf are 8086 level instructions, not 186+
git-svn-id: trunk@32677 -
2015-12-17 15:23:21 +00:00
florian
a3964d9ee0 + support for RDTSCP, resolves issue #28916
git-svn-id: trunk@32652 -
2015-12-13 13:28:51 +00:00
nickysn
1e33924f73 + support procvardefs (address only) in i8086's hlcgcpu.getaddressregister; this
fixes e.g. obtaining the address of a method in i8086 far code memory models
  after r32414

git-svn-id: trunk@32562 -
2015-12-01 15:58:11 +00:00
sergei
a78250a78b * x87 FBSTP and FBLD instructions cannot have size suffix in ATT syntax. Mantis #29095.
git-svn-id: trunk@32541 -
2015-11-27 03:59:06 +00:00
nickysn
ad92f4e80a + implemented thlcgcpu.a_op_const_reg with far pointer support for i8086, so
that second_class_to_intf can be converted to the high level code generator

git-svn-id: trunk@32301 -
2015-11-12 22:01:44 +00:00
nickysn
ef2c6065b6 + added support for word/smallint typed constants, initialized with ofs() on i8086
git-svn-id: trunk@32285 -
2015-11-11 15:01:08 +00:00
nickysn
ac97d20249 + added support for typed word/smallint constants, initialized with Seg(symbol) on the i8086
git-svn-id: trunk@32251 -
2015-11-05 16:18:47 +00:00
Jonas Maebe
fa3b0ca312 * support marking defs created via the getreusable*() class methods as
"don't free even if not registered"; use for defs that may not be written
    to a ppu file, but that must nevertheless survive the compilation of the
    current module
  * mark all defs created for para locations as "don't free even if not
    registered", because we don't discard and recalculate all para locations
    after a module has been compiled (since that's not needed)
   o solves issues if the paralocations for a routine in the interface of
     unit A are calculated while the implementation of unit B gets
     compiled, and a new reusable type is allocated at that point which
     is not used anywhere else (after r32160)

git-svn-id: trunk@32235 -
2015-11-04 20:46:18 +00:00
nickysn
a55b728d34 * optimizations for ofs() on i8086 to load only the offset (in a temporary
register), without the segment

git-svn-id: trunk@32211 -
2015-10-30 21:27:35 +00:00
Jonas Maebe
d440daf47f * fixed compilation with -Oodfa/-O3
git-svn-id: trunk@32152 -
2015-10-25 19:21:57 +00:00
nickysn
1491d9655c + fixed the emitting of non-nil far and huge pointer constptrs in typed
constants on i8086

git-svn-id: trunk@32141 -
2015-10-24 20:25:49 +00:00
nickysn
863daace35 + implemented correct simplification of far pointer comparison of two pointer const nodes
git-svn-id: trunk@32122 -
2015-10-22 14:07:45 +00:00
nickysn
b0130c008d + show the full segment:offset value of far and huge pointer const nodes in the node tree generated by -vp
git-svn-id: trunk@32117 -
2015-10-21 16:53:41 +00:00
nickysn
09218c88aa + optimizations in tcg8086.g_flags2reg for the case where the carry flag or the
inverted carry flag is converted to int, using shorter branchless code and
  the adc/rcl/sbb instructions

git-svn-id: trunk@32106 -
2015-10-20 23:22:32 +00:00
nickysn
7e6ba9db2a * do an even better optimization (swap registers in the result, saving 2 mov
instructions) on i8086 for 64-bit shl/shr with a constant in the range 32..47

git-svn-id: trunk@32062 -
2015-10-15 21:13:28 +00:00
nickysn
ff5eed1c00 * user xor reg,reg to zero out registers in the i8086 optimized 64-bit shl code
git-svn-id: trunk@32061 -
2015-10-15 21:02:53 +00:00
nickysn
6ece867305 * in the i8086 64-bit shl code, use jcxz instead of test cx,cx+jz when
optimization target is 386 or earlier (or when optimizing for size)

git-svn-id: trunk@32060 -
2015-10-15 20:51:20 +00:00
nickysn
dc92c3eb09 + i8086 optimization for the code generated for 64-bit shl/shr with a constant in the range 32..47
git-svn-id: trunk@32059 -
2015-10-15 15:59:27 +00:00
nickysn
44f6f607c5 * optimized the generated code on i8086 for 64-bit shl/shr with constant >=48
git-svn-id: trunk@32058 -
2015-10-15 15:15:11 +00:00
nickysn
66725cf170 * fixed huge memory model threadvars after r32013
git-svn-id: trunk@32016 -
2015-10-11 12:55:44 +00:00
florian
79619df936 + use the or instruction to compare 32 bit values with 0
git-svn-id: trunk@31862 -
2015-09-27 20:50:59 +00:00
florian
298cde6489 + initial code in aoptcpu for i8086: make use of lds/les
git-svn-id: trunk@31861 -
2015-09-27 20:50:57 +00:00
nickysn
b26e10d53c + generate proper win16 prologue/epilogue for exported routines (we don't yet
actually export them from the .exe or .dll, but they can now be used as
  callbacks)
+ support win16 smart callbacks via the $K switch

git-svn-id: trunk@31835 -
2015-09-26 18:04:59 +00:00
nickysn
aa57e7e835 * moved the i8086-specific threadvar generation code from
ti8086loadnode.pass_generate_code to ti8086loadnode.generate_threadvar_access

git-svn-id: trunk@31699 -
2015-09-15 13:02:25 +00:00
Jonas Maebe
3c6aa91a96 * factored out the loading of threadvars in its own method, and put the
x86-specific part in nx86ld

git-svn-id: trunk@31639 -
2015-09-12 23:32:53 +00:00
nickysn
182dffcbd8 * fixed i8086 compilation after r31593
git-svn-id: trunk@31605 -
2015-09-11 16:20:50 +00:00
Jeppe Johansen
3cb9be73bc Moved tcontrollerdatatype out into cpuinfo.
Added cputype and fputype info to tcontrollerdatatype arrays.

git-svn-id: trunk@31574 -
2015-09-07 20:36:54 +00:00
nickysn
bdfd23cc2e + new target switch "FarProcsPushOddBP", which causes the i8086 compiler to push
odd values of BP if the procedure is far. Enabled this by default for Win16.

git-svn-id: trunk@31569 -
2015-09-07 19:05:18 +00:00
nickysn
839ab714cc + started implementing a win16 target :)
git-svn-id: trunk@31521 -
2015-09-05 02:47:42 +00:00
nickysn
a1d29b8251 * always pop DS in huge memory models in asm routines that don't specify
'nostackframe'

git-svn-id: trunk@31520 -
2015-09-04 21:51:04 +00:00
nickysn
98ec7a2211 * eliminated the dual initialization of DS in interrupt procedures in the huge
memory model

git-svn-id: trunk@31519 -
2015-09-04 21:37:07 +00:00
nickysn
69042574b2 * assume external variables are in a different segment in the huge memory model
git-svn-id: trunk@31517 -
2015-09-04 19:39:55 +00:00
nickysn
2087290802 * i8086 huge memory model threadvar code generation fixes
git-svn-id: trunk@31516 -
2015-09-04 19:15:10 +00:00
nickysn
2b42c17318 + also initialize the proper (foreign) segment when loading a global variable
from another unit in the huge memory model

git-svn-id: trunk@31515 -
2015-09-04 16:05:52 +00:00
nickysn
0fdc62e0f7 + initialize DS with the current unit's data segment in the function entry code
generated in the huge memory model

git-svn-id: trunk@31500 -
2015-09-03 21:44:16 +00:00
Jonas Maebe
0fc1fd6ac1 * replaced current_procinfo.currtrue/falselabel with storing the true/false
labels of LOC_JUMP in the node's location. This generates some extra jumps
    for short circuit boolean and/or-expressions if optimizations are off, but
    with optimisations enabled the generated code is the same (except for JVM
    because the jump threading optimisation isn't enabled there yet).

git-svn-id: trunk@31431 -
2015-08-27 18:28:57 +00:00
nickysn
41203a9152 * support far classrefdef targets on i8086 in thlcgcpu.a_loadaddr_ref_reg. This
fixes code generation for loadvmtaddr nodes in i8086 far data memory models
  after r31064.

git-svn-id: trunk@31326 -
2015-08-15 17:24:49 +00:00
Jonas Maebe
f402b0d7df * changed getpointerdef() into a tpointerdef.getreusable() class method
o allows removing the ugly x86 hacks

git-svn-id: trunk@31144 -
2015-06-22 08:17:49 +00:00
florian
b4fc11fe06 * implemented r30870 for all platforms: pass dyn. array parameters like pointer parameters so typically in a register
git-svn-id: trunk@30878 -
2015-05-17 12:29:28 +00:00
Jonas Maebe
1b43930749 - removed long deprecated/buggy assembler cse optimiser for i386
o bumped ppu version because optimiser settings can be embedded in generic
     token streams

git-svn-id: trunk@30835 -
2015-05-09 17:25:07 +00:00
florian
7dd1d6aa77 o fixes handling of iso i/o parameters/program parameters:
* explicit reset is needed
  * variable must be declared again

git-svn-id: trunk@30757 -
2015-05-01 20:58:31 +00:00
nickysn
0675a9209d * use 16-bit alignment for class references and all pointer types on i8086
git-svn-id: trunk@30682 -
2015-04-20 12:41:55 +00:00
nickysn
a6e39edb8f * moved the insertion of fwaits for 8087 from the nasm asm writer to ti8086procinfo.postprocess_code
git-svn-id: trunk@30634 -
2015-04-17 23:27:03 +00:00
nickysn
2cf6852910 + added i8086 instruction entries for Jcc near (which is actually a 386+
instruction), that encode it as two i8086 compatible instructions:
    JNcc short +3
    JMP near target

git-svn-id: trunk@30612 -
2015-04-16 17:07:07 +00:00
Jonas Maebe
61e4a1b811 + added tasmlist parameter to getintparaloc() (needed for llvm)
git-svn-id: trunk@30429 -
2015-04-04 14:29:16 +00:00
nickysn
c28184b697 * fixed comparison of far procvars after the hlcgllvm branch merge
git-svn-id: trunk@30357 -
2015-03-29 00:56:43 +00:00
nickysn
6b0a19c0ab * fixed getting the address of a far proc on i8086 after the hlcgllvm branch merge
git-svn-id: trunk@30354 -
2015-03-28 17:31:52 +00:00
nickysn
0162b199f7 * fixed the i8086 g_intf_wrapper after the hlcgllvm branch merge
git-svn-id: trunk@30353 -
2015-03-28 14:33:22 +00:00
nickysn
003b283e55 * fixed thlcgcpu.g_exception_reason_save_const always generating a 286+ push
instruction on i8086, regardless of current cpu level

git-svn-id: trunk@30352 -
2015-03-28 13:59:10 +00:00
Jonas Maebe
201121d7c9 * synchronised with trunk till r30345
git-svn-id: branches/hlcgllvm@30349 -
2015-03-28 12:28:15 +00:00