You are writing an undefined value to FPSCR and savedReg. You want:
asm volatile ("VMSR FPSCR, %0 " : : "r" ( savedReg)); //Restore
Also there is no guarantee that the floating point operations stay between the inline assembler (though volatile
and "memory"
may help), use standalone assembler.