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
687bb15299
* renamed getdatalabel() to getglobaldatalabel
...
git-svn-id: branches/hlcgllvm@30336 -
2015-03-27 21:25:34 +00:00
Jonas Maebe
bd203a5b57
* synchronised with trunk till r30240
...
git-svn-id: branches/hlcgllvm@30241 -
2015-03-15 19:44:58 +00:00
Jonas Maebe
67b8aceaee
* synchronized with privatetrunk till r30095
...
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
Jeppe Johansen
901275b4a1
Switch back to emitting BLX instructions and fix calculation of constant offsets(should rarely/never happen).
...
Add missing fields to other elf targets.
git-svn-id: branches/laksen/armiw@29286 -
2014-12-14 16:28:35 +00:00
florian
5c67fcc43f
+ change always floating point divisions into multiplications if they are a power of two,
...
this is an exact operation so it is always allowed
* change only divisions by normal numbers into multiplications
git-svn-id: trunk@29085 -
2014-11-16 20:47:38 +00:00
Tomas Hajny
3ee3542744
* boolean constant instead of IFDEFs for detection of microcontroller support
...
git-svn-id: trunk@29052 -
2014-11-10 12:34:59 +00:00
sergei
b70c5efa65
* SPARC peephole: check that result of GetNextInstructionUsingReg is actually an instruction, because GetNextInstruction can stop at a label. Resolves #26798 .
...
The same issue on MIPS targets was fixed by r28380, but I forgot to apply it also to SPARC.
git-svn-id: trunk@28722 -
2014-09-28 22:18:59 +00:00
Károly Balogh
0cf7357ee2
* fix GetResFlags DFA optimizer warning on Sparc and AVR too
...
git-svn-id: trunk@28500 -
2014-08-20 13:52:28 +00:00
Jonas Maebe
b745dcc64c
* moved g_external_wrapper() to the hlcg, and also g_intf_wrapper() because
...
for some platforms it depends on that routine
git-svn-id: branches/hlcgllvm@28492 -
2014-08-19 20:22:54 +00:00
Jonas Maebe
5c75b6dd6b
* synchronised with trunk up till r28402
...
git-svn-id: branches/hlcgllvm@28403 -
2014-08-13 16:04:30 +00:00
sergei
e4fea2ebc8
* Dummy implementations of a_bit_scan_reg_reg and g_stackpointer_alloc in tcg, removes the need to override these methods in every descendant code generator solely to avoid "constructing a class with abstract method" warning.
...
git-svn-id: trunk@28175 -
2014-07-06 11:34:04 +00:00
Jonas Maebe
7949bebb8d
* synchronised with r28168 of trunk
...
git-svn-id: branches/hlcgllvm@28169 -
2014-07-05 21:30:28 +00:00
Jonas Maebe
1516661249
+ new chlcgobj class reference variable that can be used to call thlcg*
...
virtual methods even when hlcg doesn't contain a valid instance
git-svn-id: branches/hlcgllvm@28143 -
2014-07-03 22:28:31 +00:00
sergei
77d97303a9
* SPARC: cleanup and simplify 64-bit code generator. Call cg.a_op64_const_reg_reg where possible to make use of its optimization abilities.
...
git-svn-id: trunk@27985 -
2014-06-16 19:22:52 +00:00
sergei
51f6092672
* SPARC: OP_NOT can always be done in 32 bits, because for 8 and 16-bit operations the high bits of result are adjusted immediately afterwards.
...
* "carry clear" flag can be converted into register using a single instruction.
git-svn-id: trunk@27984 -
2014-06-16 19:15:01 +00:00
Jonas Maebe
bacd303208
* synchronized with trunk up to r27758
...
git-svn-id: branches/hlcgllvm@27779 -
2014-05-12 16:12:34 +00:00
sergei
f20b6c73ef
* SPARC: convert carry flag into register without branching.
...
git-svn-id: trunk@27619 -
2014-04-20 19:30:59 +00:00
sergei
f3801d13de
* SPARC: cleaned up and actualized TAsmCond (stuff copy-pasted from x86 removed, conditions for unordered floating-point comparisons added). Fixes Mantis #9362 on this target.
...
git-svn-id: trunk@27593 -
2014-04-17 14:15:45 +00:00
sergei
58882e2934
* SPARC: UNIMP instruction has 22-bit "opcode", not 12-bit.
...
git-svn-id: trunk@27592 -
2014-04-17 14:08:33 +00:00
svenbarth
02495c17bd
Fix a typo. The CPU specific version of "ttypesym" should be called "tcputypesym" and not "tcpuypesym".
...
git-svn-id: trunk@27531 -
2014-04-11 14:30:59 +00:00
Jonas Maebe
d452686c39
* moved pbestrealtype from symdef to symcpu
...
git-svn-id: trunk@27441 -
2014-04-01 21:41:37 +00:00
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
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
Jonas Maebe
e9268a0a14
* synchronised with trunk up till r26975
...
git-svn-id: branches/hlcgllvm@26976 -
2014-03-06 21:36:58 +00:00
sergei
2c02e8a726
- i386, x86_64, SPARC: removed paramanager.getintparaloc overrides, it is handled by generic implementation since r24716.
...
(This probably can be removed for all targets, but I don't want to do it without prior testing).
git-svn-id: trunk@26870 -
2014-02-24 16:01:14 +00:00
sergei
da910d654c
+ SPARC: two more peephole optimizations
...
git-svn-id: trunk@26795 -
2014-02-16 12:29:31 +00:00
sergei
534ecbda9f
* SPARC: r26561 caused a_op_const_reg_reg used for zero-extending 8-bit values to be optimized away. Fixed by replacing it with an explicit instruction.
...
git-svn-id: trunk@26566 -
2014-01-22 21:37:37 +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
sergei
ab44638635
+ SPARC: initial peephole optimizer.
...
git-svn-id: trunk@26555 -
2014-01-21 14:22:59 +00:00
sergei
cda81e1d18
* SPARC: emit "x shl 1" as "x+x", it yields shorter code.
...
git-svn-id: trunk@26553 -
2014-01-21 13:50:35 +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
c673c32ad9
+ SPARC: generate position-independent case jump tables, as specified by ABI.
...
Generate them also for non-PIC mode: absolute code is just 2 instructions shorter, trying to save them is probably not worth the effort.
git-svn-id: trunk@26468 -
2014-01-15 15:31:53 +00:00
sergei
720b9bf560
* SPARC: reworked 64-bit comparisons so their result is always in flags. Comparisons are emitted as subtractions, sides are optionally swapped to avoid using Z flag (since it is not set correctly in multi-word subtraction). This generates significantly shorter code: when both sides are in registers it is just 3 instructions for equal/unequal and 2 instructions otherwise.
...
git-svn-id: trunk@26433 -
2014-01-12 15:11:47 +00:00
sergei
d2a9308181
+ SPARC: implemented register spill replacement.
...
git-svn-id: trunk@26364 -
2014-01-03 08:14:43 +00:00
sergei
0afd95e840
* SPARC, tmoddivnode improvements/fixes:
...
* don't bother reusing locations
* don't optimize division into shift if overflow checking is enabled
* if denominator is a constant and fits into 13 bit range, use it directly and save a register.
git-svn-id: trunk@26363 -
2014-01-03 08:09:32 +00:00
sergei
36d0c8a5a7
* x86 and SPARC: fixed handling 64-bit (qwordbool) values in tcgnotnode (partial fix for Mantis #25255 ).
...
* Moved handling LOC_JUMP locations to helper method of base class, it appears to be the same for all targets.
git-svn-id: trunk@26353 -
2014-01-02 10:29:44 +00:00
sergei
471d0a5164
+ SPARC: support optimized 32x32 to 64 bit multiplications.
...
git-svn-id: trunk@26331 -
2013-12-30 23:40:47 +00:00
sergei
4168388235
+ SPARC: support 8 and 16-bit arithmetic shifts.
...
git-svn-id: trunk@26330 -
2013-12-30 23:37:21 +00:00
sergei
63c1a05718
* SPARC: Removed hacks with g1_used that were used for g_intf_wrapper to be operational without initialized reg.allocator, and replaced them with a proper solution (which is basically a clone from MIPS cg).
...
git-svn-id: trunk@26321 -
2013-12-30 13:08:51 +00:00
sergei
05489d6e05
* SPARC: fixed g_intf_wrapper for non-virtual methods once again, my initial assumption was not correct: a wrapper does not necessarily reference methods from the class that implements the interface, it may be methods from parent classes, which can be located arbitrarily far away in address space.
...
Now using code from g_external_wrapper, which has no distance limit and is only one instruction longer.
git-svn-id: trunk@26319 -
2013-12-30 11:51:57 +00:00
sergei
bf94257310
* SPARC: simplified and fixed a_load_const_reg method, was generating redundant instructions for constants with non-zero bits 10..12.
...
git-svn-id: trunk@26318 -
2013-12-30 09:59:41 +00:00
sergei
34cde7a07a
* SPARC, tsparcaddnode.second_cmp64bit: don't copy LOC_CREGISTER locations, and handle comparison with constants without loading them into register (if possible).
...
git-svn-id: trunk@26309 -
2013-12-29 10:12:19 +00:00
sergei
f8a60522d4
- SPARC: removed 3 code generator methods, they provide no difference in generated code from generic code generator.
...
git-svn-id: trunk@26307 -
2013-12-29 10:00:09 +00:00
sergei
d70a880f33
* SPARC: properly justify parameters on stack with size less than 4, fixes failure on tests/cg/tcalext5.pp
...
git-svn-id: trunk@26294 -
2013-12-28 09:23:10 +00:00
sergei
176d8434e4
* SPARC: completely rewrote PIC-related code, got it twice shorter in source lines and much less instructions in generated code.
...
+ Enable registers %i0..%i5 and %o7 for use by reg.allocator.
Some notable properties of this implementation are:
o pi_needs_got flag can be safely set during pass 2, so not setting it occasionally in pass 1 does not result in internal error.
o Reg.allocator configuration is independent from PIC. If procedure requires GOT, register %l7 is allocated at the prologue, making it unavailable to RA.
o GOT is stored in fixed %l7 register, but it is trivial to switch over to virtual register.
git-svn-id: trunk@26293 -
2013-12-27 19:53:38 +00:00
sergei
eaba90dda7
* SPARC: since peephole optimizer recognizes only one conditional branching instruction, generate all branches using A_Bxx opcode, and change it to A_FBxx if necessary when writing assembler. This enables optimization of floating-point branches.
...
* Assembler reader: rewrote branch condition matching part, don't try to match integer suffixes to floating-point branches and vice versa.
git-svn-id: trunk@26290 -
2013-12-27 06:45:49 +00:00
sergei
890d757573
+ SPARC: override g_external_wrapper method and emit PIC-safe jump without distance limit. Mantis #25455 .
...
git-svn-id: trunk@26286 -
2013-12-26 07:37:22 +00:00