This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Fwd: Extracting operands from rtl instructions
- From: Abdul Wahid Memon <engrwahidmemon at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 5 Aug 2013 18:12:38 +0200
- Subject: Fwd: Extracting operands from rtl instructions
- References: <CAM8ts8cZhe7DaYOiXhs0bOMdj+bd5re9W4GDDhqHRLOG5CRJzg at mail dot gmail dot com> <CADj25HO6MBTakTZdgUDfTCRwo_8y4W_hHo=Vr25V2yvLkHekPQ at mail dot gmail dot com> <CAM8ts8e1JZgmuwgK1L1eBXzMjVpSGsDYa-TBvcnJwuV0OKvE9A at mail dot gmail dot com>
---------- Forwarded message ----------
From: Abdul Wahid Memon <engrwahidmemon@gmail.com>
Date: Mon, Aug 5, 2013 at 6:12 PM
Subject: Re: Extracting operands from rtl instructions
To: Chung-Ju Wu <jasonwucj@gmail.com>
Thanks Chung-Ju. But how can I determine the number of operands for
any machine instruction?
Number of operands do vary for various instructions and there must be
some way to determine this number.
Regards
Abdul
On Mon, Aug 5, 2013 at 6:08 PM, Chung-Ju Wu <jasonwucj@gmail.com> wrote:
> 2013/8/4 Abdul Wahid Memon <engrwahidmemon@gmail.com>:
>> Considering the following rtl instructions:
>>
>> (insn 104 457 458 2 (set (reg/v/f:DI 41 r12 [orig:590 dsth ] [590])
>> (reg:DI 5 di [ dsth ])) foo.c:15 62 {*movdi_internal_rex64}
>> (expr_list:REG_DEAD (reg:DI 5 di [ dsth ])
>> (nil)))
>>
>> Is there any function provided to extract the operands of this
>> instructions i.e. di and r12?
>>
>> Regards
>>
>> Abdul
>
> You can use PATTERN(insn) to get inner rtx and then
> use XEXP(rtx, i) to extract operands.
>
> By the way, I suggest you can take a look at GCC Internal
> Chapter10: RTL Representation. You will find a lot of useful
> information of manipulating RTL stuff. :)
>
> Best regards,
> jasonwucj