combiner: how to compute cost for bit insertion?

Bernd Schmidt bernds_cb1@t-online.de
Tue Jul 11 12:26:00 GMT 2017


On 07/10/2017 05:10 PM, Georg-Johann Lay wrote:
> (set (zero_extract:QI (reg/i:QI 24 r24)
>         (const_int 1 [0x1])
>         (const_int 6 [0x6]))
>     (lshiftrt:QI (reg:QI 52)
>         (const_int 6 [0x6])))

> The problem is that the backend only sees
> 
> avr_rtx_costs[bset:combine(266)]=true (size) total=24, outer=set:
> (lshiftrt:QI (reg:QI 52)
>     (const_int 6 [0x6]))

> How can I fix that?

I've thought for a while is that (set (zero_extract)) is a crazy way to
express this kind of operation. This should be

(set (destreg) (bfinsert (input) (bitpos) (len) (value))

Adding an rtx code like that is trivial, but ideally all the code that
understands set of zero_extract would also be updated to understand the
new form.


Bernd



More information about the Gcc mailing list