Extracting operands from rtl instructions
Mon Aug 5 17:31:00 GMT 2013
2013/8/6 Abdul Wahid Memon <email@example.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.
According to GCC Internal chapter 10.1:
"The expression code determines how many operands the expression contains,
and what kinds of objects they are."
Also, refer to gcc/rtl.h:
"/* The first element of the operands of this rtx.
The number of operands and their types are controlled
by the `code' field, according to rtl.def. */"
The rtx code/patterns are listed in Chatper 10.
So I think you need to identify rtx code first then
you can determine the number of operands.
More information about the Gcc-help