In my project, I use a MPC8313 and Vxworks. I found that the SNAN will change to QNAN automatically. The demo codes show as below:
void testFloatStart()
{
float Original;
*(uint32*) &Original = 0x7f800001; //SNAN
testFloatNan(Original);
}
void testFloatNan(float temp)
{
float Target;
Target = temp;
}
I hope that the 'Target' is 0x7f800001, but it is 0x7fc00001. I test same codes in other processer, such as A9 or M4. They are ok.
Dear LQ Zhu,
.
Probably this problem is caused by the compiler provided in Vxworks.
After testing this program on MPC8313RDB with CodeWarrior 8.8, the result is as the following.
Original Value: 7f800001
Target Value: 7f800001
Thanks,
Yiping