o make use of the fact that callparanodes always first load everything
in temporary parameters (allocated via paramanager.createtempparaloc)
-> we pass those temporary paralocs to the llvm call nodes and ignore
the "real" locations with physical registers
o all function results are forced to memory before handing them back
to the generic code generator to avoid having to deal with special
result locations and llvm<->pascal type differences (llvm removes
the extra temp stores/loads while optimising)
o ideally, the llvm code generator should share the common code with
the generic code generator for a_load_ref_cgpara() at some point in
the future
git-svn-id: branches/hlcgllvm@27013 -
generate declarations when external symbols are referred in a taillvm
instruction
* added "declared" field to tasmsymbol for llvm to make avoid declaring a
symbol multiple times (harmless, but unnecessary)
* all kinds of declarations/definitions are now handled using the new
taillvmdecl, the old separate types have been removed
git-svn-id: branches/hlcgllvm@27010 -
o handle parameters and function results divided over multiple paralocs,
including generating fake recorddefs that represent
o fixed zero/sign extension handling
o properly handle difference between procdefs as printed for the
implementation, an alias declaration or a procvar definition
git-svn-id: branches/hlcgllvm@27009 -
destination types are different: the pointer types of the load/store must
be converted in that case, rather than the loaded/to be stored value
(you can't bitcast aggregates in LLVM)
git-svn-id: branches/hlcgllvm@26987 -
o no support yet for many ait_* types, although eventually most of them
shouldn't be generated at all for the llvm target
o no support yet for calling "opt" (which optimises llvm bitcode) before
calling llc (which translates llvm bitcode into native code) -- compile
with -s and manually call "opt" with -std-compile-opts, -O1, -O2 or -O3
if you want to experiment
o override the assembler writer with the llvm one when compiling an llvm-
targeting compiler
o override the assembler file extension with .ll when compiling an llvm-
targeting compiler
git-svn-id: branches/hlcgllvm@26054 -
overridden by the llvm target
* override a bunch of other ngenutil methods with empty stubs for things
that are not yet supported when targeting llvm
git-svn-id: branches/hlcgllvm@26051 -
bitpacked arrays:
o separate the element size from the index when constructing the memory
references, so we can easily use the llvm getelementptr instruction
o handle conversion of s80real values from their array declaration
as array elements to floating point values when loading them
git-svn-id: branches/hlcgllvm@26050 -
support for loading data from parent routines in nested routines has to
be implemented explicitly via records, like for the jvm target)
git-svn-id: branches/hlcgllvm@26049 -
fpu: treat them as extended when they are loaded into registers, and as
int64 when loading from/storing to memory
git-svn-id: branches/hlcgllvm@26048 -
registers itself, it requires them to be in SSA form. Therefore we
spill all registers that are written more than once to memory.
+ support in the generic register allocator for generating code that is
SSA-safe
+ spilling helpers for llvm
git-svn-id: branches/hlcgllvm@26044 -
Other than arrays and complex procvardefs, all aggregates are currently
handled as opaque arrays of bytes
o special case: s80real (x87 extended type) is encoded as "array[0..9] of
byte" inside arrays, because when using the llvm type describing
"extended" llvm will handle it in an ABI-compliant way (allocating e.g.
16 bytes for it on Darwin and x86-64 platforms). Loading/storing them
always happens using instructions that only read/write 10 bytes, so
we only have to take care to convert them to the actual extended type
when indexing arrays/subscripting records (when records are no longer
handled in an opaque way)
git-svn-id: branches/hlcgllvm@26041 -
the paraloc information, and then adds llvm-specific information to the
paralocs
o only partially implemented, in particular function result handling is
not yet there
git-svn-id: branches/hlcgllvm@26040 -
basic block must end with a terminator instruciton (such as a branch) ->
when emitting a label, check whether the previous instruction is a
terminator instruction and if not, add an unconditional branch to the
label we are adding.
o Implemented at the tcg instead of at the thlcgobj level because
a) these methods don't need any high level type information
b) implementing them in thlcgobj would require making thlcg.a_label()
virtual and ensuring that no-one ever calls cg.a_label() in any
generic code
git-svn-id: branches/hlcgllvm@26038 -
o opcodes + string representation
o llvm string representations of targets supported by fpc
o supported fpc optimisations
o list of supported LLVM versions (currently only targeting 3.3)
git-svn-id: branches/hlcgllvm@26035 -
temp we allocate, we set the base register to a newly allocated
R_TEMPREGISTER. This allows for uniquely identifying a temp even if its
offset is modified.
git-svn-id: branches/hlcgllvm@26033 -