-
Enhancement
-
Resolution: Unresolved
-
Low
-
Code Generation Tools
-
CODEGEN-10169
-
C2000_22.6.0.LTS
-
default
The compiler manual, in the sub-chapter titled Floating Point Conversion Intrinsics, states that writing code similar to ...
__u32_bits_as_f32(__f32_bits_as_u32(3.14159f) & 0xffff0000)
... means only 1 instruction is used to load the constant, because the low half of the constant is 0.
The attached file contains 4 simple functions that test this construct. These functions compare using the construct to not using it. It is expected the functions that use the construct will use fewer instructions. Build it.
% cl2000 --float_support=fpu32 -o -s file.c
Inspect the resulting assembly file. The functions that use the construct take several more instructions than the ones that do not.