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.

Compiler/TMS320F280049: Unified Memory option

Part Number: TMS320F280049

Tool/software: TI C/C++ Compiler

Hello expoert,

I have some questions from our customer

1. In the bellow e2e thread, 

"e2e.ti.com/.../889094

THere is the statement as follows. "If they are dense, which means the values are all close to each other, then a table is used.  If they are not dense, which means the values are far apart, then a table is not used."

Can you please clarify how much close to each other is "dense" and how much apart  is "Not dense"?

2. Are there any impact  to the assembled code by setting the "Unified memory" complier option?

Regards, A.Fujinaka

Regards, A.Fujinaka

  • Akihiko Fujinaka said:
    Can you please clarify how much close to each other is "dense" and how much apart  is "Not dense"?

    It is too difficult to represent exactly how the decision is made.  But I can give you a rough idea.

    Given these terms ...

    • NC - number of switch cases
    • HIGH - value of the highest case
    • LOW - value of the lowest case

    The rough formula is ...

    if (NC > 12 && (HIGH - LOW)/NC > 0.7)
        use a lookup table
    else
        use a series of conditional branches

    Another way to think about it ... A lookup table is used only if the density of the case values exceeds 70%.

    Akihiko Fujinaka said:
    Are there any impact  to the assembled code by setting the "Unified memory" complier option?

    Yes.  If the compiler switch --unified_memory is used, then the compiler generated assembly code that refers to the lookup table is smaller and faster, but not by much.

    Thanks and regards,

    -George

  • Hello George,

    Our customer confirmed they are OK with this answer, thanks for your support.

    Regards, A.Fujinaka