In my C program, I would like to do the following in extended assembler: Divide two floating point numbers (variables), 'numerator' by 'denominator', and put the result in another variable, 'result'. This is my guess of how it would look like, but it does not seem to compile.
float result, numerator, denominator;
asm volatile(" fdiv %2, %1 "
: "=r" (result)
: "1" (numerator), "2" (denominator));
Compiling errors:
example_program.c:66:16: error: matching constraint references invalid operand number
: "1" (numerator), "2" (denominator));
example_program:16: error: matching constraint references invalid operand number
example_program.c:64:3: error: matching constraint references invalid operand number
asm volatile(" fdiv %2, %1 "
^
example_program.c:64:3: error: matching constraint references invalid operand number
make: *** [<builtin>: example_program] Error 1