-
Bug
-
Resolution: Unresolved
-
Low
-
Code Generation Tools
-
CODEGEN-10816
-
-
default
The attached C file has this small program ...
#include <stdio.h> int main(void) { float f1, f2; f1 = 1.75e+34f; f2 = -1.96e-07f; printf("expect negative infinity, get %g\n", f1/f2); f1 = 1.0f; f2 = 0.0f; printf("expect 0x7f7fffff, get 0x%lx\n", __f32_bits_as_u32(f1/f2)); f1 = -1.0f; f2 = 0.0f; printf("expect 0xff7fffff, get 0x%lx\n", __f32_bits_as_u32(f1/f2)); return 0; }
Build with no optimization, so the RTS function for 32-bit floating point divide is called.
When it runs, this is the output ...
expect negative infinity, get 2.35099e-38 expect 0x7f7fffff, get 0x7f7f0000 expect 0xff7fffff, get 0xff7f0000