Commit Graph

886 Commits

Author SHA1 Message Date
peter
8f239d04b6 * cleanup and simplify the set type handling
git-svn-id: trunk@10432 -
2008-03-02 17:48:27 +00:00
Jonas Maebe
f36e5411af * split cpu64bit compiler define into
a) cpu64bitaddr, which means that we are generating a compiler which
       will generate code for targets with a 64 bit address space/abi
    b) cpu64bitalu, which means that we are generating a compiler which
       will generate code for a cpu with support for 64 bit integer
       operations (possibly running in a 32 bit address space, depending
       on the cpu64bitaddr define)
   All cpus which had cpu64bit set now have both the above defines set,
   and none of the 32 bit cpus have cpu64bitalu set (and none will
   compile with it currently)
  + pint and puint types, similar to aint/aword (not pword because that
    that conflicts with pword=^word)
  * several changes from aint/aword to pint/pword
  * some changes of tcgsize2size[OS_INT] to sizeof(pint)

git-svn-id: trunk@10320 -
2008-02-13 20:44:00 +00:00
yury
ed86757898 * Pass const record parameters by reference for all calling conventions on i386-wince. It is needed to be Windows unit Delphi compatible, since WinAPI functions are cdecl on wince.
git-svn-id: trunk@10296 -
2008-02-11 15:12:41 +00:00
Jonas Maebe
058e3762aa * added missing begin/end
git-svn-id: trunk@10260 -
2008-02-10 10:07:55 +00:00
daniel
459382faa8 + Teach peephole optimizer the cmc/adc trick I used in int_str.
git-svn-id: trunk@9799 -
2008-01-19 21:47:37 +00:00
Jonas Maebe
9ec3cc2022 * fixed sign of location.size for divmodn, 64 shlshrn and for muln
git-svn-id: trunk@9646 -
2008-01-05 21:35:42 +00:00
Jonas Maebe
ca7650418d * fixed/added overflow checking in generic unarminusn code + test
+ added support for OP_NEG/OP_NOT in tcg64f386.a_op64_ref_reg (needed
    for the above)

git-svn-id: trunk@9528 -
2007-12-25 23:52:09 +00:00
Jonas Maebe
6c536dab3e * added several missing make_simple_ref() calls
* removed addr_pic again for darwin, as you have to explicitly code
    the relative address using a relsym instead of using an assembler
    directive like @GOT there

git-svn-id: trunk@9353 -
2007-11-29 22:06:14 +00:00
peter
cbac667753 * check for eax,edx,ecx,ebx that support 8,16 bit registers in shortint add/sub peephole
and update register size of substructor

git-svn-id: trunk@9351 -
2007-11-29 21:16:32 +00:00
peter
59365a6db9 - garbage was being output sometimes instead of source lines when compiling with -al. This is because lastfileinfo and lastinfile were never initialized for MASM writer. This is true for TPPCMPWAssembler, too.
- long lines were not wrapped.
- constants of type ait_comp_64bit output incorrectly.
- at end of file, current segment was not closed.
patch from Sergei Gorelkin

git-svn-id: trunk@9331 -
2007-11-25 16:46:19 +00:00
peter
fcb37c4fa4 * peephole added for non-longint:=non-longint+X
git-svn-id: trunk@9329 -
2007-11-25 14:32:59 +00:00
peter
cb24c78d4d * typecast to tenumreg before updating usedregs to prevent varset usage, patch from Sergei Gorelkin
git-svn-id: trunk@9296 -
2007-11-19 22:22:25 +00:00
peter
05e44101e8 * make call by value stdcall for records and arrays delphi compatible
git-svn-id: trunk@9280 -
2007-11-18 12:53:55 +00:00
Jonas Maebe
defe46ef42 * added missing size suffixes for several sse2 opcodes
git-svn-id: trunk@9182 -
2007-11-10 19:57:01 +00:00
florian
965bb41288 * fixed more rex placements
git-svn-id: trunk@9069 -
2007-11-02 21:30:43 +00:00
florian
c3475dddc0 * handle case ranges properly for unsigned types with a non-zero base, resolves #10009
git-svn-id: trunk@8974 -
2007-10-28 17:06:02 +00:00
florian
82c7896d8d * more ins. dat issues popped up, did I mention I start to hate it :(?
git-svn-id: trunk@8968 -
2007-10-28 14:08:04 +00:00
florian
c1d62172fe * the saga continues, fixed previously broken assembler table entries
git-svn-id: trunk@8967 -
2007-10-28 13:01:58 +00:00
florian
f32831c44a * fixed assembling of fisttp of sse3 instruction set
+ sse3 optimized trunc() using fisttp
+ -Cfsse3 for x86-64

git-svn-id: trunk@8962 -
2007-10-27 20:50:46 +00:00
florian
46e1587395 * another bunch of assembler fixes, win64 builds again
git-svn-id: trunk@8957 -
2007-10-27 19:49:53 +00:00
florian
00d6a03b2c + default code now preserves mm registers
* save|restore_standard_registers => save|restore_registers

git-svn-id: trunk@8954 -
2007-10-27 12:02:28 +00:00
florian
8f5a4cc514 * more, hopefully correct, x86-64 assembler fixes
git-svn-id: trunk@8952 -
2007-10-26 20:44:57 +00:00
florian
c5f492ef50 * fixed assembling of movq mem,xmmreg
git-svn-id: trunk@8923 -
2007-10-24 20:45:38 +00:00
florian
c219b1f753 * fixed/enabled andl/addl/... xx,reg1 orl reg1,reg1 setxx/jxx/cmovxx optimization
git-svn-id: trunk@8902 -
2007-10-21 19:54:09 +00:00
peter
43c2694d50 * fixed REX placement for xmm opcodes
git-svn-id: trunk@8850 -
2007-10-18 23:30:35 +00:00
Jonas Maebe
c03f19fa50 * in case of "movzbl %dl,%edx" etc, %edx depends on its previous value.
regloadedwithnewvalue() gave the wrong answer for this in case
    candependonprevvalue was false (caused a wrong optimization in the
    space() function of the rtl)

git-svn-id: trunk@8808 -
2007-10-14 20:22:23 +00:00
florian
bb314e5456 * regenerated
git-svn-id: trunk@8788 -
2007-10-14 09:32:15 +00:00
florian
5d31cd02a7 * regenerated
git-svn-id: trunk@8786 -
2007-10-14 09:04:56 +00:00
florian
342ba323cf * fixed assembling of cvtsi2ss with rex
git-svn-id: trunk@8777 -
2007-10-13 14:53:27 +00:00
peter
9f0ca44c94 * new tf_smartlink_library flag
* use create_smartlink[_sections|_library] to check what to 
    do for smartlinking

git-svn-id: trunk@8715 -
2007-10-01 16:55:08 +00:00
Jonas Maebe
3a60a28283 * don't try to add current_procinfo.got to used_in_proc if it's a
virtual register
  * always add EBX to used_in_proc in case pi_needs_got, because it's
    currently always used due to the geteipasebx call
  * don't explicitly free the PIC register in the exitcode because
    then the assembler optimizer assumes the load restoring it (ebx)
    can be safely removed

git-svn-id: trunk@8683 -
2007-09-29 20:24:51 +00:00
Jonas Maebe
3266f4e483 + Compiler support for pic on darwin/i386. The i386 rtl still needs
to be made pic-safe (mainly accesses to the global default8087cw)
  * At the same time also made the non-pic code abi-compliant (access
    external data via indirect symbol pointers etc)

    Darwin/i386 also puts the got into a virtual register (like
    Darwin/ppc), a.o. because the register allocator fails to colour
    a routine in aasmcpu.pas if we take away ebx from it.

git-svn-id: trunk@8657 -
2007-09-26 21:42:27 +00:00
Jonas Maebe
9750e49d5a * fixed x86 compilation after r8651
git-svn-id: trunk@8652 -
2007-09-26 17:25:38 +00:00
Jonas Maebe
335bc9fd46 + PIC support for darwin/ppc32 (-Cg works now, no regressions in test
suite compiled with -Cg compared to without -Cg)
  + support for using a virtual register as PIC/got base register
  * moved got loading code from ncgutil to cgobj/cgcpu (can't test whether
    it didn't break anything under linux/i386, because "make cycle OPT=-Cg"
    was already broken due to the *prt*.as -> si_*.pp changes)

git-svn-id: trunk@8651 -
2007-09-26 16:41:32 +00:00
Jonas Maebe
70c2414daa * split off sec_rodata_norel from sec_rodata, and only put constant data
without relocations in sec_rodata_norel. It should be possible to make
    this new section read-only on all platforms, although currently it
    is only done for darwin, and for non-pic code written using the
    -Aas assembler writer.

    Most platforms also have a special section for "constant but with
    relocations" data, but such a section is currently only used for
    Darwin (others still use plain .data sections for that, like they
    did before)

git-svn-id: trunk@8650 -
2007-09-26 15:49:01 +00:00
Jonas Maebe
2bb0dced62 * optimized code for jumptables (same as for ppc now)
* put jump tables in const section for darwin/i386

git-svn-id: trunk@8627 -
2007-09-23 21:15:59 +00:00
peter
399a2a86fa * fix temp release for 64bit compare
git-svn-id: trunk@8557 -
2007-09-18 21:05:40 +00:00
Jonas Maebe
a8191abd16 * fixed parsing of "rcl/rcr rm,imm" (mantis #9025)
git-svn-id: trunk@8272 -
2007-08-12 13:50:52 +00:00
florian
4151029ee5 + .fini section support
git-svn-id: trunk@8174 -
2007-07-28 08:40:10 +00:00
peter
67e16340be * revert r8118
git-svn-id: trunk@8139 -
2007-07-22 19:59:00 +00:00
florian
447276c5bb * Jcc reads the flags, this was not in the dat yet, resolves #9278
* disabled 4 ops variant of insertq for now

git-svn-id: trunk@8133 -
2007-07-22 16:40:44 +00:00
daniel
21293f5818 + Add common type integer promotion.
- {$intpromotion common_type} or -CIcommon_type switches to common type promotion.
    - {$intpromotion native_integer} or -CIcommon_type switches to current behaviour.
    - Default in tp mode is common_type, native_integer in other modes
    - Compiler can cycle with -CIcommon_type
    - Still needs checking on other architectures than i386

git-svn-id: trunk@8118 -
2007-07-21 19:16:24 +00:00
daniel
5ce54c6a20 + For muln, don't load left operand in register unless necessary.
(mul supports memory operands).

git-svn-id: trunk@8110 -
2007-07-21 09:20:33 +00:00
yury
b86574cf36 * Fixed float constants in softfloat mode when compiler was compiled in hardfloat mode on arm-linux host.
git-svn-id: trunk@7977 -
2007-07-07 19:19:49 +00:00
Jonas Maebe
b6ccf54ae9 * fixed error in register renaming in case the first changed instruction
is an "addl %reg2,%reg1" (was changed into "leal (%reg2,%reg1),%reg2",
    now into "leal (%reg1,%reg1),%reg2")

git-svn-id: trunk@7832 -
2007-06-27 18:30:10 +00:00
yury
93e72c2079 * Fixed bug introduced by r7667. Do not release pushed return value be callee for cdecl on win32. It fixes error3 of bug #9098.
git-svn-id: trunk@7734 -
2007-06-19 21:06:44 +00:00
yury
3b7e458f02 * Properly set location of float return value if it is passed as var parameter (it is always happens for safecall functions). It fixes bugs #8523 and #8977.
+ test.

git-svn-id: trunk@7728 -
2007-06-18 23:23:46 +00:00
Jonas Maebe
02adc2b6ab * fixed calling cdecl routines under win32 which return their result in
a structure whose address is passed by the caller (the caller is
    responsible there to remove the address from the stack, unlike on
    e.g. linux/i386 and darwin/i386) (mantis #9013)

git-svn-id: trunk@7667 -
2007-06-15 12:48:12 +00:00
daniel
b635d89ffa * Fix overload selection code.
git-svn-id: trunk@7654 -
2007-06-13 20:49:13 +00:00
daniel
9adb202a92 * Rework the constexprint to allow operations from low(int64) to high(qword).
+ Some initial work on a formaldef which also carries the typinfo of a parameter.

git-svn-id: trunk@7639 -
2007-06-13 07:41:18 +00:00