Commit Graph

336 Commits

Author SHA1 Message Date
florian
406e3c4ac1 + support xgetbv instruction, resolves issue #29958
git-svn-id: trunk@33418 -
2016-04-03 20:53:10 +00:00
florian
8d5cc3dfa4 * (extended and modified) patch by Emelyanov Roman to add suport of RDRAND, RDSEED and TSX instructions set, resolves issue #29893.
In comparison with the original patch, support for a i386 has been added as well as a test program. 
  Further, a small issue with xbegin has been fixed

git-svn-id: trunk@33375 -
2016-03-28 19:08:13 +00:00
nickysn
cf3230b100 - removed IF_CENTAUR and replaced it with IF_CYRIX. Rationale: only 3 Centaur -
specific instructions were marked as CENTAUR, all the others were marked
  CYRIX, so it wasn't an accurate flag at all

git-svn-id: trunk@33326 -
2016-03-25 17:01:11 +00:00
nickysn
9a2f5e01d7 + added range checking for the immediate operand of NEC V20/V30's instructions CLR1, SET1, NOT1 and TEST1
git-svn-id: trunk@33322 -
2016-03-24 16:05:11 +00:00
nickysn
0be6d062ac + added range checking for the imm4 operand of NEC V20/V30's instructions
'EXT reg8,imm4' and 'INS reg8,imm4'

git-svn-id: trunk@33321 -
2016-03-24 15:45:23 +00:00
nickysn
5f87ac5d47 + added 486 to the list of supported CPUs on the i8086 and i386 targets
git-svn-id: trunk@33317 -
2016-03-23 15:07:56 +00:00
sergei
0f301b4c57 * Fixed spilling info for vcvt* instructions, part of Mantis #29783.
git-svn-id: trunk@33208 -
2016-03-09 16:36:30 +00:00
nickysn
80b3e3020a * the SEGFS and SEGGS prefixes are 386+
git-svn-id: trunk@32925 -
2016-01-11 15:51:40 +00:00
pierre
40193ea1db Add pi_has_open_array_parameter to proc_info.flags as this requires special handling for i8086 huge memory model to restore DS register correctly
git-svn-id: trunk@32922 -
2016-01-11 15:02:10 +00:00
nickysn
741a3eedf9 * fixed the cpu level of several 186+ instructions, that were mistakenly marked as either 286+ or 8086+
git-svn-id: trunk@32921 -
2016-01-11 13:22:08 +00:00
nickysn
6037976202 * several imul variants, featuring 32-bit or 64-bit registers marked 386+, instead of 286+
git-svn-id: trunk@32889 -
2016-01-08 17:07:36 +00:00
nickysn
e877bae4fc + add 'jmp rm16' and 'call rm16' before the rm32 versions on i8086, so the
16-bit version is picked up by default for opsize=S_NO. Previously the 386
  version was picked on i8086, but the generated code was correct, because we
  don't yet generate a 0x66 prefix for "\325", which leads to many 32-bit
  instructions not being assembled correctly with the internal asm obj writer on
  the i8086

git-svn-id: trunk@32887 -
2016-01-08 16:41:21 +00:00
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