> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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

Reply via email to