I got intresting situation with following code:
When I run my qemu device witout KVM support I got following results:
command line:android -avd x86 -qemu
But when I run same source without KVM support:
command line:android -avd x86 -qemu -disable-kvm
As I understand this situation, it's happens because in mxcsr register bit (div by zero) is not setted, by why this bit is not setted i don't understand. Any ideas?
System: Linux
Code:
static void DivideByZero() {
// volatile to prevent compiler optimizations.
volatile float zero = 0.0f;
volatile float result __attribute__((unused)) = 123.0f / zero;
}
DivideByZero();
int raised = fetestexcept(FE_DIVBYZERO | FE_OVERFLOW);
ASSERT_TRUE((raised & FE_DIVBYZERO) != 0);
command line:android -avd x86 -qemu
Code:
FE_DIVBYZERO !=0; //and it's ok
command line:android -avd x86 -qemu -disable-kvm
Code:
FE_DIVBYZERO ==0; //and it's not ok
System: Linux