This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Updating an operand in RTL for a builtin function
- From: Andrew Haley <aph-gcc at littlepinkcloud dot COM>
- To: "Mohamed Shafi" <shafitvm at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 4 May 2007 16:30:12 +0100
- Subject: Re: Updating an operand in RTL for a builtin function
- References: <ba0bd44d0705040530p5adcf059q41918dd3b91d277c@mail.gmail.com>
Mohamed Shafi writes:
> I am trying to implement a builtin function __macf for a private target.
> I have added the required target hooks for this.
> Say for the following code
>
> int main()
> {
> int operand1 = 2;
> int operand2 = 3;
> int operand3 = 4;
> int result;
>
> /* operand3 = operand3 + (operand1 * operand2)*/
>
> result = __macf(operand1, operand2, operand3);
>
> }
>
> Requirement : I need the value of operand3 and result to be same
> after calling the builtin.
> But this is not happening.
What do you mean, exactly? C only has call by value, and gcc's
builtins can only return one value. Builtins don't change their
arguments. If you want to update one of the arguments you'll have to
pass a pointer to the builtin.
I think I must be misunderstanding your question.
Andrew.