Commit Graph

798 Commits

Author SHA1 Message Date
nickysn
fbc41991f9 * i8086 fixes in tcgx86.a_op_reg_reg for 16-bit OP_SHR,OP_SHL,OP_SAR,OP_ROL,OP_ROR
git-svn-id: branches/i8086@23881 -
2013-03-17 00:05:05 +00:00
florian
d6f0a1a0df * do not generate scaled indicies for case table jumps for i8086
git-svn-id: branches/i8086@23872 -
2013-03-16 19:52:53 +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
florian
b321f867c6 + trgintcpu.add_cpu_interferences for i8086 so references are properly build
* empty make_simple_ref code path for i8086

git-svn-id: branches/i8086@23782 -
2013-03-10 18:51:42 +00:00
nickysn
c467035a1c added group directive, so that the .data, .rodata and .bss sections go to the same segment
git-svn-id: branches/i8086@23754 -
2013-03-09 18:30:11 +00:00
nickysn
95b15d15bd another nested ifdef cleaned up
git-svn-id: branches/i8086@23741 -
2013-03-09 11:35:42 +00:00
nickysn
981f0a5c6c nested ifdefs converted to series of elseif + some other ifdefs cleaned up
git-svn-id: branches/i8086@23740 -
2013-03-09 11:25:25 +00:00
nickysn
5f7d432ff9 i8086 fixes in Tcgx86.g_concatcopy and TCGSize2OpSize
git-svn-id: branches/i8086@23720 -
2013-03-08 00:13:02 +00:00
nickysn
eff0894a66 all the extra i8086 units added
git-svn-id: branches/i8086@23718 -
2013-03-08 00:04:45 +00:00
nickysn
4440015db3 added i8086 specific adaptations to the NASM assembly writer
git-svn-id: branches/i8086@23714 -
2013-03-07 22:51:42 +00:00
nickysn
a4b1a9011b i8086 specific stuff added to x86/cpubase.pas
git-svn-id: branches/i8086@23713 -
2013-03-07 22:49:35 +00:00
Jonas Maebe
5d628b29bb * set the subregsize of OS_M64 SSE registers to R_SUBQ so we can
differentiate between 64 bit and 128 bit (R_SUBMMWHOLE) SSE vector regs,
    and support spilling/assembling for R_SUBQ SSE registers (8 bytes)
    (mantis #23962)

    We currently never use the full 128 bit of an SSE register, and
    spilling for those hasn't been implemented yet either (R_SUBMMWHOLE
    SSE regs are spilled into a 4-byte temp currently -> can overwrite data)

git-svn-id: trunk@23700 -
2013-03-06 12:42:46 +00:00
yury
8ae7c5784c * Sync with trunk r23500.
git-svn-id: branches/targetandroid@23501 -
2013-01-23 07:53:13 +00:00
yury
e13e2e1697 * Turn off special handling of interrupt calling convention for i386-android.
git-svn-id: branches/targetandroid@23492 -
2013-01-22 14:43:42 +00:00
yury
0960ee2034 * Add missing checks for android target.
git-svn-id: branches/targetandroid@23477 -
2013-01-21 12:08:25 +00:00
paul
5d74e0578a compiler: remove unused variables and unneeded assignments
git-svn-id: trunk@23467 -
2013-01-21 01:24:36 +00:00
yury
c2fed960c9 * Add android to supported targets for assemblers. It fixes assembling for i386-android.
git-svn-id: branches/targetandroid@23441 -
2013-01-18 14:51:09 +00:00
sergei
7530fb3352 * tcgx86.make_simple_ref: handle references to absolute addresses (these are quite rare on x86_64, but still worth to handle correctly).
* If possible, use reference base instead of index, this yields shorter instructions.
* Added comment about offset limits for rip-relative addressing.
- Removed code related to taking threadvar address on win32, it is incorrect because Windows TLS is not directly accessible via segment registers (fs:0x2c points to array of pointers to TLS storages of each module, so at least double indirection is needed).

git-svn-id: trunk@23342 -
2013-01-07 16:00:12 +00:00
florian
feefcb6d3d * don't generate dec for case nodes of unsigned types because dec does not set the carry flag, resolves #23503
git-svn-id: trunk@23229 -
2012-12-27 19:35:58 +00:00
Jonas Maebe
68dd05e259 * fixed std_regname() for xmm registers with custom sizes
* fixed findreg_by_number() for xmm registers with R_SUBNONE
    (from the assembler reader)

git-svn-id: trunk@23151 -
2012-12-15 22:47:12 +00:00
Jonas Maebe
d180d6f241 * fixed size of movzx/movsx with 64bit operand in x86-64 Intel asm reader
git-svn-id: trunk@23131 -
2012-12-09 22:42:52 +00:00
florian
ab1815273c + added comment on movsd hack
git-svn-id: trunk@23031 -
2012-11-18 21:34:38 +00:00
florian
d49a88c3c8 * merge fixes by Torsten Grundke
git-svn-id: trunk@23030 -
2012-11-18 21:18:49 +00:00
florian
45f60bc4b5 * small changes (copyright, typo, readability)
git-svn-id: trunk@23022 -
2012-11-18 17:28:30 +00:00
florian
0b30b0fd5a * re-enable jump tables for x86-64, they are fixed, see also
http://www.hu.freepascal.org/lists/fpc-devel/2012-June/029141.html

git-svn-id: trunk@22921 -
2012-11-03 22:14:45 +00:00
florian
6345aee80b * revert r19643: FloatToStr has to handle Nan correctly and should not cause
any exceptions (silent or not), FloatToStr has been fixed in r19783

git-svn-id: trunk@22877 -
2012-10-29 22:00:42 +00:00
masta
e327b4581c Use TRegNameTable instead of array[tregisterindex] of string[10]
TRegNameTable is defined in compiler/rgbase.pas and is an array of
strings, limited to the maximum length of the used register names.

r22792 added a long register name but did not scale the string-size
enough, resulting in the compiler built breaking for arm.

git-svn-id: trunk@22817 -
2012-10-22 10:23:21 +00:00
Jonas Maebe
6497d3c994 - removed no longer used/supported af_allowdirect flag (direct assembler
reader support)

git-svn-id: trunk@22794 -
2012-10-21 13:42:58 +00:00
florian
04543b179f o merge of the branch laksen/arm-embedded of Jeppe Johansen:
fixes a couple of arm-embedded stuff, 
  adds some controllers, start of fpv4_s16 support, for a complete list of
  changes see below:
------------------------------------------------------------------------
r22787 | laksen | 2012-10-20 22:00:36 +0200 (Sa, 20 Okt 2012) | 1 line

Properly do NR_DEFAULTFLAGS detection/allocation/deallocation
------------------------------------------------------------------------
r22782 | laksen | 2012-10-20 07:44:55 +0200 (Sa, 20 Okt 2012) | 1 line

Fixed flags detections code for wide->short optimization code for Thumb-2
------------------------------------------------------------------------
r22778 | laksen | 2012-10-19 20:23:14 +0200 (Fr, 19 Okt 2012) | 1 line

Added coprocessor registers, and support for 6 operands(MCR/MRC instructions, etc)
------------------------------------------------------------------------
r22647 | laksen | 2012-10-14 21:28:08 +0200 (So, 14 Okt 2012) | 1 line

Added register specifications to lpc1768.pp. From Joan Duran
------------------------------------------------------------------------
r22646 | laksen | 2012-10-14 21:10:20 +0200 (So, 14 Okt 2012) | 4 lines

Fixed some minor formating issues
Implemented a small heap mananger
Implemented console IO
Changed default LineEnding to CrLf(to ease console IO parsing)
------------------------------------------------------------------------
r22599 | laksen | 2012-10-09 08:58:58 +0200 (Di, 09 Okt 2012) | 1 line

Added all STM32F1 configurations
------------------------------------------------------------------------
r22597 | laksen | 2012-10-08 22:10:45 +0200 (Mo, 08 Okt 2012) | 1 line

Added initial support for the Cortex-M4F FPv4_S16 FPU
------------------------------------------------------------------------
r22596 | laksen | 2012-10-08 22:04:14 +0200 (Mo, 08 Okt 2012) | 1 line

Added FPv4_d16 FPU instructions, and a few extra registers
------------------------------------------------------------------------
r22592 | laksen | 2012-10-08 16:07:40 +0200 (Mo, 08 Okt 2012) | 2 lines

Added support for IT block merging
Added a peephole pattern check for UXTB->UXTH chains
------------------------------------------------------------------------
r22590 | laksen | 2012-10-08 14:30:00 +0200 (Mo, 08 Okt 2012) | 3 lines

Add CBNZ/CBZ instructions
Create preliminary Thumb-2 PeepHoleOptPass2 code, hacked together from the ARM mode code
Added a number of simple size optimizations for common Thumb-2 instructions
------------------------------------------------------------------------
r22582 | laksen | 2012-10-08 06:49:39 +0200 (Mo, 08 Okt 2012) | 3 lines

Fix optimizations of Thumb-2 code
Fix problem with loading of condition operand for IT instructions
Properly split IT blocks when register allocator tries to spill inside a block.
------------------------------------------------------------------------
r22581 | laksen | 2012-10-08 05:15:40 +0200 (Mo, 08 Okt 2012) | 4 lines

Fixed assembler calling command line for cpus>ARMv5TE. EDSP instructions will generate errors while assembling, due to RTL assembler routines
Updated boot code for all Cortex-M3 controllers, and sc32442b to use weak linking for exception tables.
Cortex-M3 devices now also share initialization routine to simplify maintenance
STM32F10x classes now have specific units which fit the interrupt source names and counts
------------------------------------------------------------------------
r22580 | laksen | 2012-10-08 05:10:44 +0200 (Mo, 08 Okt 2012) | 2 lines

Added support for .section, .set, .weak, and .thumb_set directive for GAS assembler reader
IFDEF'ed JVM specific assembler directives, to prevent ait_* set to exceed 32 elements
------------------------------------------------------------------------
r22579 | laksen | 2012-10-08 02:10:52 +0200 (Mo, 08 Okt 2012) | 3 lines

Remove all traces of the interrupt vector table generation mechanism
Clean up cpuinfo tables
Fixed ARMv7M bug(BLX <label> doesn't exist on that version)

git-svn-id: trunk@22792 -
2012-10-21 08:39:52 +00:00
florian
a499a30ca9 * fixes to avx support by Torsten Grundke
git-svn-id: trunk@22773 -
2012-10-19 16:45:53 +00:00
florian
d7e0f07aab + UseAVX check
git-svn-id: trunk@22642 -
2012-10-14 14:04:31 +00:00
Jeppe Johansen
0087661fb5 Added FPv4_d16 FPU instructions, and a few extra registers
git-svn-id: branches/laksen/arm-embedded@22596 -
2012-10-08 20:04:14 +00:00
florian
283ff05127 * merged avx support in inline assembler developed by Torsten Grundke
git-svn-id: trunk@22568 -
2012-10-06 19:47:18 +00:00
pierre
0a755be6fe * Fix assembler fileinfo position for x86 readers
git-svn-id: trunk@22501 -
2012-09-28 22:26:41 +00:00
florian
d93cee995b * fix register method pointer for ppc64 and x86_64-linux
git-svn-id: trunk@22351 -
2012-09-07 15:15:10 +00:00
florian
8818b58e5d * Bsf/Bsr on x86 handle now correctly 0 as argument, resolves #22783
* generic Bsf implementations handle now correctly 0 as argument
* test extended

git-svn-id: trunk@22327 -
2012-09-05 13:51:45 +00:00
florian
10dbdb5c9a * fix compilation on x86-64
git-svn-id: trunk@22294 -
2012-09-03 09:52:06 +00:00
florian
76bea5c4fd * x86-64 and i386 use the popcnt instruction of possible
git-svn-id: trunk@22291 -
2012-09-02 20:59:48 +00:00
florian
ff12d63248 + generic popcnt support
git-svn-id: trunk@22290 -
2012-09-02 20:59:44 +00:00
florian
b782918434 * first draft to support the popcnt instruction, works so far for x86 with a real popcnt instruction
git-svn-id: trunk@22289 -
2012-09-02 20:59:39 +00:00
Jonas Maebe
b1dc518ac4 * removed systems_need_16_byte_stack_alignment and use target_info.stackalign instead
git-svn-id: trunk@22279 -
2012-09-02 14:32:21 +00:00
Jonas Maebe
952ac1ffa6 * only use indirect symbol loads for (weak)external and private_external
symbols on darwin/ppc and darwin/i386, and also for common symbols on
    darwin/ppc, as they're not required for other kinds of symbols on those
    platforms (gcc doesn't use them either with -O1 and higher; it does use
    them always for darwin/ppc64 except for local symbols, and hence so do we)

git-svn-id: trunk@22271 -
2012-08-30 21:30:38 +00:00
Jonas Maebe
68d9e95120 * if the size of an operand is not explicitly forced in intel assembler
(e.g. via "dword ptr"), let the size of accessed fields in memory
    expressions override the default size (mantis #18019)

git-svn-id: trunk@22250 -
2012-08-26 17:05:31 +00:00
Jonas Maebe
4d0e4e1b56 * treat "[var + rip]" in intel assembler mode as addr_pic_no_got on x86-64
(mantis #22665)
  + support "[var wrt ..gotpcrel]" nasm/yasm syntax in intel assembler mode
    for GOT-relative accesses on x86-64, + give an error when trying to do
    this on win64 (it doesn't have a GOT)
  * moved code that give a warning when using GOT-relative accesses to
    static data on x86-64 from the AT&T reader to rax86 so it's also
    active for the Intel assembler reader
  + added warning when not using GOT-relative accesses (but plain
    RIP-relative instead) to global data on non-Win64 x86-64

git-svn-id: trunk@22243 -
2012-08-25 15:12:49 +00:00
Jonas Maebe
2c43e084f0 * disabled "[reg].offset globalvar" pic syntax in intel assembler mode for
x86-64, because it does not specify whether the code should be got-based
    or not

git-svn-id: trunk@22242 -
2012-08-25 15:12:44 +00:00
Jonas Maebe
35c70a6c96 * copy the darwin got register to a new register when using it, so it
cannot get modified

git-svn-id: trunk@22240 -
2012-08-25 15:12:34 +00:00
Jonas Maebe
f7dbe6d7a6 * use a different register constant for EIP and RIP (fixes external
assembler writers on x86-64 after r22181, the shift in positions
    caused every occurrence of RIP to become EIP in the assembler code)

git-svn-id: trunk@22234 -
2012-08-24 18:49:17 +00:00
florian
4dee21c60e + NR_DEFAULTFLAGS and RS_DEFAULTFLAGS for all CPUs with flags added
git-svn-id: trunk@22181 -
2012-08-22 19:38:27 +00:00
florian
d2aa35e9de * throw an internal error if code generation depends on expectloc but expectloc and real loc do not match
git-svn-id: trunk@22073 -
2012-08-13 15:02:55 +00:00
Jonas Maebe
0a1157da38 * fixed memory leaks in the compiler introduced in r21862 by marking and
releasing temporarily created function result locations

git-svn-id: trunk@21953 -
2012-07-23 13:49:29 +00:00