This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: combiner: how to compute cost for bit insertion?
- From: Bernd Schmidt <bernds_cb1 at t-online dot de>
- To: Georg-Johann Lay <avr at gjlay dot de>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Tue, 11 Jul 2017 14:26:44 +0200
- Subject: Re: combiner: how to compute cost for bit insertion?
- Authentication-results: sourceware.org; auth=none
- References: <e8737af4-fb89-12b4-a6ec-833e6c244b39@gjlay.de>
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