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
nickysn
f9d3e0c8d6
+ the beginnings of an i8086-msdos internal obj writer
...
git-svn-id: trunk@30330 -
2015-03-27 00:01:11 +00:00
Jonas Maebe
bd203a5b57
* synchronised with trunk till r30240
...
git-svn-id: branches/hlcgllvm@30241 -
2015-03-15 19:44:58 +00:00
Jonas Maebe
2e126bb723
- removed darwin/i386 special case code from i8086 code generator
...
git-svn-id: trunk@30204 -
2015-03-14 18:35:50 +00:00
Jonas Maebe
67b8aceaee
* synchronized with privatetrunk till r30095
...
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
florian
99635658ec
* corrects change flags for VSQRTSD
...
git-svn-id: trunk@30037 -
2015-02-28 22:42:25 +00:00
Jonas Maebe
d6de2c03cb
* generic part of r26050 from the hlcgllvm branch: made tcgvecnode hlcg-safe
...
o in particular, add tdef size information to the update_reference*()
methods, and factored out offset adjustments into its own method
o also make sure the passed size to update_reference*() corresponds to the
actual size of the index, as it's no longer guaranteed to be ptruint
since the previous commit
git-svn-id: trunk@29967 -
2015-02-23 22:56:00 +00:00
florian
d6e4af8279
+ applied remaining patches of Torsten Grundke: adds gather instructions of avx2
...
git-svn-id: trunk@29745 -
2015-02-17 21:43:46 +00:00
florian
35a04ad095
* modified patch of Paul W to replace leave by mov/pop, resolves #26455
...
git-svn-id: trunk@29633 -
2015-02-05 20:51:12 +00:00
nickysn
c39128708e
+ implemented inc/dec for huge pointers
...
git-svn-id: trunk@29251 -
2014-12-10 23:52:46 +00:00
florian
5c67fcc43f
+ change always floating point divisions into multiplications if they are a power of two,
...
this is an exact operation so it is always allowed
* change only divisions by normal numbers into multiplications
git-svn-id: trunk@29085 -
2014-11-16 20:47:38 +00:00
Tomas Hajny
3ee3542744
* boolean constant instead of IFDEFs for detection of microcontroller support
...
git-svn-id: trunk@29052 -
2014-11-10 12:34:59 +00:00
Károly Balogh
dd67fa8c5c
* fixed DFA warnings for i8086
...
git-svn-id: trunk@28504 -
2014-08-20 15:49:27 +00:00
Jonas Maebe
b745dcc64c
* moved g_external_wrapper() to the hlcg, and also g_intf_wrapper() because
...
for some platforms it depends on that routine
git-svn-id: branches/hlcgllvm@28492 -
2014-08-19 20:22:54 +00:00
Jonas Maebe
9880b53242
* changed all alignment parameters in the temp manager to shortint
...
git-svn-id: branches/hlcgllvm@28489 -
2014-08-19 20:22:45 +00:00
Jonas Maebe
dd733bd5b5
* changed all size parameters in the temp manager from longint to asizeint
...
git-svn-id: branches/hlcgllvm@28488 -
2014-08-19 20:22:42 +00:00
Jonas Maebe
344acef9b5
* separate tracking the def of a temp and whether or not it needs to be
...
finalised (for llvm, we always keep track of the def)
git-svn-id: branches/hlcgllvm@28485 -
2014-08-19 20:22:34 +00:00
Jonas Maebe
a637fbe596
* moved all g_exception_*() methods to hlcgobj and cleaned them up (no more
...
hardcoded registers for the most part)
+ added extra g_exception_discard_reason() that can be called when we only
want to get rid of the currently pushed exception reason, and don't have
to load it (so it can do nothing on platforms that don't use push/pop)
git-svn-id: branches/hlcgllvm@28481 -
2014-08-19 20:22:24 +00:00
Jonas Maebe
5c75b6dd6b
* synchronised with trunk up till r28402
...
git-svn-id: branches/hlcgllvm@28403 -
2014-08-13 16:04:30 +00:00
nickysn
94bcb9878a
* reimplemented r28329 in a different way, as suggested by Jonas
...
git-svn-id: trunk@28332 -
2014-08-07 19:36:52 +00:00
nickysn
3164bf66f5
+ implemented correct [] indexing of huge pointers
...
git-svn-id: trunk@28330 -
2014-08-07 09:11:21 +00:00
nickysn
4ea551a0f7
* is_farpointer and is_hugepointer moved from defutil to symcpu
...
git-svn-id: trunk@28328 -
2014-08-06 20:32:41 +00:00
nickysn
36d63b953e
+ added an i8086 specific boolean property is_huge to the tarraydef. For now it
...
will only be used for indexing huge pointers (i.e. only huge arrays with the
ado_IsConvertedPointer array option will be supported). In the distant future,
regular huge arrays may be supported as well (but that would require
substantially more work, including adding hugeness support to other structures
such as records, objects and classes, so I'm not planning on doing it anytime
soon).
git-svn-id: trunk@28270 -
2014-07-26 13:27:46 +00:00
nickysn
33dac14554
* defutil.get_int_type_for_pointer_arithmetic replaced with a virtual method
...
tpointerdef.pointer_arithmetic_int_type
git-svn-id: trunk@28258 -
2014-07-24 14:18:57 +00:00
nickysn
d86a8ebc99
* defutil.get_int_result_type_from_pointer_subtraction moved to a virtual
...
method tpointerdef.pointer_subtraction_result_type
git-svn-id: trunk@28219 -
2014-07-14 23:30:29 +00:00
nickysn
99c555cea8
+ implemented huge pointer subtraction
...
* the result of far pointer subtraction changed to word (for TP7 compatibility)
git-svn-id: trunk@28218 -
2014-07-13 23:40:43 +00:00
nickysn
200df7a136
* set expectloc correctly for far pointer comparison as well
...
git-svn-id: trunk@28217 -
2014-07-13 16:25:20 +00:00
nickysn
04234c733f
* set expectloc correctly (LOC_JUMP instead of LOC_FLAGS) for non-normalized
...
huge pointer comparison
git-svn-id: trunk@28216 -
2014-07-13 15:20:58 +00:00
nickysn
5818451bb5
* non-normalized huge pointer comparison made unsigned
...
git-svn-id: trunk@28214 -
2014-07-13 12:54:12 +00:00
nickysn
8604372da3
+ implemented far pointer comparison operating only on the offset (+ added test)
...
git-svn-id: trunk@28179 -
2014-07-06 22:45:19 +00:00
Jonas Maebe
7949bebb8d
* synchronised with r28168 of trunk
...
git-svn-id: branches/hlcgllvm@28169 -
2014-07-05 21:30:28 +00:00
nickysn
3bb730d5b9
+ implemented normalized huge pointer comparison
...
git-svn-id: trunk@28157 -
2014-07-04 23:22:33 +00:00
nickysn
aee568e6fc
* cs_hugeptr_normalization renamed to cs_hugeptr_arithmetic_normalization,
...
because we're going to also introduce cs_hugeptr_comparison_normalization as
an independent option
git-svn-id: trunk@28149 -
2014-07-04 13:14:06 +00:00
Jonas Maebe
1516661249
+ new chlcgobj class reference variable that can be used to call thlcg*
...
virtual methods even when hlcg doesn't contain a valid instance
git-svn-id: branches/hlcgllvm@28143 -
2014-07-03 22:28:31 +00:00
nickysn
d9e94ffab7
+ implemented huge pointer arithmetic
...
git-svn-id: trunk@28139 -
2014-07-03 16:53:22 +00:00
Jonas Maebe
6c45f9b3ee
* converted most of the asmlist-based typed const parsing to use the new
...
typed const builder class
git-svn-id: branches/hlcgllvm@28118 -
2014-07-01 16:30:40 +00:00
nickysn
1910177cf0
+ added heapmax support to the $M directive on i8086-msdos. It is currently
...
only implemented in the near data memory models. The far data models support
is still a TODO.
git-svn-id: trunk@28039 -
2014-06-23 20:17:17 +00:00
nickysn
7cfd7a66cd
+ create a special 'heap' segment with reserved space equal to heapsize (i.e.
...
the value set by -Ch or the second parameter to the $M directive). This is
equivalent to the heapmin value in Turbo Pascal 7 and ensures that the program
has at least this amount of heap space available (otherwise DOS will show a
'not enough memory' error and will refuse to load the program).
git-svn-id: trunk@28002 -
2014-06-19 14:14:01 +00:00
nickysn
8ad63788c7
- do not emit a stack segment in the tiny memory model
...
- rm the reference to the top of the stack segment from the startup code in tiny
model
git-svn-id: trunk@27956 -
2014-06-14 15:56:44 +00:00
sergei
dc628b8969
* x86: Completely skip instructions that do not exist for target CPU bit width. The existing behavior of writing mnemonics and properties but no encoding allows an invalid instruction to be recognized by assembler reader or even generated by compiler, but it but won't assemble anyway.
...
git-svn-id: trunk@27934 -
2014-06-11 22:31:40 +00:00
nickysn
73d7f2aa18
* let the compiler generate the stack segment in i8086 near data memory models
...
as well. Even though, in these models, the stack is dynamically allocated
(because it goes on top of the heap, but the heap is variable size), there are
still benefits:
1) the program will run on a larger stack during initialization, before the
actual stack (and heap) are ready
2) in cases, when the system is extremely low on memory, DOS will reject to
load the program if there's not enough memory for the stack the program
requires. This way the startup code can be further simplified by omitting
the 'not enough memory' check in the future (when we add the minimum heap
size to the executable reserved space as well).
git-svn-id: trunk@27903 -
2014-06-08 21:14:57 +00:00
nickysn
70732aedbb
* ti8086nodeutils.InsertMemorySizes: stack segment creation moved to a separate
...
method
git-svn-id: trunk@27851 -
2014-06-04 13:44:10 +00:00
nickysn
47a7a9835a
* added hack to support stack exceeding 32kb in size in the i8086 far data
...
memory models
git-svn-id: trunk@27827 -
2014-05-29 17:07:01 +00:00
nickysn
e9cb275f66
* put the i8086-msdos stack segment in a separate object file
...
git-svn-id: trunk@27825 -
2014-05-29 16:04:15 +00:00
nickysn
3cc8ff11e3
+ generate the stack segment for i8086 far data memory models from within fpc
...
itself (instead of having a fixed 16k stack in the startup code). This allows
setting the stack size in these models with the -Cs option.
git-svn-id: trunk@27820 -
2014-05-27 23:29:50 +00:00
nickysn
24fcac9f87
+ added support for nested procvars in the i8086 far data memory models
...
git-svn-id: trunk@27812 -
2014-05-22 23:44:09 +00:00
nickysn
feb840b47f
* support reg=NR_NO in thlcgcpu.reference_reset_base on i8086. This fixes test
...
webtbs/tw26162.pp in the i8086 far data memory models.
git-svn-id: trunk@27807 -
2014-05-21 13:26:02 +00:00
nickysn
683478f00c
+ added a proper far pointer inc/dec implementation (operating only on the offset,
...
without touching the segment)
git-svn-id: trunk@27805 -
2014-05-19 16:24:25 +00:00
Jonas Maebe
bacd303208
* synchronized with trunk up to r27758
...
git-svn-id: branches/hlcgllvm@27779 -
2014-05-12 16:12:34 +00:00
nickysn
791cd932fd
+ support i8086 far data memory models in tcg8086.g_intf_wrapper
...
git-svn-id: trunk@27722 -
2014-05-03 14:17:54 +00:00
nickysn
906d828ee0
* tcg8086.g_copyvaluepara_openarray: fix for the case where ref.segment is
...
specified, but equal to DS in the current memory model -> call the high level
code generator with a near pointer type in order to force the segment to be
ignored
git-svn-id: trunk@27716 -
2014-05-01 22:28:07 +00:00
nickysn
c9c29a3cd4
+ ignore the source segment, when the destination cgpara is a near pointer in
...
tcg8086.a_loadaddr_ref_cgpara
git-svn-id: trunk@27715 -
2014-05-01 21:56:04 +00:00
nickysn
c9f8703679
+ set ref.segment to NR_SS for all temps/localvars on i8086. This allows the
...
segment to survive e.g. several nested vecnodes, which cause the base register
to change from BP to something else. In the cases where the ss: prefix is not
needed, it is removed by make_simple_ref.
+ remove the ss: prefix in the several cases where make_simple_ref isn't called
(namely spilling and tcg8086.a_call_reg_far)
git-svn-id: trunk@27714 -
2014-05-01 21:18:47 +00:00
nickysn
38aec68d6f
* ti8086vecnode.update_reference_reg_mul: remove the segment before calling
...
base, because base may in some cases call cg.a_loadaddr_ref_reg, which will
overwrite the next register, if the source reference contains a segment
git-svn-id: trunk@27713 -
2014-05-01 19:39:52 +00:00
nickysn
3dfc6ac7e1
* fixed the passing of extended floating type parameters on i8086 for
...
pocall_register after r24761 (it is the same change as in r24766, but for
pocall_register)
git-svn-id: trunk@27709 -
2014-05-01 16:45:49 +00:00
nickysn
906412411f
* fixed the passing of pushaddr paramaters for pocall_register in i8086 far data
...
memory models
git-svn-id: trunk@27708 -
2014-05-01 16:43:35 +00:00
nickysn
7da8719036
+ support near pointers, bound to a segment register in hlcg.reference_reset_base
...
on i8086
git-svn-id: trunk@27688 -
2014-04-29 23:15:20 +00:00
nickysn
e8b9d9bf41
* converted tcgtypeconvnode.second_nil_to_methodprocvar to the high level code
...
generator, so it handles i8086 near and far pointers generically
- removed t8086typeconvnode.second_nil_to_methodprocvar, since it's no longer
necessary
git-svn-id: trunk@27678 -
2014-04-28 01:05:14 +00:00
nickysn
187c2af20e
* tcgtypeconvnode.second_proc_to_procvar converted to the high level code
...
generator, so it can now handle i8086 near and far pointers generically
- removed almost all of t8086typeconvnode.second_proc_procvar, since it's no
longer needed. Only a few assertions are left there to ensure that we don't
accidentally attempt to take the address of a near procedure in a far code
memory model, because the calling conventions are incompatible.
git-svn-id: trunk@27677 -
2014-04-27 23:18:05 +00:00
nickysn
313240b9e8
* use a better way (suggested by Jonas) to determine whether a procedure is from
...
the same unit
git-svn-id: trunk@27629 -
2014-04-21 23:14:16 +00:00
nickysn
8a606761cd
* don't push cs in ti8086callnode.extra_interrupt_code in the far code memory
...
models, because in these models, interrupt procedures are treated as far and
an appropriate far call (or push cs+near call if in the same segment) is made
anyway
git-svn-id: trunk@27622 -
2014-04-21 00:56:51 +00:00
nickysn
70a7ecd0fa
+ use 'push cs + call near' (which is both shorter and faster), instead of far
...
call, when calling a far proc in the same segment
git-svn-id: trunk@27621 -
2014-04-21 00:44:45 +00:00
nickysn
597f110eb9
+ added support for units with code larger than 64kb in the far code i8086
...
memory models. Enabled by the new directive {$hugecode on}. The directive is
ignored in the near code memory models. When enabled, it forces each procedure
to be in a separate segment and disables mixing near and far procedures (so
'near' and {$F-} are ignored in this mode). Note that {$hugecode on} does not
count as a different memory model, because you can freely link modules (units)
compiled with {$hugecode on} and {$hugecode off}.
git-svn-id: trunk@27615 -
2014-04-20 19:03:14 +00:00
nickysn
bf6ad0ff78
* fixed tcg8086.g_flags2reg, so it behaves the same way as tcgx86.g_flags2reg
...
after r27581 in regard to floating point comparisons. The tcmpnan.pp test now
almost works (i.e. fails due to only one error, instead of many).
git-svn-id: trunk@27605 -
2014-04-19 22:54:29 +00:00
nickysn
9a44ab2fc2
* always treat interrupt routines as far, so their address can be taken even in
...
{$F-} mode
git-svn-id: trunk@27591 -
2014-04-16 23:37:28 +00:00
nickysn
d6ad2b1f8a
+ added support for mixing near and far procedures in the i8086 far code memory
...
models. The $F directive and the 'near' and 'far' procedure modifiers should
now work as expected in the far code memory models (they are still ignored in
the near code memory models). The compiler defaults to the {$F+} state,
because {$F-} requires adding 'far' to a lot of procedures in the rtl,
packages and tests.
git-svn-id: trunk@27590 -
2014-04-16 23:09:18 +00:00
sergei
98de3c4e40
* tcg8086.g_flags2reg: call virtual method a_jmp_flags instead of duplicating its functionality, it prevents further changes to this method when adding support for unordered comparison results.
...
git-svn-id: trunk@27579 -
2014-04-14 00:20:06 +00:00
nickysn
ce0bd81273
+ show an error message 'procedure must be far' if an attempt is made to convert
...
a near proc to a procvar in a i8086 far code memory model
git-svn-id: trunk@27567 -
2014-04-13 19:29:28 +00:00
nickysn
d8d3706462
+ override hlcg.a_call_name for i8086 and dispatch to the appropriate type of
...
call (near or far), according to whether the procdef is near or far, instead
of relying on the default for the memory model
git-svn-id: trunk@27562 -
2014-04-13 15:17:43 +00:00
nickysn
6fe362a1b0
+ added method is_far to i8086's tcpuprocdef and tcpuprocvardef
...
+ added helper function to i8086's symcpu is_proc_far that dispatches the call
to the proper is_far method (because we can't make a cpu specific descendant
of tabstractprocdef and add it there)
* all checks for (po_far in procoptions) in the i8086 code generator replaced
with calls to is_proc_far
git-svn-id: trunk@27559 -
2014-04-13 12:41:46 +00:00
nickysn
40a6a9c820
+ added i8086 specific implementation of thlcgcpu.a_load_loc_ref, which handles
...
6-byte method pointers and other i8086 types that use loc.registerhi
* changed the i8086 specific code in tcgassignmentnode.pass_generate_code to
use hlcg.a_load_loc_ref
git-svn-id: trunk@27555 -
2014-04-13 01:38:43 +00:00
nickysn
2e7aab0155
* refactored i8086's thlcgcpu.location_force_mem:
...
o The checks for types that need special handling moved to separate methods,
because they'll probably be used by the other hlcg.a_load*loc* methods as
well.
o Use voidcodepointertype and voidpointertype to avoid the ifs for checking
the memory model.
git-svn-id: trunk@27554 -
2014-04-12 21:59:32 +00:00
nickysn
fc71081b74
* i8086 and i386-specific code from tabstractprocdef.is_pushleftright moved to
...
symi86
git-svn-id: trunk@27549 -
2014-04-12 15:34:08 +00:00
nickysn
0a515311e6
* tabstractprocdef.address_type i8086-specific code moved to symcpu, ifdef i8086 removed
...
git-svn-id: trunk@27548 -
2014-04-12 15:09:17 +00:00
nickysn
b41892f048
* set po_far in the i8086-specific descendants of tprocdef and tprocvardef,
...
instead of in tabstractprocdef.create; ifdef i8086 removed
git-svn-id: trunk@27544 -
2014-04-12 12:17:10 +00:00
svenbarth
02495c17bd
Fix a typo. The CPU specific version of "ttypesym" should be called "tcputypesym" and not "tcpuypesym".
...
git-svn-id: trunk@27531 -
2014-04-11 14:30:59 +00:00
nickysn
e725af86fe
* fixed the handling of the register parameters of i8086 interrupt procedures
...
git-svn-id: trunk@27502 -
2014-04-07 22:19:10 +00:00
nickysn
9f2e59de3a
+ implemented far pointer arithmetic in the i8086 add node simplify method
...
git-svn-id: trunk@27495 -
2014-04-06 18:51:53 +00:00
nickysn
8d1ed088c8
+ implemented far pointer arithmetic (operating only on the offset, without
...
touching the segment)
git-svn-id: trunk@27485 -
2014-04-06 13:12:29 +00:00
nickysn
f00f7d6ee7
* override tcgvecnode.update_reference_reg_mul for i8086 and add code that
...
preserves the reference segment (because reference_reset_base, which is
sometimes used by the base method, kills the segment)
git-svn-id: trunk@27480 -
2014-04-05 14:02:52 +00:00
nickysn
e43791cf7c
* ti8086callnode.extra_call_ref_code: do not change the base register to BX if
...
it's BP, because that breaks memory models with DS<>SS
git-svn-id: trunk@27471 -
2014-04-04 21:43:40 +00:00
nickysn
9da1ee0138
* i8086 far data model fixes in the copying of openarray value params
...
git-svn-id: trunk@27470 -
2014-04-04 20:18:47 +00:00
nickysn
4832682c58
* fixed i8086 far pointer typed constants that are initialized with nil
...
git-svn-id: trunk@27458 -
2014-04-03 21:39:00 +00:00
Jonas Maebe
d452686c39
* moved pbestrealtype from symdef to symcpu
...
git-svn-id: trunk@27441 -
2014-04-01 21:41:37 +00:00
nickysn
5f57274b74
+ proper i8086 Seg() implementation (i.e. support segments other than DS)
...
git-svn-id: trunk@27432 -
2014-04-01 19:11:39 +00:00
Jonas Maebe
338c064beb
* moved x86-specific tpointerdef functionality to architecture-specific
...
descendants
git-svn-id: trunk@27397 -
2014-03-30 21:04:36 +00:00
Jonas Maebe
dae5d1ff62
+ added class reference types of the architecture-specific t*def/t*sym
...
classes
git-svn-id: trunk@27396 -
2014-03-30 21:04:32 +00:00
nickysn
0a9f738167
+ tcg8086.g_copyvaluepara_openarray: support source to be in a different segment
...
git-svn-id: trunk@27393 -
2014-03-30 19:55:11 +00:00
nickysn
1f8280e8f1
* load the destination segment in tcg8086.g_copyvaluepara_openarray from SS
...
instead of DS, because the destination is on the stack, but in some memory
models DS may be different than SS
git-svn-id: trunk@27391 -
2014-03-30 19:10:21 +00:00
nickysn
f4a0c08736
* fixed nested access to parent local variables in i8086 far data memory models
...
git-svn-id: trunk@27388 -
2014-03-30 17:50:35 +00:00
Jonas Maebe
4a79481c51
* isolated segment-related functionality of tabsolutevarsym into i386/i8086-
...
specific descendent classes and moved the code that deals with this in the
code generator also to target-specific classes -> only ifdefs left in
pdecvar
git-svn-id: trunk@27379 -
2014-03-30 15:42:53 +00:00
Jonas Maebe
b57c95043f
+ support overriding tdef/tsym methods with target-specific functionality:
...
o made all (non-abstract) tdef and tsym constructors virtual
o added c*def/c*sym classref types for every (non-abstract) t*def/t*sym
class
o added cpusym unit for every architecture that derives a tcpu*def/tcpu*sym
class from the base classes, and initialises the c*def/c*sym classes with
them. This is done so that the llvm target will be able to derive from
the tcpu*def/sym classes without umpteen ifdefs, and it also means that
the WPO can devirtualise everything because the c* variables are only
initialised with one class type
o replaced all t*def/t*sym constructor calls with c*def/c*sym constructor
calls
git-svn-id: trunk@27361 -
2014-03-29 22:31:55 +00:00
Jonas Maebe
b5fd71c3b9
* removed {$ifndef i8086} in tx86vecnode, instead reset cvecnode to
...
tcgvecnode in the n8086mem initcode
git-svn-id: trunk@27360 -
2014-03-29 22:31:49 +00:00
nickysn
4e60d2316f
* support implicit pointer types (classes, dynarrays, ansistrings, etc.) in
...
i8086's thlcgcpu.getaddressregister and thlcgcpu.reference_reset_base
git-svn-id: trunk@27333 -
2014-03-29 14:00:24 +00:00
nickysn
ce59c4616f
* assume SS for the segment of references that have BP as base in
...
thlcgcpu.a_loadaddr_ref_reg
git-svn-id: trunk@27332 -
2014-03-29 13:25:11 +00:00
nickysn
e465ab355b
* converted tcgaddrnode.pass_generate_code to use the high level code generator,
...
which makes the i8086 overridden class unnecessary
git-svn-id: trunk@27323 -
2014-03-28 16:19:49 +00:00
nickysn
ead05754b4
+ implemented hlcg.a_loadaddr_ref_reg for i8086, which uses tosize to determine whether the destination is a far pointer, instead of using the presence of ref.segment
...
git-svn-id: trunk@27321 -
2014-03-28 14:49:43 +00:00
nickysn
359bd9a13a
* fixed class name in comment
...
git-svn-id: trunk@27312 -
2014-03-28 00:16:03 +00:00
nickysn
26b53607f8
+ added method reference_reset_base with support for different pointer types to
...
the high level code generator. All hlcg code, except for the jvm code
generator, updated to use the new method. I didn't update jvm (it still uses
the method from cgutils), because I'm not familiar with that platform, so I
might get the types wrong.
git-svn-id: trunk@27309 -
2014-03-28 00:01:18 +00:00
nickysn
22acb2e44b
* moved the i8086 specific code from tpointerconstnode.create to the i8086
...
descendant class
git-svn-id: trunk@27285 -
2014-03-25 22:00:23 +00:00
nickysn
a9f56d2714
* refactored tcgtypeconvnode.second_ansistring_to_pchar to use the high level
...
code generator and work in all i8086 memory models. Removed the i8086-specific
overriden version.
git-svn-id: trunk@27278 -
2014-03-25 01:27:58 +00:00
nickysn
122f66b11a
+ support passing far addresses in tcg8086.a_loadaddr_ref_cgpara
...
git-svn-id: trunk@27276 -
2014-03-25 00:45:22 +00:00
nickysn
ee7a6dfc2e
* set the para sizes correctly for push_addr_params in i8086 far data memory
...
models. This breaks compilation of the system unit in the compact and large
memory models once again, but the generated code wasn't correct in the first
place, so it's not really a loss.
git-svn-id: trunk@27275 -
2014-03-25 00:40:48 +00:00
nickysn
3cd9cef182
+ added a far pointer aware implementation of hlcg.getaddressregister for i8086.
...
This should allow writing memory model independent code in the FPC code
generator.
git-svn-id: trunk@27274 -
2014-03-25 00:18:32 +00:00
nickysn
2b57a50233
* i8086 far data model implementation of typeconvnode.second_ansistring_to_pchar
...
git-svn-id: trunk@27248 -
2014-03-23 22:32:46 +00:00
florian
842e027a9f
+ prove of concept how FMA4 could be supported in inline assembler
...
git-svn-id: trunk@27214 -
2014-03-20 21:25:38 +00:00
florian
a79be2b05c
+ support for FMA instructions in inline assembler
...
+ extended avx test code with FMA
git-svn-id: trunk@27209 -
2014-03-20 20:06:56 +00:00
florian
aa107b914c
* merged avx2 branch, developed by Torsten Grundke
...
git-svn-id: trunk@27200 -
2014-03-20 12:03:52 +00:00
Jonas Maebe
73a3f5ced4
* moved ncgutil.maybechangeloadnodereg() to hlcg.maybe_change_load_node_reg()
...
and moved ifdef'd jvm code to overridden method
git-svn-id: trunk@27153 -
2014-03-16 11:24:40 +00:00
sergei
c003f934c5
* Included cs_opt_peephole into genericlevel1optimizerswitches, so it is re-enabled for all targets after r27106.
...
- Removed cs_opt_peephole from level1optimizerswicthes on i386 and i8086, it is redundant due to the above change.
git-svn-id: trunk@27147 -
2014-03-15 21:23:29 +00:00
sergei
9c54cdc85d
* x86: Cleaned out addr_far,addr_far_ref used to encode far calls/jumps. NASM (and FPC x86 assembler based on it) already have opsize=S_FAR for this purpose.
...
git-svn-id: trunk@27037 -
2014-03-08 22:54:43 +00:00
Jonas Maebe
81427523ab
* pass a list of (pointers to) the paralocs to hlcgobj.a_call/g_call*, as
...
required for the LLVM support (LLVM parameter support is not yet
included)
* always return the function return loc from a_call*, again as required
for the LLVM support
git-svn-id: branches/hlcgllvm@26992 -
2014-03-06 21:40:57 +00:00
Jonas Maebe
e9268a0a14
* synchronised with trunk up till r26975
...
git-svn-id: branches/hlcgllvm@26976 -
2014-03-06 21:36:58 +00:00
nickysn
cb0f7e265d
+ fixed get_frame for i8086 far data memory models
...
git-svn-id: trunk@26929 -
2014-03-02 19:36:35 +00:00
nickysn
b672bc754a
- rm references to system_i386_darwin and system_i386_iphonesim from
...
tcg8086.init_register_allocators
git-svn-id: trunk@26910 -
2014-03-01 12:52:31 +00:00
nickysn
a31b7d485f
* tcg8086.init_register_allocator: instantiate trgintcpu instead of trgcpu for
...
the integer registers in all cases
git-svn-id: trunk@26909 -
2014-03-01 12:50:26 +00:00
nickysn
fc29e10349
* allow the use of inc/dec when adding/subtracting 32 or 64-bit constants with
...
the highest word equal to one and the lower parts zero
git-svn-id: trunk@26907 -
2014-03-01 10:25:46 +00:00
florian
13cb468a8e
* fixed modification information for some avx instructions
...
git-svn-id: trunk@26840 -
2014-02-22 15:52:33 +00:00
florian
be0a29da95
* fix modification information for bmi instructions
...
git-svn-id: trunk@26738 -
2014-02-08 21:38:21 +00:00
Jonas Maebe
a1eb9a0f99
* fixed spilling of CMOVcc instruction: it "reads" operand two (in the sense
...
that the value of operand two is used/kept in case the condition is false)
(fixes mantis #25672 )
git-svn-id: trunk@26674 -
2014-02-05 00:27:21 +00:00
sergei
9c1f917e3a
* a_call_ref functionality cannot be implemented efficiently at code generator level, because references need specific preparations at earlier points. Moved this support to tcgcallnode and its x86 descendants, and got rid of all ifdef's around.
...
+ x86 targets now directly call procedure variables located in references.
- a_call_ref method removed from tcg and thlcgobj.
git-svn-id: trunk@26666 -
2014-02-03 13:28:56 +00:00
florian
8989a40b4f
* more flags to mark changes fixed
...
git-svn-id: trunk@26626 -
2014-01-30 17:34:28 +00:00
florian
2ec5a649d7
* set Ch_* for more operations
...
* Ch_* flags for VMOVSD and VMOVSS are now set for the 2 operand variants
git-svn-id: trunk@26586 -
2014-01-26 12:37:50 +00:00
nickysn
e83ef05b74
- disable cs_opt_nodecse from -O2 on i8086, because it breaks building packages
...
since r26579
git-svn-id: trunk@26583 -
2014-01-26 02:08:08 +00:00
nickysn
85dd9e5789
+ added a size parameter to optimize_op_const and do a sign extension of the 'a' parameter up from the specified size, so that things like (i and $ffffffff) get optimized away the same way as (i and -1)
...
git-svn-id: trunk@26561 -
2014-01-22 15:00:34 +00:00
florian
7028210817
+ tzcnt assembler instruction
...
git-svn-id: trunk@26506 -
2014-01-18 12:11:50 +00:00
nickysn
2602f379d7
* fixes in the 16 to 32-bit multiplication in ti8086addnode.second_mul
...
git-svn-id: trunk@26497 -
2014-01-18 00:38:46 +00:00
nickysn
3f4111ac37
* emit MUL instead of IMUL in ti8086addnode.second_mul when overflow checking is
...
off and the multiplication is 16->16
git-svn-id: trunk@26495 -
2014-01-17 23:04:46 +00:00
nickysn
529008e031
* emit MUL (when overflow checking is off), instead of IMUL for OP_IMUL in
...
tcg8086.a_op_const_reg, when the target CPU is 8086/8088, because it's
supposed to be faster on these processors, according to Intel's instruction
timings.
git-svn-id: trunk@26493 -
2014-01-17 21:23:42 +00:00
nickysn
767a0f1187
- rm TODO comment about the IMUL optimization with SHL from
...
tcg8086.a_op_const_reg, since that optimization is already done in
optimize_op_const, which is called earlier in the same method.
git-svn-id: trunk@26488 -
2014-01-17 10:28:30 +00:00
nickysn
1a846e7c71
- rm TODO comment for overflow checking from tcg8086.a_op_const_reg, since
...
overflow checking should not be implemented there. It should only leave the
flags in place for the jo instruction, which the IMUL instruction already
does.
git-svn-id: trunk@26487 -
2014-01-17 10:26:20 +00:00
nickysn
b8203a3406
* fixed tcg8086.gen_cmp32_jmp1 for the less than/greater than cases
...
git-svn-id: trunk@26370 -
2014-01-03 18:06:21 +00:00
nickysn
cf6f408214
+ implemented the tcg8086.a_cmp_*_*_label methods for i8086. How did the i8086
...
code generator even work without these?
git-svn-id: trunk@26362 -
2014-01-03 03:31:51 +00:00
nickysn
dcb9306de8
* perform the OP_AND, OP_OR and OP_XOR optimizations for 0 and $FFFF values
...
independently also in tcg8086.a_op_const_ref
git-svn-id: trunk@26345 -
2014-01-01 17:45:40 +00:00
nickysn
9a1e33d2a0
* tcg8086.a_op_const_reg: perform the OP_AND, OP_OR and OP_XOR optimizations for
...
$0000 and $FFFF values on the low and the high words independently.
git-svn-id: trunk@26344 -
2014-01-01 14:57:44 +00:00
nickysn
9eb4419ba3
* fixed the conversion and assignment to the 64-bit boolean types on the i8086
...
git-svn-id: trunk@26343 -
2013-12-31 17:18:20 +00:00
nickysn
974fea30b2
* use only one temporary 16-bit register, instead of two in tcg8086.g_flags2ref
...
when the target ref is 32-bit.
git-svn-id: trunk@26342 -
2013-12-31 16:27:11 +00:00
nickysn
bda163544a
* tcg8086.g_flags2reg: restore the register back to the original size after the
...
16-bit inc
git-svn-id: trunk@26337 -
2013-12-31 13:15:30 +00:00
nickysn
fbd05c4e12
* Improved code generation in tcg8086.g_flags2reg for the case when target reg
...
size is >=16-bit:
o Generated code is now one instruction and one byte shorter.
o No 8-bit subregisters are used, which reduces register pressure.
git-svn-id: trunk@26336 -
2013-12-31 11:31:23 +00:00
nickysn
d57d982be7
* simpler handling of moves from a smaller to a larger cgsize in
...
tcg8086.a_load_reg_ref, which additionally fixes the following issues:
o The higher parts of the source register is no longer modified.
o The source register's size is no longer modified with makeregsize.
o Conversion from OS_S8 to a larger size is now supported.
git-svn-id: trunk@26335 -
2013-12-31 00:33:37 +00:00
nickysn
5d0814016d
* improvements and fixes in tcg8086.a_load_reg_reg and .a_load_ref_reg:
...
o When expanding from a OS_8 to a 16-bit or 32-bit tcgsize, use the R_SUBH
subregister to initialize the high 16 bits of the register to zero. This
generates shorter and faster code, without increasing register
interferences, because R_SUBH has the same register constraints on i8086 as
R_SUBL, which is already used on the same imaginary register.
o After performing operations on the 8-bit subparts of a register that was
initially 16-bit, call makeregsize(OS_16) to notify the register allocator
that the register is once again 16-bit.
git-svn-id: trunk@26328 -
2013-12-30 21:20:10 +00:00
nickysn
6d48b32115
* fixes and improvements in tcg8086.a_load_reg_reg for the case when the src and
...
dest are subregisters of the same superregister, but of different sizes:
o Do not emit spurious moves from a register to the same register.
o Correctly support the case when converting from 16-bit to 32-bit int.
Previously it didn't work correctly, because in this particular case, due
to the way the GetNextReg scheme works, we have reg1=reg2.
git-svn-id: trunk@26313 -
2013-12-29 17:15:58 +00:00
nickysn
fdd36b4603
* on i8086 with regvars on, do not notify the register allocator of moves to BX.
...
This fixes compilation of unit math (and the whole RTL) with regvars enabled.
git-svn-id: trunk@26282 -
2013-12-25 12:19:21 +00:00
Jonas Maebe
386cda95b7
* synchronised with trunk up to r26077
...
git-svn-id: branches/hlcgllvm@26078 -
2013-11-13 13:12:49 +00:00
nickysn
dc432918da
+ enabled the use of the DIV/IDIV instruction for 16-bit div/mod on i8086
...
* ti8086.moddivnode.pass_generate_code: use cg.a_op_const_reg, instead of
emit_const_reg, in order to support generating plain 8086/8088 code
(shr/shl/sar reg,const is 186+ if const is >= 2).
git-svn-id: trunk@26063 -
2013-11-11 22:34:41 +00:00
nickysn
bd083c0b8e
* ti8086moddivnode.pass_generate_code converted to 16-bit. Note that this code
...
is still not active, due to the cpuneedsdiv32helper define, but will
eventually be enabled for 16-bit divisions.
git-svn-id: trunk@26062 -
2013-11-11 21:01:13 +00:00
Jonas Maebe
99de108c68
* renamed all paramanagers to tcpuparamanager so the llvm paramanager can
...
derive from them without ifdefs
git-svn-id: branches/hlcgllvm@26039 -
2013-11-11 11:15:27 +00:00
nickysn
039979fdcc
* handle 4-byte records in registers as well in location_force_mem on i8086
...
git-svn-id: trunk@26002 -
2013-11-09 21:57:29 +00:00
florian
f132a804d6
+ handle 32 bit references on x86-64 so lea can be used for 32 bit arithmetics
...
git-svn-id: trunk@25909 -
2013-11-01 19:01:39 +00:00
nickysn
8bfe2a56dd
* optimized SAR by 31 to use only one SAR instruction in tcg8086.a_op_const_reg
...
git-svn-id: trunk@25883 -
2013-10-30 16:53:59 +00:00
nickysn
645cd11b9d
* fixed the assignment of global functions to nested procvars in i8086 far code
...
models
git-svn-id: trunk@25831 -
2013-10-19 20:42:39 +00:00
nickysn
bfd31e7516
* optimizations in tcg8086.g_copyvaluepara_openarray:
...
- when elesize=2, avoid the SHR CX,1 instruction
- use rep movsw even for odd elesizes, unless cs_opt_size is set
git-svn-id: trunk@25829 -
2013-10-19 15:07:55 +00:00
nickysn
0f69362edd
- rm LEA reg,imm from x86ins.dat, as that's not a valid x86 instruction,
...
using it in inline asm causes an internal error and removing it didn't show
any regressions after running the testsuite on i386-linux.
git-svn-id: trunk@25827 -
2013-10-18 23:26:58 +00:00
nickysn
ff9ce0d20d
* tcg8086.g_copyvaluepara_openarray improvements:
...
- use a_op_const_reg for the multiplication, instead of emitting directly
instructions, which are 186+
- avoid using IMUL twice, when the element size is not power of two
- rm the system_i386_win32 leftovers
git-svn-id: trunk@25826 -
2013-10-18 22:35:51 +00:00
nickysn
7e7ab2fd4d
* also handle nested proc ptrs in thlcgcpu.location_force_mem on i8086
...
git-svn-id: trunk@25824 -
2013-10-18 20:09:01 +00:00
nickysn
ef51c8c5a2
* fixed the interface wrapper code generation for virtual methods on i8086 in
...
the medium memory model
git-svn-id: trunk@25817 -
2013-10-18 12:11:50 +00:00
nickysn
116d3746ca
* fixed the stack offset to the self parameter when generating an interface
...
wrapper for a virtual method in tcg8086.g_intf_wrapper
git-svn-id: trunk@25816 -
2013-10-18 10:56:04 +00:00
nickysn
83aa50de74
* emit a far jmp in the interface wrapper on i8086 in far code memory models
...
git-svn-id: trunk@25812 -
2013-10-17 21:55:45 +00:00
nickysn
4aa010eedc
+ support LEA with 16-bit operand size
...
git-svn-id: trunk@25808 -
2013-10-17 16:11:08 +00:00
nickysn
814e1297ed
* tcg8086.g_adjust_self_value fixed for far code memory models
...
git-svn-id: trunk@25798 -
2013-10-15 23:34:18 +00:00
nickysn
f6e846c574
+ added the NEC V20/V30 instructions
...
git-svn-id: trunk@25750 -
2013-10-11 21:27:56 +00:00
nickysn
0aff18ac61
+ implemented tcg64f8086.a_op64_ref_reg
...
git-svn-id: trunk@25707 -
2013-10-07 00:17:03 +00:00
nickysn
3cdbf9a805
+ implemented tcg64f8086.a_op64_const_ref
...
git-svn-id: trunk@25706 -
2013-10-06 23:56:25 +00:00
nickysn
3bdd3d9a4e
+ optimization in tcg64f8086.a_op64_const_reg for OP_ADD and OP_SUB when the
...
lowest 48, 32 or 16 bits of the constant are zeros
git-svn-id: trunk@25705 -
2013-10-06 23:43:38 +00:00
nickysn
88c7ca96c5
+ optimization in tcg8086.a_op_const_reg and .a_op_const_ref for 32-bit OP_ADD
...
and OP_SUB when the low 16 bits of the const are 0
git-svn-id: trunk@25704 -
2013-10-06 23:23:06 +00:00
nickysn
8f44e729cc
* tcg8086.a_op_const_ref and .a_op_const_reg: when splitting a 32-bit OP_AND,
...
OP_OR or OP_XOR operation into two 16-bit parts, call a_op_const_reg/ref
recursively for the 16-bit parts, so certain optimizations can be done if the
low or high 16-bit of the const are $ffff.
git-svn-id: trunk@25703 -
2013-10-06 23:02:07 +00:00
svenbarth
c48d572996
Implement support for saving and restoring address registers.
...
cgobj.pas, tcg:
* g_save_registers: add the amount of used address registers to size as well
* g_save_registers: save all used address registers
* g_restore_registers: restore all stored address registers
m68k/cpubase.pas:
* rename saved_standard_address_registers to saved_address_registers
all other platform's cpubase.{inc,pas} (except alpha, ia64 and vis which are not up to date):
* add a saved_address_registers variable with one entry of RS_INVALID
At least a "make fullcycle" did complete.
git-svn-id: trunk@25664 -
2013-10-05 21:43:42 +00:00
sergei
5af873ee5b
* x86 targets: Profiling shows that quite a bit of time is spent in findreg_by_number(), despite it uses binary search. Worse, it is repeated for every piece of register information. Trying to get rid of some of these calls: rearranged registers so that their "opcode" matches 3 LSBs of superregister number (with a few exceptions described at the beginning of x86reg.dat). This allows to lookup opcodes in regval() with O(1) complexity, and removes need in rXXXop.inc files.
...
git-svn-id: trunk@25627 -
2013-10-03 08:08:04 +00:00
nickysn
4929bc5694
* regenerated the i8086 ins files
...
git-svn-id: trunk@25603 -
2013-09-28 21:10:23 +00:00
nickysn
bd0585274e
* tsettings.enablecld converted to a targetswitch ts_cld
...
git-svn-id: trunk@25592 -
2013-09-28 13:41:58 +00:00
nickysn
52fcc0a407
+ added a new x86-specific compiler option 'enablecld', which controls whether
...
the compiler should emit a CLD before using the x86 string instructions.
git-svn-id: trunk@25590 -
2013-09-28 11:54:02 +00:00
nickysn
1f783f539c
* emit a cld instruction before the rep movsXX in tcg8086.g_copyvaluepara_openarray as well
...
git-svn-id: trunk@25556 -
2013-09-24 20:09:11 +00:00
nickysn
a04cbc09b0
* changed the default i8086 asmmode to Intel
...
git-svn-id: trunk@25531 -
2013-09-21 18:43:34 +00:00
nickysn
6aae88578c
+ getting the address of a label now returns a far pointer in i8086 far code memory models; this fixes the call to fpc_raiseexception in the raise node
...
git-svn-id: trunk@25517 -
2013-09-17 22:45:13 +00:00
nickysn
a5284881f5
+ support 6-byte records in registers in thlcgcpu.location_force_mem on the i8086; this fixes the handling of methodpointers typecasted to record (TMethod) in medium and compact memory models
...
git-svn-id: trunk@25500 -
2013-09-16 16:24:00 +00:00
nickysn
b327eac688
- disable cs_opt_regvar from -O2 on i8086, since it's not working properly yet
...
git-svn-id: trunk@25364 -
2013-08-24 23:06:10 +00:00
florian
11ff8a4ec1
+ support register parameters with multiple locations
...
git-svn-id: trunk@25238 -
2013-08-11 16:12:39 +00:00
nickysn
a5517cd3d4
* SI and DI removed from the i8086 saved_standard_registers list, because they are volatile in TP7's default calling convention
...
git-svn-id: trunk@25231 -
2013-08-09 12:21:30 +00:00
florian
57d4185d44
* allocate/deallocate cpu registers as late/early as possible, this gives the reg. allocator more flexibility
...
git-svn-id: trunk@25229 -
2013-08-08 20:55:45 +00:00
sergei
a21a20d559
+ i8086-specific version of g_stackpointer_alloc.
...
git-svn-id: trunk@25219 -
2013-08-06 08:11:39 +00:00
nickysn
42e82c9de3
* when a i8086 reference uses only one register, choose it from the set [BX,BP,SI,DI] as it can be treated either as a base or an index, depending on what's convenient
...
git-svn-id: trunk@25183 -
2013-07-29 21:03:10 +00:00
nickysn
2e97de9522
+ added an i8086 specific override of thlcgcpu.location_force_mem, which handles 6-byte (medium/compact memory model) method pointers
...
git-svn-id: trunk@25151 -
2013-07-20 19:40:27 +00:00
nickysn
f5a0702f9a
+ added i8086 specific implementation of Tcgtypeconvnode.second_nil_to_methodprocvar, which supports memory models with far code and/or far data
...
git-svn-id: trunk@25150 -
2013-07-20 16:58:41 +00:00
nickysn
4b93fa1323
* set all the i8086 calling conventions' volatile registers to be the same as the 'pascal' calling convention; this should make cdecl compatible with 16-bit C compilers
...
git-svn-id: trunk@25128 -
2013-07-18 21:01:41 +00:00
nickysn
2a64ba0ad3
* do a 32-bit comparison on far and huge pointers
...
git-svn-id: trunk@25110 -
2013-07-16 07:57:49 +00:00
nickysn
e291805880
* i8086 compilation fixed after r24896
...
git-svn-id: trunk@24902 -
2013-06-15 10:33:18 +00:00
nickysn
70dbd7f667
* far pointer aware conversion of method pointer to plain procvar
...
git-svn-id: trunk@24863 -
2013-06-10 09:56:45 +00:00
nickysn
b342588af1
+ i8086 specific far proc aware implementation of ttypeconvnode.second_proc_to_procvar
...
git-svn-id: trunk@24860 -
2013-06-10 01:19:01 +00:00
nickysn
b81f0ab50d
+ implemented tcg8086.a_call_reg_far; very hacky, but still better than doing a near call, when it should be far
...
git-svn-id: trunk@24856 -
2013-06-09 22:16:40 +00:00
nickysn
604b7c9deb
+ added cg.a_call_ref_near and a_call_ref_far
...
git-svn-id: trunk@24853 -
2013-06-09 20:22:47 +00:00
nickysn
af54de6d56
+ added tcg8086.a_call_name_far and .a_call_name_static_far; a_call_name and a_call_name_static overriden and call near or far depending on the memory model
...
git-svn-id: trunk@24828 -
2013-06-09 10:54:30 +00:00
nickysn
6fdd48878f
* adjust parameters of far procedures for the extra segment that's pushed on the stack by the far call instruction
...
git-svn-id: trunk@24818 -
2013-06-08 20:42:13 +00:00
nickysn
aa63efc27e
* emit a far ret instruction in the exit code of far procedures
...
git-svn-id: trunk@24817 -
2013-06-08 20:40:50 +00:00
nickysn
a9c949e551
* the memory model const sets introduced in r24812 moved to i8086/cpuinfo.pas
...
git-svn-id: trunk@24816 -
2013-06-08 19:52:28 +00:00
Jonas Maebe
7f2750f188
* missing part of r24776, using a build server also has pitfalls :/
...
git-svn-id: trunk@24777 -
2013-06-02 14:35:29 +00:00
nickysn
75451181c9
* fixed the passing of the extended floating type parameters on i8086 after r24761
...
git-svn-id: trunk@24766 -
2013-06-02 12:03:16 +00:00
Jonas Maebe
7566ddcc8f
* add a tdef to each parameter location and set it for all target
...
backends (not yet used, will be used in high level code generator)
git-svn-id: trunk@24761 -
2013-06-02 10:24:02 +00:00
nickysn
e2241d97a2
* i8086 optimizations for 32-bit OP_SAR with const >= 16
...
git-svn-id: trunk@24757 -
2013-06-02 09:35:30 +00:00
nickysn
55a071692e
* i8086 optimizations in op_const_reg for 32-bit OP_SHL and OP_SHR with const >= 16
...
git-svn-id: trunk@24756 -
2013-06-02 08:58:50 +00:00
nickysn
ec76b2cf40
* refactored the segment-in-integer-register reference support, so it's handled in make_simple_ref, instead of all over the place in the code generator
...
git-svn-id: trunk@24752 -
2013-06-01 22:18:09 +00:00
nickysn
1e8b192b3d
* support far references in second_cmp32bit for i8086
...
git-svn-id: trunk@24736 -
2013-06-01 17:51:18 +00:00
nickysn
e243b6b869
* never use the 66h prefix when pushing/popping segment registers on i8086, as the stack is aligned on 2 bytes there
...
git-svn-id: trunk@24729 -
2013-06-01 16:03:14 +00:00
nickysn
c2e3fb5918
+ emit proper interrupt procedure entry/exit code on i8086
...
git-svn-id: trunk@24728 -
2013-06-01 15:50:11 +00:00
nickysn
10b3ce1ba5
* fixed an opsize bug in ti8086addnode.second_add64bit, which caused 32-bit instructions to be emitted
...
git-svn-id: trunk@24670 -
2013-05-31 17:13:38 +00:00
nickysn
c271594b4f
+ optimized implementation of 32-bit OP_SHL,OP_SHR and OP_SAR in tcg8086.a_op_const_reg
...
git-svn-id: trunk@24660 -
2013-05-31 11:03:36 +00:00
nickysn
125a6a8720
* register id of (e)flags changed, so it doesn't overlap with dr0
...
git-svn-id: trunk@24647 -
2013-05-30 16:40:59 +00:00
nickysn
06838be452
* fixed bug when passing a 'single' floating point type parameter via tcg8086.a_load_ref_cgpara
...
git-svn-id: trunk@24592 -
2013-05-25 13:37:24 +00:00
nickysn
27adafeecb
+ support moving from a shorter unsigned (sign extension not yet implemented) to a longer type in tcg8086.a_load_reg_ref
...
git-svn-id: trunk@24589 -
2013-05-25 12:05:02 +00:00
nickysn
3aeea835f9
+ int register in treference.segment support in tcg8086.op_*ref*
...
git-svn-id: trunk@24586 -
2013-05-24 19:57:02 +00:00
florian
c1a1325a72
* reduce register pressure by allocating/deallocating registers as late/early as possible
...
git-svn-id: trunk@24581 -
2013-05-24 18:09:15 +00:00
nickysn
a308994423
* i8086 specific code from tcgpointerconstnode.pass_generate_code moved to an i8086 specific overriden method
...
git-svn-id: trunk@24577 -
2013-05-24 17:16:55 +00:00
nickysn
8b1e621665
* segment in int register support added also to tcg8086.a_load_reg_ref and .a_load_ref_reg
...
git-svn-id: trunk@24570 -
2013-05-24 14:46:40 +00:00
nickysn
9171c19601
* support int register in treference.segment in tcg8086.a_load_const_ref; this fixes farptr^:=const
...
git-svn-id: trunk@24569 -
2013-05-24 13:36:22 +00:00
nickysn
fd429612f8
+ initial (and not yet fully complete) implementation of far pointers on the i8086
...
git-svn-id: trunk@24553 -
2013-05-22 16:26:33 +00:00
nickysn
ecb5a4866d
* refactored the int64 result passing in ax:bx:cx:dx to use 4 paralocs, instead of the GetNextReg hack
...
git-svn-id: trunk@24527 -
2013-05-19 12:50:15 +00:00
nickysn
3665ed4b03
+ enabled returning int64 in ax:bx:cx:dx for the i8086
...
git-svn-id: trunk@24502 -
2013-05-14 22:45:57 +00:00
nickysn
d433408a7d
-rm BX from i8086's saved_stadard_registers array, as it interferes with returning int64 in ax:bx:cx:dx and it shouldn't be saved anyway
...
git-svn-id: trunk@24501 -
2013-05-14 22:32:02 +00:00
nickysn
8fea00d8f5
- rm NR_PIC_OFFSET_REG from i8086/cpubase.inc, because it isn't used (and shouldn't be used) on the i8086
...
git-svn-id: trunk@24500 -
2013-05-14 22:22:24 +00:00
nickysn
2557382815
- rm tcg8086.g_maybe_got_init as it's of no use for the i8086
...
git-svn-id: trunk@24499 -
2013-05-14 22:20:04 +00:00
nickysn
6b2f59c3e0
+ preparations for returning int64 in ax:bx:cx:dx on i8086
...
git-svn-id: trunk@24498 -
2013-05-14 22:19:17 +00:00
nickysn
c4dd85a0eb
+ implemented tcg8086.a_op_reg_ref
...
git-svn-id: trunk@24474 -
2013-05-08 11:49:39 +00:00
nickysn
85b98671bd
+ implemented tcg8086.a_op_const_ref for op_add/and/or/sub/xor/move/none; this fixes inc(longint) among other things
...
git-svn-id: trunk@24473 -
2013-05-08 08:23:46 +00:00
nickysn
2d67a3169d
* i8086 fixes in tcg8086.g_copyvaluepara_openarray
...
git-svn-id: trunk@24467 -
2013-05-07 22:34:26 +00:00
nickysn
502c2ffb94
* fixed tcg8086.a_load_reg_reg when doing an unsigned extension in the same superregister; this fixes the taddbool test
...
git-svn-id: trunk@24466 -
2013-05-07 21:20:40 +00:00
nickysn
5a4a3cbbc3
+ implemented tcg8086.a_op_ref_reg; supports op_add/sub/xor/or/and
...
git-svn-id: trunk@24464 -
2013-05-07 19:19:55 +00:00
nickysn
b0f7786782
+ added support for special versions of near data pointers associated with a x86 segment register. They are supported on all x86 platforms: i8086, i386 and x86_64
...
git-svn-id: trunk@24453 -
2013-05-05 17:22:37 +00:00
nickysn
4527fe8fa2
+ added 8086 workaround for the 'imul reg,const' 186+ instruction. The compiler can now generate strict 8086/8088 code.
...
git-svn-id: trunk@24404 -
2013-05-01 19:18:12 +00:00
florian
19c8abac0b
+ enable jump optimizer for i8086
...
git-svn-id: trunk@24400 -
2013-05-01 13:54:13 +00:00
nickysn
8fddb1361b
* got rid of push const also in tcg8086.a_loadaddr_ref_cgpara
...
git-svn-id: trunk@24384 -
2013-04-29 23:13:09 +00:00
nickysn
cfc3c6ec5d
- cleanup tcg8086.a_loadaddr_ref_cgpara from unused code left over from i386
...
git-svn-id: trunk@24383 -
2013-04-29 23:08:12 +00:00
nickysn
76e3dd5cef
* do not generate push const on the i8086, go through a register instead, unless it's 186+
...
git-svn-id: trunk@24381 -
2013-04-29 22:29:26 +00:00
nickysn
06f1b6a4e8
* moved the i8086 'push const' instructions to a new method, so they can be abstracted on pre-186 processors
...
git-svn-id: trunk@24380 -
2013-04-29 21:53:55 +00:00
nickysn
7c0679efdb
* use the 'leave' instruction on 80186+
...
git-svn-id: trunk@24378 -
2013-04-29 19:45:39 +00:00
nickysn
3853d06ac0
+ added n8086cal.pas, based on n386cal.pas; this pulls in nx86cal.pas as well and fixes compilation of the system unit on i8086 after the merge of the i8086 branch to trunk
...
git-svn-id: trunk@24335 -
2013-04-26 20:19:57 +00:00
nickysn
28c05c1ed5
* document the fact that ti8086paramanager.getintparaloc allocates a 16-bit parameter, and not a 32-bit one
...
git-svn-id: branches/i8086@24255 -
2013-04-15 22:08:11 +00:00
nickysn
8ce2f0c56b
- rm the i386 specific code from ti8086paramanager.ret_in_param
...
git-svn-id: branches/i8086@24239 -
2013-04-14 14:43:42 +00:00
nickysn
c916105db8
- rm ti8086procinfo.allocate_got_register as it isn't used on the i8086
...
git-svn-id: branches/i8086@24238 -
2013-04-14 14:35:51 +00:00
nickysn
97ca0fa323
- removed ti8086inlinenode.second_round_real, second_trunc_real and load_fpu_location as they mostly repeat the code in tx86inlinenode.load_fpu_location; tx86inlinenode.load_fpu_location adapted for i8086 instead
...
git-svn-id: branches/i8086@24237 -
2013-04-14 14:25:22 +00:00
nickysn
107a6f6552
* i8086 versions of i386*.inc and r386*.inc renamed to i8086*.inc and r8086*.inc
...
git-svn-id: branches/i8086@24232 -
2013-04-12 12:06:28 +00:00
nickysn
4d8adbf5ff
+ implemented Seg() for i8086 (small/tiny memory model)
...
git-svn-id: branches/i8086@24071 -
2013-03-30 13:04:58 +00:00
nickysn
af5614e52d
* i8086 parameter alignment fixes
...
git-svn-id: branches/i8086@23978 -
2013-03-24 20:15:39 +00:00
nickysn
7b9fd7b9f4
* instruction size fixes in tcg8086.g_intf_wrapper
...
git-svn-id: branches/i8086@23925 -
2013-03-18 13:07:05 +00:00
nickysn
c4cee15481
* bug fix in tcg8086.a_load_reg_reg for loading larger register to a smaller one
...
git-svn-id: branches/i8086@23914 -
2013-03-18 01:03:37 +00:00
nickysn
43dba74a5c
+ implemented 64-bit shl and shr for i8086
...
git-svn-id: branches/i8086@23882 -
2013-03-17 02:11:25 +00:00
florian
636129ed8c
* fix interface wrapper generation for i8086
...
git-svn-id: branches/i8086@23873 -
2013-03-16 19:57:36 +00:00
nickysn
5dd5add67a
* proper implementation of ti8086addnode.second_cmp64bit
...
git-svn-id: branches/i8086@23871 -
2013-03-16 19:01:15 +00:00
nickysn
56d2830beb
+ implemented 32-bit comparisons on the i8086
...
git-svn-id: branches/i8086@23870 -
2013-03-16 18:13:11 +00:00
florian
edd4c1ce4b
* proper fix to avoid sp relative adressing as r23867 tries
...
git-svn-id: branches/i8086@23868 -
2013-03-16 16:51:31 +00:00