nickysn
b92b0eac83
* also improve the code, generated for signed division by 2 on i8086, when
...
optimize cpu target is 486+, by replacing the sequence
sar reg, 15
and reg, 1
with:
shr reg, 15
git-svn-id: trunk@36807 -
2017-07-28 15:38:40 +00:00
nickysn
bb7cd4866d
* corrected comment in x86 division code - it said "signed", when it actually meant "negative"
...
git-svn-id: trunk@36799 -
2017-07-27 15:04:56 +00:00
pierre
8b6563bef2
Generate error if stack size of a procedure/function is bigger than globally allocated stack size
...
git-svn-id: trunk@36506 -
2017-06-16 07:47:17 +00:00
florian
912e6d129a
* fix modification flags for *ROUND*
...
git-svn-id: trunk@36280 -
2017-05-21 11:12:57 +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
4a43d992f5
* unified usage of MatchOpType
...
* fixed generic MatchOpType
git-svn-id: trunk@36145 -
2017-05-07 16:18:33 +00:00
nickysn
af48d176ec
+ precise flag information for the ucomiss,ucomisd,vucomiss and vucomisd x86 instructions
...
git-svn-id: trunk@36115 -
2017-05-05 13:41:43 +00:00
nickysn
4e4e5d6d07
+ allocate and free the flags register (when necessary), when generating code
...
for OP_SHR,OP_SHL and OP_SAR in tcg64f8086.a_op64_const_reg
git-svn-id: trunk@36021 -
2017-04-30 01:25:54 +00:00
nickysn
b8c4dd9e18
+ implemented 64-bit OP_SHR,OP_SHL and OP_SAR in a_op64_reg_reg for i8086 and
...
use it in the shl/shr node for code generation.
git-svn-id: trunk@36018 -
2017-04-29 21:57:48 +00:00
nickysn
a82c89d894
+ implemented OP_SHR,OP_SHL and OP_SAR in a_op64_const_reg for i8086. The shlshr
...
node now uses them for 64-bit shift by constant.
git-svn-id: trunk@36017 -
2017-04-29 20:58:55 +00:00
nickysn
aee000a773
* i8086's TCpuAsmOptimizer made a descendant of TX86AsmOptimizer
...
git-svn-id: trunk@35985 -
2017-04-27 18:22:14 +00:00
nickysn
ff1ee6836d
+ fix RegReadByInstruction for the x86 MOVSD instruction
...
git-svn-id: trunk@35968 -
2017-04-27 14:42:08 +00:00
nickysn
c8487c4150
+ added individual bits of the x86 flags register as subregisters
...
git-svn-id: trunk@35955 -
2017-04-26 13:52:52 +00:00
nickysn
5f66f5cebb
+ distinguish between x86 flags subregisters: flags, eflags and rflags
...
git-svn-id: trunk@35953 -
2017-04-25 16:10:43 +00:00
nickysn
65977f9f27
+ implemented OP_ROL and OP_ROR in tcg8086.a_op_reg_reg and .a_op_reg_ref
...
git-svn-id: trunk@35952 -
2017-04-25 13:46:20 +00:00
nickysn
8c200fcfba
+ implemented OP_SHR,OP_SHL,OP_SAR,OP_ROL and OP_ROR in tcg8086.a_op_const_ref
...
git-svn-id: trunk@35945 -
2017-04-25 11:06:12 +00:00
nickysn
50b1c9c088
+ implemented 32-bit OP_SHR,OP_SHL and OP_SAR in tcg8086.a_op_reg_ref
...
git-svn-id: trunk@35935 -
2017-04-24 13:43:18 +00:00
nickysn
0c244046a9
* proper register change info for the movs,cmps and scas x86 string instructions
...
(movsd still todo, because of the overlap with the sse2 instruction)
git-svn-id: trunk@35929 -
2017-04-23 21:30:25 +00:00
nickysn
1d34e96064
+ added x86 instruction flag Ch_RFLAGScc, indicating instructions that read
...
specific bits from the flags register, according to their condition (used by
Jcc/SETcc/CMOVcc)
git-svn-id: trunk@35907 -
2017-04-22 22:07:05 +00:00
nickysn
1146b7c12c
+ added detailed information for individual flag bits use for most x86
...
instructions. Not used by the compiler yet, but may allow more
optimizations in the future.
git-svn-id: trunk@35882 -
2017-04-21 23:03:33 +00:00
nickysn
869f395a31
+ added knowledge to the compiler for the x86 instructions, that don't read
...
their input registers, in case both parameters are the same register (e.g.
xor eax, eax; sub eax, eax; etc.)
git-svn-id: trunk@35861 -
2017-04-20 15:11:56 +00:00
nickysn
328d546155
+ extend the i8086 peephole optimization that converts certain sequences to lds
...
and les instructions to also support the lss, lfs and lgs instructions on i386
(won't be generated by the current code generator, but might become useful in
the future, if we start using the fs and gs segment registers as well)
git-svn-id: trunk@35858 -
2017-04-20 13:00:26 +00:00
nickysn
12a1ad66b2
+ added the Ch_RDirFlag change attribute to the STOSx instructions (previously
...
was missing, due to the 3 attributes per instruction limit)
git-svn-id: trunk@35855 -
2017-04-19 20:23:24 +00:00
nickysn
9303a8f61a
* changed the x86 TInsProp.Ch structure from a 3-element array to a pascal set;
...
this removes the limit of 3 Ch_XXX flags per instruction (thus allowing adding
more precise flags, e.g. for tracking only certain bits of the flags register,
etc.) and avoids the ugliness of having the Ch_None filler, which makes
x86ins.dat less readable.
git-svn-id: trunk@35850 -
2017-04-19 16:48:35 +00:00
nickysn
189e49998c
* fixes to the x86 instruction flags tracking attributes:
...
* AAA and AAS also read flags (AF)
* CMC reads and writes flags (it inverts CF)
* CMPSx and SCASx write flags
* CMPSx, SCASx, LODSx, STOSx, MOVSx read the direction flag
* NOT doesn't affect flags
* REP isn't affected by and doesn't affect flags
* REPE/REPNE/REPZ/REPNZ/REPC/REPNC don't write flags, only read them
* ROL and ROR don't read flags
* SAL doesn't read flags
* SHLD and SHRD don't read flags
git-svn-id: trunk@35849 -
2017-04-19 15:42:50 +00:00
nickysn
7ee0c07b8d
+ added flags register tracking for many i8086 operations
...
git-svn-id: trunk@35848 -
2017-04-19 13:46:20 +00:00
nickysn
256dc546ac
+ implemented the in_neg_assign_x and in_not_assign_x inline nodes, which will
...
be used (TBD in a future commit) for optimizing x:=-x and x:=not x on CPUs
that support performing these operations directly in memory (such as x86)
git-svn-id: trunk@35749 -
2017-04-07 16:02:40 +00:00
nickysn
9093047a7a
* fixed a bug in the i8086 32-bit rol/ror code generation method rm_fast_386
...
git-svn-id: trunk@35745 -
2017-04-06 15:55:43 +00:00
nickysn
1560f20e7f
+ implemented other 32-bit rol/ror by const methods for i8086 and added a
...
(hopefully) reasonable selection for them for all consts between 1 and 31
git-svn-id: trunk@35744 -
2017-04-06 15:41:39 +00:00
nickysn
0fd860d9e7
* refactored the code generation for 32-bit rol/ror by const for i8086, so it
...
uses less code repetition and allow choosing various methods (some of which
will be implemented later and selected, according to the cpu and optimization
settings (size vs speed))
git-svn-id: trunk@35743 -
2017-04-06 13:59:53 +00:00
nickysn
d5e33cce7f
* generate better i8086 code for ror32 by 1 and 17
...
git-svn-id: trunk@35741 -
2017-04-05 14:16:00 +00:00
nickysn
321876252b
+ enabled the rol/ror intrinsic on i8086
...
git-svn-id: trunk@35734 -
2017-04-04 22:37:58 +00:00
nickysn
b957b65ec8
* generate better i8086 code for 64-bit shl/shr, by masking the shift count by 63
...
git-svn-id: trunk@35730 -
2017-04-04 17:58:00 +00:00
nickysn
76cb419241
* use 16-bit 386+ instructions (shld,shrd) for performing fast 32-bit
...
shl/shr/sar on i8086, in a_op_const_reg, when the target CPU is set to 80386
or later
git-svn-id: trunk@35726 -
2017-04-04 14:40:29 +00:00
nickysn
0ab4f01668
* implemented fast (loopless) 32-bit shift by constant for 8086 as well
...
git-svn-id: trunk@35725 -
2017-04-03 21:04:59 +00:00
nickysn
0f2ad7b712
* generate faster (i.e. loopless) code for 32-bit shl/shr/sar by const on 186+
...
git-svn-id: trunk@35723 -
2017-04-03 20:37:21 +00:00
nickysn
f0a63fa895
+ added an optimized implementation of a_op64_reg_ref for i8086; this improves
...
the generated code on i8086 for things like inc(int64_var,int64_var) and
dec(int64_var,int64_var)
git-svn-id: trunk@35657 -
2017-03-25 18:45:31 +00:00
Jonas Maebe
880d438704
* renamed t<cpuname>procinfo to tcpuprocinfo for all targets, so we can
...
inherit from it for LLVM without a thousand ifdefs
git-svn-id: trunk@35141 -
2016-12-16 22:41:21 +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
sergei
133fcb5ab2
* Fixed VMOVQ instruction encoding, now assembles correctly also in 32-bit code.
...
+ Test
git-svn-id: trunk@34949 -
2016-11-21 13:59:44 +00:00
sergei
ebe134febc
* Fixed memory reference size for MOVSS instruction, Mantis #29954 .
...
git-svn-id: trunk@34943 -
2016-11-21 03:31:25 +00:00
sergei
870fda34d5
* x86 AT&T reader and writer: cleaned up usage of attsufMM suffix:
...
* It is now only used to select size of vector instructions (i.e. 128 or 256 bits)
* Scalar instructions reverted to use attsufINT suffix (selecting between 32 or 64 bits).
* Additionally, vcvtsi2sd and vcvtsi2ss with rm64 operand are x86_64 only.
git-svn-id: trunk@34942 -
2016-11-21 02:07:13 +00:00
sergei
edf943a4f6
* Changed memory operand size for VMOVSS instruction to 32 bits, Mantis #29957 .
...
git-svn-id: trunk@34918 -
2016-11-18 23:37:01 +00:00
florian
56252d59f0
+ support for the PREFETCHTW1 instruction based on a patch by Emelyanov Roman, resolves #30933
...
git-svn-id: trunk@34917 -
2016-11-18 20:19:39 +00:00
pierre
abaea9959f
Fix parameter loading of FPC_CHECKPOINTER to handle correctly references with offsets
...
git-svn-id: trunk@34743 -
2016-10-18 21:48:59 +00:00
nickysn
35b0201002
+ added an unsigned counterpart to tpointerdef.pointer_arithmetic_it_type (needed by inc/dec)
...
git-svn-id: trunk@34653 -
2016-10-08 11:45:24 +00:00
nickysn
f76722b6c3
* fixed i8086's tcpupointerdef.pointer_arithmetic_int_type and
...
.pointer_subtraction_result_type methods after r34607
git-svn-id: trunk@34613 -
2016-10-04 00:06:50 +00:00
nickysn
481a8ec58d
* for pointers, converted to arrays, use a newly added virtual method
...
tpointerdef.converted_pointer_to_array_range_type to obtain their integer
range type, instead of using ptrsinttype
git-svn-id: trunk@34612 -
2016-10-04 00:01:06 +00:00
svenbarth
c8202061dc
* get rid of addr_load_indirect again by having tcgx86 provide an internal implementation of both make_simple_ref() and a_load_ref_reg() so that make_direct_ref() can call the latter (and the latter the former) without fear of inifinite recursive calls due to the symbol; a_load_ref_reg() is additionally declared as "final" as a_load_ref_reg_internal() needs to be overloaded instead (which is the case for tcg8086)
...
git-svn-id: trunk@34579 -
2016-09-30 14:01:02 +00:00
pierre
4d09dfca95
Remember usage of checkpointer (-gc) option:
...
Use new cs_checkpointer_called moduleswitches set element.
Use new uf_checkpointer_called PPU flag (reusing obsolete uf_local_browser flag value)
Emit warning if compiled library/program has any code using checkpointer.
* ppu.pas: New constant: uf_checkpointer_called
* globtype.pas: New constant: cs_checkpointer_called
* fppu.pas: Set uf_checkpointer_called flag if cs_checkpointer_called is set in current_settings.module_switches
* i8086/n8086mem.pas: Include cs_checkpointer_called in current_settings.moduleswitches
* ncgmem.pas: Likewise.
* msg/errore.msg: Add new message saying that -gc and -Ur options are incompatible
Add description to -gc option, saying it is experimental.
Add warning at link time for program/library if checkpointer is used in any unit or main code.
* options.pas: if -gc and -Ur options are used, never enable checkpointer code,
instead output a warning that release is incompatible with -gc option.
* pmodules.pas: proc_program: Check all modules for uf_checkpointer_called flag,
emit a warning if checkpointer is used.
* utils/ppuutils/ppudump.pp: Add code for uf_codepointer_called option.
git-svn-id: trunk@34567 -
2016-09-27 14:46:09 +00:00
Jonas Maebe
0afbe85aab
* various memory reference alignment fixes
...
git-svn-id: trunk@34544 -
2016-09-20 21:43:19 +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
Jonas Maebe
a0efde8167
* automatically generate necessary indirect symbols when a new assembler
...
symbol is defined
o removed all places where AB_INDIRECT symbols were explicitly generated
o only generate AB_INDIRECT symbols for AT_DATA on systems_indirect_var_imports
o for some symbols an indirect symbol is always required (because they are
dereferenced by code in RTL units) -> use new AT_DATA_FORCEINDIRECT type
git-svn-id: trunk@34165 -
2016-07-20 20:53:03 +00:00
Jonas Maebe
1cb8c0d00c
* specify the def of assembler level symbols defined via
...
tasmdata.DefineAsmSymbol() and all routines that call it
o will be used to automatically generate AB_INDIRECT sybols when
necessary
git-svn-id: trunk@34164 -
2016-07-20 20:52:59 +00:00
nickysn
ac5658470e
+ use the 16-bit movsx and movzx instructions on 386+ in tcg8086.a_load_ref_reg
...
as well
git-svn-id: trunk@34050 -
2016-07-02 17:05:48 +00:00
nickysn
a5f1ae97d4
+ make use of the 16-bit movsx and movzx instructions in tcg8086.a_load_reg_reg
...
when the cpu target is 80386 or later
git-svn-id: trunk@34046 -
2016-07-02 14:06:25 +00:00
nickysn
c2305809dc
+ added an i8086-embedded target support to the compiler (RTL and makefile
...
support are not done yet)
git-svn-id: trunk@33999 -
2016-06-17 19:15:24 +00:00
florian
a7516dfb50
* fix modification information of VCOMISS and VCOMISD
...
git-svn-id: trunk@33874 -
2016-06-01 19:58:43 +00:00
nickysn
c78f406d99
+ implemented proper stack checking for the i8086
...
git-svn-id: trunk@33787 -
2016-05-24 23:57:47 +00:00
nickysn
ce66597df8
* handle classrefdefs properly, according to the memory model in i8086's
...
thlcgobj.getaddressregister. This should fix several regressions in the
compact, large and huge memory models after r33591
git-svn-id: trunk@33637 -
2016-05-03 15:11:32 +00:00
florian
0c13f3ce3e
* fix modification information for vand*
...
git-svn-id: trunk@33593 -
2016-05-01 12:00:25 +00:00
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
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
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