On 3/18/25 10:23 AM, Luis Silva wrote:
This patch handles both signed and unsigned
builtin multiplication overflow.

Uses the "mpy.f" instruction to set the condition
codes based on the result.  In the event of an
overflow, the V flag is set, triggering a
conditional move depending on the V flag status.

For example, set "1" to "r0" in case of overflow:

        mov_s   r0,1
        mpy.f   r0,r0,r1
        j_s.d   [blink]
        mov.nv  r0,0

gcc/ChangeLog:

         * config/arc/arc.md (<su_optab>mulvsi4): New define_expand.
         (<su_optab>mulsi3_Vcmp): New define_insn.
So similar to your other patch, there are other attributes (cond and predicable) that you may need to set. I just don't know the port well enough to judge that.

jeff

Reply via email to