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.

DINT instruction automatically generated

Hi,

I have a loop in my code for C6748 DSP, which is small in size but it is executed a large number of iterations.  I have seen in the assembly generated by the compiler that a pair or DINT/RINT instructions are generated before/after the loop.  So, interrupts are disabled during the loop.  How can I avoid this?

Best Regards,

  Miguel

  • Hi Miguel,

    Thanks for your post.

    Yes, you are right, the compiler may use c674x- specific instructions DINT and RINT to disable and restore interrupts around software-pipelined loops. Basically, The SGIE bit in TSR is used by the DINT and RINT instructions to globally disable and re-enable interrupts. So, SGIE bit contains previous state of GIE bit after execution of a DINT instruction and you can set SGIE bit to 1 so that, global interrupts are enabled by the RINT instruction.

    For more details, please refer section 2.9.15 (TSR) of c674x instruction set reference guide as below to enable/disable global interrupts thru. SGIE bit  

    http://www.ti.com/lit/ug/sprufe8b/sprufe8b.pdf

    By this way, you can save the global interrupts enable thru. SGIE bit.

    Typically, the MUST_ITERATE pragma is used to optimize loop execution  and please refer the c6000 optimizing compiler user guide too and kindly check section 6.9.20.2 for using this pragma & section 7.6.1 for saving the SGIE bit from the doc. below;

    http://www.ti.com/lit/ug/spru187v/spru187v.pdf

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------
    Please click the Verify Answer button on this post if it answers your question.
    -------------------------------------------------------------------------------------------------------