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/TMS570LS3137: assembly instructions for special math functions

Part Number: TMS570LS3137

Tool/software: TI C/C++ Compiler

Hi,

a customer is using the TI C compiler for the TMS570LS3137 R4F and would like to know if the compiler has internally instruction sets for calculating functions such as Tan() or Pow(). The customer is trying to not use the libraries for this.

The SPNU118R mentions that there are some instructions for math functions.

Thanks,

--Gunter

  • Hi,

    in the document
    www.ti.com/.../spnu118r.pdf

    there is table 4-7 for the build in math functions. Could you give me an example of usage of these functions and how the assembler would resolve these into actual assembly instructions? E.g. $$tan()

    Secondly for the TMS570LS3137 R4F how is e.g. a $$tan() specifically resolved? I want to make sure that the core has the specific instruction capability.


    Thanks,
    --Gunter
  • Hi,

    the customer is using TI ARM CGT v5.1.6
    So we would need to know how the built in math functions resolve for that version and the R4F core specifically.

    Thanks,
    --Gunter
  • Hello Gunter,

    The ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition would be the document that would show the supported instructions from an ARM perspective. It can be accessed at this link  but is only available to registered users.

    From my understanding, Cortex-R4F does not these specific math instructions and only supports single and double-precision add, subtract, multiply, divide, multiply and accumulate, and square root operations as described in the ARM VFPv3 architecture.

    In regard to how the higher level instructions are compiled by the TI code gen tools, this would have to be addressed by the CGT team. As such, I will reassign this to the tools group E2E.

  • Gunter,

    As a follow-on question, why is there a specific requirement from your customer for direct support of the TAN math instruction? Are they concerned with performance and if so, what device are they currently using that supports it?
  • Gunter Schmer said:
    how the assembler would resolve these into actual assembly instructions? E.g. $$tan()

    Those built-in functions are not resolved to assembly instructions.  The input must be constant, and the result is computed at build time.

     

    Gunter Schmer said:
    Could you give me an example of usage of these functions

    Here is simple contrived example ...

    	.data
    
    	.global	table_of_floats
    
    table_of_floats:
    	.float	$$tan(1)  ; approximately 1.56
            ; and so on
    

    Thanks and regards,

    -George