Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-10856

Compiler does not implement 16-bit floating point constants as described in the manual

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Low Low

      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.

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: