This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CLA integer performance

Hi,

I was wondering what's the performance difference on the CLA between float comparison and integer comparison ( int, uint, enum etc... ). Is there a big hit? Which documentation would suit me best to answer this question.

Thanks

  • Hi Mosin,

    If you refer to the instruction set for the CLA you get an idea for which assembly functions are available for comparisons and their cycle counts.

    Float compares are single cycle instructions, signed 32-bit integer comparisons are also single cycle, unsigned is not supported on the C compiler

    signed 16 bits are loaded to a working register using the MMOVIZ instruction and the comparison used is 32 bit so no penalty is incurred..and im guessing enums fall in this category(probably 32-bit signed compare, will have to check on this)

  • Hi Vishal,

    How about unsigned 16-bit integer comparisons on the CLA? The compiler seems to support them, but I would like to know how efficient this comparison is.

    Thanks,

    Juan
  • Looks like support for unsigned compares has been added as of 15.9.0.STS, but it will likely be inefficient as there isn't an assembly instruction to do unsigned compares, only signed compares, so it must require multiple instructions (cycles) to compute and reach a decision.

    If i recall there should also be an accompanying advisory that basically warns of its inefficiency - is that the case?

  • Thanks for your reply!
    I am using an old version of the compiler (6.1.4). In this version:
    - Unsigned 32-bit comparisons are not supported
    - Unsigned 16-bit comparisons are supported (no warnings)
    I will soon change to the latest version of the compiler and verify the behaviour again