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: "Fu, Chao-Ying" <fu at mips dot com>
- To: <gcc at gcc dot gnu dot org>, "Mohamed Shafi" <shafitvm at gmail dot com>
- Cc: "Andrew Haley" <aph-gcc at littlepinkcloud dot com>, "Paul Brook" <paul at codesourcery dot com>, "Dave Korn" <dave dot korn at artimi dot com>
- Date: Fri, 11 May 2007 13:48:41 -0700
- Subject: RE: Updating an operand in RTL for a builtin function
> -----Original Message-----
> From: gcc-owner@gcc.gnu.org [mailto:gcc-owner@gcc.gnu.org]On Behalf Of
> Dave Korn
> Sent: Friday, May 11, 2007 11:32 AM
> To: 'Paul Brook'; gcc@gcc.gnu.org
> Cc: 'Mohamed Shafi'; 'Andrew Haley'
> Subject: RE: Updating an operand in RTL for a builtin function
>
>
> On 11 May 2007 19:27, Paul Brook wrote:
>
> >>> > 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.
> >>
> >> After the builtin i want to have the following operations
> also to carried
> >> out operand3 = result ;
> >
> > Why do you want this to happen?
>
> I think what he means is he wants operand 3 and operand
> zero to be placed in
> the same register, hence the "0" constraint. As to quite why it's not
> working, I don't know. A very similar pattern, only with
> "=&" modifiers on
> operand zero, works fine for me under 3.4.4.
>
>
> cheers,
> DaveK
> --
> Can't think of a witty .sigline today....
>
>
> >>> > result = __macf(operand1, operand2, operand3); >
Since operand3 is passed by value, operand3 should not
be changed for the above code.
Could you re-write your code as this:
"operand3 = __macf(operand1, operand2, operand3);" ?
Then, operand3 will be updated.
Regards,
Chaoy-ing