kenshinofkin
Programmer
- Dec 1, 2008
- 1
I am using Cygwin and gcc to create a function that gets the absolute value of a float. Is fabs the instruction to use to get the absolute value?
asm("lea %[nIn],%%edi \n"
"fabs \n"
"mov %%edi,%[nOut] \n"
: [nOut] "=m"
: [nIn] "m"
);
'n' is a double. What do I pass to fabs or does it check a register?
Thanks!
asm("lea %[nIn],%%edi \n"
"fabs \n"
"mov %%edi,%[nOut] \n"
: [nOut] "=m"
: [nIn] "m"
);
'n' is a double. What do I pass to fabs or does it check a register?
Thanks!