I have a variable:
volatile float *tfv = static_cast<float*>((void*)0x3990);
I have an issue. This code works:
(*tfv) = 1234.5f;
(*tfv) = (*tfv) * 0.0025f;
This also works:
(*tfv) = 1234.5f;
(*tfv) = (*tfv) / 2.0f;
But this causes cores to crash:
(*tfv) = 1234.5f;
(*tfv) = (*tfv) / 400.0f;
In fact performing division crashes the execution inside the cores. The only exception is division by 2 or division by power of twos. The program itself is big, but essentially it stops crashing only after I take out all the places where division is made (square root also crashes).
Does anybody have any ideas why this could be happening? Or how can I replace this line so that it doesn't use division and square root:
b = 1 / (sqrt(a));