You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just reading through section_2/float/literals and there is a call to printf, but it looks like only registers x0 and x2 have been set though the format takes an int and two floats. Are the two floats d0 and d1? If so then it's not clear to me by what mechanism they get passed as the third and fourth argument.
Perhaps the passing arguments section could include an example of passing floats?
The text was updated successfully, but these errors were encountered:
Lines 19 through 21 put doubles into d0 and d1. printf %f only prints doubles, by the way. That's why the floats are converted to doubles. Note this code is Linux only. Had it been Mac, x1, d0 and d1 would have to be put on the stack. I will amplify the comments about this code.
Thanks. Part of what confuses me is that in C the floats would be the third and fourth argument which I would have guessed should be d2 and d3 rather than d0 and d1.
Just reading through section_2/float/literals and there is a call to printf, but it looks like only registers
x0
andx2
have been set though the format takes an int and two floats. Are the two floatsd0
andd1
? If so then it's not clear to me by what mechanism they get passed as the third and fourth argument.Perhaps the passing arguments section could include an example of passing floats?
The text was updated successfully, but these errors were encountered: