#include int main(void) { int i = 7; int j = 10; int result = -1; double dtable[2] = { 2.5, 0 }; /* doubles integer value by using vfp in single precision mode asm volatile( "fmsr s0, %1" "\n\t" "fsitos s0, s0" "\n\t" "fadds s1, s0, s0" "\n\t" "ftosis s1, s1" "\n\t" "fmrs %0, s1" "\n\t" : "=r" (result) : "r" (i), "r" (j) : "s0", "s1"); */ /* doubles integer value by using vfp in double precision mode asm volatile( "fmsr s0, %1" "\n\t" "fsitos s0, s0" "\n\t" "fcvtds d0, s0" "\n\t" "faddd d0, d0, d0" "\n\t" "fcvtsd s0, d0" "\n\t" "ftosis s0, s0" "\n\t" "fmrs %0, s0" "\n\t" : "=r" (result) : "r" (i), "r" (j) : "d0", "s0"); printf("result: %i\n", result); */ asm volatile( "ldfd f0, [%1]" "\n\t" "stfd f0, [%1, #8]" "\n\t" "fldd d0, [%1]" "\n\t" "fstd d0, [%1, #8]" "\n\t" : "=r" (result) : "r" (dtable) : "d0", "memory"); printf("result: %d\n", dtable[1]); return result; }