Commit Graph

17863 Commits

Author SHA1 Message Date
Jonas Maebe
101fc3d4ec * translate formaldef into "i8*", as intended, instead of "i8**" due to
the fact that this type is always passed by reference

git-svn-id: trunk@30486 -
2015-04-07 19:35:22 +00:00
Jonas Maebe
f94f9f44e4 * convert all arguments to integers in case of comparisons of pointers with
constants on llvm, as you can only compare with "null" in that case
  * convert all arguments to integers in case of pointer subtractions,
    as pointer subtractions are not supported by llvm

git-svn-id: trunk@30485 -
2015-04-07 19:35:08 +00:00
nickysn
068e3d93c7 * fixed warnings during compilation of an i8086 cross compiler
git-svn-id: trunk@30481 -
2015-04-07 09:33:22 +00:00
nickysn
13ed542f0c + also fill the "size" field in the SEGDEF records
git-svn-id: trunk@30480 -
2015-04-07 01:38:55 +00:00
nickysn
a0aa85f372 + also fill "overlay name" in the SEGDEF records
git-svn-id: trunk@30479 -
2015-04-07 01:35:25 +00:00
nickysn
293ffda788 * build the list of SEGDEF records from the ObjSectionList, instead of using a
hardcoded list. Creation of dgroup temporarily disabled.

git-svn-id: trunk@30478 -
2015-04-07 01:33:11 +00:00
nickysn
1d236e8386 + count omf sections and set their index starting with 1
git-svn-id: trunk@30477 -
2015-04-07 01:07:42 +00:00
nickysn
e87148c425 + added property PrimaryGroup to TOmfObjSection; fill it with 'dgroup' if
section belongs to the group dgroup in the current memory model

git-svn-id: trunk@30476 -
2015-04-07 00:11:56 +00:00
nickysn
c7af648d69 + added omf-specific properties to TOmfObjSection and fill them in the constructor
git-svn-id: trunk@30475 -
2015-04-06 23:48:39 +00:00
nickysn
38f8a942e2 + added descendant class TOmfObjSection (empty for now) for storing omf sections' extra data
git-svn-id: trunk@30474 -
2015-04-06 23:26:52 +00:00
nickysn
a1bc36ab56 + TOmfObjData.writeReloc: write the actual offset of the symbol in the section data
git-svn-id: trunk@30473 -
2015-04-06 21:43:06 +00:00
nickysn
6a7fff644a * align non-code sections with zeros, instead of nops in the nasm asm output
writer, so they match the behaviour of the internal object writer (so it
  becomes easier to compare to the binary output of the omf object writer)

git-svn-id: trunk@30472 -
2015-04-06 20:30:06 +00:00
Jonas Maebe
5d8483185f * silence another warning from r30449
git-svn-id: trunk@30469 -
2015-04-06 16:42:27 +00:00
Jonas Maebe
640efba580 * fixed warnings after r30449/r30450
git-svn-id: trunk@30466 -
2015-04-06 14:24:09 +00:00
Jonas Maebe
b403a8c3fd * fixed ppu dump for objc categories
git-svn-id: trunk@30465 -
2015-04-06 14:05:39 +00:00
Jonas Maebe
f6b03b2912 * updated ppudump for changes in ppu version 174
git-svn-id: trunk@30464 -
2015-04-06 14:05:36 +00:00
nickysn
877a769ac3 + support align directive with a given use_op/fillop in the NASM asm writer
git-svn-id: trunk@30459 -
2015-04-06 01:03:22 +00:00
nickysn
824bfd961b + very early (and incomplete/broken) implementation of FIXUPP records in the omf
object writer

git-svn-id: trunk@30458 -
2015-04-06 00:34:28 +00:00
nickysn
3840db5457 * handle aitconst_farptr with a constant (nil) directly in the internal asm
writer, without calling writereloc

git-svn-id: trunk@30457 -
2015-04-05 23:56:23 +00:00
nickysn
393b9b54a8 + handle aitconst_farptr in the internal asm writer as a new relocation type (RELOC_FARPTR)
git-svn-id: trunk@30456 -
2015-04-05 23:43:37 +00:00
nickysn
1c5d0ed09a + support aitconst_farptr in tai_const.size
git-svn-id: trunk@30455 -
2015-04-05 23:33:41 +00:00
nickysn
b67fea70bd + write a MODEND (end of module) record at the end of the omf file
git-svn-id: trunk@30454 -
2015-04-05 22:42:26 +00:00
nickysn
c59855b5e7 + start writing actual section content (without fixups and probably still buggy)
in the OMF object writer
* give proper section names (like in the NASM asm writer) for the OMF object
  writer

git-svn-id: trunk@30452 -
2015-04-05 21:39:02 +00:00
florian
9ab9e03650 * limit number of possible units with initialization/finalization for a certain architecture to high(aint)
+ give an error if the number of possible units is exceeded

git-svn-id: trunk@30450 -
2015-04-05 21:06:58 +00:00
florian
b684719f1e + give an error if allocated temps. overflow the normally max. available space
git-svn-id: trunk@30449 -
2015-04-05 20:59:34 +00:00
nickysn
444b63cf07 + added class for reading/writing a FIXUP subrecord in a FIXUPP omf record
git-svn-id: trunk@30448 -
2015-04-05 19:57:41 +00:00
florian
1114089d25 * IsJumpToLabel checks number of operands
* add a few safety checks

git-svn-id: trunk@30446 -
2015-04-05 19:24:22 +00:00
florian
02d9c676d3 * make offsets passed to tconst of type asizeint instead of aint
git-svn-id: trunk@30445 -
2015-04-05 19:18:52 +00:00
florian
63bf17440c * use volatile registers first
* fix some range check errors

git-svn-id: trunk@30444 -
2015-04-05 19:17:24 +00:00
florian
db63693b7e * tai returned by GetNextInstructionUsingReg must be checked if it is really an instruction
git-svn-id: trunk@30443 -
2015-04-05 19:12:43 +00:00
florian
2b9c0ef3b4 - jmp_instructions shouldn't include call/ret instructions
git-svn-id: trunk@30442 -
2015-04-05 19:11:40 +00:00
florian
73c0422997 + create defines for CPU ALU size
git-svn-id: trunk@30441 -
2015-04-05 19:09:28 +00:00
florian
2daae5ff03 * moved comment so it is recognized by lazarus as a method description
git-svn-id: trunk@30439 -
2015-04-05 19:08:00 +00:00
florian
31709b1b43 * check registers of ait_regalloc for a valid color when translating and compiling with -dextdebug
git-svn-id: trunk@30438 -
2015-04-05 19:06:06 +00:00
nickysn
25411c3871 + added omf fixup related enums
git-svn-id: trunk@30436 -
2015-04-05 14:50:59 +00:00
Jonas Maebe
94aadb23ab + implemented getintparaloc() for llvm
git-svn-id: trunk@30430 -
2015-04-04 14:29:19 +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
Jonas Maebe
2336d22985 * override instr_get_oper_spilling_info and substitute_spilled_registers for
llvm (add support for top_para)

git-svn-id: trunk@30428 -
2015-04-04 14:29:12 +00:00
Jonas Maebe
9d4c8f68d4 * fixed first_fpu_immreg definition
git-svn-id: trunk@30427 -
2015-04-04 14:29:09 +00:00
Jonas Maebe
e12dff9a5e * support top_para in trgllvm.get_spill_temp()
git-svn-id: trunk@30426 -
2015-04-04 14:29:06 +00:00
Jonas Maebe
e750678f37 * factored out spilling code that deals with operand types into virtual
methods so they can be overridden by platform-specific variants
    for platform-specific operand types

git-svn-id: trunk@30425 -
2015-04-04 14:29:03 +00:00
Jonas Maebe
ee7198aa57 * fixed memory leak in case one tai operand is replaced by another
git-svn-id: trunk@30424 -
2015-04-04 14:29:00 +00:00
Jonas Maebe
3279cc052a * moved llvm-specific code from aasmtai to aasmllvm
* call add_reg_instruction_hook() for top_para parameters

git-svn-id: trunk@30423 -
2015-04-04 14:28:57 +00:00
Jonas Maebe
2ef753faae * support llvm spilling_get_reg_type() for the destination of call/invoke
git-svn-id: trunk@30422 -
2015-04-04 14:28:54 +00:00
nickysn
7f4c2c0cc2 * added missing 'private' declaration to TOmfRecord_SEGDEF
git-svn-id: trunk@30420 -
2015-04-04 12:48:05 +00:00
Jeppe Johansen
e2272c8a7e Added aitconst_gs for AVR pointer references to Flash.
git-svn-id: trunk@30419 -
2015-04-04 10:29:11 +00:00
nickysn
ef9c15c165 + write link pass 1 separator to omf obj output
git-svn-id: trunk@30415 -
2015-04-04 00:14:34 +00:00
nickysn
4fc55f97fc * refactored adding groups to use a method with an 'array of const' parameter
git-svn-id: trunk@30414 -
2015-04-03 23:45:43 +00:00
nickysn
1521f88a9d * fixed off by one error when writing a GRPDEF record
git-svn-id: trunk@30413 -
2015-04-03 22:56:49 +00:00
nickysn
a9f10f60eb + write the dgroup GRPDEF record
git-svn-id: trunk@30412 -
2015-04-03 22:56:09 +00:00
nickysn
a84537dd9b + create the default segments and write them in the OMF object file
git-svn-id: trunk@30411 -
2015-04-03 22:33:45 +00:00
nickysn
56621e6ee1 + added class for writing GRPDEF omf records
git-svn-id: trunk@30410 -
2015-04-03 21:58:02 +00:00
nickysn
7c90285af1 * improved record length checking in the SEGDEF omf record parsing
git-svn-id: trunk@30409 -
2015-04-03 00:12:16 +00:00
nickysn
28d8e915b7 + implemented parsing of SEGDEF omf records as well
git-svn-id: trunk@30408 -
2015-04-02 23:59:45 +00:00
nickysn
f380d67575 - rm unused var
git-svn-id: trunk@30407 -
2015-04-02 23:49:36 +00:00
nickysn
65212e7a34 + added class for encoding a SEGDEF(32) omf record
git-svn-id: trunk@30406 -
2015-04-02 23:05:02 +00:00
Jeppe Johansen
7f34ab27d2 Fixed issue with COFF linker. The addend wasn't shifted up by four before being added.
git-svn-id: trunk@30405 -
2015-04-02 22:06:14 +00:00
nickysn
1a3bd5fde1 + added enums for OMF segment alignment and combination
git-svn-id: trunk@30404 -
2015-04-02 20:20:47 +00:00
Jeppe Johansen
a3fd3ee3ab Fixed bug in ARM coff writer. Relocations just ORed the offset onto the instruction instead of adding, but they are emitted as bl 0xFFFFFE, and not bl 0x0.
git-svn-id: trunk@30403 -
2015-04-02 18:28:42 +00:00
Jonas Maebe
197e5194b9 * don't crash if we have to spill a register of the last instruction in an
asmlist

git-svn-id: trunk@30402 -
2015-04-01 15:43:10 +00:00
Jonas Maebe
7b4bf9cc33 * fixed comment for emit_ansi/unicodestring_const() after changing those
class methods into instance methods

git-svn-id: trunk@30401 -
2015-04-01 15:43:07 +00:00
nickysn
72bfe8d2c4 + implemented writing of the LNAMES omf record(s)
git-svn-id: trunk@30398 -
2015-03-31 23:46:15 +00:00
nickysn
e4c612611f + added class (and constants) for handling OMF COMENT records. Write a COMENT
"Translator" record with the FPC version immediately after the header in the
  omf internal object writer.

git-svn-id: trunk@30396 -
2015-03-30 23:38:28 +00:00
nickysn
70577a55f3 + write the omf header in the omf binary writer
git-svn-id: trunk@30395 -
2015-03-30 22:44:58 +00:00
nickysn
ae44d240a3 * updated ppc8086.lpi with the latest compiler source files
git-svn-id: trunk@30394 -
2015-03-30 21:02:54 +00:00
Jeppe Johansen
8c105d4c97 Fix off by 8 error.
git-svn-id: trunk@30393 -
2015-03-30 12:03:18 +00:00
Jeppe Johansen
7fe4b13248 Fix broken peephole optimization that was testing the wrong register for modifications.
Fix tests on unsigned values. The flags were swapped.

git-svn-id: trunk@30392 -
2015-03-30 11:17:38 +00:00
nickysn
9c52c98b77 * use default_settings.packrecords, instead of 0 (since that's different for
i8086) for the packrecords parameter of begin_anonymous_record in
  intf_write_table. This fixes interfaces in i8086 far code or data memory
  models.

git-svn-id: trunk@30389 -
2015-03-30 01:39:47 +00:00
florian
1f93c3aaa1 * get memory sizes on avr-embedded from controller info records
git-svn-id: trunk@30387 -
2015-03-29 21:41:52 +00:00
florian
dfd4d3656b + avrsim controller target requiring a special avr simulator with a certain memory location handling, see avrsim.pp controller helper unit for what it is needed
git-svn-id: trunk@30385 -
2015-03-29 21:13:36 +00:00
florian
b07ba5786b * updated errord(u).msg files by Karl-Michael Schindler, resolves #27725
git-svn-id: trunk@30382 -
2015-03-29 20:02:06 +00:00
florian
873d88ba57 * fix 8 Bit*8 Bit multiplication according to #27737 using modified code supplied by Georg Hieber
git-svn-id: trunk@30381 -
2015-03-29 19:58:30 +00:00
Károly Balogh
72e1443081 + don't abuse status.currentsourcepath to pass on PPU names if the source is unavailable, causes side effects with other frontends (like the IDE). Improved solution for Mantis #27588
git-svn-id: trunk@30373 -
2015-03-29 19:05:19 +00:00
florian
ad995eb121 * use correctly CALL/RCALL and JMP/RJMP on avr, resolves #27738
git-svn-id: trunk@30372 -
2015-03-29 18:26:32 +00:00
Jonas Maebe
c32b6b01ad * make sure the calcparas() is called when calling getcopyas() on a
procvardef

git-svn-id: trunk@30371 -
2015-03-29 18:16:54 +00:00
Jonas Maebe
2112713579 * converted the remaining parts of tcginnode.pass_generate_code() to thlcg
git-svn-id: trunk@30370 -
2015-03-29 18:16:51 +00:00
Jonas Maebe
69e7b06cef * converted rest of VMT generation to high level typed const builder
git-svn-id: trunk@30369 -
2015-03-29 18:16:48 +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
a30f0bc289 * fixed -Oodfa warnings
git-svn-id: branches/hlcgllvm@30350 -
2015-03-28 12:28:21 +00:00
Jonas Maebe
201121d7c9 * synchronised with trunk till r30345
git-svn-id: branches/hlcgllvm@30349 -
2015-03-28 12:28:15 +00:00
Jonas Maebe
f631430775 * made the allocation of labels for internal data in typed const builders
overridable, and implement those routines for llvm

git-svn-id: branches/hlcgllvm@30348 -
2015-03-28 11:34:04 +00:00
Jonas Maebe
e12bd99b59 * fixed compilation with -dllvm after r30343
git-svn-id: branches/hlcgllvm@30347 -
2015-03-28 11:34:02 +00:00
Jonas Maebe
5a2609933f * fixed crash in r30244 (we only have to get a new elementdef if we didn't
already initialise the location, and we won't get a new elementdef if
    the location is already assigned)

git-svn-id: branches/hlcgllvm@30346 -
2015-03-28 11:33:59 +00:00
nickysn
131422b594 + added methods for calculating and verifying the omf record checksum and
properties for accessing it

git-svn-id: trunk@30345 -
2015-03-28 01:55:03 +00:00
nickysn
359eaa4152 + added class for encapsulating an omf raw record
git-svn-id: trunk@30344 -
2015-03-28 01:37:57 +00:00
Jonas Maebe
25e6eaf07f * store the to be used recordalignmin and maxcrecordalign settings inside
(abstract)recordsymtables, so that these settings don't depend on the
    current user settings when internally creating record definitions

git-svn-id: branches/hlcgllvm@30343 -
2015-03-27 21:25:56 +00:00
Jonas Maebe
419a97cce8 * changed emit_ansistring_const() and emit_unicodestring_const() into
instance methods that make use of the internal data builder
    functionality so they automatically place all string data in the
    same section if possible

git-svn-id: branches/hlcgllvm@30342 -
2015-03-27 21:25:53 +00:00
Jonas Maebe
6ed273eec5 * support specifying the name of an internal data section
git-svn-id: branches/hlcgllvm@30341 -
2015-03-27 21:25:50 +00:00
Jonas Maebe
a76aba4a20 * converted a number of string data generators to the internal data builder
functionality

git-svn-id: branches/hlcgllvm@30340 -
2015-03-27 21:25:47 +00:00
Jonas Maebe
158116392c + ttai_typedconstbuilder.start_internal_data_builder() and
ttai_typedconstbuilder.finish_internal_data_builder() to generate data
    will only be referenced by the typed const that we are currently
    generating. Takes care of creating an appropriate label/section for
    this data, avoiding needless global symbols and sections.

git-svn-id: branches/hlcgllvm@30339 -
2015-03-27 21:25:43 +00:00
Jonas Maebe
be2f63aa97 + tasmlabel.createstatic() constructor for creating static data labels
(object-local, but not starting with (.)L, so they're still treated as
    the start of a subsection by Darwin's linker when dead-stripping)
  + tasmdata.getstaticdatalabel() that uses the above

git-svn-id: branches/hlcgllvm@30338 -
2015-03-27 21:25:40 +00:00
Jonas Maebe
560fe24c44 + getlocaldatalabel()
git-svn-id: branches/hlcgllvm@30337 -
2015-03-27 21:25:37 +00:00
Jonas Maebe
687bb15299 * renamed getdatalabel() to getglobaldatalabel
git-svn-id: branches/hlcgllvm@30336 -
2015-03-27 21:25:34 +00:00
Jonas Maebe
5e1bb8e408 + tcalo_make_dead_strippable to indicate that a typed constant data block
should be dead-strippable; may imply the creation of a separate section
    (on platforms that dead-strip data based on sections), but does not
    require it
  * replaced all existing tcalo_new_section uses with
    tcalo_make_dead_strippable, as that is their meaning/purpose

git-svn-id: branches/hlcgllvm@30335 -
2015-03-27 21:25:30 +00:00
Jonas Maebe
e924dbed90 * moved the specification of the options for a ttai_typedconstbuilder from
get_final_asmlist() to the constructor, in preparation of supporting the
    creation of internal builders for local data that will ignore some of the
    irrelevant flags (at creation time)

git-svn-id: branches/hlcgllvm@30334 -
2015-03-27 21:25:27 +00:00
nickysn
49d501a798 + added unit omfbase for omf definitions; currently contains all the omf record
type constants

git-svn-id: trunk@30331 -
2015-03-27 00:44:01 +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