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.