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.

CCSv5 inline UAL assembly



All,

I'm working on getting a library of functions to build for Stellaris under CCS, and am having some difficulty porting over the inline assembly calls the library makes.  The syntax of the assembly calls presently in the library is __FOO(bar), so I have created a header file that redefines each of the calls to match the syntax I believe I need, _foo(bar).  This is working for some commands (specifically, _norm, _smuad, and _smlald), but there are a number of commands that are giving me a "function declared implicitly" warning when trying to compile.  It looks like the commands that are giving me issues are defined in the ARM Unified Assembler Language (clz, ssat, qadd, qsub), so I was hoping that by passing in the --ual flag, the compiler would acknowledge that these are valid assembler instructions and not continue to give me warnings.  Sadly, that is not the case.  Is there something else I need to do to get the compiler to recognize the UAL instructions?  Or is there an option that must be checked somewhere other than the "Use unified assembly language (--ual)" checkbox found in Project Properties->C/C++ Build->Settings->Tool Settings->TMS470 Compiler->Assembler Options?  It is also worth mentioning that I am not using asm statements for this because I need to pass C variables to the instruction, and my understanding is that asm statements can only reference registers.

Any help would be appreciated!

-Jordan Wills

  • Jordan,

    It sounds like you are trying to use compiler intrinsics to achieve these assembly instructions. If so, please see the TMS470 Compiler Users Guide, section 5.12 for the list of intrinsics supported by the TI compiler tools.

  • Thank you very much!  The tables found in section 5.12 of that document are indeed exactly what I was looking for!  I am still having one issue though- The library that I'm porting makes use of the SHASX(dst, src1, src2) instruction, but I am unable to find any reference to this instruction in the compiler users guide.  I see support for the similar SASX (which does the same add-subtract-exchange arithmetic, but doesn't halve the resulting halfwords), and SHADD16 (which performs different halfword arithmetic but still halves the resulting halfwords), but nothing about supporting SHASX.  I think I can figure out a way to replace the SHASX call with a combination of intrinsics, but it would be really helpful if there were support for that specific instruction.  Do you know why SHASX does not appear in the list of intrinsics in section 5.12 of the document you linked?  If not, do you know if there is an alternate method of calling this instruction inline?

    Much obliged,

    Jordan

  • Jordan said:
    Do you know why SHASX does not appear in the list of intrinsics in section 5.12 of the document you linked?  If not, do you know if there is an alternate method of calling this instruction inline?

    It is an error that SHASX is not documented.  This error is being corrected.  This intrinsic is available, but under the name _shaddsubx.  

    Thanks and regards,

    -George