Re: Calculating instruction costs

2013-07-11 Thread Michael Matz
Hi, On Wed, 10 Jul 2013, David Given wrote: > Michael Matz wrote: > [...] > > As you didn't adjust any cost I would guess the high value comes from the > > default implementation of address_cost, which simply uses arithmetic cost, > > and the MULT in there is quite expensive by default. > > >

Re: Calculating instruction costs

2013-07-10 Thread David Given
Michael Matz wrote: [...] > As you didn't adjust any cost I would guess the high value comes from the > default implementation of address_cost, which simply uses arithmetic cost, > and the MULT in there is quite expensive by default. > > See TARGET_ADDRESS_COST in several ports. Oddly, TARGET_A

Re: Calculating instruction costs

2013-07-09 Thread Michael Matz
Hi, On Tue, 9 Jul 2013, David Given wrote: > Trying 8, 9 -> 10: > Successfully matched this instruction: > (set (reg:SI 47 [ *_5 ]) > (mem:SI (plus:SI (mult:SI (reg/v:SI 43 [ b ]) > (const_int 4 [0x4])) > (reg:SI 0 r0 [ a ])) [2 *_5+0 S4 A32])) > rejecting combinat

Re: Calculating instruction costs

2013-07-09 Thread Chung-Ju Wu
2013/7/9, David Given : > I'm working on a gcc backend for an architecture. The architecture has > instructions for indexed array access; so, ld r0, (r1, r2) is equivalent > to r0 = r1[r2] where r1 is a int32_t*. > > I'm representing this in the .md file with the following pattern: > > (define_insn

Re: Calculating instruction costs

2013-07-09 Thread Jay Foad
On 9 July 2013 11:02, David Given wrote: > Right now all the cost macros are left as the default, which is probably > the root of the problem; but I'm having a lot of trouble getting my head > around them. In the interest of actually getting something to work, are > there any ways of using a simpl

Calculating instruction costs

2013-07-09 Thread David Given
I'm working on a gcc backend for an architecture. The architecture has instructions for indexed array access; so, ld r0, (r1, r2) is equivalent to r0 = r1[r2] where r1 is a int32_t*. I'm representing this in the .md file with the following pattern: (define_insn "*si_load_indexed" [ (set