Commit Graph

553 Commits

Author SHA1 Message Date
Jonas Maebe
62e66d2a56 * explicit typecasting of any ordinal type to a boolean of the same
size must happen without any mangling of the value (mantis #11027)
  * moved checking for signed-to-unsigned (or vice versa) type
    conversions in assignments from htypechk to ncnv (where there
    was already code for similar checks) and added support for
    bool_to_bool there as well

git-svn-id: trunk@10521 -
2008-03-21 14:44:58 +00:00
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
Jonas Maebe
8349cde7db * changed byte/word/longbool to be Delphi-compatible (+ similar changes
for qwordbool) + test:
    o assigning true to such a variable now sets them to $ff/$ffff/$ffffffff
    o these types are now all signed
    o converting an integer type to a byte/word/long/qwordbool using an
      explicit type cast keeps the integer's original value stored in the
      bool, instead of forcing it to ord(true)/ord(false)
    (mantis #10233 and #10613, implemented for all architectures, testsuite
     tested for ppc32, sparc and x86)
  * fixed some places where the rtl depended on longbool(true) having the
    value 1
  * extended several boolean tests (and adapted some to no longer assume
    that byte/word/long/qwordbool(true)=1)
  + support for converting to qwordbool in second_int_to_bool for x86, ppc
    and sparc

git-svn-id: trunk@9898 -
2008-01-24 21:30:55 +00:00
Jonas Maebe
ea22e81374 * fixed include/exclude for byte-sized sets in registers
git-svn-id: trunk@9887 -
2008-01-23 22:28:12 +00:00
Jonas Maebe
974c240266 * also use sse2 instructions to convert int to real on i386
for (types convertable to) longint
  * fixed expectloc for x86_64 int_to_real if result is in mmreg

git-svn-id: trunk@9423 -
2007-12-09 18:10:23 +00:00
Jonas Maebe
95f00eb633 * fixed x86_64 and non-darwin i386 GOT/GOTPCREL parsing after r9366
(I put that code in a separate method because it appeared in two
     places, but in one of the two places it was buggy and apparently
     never triggered, and I copied that part...)

git-svn-id: trunk@9379 -
2007-12-02 11:13:51 +00:00
Jonas Maebe
527190a875 + relsymbol support for intel asm reader
git-svn-id: trunk@9368 -
2007-12-01 14:26:24 +00:00
Jonas Maebe
3f57d681e1 * check that not more than one relsymbol is used
git-svn-id: trunk@9367 -
2007-12-01 14:26:06 +00:00
Jonas Maebe
df2980f0c0 + relsym support
* give an error message when using @GOT in darwin/i386 assembler code
    (have to use a relsym instead)

git-svn-id: trunk@9366 -
2007-12-01 11:59:37 +00:00
Jonas Maebe
18eb495d0f * give a regular error message instead of an internal error on x86
when using non-PIC references in assembler code when the compiler
    is configured to generate PIC code (on ppc, sparc and arm, no
    error message is given at all currently)

git-svn-id: trunk@9364 -
2007-12-01 11:28:15 +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
dbba46c0e4 * set addr_pic
git-svn-id: trunk@9350 -
2007-11-29 21:15:22 +00:00
peter
f0e804beb7 * typecast fix
git-svn-id: trunk@9349 -
2007-11-29 21:15:08 +00:00
florian
fb8bbd5ff0 + inline abs(<longint>) on x86
git-svn-id: trunk@9333 -
2007-11-25 18:54:40 +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
6058b2c247 * renamed t_times to executionweight and moved it to
code generation pass
  * include executionweight in the spilling decision

git-svn-id: trunk@9330 -
2007-11-25 16:38:05 +00:00
Jonas Maebe
c8f270c556 + darwin/x86_64 gprof support
git-svn-id: trunk@9252 -
2007-11-14 20:47: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
Jonas Maebe
032352d98b + darwin/x86_64 support
git-svn-id: trunk@9180 -
2007-11-10 18:33:09 +00:00
florian
965bb41288 * fixed more rex placements
git-svn-id: trunk@9069 -
2007-11-02 21:30:43 +00:00
Jonas Maebe
8d8ba9a583 * fixed pic reference loading for non-darwin i386 platforms after
r8657

git-svn-id: trunk@8993 -
2007-10-29 19:00:15 +00:00
florian
19b79468ad * store/load mmx registers properly
* sse registers can be stored/loaded aligned on x86-64

git-svn-id: trunk@8969 -
2007-10-28 14:08:57 +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
9d88b1d9ef * x86-64 fixed
git-svn-id: trunk@8963 -
2007-10-28 08:45:48 +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
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
peter
d74bd34a91 * fix 32bit truncation in type determination of constant operands
git-svn-id: trunk@8909 -
2007-10-22 16:36:41 +00:00
florian
1cb5d2a603 * some missing make_simple_ref calls added, resolves #8948
git-svn-id: trunk@8904 -
2007-10-21 20:19:04 +00:00
peter
43c2694d50 * fixed REX placement for xmm opcodes
git-svn-id: trunk@8850 -
2007-10-18 23:30:35 +00:00
peter
658d9fcc92 * reset subregister before writing mm register names
git-svn-id: trunk@8846 -
2007-10-18 21:52:04 +00:00
peter
ad944fd198 * move x86_64 specific int_to_real conversion to nx64cnv
* fix x86_64 code for none loc_register/loc_reference location

git-svn-id: trunk@8844 -
2007-10-18 20:46:44 +00:00
florian
6eff22d466 * remove disassembler hint \331 from comisd, it causes rex to be
generated too early. rex must be generated after the 0x66 prefix.
  There might be more problems like this which must be fixed.

git-svn-id: trunk@8787 -
2007-10-14 09:32:01 +00:00
florian
6d53d3b4cd * fixed assembling of comisd with rex, there are probably more similiar fixes necessary, must be checked first
git-svn-id: trunk@8785 -
2007-10-14 09:04:45 +00:00
florian
342ba323cf * fixed assembling of cvtsi2ss with rex
git-svn-id: trunk@8777 -
2007-10-13 14:53:27 +00:00
peter
1e28adac60 * there can be a tai_stab between lock/rep and the next opcode
git-svn-id: trunk@8716 -
2007-10-01 19:23:49 +00:00
peter
9715eceee7 * fixed expectloc setting for x86_64
git-svn-id: trunk@8704 -
2007-09-30 21:02:33 +00:00
Jonas Maebe
c84744b27f * fixed a_jmp_name() for darwin/i386 (go via a stub)
* fixed g_external_wrapper for darwin/i386 (both with and without pic,
    by using a_jmp_name(), because the darwin jump stubs can always
    be called directly)

git-svn-id: trunk@8669 -
2007-09-28 14:12:46 +00:00
peter
c19217f846 * only for jump instructions we need to look at the relative
offset of an symbol

git-svn-id: trunk@8664 -
2007-09-27 20:10:30 +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
peter
6b8aed593f * remove registers{int/mmx/fpu} from firstpass
* small cleanups of unused variables in firstpass
  * node_resources_fpu() created to get an approximation of the
    required fpu registers
  * for the moment use node_complexity in the CG until the
    node_resource_int() is created

git-svn-id: trunk@8655 -
2007-09-26 21:12:01 +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
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
ecd2445602 + segment register support in g_concatcopy (should fix #9667, but I
can't test since I don't have Dos/Windows -- at least the changes
    don't break Linux/i386)

git-svn-id: trunk@8608 -
2007-09-22 20:10:56 +00:00
Jonas Maebe
b4b715f213 * make sure tai_align.calculatefillbuf no longer destroys the fillsize
field, because it can still be read afterwards

git-svn-id: trunk@8602 -
2007-09-22 13:01:30 +00:00
tom_at_work
b0bb3f94a7 * improve powerpc64/linux stub for external procedures in units: also consider GOT change in call to this external procedure
* refactored above mentioned stub code generation, allowing the CG to define a cpu specific method for this task by overriding new g_external_wrapper() method

git-svn-id: trunk@8566 -
2007-09-19 20:41:39 +00:00
peter
2f044481ae * release temp when downgrading fpuregister value
git-svn-id: trunk@8530 -
2007-09-17 20:52:24 +00:00