Jonas Maebe
dae5d1ff62
+ added class reference types of the architecture-specific t*def/t*sym
...
classes
git-svn-id: trunk@27396 -
2014-03-30 21:04:32 +00:00
Jonas Maebe
b57c95043f
+ support overriding tdef/tsym methods with target-specific functionality:
...
o made all (non-abstract) tdef and tsym constructors virtual
o added c*def/c*sym classref types for every (non-abstract) t*def/t*sym
class
o added cpusym unit for every architecture that derives a tcpu*def/tcpu*sym
class from the base classes, and initialises the c*def/c*sym classes with
them. This is done so that the llvm target will be able to derive from
the tcpu*def/sym classes without umpteen ifdefs, and it also means that
the WPO can devirtualise everything because the c* variables are only
initialised with one class type
o replaced all t*def/t*sym constructor calls with c*def/c*sym constructor
calls
git-svn-id: trunk@27361 -
2014-03-29 22:31:55 +00:00
florian
b2b26f84cf
* partially merged the mips-embedded branch of Michael Ring:
...
- startup code/controller units are not merged yet
- assembler call does not pass the needed CPU type yet
git-svn-id: trunk@27188 -
2014-03-19 21:25:38 +00:00
sergei
e163a2c813
* MIPS and SPARC: determine whether case expression is in range using a single unsigned comparison (like it is done on other targets).
...
git-svn-id: trunk@27088 -
2014-03-10 23:02:05 +00:00
Jonas Maebe
4065483a50
* completed thlcgobj.location_force_fpureg(), use it everywhere and removed
...
ncgutil/thlcg2ll.location_force_fpureg()
git-svn-id: trunk@27071 -
2014-03-10 09:01:05 +00:00
sergei
87684e1cf1
* MIPS: clean up
...
git-svn-id: trunk@26946 -
2014-03-04 08:42:45 +00:00
sergei
46f8e78d1f
+ Support GOT/gp-relative constants in GAS and internal assemblers, MIPS and i386.
...
* Change MIPS jump tables in PIC mode to use gp-relative constants, making them ABI-compliant and not requiring dynamic relocations.
git-svn-id: trunk@26886 -
2014-02-26 14:54:47 +00:00
sergei
ed1555b918
* Moved generation of .ent/.end directives out of generic code generator.
...
* Generation of .ent/.end directives for Alpha is dropped, but that target has more important issues to solve.
git-svn-id: trunk@26757 -
2014-02-12 17:30:48 +00:00
sergei
d7c7ee2c2a
* MIPS: fixed 8/16 bit arithmetic shifting to be done without using an additional register.
...
git-svn-id: trunk@26736 -
2014-02-08 21:13:58 +00:00
sergei
d29300df13
* tMIPSELnotnode.second_boolean: reuse common handle_locjump method.
...
git-svn-id: trunk@26735 -
2014-02-08 21:10:01 +00:00
yury
e0c8a4701e
* Fixed compilation for mips-linux.
...
git-svn-id: trunk@26732 -
2014-02-08 19:08:21 +00:00
yury
c58340f8dd
* Enabled safecall for mips.
...
git-svn-id: trunk@26709 -
2014-02-07 14:12:33 +00:00
yury
56b3287e29
+ Added compiler support for mipsel-android target.
...
git-svn-id: trunk@26686 -
2014-02-06 17:02:43 +00:00
sergei
0d3f36eebf
- Remove references to global variable 'cg' from methods of tcg and some of its descendants.
...
git-svn-id: trunk@26665 -
2014-02-03 12:27:48 +00:00
nickysn
85dd9e5789
+ added a size parameter to optimize_op_const and do a sign extension of the 'a' parameter up from the specified size, so that things like (i and $ffffffff) get optimized away the same way as (i and -1)
...
git-svn-id: trunk@26561 -
2014-01-22 15:00:34 +00:00
pierre
5e6669890a
Handle asmextraopt in powerpc, mips and sparc assemblers
...
git-svn-id: trunk@26542 -
2014-01-21 00:19:17 +00:00
sergei
ffba5aee60
* MIPS: emit PIC-friendly instruction sequences instead of "J" when fixing up branches outside of 128K range. Resolves #25399 .
...
git-svn-id: trunk@26215 -
2013-12-11 10:56:07 +00:00
sergei
d72478eb64
* Function tjvmaddnode.cmpnode2topcmp is, in fact, not specific to any target. Moved it to generic tcgaddnode and reused in tmipsaddnode, where the same functionality was implemented in different way.
...
git-svn-id: trunk@26151 -
2013-11-28 11:52:47 +00:00
sergei
e16e19b170
* MIPS: removed specific handling of 32-bit shifts, generic code does the job just well.
...
* Tweak 64-bit shifts to take advantage of 3-address instructions (i.e. don't operate on same register).
git-svn-id: trunk@26142 -
2013-11-27 11:33:52 +00:00
sergei
2a112ad01b
* MIPS: don't optimize reference twice for 64-bit loads and stores. Now loading/storing 64-bit value to global variable takes typically 3 instructions.
...
git-svn-id: trunk@26139 -
2013-11-25 14:27:35 +00:00
sergei
06735eaefc
+ MIPS peephole optimizer: eliminate redundant moves of floating point registers.
...
git-svn-id: trunk@26136 -
2013-11-25 13:57:19 +00:00
sergei
0bef197c84
* MIPS unary minus node: override the entire second_float method, not just emit_float_sign_change. Makes use of two-address neg.d/neg.s instructions, eliminating extra register moves.
...
git-svn-id: trunk@26135 -
2013-11-25 13:54:38 +00:00
pierre
a091c26750
* Use mips everywhere for big endian mips target
...
git-svn-id: trunk@25992 -
2013-11-07 21:38:43 +00:00
sergei
fbf6192aff
* tmipsaddnode.second_addfloat: don't bother reusing locations, always allocate a new register for result.
...
git-svn-id: trunk@25857 -
2013-10-26 18:15:24 +00:00
sergei
dd472dbfb0
* MIPS: when converting int to real, use a floating point constant directly, instead of emulating it with integers. tai_real_64bit already handles all endian issues.
...
git-svn-id: trunk@25856 -
2013-10-26 18:12:25 +00:00
sergei
142d20ca30
* MIPS: cleanup assembler reader, MIPS references allow only a single register in parentheses.
...
git-svn-id: trunk@25768 -
2013-10-13 21:22:04 +00:00
sergei
e10e383b8e
* MIPS: ".set macro"/".set nomacro" directives around ".cprestore" are necessary only when offset is outside smallint range. Otherwise they just clutter the assembler file.
...
git-svn-id: trunk@25767 -
2013-10-13 20:23:43 +00:00
svenbarth
c48d572996
Implement support for saving and restoring address registers.
...
cgobj.pas, tcg:
* g_save_registers: add the amount of used address registers to size as well
* g_save_registers: save all used address registers
* g_restore_registers: restore all stored address registers
m68k/cpubase.pas:
* rename saved_standard_address_registers to saved_address_registers
all other platform's cpubase.{inc,pas} (except alpha, ia64 and vis which are not up to date):
* add a saved_address_registers variable with one entry of RS_INVALID
At least a "make fullcycle" did complete.
git-svn-id: trunk@25664 -
2013-10-05 21:43:42 +00:00
sergei
e7f6b06969
+ MIPS internal linker: support TLS IE/LE and GPREL32 relocations, is now able to link tw14265.
...
git-svn-id: trunk@25181 -
2013-07-29 09:30:40 +00:00
sergei
404c3efa58
* MIPS: handle get_frame internally, so it sets pi_needs_stackframe flag on current procedure. This makes possible not to force pi_needs_stackframe on every procedure and thus omit saving/restoring $fp register when it is not necessary.
...
git-svn-id: trunk@25170 -
2013-07-24 15:25:12 +00:00
sergei
8e6d4b41e2
+ MIPS: started the peephole optimizer.
...
git-svn-id: trunk@25148 -
2013-07-20 13:44:21 +00:00
sergei
9494fadf08
* MIPS: set pi_do_call flag for assembler procedures with stackframes, so in PIC mode it further receives pi_needs_got in PIC mode and allocates the GP save temp.
...
* Deallocate GP save temp in epilogue to avoid warnings when compiled with -dEXTDEBUG
* g_concatcopy: don't check alignment, this allows single byte or word locations to be copied with 2 instructions. Larger unaligned references are supposed to be handled in g_concatcopy_unaligned instead.
git-svn-id: trunk@25147 -
2013-07-20 13:42:41 +00:00
sergei
f80ce76a69
+ MIPS: emulate "flags", i.e. support LOC_FLAGS location. This allows to generate differently optimized code for branching and for conversion to register, typically saving a register and instruction per compare.
...
git-svn-id: trunk@25131 -
2013-07-19 14:06:47 +00:00
sergei
9a6edd0fb8
* MIPS: handle restoring GP after calls without GAS macro processing, removes ugly workaround for GAS bug.
...
git-svn-id: trunk@25130 -
2013-07-19 08:04:06 +00:00
sergei
f49be98507
* MIPS: avoid temp if possible also when converting unsigned 32-bit integers to real.
...
git-svn-id: trunk@25123 -
2013-07-17 11:19:19 +00:00
sergei
c3350d13f9
* MIPS: floating point parameters on stack should be loaded to/from FPU registers directly, without using temp.
...
git-svn-id: trunk@25122 -
2013-07-17 11:00:46 +00:00
sergei
e82ecd66f3
- MIPS: removed target-specific real_to_real conversion, generic code handles it just well.
...
git-svn-id: trunk@25083 -
2013-07-11 08:28:24 +00:00
sergei
1ca2a253e8
MIPS, improved integer to real conversions:
...
* Use fpc_[int64|qword]_to_double instead of [int64|qword]_to_float64, makes RTL no longer dependent on softfloat code.
* Move 32-bit values from integer registers to FPU registers without using memory.
* Fixed branching, was still using a macro and delay slot was missing.
git-svn-id: trunk@25071 -
2013-07-09 14:17:51 +00:00
sergei
faa778b6c7
* MIPS: div/mod and 32-bit shifts: don't bother reusing argument locations, always allocate new register and emit 3-address instructions.
...
* Fixed possible overwrite of LOC_CREGISTER numerator in optimized division by power of 2.
git-svn-id: trunk@25066 -
2013-07-08 11:51:39 +00:00
sergei
9e4cc57768
* MIPS: handle 8 and 16-bit arithmetic shifts internally, by shifting argument left by 24/16 bits, followed with 32-bit arithmetic shift right by appropriately adjusted amount.
...
This approach should be usable for other non-x86 targets as well.
git-svn-id: trunk@25062 -
2013-07-08 08:45:16 +00:00
sergei
59d6df4fca
* MIPS: replaced opcode mapping functions with array, much shorter that way. Separate "overflow" mapping is also no longer needed.
...
* Use SRAV/SRLV/SLLV opcodes for shifts by variable amount.
git-svn-id: trunk@25038 -
2013-07-04 14:26:44 +00:00
sergei
1c84c3edbf
* Fixed label optimizer to work with MIPS, and enabled level 1 optimization for MIPS targets.
...
The difference in branch instruction formats is isolated in function JumpTargetOp, it is a plain function rather than a virtual method, so it can be easily inlined and, after inlining, produces the same code for non-MIPS targets as it was before change.
git-svn-id: trunk@25033 -
2013-07-03 14:40:24 +00:00
sergei
8823574fe2
* MIPS: get rid of DIV and DIVU macros.
...
git-svn-id: trunk@25030 -
2013-07-02 14:28:10 +00:00
sergei
d0ae800da6
+ MIPS: Use INS and EXT instructions for bit manipulations when target CPU type is set to mips32r2.
...
git-svn-id: trunk@25029 -
2013-07-02 14:21:29 +00:00
sergei
828309e61d
- MIPS: removed opcodes that are not in any known documentation.
...
git-svn-id: trunk@25023 -
2013-07-01 06:09:53 +00:00
sergei
7810d6637a
* MIPS: improved 64-bit comparisons by using cg.a_cmp_reg_reg_label, uses less instructions and registers when comparing with zero.
...
git-svn-id: trunk@25008 -
2013-06-28 15:46:17 +00:00
sergei
7a28815182
* r24895 used wrong expression for swapping sides of comparison, and it went undetected by tests. Fixed.
...
git-svn-id: trunk@25007 -
2013-06-28 15:40:37 +00:00
sergei
c855868a3d
* MIPS: get rid of macros in comparison operations, use immediate operands for comparison with constants when possible.
...
+ InternalError if valid GP is needed but pi_needs_got was not set in pass 1.
git-svn-id: trunk@25003 -
2013-06-28 10:22:26 +00:00
sergei
89c9cdf6c4
+ MIPS: implemented parameter location reusing, eliminating second copy of (potentially large) records passed by value. When parameter is passed both in registers and stack, let it have a single LOC_REFERENCE location on callee side, and store relevant registers on stack (into 16-byte area reserved by ABI) early in prologue.
...
git-svn-id: trunk@24970 -
2013-06-25 08:15:17 +00:00
sergei
456f991c51
* MIPS: 3-operand forms of DIV and DIVU are not macros if first operand is $zero.
...
git-svn-id: trunk@24918 -
2013-06-20 13:14:38 +00:00